react-semaphor 0.0.392 → 0.0.393

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.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { c as R, p as It, u as D, a as Xe, b as Te, d as Mt, e as Tt, B as z, P as Ye, f as Dt, g as zt, h as Lt, i as na, L as $, I as he, j as sa, k as la, l as ia, m as ra, n as oa, o as ca, q as xn, r as Ut, s as ee, C as ht, t as vn, v as m, w as Nn, x as Cn, y as da, F as ua, z as Ke, A as lt, E as Re, G as _e, H as Sn, J as He, K as ha, M as ma, N as Qe, O as pa, Q as fa, R as ga, S as ya, T as ba, U as xa, V as wn, W as va, X as me, Y as pe, Z as fe, _ as ge, $ as ke, a0 as Ce, a1 as Q, a2 as Ft, a3 as Na, a4 as Ca, a5 as Sa, a6 as wa, a7 as ka, a8 as ve, a9 as kn, aa as On, ab as Oa, ac as In, ad as Mn, ae as Tn, af as Ia, ag as Me, ah as Dn, ai as je, aj as it, ak as Nt, al as De, am as Ve, an as Oe, ao as zn, ap as ie, aq as Ln, ar as Fn, as as Jt, at as An, au as et, av as En, aw as Vn, ax as qn, ay as jn, az as Rn, aA as xt, aB as _n, aC as Hn, aD as Le, aE as Ma, aF as Pn, aG as mt, aH as $n, aI as Gn, aJ as Bn, aK as Ct, aL as Un, aM as rt, aN as we, aO as ot, aP as Jn, aQ as Wn, aR as Kn, aS as Qn, aT as vt, aU as Zn, aV as Wt, aW as Xn, aX as Kt, aY as Yn, aZ as es, a_ as ts, a$ as as, b0 as Ta, b1 as ns, b2 as At, b3 as Da, b4 as ss, b5 as ls, b6 as st, b7 as is, b8 as rs, b9 as za, ba as os, bb as cs, bc as ds, bd as us, be as hs, bf as pt, bg as La, bh as ms, bi as Fa, bj as Aa, bk as St, bl as wt, bm as ps, bn as fs, bo as gs, bp as ys, bq as bs, br as xs, bs as vs, bt as Ns, bu as Cs, bv as Ss, bw as ft, bx as ze, by as ws, bz as Ue, bA as Et, bB as Ea, bC as ks, bD as Os, bE as ct, bF as Is, bG as Ms, bH as Ts, bI as Ds, bJ as Qt, bK as Zt, bL as Va, bM as zs, bN as Ls, bO as Fe, bP as te, bQ as ae, bR as Vt, bS as ne, bT as Fs, bU as qa, bV as As, bW as Es, bX as Vs, bY as qs, bZ as js, b_ as Rs, b$ as _s, c0 as Hs, c1 as Ps } from "./chunks/index-BukQhzs1.js";
2
- import { D as Zi, c6 as Xi, c4 as Yi, c4 as er, c8 as tr, c7 as ar, c9 as nr, c5 as sr, c2 as lr, c3 as ir } from "./chunks/index-BukQhzs1.js";
1
+ import { c as j, p as It, u as D, a as Xe, b as Te, d as Mt, e as Tt, B as z, P as Ye, f as Dt, g as zt, h as Lt, i as na, L as $, I as he, j as sa, k as la, l as ra, m as ia, n as oa, o as ca, q as vn, r as Ut, s as ee, C as ht, t as Nn, v as m, w as Cn, x as Sn, y as da, F as ua, z as Ke, A as lt, E as Re, G as _e, H as wn, J as He, K as ha, M as ma, N as Qe, O as pa, Q as fa, R as ga, S as ya, T as ba, U as xa, V as kn, W as va, X as me, Y as pe, Z as fe, _ as ge, $ as ke, a0 as Ce, a1 as Q, a2 as Ft, a3 as Na, a4 as Ca, a5 as Sa, a6 as wa, a7 as ka, a8 as ve, a9 as On, aa as In, ab as Oa, ac as Mn, ad as Tn, ae as Dn, af as Ia, ag as Me, ah as zn, ai as je, aj as rt, ak as Nt, al as De, am as Ve, an as Oe, ao as Ln, ap as re, aq as Fn, ar as An, as as Jt, at as En, au as et, av as Vn, aw as qn, ax as jn, ay as Rn, az as _n, aA as Hn, aB as xt, aC as Pn, aD as $n, aE as Le, aF as Ma, aG as Gn, aH as mt, aI as Bn, aJ as Un, aK as Jn, aL as Ct, aM as Wn, aN as it, aO as we, aP as ot, aQ as Kn, aR as Qn, aS as Zn, aT as Xn, aU as vt, aV as Yn, aW as Wt, aX as es, aY as Kt, aZ as ts, a_ as as, a$ as ns, b0 as ss, b1 as Ta, b2 as ls, b3 as At, b4 as Da, b5 as rs, b6 as is, b7 as st, b8 as os, b9 as cs, ba as za, bb as ds, bc as us, bd as hs, be as ms, bf as ps, bg as pt, bh as La, bi as fs, bj as Fa, bk as Aa, bl as St, bm as wt, bn as gs, bo as ys, bp as bs, bq as Ea, br as xs, bs as vs, bt as Ns, bu as Cs, bv as Ss, bw as ft, bx as ze, by as ws, bz as Ue, bA as Et, bB as Va, bC as ks, bD as Os, bE as ct, bF as Is, bG as Ms, bH as Ts, bI as Ds, bJ as Qt, bK as Zt, bL as qa, bM as zs, bN as Ls, bO as Fe, bP as te, bQ as ae, bR as Vt, bS as ne, bT as Fs, bU as ja, bV as As, bW as Es, bX as Vs, bY as qs, bZ as js, b_ as Rs, b$ as _s, c0 as Hs, c1 as Ps } from "./chunks/index-1ZJ3im1i.js";
2
+ import { D as Zr, c6 as Xr, c4 as Yr, c4 as ei, c8 as ti, c7 as ai, c9 as ni, c5 as si, c2 as li, c3 as ri } from "./chunks/index-1ZJ3im1i.js";
3
3
  import { jsxs as n, jsx as e, Fragment as le } from "react/jsx-runtime";
4
4
  import * as qe from "react";
5
- import Ie, { useState as P, useMemo as kt, useEffect as de, useRef as Je, useCallback as ja, Suspense as $s } from "react";
5
+ import Ie, { useState as H, useMemo as kt, useEffect as de, useRef as Je, useCallback as Ra, Suspense as $s } from "react";
6
6
  import "react-dom";
7
7
  /**
8
8
  * @license lucide-react v0.453.0 - ISC
@@ -10,7 +10,7 @@ import "react-dom";
10
10
  * This source code is licensed under the ISC license.
11
11
  * See the LICENSE file in the root directory of this source tree.
12
12
  */
13
- const Gs = R("BookOpenText", [
13
+ const Gs = j("BookOpenText", [
14
14
  ["path", { d: "M12 7v14", key: "1akyts" }],
15
15
  ["path", { d: "M16 12h2", key: "7q9ll5" }],
16
16
  ["path", { d: "M16 8h2", key: "msurwy" }],
@@ -30,7 +30,7 @@ const Gs = R("BookOpenText", [
30
30
  * This source code is licensed under the ISC license.
31
31
  * See the LICENSE file in the root directory of this source tree.
32
32
  */
33
- const Bs = R("BookType", [
33
+ const Bs = j("BookType", [
34
34
  ["path", { d: "M10 13h4", key: "ytezjc" }],
35
35
  ["path", { d: "M12 6v7", key: "1f6ttz" }],
36
36
  ["path", { d: "M16 8V6H8v2", key: "x8j6u4" }],
@@ -48,7 +48,7 @@ const Bs = R("BookType", [
48
48
  * This source code is licensed under the ISC license.
49
49
  * See the LICENSE file in the root directory of this source tree.
50
50
  */
51
- const Us = R("Box", [
51
+ const Us = j("Box", [
52
52
  [
53
53
  "path",
54
54
  {
@@ -65,7 +65,7 @@ const Us = R("Box", [
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 Js = R("Braces", [
68
+ const Js = j("Braces", [
69
69
  [
70
70
  "path",
71
71
  { d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1", key: "ezmyqa" }
@@ -84,7 +84,7 @@ const Js = R("Braces", [
84
84
  * This source code is licensed under the ISC license.
85
85
  * See the LICENSE file in the root directory of this source tree.
86
86
  */
87
- const Ws = R("ChartArea", [
87
+ const Ws = j("ChartArea", [
88
88
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
89
89
  [
90
90
  "path",
@@ -100,7 +100,7 @@ const Ws = R("ChartArea", [
100
100
  * This source code is licensed under the ISC license.
101
101
  * See the LICENSE file in the root directory of this source tree.
102
102
  */
103
- const qt = R("ChartColumnIncreasing", [
103
+ const qt = j("ChartColumnIncreasing", [
104
104
  ["path", { d: "M13 17V9", key: "1fwyjl" }],
105
105
  ["path", { d: "M18 17V5", key: "sfb6ij" }],
106
106
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
@@ -112,7 +112,7 @@ const qt = R("ChartColumnIncreasing", [
112
112
  * This source code is licensed under the ISC license.
113
113
  * See the LICENSE file in the root directory of this source tree.
114
114
  */
115
- const Ra = R("ChartColumnStacked", [
115
+ const _a = j("ChartColumnStacked", [
116
116
  ["path", { d: "M11 13H7", key: "t0o9gq" }],
117
117
  ["path", { d: "M19 9h-4", key: "rera1j" }],
118
118
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
@@ -125,7 +125,7 @@ const Ra = R("ChartColumnStacked", [
125
125
  * This source code is licensed under the ISC license.
126
126
  * See the LICENSE file in the root directory of this source tree.
127
127
  */
128
- const jt = R("ChartLine", [
128
+ const jt = j("ChartLine", [
129
129
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
130
130
  ["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
131
131
  ]);
@@ -135,7 +135,7 @@ const jt = R("ChartLine", [
135
135
  * This source code is licensed under the ISC license.
136
136
  * See the LICENSE file in the root directory of this source tree.
137
137
  */
138
- const _a = R("ChartNoAxesGantt", [
138
+ const Ha = j("ChartNoAxesGantt", [
139
139
  ["path", { d: "M8 6h10", key: "9lnwnk" }],
140
140
  ["path", { d: "M6 12h9", key: "1g9pqf" }],
141
141
  ["path", { d: "M11 18h7", key: "c8dzvl" }]
@@ -146,7 +146,7 @@ const _a = R("ChartNoAxesGantt", [
146
146
  * This source code is licensed under the ISC license.
147
147
  * See the LICENSE file in the root directory of this source tree.
148
148
  */
149
- const Ha = R("ChartPie", [
149
+ const Pa = j("ChartPie", [
150
150
  [
151
151
  "path",
152
152
  {
@@ -162,7 +162,7 @@ const Ha = R("ChartPie", [
162
162
  * This source code is licensed under the ISC license.
163
163
  * See the LICENSE file in the root directory of this source tree.
164
164
  */
165
- const Pa = R("ChartScatter", [
165
+ const $a = j("ChartScatter", [
166
166
  ["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
167
167
  ["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
168
168
  ["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
@@ -176,7 +176,7 @@ const Pa = R("ChartScatter", [
176
176
  * This source code is licensed under the ISC license.
177
177
  * See the LICENSE file in the root directory of this source tree.
178
178
  */
179
- const Ks = R("CircleX", [
179
+ const Ks = j("CircleX", [
180
180
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
181
181
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
182
182
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
@@ -187,7 +187,7 @@ const Ks = R("CircleX", [
187
187
  * This source code is licensed under the ISC license.
188
188
  * See the LICENSE file in the root directory of this source tree.
189
189
  */
190
- const Qs = R("Columns3", [
190
+ const Qs = j("Columns3", [
191
191
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
192
192
  ["path", { d: "M9 3v18", key: "fh3hqa" }],
193
193
  ["path", { d: "M15 3v18", key: "14nvp0" }]
@@ -198,7 +198,7 @@ const Qs = R("Columns3", [
198
198
  * This source code is licensed under the ISC license.
199
199
  * See the LICENSE file in the root directory of this source tree.
200
200
  */
201
- const Zs = R("CopyPlus", [
201
+ const Zs = j("CopyPlus", [
202
202
  ["line", { x1: "15", x2: "15", y1: "12", y2: "18", key: "1p7wdc" }],
203
203
  ["line", { x1: "12", x2: "18", y1: "15", y2: "15", key: "1nscbv" }],
204
204
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
@@ -210,7 +210,7 @@ const Zs = R("CopyPlus", [
210
210
  * This source code is licensed under the ISC license.
211
211
  * See the LICENSE file in the root directory of this source tree.
212
212
  */
213
- const Xs = R("Database", [
213
+ const Xs = j("Database", [
214
214
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
215
215
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
216
216
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
@@ -221,7 +221,7 @@ const Xs = R("Database", [
221
221
  * This source code is licensed under the ISC license.
222
222
  * See the LICENSE file in the root directory of this source tree.
223
223
  */
224
- const $a = R("Donut", [
224
+ const Ga = j("Donut", [
225
225
  [
226
226
  "path",
227
227
  {
@@ -237,7 +237,7 @@ const $a = R("Donut", [
237
237
  * This source code is licensed under the ISC license.
238
238
  * See the LICENSE file in the root directory of this source tree.
239
239
  */
240
- const Ga = R("EllipsisVertical", [
240
+ const Ba = j("EllipsisVertical", [
241
241
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
242
242
  ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
243
243
  ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
@@ -248,7 +248,7 @@ const Ga = R("EllipsisVertical", [
248
248
  * This source code is licensed under the ISC license.
249
249
  * See the LICENSE file in the root directory of this source tree.
250
250
  */
251
- const Ys = R("Eraser", [
251
+ const Ys = j("Eraser", [
252
252
  [
253
253
  "path",
254
254
  {
@@ -265,7 +265,7 @@ const Ys = R("Eraser", [
265
265
  * This source code is licensed under the ISC license.
266
266
  * See the LICENSE file in the root directory of this source tree.
267
267
  */
268
- const el = R("EyeClosed", [
268
+ const el = j("EyeClosed", [
269
269
  ["path", { d: "m15 18-.722-3.25", key: "1j64jw" }],
270
270
  ["path", { d: "M2 8a10.645 10.645 0 0 0 20 0", key: "1e7gxb" }],
271
271
  ["path", { d: "m20 15-1.726-2.05", key: "1cnuld" }],
@@ -278,7 +278,7 @@ const el = R("EyeClosed", [
278
278
  * This source code is licensed under the ISC license.
279
279
  * See the LICENSE file in the root directory of this source tree.
280
280
  */
281
- const tl = R("FileJson2", [
281
+ const tl = j("FileJson2", [
282
282
  ["path", { d: "M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4", key: "1pf5j1" }],
283
283
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
284
284
  [
@@ -296,7 +296,7 @@ const tl = R("FileJson2", [
296
296
  * This source code is licensed under the ISC license.
297
297
  * See the LICENSE file in the root directory of this source tree.
298
298
  */
299
- const al = R("Glasses", [
299
+ const al = j("Glasses", [
300
300
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
301
301
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
302
302
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -309,7 +309,7 @@ const al = R("Glasses", [
309
309
  * This source code is licensed under the ISC license.
310
310
  * See the LICENSE file in the root directory of this source tree.
311
311
  */
312
- const nl = R("Grid3x3", [
312
+ const nl = j("Grid3x3", [
313
313
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
314
314
  ["path", { d: "M3 9h18", key: "1pudct" }],
315
315
  ["path", { d: "M3 15h18", key: "5xshup" }],
@@ -322,7 +322,7 @@ const nl = R("Grid3x3", [
322
322
  * This source code is licensed under the ISC license.
323
323
  * See the LICENSE file in the root directory of this source tree.
324
324
  */
325
- const sl = R("Hammer", [
325
+ const sl = j("Hammer", [
326
326
  ["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
327
327
  ["path", { d: "m18 15 4-4", key: "16gjal" }],
328
328
  [
@@ -339,7 +339,7 @@ const sl = R("Hammer", [
339
339
  * This source code is licensed under the ISC license.
340
340
  * See the LICENSE file in the root directory of this source tree.
341
341
  */
342
- const ll = R("Hash", [
342
+ const ll = j("Hash", [
343
343
  ["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
344
344
  ["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
345
345
  ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
@@ -351,7 +351,7 @@ const ll = R("Hash", [
351
351
  * This source code is licensed under the ISC license.
352
352
  * See the LICENSE file in the root directory of this source tree.
353
353
  */
354
- const il = R("House", [
354
+ const rl = j("House", [
355
355
  ["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
356
356
  [
357
357
  "path",
@@ -367,7 +367,7 @@ const il = R("House", [
367
367
  * This source code is licensed under the ISC license.
368
368
  * See the LICENSE file in the root directory of this source tree.
369
369
  */
370
- const rl = R("LayoutList", [
370
+ const il = j("LayoutList", [
371
371
  ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
372
372
  ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }],
373
373
  ["path", { d: "M14 4h7", key: "3xa0d5" }],
@@ -381,7 +381,7 @@ const rl = R("LayoutList", [
381
381
  * This source code is licensed under the ISC license.
382
382
  * See the LICENSE file in the root directory of this source tree.
383
383
  */
384
- const ol = R("ListEnd", [
384
+ const ol = j("ListEnd", [
385
385
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
386
386
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
387
387
  ["path", { d: "M10 18H3", key: "13769t" }],
@@ -394,7 +394,7 @@ const ol = R("ListEnd", [
394
394
  * This source code is licensed under the ISC license.
395
395
  * See the LICENSE file in the root directory of this source tree.
396
396
  */
397
- const cl = R("ListStart", [
397
+ const cl = j("ListStart", [
398
398
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
399
399
  ["path", { d: "M16 18H3", key: "12xzn7" }],
400
400
  ["path", { d: "M10 6H3", key: "lf8lx7" }],
@@ -407,7 +407,7 @@ const cl = R("ListStart", [
407
407
  * This source code is licensed under the ISC license.
408
408
  * See the LICENSE file in the root directory of this source tree.
409
409
  */
410
- const dl = R("ListX", [
410
+ const dl = j("ListX", [
411
411
  ["path", { d: "M11 12H3", key: "51ecnj" }],
412
412
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
413
413
  ["path", { d: "M16 18H3", key: "12xzn7" }],
@@ -420,7 +420,7 @@ const dl = R("ListX", [
420
420
  * This source code is licensed under the ISC license.
421
421
  * See the LICENSE file in the root directory of this source tree.
422
422
  */
423
- const Ze = R("LoaderCircle", [
423
+ const Ze = j("LoaderCircle", [
424
424
  ["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
425
425
  ]);
426
426
  /**
@@ -429,7 +429,7 @@ const Ze = R("LoaderCircle", [
429
429
  * This source code is licensed under the ISC license.
430
430
  * See the LICENSE file in the root directory of this source tree.
431
431
  */
432
- const ul = R("Logs", [
432
+ const ul = j("Logs", [
433
433
  ["path", { d: "M13 12h8", key: "h98zly" }],
434
434
  ["path", { d: "M13 18h8", key: "oe0vm4" }],
435
435
  ["path", { d: "M13 6h8", key: "15sg57" }],
@@ -446,7 +446,7 @@ const ul = R("Logs", [
446
446
  * This source code is licensed under the ISC license.
447
447
  * See the LICENSE file in the root directory of this source tree.
448
448
  */
449
- const Ba = R("Map", [
449
+ const Ua = j("Map", [
450
450
  [
451
451
  "path",
452
452
  {
@@ -463,7 +463,7 @@ const Ba = R("Map", [
463
463
  * This source code is licensed under the ISC license.
464
464
  * See the LICENSE file in the root directory of this source tree.
465
465
  */
466
- const hl = R("MessageSquareMore", [
466
+ const hl = j("MessageSquareMore", [
467
467
  ["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" }],
468
468
  ["path", { d: "M8 10h.01", key: "19clt8" }],
469
469
  ["path", { d: "M12 10h.01", key: "1nrarc" }],
@@ -475,7 +475,7 @@ const hl = R("MessageSquareMore", [
475
475
  * This source code is licensed under the ISC license.
476
476
  * See the LICENSE file in the root directory of this source tree.
477
477
  */
478
- const ml = R("Network", [
478
+ const ml = j("Network", [
479
479
  ["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
480
480
  ["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
481
481
  ["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
@@ -488,7 +488,7 @@ const ml = R("Network", [
488
488
  * This source code is licensed under the ISC license.
489
489
  * See the LICENSE file in the root directory of this source tree.
490
490
  */
491
- const pl = R("Plug2", [
491
+ const pl = j("Plug2", [
492
492
  ["path", { d: "M9 2v6", key: "17ngun" }],
493
493
  ["path", { d: "M15 2v6", key: "s7yy2p" }],
494
494
  ["path", { d: "M12 17v5", key: "bb1du9" }],
@@ -501,7 +501,7 @@ const pl = R("Plug2", [
501
501
  * This source code is licensed under the ISC license.
502
502
  * See the LICENSE file in the root directory of this source tree.
503
503
  */
504
- const Ua = R("Radar", [
504
+ const Ja = j("Radar", [
505
505
  ["path", { d: "M19.07 4.93A10 10 0 0 0 6.99 3.34", key: "z3du51" }],
506
506
  ["path", { d: "M4 6h.01", key: "oypzma" }],
507
507
  ["path", { d: "M2.29 9.62A10 10 0 1 0 21.31 8.35", key: "qzzz0" }],
@@ -517,7 +517,7 @@ const Ua = R("Radar", [
517
517
  * This source code is licensed under the ISC license.
518
518
  * See the LICENSE file in the root directory of this source tree.
519
519
  */
520
- const Ja = R("RefreshCw", [
520
+ const Wa = j("RefreshCw", [
521
521
  ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
522
522
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
523
523
  ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
@@ -529,7 +529,7 @@ const Ja = R("RefreshCw", [
529
529
  * This source code is licensed under the ISC license.
530
530
  * See the LICENSE file in the root directory of this source tree.
531
531
  */
532
- const fl = R("Rows3", [
532
+ const fl = j("Rows3", [
533
533
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
534
534
  ["path", { d: "M21 9H3", key: "1338ky" }],
535
535
  ["path", { d: "M21 15H3", key: "9uk58r" }]
@@ -540,7 +540,7 @@ const fl = R("Rows3", [
540
540
  * This source code is licensed under the ISC license.
541
541
  * See the LICENSE file in the root directory of this source tree.
542
542
  */
543
- const gl = R("Save", [
543
+ const gl = j("Save", [
544
544
  [
545
545
  "path",
546
546
  {
@@ -557,7 +557,7 @@ const gl = R("Save", [
557
557
  * This source code is licensed under the ISC license.
558
558
  * See the LICENSE file in the root directory of this source tree.
559
559
  */
560
- const Wa = R("Shapes", [
560
+ const Ka = j("Shapes", [
561
561
  [
562
562
  "path",
563
563
  {
@@ -574,7 +574,7 @@ const Wa = R("Shapes", [
574
574
  * This source code is licensed under the ISC license.
575
575
  * See the LICENSE file in the root directory of this source tree.
576
576
  */
577
- const yl = R("ShieldQuestion", [
577
+ const yl = j("ShieldQuestion", [
578
578
  [
579
579
  "path",
580
580
  {
@@ -591,7 +591,7 @@ const yl = R("ShieldQuestion", [
591
591
  * This source code is licensed under the ISC license.
592
592
  * See the LICENSE file in the root directory of this source tree.
593
593
  */
594
- const bl = R("Sigma", [
594
+ const bl = j("Sigma", [
595
595
  [
596
596
  "path",
597
597
  {
@@ -606,7 +606,7 @@ const bl = R("Sigma", [
606
606
  * This source code is licensed under the ISC license.
607
607
  * See the LICENSE file in the root directory of this source tree.
608
608
  */
609
- const xl = R("Square", [
609
+ const xl = j("Square", [
610
610
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
611
611
  ]);
612
612
  /**
@@ -615,7 +615,7 @@ const xl = R("Square", [
615
615
  * This source code is licensed under the ISC license.
616
616
  * See the LICENSE file in the root directory of this source tree.
617
617
  */
618
- const vl = R("Tag", [
618
+ const vl = j("Tag", [
619
619
  [
620
620
  "path",
621
621
  {
@@ -631,7 +631,7 @@ const vl = R("Tag", [
631
631
  * This source code is licensed under the ISC license.
632
632
  * See the LICENSE file in the root directory of this source tree.
633
633
  */
634
- const Nl = R("TicketX", [
634
+ const Nl = j("TicketX", [
635
635
  [
636
636
  "path",
637
637
  {
@@ -648,7 +648,7 @@ const Nl = R("TicketX", [
648
648
  * This source code is licensed under the ISC license.
649
649
  * See the LICENSE file in the root directory of this source tree.
650
650
  */
651
- const Cl = R("ToggleLeft", [
651
+ const Cl = j("ToggleLeft", [
652
652
  ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
653
653
  ["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
654
654
  ]);
@@ -658,7 +658,7 @@ const Cl = R("ToggleLeft", [
658
658
  * This source code is licensed under the ISC license.
659
659
  * See the LICENSE file in the root directory of this source tree.
660
660
  */
661
- const Ka = R("Tornado", [
661
+ const Qa = j("Tornado", [
662
662
  ["path", { d: "M21 4H3", key: "1hwok0" }],
663
663
  ["path", { d: "M18 8H6", key: "41n648" }],
664
664
  ["path", { d: "M19 12H9", key: "1g4lpz" }],
@@ -671,12 +671,12 @@ const Ka = R("Tornado", [
671
671
  * This source code is licensed under the ISC license.
672
672
  * See the LICENSE file in the root directory of this source tree.
673
673
  */
674
- const Qa = R("Type", [
674
+ const Za = j("Type", [
675
675
  ["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
676
676
  ["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
677
677
  ["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
678
678
  ]);
679
- function Za(t) {
679
+ function Xa(t) {
680
680
  var s;
681
681
  return {
682
682
  ...t,
@@ -684,11 +684,11 @@ function Za(t) {
684
684
  var l;
685
685
  return {
686
686
  ...a,
687
- frames: (l = a.frames) == null ? void 0 : l.map((i) => {
687
+ frames: (l = a.frames) == null ? void 0 : l.map((r) => {
688
688
  var o;
689
689
  return {
690
- ...i,
691
- cards: (o = i.cards) == null ? void 0 : o.map((c) => Sl(c))
690
+ ...r,
691
+ cards: (o = r.cards) == null ? void 0 : o.map((c) => Sl(c))
692
692
  };
693
693
  })
694
694
  };
@@ -696,7 +696,7 @@ function Za(t) {
696
696
  };
697
697
  }
698
698
  function Sl(t) {
699
- var s, a, l, i;
699
+ var s, a, l, r;
700
700
  return {
701
701
  ...t,
702
702
  cfg: {
@@ -704,7 +704,7 @@ function Sl(t) {
704
704
  data: {
705
705
  ...(s = t.cfg) == null ? void 0 : s.data,
706
706
  labels: [],
707
- datasets: (i = (l = (a = t.cfg) == null ? void 0 : a.data) == null ? void 0 : l.datasets) == null ? void 0 : i.map((o) => ({
707
+ datasets: (r = (l = (a = t.cfg) == null ? void 0 : a.data) == null ? void 0 : l.datasets) == null ? void 0 : r.map((o) => ({
708
708
  ...o,
709
709
  data: []
710
710
  }))
@@ -732,10 +732,10 @@ function wl(t) {
732
732
  async function kl(t, s, a, l) {
733
733
  if (!l)
734
734
  return null;
735
- const i = JSON.stringify(s);
735
+ const r = JSON.stringify(s);
736
736
  return await It("https://semaphor.cloud/api/v1/lens", l, {
737
737
  name: t,
738
- template: i,
738
+ template: r,
739
739
  filterValues: a,
740
740
  operation: "create"
741
741
  });
@@ -743,11 +743,11 @@ async function kl(t, s, a, l) {
743
743
  async function Ot(t, s) {
744
744
  if (!s)
745
745
  return null;
746
- const { id: a, template: l, filterValues: i, isDefault: o, shared: c } = t;
746
+ const { id: a, template: l, filterValues: r, isDefault: o, shared: c } = t;
747
747
  return await It("https://semaphor.cloud/api/v1/lens", s, {
748
748
  lensId: a,
749
749
  template: l,
750
- filterValues: i,
750
+ filterValues: r,
751
751
  isDefault: o,
752
752
  shared: c,
753
753
  operation: "update"
@@ -760,18 +760,18 @@ async function Ol(t, s) {
760
760
  }) : null;
761
761
  }
762
762
  function Il() {
763
- const [t, s] = P(""), [a, l] = P(!1), i = D((g) => g.lenses), { setLenses: o, setSelectedLensId: c } = Xe(), [d, u] = P(!1), [f, h] = P(!1), b = D((g) => g.dashboard), v = D((g) => g.filterValues), { authToken: r } = Te();
763
+ const [t, s] = H(""), [a, l] = H(!1), r = D((g) => g.lenses), { setLenses: o, setSelectedLensId: c } = Xe(), [d, u] = H(!1), [f, h] = H(!1), b = D((g) => g.dashboard), N = D((g) => g.filterValues), { authToken: i } = Te();
764
764
  async function y() {
765
765
  u(!0);
766
- const g = Za(
766
+ const g = Xa(
767
767
  b
768
768
  ), C = await kl(
769
769
  t,
770
770
  g,
771
- v,
772
- r == null ? void 0 : r.accessToken
771
+ N,
772
+ i == null ? void 0 : i.accessToken
773
773
  );
774
- C && (o([...i || [], C]), c(C.id), h(!1)), u(!1);
774
+ C && (o([...r || [], C]), c(C.id), h(!1)), u(!1);
775
775
  }
776
776
  return /* @__PURE__ */ n(Mt, { open: f, onOpenChange: h, children: [
777
777
  /* @__PURE__ */ e(Tt, { asChild: !0, children: /* @__PURE__ */ n(
@@ -821,14 +821,14 @@ function Il() {
821
821
  ] });
822
822
  }
823
823
  function Ml() {
824
- const [t, s] = P(!1), a = D((h) => h.lenses), l = D((h) => h.selectedLensId), { setLenses: i, setSelectedLensId: o } = Xe(), { authToken: c } = Te();
824
+ const [t, s] = H(!1), a = D((h) => h.lenses), l = D((h) => h.selectedLensId), { setLenses: r, setSelectedLensId: o } = Xe(), { authToken: c } = Te();
825
825
  async function d(h) {
826
826
  o(h);
827
827
  }
828
828
  async function u(h) {
829
829
  if (await Ol(h, c == null ? void 0 : c.accessToken)) {
830
- const v = a == null ? void 0 : a.filter((r) => r.id !== h);
831
- i(v || []), o("original");
830
+ const N = a == null ? void 0 : a.filter((i) => i.id !== h);
831
+ r(N || []), o("original");
832
832
  }
833
833
  }
834
834
  async function f(h) {
@@ -839,28 +839,28 @@ function Ml() {
839
839
  ...y,
840
840
  isDefault: !1
841
841
  });
842
- i(b || []);
843
- const v = {
842
+ r(b || []);
843
+ const N = {
844
844
  ...h,
845
845
  isDefault: !h.isDefault
846
846
  };
847
- await Ot(v, c == null ? void 0 : c.accessToken);
848
- const r = a == null ? void 0 : a.find((y) => y.isDefault);
849
- if (r && r.id !== h.id) {
847
+ await Ot(N, c == null ? void 0 : c.accessToken);
848
+ const i = a == null ? void 0 : a.find((y) => y.isDefault);
849
+ if (i && i.id !== h.id) {
850
850
  const y = {
851
- ...r,
851
+ ...i,
852
852
  isDefault: !1
853
853
  };
854
854
  await Ot(y, c == null ? void 0 : c.accessToken);
855
855
  }
856
856
  }
857
857
  return /* @__PURE__ */ n(la, { open: t, onOpenChange: s, children: [
858
- /* @__PURE__ */ e(ia, { asChild: !0, children: /* @__PURE__ */ e(z, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e(al, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
859
- /* @__PURE__ */ n(ra, { align: "end", className: "w-60", children: [
858
+ /* @__PURE__ */ e(ra, { asChild: !0, children: /* @__PURE__ */ e(z, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e(al, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
859
+ /* @__PURE__ */ n(ia, { align: "end", className: "w-60", children: [
860
860
  /* @__PURE__ */ e(oa, { className: "px-3", children: "Lenses" }),
861
861
  /* @__PURE__ */ e(ca, {}),
862
862
  /* @__PURE__ */ n(
863
- xn,
863
+ vn,
864
864
  {
865
865
  value: l,
866
866
  onValueChange: d,
@@ -875,7 +875,7 @@ function Ml() {
875
875
  /* @__PURE__ */ e("p", { children: h.name }),
876
876
  /* @__PURE__ */ n("span", { className: "flex items-center gap-3", children: [
877
877
  /* @__PURE__ */ e(
878
- il,
878
+ rl,
879
879
  {
880
880
  onClick: (b) => {
881
881
  b.preventDefault(), f(h);
@@ -912,9 +912,9 @@ function Ml() {
912
912
  ] });
913
913
  }
914
914
  async function Tl() {
915
- var r;
916
- const t = D.getState().authToken, s = D.getState().theme, a = D.getState().filterValues, l = (r = D.getState().dashboard) == null ? void 0 : r.title, i = D.getState().isDownloadingPdf, o = D.getState().selectedSheetId;
917
- if (i)
915
+ var i;
916
+ const t = D.getState().authToken, s = D.getState().theme, a = D.getState().filterValues, l = (i = D.getState().dashboard) == null ? void 0 : i.title, r = D.getState().isDownloadingPdf, o = D.getState().selectedSheetId;
917
+ if (r)
918
918
  return;
919
919
  const c = new URLSearchParams();
920
920
  c.set("token", (t == null ? void 0 : t.accessToken) || ""), c.set("theme", s || "light"), c.set("filterValues", JSON.stringify(a)), c.set("selectedSheetId", o || "");
@@ -927,18 +927,18 @@ async function Tl() {
927
927
  }
928
928
  })).json()).url, b = document.createElement("a");
929
929
  b.href = h;
930
- const v = `${l}-${(/* @__PURE__ */ new Date()).toISOString()}.pdf`;
931
- b.download = v, b.click(), D.setState({ isDownloadingPdf: !1 });
930
+ const N = `${l}-${(/* @__PURE__ */ new Date()).toISOString()}.pdf`;
931
+ b.download = N, b.click(), D.setState({ isDownloadingPdf: !1 });
932
932
  }
933
933
  function Dl({
934
934
  iconClassName: t
935
935
  }) {
936
936
  const { authToken: s } = Te();
937
- D((i) => {
937
+ D((r) => {
938
938
  var o;
939
- return (o = i.dashboard) == null ? void 0 : o.title;
940
- }), D((i) => i.theme), D((i) => i.filterValues);
941
- const a = D((i) => i.isDownloadingPdf);
939
+ return (o = r.dashboard) == null ? void 0 : o.title;
940
+ }), D((r) => r.theme), D((r) => r.filterValues);
941
+ const a = D((r) => r.isDownloadingPdf);
942
942
  async function l() {
943
943
  await Tl();
944
944
  }
@@ -950,7 +950,7 @@ function Dl({
950
950
  size: "sm",
951
951
  onClick: l,
952
952
  children: a ? /* @__PURE__ */ e(Ze, { className: ee("size-3.5 animate-spin", t) }) : /* @__PURE__ */ e(
953
- vn,
953
+ Nn,
954
954
  {
955
955
  className: ee("size-3.5", t),
956
956
  strokeWidth: 1.5
@@ -962,24 +962,24 @@ function Dl({
962
962
  function zl() {
963
963
  const { authToken: t } = Te();
964
964
  D((p) => p.theme);
965
- const s = D((p) => p.lenses), a = D((p) => p.selectedLensId), l = s == null ? void 0 : s.find((p) => p.id === a), i = D((p) => p.dashboard);
965
+ const s = D((p) => p.lenses), a = D((p) => p.selectedLensId), l = s == null ? void 0 : s.find((p) => p.id === a), r = D((p) => p.dashboard);
966
966
  D((p) => p.selectedSheetId);
967
967
  const o = D(
968
968
  (p) => p.isDashboardEditing
969
969
  ), c = m(
970
970
  (p) => p.selectedConnectionId
971
- ), [d, u] = P(!1), f = D((p) => p.filterValues), h = D((p) => p.isVisualEditing), b = D((p) => p.showFilters);
971
+ ), [d, u] = H(!1), f = D((p) => p.filterValues), h = D((p) => p.isVisualEditing), b = D((p) => p.showFilters);
972
972
  D(
973
973
  (p) => p.showDashboardJSON
974
974
  );
975
- const v = D((p) => p.onSaveFunction), r = D(
975
+ const N = D((p) => p.onSaveFunction), i = D(
976
976
  (p) => p.actions.setShowFilters
977
977
  ), { addFrame: y, setSelectedFrameId: g } = D(
978
978
  (p) => p.actions
979
- ), { getSelectedSheet: C, setIsDashboardEditing: x, setShowDashboardJSON: O } = D((p) => p.actions), S = C(), { tenantId: M, endUserId: q } = kt(
980
- () => Nn(t == null ? void 0 : t.accessToken),
979
+ ), { getSelectedSheet: C, setIsDashboardEditing: x, setShowDashboardJSON: O } = D((p) => p.actions), S = C(), { tenantId: M, endUserId: V } = kt(
980
+ () => Cn(t == null ? void 0 : t.accessToken),
981
981
  [t == null ? void 0 : t.accessToken]
982
- ), F = kt(() => M || q, [M, q]), G = () => {
982
+ ), F = kt(() => M || V, [M, V]), G = () => {
983
983
  if (!o || !S) return;
984
984
  const p = {
985
985
  connectionId: c,
@@ -1008,14 +1008,14 @@ function zl() {
1008
1008
  };
1009
1009
  async function B() {
1010
1010
  if (u(!0), !a || !l) return;
1011
- const p = Za(
1012
- i
1011
+ const p = Xa(
1012
+ r
1013
1013
  ), E = JSON.stringify(p), W = {
1014
1014
  ...l,
1015
1015
  template: E,
1016
1016
  filterValues: f
1017
1017
  };
1018
- await Ot(W, t == null ? void 0 : t.accessToken), lt.success("Lens saved"), v == null || v(p), u(!1);
1018
+ await Ot(W, t == null ? void 0 : t.accessToken), lt.success("Lens saved"), N == null || N(p), u(!1);
1019
1019
  }
1020
1020
  return h ? null : /* @__PURE__ */ n(
1021
1021
  "div",
@@ -1025,7 +1025,7 @@ function zl() {
1025
1025
  children: [
1026
1026
  !h && /* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e($, { children: l == null ? void 0 : l.name }) }),
1027
1027
  /* @__PURE__ */ n("div", { className: "flex gap-2", children: [
1028
- /* @__PURE__ */ e("button", { onClick: Cn, children: /* @__PURE__ */ e(Nl, { className: "h-4 w-4", strokeWidth: 1.5 }) }),
1028
+ /* @__PURE__ */ e("button", { onClick: Sn, children: /* @__PURE__ */ e(Nl, { className: "h-4 w-4", strokeWidth: 1.5 }) }),
1029
1029
  /* @__PURE__ */ e(Dl, {}),
1030
1030
  o && !h && F && /* @__PURE__ */ e(Il, {}),
1031
1031
  !h && F && /* @__PURE__ */ e(Ml, {}),
@@ -1082,7 +1082,7 @@ function zl() {
1082
1082
  {
1083
1083
  className: "h-7 p-2",
1084
1084
  variant: "ghost",
1085
- onClick: () => r(!0),
1085
+ onClick: () => i(!0),
1086
1086
  size: "sm",
1087
1087
  children: /* @__PURE__ */ e(ua, { className: "h-4 w-4", strokeWidth: 1.5 })
1088
1088
  }
@@ -1099,19 +1099,19 @@ function Ll({
1099
1099
  items: s,
1100
1100
  value: a,
1101
1101
  onChange: l,
1102
- isLoading: i,
1102
+ isLoading: r,
1103
1103
  isError: o,
1104
1104
  refetch: c,
1105
1105
  className: d,
1106
1106
  showNone: u = !1
1107
1107
  }) {
1108
- const f = qe.useRef(null), [h, b] = qe.useState(!1), [v, r] = qe.useState("100%"), y = u ? [...s || [], { id: "none", name: "None" }] : s;
1108
+ const f = qe.useRef(null), [h, b] = qe.useState(!1), [N, i] = qe.useState("100%"), y = u ? [...s || [], { id: "none", name: "None" }] : s;
1109
1109
  qe.useLayoutEffect(() => {
1110
- f.current && r(f.current.offsetWidth);
1110
+ f.current && i(f.current.offsetWidth);
1111
1111
  }, []);
1112
1112
  function g() {
1113
1113
  var x;
1114
- return i ? "Loading..." : o ? "Error" : a ? (x = s == null ? void 0 : s.find((O) => O.id === a)) == null ? void 0 : x.name : `Select ${t}`;
1114
+ return r ? "Loading..." : o ? "Error" : a ? (x = s == null ? void 0 : s.find((O) => O.id === a)) == null ? void 0 : x.name : `Select ${t}`;
1115
1115
  }
1116
1116
  function C(x, O) {
1117
1117
  l(O), b(!1);
@@ -1130,7 +1130,7 @@ function Ll({
1130
1130
  ),
1131
1131
  children: [
1132
1132
  /* @__PURE__ */ e("span", { className: "overflow-hidden text-ellipsis whitespace-nowrap", children: g() }),
1133
- /* @__PURE__ */ e(Sn, { className: "size-4 opacity-50" })
1133
+ /* @__PURE__ */ e(wn, { className: "size-4 opacity-50" })
1134
1134
  ]
1135
1135
  }
1136
1136
  ) }),
@@ -1138,16 +1138,16 @@ function Ll({
1138
1138
  He,
1139
1139
  {
1140
1140
  className: "w-full p-0",
1141
- style: { minWidth: v },
1141
+ style: { minWidth: N },
1142
1142
  children: /* @__PURE__ */ n(ha, { children: [
1143
1143
  /* @__PURE__ */ n("div", { className: "flex h-9 items-center justify-between border-b pr-1", children: [
1144
1144
  /* @__PURE__ */ e(ma, { className: "h-9", placeholder: "Search..." }),
1145
1145
  /* @__PURE__ */ e(Qe, { className: "h-7", onClick: c, children: /* @__PURE__ */ e(
1146
- Ja,
1146
+ Wa,
1147
1147
  {
1148
1148
  className: ee(
1149
1149
  "size-3.5 opacity-50",
1150
- i && "animate-spin"
1150
+ r && "animate-spin"
1151
1151
  )
1152
1152
  }
1153
1153
  ) })
@@ -1190,7 +1190,7 @@ function Be({
1190
1190
  items: s,
1191
1191
  value: a,
1192
1192
  isLoading: l,
1193
- isError: i,
1193
+ isError: r,
1194
1194
  refetch: o,
1195
1195
  connectionTooltip: c,
1196
1196
  onChange: d,
@@ -1198,9 +1198,9 @@ function Be({
1198
1198
  className: f,
1199
1199
  showIcon: h = !0,
1200
1200
  disabled: b = !1,
1201
- type: v = "select"
1201
+ type: N = "select"
1202
1202
  }) {
1203
- const r = l ? "Loading..." : i ? "Error" : a;
1203
+ const i = l ? "Loading..." : r ? "Error" : a;
1204
1204
  function y() {
1205
1205
  if (t === "Connection")
1206
1206
  return /* @__PURE__ */ e(pl, { className: "size-4 rotate-90" });
@@ -1214,7 +1214,7 @@ function Be({
1214
1214
  return /* @__PURE__ */ e(Us, { className: "size-4" });
1215
1215
  }
1216
1216
  function g() {
1217
- return /* @__PURE__ */ n(me, { disabled: b, value: r, onValueChange: d, children: [
1217
+ return /* @__PURE__ */ n(me, { disabled: b, value: i, onValueChange: d, children: [
1218
1218
  /* @__PURE__ */ e(
1219
1219
  pe,
1220
1220
  {
@@ -1225,7 +1225,7 @@ function Be({
1225
1225
  children: /* @__PURE__ */ e(
1226
1226
  fe,
1227
1227
  {
1228
- placeholder: l ? "Loading..." : i ? "Error" : `Select ${t}`
1228
+ placeholder: l ? "Loading..." : r ? "Error" : `Select ${t}`
1229
1229
  }
1230
1230
  )
1231
1231
  }
@@ -1234,7 +1234,7 @@ function Be({
1234
1234
  l ? /* @__PURE__ */ e(Ce, { children: "Loading..." }) : /* @__PURE__ */ n(Ce, { className: "flex items-center justify-between gap-2", children: [
1235
1235
  t,
1236
1236
  /* @__PURE__ */ e(
1237
- Ja,
1237
+ Wa,
1238
1238
  {
1239
1239
  className: ee(
1240
1240
  "mr-1 size-3 cursor-pointer text-muted-foreground hover:text-foreground",
@@ -1248,7 +1248,7 @@ function Be({
1248
1248
  u && /* @__PURE__ */ e(Q, { value: "none", children: "None" }, "none"),
1249
1249
  s && s.map((x, O) => /* @__PURE__ */ e(Q, { value: x.id, children: x.name }, O))
1250
1250
  ] }),
1251
- (l || i) && /* @__PURE__ */ e(Q, { value: r, children: r })
1251
+ (l || r) && /* @__PURE__ */ e(Q, { value: i, children: i })
1252
1252
  ] }) })
1253
1253
  ] });
1254
1254
  }
@@ -1257,11 +1257,11 @@ function Be({
1257
1257
  Ll,
1258
1258
  {
1259
1259
  items: s,
1260
- value: r,
1260
+ value: i,
1261
1261
  onChange: d || (() => {
1262
1262
  }),
1263
1263
  isLoading: l,
1264
- isError: i,
1264
+ isError: r,
1265
1265
  refetch: o,
1266
1266
  name: t,
1267
1267
  showNone: u
@@ -1270,19 +1270,19 @@ function Be({
1270
1270
  }
1271
1271
  return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1272
1272
  h && /* @__PURE__ */ e("div", { className: "shrink-0", children: c ? /* @__PURE__ */ n(xa, { children: [
1273
- /* @__PURE__ */ e(wn, { children: y() }),
1273
+ /* @__PURE__ */ e(kn, { children: y() }),
1274
1274
  /* @__PURE__ */ e(va, { className: "text-xs", align: "start", children: c })
1275
1275
  ] }) : y() }),
1276
- v === "combobox" ? C() : g()
1276
+ N === "combobox" ? C() : g()
1277
1277
  ] });
1278
1278
  }
1279
1279
  function Fl({ column: t }) {
1280
- const [s, a] = P(!1), l = m((y) => y.selectedTableName), i = m(
1280
+ const [s, a] = H(!1), l = m((y) => y.selectedTableName), r = m(
1281
1281
  (y) => y.selectedSchemaName
1282
1282
  ), o = m(
1283
1283
  (y) => y.selectedDatamodelId
1284
1284
  ), c = m((y) => y.sqlGen), { modelItems: d, connectionType: u } = Ae(), f = m((y) => y.actions.setSqlGen), h = m((y) => y.actions.setCardSql), b = m((y) => y.actions.setRunSql);
1285
- function v(y, g) {
1285
+ function N(y, g) {
1286
1286
  var S;
1287
1287
  const C = wa(y, c, g), x = (S = d == null ? void 0 : d.find(
1288
1288
  (M) => M.id === o
@@ -1290,19 +1290,19 @@ function Fl({ column: t }) {
1290
1290
  f(C);
1291
1291
  const O = ka(
1292
1292
  C,
1293
- ve(i || ""),
1293
+ ve(r || ""),
1294
1294
  ve(l),
1295
1295
  x,
1296
1296
  u
1297
1297
  );
1298
1298
  O && (h(O), b(!0)), a(!1);
1299
1299
  }
1300
- function r() {
1300
+ function i() {
1301
1301
  return /* @__PURE__ */ n("ul", { className: "text-xs", children: [
1302
1302
  /* @__PURE__ */ e(
1303
1303
  "li",
1304
1304
  {
1305
- onClick: () => v(t, "COUNT"),
1305
+ onClick: () => N(t, "COUNT"),
1306
1306
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1307
1307
  children: "Count"
1308
1308
  }
@@ -1310,7 +1310,7 @@ function Fl({ column: t }) {
1310
1310
  /* @__PURE__ */ e(
1311
1311
  "li",
1312
1312
  {
1313
- onClick: () => v(t, "AVG"),
1313
+ onClick: () => N(t, "AVG"),
1314
1314
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1315
1315
  children: "Avg"
1316
1316
  }
@@ -1318,7 +1318,7 @@ function Fl({ column: t }) {
1318
1318
  /* @__PURE__ */ e(
1319
1319
  "li",
1320
1320
  {
1321
- onClick: () => v(t, "SUM"),
1321
+ onClick: () => N(t, "SUM"),
1322
1322
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1323
1323
  children: "Sum"
1324
1324
  }
@@ -1326,7 +1326,7 @@ function Fl({ column: t }) {
1326
1326
  /* @__PURE__ */ e(
1327
1327
  "li",
1328
1328
  {
1329
- onClick: () => v(t, "MAX"),
1329
+ onClick: () => N(t, "MAX"),
1330
1330
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1331
1331
  children: "Max"
1332
1332
  }
@@ -1334,7 +1334,7 @@ function Fl({ column: t }) {
1334
1334
  /* @__PURE__ */ e(
1335
1335
  "li",
1336
1336
  {
1337
- onClick: () => v(t, "MIN"),
1337
+ onClick: () => N(t, "MIN"),
1338
1338
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1339
1339
  children: "Min"
1340
1340
  }
@@ -1342,20 +1342,20 @@ function Fl({ column: t }) {
1342
1342
  ] });
1343
1343
  }
1344
1344
  return /* @__PURE__ */ n(Na, { openDelay: 0, open: s, onOpenChange: a, children: [
1345
- /* @__PURE__ */ e(Ca, { asChild: !0, children: /* @__PURE__ */ e(Ga, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
1345
+ /* @__PURE__ */ e(Ca, { asChild: !0, children: /* @__PURE__ */ e(Ba, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
1346
1346
  /* @__PURE__ */ e(
1347
1347
  Sa,
1348
1348
  {
1349
1349
  align: "center",
1350
1350
  className: "w-20 rounded-md p-0 shadow-none",
1351
- children: r()
1351
+ children: i()
1352
1352
  }
1353
1353
  )
1354
1354
  ] });
1355
1355
  }
1356
- function Xa({ column: t }) {
1356
+ function Ya({ column: t }) {
1357
1357
  return /* @__PURE__ */ n(xa, { children: [
1358
- /* @__PURE__ */ e(kn, { asChild: !0, children: On(t.data_type) ? /* @__PURE__ */ e(Qa, { className: "size-3" }) : Oa(t.data_type) ? /* @__PURE__ */ e(ll, { className: "size-3" }) : In(t.data_type) ? /* @__PURE__ */ e(Mn, { className: "size-3" }) : Tn(t.data_type) ? /* @__PURE__ */ e(Cl, { className: "size-3" }) : t.data_type.toLowerCase() === "json" ? /* @__PURE__ */ e(Js, { className: "size-3" }) : /* @__PURE__ */ e(yl, { className: "size-3" }) }),
1358
+ /* @__PURE__ */ e(On, { asChild: !0, children: In(t.data_type) ? /* @__PURE__ */ e(Za, { className: "size-3" }) : Oa(t.data_type) ? /* @__PURE__ */ e(ll, { className: "size-3" }) : Mn(t.data_type) ? /* @__PURE__ */ e(Tn, { className: "size-3" }) : Dn(t.data_type) ? /* @__PURE__ */ e(Cl, { className: "size-3" }) : t.data_type.toLowerCase() === "json" ? /* @__PURE__ */ e(Js, { className: "size-3" }) : /* @__PURE__ */ e(yl, { className: "size-3" }) }),
1359
1359
  /* @__PURE__ */ e(va, { children: /* @__PURE__ */ e("p", { className: "font-mono text-xs", children: t.data_type }) })
1360
1360
  ] });
1361
1361
  }
@@ -1365,7 +1365,7 @@ function Al({
1365
1365
  columns: a,
1366
1366
  status: l
1367
1367
  }) {
1368
- const i = m((p) => p.sqlGen), o = m(
1368
+ const r = m((p) => p.sqlGen), o = m(
1369
1369
  (p) => p.selectedConnectionId
1370
1370
  ), c = m(
1371
1371
  (p) => p.selectedDatabaseName
@@ -1375,12 +1375,12 @@ function Al({
1375
1375
  (p) => p.selectedDatamodelId
1376
1376
  ), h = D(
1377
1377
  (p) => p.dashboard.aiScopeTables
1378
- ), { addToAIScope: b, removeFromAIScope: v } = Xe(), { setAIScopeTables: r } = D((p) => p.actions), y = m((p) => p.actions.setRunSql), g = m((p) => p.actions.setSqlGen), C = m(
1378
+ ), { addToAIScope: b, removeFromAIScope: N } = Xe(), { setAIScopeTables: i } = D((p) => p.actions), y = m((p) => p.actions.setRunSql), g = m((p) => p.actions.setSqlGen), C = m(
1379
1379
  (p) => p.actions.setIsShowingVisual
1380
1380
  ), x = m((p) => p.actions.setCardSql), { connectionType: O, modelItems: S, selectedDatamodelName: M } = Ae();
1381
- function q(p) {
1381
+ function V(p) {
1382
1382
  var U;
1383
- const E = wa(p, i);
1383
+ const E = wa(p, r);
1384
1384
  g(E);
1385
1385
  const W = (U = S == null ? void 0 : S.find(
1386
1386
  (K) => K.id === f
@@ -1405,17 +1405,17 @@ function Al({
1405
1405
  databaseName: c || "",
1406
1406
  schemaName: d || "",
1407
1407
  tableName: u || "",
1408
- datamodelName: it(M),
1408
+ datamodelName: rt(M),
1409
1409
  datamodelId: f || ""
1410
1410
  }), lt.success("Added to Assistant Scope", {
1411
1411
  position: "top-right",
1412
1412
  duration: 2500,
1413
1413
  richColors: !0
1414
- })) : (v({
1414
+ })) : (N({
1415
1415
  connectionId: o || "",
1416
1416
  connectionType: O || "",
1417
1417
  tableName: u || "",
1418
- datamodelName: it(M),
1418
+ datamodelName: rt(M),
1419
1419
  datamodelId: f || "",
1420
1420
  databaseName: c || "",
1421
1421
  schemaName: d || ""
@@ -1508,16 +1508,16 @@ function Al({
1508
1508
  /* @__PURE__ */ e("div", { className: "flex flex-col gap-1", children: a == null ? void 0 : a.map((p) => /* @__PURE__ */ n(
1509
1509
  "div",
1510
1510
  {
1511
- onClick: () => q(p),
1511
+ onClick: () => V(p),
1512
1512
  className: ee(
1513
1513
  "group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-1 text-sm transition-colors hover:bg-muted/50",
1514
1514
  {
1515
- "border border-dashed border-muted-foreground bg-muted": Dn(p, i)
1515
+ "border border-dashed border-muted-foreground bg-muted": zn(p, r)
1516
1516
  }
1517
1517
  ),
1518
1518
  children: [
1519
1519
  /* @__PURE__ */ n("div", { className: "flex items-center space-x-2", children: [
1520
- /* @__PURE__ */ e(Xa, { column: p }),
1520
+ /* @__PURE__ */ e(Ya, { column: p }),
1521
1521
  /* @__PURE__ */ e("span", { children: p.column_name })
1522
1522
  ] }),
1523
1523
  /* @__PURE__ */ e(
@@ -1542,7 +1542,7 @@ function Al({
1542
1542
  function Ae(t, s) {
1543
1543
  var _t, Ht, Pt, $t, Gt, Bt;
1544
1544
  let a = kt(() => [], []);
1545
- const l = Te().authToken || t, i = m(
1545
+ const l = Te().authToken || t, r = m(
1546
1546
  (w) => w.selectedConnectionId
1547
1547
  ), o = m(
1548
1548
  (w) => w.selectedDatamodelId
@@ -1556,28 +1556,28 @@ function Ae(t, s) {
1556
1556
  (w) => w.actions.setSelectedConnectionId
1557
1557
  ), b = m(
1558
1558
  (w) => w.actions.setSelectedDatamodelId
1559
- ), v = m(
1559
+ ), N = m(
1560
1560
  (w) => w.actions.setSelectedDatabaseName
1561
- ), r = m(
1561
+ ), i = m(
1562
1562
  (w) => w.actions.setSelectedSchemaName
1563
1563
  ), y = m(
1564
1564
  (w) => w.actions.setSelectedTableName
1565
1565
  );
1566
1566
  m((w) => w.actions.setCardSql);
1567
1567
  function g(w) {
1568
- return i && c && d && c !== "NA" ? !0 : i && w === "API" ? !1 : !!(i && w === "S3");
1568
+ return r && c && d && c !== "NA" ? !0 : r && w === "API" ? !1 : !!(r && w === "S3");
1569
1569
  }
1570
1570
  function C(w) {
1571
- return !!(i && c && c !== "NA" && d && u || i && (w === "S3" || w === "API") || o && o);
1571
+ return !!(r && c && c !== "NA" && d && u || r && (w === "S3" || w === "API") || o && o);
1572
1572
  }
1573
1573
  function x(w) {
1574
- return i && w ? !(w === "API" || w === "S3") : !1;
1574
+ return r && w ? !(w === "API" || w === "S3") : !1;
1575
1575
  }
1576
1576
  const {
1577
1577
  refetch: O,
1578
1578
  data: S,
1579
1579
  isLoading: M,
1580
- isError: q
1580
+ isError: V
1581
1581
  } = De({
1582
1582
  queryKey: ["connections"],
1583
1583
  queryFn: () => Ve(
@@ -1592,52 +1592,52 @@ function Ae(t, s) {
1592
1592
  isLoading: _,
1593
1593
  isError: B
1594
1594
  } = De({
1595
- queryKey: ["models", i],
1595
+ queryKey: ["models", r],
1596
1596
  queryFn: () => Ve(
1597
1597
  "https://semaphor.cloud/api/v1/datamodels",
1598
1598
  (l == null ? void 0 : l.accessToken) || "",
1599
1599
  {
1600
- connection_id: i
1600
+ connection_id: r
1601
1601
  }
1602
1602
  ),
1603
- enabled: !!(l != null && l.accessToken) && !!i
1603
+ enabled: !!(l != null && l.accessToken) && !!r
1604
1604
  // Only fetch if authToken is present
1605
1605
  }), p = S == null ? void 0 : S.connections.find(
1606
- (w) => w.id === i
1606
+ (w) => w.id === r
1607
1607
  ), E = p == null ? void 0 : p.type, W = (p == null ? void 0 : p.type) === "API" || (p == null ? void 0 : p.type) === "S3", {
1608
1608
  data: A,
1609
1609
  isLoading: U,
1610
1610
  isFetching: K,
1611
- isError: V,
1612
- refetch: N
1611
+ isError: P,
1612
+ refetch: v
1613
1613
  } = De({
1614
- queryKey: ["databases", i],
1614
+ queryKey: ["databases", r],
1615
1615
  queryFn: () => Ve(
1616
1616
  "https://semaphor.cloud/api/v1/databases",
1617
1617
  (l == null ? void 0 : l.accessToken) || "",
1618
1618
  {
1619
- connection_id: i
1619
+ connection_id: r
1620
1620
  }
1621
1621
  ),
1622
1622
  enabled: x(E)
1623
1623
  // !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
1624
1624
  }), {
1625
1625
  data: I,
1626
- isLoading: H,
1626
+ isLoading: R,
1627
1627
  isFetching: Z,
1628
1628
  isError: X,
1629
- refetch: j
1629
+ refetch: q
1630
1630
  } = De({
1631
- queryKey: ["schemas", i, c],
1631
+ queryKey: ["schemas", r, c],
1632
1632
  queryFn: () => Ve(
1633
1633
  "https://semaphor.cloud/api/v1/schemas",
1634
1634
  (l == null ? void 0 : l.accessToken) || "",
1635
1635
  {
1636
- connection_id: i,
1636
+ connection_id: r,
1637
1637
  database_name: c
1638
1638
  }
1639
1639
  ),
1640
- enabled: !!i && !!c && !W && c !== "NA"
1640
+ enabled: !!r && !!c && !W && c !== "NA"
1641
1641
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
1642
1642
  }), {
1643
1643
  data: L,
@@ -1648,7 +1648,7 @@ function Ae(t, s) {
1648
1648
  } = De({
1649
1649
  queryKey: [
1650
1650
  "tables",
1651
- i,
1651
+ r,
1652
1652
  c,
1653
1653
  d
1654
1654
  ],
@@ -1656,7 +1656,7 @@ function Ae(t, s) {
1656
1656
  "https://semaphor.cloud/api/v1/tables",
1657
1657
  (l == null ? void 0 : l.accessToken) || "",
1658
1658
  {
1659
- connection_id: i,
1659
+ connection_id: r,
1660
1660
  database_name: c,
1661
1661
  schema_name: d
1662
1662
  }
@@ -1671,7 +1671,7 @@ function Ae(t, s) {
1671
1671
  } = De({
1672
1672
  queryKey: [
1673
1673
  "columns",
1674
- i,
1674
+ r,
1675
1675
  c,
1676
1676
  o,
1677
1677
  d,
@@ -1681,7 +1681,7 @@ function Ae(t, s) {
1681
1681
  "https://semaphor.cloud/api/v1/columns",
1682
1682
  (l == null ? void 0 : l.accessToken) || "",
1683
1683
  {
1684
- connection_id: i,
1684
+ connection_id: r,
1685
1685
  datamodel_id: o || "",
1686
1686
  // don't pass undefined. Pass empty string
1687
1687
  database_name: c,
@@ -1701,31 +1701,31 @@ function Ae(t, s) {
1701
1701
  de(() => {
1702
1702
  f(a);
1703
1703
  }, [oe, f, a]), de(() => {
1704
- (E === "S3" || E === "API") && (v(""), r(""), b(""), E === "API" && y("api"));
1704
+ (E === "S3" || E === "API") && (N(""), i(""), b(""), E === "API" && y("api"));
1705
1705
  }, [
1706
1706
  E,
1707
1707
  y,
1708
- v,
1709
- r,
1708
+ N,
1709
+ i,
1710
1710
  b
1711
1711
  ]);
1712
- const T = (p == null ? void 0 : p.type) === "API" ? (_t = p == null ? void 0 : p.type) == null ? void 0 : _t.toLowerCase() : u || "", re = W ? "" : d || "";
1712
+ const T = (p == null ? void 0 : p.type) === "API" ? (_t = p == null ? void 0 : p.type) == null ? void 0 : _t.toLowerCase() : u || "", ie = W ? "" : d || "";
1713
1713
  function ye(w) {
1714
- r(w), y("");
1714
+ i(w), y("");
1715
1715
  }
1716
1716
  function be(w) {
1717
- v(w === "none" ? "" : w), r(""), y(""), w !== "none" && w !== "" && b("");
1717
+ N(w === "none" ? "" : w), i(""), y(""), w !== "none" && w !== "" && b("");
1718
1718
  }
1719
1719
  function Ge(w) {
1720
1720
  h(w);
1721
1721
  }
1722
1722
  function yt(w) {
1723
- b(w === "none" ? "" : w), w !== "none" && w !== "" && v("");
1723
+ b(w === "none" ? "" : w), w !== "none" && w !== "" && N("");
1724
1724
  }
1725
1725
  A && ((Ht = A == null ? void 0 : A.databases) == null ? void 0 : Ht.length) > 0, I && ((Pt = I == null ? void 0 : I.schemas) == null ? void 0 : Pt.length) > 0, oe && (($t = oe == null ? void 0 : oe.columns) == null ? void 0 : $t.length) > 0 && (a = oe.columns.map((w) => ({
1726
1726
  ...w,
1727
1727
  data_type: w.data_type.toLowerCase()
1728
- }))), V && (a = []), (Y || q) && (a = []);
1728
+ }))), P && (a = []), (Y || V) && (a = []);
1729
1729
  const tt = S == null ? void 0 : S.connections.map(
1730
1730
  (w) => ({
1731
1731
  id: w.id,
@@ -1735,34 +1735,34 @@ function Ae(t, s) {
1735
1735
  ), bt = (Gt = G == null ? void 0 : G.datamodels) == null ? void 0 : Gt.map((w) => ({
1736
1736
  id: w.id,
1737
1737
  name: w.name
1738
- })), fn = A == null ? void 0 : A.databases.map((w) => ({
1738
+ })), gn = A == null ? void 0 : A.databases.map((w) => ({
1739
1739
  id: w.database_name,
1740
1740
  name: w.database_name
1741
- })), gn = I == null ? void 0 : I.schemas.map((w) => ({
1741
+ })), yn = I == null ? void 0 : I.schemas.map((w) => ({
1742
1742
  id: w.schema_name,
1743
1743
  name: w.schema_name
1744
- })), yn = L == null ? void 0 : L.tables.map((w) => ({
1744
+ })), bn = L == null ? void 0 : L.tables.map((w) => ({
1745
1745
  id: w.table_name,
1746
1746
  name: w.table_name
1747
- })), bn = (Bt = G == null ? void 0 : G.datamodels.find(
1747
+ })), xn = (Bt = G == null ? void 0 : G.datamodels.find(
1748
1748
  (w) => w.id === o
1749
1749
  )) == null ? void 0 : Bt.name;
1750
1750
  return {
1751
1751
  connectionItems: tt,
1752
1752
  isConnectionsLoading: M,
1753
- isConnectionsError: q,
1753
+ isConnectionsError: V,
1754
1754
  modelItems: bt,
1755
1755
  selectedDatamodelId: o,
1756
- selectedDatamodelName: bn,
1756
+ selectedDatamodelName: xn,
1757
1757
  isModelsLoading: _,
1758
1758
  isModelsError: B,
1759
- databaseItems: fn,
1759
+ databaseItems: gn,
1760
1760
  isDatabasesLoadingOrFetching: U || K,
1761
- isDatabaseError: V,
1762
- schemaItems: gn,
1763
- isSchemaLoadingOrFetching: H || Z,
1761
+ isDatabaseError: P,
1762
+ schemaItems: yn,
1763
+ isSchemaLoadingOrFetching: R || Z,
1764
1764
  isSchemaError: X,
1765
- tableItems: yn,
1765
+ tableItems: bn,
1766
1766
  isTableLoadingOrFetching: ue || k,
1767
1767
  isTableError: J,
1768
1768
  columns: a,
@@ -1771,11 +1771,11 @@ function Ae(t, s) {
1771
1771
  isNonDbConnection: W,
1772
1772
  connectionType: E,
1773
1773
  tableName: T,
1774
- schemaName: re,
1774
+ schemaName: ie,
1775
1775
  refetchConnections: O,
1776
1776
  refetchModels: F,
1777
- refetchDatabases: N,
1778
- refetchSchemas: j,
1777
+ refetchDatabases: v,
1778
+ refetchSchemas: q,
1779
1779
  refetchTables: se,
1780
1780
  refetchColumns: ce,
1781
1781
  handleConnectionChange: Ge,
@@ -1784,7 +1784,7 @@ function Ae(t, s) {
1784
1784
  handleSchemaChange: ye
1785
1785
  };
1786
1786
  }
1787
- function Ya({
1787
+ function en({
1788
1788
  ColumnsComponent: t
1789
1789
  }) {
1790
1790
  var xe;
@@ -1794,7 +1794,7 @@ function Ya({
1794
1794
  (Y) => Y.selectedDatamodelId
1795
1795
  ), l = m(
1796
1796
  (Y) => Y.selectedDatabaseName
1797
- ), i = m(
1797
+ ), r = m(
1798
1798
  (Y) => Y.selectedSchemaName
1799
1799
  ), o = m((Y) => Y.selectedTableName), c = m(
1800
1800
  (Y) => Y.actions.setSelectedTableName
@@ -1804,8 +1804,8 @@ function Ya({
1804
1804
  schemaItems: f,
1805
1805
  databaseItems: h,
1806
1806
  tableItems: b,
1807
- columns: v,
1808
- isConnectionsLoading: r,
1807
+ columns: N,
1808
+ isConnectionsLoading: i,
1809
1809
  isModelsLoading: y,
1810
1810
  isConnectionsError: g,
1811
1811
  isModelsError: C,
@@ -1813,7 +1813,7 @@ function Ya({
1813
1813
  isDatabaseError: O,
1814
1814
  isSchemaLoadingOrFetching: S,
1815
1815
  isSchemaError: M,
1816
- isColumnsError: q,
1816
+ isColumnsError: V,
1817
1817
  isColumnsLoadingOrFetching: F,
1818
1818
  isTableLoadingOrFetching: G,
1819
1819
  isTableError: _,
@@ -1824,22 +1824,22 @@ function Ya({
1824
1824
  refetchSchemas: A,
1825
1825
  refetchTables: U,
1826
1826
  refetchColumns: K,
1827
- refetchConnections: V,
1828
- handleConnectionChange: N,
1827
+ refetchConnections: P,
1828
+ handleConnectionChange: v,
1829
1829
  handleDatabaseChange: I,
1830
- handleSchemaChange: H,
1830
+ handleSchemaChange: R,
1831
1831
  handleDatamodelChange: Z,
1832
1832
  tableName: X,
1833
- schemaName: j
1833
+ schemaName: q
1834
1834
  } = Ae();
1835
1835
  function L() {
1836
- return t ? t(j, X, v) : /* @__PURE__ */ e(
1836
+ return t ? t(q, X, N) : /* @__PURE__ */ e(
1837
1837
  Al,
1838
1838
  {
1839
- schemaName: j,
1839
+ schemaName: q,
1840
1840
  tableName: X,
1841
- columns: v,
1842
- status: F ? "Loading..." : q ? "Error" : "Success"
1841
+ columns: N,
1842
+ status: F ? "Loading..." : V ? "Error" : "Success"
1843
1843
  }
1844
1844
  );
1845
1845
  }
@@ -1895,11 +1895,11 @@ function Ya({
1895
1895
  Be,
1896
1896
  {
1897
1897
  refetch: A,
1898
- onChange: H,
1898
+ onChange: R,
1899
1899
  isError: M,
1900
1900
  isLoading: S,
1901
1901
  items: f,
1902
- value: i || "",
1902
+ value: r || "",
1903
1903
  title: "Schema",
1904
1904
  type: "combobox"
1905
1905
  }
@@ -1908,7 +1908,7 @@ function Ya({
1908
1908
  function Se() {
1909
1909
  function Y() {
1910
1910
  let ce = !1;
1911
- return B === "API" ? (ce = !1, ce) : ((B === "S3" || s && l && l !== "none" && i) && (ce = !0), ce);
1911
+ return B === "API" ? (ce = !1, ce) : ((B === "S3" || s && l && l !== "none" && r) && (ce = !0), ce);
1912
1912
  }
1913
1913
  return Y() ? /* @__PURE__ */ e(
1914
1914
  Be,
@@ -1929,12 +1929,12 @@ function Ya({
1929
1929
  /* @__PURE__ */ e(
1930
1930
  Be,
1931
1931
  {
1932
- refetch: V,
1932
+ refetch: P,
1933
1933
  items: d,
1934
1934
  title: "Connection",
1935
1935
  value: s || "",
1936
- onChange: N,
1937
- isLoading: r,
1936
+ onChange: v,
1937
+ isLoading: i,
1938
1938
  isError: g,
1939
1939
  type: "combobox",
1940
1940
  connectionTooltip: ((xe = d == null ? void 0 : d.find(
@@ -1965,9 +1965,9 @@ function Ya({
1965
1965
  ] });
1966
1966
  }
1967
1967
  function El(t) {
1968
- const s = t.toUpperCase().indexOf("WHERE"), a = t.toUpperCase().indexOf("GROUP BY"), l = t.toUpperCase().indexOf("LIMIT"), i = t.toUpperCase().indexOf("ORDER BY");
1968
+ const s = t.toUpperCase().indexOf("WHERE"), a = t.toUpperCase().indexOf("GROUP BY"), l = t.toUpperCase().indexOf("LIMIT"), r = t.toUpperCase().indexOf("ORDER BY");
1969
1969
  let o = t.length;
1970
- if (i !== -1 && (o = i), l !== -1 && l < o && (o = l), s !== -1) {
1970
+ if (r !== -1 && (o = r), l !== -1 && l < o && (o = l), s !== -1) {
1971
1971
  const c = t.substring(0, s), d = t.substring(s);
1972
1972
  return `${c} {{ filters | where }} AND ${d.substring(
1973
1973
  6
@@ -1982,7 +1982,7 @@ function El(t) {
1982
1982
  }
1983
1983
  function Vl({ sql: t, error: s, onClick: a }) {
1984
1984
  return !t && !s ? null : /* @__PURE__ */ n(Na, { openDelay: s ? 0 : 500, children: [
1985
- /* @__PURE__ */ e(Ca, { asChild: !0, children: /* @__PURE__ */ e(z, { variant: "link", className: "h-5 p-0", children: s ? /* @__PURE__ */ e(Ks, { className: "h-4 w-4 text-red-500" }) : /* @__PURE__ */ e(zn, { className: "h-4 w-4 text-muted-foreground" }) }) }),
1985
+ /* @__PURE__ */ e(Ca, { asChild: !0, children: /* @__PURE__ */ e(z, { variant: "link", className: "h-5 p-0", children: s ? /* @__PURE__ */ e(Ks, { className: "h-4 w-4 text-red-500" }) : /* @__PURE__ */ e(Ln, { className: "h-4 w-4 text-muted-foreground" }) }) }),
1986
1986
  /* @__PURE__ */ e(
1987
1987
  Sa,
1988
1988
  {
@@ -2006,7 +2006,7 @@ function Vl({ sql: t, error: s, onClick: a }) {
2006
2006
  ] });
2007
2007
  }
2008
2008
  function ql() {
2009
- const [t, s] = P([]), [a, l] = P(""), [i, o] = P(null), { authToken: c } = Te(), d = m((k) => {
2009
+ const [t, s] = H([]), [a, l] = H(""), [r, o] = H(null), { authToken: c } = Te(), d = m((k) => {
2010
2010
  var J;
2011
2011
  return (J = k == null ? void 0 : k.card) == null ? void 0 : J.sql;
2012
2012
  }), u = m((k) => {
@@ -2014,7 +2014,7 @@ function ql() {
2014
2014
  return (J = k == null ? void 0 : k.card) == null ? void 0 : J.python;
2015
2015
  }), f = m((k) => k.actions.setCardSql), h = m((k) => k.actions.setRunSql), b = m(
2016
2016
  (k) => k.actions.switchCardType
2017
- ), v = m((k) => k.userInputForAI), r = m((k) => k.triggerAIRun), y = m(
2017
+ ), N = m((k) => k.userInputForAI), i = m((k) => k.triggerAIRun), y = m(
2018
2018
  (k) => k.selectedDatabaseName
2019
2019
  ), g = m((k) => k.selectedTableName), C = m(
2020
2020
  (k) => k.selectedConnectionId
@@ -2022,7 +2022,7 @@ function ql() {
2022
2022
  (k) => k.selectedSchemaName
2023
2023
  ), O = D(
2024
2024
  (k) => k.dashboard.aiScopeTables
2025
- ), { setTriggerAIRun: S } = ie(), { selectedDatamodelName: M, connectionType: q, selectedDatamodelId: F } = Ae(), {
2025
+ ), { setTriggerAIRun: S } = re(), { selectedDatamodelName: M, connectionType: V, selectedDatamodelId: F } = Ae(), {
2026
2026
  messages: G,
2027
2027
  setMessages: _,
2028
2028
  reload: B,
@@ -2032,8 +2032,8 @@ function ql() {
2032
2032
  status: A,
2033
2033
  handleInputChange: U,
2034
2034
  handleSubmit: K,
2035
- stop: V
2036
- } = Ln({
2035
+ stop: P
2036
+ } = Fn({
2037
2037
  api: "https://semaphor.cloud/api/v1/assistant",
2038
2038
  headers: {
2039
2039
  Authorization: `Bearer ${c == null ? void 0 : c.accessToken}`
@@ -2043,25 +2043,25 @@ function ql() {
2043
2043
  },
2044
2044
  maxSteps: 10,
2045
2045
  //maxToolRoundtrips: 5,
2046
- onToolCall: N,
2046
+ onToolCall: v,
2047
2047
  onFinish(k, J) {
2048
2048
  I(J.usage), l(""), console.log("onFinish", k, J), J.finishReason === "stop" && l("");
2049
2049
  }
2050
2050
  });
2051
2051
  de(() => {
2052
- r && v && (U({
2053
- target: { value: v }
2052
+ i && N && (U({
2053
+ target: { value: N }
2054
2054
  }), setTimeout(() => {
2055
2055
  K(), S(!1);
2056
2056
  }, 100));
2057
2057
  }, [
2058
- r,
2058
+ i,
2059
2059
  K,
2060
- v,
2060
+ N,
2061
2061
  S,
2062
2062
  U
2063
2063
  ]);
2064
- async function N({
2064
+ async function v({
2065
2065
  toolCall: k
2066
2066
  }) {
2067
2067
  if (k.toolName === "createChart") {
@@ -2099,8 +2099,8 @@ function ql() {
2099
2099
  totalTokens: J.totalTokens + k.totalTokens
2100
2100
  } : k);
2101
2101
  }
2102
- function H(k) {
2103
- const J = An(t, k);
2102
+ function R(k) {
2103
+ const J = En(t, k);
2104
2104
  X(J);
2105
2105
  }
2106
2106
  function Z(k) {
@@ -2120,15 +2120,15 @@ function ql() {
2120
2120
  }
2121
2121
  ]);
2122
2122
  }
2123
- function j() {
2123
+ function q() {
2124
2124
  const k = {
2125
2125
  databaseName: y || "",
2126
2126
  schemaName: x || "",
2127
2127
  tableName: g || "",
2128
2128
  datamodelId: F || "",
2129
- datamodelName: it(M),
2129
+ datamodelName: rt(M),
2130
2130
  connectionId: C || "",
2131
- connectionType: q || ""
2131
+ connectionType: V || ""
2132
2132
  }, J = Jt([...t, k]);
2133
2133
  X(J);
2134
2134
  }
@@ -2137,12 +2137,12 @@ function ql() {
2137
2137
  databaseName: y || "",
2138
2138
  schemaName: x || "",
2139
2139
  tableName: g || "",
2140
- datamodelName: it(M),
2140
+ datamodelName: rt(M),
2141
2141
  connectionId: C || "",
2142
- connectionType: q || "",
2142
+ connectionType: V || "",
2143
2143
  datamodelId: F || ""
2144
2144
  };
2145
- if (!Fn(
2145
+ if (!An(
2146
2146
  [...O || [], ...t],
2147
2147
  k
2148
2148
  ) || t.length === 0) {
@@ -2166,22 +2166,22 @@ function ql() {
2166
2166
  setInput: W,
2167
2167
  isLoading: ue,
2168
2168
  handleSetAIScope: L,
2169
- handleAddCurrentTableToScope: j,
2170
- removeFromCurrentSelections: H,
2169
+ handleAddCurrentTableToScope: q,
2170
+ removeFromCurrentSelections: R,
2171
2171
  currentScope: t,
2172
2172
  setCurrentScope: s,
2173
2173
  handleInputChange: U,
2174
2174
  handleSubmit: K,
2175
- stop: V,
2175
+ stop: P,
2176
2176
  chatStatus: A,
2177
2177
  toolStatus: a,
2178
- llmUsage: i
2178
+ llmUsage: r
2179
2179
  };
2180
2180
  }
2181
2181
  const jl = !1;
2182
2182
  function Rl() {
2183
- const t = m((V) => V.showAIDialog), s = Je(t), a = Je(null), l = Je(null), [i, o] = P(!1), [c, d] = P(jl), [u, f] = P(!1), h = m((V) => V.actions.setCardSql), b = m((V) => V.actions.setRunSql), { setShowAIDialog: v } = ie(), {
2184
- messages: r,
2183
+ const t = m((v) => v.showAIDialog), s = Je(t), a = Je(null), l = Je(null), [r, o] = H(!1), [c, d] = H(jl), [u, f] = H(!1), h = m((v) => v.actions.setCardSql), b = m((v) => v.actions.setRunSql), { setShowAIDialog: N } = re(), {
2184
+ messages: i,
2185
2185
  setMessages: y,
2186
2186
  reload: g,
2187
2187
  input: C,
@@ -2189,7 +2189,7 @@ function Rl() {
2189
2189
  isLoading: O,
2190
2190
  handleSetAIScope: S,
2191
2191
  handleAddCurrentTableToScope: M,
2192
- removeFromCurrentSelections: q,
2192
+ removeFromCurrentSelections: V,
2193
2193
  currentScope: F,
2194
2194
  setCurrentScope: G,
2195
2195
  handleInputChange: _,
@@ -2200,30 +2200,30 @@ function Rl() {
2200
2200
  llmUsage: A
2201
2201
  } = ql();
2202
2202
  de(() => {
2203
- const V = s.current ? "smooth" : "auto";
2203
+ const v = s.current ? "smooth" : "auto";
2204
2204
  s.current = t;
2205
- const N = setTimeout(() => {
2206
- var I;
2205
+ const I = setTimeout(() => {
2206
+ var R;
2207
2207
  a.current && (a.current.scroll({
2208
2208
  top: a.current.scrollHeight,
2209
- behavior: V
2210
- }), (I = l.current) == null || I.focus());
2209
+ behavior: v
2210
+ }), (R = l.current) == null || R.focus());
2211
2211
  }, 50);
2212
- return () => clearTimeout(N);
2213
- }, [r, t]);
2214
- function U(V) {
2215
- v(!1), h(V), b(!0);
2212
+ return () => clearTimeout(I);
2213
+ }, [i, t]);
2214
+ function U(v) {
2215
+ N(!1), h(v), b(!0);
2216
2216
  }
2217
2217
  function K() {
2218
2218
  return /* @__PURE__ */ n(la, { children: [
2219
- /* @__PURE__ */ e(ia, { children: /* @__PURE__ */ e(z, { className: "h-7 p-2", size: "sm", variant: "ghost", children: /* @__PURE__ */ e(Ga, { className: "size-3.5 text-muted-foreground/70 hover:text-muted-foreground" }) }) }),
2220
- /* @__PURE__ */ n(ra, { align: "end", children: [
2219
+ /* @__PURE__ */ e(ra, { children: /* @__PURE__ */ e(z, { className: "h-7 p-2", size: "sm", variant: "ghost", children: /* @__PURE__ */ e(Ba, { className: "size-3.5 text-muted-foreground/70 hover:text-muted-foreground" }) }) }),
2220
+ /* @__PURE__ */ n(ia, { align: "end", children: [
2221
2221
  /* @__PURE__ */ e(oa, { children: "Options" }),
2222
2222
  /* @__PURE__ */ e(ca, {}),
2223
2223
  /* @__PURE__ */ e(
2224
2224
  xt,
2225
2225
  {
2226
- checked: i,
2226
+ checked: r,
2227
2227
  onCheckedChange: o,
2228
2228
  children: "Token Usage"
2229
2229
  }
@@ -2247,7 +2247,8 @@ function Rl() {
2247
2247
  ] })
2248
2248
  ] });
2249
2249
  }
2250
- return /* @__PURE__ */ n(Mt, { open: t, onOpenChange: v, children: [
2250
+ const P = (C == null ? void 0 : C.length) === 0 && (i == null ? void 0 : i.filter((v) => v.role === "user").length) === 0;
2251
+ return /* @__PURE__ */ n(Mt, { open: t, onOpenChange: N, children: [
2251
2252
  /* @__PURE__ */ e(Tt, { asChild: !0, children: /* @__PURE__ */ e(
2252
2253
  z,
2253
2254
  {
@@ -2264,29 +2265,29 @@ function Rl() {
2264
2265
  /* @__PURE__ */ e(Lt, { children: "Assistant" }),
2265
2266
  F && F.length > 0 && /* @__PURE__ */ n("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: [
2266
2267
  /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "Context:" }),
2267
- F == null ? void 0 : F.map((V, N) => /* @__PURE__ */ n(
2268
+ F == null ? void 0 : F.map((v, I) => /* @__PURE__ */ n(
2268
2269
  "div",
2269
2270
  {
2270
2271
  className: "flex items-center gap-2 rounded-md border border-border bg-muted px-2 py-1 text-xs",
2271
2272
  children: [
2272
2273
  Nt({
2273
- schemaName: V.schemaName || "",
2274
- tableName: V.tableName || "",
2275
- modelName: V.datamodelName || "",
2276
- connectionType: V.connectionType || ""
2274
+ schemaName: v.schemaName || "",
2275
+ tableName: v.tableName || "",
2276
+ modelName: v.datamodelName || "",
2277
+ connectionType: v.connectionType || ""
2277
2278
  }),
2278
2279
  /* @__PURE__ */ e(
2279
2280
  "button",
2280
2281
  {
2281
2282
  onClick: () => {
2282
- q(V);
2283
+ V(v);
2283
2284
  },
2284
2285
  children: /* @__PURE__ */ e(et, { className: "size-3 text-muted-foreground hover:text-foreground" })
2285
2286
  }
2286
2287
  )
2287
2288
  ]
2288
2289
  },
2289
- N
2290
+ I
2290
2291
  ))
2291
2292
  ] }),
2292
2293
  (F == null ? void 0 : F.length) === 0 && /* @__PURE__ */ n("div", { className: "mt-2 flex items-center gap-2", children: [
@@ -2317,31 +2318,32 @@ function Rl() {
2317
2318
  onClick: () => {
2318
2319
  y([]), G([]), g();
2319
2320
  },
2320
- children: /* @__PURE__ */ e(En, { className: "size-3.5 text-muted-foreground" })
2321
+ children: /* @__PURE__ */ e(Vn, { className: "size-3.5 text-muted-foreground" })
2321
2322
  }
2322
2323
  )
2323
2324
  ] })
2324
2325
  ] }) }),
2325
2326
  /* @__PURE__ */ e("div", { ref: a, className: "h-[700px] w-full overflow-auto", children: /* @__PURE__ */ n("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: [
2326
2327
  /* @__PURE__ */ e(
2327
- Vn,
2328
+ qn,
2328
2329
  {
2329
- messages: r,
2330
+ messages: i,
2330
2331
  showTools: c,
2331
2332
  handleRun: U,
2332
2333
  showSystemMessage: u
2333
2334
  }
2334
2335
  ),
2335
2336
  /* @__PURE__ */ e(
2336
- qn,
2337
+ jn,
2337
2338
  {
2338
- status: jn(E, W),
2339
+ status: Rn(E, W),
2339
2340
  isLoading: O
2340
2341
  }
2341
2342
  )
2342
2343
  ] }) }),
2344
+ P && /* @__PURE__ */ e(_n, {}),
2343
2345
  /* @__PURE__ */ e(
2344
- Rn,
2346
+ Hn,
2345
2347
  {
2346
2348
  stop: p,
2347
2349
  ref: l,
@@ -2352,7 +2354,7 @@ function Rl() {
2352
2354
  isLoading: O
2353
2355
  }
2354
2356
  ),
2355
- A && i && /* @__PURE__ */ e("div", { className: "flex h-8 items-center justify-between", children: /* @__PURE__ */ n("div", { className: "text-xs text-muted-foreground", children: [
2357
+ A && r && /* @__PURE__ */ e("div", { className: "flex h-8 items-center justify-between", children: /* @__PURE__ */ n("div", { className: "text-xs text-muted-foreground", children: [
2356
2358
  "Usage: ",
2357
2359
  A.promptTokens,
2358
2360
  " prompt tokens,",
@@ -2366,20 +2368,20 @@ function Rl() {
2366
2368
  ] })
2367
2369
  ] });
2368
2370
  }
2369
- var en = {
2371
+ var tn = {
2370
2372
  color: void 0,
2371
2373
  size: void 0,
2372
2374
  className: void 0,
2373
2375
  style: void 0,
2374
2376
  attr: void 0
2375
- }, Xt = Ie.createContext && /* @__PURE__ */ Ie.createContext(en), _l = ["attr", "size", "title"];
2377
+ }, Xt = Ie.createContext && /* @__PURE__ */ Ie.createContext(tn), _l = ["attr", "size", "title"];
2376
2378
  function Hl(t, s) {
2377
2379
  if (t == null) return {};
2378
- var a = Pl(t, s), l, i;
2380
+ var a = Pl(t, s), l, r;
2379
2381
  if (Object.getOwnPropertySymbols) {
2380
2382
  var o = Object.getOwnPropertySymbols(t);
2381
- for (i = 0; i < o.length; i++)
2382
- l = o[i], !(s.indexOf(l) >= 0) && Object.prototype.propertyIsEnumerable.call(t, l) && (a[l] = t[l]);
2383
+ for (r = 0; r < o.length; r++)
2384
+ l = o[r], !(s.indexOf(l) >= 0) && Object.prototype.propertyIsEnumerable.call(t, l) && (a[l] = t[l]);
2383
2385
  }
2384
2386
  return a;
2385
2387
  }
@@ -2407,8 +2409,8 @@ function Yt(t, s) {
2407
2409
  var a = Object.keys(t);
2408
2410
  if (Object.getOwnPropertySymbols) {
2409
2411
  var l = Object.getOwnPropertySymbols(t);
2410
- s && (l = l.filter(function(i) {
2411
- return Object.getOwnPropertyDescriptor(t, i).enumerable;
2412
+ s && (l = l.filter(function(r) {
2413
+ return Object.getOwnPropertyDescriptor(t, r).enumerable;
2412
2414
  })), a.push.apply(a, l);
2413
2415
  }
2414
2416
  return a;
@@ -2441,23 +2443,23 @@ function Bl(t, s) {
2441
2443
  }
2442
2444
  return (s === "string" ? String : Number)(t);
2443
2445
  }
2444
- function tn(t) {
2446
+ function an(t) {
2445
2447
  return t && t.map((s, a) => /* @__PURE__ */ Ie.createElement(s.tag, ut({
2446
2448
  key: a
2447
- }, s.attr), tn(s.child)));
2449
+ }, s.attr), an(s.child)));
2448
2450
  }
2449
2451
  function Pe(t) {
2450
2452
  return (s) => /* @__PURE__ */ Ie.createElement(Ul, dt({
2451
2453
  attr: ut({}, t.attr)
2452
- }, s), tn(t.child));
2454
+ }, s), an(t.child));
2453
2455
  }
2454
2456
  function Ul(t) {
2455
2457
  var s = (a) => {
2456
2458
  var {
2457
2459
  attr: l,
2458
- size: i,
2460
+ size: r,
2459
2461
  title: o
2460
- } = t, c = Hl(t, _l), d = i || a.size || "1em", u;
2462
+ } = t, c = Hl(t, _l), d = r || a.size || "1em", u;
2461
2463
  return a.className && (u = a.className), t.className && (u = (u ? u + " " : "") + t.className), /* @__PURE__ */ Ie.createElement("svg", dt({
2462
2464
  stroke: "currentColor",
2463
2465
  fill: "currentColor",
@@ -2472,38 +2474,38 @@ function Ul(t) {
2472
2474
  xmlns: "http://www.w3.org/2000/svg"
2473
2475
  }), o && /* @__PURE__ */ Ie.createElement("title", null, o), t.children);
2474
2476
  };
2475
- return Xt !== void 0 ? /* @__PURE__ */ Ie.createElement(Xt.Consumer, null, (a) => s(a)) : s(en);
2477
+ return Xt !== void 0 ? /* @__PURE__ */ Ie.createElement(Xt.Consumer, null, (a) => s(a)) : s(tn);
2476
2478
  }
2477
2479
  function Jl(t) {
2478
2480
  return Pe({ 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: [] }] })(t);
2479
2481
  }
2480
- function an(t) {
2481
- const { theme: s } = _n(), a = D((g) => g.theme), l = m((g) => g.frame), i = m((g) => g.card), o = m((g) => g.activeTabCardId), c = Hn(), { refetch: d } = Le(i), { updateCardTab: u, setRunSql: f } = ie(), h = Je(), b = Je({}), v = l.cards.find((g) => g.id === o), r = ja(() => {
2482
+ function nn(t) {
2483
+ const { theme: s } = Pn(), a = D((g) => g.theme), l = m((g) => g.frame), r = m((g) => g.card), o = m((g) => g.activeTabCardId), c = $n(), { refetch: d } = Le(r), { updateCardTab: u, setRunSql: f } = re(), h = Je(), b = Je({}), N = l.cards.find((g) => g.id === o), i = Ra(() => {
2482
2484
  let g = "";
2483
- return t === "python" && (g = (v == null ? void 0 : v.python) || Ma), t === "sql" && (g = (v == null ? void 0 : v.sql) || ""), g;
2484
- }, [t, v]);
2485
+ return t === "python" && (g = (N == null ? void 0 : N.python) || Ma), t === "sql" && (g = (N == null ? void 0 : N.sql) || ""), g;
2486
+ }, [t, N]);
2485
2487
  de(() => {
2486
- if (o && i.id && i.id !== o) {
2488
+ if (o && r.id && r.id !== o) {
2487
2489
  if (h.current && c) {
2488
2490
  const g = h.current.getModel();
2489
- g && (b.current[i.id] = g);
2491
+ g && (b.current[r.id] = g);
2490
2492
  let C = b.current[o];
2491
2493
  if (!C) {
2492
- const x = r();
2494
+ const x = i();
2493
2495
  C = c.editor.createModel(x, t), b.current[o] = C;
2494
2496
  }
2495
2497
  h.current.setModel(C);
2496
2498
  }
2497
- u(o, i), f(!0);
2499
+ u(o, r), f(!0);
2498
2500
  }
2499
2501
  }, [
2500
2502
  o,
2501
- i,
2503
+ r,
2502
2504
  u,
2503
2505
  c,
2504
2506
  f,
2505
2507
  t,
2506
- r
2508
+ i
2507
2509
  ]), de(() => {
2508
2510
  if (!c) return;
2509
2511
  const g = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", C = a === "system" ? g : a;
@@ -2513,7 +2515,7 @@ function an(t) {
2513
2515
  inherit: !0,
2514
2516
  rules: [],
2515
2517
  colors: {
2516
- "editor.background": C === "light" ? "#ffffff" : Pn("240 10% 10%")
2518
+ "editor.background": C === "light" ? "#ffffff" : Gn("240 10% 10%")
2517
2519
  // 'editor.background':
2518
2520
  // activeTheme === 'light'
2519
2521
  // ? '#ffffff'
@@ -2522,26 +2524,26 @@ function an(t) {
2522
2524
  }), c.editor.setTheme("default");
2523
2525
  }, [s, a, c]), de(() => {
2524
2526
  const g = h.current;
2525
- g && c && i && g.addCommand(
2527
+ g && c && r && g.addCommand(
2526
2528
  c.KeyMod.Shift | c.KeyCode.Enter,
2527
2529
  function() {
2528
2530
  return d(), !1;
2529
2531
  }
2530
2532
  );
2531
- }, [c, d, i]);
2533
+ }, [c, d, r]);
2532
2534
  function y(g, C) {
2533
- if (h.current = g, !b.current[i.id]) {
2534
- const x = g.getModel(), O = r();
2535
- b.current[i.id] = x || (C == null ? void 0 : C.editor.createModel(O, t)) || g.getModel();
2535
+ if (h.current = g, !b.current[r.id]) {
2536
+ const x = g.getModel(), O = i();
2537
+ b.current[r.id] = x || (C == null ? void 0 : C.editor.createModel(O, t)) || g.getModel();
2536
2538
  }
2537
- g.setModel(b.current[i.id]);
2539
+ g.setModel(b.current[r.id]);
2538
2540
  }
2539
2541
  return { handleEditorDidMount: y };
2540
2542
  }
2541
2543
  function Wl() {
2542
- const t = m((c) => c.card.sql), s = m((c) => c.sqlGen), { setCardSql: a, setSqlGen: l } = ie(), { handleEditorDidMount: i } = an("sql");
2544
+ const t = m((c) => c.card.sql), s = m((c) => c.sqlGen), { setCardSql: a, setSqlGen: l } = re(), { handleEditorDidMount: r } = nn("sql");
2543
2545
  function o(c) {
2544
- a(c), $n(s) || l({});
2546
+ a(c), Bn(s) || l({});
2545
2547
  }
2546
2548
  return /* @__PURE__ */ e(
2547
2549
  mt,
@@ -2563,14 +2565,14 @@ function Wl() {
2563
2565
  renderLineHighlight: "none"
2564
2566
  },
2565
2567
  defaultLanguage: "sql",
2566
- onMount: i
2568
+ onMount: r
2567
2569
  }
2568
2570
  );
2569
2571
  }
2570
2572
  function Kl() {
2571
- const t = m((i) => i.card.python), { setCardPython: s } = ie(), { handleEditorDidMount: a } = an("python");
2572
- function l(i) {
2573
- s(i);
2573
+ const t = m((r) => r.card.python), { setCardPython: s } = re(), { handleEditorDidMount: a } = nn("python");
2574
+ function l(r) {
2575
+ s(r);
2574
2576
  }
2575
2577
  return /* @__PURE__ */ e(
2576
2578
  mt,
@@ -2624,78 +2626,78 @@ function Ql({ jsonString: t }) {
2624
2626
  }
2625
2627
  function Zl() {
2626
2628
  var ce;
2627
- const [t, s] = P({
2629
+ const [t, s] = H({
2628
2630
  queryKey: [],
2629
2631
  queryData: null
2630
- }), a = Gn(), [l, i] = P(!1), [o, c] = P(!1), d = m((T) => T.frame), u = m((T) => T.card), f = m((T) => T.isShowingVisual), h = m(
2632
+ }), a = Un(), [l, r] = H(!1), [o, c] = H(!1), d = m((T) => T.frame), u = m((T) => T.card), f = m((T) => T.isShowingVisual), h = m(
2631
2633
  (T) => T.selectedConnectionId
2632
2634
  ), b = m(
2633
2635
  (T) => T.selectedDatabaseName
2634
- ), v = m(
2636
+ ), N = m(
2635
2637
  (T) => T.selectedDatamodelId
2636
- ), r = m(
2638
+ ), i = m(
2637
2639
  (T) => T.selectedSchemaName
2638
2640
  ), y = m((T) => T.selectedTableName), g = m((T) => {
2639
- var re;
2640
- return (re = T == null ? void 0 : T.card) == null ? void 0 : re.sql;
2641
- }), { sheetFilterValues: C } = Bn(), {
2641
+ var ie;
2642
+ return (ie = T == null ? void 0 : T.card) == null ? void 0 : ie.sql;
2643
+ }), { sheetFilterValues: C } = Jn(), {
2642
2644
  setCardCustomCfg: x,
2643
2645
  setQueryResultColumns: O,
2644
2646
  setCardSql: S,
2645
2647
  // setQueryError,
2646
2648
  setPythonStdOut: M,
2647
- setCardPreferences: q,
2649
+ setCardPreferences: V,
2648
2650
  setCardType: F,
2649
2651
  setCardPython: G,
2650
2652
  runAssistant: _
2651
- } = ie(), B = m((T) => T.onSave), p = m((T) => T.onClose), E = m((T) => T.actions.setSqlGen), W = m((T) => T.runSql), A = m((T) => T.actions.setRunSql), U = m((T) => T.actions.setCardCfg), K = m(
2653
+ } = re(), B = m((T) => T.onSave), p = m((T) => T.onClose), E = m((T) => T.actions.setSqlGen), W = m((T) => T.runSql), A = m((T) => T.actions.setRunSql), U = m((T) => T.actions.setCardCfg), K = m(
2652
2654
  (T) => T.actions.setIsSqlRunning
2653
2655
  ), {
2654
- data: V,
2655
- isLoading: N,
2656
+ data: P,
2657
+ isLoading: v,
2656
2658
  isFetching: I,
2657
- isSuccess: H,
2659
+ isSuccess: R,
2658
2660
  isError: Z,
2659
2661
  error: X,
2660
- queryKey: j,
2662
+ queryKey: q,
2661
2663
  refetch: L
2662
2664
  } = Le(u);
2663
2665
  de(() => {
2664
- if (V && (V.rowLimitExceeded && lt.error("Row limit (10,000) exceeded. Refine your query.", {
2666
+ if (P && (P.rowLimitExceeded && lt.error("Row limit (10,000) exceeded. Refine your query.", {
2665
2667
  position: "top-center",
2666
2668
  richColors: !0
2667
- }), M((V == null ? void 0 : V.output) || ""), V.records.length > 0)) {
2668
- const { dimensionKeys: T } = Ct(V.records);
2669
+ }), M((P == null ? void 0 : P.output) || ""), P.records.length > 0)) {
2670
+ const { dimensionKeys: T } = Ct(P.records);
2669
2671
  O(T);
2670
2672
  }
2671
- }, [V, O, M]), de(() => {
2672
- (N || I) && K(!0), (Z || H) && K(!1), Z && (O([]), M(""));
2673
+ }, [P, O, M]), de(() => {
2674
+ (v || I) && K(!0), (Z || R) && K(!1), Z && (O([]), M(""));
2673
2675
  }, [
2674
- N,
2676
+ v,
2675
2677
  I,
2676
- V,
2678
+ P,
2677
2679
  M,
2678
2680
  Z,
2679
- H,
2681
+ R,
2680
2682
  K,
2681
2683
  O,
2682
2684
  // setQueryError,
2683
2685
  X
2684
2686
  ]), de(() => {
2685
- W && (a.getQueryData(j) || L(), A(!1));
2686
- }, [W, L, A, j, a]);
2687
+ W && (a.getQueryData(q) || L(), A(!1));
2688
+ }, [W, L, A, q, a]);
2687
2689
  function ue() {
2688
- const T = a.getQueryData(j);
2690
+ const T = a.getQueryData(q);
2689
2691
  t.queryData || s({
2690
- queryKey: j,
2692
+ queryKey: q,
2691
2693
  queryData: T
2692
- }), a.setQueryData(j, null), a.removeQueries({ queryKey: j, exact: !0 }), S(""), E({}), G(""), U(void 0), x(""), q({}), F("bar");
2694
+ }), a.setQueryData(q, null), a.removeQueries({ queryKey: q, exact: !0 }), S(""), E({}), G(""), U(void 0), x(""), V({}), F("bar");
2693
2695
  }
2694
- function k(T, re) {
2696
+ function k(T, ie) {
2695
2697
  if (T.length === 0)
2696
2698
  return "";
2697
- if (re) {
2698
- const ye = T.find((be) => be.id === re);
2699
+ if (ie) {
2700
+ const ye = T.find((be) => be.id === ie);
2699
2701
  if (ye) {
2700
2702
  const be = ye.tabTitle;
2701
2703
  if (be == "All__Header")
@@ -2706,7 +2708,7 @@ function Zl() {
2706
2708
  );
2707
2709
  return tt ? tt.id : T[0].id;
2708
2710
  }
2709
- return re;
2711
+ return ie;
2710
2712
  }
2711
2713
  }
2712
2714
  return T[0].id;
@@ -2714,10 +2716,10 @@ function Zl() {
2714
2716
  function J() {
2715
2717
  let T = g;
2716
2718
  g && !g.includes("{{") && (T = El(g), S(T));
2717
- const re = {
2719
+ const ie = {
2718
2720
  ...u,
2719
- lastSelectedSchema: r,
2720
- lastSelectedDatamodelId: v,
2721
+ lastSelectedSchema: i,
2722
+ lastSelectedDatamodelId: N,
2721
2723
  lastSelectedDatabase: b,
2722
2724
  lastSelectedTable: y,
2723
2725
  connectionId: h,
@@ -2725,7 +2727,7 @@ function Zl() {
2725
2727
  sql: T,
2726
2728
  customCfg: f ? u.customCfg : null
2727
2729
  }, ye = d.cards.map(
2728
- (Ge) => Ge.id === u.id ? re : Ge
2730
+ (Ge) => Ge.id === u.id ? ie : Ge
2729
2731
  ), be = {
2730
2732
  ...d,
2731
2733
  cards: ye,
@@ -2734,8 +2736,8 @@ function Zl() {
2734
2736
  B == null || B(be);
2735
2737
  }
2736
2738
  function se() {
2737
- const { queryKey: T, queryData: re } = t;
2738
- T && re && a.setQueryData(T, re), E({}), p == null || p();
2739
+ const { queryKey: T, queryData: ie } = t;
2740
+ T && ie && a.setQueryData(T, ie), E({}), p == null || p();
2739
2741
  }
2740
2742
  async function oe() {
2741
2743
  const T = `Can you help me debug this query in the current table scope?
@@ -2779,7 +2781,7 @@ function Zl() {
2779
2781
  }
2780
2782
  function xe() {
2781
2783
  return /* @__PURE__ */ n(
2782
- rt,
2784
+ it,
2783
2785
  {
2784
2786
  className: "flex grow pb-1",
2785
2787
  direction: "vertical",
@@ -2832,7 +2834,7 @@ function Zl() {
2832
2834
  }
2833
2835
  );
2834
2836
  }
2835
- const Y = (X == null ? void 0 : X.message) || ((ce = V == null ? void 0 : V.error) == null ? void 0 : ce.message);
2837
+ const Y = (X == null ? void 0 : X.message) || ((ce = P == null ? void 0 : P.error) == null ? void 0 : ce.message);
2836
2838
  return (
2837
2839
  // This is a tricky css, the pt-8 is to make sure the editor doesn't slide under the header
2838
2840
  /* @__PURE__ */ n(
@@ -2856,14 +2858,14 @@ function Zl() {
2856
2858
  z,
2857
2859
  {
2858
2860
  title: "Shift + Enter",
2859
- disabled: N || I,
2861
+ disabled: v || I,
2860
2862
  onClick: () => {
2861
2863
  L();
2862
2864
  },
2863
2865
  className: "shrink-0",
2864
2866
  size: "sm",
2865
2867
  children: [
2866
- N || I ? /* @__PURE__ */ e(Ze, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(Un, { className: "mr-2 h-4 w-4" }),
2868
+ v || I ? /* @__PURE__ */ e(Ze, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(Wn, { className: "mr-2 h-4 w-4" }),
2867
2869
  "Run"
2868
2870
  ]
2869
2871
  }
@@ -2871,7 +2873,7 @@ function Zl() {
2871
2873
  /* @__PURE__ */ e(
2872
2874
  Vl,
2873
2875
  {
2874
- sql: V == null ? void 0 : V.sql,
2876
+ sql: P == null ? void 0 : P.sql,
2875
2877
  error: Y,
2876
2878
  onClick: oe
2877
2879
  }
@@ -2893,7 +2895,7 @@ function Zl() {
2893
2895
  Ia,
2894
2896
  {
2895
2897
  pressed: l,
2896
- onPressedChange: (T) => i(T),
2898
+ onPressedChange: (T) => r(T),
2897
2899
  className: "",
2898
2900
  size: "sm",
2899
2901
  children: /* @__PURE__ */ e(Jl, { className: "size-4 text-foreground/70" })
@@ -2938,7 +2940,7 @@ function Zl() {
2938
2940
  }
2939
2941
  function Xl({ data: t }) {
2940
2942
  var c;
2941
- const [s, a] = Ie.useState([]), i = Object.keys(t[0]).map((d) => ({
2943
+ const [s, a] = Ie.useState([]), r = Object.keys(t[0]).map((d) => ({
2942
2944
  // header: key,
2943
2945
  accessorKey: d,
2944
2946
  header: ({ column: u }) => {
@@ -2950,26 +2952,26 @@ function Xl({ data: t }) {
2950
2952
  onClick: () => u.toggleSorting(u.getIsSorted() === "asc"),
2951
2953
  children: [
2952
2954
  d,
2953
- f === "asc" ? /* @__PURE__ */ e(Jn, { className: "ml-2 h-5 w-5" }) : f === "desc" ? /* @__PURE__ */ e(Wn, { className: "ml-2 h-5 w-5" }) : null
2955
+ f === "asc" ? /* @__PURE__ */ e(Kn, { className: "ml-2 h-5 w-5" }) : f === "desc" ? /* @__PURE__ */ e(Qn, { className: "ml-2 h-5 w-5" }) : null
2954
2956
  ]
2955
2957
  }
2956
2958
  ) });
2957
2959
  }
2958
- })), o = Kn({
2960
+ })), o = Zn({
2959
2961
  data: t,
2960
- columns: i,
2961
- getCoreRowModel: ts(),
2962
- getPaginationRowModel: es(),
2962
+ columns: r,
2963
+ getCoreRowModel: ns(),
2964
+ getPaginationRowModel: as(),
2963
2965
  onSortingChange: a,
2964
- getSortedRowModel: Yn(),
2966
+ getSortedRowModel: ts(),
2965
2967
  manualPagination: !0,
2966
2968
  state: {
2967
2969
  sorting: s
2968
2970
  }
2969
2971
  });
2970
2972
  return /* @__PURE__ */ e("div", { className: "font-mono text-xs text-foreground/95", children: /* @__PURE__ */ n("table", { className: "w-full", children: [
2971
- /* @__PURE__ */ e(Qn, { children: o.getHeaderGroups().map((d) => /* @__PURE__ */ e(vt, { children: d.headers.map((u) => /* @__PURE__ */ e(
2972
- Zn,
2973
+ /* @__PURE__ */ e(Xn, { children: o.getHeaderGroups().map((d) => /* @__PURE__ */ e(vt, { children: d.headers.map((u) => /* @__PURE__ */ e(
2974
+ Yn,
2973
2975
  {
2974
2976
  className: "sticky top-0 h-11 bg-muted font-semibold",
2975
2977
  children: u.isPlaceholder ? null : Wt(
@@ -2979,7 +2981,7 @@ function Xl({ data: t }) {
2979
2981
  },
2980
2982
  u.id
2981
2983
  )) }, d.id)) }),
2982
- /* @__PURE__ */ e(Xn, { children: (c = o.getRowModel().rows) != null && c.length ? o.getRowModel().rows.map((d) => /* @__PURE__ */ e(
2984
+ /* @__PURE__ */ e(es, { children: (c = o.getRowModel().rows) != null && c.length ? o.getRowModel().rows.map((d) => /* @__PURE__ */ e(
2983
2985
  vt,
2984
2986
  {
2985
2987
  className: "whitespace-nowrap py-2",
@@ -2987,19 +2989,19 @@ function Xl({ data: t }) {
2987
2989
  children: d.getVisibleCells().map((u) => /* @__PURE__ */ e(Kt, { className: "py-3", children: Wt(u.column.columnDef.cell, u.getContext()) }, u.id))
2988
2990
  },
2989
2991
  d.id
2990
- )) : /* @__PURE__ */ e(vt, { children: /* @__PURE__ */ e(Kt, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
2992
+ )) : /* @__PURE__ */ e(vt, { children: /* @__PURE__ */ e(Kt, { colSpan: r.length, className: "h-24 text-center", children: "No results." }) }) })
2991
2993
  ] }) });
2992
2994
  }
2993
2995
  function Yl({ card: t }) {
2994
- var O, S, M, q, F, G, _, B, p, E, W;
2995
- const [s, a] = P(!1), [l, i] = P(
2996
+ var O, S, M, V, F, G, _, B, p, E, W;
2997
+ const [s, a] = H(!1), [l, r] = H(
2996
2998
  []
2997
- ), { authToken: o } = Te(), c = as(o == null ? void 0 : o.accessToken), d = D((A) => A.themeStyle), u = {
2999
+ ), { authToken: o } = Te(), c = ss(o == null ? void 0 : o.accessToken), d = D((A) => A.themeStyle), u = {
2998
3000
  colors: ((S = (O = d == null ? void 0 : d.chart) == null ? void 0 : O.dataset) == null ? void 0 : S.backgroundColor) || []
2999
3001
  };
3000
3002
  (M = t.customCardPreferences) != null && M.inputData;
3001
- const { getCard: f } = Ta(((q = t.customCardPreferences) == null ? void 0 : q.url) || ""), h = ((F = t.customCardPreferences) == null ? void 0 : F.visualType) || "single", b = m((A) => A.frame), { setCustomCardPreferences: v } = ie(), { data: r } = Le(t), y = ja((A, U) => {
3002
- i((K) => ({
3003
+ const { getCard: f } = Ta(((V = t.customCardPreferences) == null ? void 0 : V.url) || ""), h = ((F = t.customCardPreferences) == null ? void 0 : F.visualType) || "single", b = m((A) => A.frame), { setCustomCardPreferences: N } = re(), { data: i } = Le(t), y = Ra((A, U) => {
3004
+ r((K) => ({
3003
3005
  ...K,
3004
3006
  [A]: U
3005
3007
  }));
@@ -3015,8 +3017,8 @@ function Yl({ card: t }) {
3015
3017
  const x = Object.keys(
3016
3018
  ((B = t.customCardPreferences) == null ? void 0 : B.dataInputCardIds) || {}
3017
3019
  ).map((A) => {
3018
- var V, N, I;
3019
- const U = (N = (V = t.customCardPreferences) == null ? void 0 : V.dataInputCardIds) == null ? void 0 : N[A].cardId, K = (I = b == null ? void 0 : b.cards) == null ? void 0 : I.find((H) => H.id === U);
3020
+ var P, v, I;
3021
+ const U = (v = (P = t.customCardPreferences) == null ? void 0 : P.dataInputCardIds) == null ? void 0 : v[A].cardId, K = (I = b == null ? void 0 : b.cards) == null ? void 0 : I.find((R) => R.id === U);
3020
3022
  return K || null;
3021
3023
  });
3022
3024
  return /* @__PURE__ */ e("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ n(
@@ -3031,20 +3033,20 @@ function Yl({ card: t }) {
3031
3033
  theme: u,
3032
3034
  settings: (p = t.customCardPreferences) == null ? void 0 : p.settings,
3033
3035
  onDataChange: y,
3034
- data: (r == null ? void 0 : r.records) || []
3036
+ data: (i == null ? void 0 : i.records) || []
3035
3037
  }
3036
3038
  ),
3037
3039
  g && h === "multiple" && /* @__PURE__ */ n(le, { children: [
3038
3040
  Object.keys(
3039
3041
  ((E = t.customCardPreferences) == null ? void 0 : E.dataInputCardIds) || {}
3040
3042
  ).map((A) => {
3041
- var V, N, I;
3042
- const U = (N = (V = t.customCardPreferences) == null ? void 0 : V.dataInputCardIds) == null ? void 0 : N[A].cardId, K = (I = b == null ? void 0 : b.cards) == null ? void 0 : I.find(
3043
- (H) => H.id === U
3043
+ var P, v, I;
3044
+ const U = (v = (P = t.customCardPreferences) == null ? void 0 : P.dataInputCardIds) == null ? void 0 : v[A].cardId, K = (I = b == null ? void 0 : b.cards) == null ? void 0 : I.find(
3045
+ (R) => R.id === U
3044
3046
  );
3045
3047
  if (K)
3046
3048
  return /* @__PURE__ */ e(
3047
- ns,
3049
+ ls,
3048
3050
  {
3049
3051
  onLoadingStatus: C,
3050
3052
  onDataChange: y,
@@ -3074,25 +3076,25 @@ function Yl({ card: t }) {
3074
3076
  (W = t.customCardPreferences) == null ? void 0 : W.componentName
3075
3077
  ) });
3076
3078
  }
3077
- function nn({
3079
+ function sn({
3078
3080
  // card,
3079
3081
  // showCard,
3080
3082
  className: t,
3081
3083
  ...s
3082
3084
  }) {
3083
3085
  var C;
3084
- const a = m((x) => x.card), l = ((C = a.customCardPreferences) == null ? void 0 : C.showCardHeader) ?? !0, i = m((x) => x.frame), o = D((x) => x.dashboard.filters);
3086
+ const a = m((x) => x.card), l = ((C = a.customCardPreferences) == null ? void 0 : C.showCardHeader) ?? !0, r = m((x) => x.frame), o = D((x) => x.dashboard.filters);
3085
3087
  m((x) => x.actions.setRunSql);
3086
- const { updateFilter: c } = Xe(), d = o == null ? void 0 : o.find((x) => x.id === i.filterId), { data: u, isLoading: f, isFetching: h } = Le(a), { setCard: b } = ie(), { data: v } = At(a);
3088
+ const { updateFilter: c } = Xe(), d = o == null ? void 0 : o.find((x) => x.id === r.filterId), { data: u, isLoading: f, isFetching: h } = Le(a), { setCard: b } = re(), { data: N } = At(a);
3087
3089
  if (!a.id) return null;
3088
- let r;
3089
- u != null && u.records && (u == null ? void 0 : u.records.length) > 0 && (r = Da({
3090
+ let i;
3091
+ u != null && u.records && (u == null ? void 0 : u.records.length) > 0 && (i = Da({
3090
3092
  data: u == null ? void 0 : u.records,
3091
3093
  cardType: a.type,
3092
3094
  cfg: a.cfg,
3093
3095
  customCfg: a.customCfg,
3094
3096
  preferences: a.preferences,
3095
- topoJson: v
3097
+ topoJson: N
3096
3098
  }));
3097
3099
  function y(x) {
3098
3100
  return /* @__PURE__ */ e(Yl, { card: x });
@@ -3101,40 +3103,40 @@ function nn({
3101
3103
  var x;
3102
3104
  if (u != null && u.records && (u == null ? void 0 : u.records.length) === 0 && !f && !h)
3103
3105
  return /* @__PURE__ */ n("div", { className: "flex h-full flex-col items-center justify-center gap-2", children: [
3104
- /* @__PURE__ */ e(cs, { className: "size-8 text-muted-foreground" }),
3106
+ /* @__PURE__ */ e(us, { className: "size-8 text-muted-foreground" }),
3105
3107
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "No records to display" })
3106
3108
  ] });
3107
3109
  if (a.type === "custom")
3108
3110
  return y(a);
3109
- if (!["table", "custom"].includes(a.type) && r)
3111
+ if (!["table", "custom"].includes(a.type) && i)
3110
3112
  return /* @__PURE__ */ e(
3111
- ds,
3113
+ hs,
3112
3114
  {
3113
- cfg: r
3115
+ cfg: i
3114
3116
  },
3115
- JSON.stringify(r) + JSON.stringify(a.preferences) + ((x = a == null ? void 0 : a.preferences) == null ? void 0 : x.customVisualCode)
3117
+ JSON.stringify(i) + JSON.stringify(a.preferences) + ((x = a == null ? void 0 : a.preferences) == null ? void 0 : x.customVisualCode)
3116
3118
  );
3117
3119
  if (a.type === "table" && (u != null && u.records) && (u == null ? void 0 : u.records.length) > 0)
3118
3120
  return /* @__PURE__ */ n(Me, { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: [
3119
- /* @__PURE__ */ e(us, { card: a, data: u == null ? void 0 : u.records }),
3121
+ /* @__PURE__ */ e(ms, { card: a, data: u == null ? void 0 : u.records }),
3120
3122
  /* @__PURE__ */ e(je, { orientation: "horizontal" })
3121
3123
  ] });
3122
3124
  }
3123
3125
  return /* @__PURE__ */ n(
3124
- ss,
3126
+ rs,
3125
3127
  {
3126
3128
  role: "editor-visual-card",
3127
3129
  className: ee("relative flex h-full flex-col rounded-none", t),
3128
3130
  ...s,
3129
3131
  children: [
3130
- l && /* @__PURE__ */ n(ls, { className: "flex flex-row items-start justify-between py-4", children: [
3132
+ l && /* @__PURE__ */ n(is, { className: "flex flex-row items-start justify-between py-4", children: [
3131
3133
  /* @__PURE__ */ n("div", { children: [
3132
3134
  /* @__PURE__ */ e(
3133
3135
  st,
3134
3136
  {
3135
3137
  text: a.title,
3136
3138
  onSave: (x) => b({ ...a, title: x }),
3137
- children: /* @__PURE__ */ e("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e(is, { className: "text-base", children: a.title || "Edit title..." }) })
3139
+ children: /* @__PURE__ */ e("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e(os, { className: "text-base", children: a.title || "Edit title..." }) })
3138
3140
  },
3139
3141
  a.title
3140
3142
  ),
@@ -3143,7 +3145,7 @@ function nn({
3143
3145
  {
3144
3146
  text: a.description || "",
3145
3147
  onSave: (x) => b({ ...a, description: x }),
3146
- children: /* @__PURE__ */ e(rs, { children: a.description || "Edit description..." })
3148
+ children: /* @__PURE__ */ e(cs, { children: a.description || "Edit description..." })
3147
3149
  },
3148
3150
  a.description
3149
3151
  )
@@ -3161,7 +3163,7 @@ function nn({
3161
3163
  /* @__PURE__ */ e(za, { filter: d })
3162
3164
  ] })
3163
3165
  ] }),
3164
- /* @__PURE__ */ e(os, { className: "flex grow flex-col", children: g() })
3166
+ /* @__PURE__ */ e(ds, { className: "flex grow flex-col", children: g() })
3165
3167
  ]
3166
3168
  }
3167
3169
  );
@@ -3192,7 +3194,7 @@ const ea = ({
3192
3194
  value: s,
3193
3195
  onChange: a
3194
3196
  }
3195
- ), ei = () => /* @__PURE__ */ n(zt, { children: [
3197
+ ), er = () => /* @__PURE__ */ n(zt, { children: [
3196
3198
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(Lt, { children: "Customize Card" }) }),
3197
3199
  /* @__PURE__ */ n(na, { children: [
3198
3200
  "See the configuration options and documentation",
@@ -3206,7 +3208,7 @@ const ea = ({
3206
3208
  }
3207
3209
  )
3208
3210
  ] })
3209
- ] }), ti = ({
3211
+ ] }), tr = ({
3210
3212
  // defaultConfig,
3211
3213
  customCode: t,
3212
3214
  customConfig: s,
@@ -3247,27 +3249,27 @@ const ea = ({
3247
3249
  )
3248
3250
  }
3249
3251
  )
3250
- ] }), ai = ({
3252
+ ] }), ar = ({
3251
3253
  error: t,
3252
3254
  hasCustomConfig: s,
3253
3255
  onReset: a,
3254
3256
  onApply: l,
3255
- onClose: i
3257
+ onClose: r
3256
3258
  }) => /* @__PURE__ */ n(sa, { className: "flex items-center", children: [
3257
3259
  /* @__PURE__ */ e($, { className: "mr-2 text-red-500", children: t }),
3258
3260
  /* @__PURE__ */ e(z, { disabled: !s, onClick: a, variant: "outline", children: "Reset" }),
3259
3261
  /* @__PURE__ */ e(z, { onClick: l, variant: "outline", children: "Apply" }),
3260
- /* @__PURE__ */ e(z, { onClick: i, variant: "outline", children: "Close" })
3262
+ /* @__PURE__ */ e(z, { onClick: r, variant: "outline", children: "Close" })
3261
3263
  ] });
3262
- function ni() {
3263
- const [t, s] = P(!1), [a, l] = P(""), [i, o] = P(""), [c, d] = P(""), [u, f] = P(""), h = m((S) => S.card), b = m((S) => S.card.customCfg), { data: v } = Le(h), { data: r } = At(h), { setCardCustomCfg: y, setCustomVisualCode: g } = ie(), C = (S) => {
3264
- var M, q;
3264
+ function nr() {
3265
+ const [t, s] = H(!1), [a, l] = H(""), [r, o] = H(""), [c, d] = H(""), [u, f] = H(""), h = m((S) => S.card), b = m((S) => S.card.customCfg), { data: N } = Le(h), { data: i } = At(h), { setCardCustomCfg: y, setCustomVisualCode: g } = re(), C = (S) => {
3266
+ var M, V;
3265
3267
  return JSON.stringify(
3266
3268
  {
3267
3269
  ...S,
3268
3270
  data: {
3269
3271
  ...S.data,
3270
- datasets: (q = (M = S.data) == null ? void 0 : M.datasets) == null ? void 0 : q.map((F) => ({
3272
+ datasets: (V = (M = S.data) == null ? void 0 : M.datasets) == null ? void 0 : V.map((F) => ({
3271
3273
  ...F,
3272
3274
  data: []
3273
3275
  }))
@@ -3283,41 +3285,41 @@ function ni() {
3283
3285
  {
3284
3286
  tooltip: "Customize Visual",
3285
3287
  onClick: () => {
3286
- var M, q;
3287
- if (!((M = v == null ? void 0 : v.records) != null && M.length)) return;
3288
+ var M, V;
3289
+ if (!((M = N == null ? void 0 : N.records) != null && M.length)) return;
3288
3290
  const S = Da({
3289
- data: v.records,
3291
+ data: N.records,
3290
3292
  cardType: h.type,
3291
3293
  cfg: h.cfg,
3292
3294
  preferences: h.preferences,
3293
- topoJson: r
3295
+ topoJson: i
3294
3296
  });
3295
3297
  if (S) {
3296
- l(C(S)), d(((q = h.preferences) == null ? void 0 : q.customVisualCode) || "");
3297
- const F = ms(S, b);
3298
+ l(C(S)), d(((V = h.preferences) == null ? void 0 : V.customVisualCode) || "");
3299
+ const F = fs(S, b);
3298
3300
  o(C(F));
3299
3301
  }
3300
3302
  },
3301
3303
  className: b ? "text-green-600 hover:text-green-700" : "",
3302
- children: /* @__PURE__ */ e(hs, { className: "h-4 w-4" })
3304
+ children: /* @__PURE__ */ e(ps, { className: "h-4 w-4" })
3303
3305
  }
3304
3306
  ) }),
3305
3307
  /* @__PURE__ */ n(Dt, { className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]", children: [
3306
- /* @__PURE__ */ e(ei, {}),
3308
+ /* @__PURE__ */ e(er, {}),
3307
3309
  /* @__PURE__ */ n("div", { className: "flex grow gap-2", children: [
3308
- /* @__PURE__ */ e(pt, { FallbackComponent: La, children: /* @__PURE__ */ e(nn, { className: "w-1/2 rounded shadow-none" }) }),
3310
+ /* @__PURE__ */ e(pt, { FallbackComponent: La, children: /* @__PURE__ */ e(sn, { className: "w-1/2 rounded shadow-none" }) }),
3309
3311
  /* @__PURE__ */ e(
3310
- ti,
3312
+ tr,
3311
3313
  {
3312
3314
  customCode: c,
3313
- customConfig: i,
3315
+ customConfig: r,
3314
3316
  onConfigChange: (S) => o(S ?? ""),
3315
3317
  onCodeChange: (S) => d(S ?? "")
3316
3318
  }
3317
3319
  )
3318
3320
  ] }),
3319
3321
  /* @__PURE__ */ e(
3320
- ai,
3322
+ ar,
3321
3323
  {
3322
3324
  error: u,
3323
3325
  hasCustomConfig: !!b,
@@ -3326,10 +3328,10 @@ function ni() {
3326
3328
  },
3327
3329
  onApply: () => {
3328
3330
  try {
3329
- if (c && g(c), i) {
3331
+ if (c && g(c), r) {
3330
3332
  const S = JSON.parse(
3331
- i
3332
- ), M = ps(
3333
+ r
3334
+ ), M = gs(
3333
3335
  JSON.parse(a),
3334
3336
  S
3335
3337
  );
@@ -3345,43 +3347,43 @@ function ni() {
3345
3347
  ] })
3346
3348
  ] });
3347
3349
  }
3348
- function sn(t) {
3350
+ function ln(t) {
3349
3351
  return Pe({ 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: [] }] })(t);
3350
3352
  }
3351
- function si(t) {
3353
+ function sr(t) {
3352
3354
  return Pe({ attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M48,180c0,11,7.18,20,16,20a14.24,14.24,0,0,0,10.22-4.66A8,8,0,0,1,85.78,206.4,30.06,30.06,0,0,1,64,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a30.06,30.06,0,0,1,21.78,9.6,8,8,0,0,1-11.56,11.06A14.24,14.24,0,0,0,64,160C55.18,160,48,169,48,180Zm79.6-8.69c-4-1.16-8.14-2.35-10.45-3.84-1.25-.81-1.23-1-1.12-1.9a4.57,4.57,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.82-.56A8,8,0,0,0,142,145.86c-2.12-.55-21-5.22-32.84,2.76a20.58,20.58,0,0,0-9,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.14,3.93-4.6,3.06-15.17,1.56-19.55.36A8,8,0,0,0,109.94,214a61.34,61.34,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C154,179,137.49,174.17,127.6,171.31Zm83.09-26.84a8,8,0,0,0-10.23,4.84L188,184.21l-12.47-34.9a8,8,0,0,0-15.07,5.38l20,56a8,8,0,0,0,15.07,0l20-56A8,8,0,0,0,210.69,144.47ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z" }, child: [] }] })(t);
3353
3355
  }
3354
- function ln(t) {
3356
+ function rn(t) {
3355
3357
  return Pe({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, 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: [] }] })(t);
3356
3358
  }
3357
- function rn(t) {
3359
+ function on(t) {
3358
3360
  return Pe({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01-1.5-1.5zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99l1.5 1.5z" }, child: [] }] })(t);
3359
3361
  }
3360
- function on(t) {
3362
+ function cn(t) {
3361
3363
  return Pe({ 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: [] }] })(t);
3362
3364
  }
3363
- function cn(t) {
3364
- const [s, a] = P(null);
3365
+ function dn(t) {
3366
+ const [s, a] = H(null);
3365
3367
  return s;
3366
3368
  }
3367
- function dn() {
3368
- const { authToken: t } = Te(), { data: s, isLoading: a, isFetching: l, isError: i } = De({
3369
+ function un() {
3370
+ const { authToken: t } = Te(), { data: s, isLoading: a, isFetching: l, isError: r } = De({
3369
3371
  queryKey: ["plugins", t == null ? void 0 : t.accessToken],
3370
- queryFn: () => fs(t == null ? void 0 : t.accessToken)
3372
+ queryFn: () => ys(t == null ? void 0 : t.accessToken)
3371
3373
  // staleTime: Infinity,
3372
3374
  });
3373
- return { data: s, isLoading: a, isFetching: l, isError: i };
3375
+ return { data: s, isLoading: a, isFetching: l, isError: r };
3374
3376
  }
3375
- function li({
3377
+ function lr({
3376
3378
  onChartTypeChange: t
3377
3379
  }) {
3378
- const [s, a] = P([]), { data: l } = dn();
3380
+ const [s, a] = H([]), { data: l } = un();
3379
3381
  return de(() => {
3380
3382
  (async () => {
3381
3383
  var o;
3382
3384
  if (l) {
3383
3385
  const d = (await Promise.all(
3384
- (o = l == null ? void 0 : l.plugins) == null ? void 0 : o.map(async (u) => (await gs(u.value)).visuals.map((b) => ({
3386
+ (o = l == null ? void 0 : l.plugins) == null ? void 0 : o.map(async (u) => (await bs(u.value)).visuals.map((b) => ({
3385
3387
  name: b.name,
3386
3388
  icon: b.icon,
3387
3389
  url: u.value
@@ -3392,40 +3394,40 @@ function li({
3392
3394
  })();
3393
3395
  }, [l]), s.length === 0 ? null : /* @__PURE__ */ n(le, { children: [
3394
3396
  /* @__PURE__ */ e(Oe, { className: "my-2" }),
3395
- /* @__PURE__ */ e("div", { className: "grid grid-cols-4 place-items-center", children: s.map((i, o) => /* @__PURE__ */ e(
3396
- ii,
3397
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-4 place-items-center", children: s.map((r, o) => /* @__PURE__ */ e(
3398
+ rr,
3397
3399
  {
3398
- text: i.name,
3399
- onClick: () => t("custom", i),
3400
- icon: i.icon
3400
+ text: r.name,
3401
+ onClick: () => t("custom", r),
3402
+ icon: r.icon
3401
3403
  },
3402
- i.url + i.name + o
3404
+ r.url + r.name + o
3403
3405
  )) })
3404
3406
  ] });
3405
3407
  }
3406
- const ii = ({
3408
+ const rr = ({
3407
3409
  text: t,
3408
3410
  icon: s,
3409
3411
  onClick: a
3410
3412
  }) => {
3411
- const l = cn(), i = t.charAt(0).toUpperCase();
3412
- return /* @__PURE__ */ e(z, { onClick: a, title: t, variant: "ghost", children: l ? /* @__PURE__ */ e(l, { className: "h-4 w-4" }) : i });
3413
+ const l = dn(), r = t.charAt(0).toUpperCase();
3414
+ return /* @__PURE__ */ e(z, { onClick: a, title: t, variant: "ghost", children: l ? /* @__PURE__ */ e(l, { className: "h-4 w-4" }) : r });
3413
3415
  };
3414
- function ri() {
3416
+ function ir() {
3415
3417
  var h, b;
3416
- const [t, s] = P(!1), a = m((v) => v.card), l = a.type, { setCardType: i, setCardPreferences: o, setChartOrientation: c } = m((v) => v.actions), { setCardCustomCfg: d, setCustomCardPreferences: u } = ie();
3417
- function f(v, r) {
3418
- d(null), o({}), i(v), r && u({
3418
+ const [t, s] = H(!1), a = m((N) => N.card), l = a.type, { setCardType: r, setCardPreferences: o, setChartOrientation: c } = m((N) => N.actions), { setCardCustomCfg: d, setCustomCardPreferences: u } = re();
3419
+ function f(N, i) {
3420
+ d(null), o({}), r(N), i && u({
3419
3421
  type: "component",
3420
3422
  visualType: "single",
3421
- url: r.url,
3422
- componentName: r.name,
3423
- icon: r.icon
3423
+ url: i.url,
3424
+ componentName: i.name,
3425
+ icon: i.icon
3424
3426
  }), s(!1);
3425
3427
  }
3426
3428
  return /* @__PURE__ */ n(Re, { open: t, onOpenChange: s, children: [
3427
3429
  /* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ e(z, { size: "sm", variant: "ghost", children: /* @__PURE__ */ e(
3428
- oi,
3430
+ or,
3429
3431
  {
3430
3432
  className: "size-4",
3431
3433
  chartType: l,
@@ -3457,7 +3459,7 @@ function ri() {
3457
3459
  {
3458
3460
  onClick: () => f("stackedBar"),
3459
3461
  variant: "ghost",
3460
- children: /* @__PURE__ */ e(Ra, { className: "size-5" })
3462
+ children: /* @__PURE__ */ e(_a, { className: "size-5" })
3461
3463
  }
3462
3464
  ),
3463
3465
  /* @__PURE__ */ e(
@@ -3465,7 +3467,7 @@ function ri() {
3465
3467
  {
3466
3468
  onClick: () => f("stackedLine"),
3467
3469
  variant: "ghost",
3468
- children: /* @__PURE__ */ e(rn, { className: "size-5", strokeWidth: 0 })
3470
+ children: /* @__PURE__ */ e(on, { className: "size-5", strokeWidth: 0 })
3469
3471
  }
3470
3472
  ),
3471
3473
  /* @__PURE__ */ e(
@@ -3473,7 +3475,7 @@ function ri() {
3473
3475
  {
3474
3476
  onClick: () => f("scatter"),
3475
3477
  variant: "ghost",
3476
- children: /* @__PURE__ */ e(Pa, { className: "size-5" })
3478
+ children: /* @__PURE__ */ e($a, { className: "size-5" })
3477
3479
  }
3478
3480
  ),
3479
3481
  /* @__PURE__ */ e(
@@ -3481,7 +3483,7 @@ function ri() {
3481
3483
  {
3482
3484
  onClick: () => f("bubble"),
3483
3485
  variant: "ghost",
3484
- children: /* @__PURE__ */ e(ln, { className: "size-5" })
3486
+ children: /* @__PURE__ */ e(rn, { className: "size-5" })
3485
3487
  }
3486
3488
  ),
3487
3489
  /* @__PURE__ */ e(
@@ -3489,7 +3491,7 @@ function ri() {
3489
3491
  {
3490
3492
  onClick: () => f("pie"),
3491
3493
  variant: "ghost",
3492
- children: /* @__PURE__ */ e(Ha, { className: "size-5" })
3494
+ children: /* @__PURE__ */ e(Pa, { className: "size-5" })
3493
3495
  }
3494
3496
  ),
3495
3497
  /* @__PURE__ */ e(
@@ -3497,7 +3499,7 @@ function ri() {
3497
3499
  {
3498
3500
  onClick: () => f("doughnut"),
3499
3501
  variant: "ghost",
3500
- children: /* @__PURE__ */ e($a, { className: "size-5" })
3502
+ children: /* @__PURE__ */ e(Ga, { className: "size-5" })
3501
3503
  }
3502
3504
  ),
3503
3505
  /* @__PURE__ */ e(
@@ -3505,7 +3507,7 @@ function ri() {
3505
3507
  {
3506
3508
  onClick: () => f("radar"),
3507
3509
  variant: "ghost",
3508
- children: /* @__PURE__ */ e(Ua, { className: "size-5" })
3510
+ children: /* @__PURE__ */ e(Ja, { className: "size-5" })
3509
3511
  }
3510
3512
  ),
3511
3513
  /* @__PURE__ */ e(
@@ -3513,7 +3515,7 @@ function ri() {
3513
3515
  {
3514
3516
  onClick: () => f("polarArea"),
3515
3517
  variant: "ghost",
3516
- children: /* @__PURE__ */ e(sn, { className: "size-6" })
3518
+ children: /* @__PURE__ */ e(ln, { className: "size-6" })
3517
3519
  }
3518
3520
  ),
3519
3521
  /* @__PURE__ */ e(
@@ -3521,7 +3523,7 @@ function ri() {
3521
3523
  {
3522
3524
  onClick: () => f("pyramid"),
3523
3525
  variant: "ghost",
3524
- children: /* @__PURE__ */ e(Ka, { className: "size-5" })
3526
+ children: /* @__PURE__ */ e(Qa, { className: "size-5" })
3525
3527
  }
3526
3528
  ),
3527
3529
  /* @__PURE__ */ e(
@@ -3529,7 +3531,7 @@ function ri() {
3529
3531
  {
3530
3532
  onClick: () => f("range"),
3531
3533
  variant: "ghost",
3532
- children: /* @__PURE__ */ e(_a, { className: "size-5" })
3534
+ children: /* @__PURE__ */ e(Ha, { className: "size-5" })
3533
3535
  }
3534
3536
  ),
3535
3537
  /* @__PURE__ */ e(
@@ -3545,7 +3547,7 @@ function ri() {
3545
3547
  {
3546
3548
  onClick: () => f("kpi"),
3547
3549
  variant: "ghost",
3548
- children: /* @__PURE__ */ e(on, { className: "size-6" })
3550
+ children: /* @__PURE__ */ e(cn, { className: "size-6" })
3549
3551
  }
3550
3552
  ),
3551
3553
  /* @__PURE__ */ e(
@@ -3561,7 +3563,7 @@ function ri() {
3561
3563
  {
3562
3564
  onClick: () => f("map"),
3563
3565
  variant: "ghost",
3564
- children: /* @__PURE__ */ e(Ba, { className: "size-5" })
3566
+ children: /* @__PURE__ */ e(Ua, { className: "size-5" })
3565
3567
  }
3566
3568
  ),
3567
3569
  /* @__PURE__ */ e(
@@ -3569,59 +3571,59 @@ function ri() {
3569
3571
  {
3570
3572
  onClick: () => f("custom"),
3571
3573
  variant: "ghost",
3572
- children: /* @__PURE__ */ e(Wa, { className: "size-5" })
3574
+ children: /* @__PURE__ */ e(Ka, { className: "size-5" })
3573
3575
  }
3574
3576
  )
3575
3577
  ] }),
3576
- /* @__PURE__ */ e(li, { onChartTypeChange: f })
3578
+ /* @__PURE__ */ e(lr, { onChartTypeChange: f })
3577
3579
  ] })
3578
3580
  ] });
3579
3581
  }
3580
- function oi({
3582
+ function or({
3581
3583
  chartType: t,
3582
3584
  className: s,
3583
3585
  customIcon: a,
3584
3586
  componentName: l
3585
3587
  }) {
3586
- const i = cn();
3588
+ const r = dn();
3587
3589
  switch (t) {
3588
3590
  case "bar":
3589
3591
  return /* @__PURE__ */ e(qt, { className: s });
3590
3592
  case "line":
3591
3593
  return /* @__PURE__ */ e(jt, { className: s });
3592
3594
  case "pie":
3593
- return /* @__PURE__ */ e(Ha, { className: s });
3595
+ return /* @__PURE__ */ e(Pa, { className: s });
3594
3596
  case "radar":
3595
- return /* @__PURE__ */ e(Ua, { className: s });
3597
+ return /* @__PURE__ */ e(Ja, { className: s });
3596
3598
  case "scatter":
3597
- return /* @__PURE__ */ e(Pa, { className: s });
3599
+ return /* @__PURE__ */ e($a, { className: s });
3598
3600
  case "bubble":
3599
- return /* @__PURE__ */ e(ln, { className: s });
3601
+ return /* @__PURE__ */ e(rn, { className: s });
3600
3602
  case "doughnut":
3601
- return /* @__PURE__ */ e($a, { className: s });
3603
+ return /* @__PURE__ */ e(Ga, { className: s });
3602
3604
  case "stackedBar":
3603
- return /* @__PURE__ */ e(Ra, { className: s });
3605
+ return /* @__PURE__ */ e(_a, { className: s });
3604
3606
  case "stackedLine":
3605
- return /* @__PURE__ */ e(rn, { className: s });
3607
+ return /* @__PURE__ */ e(on, { className: s });
3606
3608
  case "polarArea":
3607
- return /* @__PURE__ */ e(sn, { className: s });
3609
+ return /* @__PURE__ */ e(ln, { className: s });
3608
3610
  case "pyramid":
3609
- return /* @__PURE__ */ e(Ka, { className: s });
3611
+ return /* @__PURE__ */ e(Qa, { className: s });
3610
3612
  case "range":
3611
- return /* @__PURE__ */ e(_a, { className: s });
3613
+ return /* @__PURE__ */ e(Ha, { className: s });
3612
3614
  case "kpi":
3613
- return /* @__PURE__ */ e(on, { className: s });
3615
+ return /* @__PURE__ */ e(cn, { className: s });
3614
3616
  case "text":
3615
- return /* @__PURE__ */ e(Qa, { className: s });
3617
+ return /* @__PURE__ */ e(Za, { className: s });
3616
3618
  case "map":
3617
- return /* @__PURE__ */ e(Ba, { className: s });
3619
+ return /* @__PURE__ */ e(Ua, { className: s });
3618
3620
  case "custom":
3619
- return a && i ? /* @__PURE__ */ e(i, { className: s }) : l ? l == null ? void 0 : l.charAt(0).toUpperCase() : /* @__PURE__ */ e(Wa, { className: s });
3621
+ return a && r ? /* @__PURE__ */ e(r, { className: s }) : l ? l == null ? void 0 : l.charAt(0).toUpperCase() : /* @__PURE__ */ e(Ka, { className: s });
3620
3622
  default:
3621
3623
  return /* @__PURE__ */ e(Ft, { className: s });
3622
3624
  }
3623
3625
  }
3624
- function ci() {
3626
+ function cr() {
3625
3627
  const t = m(
3626
3628
  (d) => {
3627
3629
  var u, f, h, b;
@@ -3637,10 +3639,10 @@ function ci() {
3637
3639
  var u, f, h, b;
3638
3640
  return (b = (h = (f = (u = d.card.preferences) == null ? void 0 : u.chartOptions) == null ? void 0 : f.plugins) == null ? void 0 : h.legend) == null ? void 0 : b.display;
3639
3641
  }
3640
- ), { setLegendOptions: l } = ie();
3642
+ ), { setLegendOptions: l } = re();
3641
3643
  return /* @__PURE__ */ n(Re, { children: [
3642
- /* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ e(Qe, { tooltip: "Legend Settings", children: /* @__PURE__ */ e(rl, { className: "size-4" }) }) }),
3643
- /* @__PURE__ */ e(He, { className: "w-80", children: /* @__PURE__ */ n("div", { className: "grid gap-4", children: [
3644
+ /* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ e(Qe, { tooltip: "Legend Settings", children: /* @__PURE__ */ e(il, { className: "size-4" }) }) }),
3645
+ /* @__PURE__ */ e(He, { className: "w-72", children: /* @__PURE__ */ n("div", { className: "grid gap-4", children: [
3644
3646
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
3645
3647
  /* @__PURE__ */ e("h4", { className: "font-medium leading-none", children: "Legend Options" }),
3646
3648
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "Set the legend options for the chart." })
@@ -3649,7 +3651,7 @@ function ci() {
3649
3651
  /* @__PURE__ */ n("div", { className: "grid grid-cols-3 items-center gap-4", children: [
3650
3652
  /* @__PURE__ */ e($, { htmlFor: "displayLegend", children: "Display" }),
3651
3653
  /* @__PURE__ */ e("div", { className: "col-span-2 flex h-8 items-center", children: /* @__PURE__ */ e(
3652
- ys,
3654
+ Ea,
3653
3655
  {
3654
3656
  checked: a,
3655
3657
  onCheckedChange: (d) => {
@@ -3673,7 +3675,7 @@ function ci() {
3673
3675
  align: s
3674
3676
  });
3675
3677
  }, children: [
3676
- /* @__PURE__ */ e(pe, { className: "col-span-2 h-8 focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e(fe, { placeholder: "Select position" }) }),
3678
+ /* @__PURE__ */ e(pe, { className: "col-span-2 h-8 focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e(fe, { placeholder: "Select Position" }) }),
3677
3679
  /* @__PURE__ */ n(ge, { children: [
3678
3680
  /* @__PURE__ */ e(Q, { value: "top", children: "Top" }),
3679
3681
  /* @__PURE__ */ e(Q, { value: "left", children: "Left" }),
@@ -3691,7 +3693,7 @@ function ci() {
3691
3693
  align: d
3692
3694
  });
3693
3695
  }, children: [
3694
- /* @__PURE__ */ e(pe, { className: "col-span-2 h-8 focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e(fe, { placeholder: "Select alignment" }) }),
3696
+ /* @__PURE__ */ e(pe, { className: "col-span-2 h-8 focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e(fe, { placeholder: "Select Alignment" }) }),
3695
3697
  /* @__PURE__ */ n(ge, { children: [
3696
3698
  /* @__PURE__ */ e(Q, { value: "start", children: "Start" }),
3697
3699
  /* @__PURE__ */ e(Q, { value: "center", children: "Center" }),
@@ -3704,25 +3706,25 @@ function ci() {
3704
3706
  ] });
3705
3707
  }
3706
3708
  function ta() {
3707
- var V;
3708
- const t = m((N) => N.frame), s = m((N) => N.card), a = m((N) => N.isShowingVisual), l = m((N) => N.isSqlRunning), i = m((N) => N.pythonStdOut), o = m(
3709
- (N) => {
3709
+ var P;
3710
+ const t = m((v) => v.frame), s = m((v) => v.card), a = m((v) => v.isShowingVisual), l = m((v) => v.isSqlRunning), r = m((v) => v.pythonStdOut), o = m(
3711
+ (v) => {
3710
3712
  var I;
3711
- return (I = N.card.preferences) == null ? void 0 : I.chartOptions;
3713
+ return (I = v.card.preferences) == null ? void 0 : I.chartOptions;
3712
3714
  }
3713
3715
  );
3714
- m((N) => N.actions.setRunSql);
3715
- const c = bs(o), {
3716
+ m((v) => v.actions.setRunSql);
3717
+ const c = xs(o), {
3716
3718
  setFrame: d,
3717
3719
  setCard: u,
3718
3720
  updateCardInFrame: f,
3719
3721
  setActiveTabCardId: h,
3720
3722
  runAssistant: b,
3721
- setChartGrid: v
3722
- } = ie(), { data: r, isLoading: y, isFetching: g, error: C } = Le(s);
3723
+ setChartGrid: N
3724
+ } = re(), { data: i, isLoading: y, isFetching: g, error: C } = Le(s);
3723
3725
  if (!s) return /* @__PURE__ */ e(le, { children: "No Active Card" });
3724
3726
  function x() {
3725
- const N = {
3727
+ const v = {
3726
3728
  connectionId: s.connectionId,
3727
3729
  id: Ke(),
3728
3730
  title: "Title",
@@ -3739,56 +3741,56 @@ function ta() {
3739
3741
  sql: "",
3740
3742
  data: []
3741
3743
  };
3742
- O(N);
3744
+ O(v);
3743
3745
  }
3744
- function O(N) {
3746
+ function O(v) {
3745
3747
  const I = {
3746
3748
  ...t,
3747
- cards: [...t.cards, N],
3748
- activeCardId: N.id
3749
+ cards: [...t.cards, v],
3750
+ activeCardId: v.id
3749
3751
  };
3750
- d(I), h(N.id);
3752
+ d(I), h(v.id);
3751
3753
  }
3752
3754
  function S() {
3753
- const N = {
3755
+ const v = {
3754
3756
  ...s,
3755
3757
  id: Ke(),
3756
3758
  title: `${s.title} Copy`,
3757
3759
  tabTitle: `${s.tabTitle || s.title} Copy`
3758
3760
  };
3759
- O(N);
3761
+ O(v);
3760
3762
  }
3761
- function M(N) {
3762
- const I = t.cards.filter((X) => X.id !== N), H = I[0], Z = {
3763
+ function M(v) {
3764
+ const I = t.cards.filter((X) => X.id !== v), R = I[0], Z = {
3763
3765
  ...t,
3764
3766
  cards: I,
3765
3767
  // update the active card to the first card in the frame
3766
- activeCardId: H.id
3768
+ activeCardId: R.id
3767
3769
  };
3768
- d(Z), h(H.id), u(H);
3770
+ d(Z), h(R.id), u(R);
3769
3771
  }
3770
- function q(N) {
3771
- h(N);
3772
+ function V(v) {
3773
+ h(v);
3772
3774
  }
3773
- const F = (N, I) => {
3774
- console.log("handleDragStart", I), N.dataTransfer.setData("tabIndex", I.toString());
3775
- }, G = (N) => {
3776
- N.preventDefault();
3777
- }, _ = (N, I) => {
3778
- const H = N.dataTransfer.getData("tabIndex");
3779
- if (H === I.toString()) return;
3780
- const Z = Array.from(t.cards), [X] = Z.splice(parseInt(H), 1);
3775
+ const F = (v, I) => {
3776
+ console.log("handleDragStart", I), v.dataTransfer.setData("tabIndex", I.toString());
3777
+ }, G = (v) => {
3778
+ v.preventDefault();
3779
+ }, _ = (v, I) => {
3780
+ const R = v.dataTransfer.getData("tabIndex");
3781
+ if (R === I.toString()) return;
3782
+ const Z = Array.from(t.cards), [X] = Z.splice(parseInt(R), 1);
3781
3783
  Z.splice(I, 0, X), d({ ...t, cards: Z });
3782
3784
  };
3783
- function B(N, I) {
3784
- return N.cards.length === 1 && (I.displayTab === !0 || I.displayTab === void 0) || N.activeCardId !== I.id && (I.displayTab === !0 || I.displayTab === void 0) ? null : /* @__PURE__ */ e(
3785
+ function B(v, I) {
3786
+ return v.cards.length === 1 && (I.displayTab === !0 || I.displayTab === void 0) || v.activeCardId !== I.id && (I.displayTab === !0 || I.displayTab === void 0) ? null : /* @__PURE__ */ e(
3785
3787
  "div",
3786
3788
  {
3787
3789
  onClick: () => {
3788
- const H = I.displayTab === void 0 ? !1 : !I.displayTab;
3789
- u({ ...I, displayTab: H }), f({
3790
+ const R = I.displayTab === void 0 ? !1 : !I.displayTab;
3791
+ u({ ...I, displayTab: R }), f({
3790
3792
  ...I,
3791
- displayTab: H
3793
+ displayTab: R
3792
3794
  });
3793
3795
  },
3794
3796
  children: I.displayTab === !0 || I.displayTab === void 0 ? /* @__PURE__ */ e(Ss, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e(el, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
@@ -3799,43 +3801,43 @@ function ta() {
3799
3801
  return /* @__PURE__ */ n(
3800
3802
  Fa,
3801
3803
  {
3802
- onValueChange: q,
3804
+ onValueChange: V,
3803
3805
  value: t.activeCardId,
3804
3806
  className: "flex grow flex-col",
3805
3807
  children: [
3806
- t.cards.map((N) => /* @__PURE__ */ e(wt, { className: "mt-0 grow", value: N.id, children: E() }, N.id)),
3808
+ t.cards.map((v) => /* @__PURE__ */ e(wt, { className: "mt-0 grow", value: v.id, children: E() }, v.id)),
3807
3809
  /* @__PURE__ */ e(Aa, { className: "group mx-6 justify-between", children: /* @__PURE__ */ n("div", { className: "flex items-center", children: [
3808
- t.cards.map((N, I) => /* @__PURE__ */ e(
3810
+ t.cards.map((v, I) => /* @__PURE__ */ e(
3809
3811
  st,
3810
3812
  {
3811
- text: N.tabTitle || N.title,
3812
- onSave: (H) => {
3813
- u({ ...s, tabTitle: H }), f({ ...s, tabTitle: H });
3813
+ text: v.tabTitle || v.title,
3814
+ onSave: (R) => {
3815
+ u({ ...s, tabTitle: R }), f({ ...s, tabTitle: R });
3814
3816
  },
3815
3817
  children: /* @__PURE__ */ n(
3816
3818
  St,
3817
3819
  {
3818
3820
  draggable: !0,
3819
- onDragStart: (H) => F(H, I),
3821
+ onDragStart: (R) => F(R, I),
3820
3822
  onDragOver: G,
3821
- onDrop: (H) => _(H, I),
3823
+ onDrop: (R) => _(R, I),
3822
3824
  className: "",
3823
- value: N.id,
3825
+ value: v.id,
3824
3826
  children: [
3825
- B(t, N),
3826
- N.tabTitle || N.title,
3827
- t.activeCardId === N.id && t.cards.length > 1 && /* @__PURE__ */ e(
3827
+ B(t, v),
3828
+ v.tabTitle || v.title,
3829
+ t.activeCardId === v.id && t.cards.length > 1 && /* @__PURE__ */ e(
3828
3830
  et,
3829
3831
  {
3830
3832
  className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
3831
- onClick: () => M(N.id)
3833
+ onClick: () => M(v.id)
3832
3834
  }
3833
3835
  )
3834
3836
  ]
3835
3837
  }
3836
3838
  )
3837
3839
  },
3838
- N.id
3840
+ v.id
3839
3841
  )),
3840
3842
  /* @__PURE__ */ e(
3841
3843
  z,
@@ -3861,44 +3863,44 @@ function ta() {
3861
3863
  );
3862
3864
  }
3863
3865
  function E() {
3864
- return s.type === "kpi" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(vs, { card: s, data: r == null ? void 0 : r.records }) }) }) : s.type === "text" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(Me, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e(
3865
- Ns,
3866
+ return s.type === "kpi" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(Ns, { card: s, data: i == null ? void 0 : i.records }) }) }) : s.type === "text" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(Me, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e(
3867
+ Cs,
3866
3868
  {
3867
3869
  isLoading: l,
3868
3870
  card: s,
3869
- data: r == null ? void 0 : r.records
3871
+ data: i == null ? void 0 : i.records
3870
3872
  }
3871
- ) }) }) }) : /* @__PURE__ */ e(pt, { FallbackComponent: La, children: /* @__PURE__ */ e(nn, { className: "grow border-none shadow-none" }) });
3873
+ ) }) }) }) : /* @__PURE__ */ e(pt, { FallbackComponent: La, children: /* @__PURE__ */ e(sn, { className: "grow border-none shadow-none" }) });
3872
3874
  }
3873
3875
  function W() {
3874
- const N = JSON.stringify(r == null ? void 0 : r.records, null, 2), I = new Blob([N], { type: "application/json" }), H = URL.createObjectURL(I), Z = document.createElement("a");
3875
- Z.href = H, Z.download = `${s.title}.json`, Z.click();
3876
+ const v = JSON.stringify(i == null ? void 0 : i.records, null, 2), I = new Blob([v], { type: "application/json" }), R = URL.createObjectURL(I), Z = document.createElement("a");
3877
+ Z.href = R, Z.download = `${s.title}.json`, Z.click();
3876
3878
  }
3877
3879
  function A() {
3878
3880
  const I = [
3879
3881
  Object.keys(
3880
- r == null ? void 0 : r.records.reduce((j, L) => ({ ...j, ...L }), {})
3882
+ i == null ? void 0 : i.records.reduce((q, L) => ({ ...q, ...L }), {})
3881
3883
  ).join(","),
3882
- ...((r == null ? void 0 : r.records) || []).map((j) => Object.values(j).join(","))
3884
+ ...((i == null ? void 0 : i.records) || []).map((q) => Object.values(q).join(","))
3883
3885
  ].join(`
3884
- `), H = new Blob([I], { type: "text/csv" }), Z = URL.createObjectURL(H), X = document.createElement("a");
3886
+ `), R = new Blob([I], { type: "text/csv" }), Z = URL.createObjectURL(R), X = document.createElement("a");
3885
3887
  X.href = Z, X.download = `${s.title}.csv`, X.click();
3886
3888
  }
3887
3889
  function U() {
3888
- const N = `Can you get the documentation for ${s.type} chart?`;
3889
- b(N);
3890
+ const v = `Can you get the documentation for ${s.type} chart?`;
3891
+ b(v);
3890
3892
  }
3891
3893
  function K() {
3892
- const N = ["xy", "none", "x", "y"], H = (N.indexOf(c) + 1) % N.length;
3893
- v(N[H]);
3894
+ const v = ["xy", "none", "x", "y"], R = (v.indexOf(c) + 1) % v.length;
3895
+ N(v[R]);
3894
3896
  }
3895
3897
  return /* @__PURE__ */ n("div", { className: "relative flex h-full flex-col py-3", children: [
3896
3898
  (y || g) && /* @__PURE__ */ e("div", { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto flex h-10 w-10 items-center justify-center rounded-md bg-muted", children: /* @__PURE__ */ e(Ze, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }),
3897
3899
  /* @__PURE__ */ n("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
3898
3900
  a && /* @__PURE__ */ n("div", { className: "flex grow items-center", children: [
3899
- /* @__PURE__ */ e(ri, {}),
3901
+ /* @__PURE__ */ e(ir, {}),
3900
3902
  /* @__PURE__ */ e(Qe, { tooltip: "Visual Docs", onClick: U, children: /* @__PURE__ */ e(Gs, { className: "size-4" }) }),
3901
- !["table", "custom"].includes(s.type) && /* @__PURE__ */ e(ni, {})
3903
+ !["table", "custom"].includes(s.type) && /* @__PURE__ */ e(nr, {})
3902
3904
  ] }),
3903
3905
  !a && /* @__PURE__ */ n("div", { className: "flex grow items-center gap-1", children: [
3904
3906
  /* @__PURE__ */ e(
@@ -3908,7 +3910,7 @@ function ta() {
3908
3910
  variant: "ghost",
3909
3911
  size: "icon",
3910
3912
  onClick: A,
3911
- children: /* @__PURE__ */ e(si, { className: "size-4" })
3913
+ children: /* @__PURE__ */ e(sr, { className: "size-4" })
3912
3914
  }
3913
3915
  ),
3914
3916
  /* @__PURE__ */ e(
@@ -3922,15 +3924,15 @@ function ta() {
3922
3924
  }
3923
3925
  ),
3924
3926
  /* @__PURE__ */ e(
3925
- xs,
3927
+ vs,
3926
3928
  {
3927
- text: JSON.stringify(r == null ? void 0 : r.records, null, 2),
3929
+ text: JSON.stringify(i == null ? void 0 : i.records, null, 2),
3928
3930
  className: "h-7 w-fit px-1 font-mono text-xs text-muted-foreground/70"
3929
3931
  }
3930
3932
  )
3931
3933
  ] }),
3932
3934
  a && /* @__PURE__ */ n("div", { className: "flex items-center", children: [
3933
- !["kpi", "text", "custom", "table"].includes(s.type) && /* @__PURE__ */ e(ci, {}),
3935
+ !["kpi", "text", "custom", "table"].includes(s.type) && /* @__PURE__ */ e(cr, {}),
3934
3936
  ![
3935
3937
  "pie",
3936
3938
  "doughnut",
@@ -3948,15 +3950,15 @@ function ta() {
3948
3950
  c === "none" && /* @__PURE__ */ e(xl, { className: "size-4" })
3949
3951
  ] })
3950
3952
  ] }),
3951
- /* @__PURE__ */ e(ui, {})
3953
+ /* @__PURE__ */ e(ur, {})
3952
3954
  ] }),
3953
3955
  a ? p() : /* @__PURE__ */ n(
3954
- rt,
3956
+ it,
3955
3957
  {
3956
3958
  className: "px-6",
3957
3959
  direction: "horizontal",
3958
3960
  children: [
3959
- i && /* @__PURE__ */ n(le, { children: [
3961
+ r && /* @__PURE__ */ n(le, { children: [
3960
3962
  /* @__PURE__ */ e(
3961
3963
  we,
3962
3964
  {
@@ -3965,7 +3967,7 @@ function ta() {
3965
3967
  defaultSize: 30,
3966
3968
  minSize: 10,
3967
3969
  className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
3968
- children: i && /* @__PURE__ */ e(di, {})
3970
+ children: r && /* @__PURE__ */ e(dr, {})
3969
3971
  }
3970
3972
  ),
3971
3973
  /* @__PURE__ */ e(ot, {})
@@ -3978,8 +3980,8 @@ function ta() {
3978
3980
  minSize: 10,
3979
3981
  className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
3980
3982
  children: /* @__PURE__ */ n(Me, { className: "relative flex h-full min-h-0 w-full flex-1 basis-0", children: [
3981
- (r == null ? void 0 : r.records) && (r == null ? void 0 : r.records.length) > 0 && /* @__PURE__ */ e(Xl, { data: (r == null ? void 0 : r.records) || [] }),
3982
- (C || (r == null ? void 0 : r.error)) && /* @__PURE__ */ e("span", { className: "font-mono text-xs", children: (C == null ? void 0 : C.message) || ((V = r == null ? void 0 : r.error) == null ? void 0 : V.message) }),
3983
+ (i == null ? void 0 : i.records) && (i == null ? void 0 : i.records.length) > 0 && /* @__PURE__ */ e(Xl, { data: (i == null ? void 0 : i.records) || [] }),
3984
+ (C || (i == null ? void 0 : i.error)) && /* @__PURE__ */ e("span", { className: "font-mono text-xs", children: (C == null ? void 0 : C.message) || ((P = i == null ? void 0 : i.error) == null ? void 0 : P.message) }),
3983
3985
  /* @__PURE__ */ e(je, { orientation: "horizontal" })
3984
3986
  ] })
3985
3987
  }
@@ -3989,7 +3991,7 @@ function ta() {
3989
3991
  )
3990
3992
  ] });
3991
3993
  }
3992
- function di() {
3994
+ function dr() {
3993
3995
  const t = m((a) => a.pythonStdOut);
3994
3996
  if (!t) return null;
3995
3997
  const s = t.replace(/\n/g, "<br>");
@@ -4001,14 +4003,14 @@ function di() {
4001
4003
  ] })
4002
4004
  ] });
4003
4005
  }
4004
- function ui() {
4006
+ function ur() {
4005
4007
  const t = m((a) => a.isShowingVisual), s = m(
4006
4008
  (a) => a.actions.setIsShowingVisual
4007
4009
  );
4008
4010
  return /* @__PURE__ */ n("div", { className: "flex items-center space-x-2", children: [
4009
4011
  /* @__PURE__ */ e($, { htmlFor: "visualize", children: "Chart" }),
4010
4012
  /* @__PURE__ */ e(
4011
- Cs,
4013
+ Ea,
4012
4014
  {
4013
4015
  checked: t,
4014
4016
  onCheckedChange: () => s(!t),
@@ -4018,7 +4020,7 @@ function ui() {
4018
4020
  )
4019
4021
  ] });
4020
4022
  }
4021
- function hi({
4023
+ function hr({
4022
4024
  options: t,
4023
4025
  value: s,
4024
4026
  onValueChange: a
@@ -4042,13 +4044,13 @@ function Ne({
4042
4044
  options: s,
4043
4045
  value: a,
4044
4046
  onValueChange: l,
4045
- className: i
4047
+ className: r
4046
4048
  }) {
4047
4049
  return /* @__PURE__ */ n(me, { value: a, onValueChange: l, children: [
4048
4050
  /* @__PURE__ */ e(
4049
4051
  pe,
4050
4052
  {
4051
- className: ee("w-full focus:ring-0 focus:ring-offset-0", i),
4053
+ className: ee("w-full focus:ring-0 focus:ring-offset-0", r),
4052
4054
  children: /* @__PURE__ */ e(fe, { placeholder: t })
4053
4055
  }
4054
4056
  ),
@@ -4079,11 +4081,11 @@ function We({
4079
4081
  }
4080
4082
  );
4081
4083
  }
4082
- function mi() {
4084
+ function mr() {
4083
4085
  var g, C;
4084
4086
  const t = m(
4085
4087
  (x) => x.card.customCardPreferences
4086
- ), { data: s } = dn(), a = (s == null ? void 0 : s.plugins) || [], l = m((x) => x.card), i = m((x) => x.frame), o = (t == null ? void 0 : t.visualType) || "single", { setCustomCardPreferences: c } = ie(), { components: d, manifest: u } = Ta(
4088
+ ), { data: s } = un(), a = (s == null ? void 0 : s.plugins) || [], l = m((x) => x.card), r = m((x) => x.frame), o = (t == null ? void 0 : t.visualType) || "single", { setCustomCardPreferences: c } = re(), { components: d, manifest: u } = Ta(
4087
4089
  (t == null ? void 0 : t.url) || ""
4088
4090
  ), f = (g = u == null ? void 0 : u.visuals) == null ? void 0 : g.find(
4089
4091
  (x) => x.name === (t == null ? void 0 : t.componentName)
@@ -4104,21 +4106,21 @@ function mi() {
4104
4106
  }
4105
4107
  function b(x) {
4106
4108
  var S, M;
4107
- const O = (S = i == null ? void 0 : i.cards) == null ? void 0 : S.filter((q) => {
4109
+ const O = (S = r == null ? void 0 : r.cards) == null ? void 0 : S.filter((V) => {
4108
4110
  var F;
4109
- return ((F = q == null ? void 0 : q.customCardPreferences) == null ? void 0 : F.visualType) !== "multiple";
4110
- }).map((q) => ({
4111
- value: q.id,
4112
- label: q.tabTitle || q.title
4111
+ return ((F = V == null ? void 0 : V.customCardPreferences) == null ? void 0 : F.visualType) !== "multiple";
4112
+ }).map((V) => ({
4113
+ value: V.id,
4114
+ label: V.tabTitle || V.title
4113
4115
  }));
4114
- return /* @__PURE__ */ e("div", { className: "space-y-2", children: (M = x == null ? void 0 : x.dataInputs) == null ? void 0 : M.map((q, F) => {
4116
+ return /* @__PURE__ */ e("div", { className: "space-y-2", children: (M = x == null ? void 0 : x.dataInputs) == null ? void 0 : M.map((V, F) => {
4115
4117
  var G, _;
4116
4118
  return /* @__PURE__ */ n(
4117
4119
  "div",
4118
4120
  {
4119
4121
  className: "grid grid-cols-10 gap-2",
4120
4122
  children: [
4121
- /* @__PURE__ */ e("div", { className: "col-span-4 flex items-center", children: q }),
4123
+ /* @__PURE__ */ e("div", { className: "col-span-4 flex items-center", children: V }),
4122
4124
  /* @__PURE__ */ e(
4123
4125
  Ne,
4124
4126
  {
@@ -4135,8 +4137,8 @@ function mi() {
4135
4137
  );
4136
4138
  }) });
4137
4139
  }
4138
- function v(x, O, S = []) {
4139
- var M, q;
4140
+ function N(x, O, S = []) {
4141
+ var M, V;
4140
4142
  return t ? x === "input" ? /* @__PURE__ */ e(
4141
4143
  he,
4142
4144
  {
@@ -4159,7 +4161,7 @@ function mi() {
4159
4161
  className: "h-8 w-full",
4160
4162
  label: "",
4161
4163
  options: S,
4162
- value: ((q = t == null ? void 0 : t.settings) == null ? void 0 : q[O]) || "",
4164
+ value: ((V = t == null ? void 0 : t.settings) == null ? void 0 : V[O]) || "",
4163
4165
  onValueChange: (F) => {
4164
4166
  c({
4165
4167
  ...t,
@@ -4169,11 +4171,11 @@ function mi() {
4169
4171
  }
4170
4172
  ) : null : null;
4171
4173
  }
4172
- function r(x) {
4174
+ function i(x) {
4173
4175
  const O = Object.entries((x == null ? void 0 : x.settings) || {});
4174
4176
  return /* @__PURE__ */ e("div", { className: "space-y-3", children: O.map(([S, M]) => /* @__PURE__ */ n("div", { className: "space-y-2", children: [
4175
4177
  /* @__PURE__ */ e($, { children: M.title }),
4176
- v(
4178
+ N(
4177
4179
  M.ui,
4178
4180
  S,
4179
4181
  M.options
@@ -4210,7 +4212,7 @@ function mi() {
4210
4212
  }
4211
4213
  ) }) }),
4212
4214
  ((t == null ? void 0 : t.type) === "component" || (t == null ? void 0 : t.type) === void 0) && /* @__PURE__ */ e(
4213
- hi,
4215
+ hr,
4214
4216
  {
4215
4217
  options: [
4216
4218
  { value: "single", label: "Single Visual" },
@@ -4250,18 +4252,18 @@ function mi() {
4250
4252
  /* @__PURE__ */ e($, { children: "Input Mapping" }),
4251
4253
  /* @__PURE__ */ e("div", { className: "px-2", children: b(f) })
4252
4254
  ] }),
4253
- f && f.settings && /* @__PURE__ */ e("div", { className: "space-y-3", children: /* @__PURE__ */ e("div", { className: "px-2", children: r(f) }) })
4255
+ f && f.settings && /* @__PURE__ */ e("div", { className: "space-y-3", children: /* @__PURE__ */ e("div", { className: "px-2", children: i(f) }) })
4254
4256
  ] })
4255
4257
  ]
4256
4258
  }
4257
4259
  );
4258
4260
  }
4259
4261
  function Ee() {
4260
- const [t, s] = P([]);
4262
+ const [t, s] = H([]);
4261
4263
  m(
4262
4264
  (h) => h.card.cfg
4263
4265
  );
4264
- const a = m((h) => h.card.preferences), { setCardCfg: l, setFilterOnClickColumnIndex: i, setCardPreferences: o } = m((h) => h.actions), c = m(
4266
+ const a = m((h) => h.card.preferences), { setCardCfg: l, setFilterOnClickColumnIndex: r, setCardPreferences: o } = m((h) => h.actions), c = m(
4265
4267
  (h) => h.queryResultColumns
4266
4268
  );
4267
4269
  m(
@@ -4273,8 +4275,8 @@ function Ee() {
4273
4275
  c && s(new Array(c.length).fill(!1));
4274
4276
  }, [c]);
4275
4277
  function d(h, b) {
4276
- var v, r;
4277
- b ? a != null && a.onClickFilter && ((v = a == null ? void 0 : a.onClickFilter) == null ? void 0 : v.length) > 0 ? o({
4278
+ var N, i;
4279
+ b ? a != null && a.onClickFilter && ((N = a == null ? void 0 : a.onClickFilter) == null ? void 0 : N.length) > 0 ? o({
4278
4280
  ...a,
4279
4281
  onClickFilter: [
4280
4282
  ...a.onClickFilter,
@@ -4293,7 +4295,7 @@ function Ee() {
4293
4295
  ]
4294
4296
  }) : (o({
4295
4297
  ...a,
4296
- onClickFilter: (r = a == null ? void 0 : a.onClickFilter) == null ? void 0 : r.filter(
4298
+ onClickFilter: (i = a == null ? void 0 : a.onClickFilter) == null ? void 0 : i.filter(
4297
4299
  (y) => y.columnIndex !== h
4298
4300
  )
4299
4301
  }), s((y) => {
@@ -4302,23 +4304,23 @@ function Ee() {
4302
4304
  }));
4303
4305
  }
4304
4306
  function u(h, b) {
4305
- var r;
4306
- const v = (r = a == null ? void 0 : a.onClickFilter) == null ? void 0 : r.map((y) => y.columnIndex === h ? {
4307
+ var i;
4308
+ const N = (i = a == null ? void 0 : a.onClickFilter) == null ? void 0 : i.map((y) => y.columnIndex === h ? {
4307
4309
  ...y,
4308
4310
  expression: b.target.value
4309
4311
  } : y);
4310
4312
  o({
4311
4313
  ...a,
4312
- onClickFilter: v
4314
+ onClickFilter: N
4313
4315
  });
4314
4316
  }
4315
4317
  function f(h) {
4316
- var b, v, r, y;
4317
- if (t != null && t[h] || (v = (b = a == null ? void 0 : a.onClickFilter) == null ? void 0 : b.find((g) => g.columnIndex === h)) != null && v.expression)
4318
+ var b, N, i, y;
4319
+ if (t != null && t[h] || (N = (b = a == null ? void 0 : a.onClickFilter) == null ? void 0 : b.find((g) => g.columnIndex === h)) != null && N.expression)
4318
4320
  return /* @__PURE__ */ e(
4319
4321
  he,
4320
4322
  {
4321
- value: (y = (r = a == null ? void 0 : a.onClickFilter) == null ? void 0 : r.find((g) => g.columnIndex === h)) == null ? void 0 : y.expression,
4323
+ value: (y = (i = a == null ? void 0 : a.onClickFilter) == null ? void 0 : i.find((g) => g.columnIndex === h)) == null ? void 0 : y.expression,
4322
4324
  onChange: (g) => u(h, g),
4323
4325
  type: "text",
4324
4326
  className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
@@ -4329,7 +4331,7 @@ function Ee() {
4329
4331
  return /* @__PURE__ */ n("div", { className: "space-y-2", children: [
4330
4332
  /* @__PURE__ */ e($, { children: "On Click" }),
4331
4333
  c == null ? void 0 : c.map((h, b) => {
4332
- var v, r;
4334
+ var N, i;
4333
4335
  return /* @__PURE__ */ e(
4334
4336
  "div",
4335
4337
  {
@@ -4339,7 +4341,7 @@ function Ee() {
4339
4341
  /* @__PURE__ */ e(
4340
4342
  Et,
4341
4343
  {
4342
- checked: !!((v = a == null ? void 0 : a.onClickFilter) != null && v.find(
4344
+ checked: !!((N = a == null ? void 0 : a.onClickFilter) != null && N.find(
4343
4345
  (y) => y.columnIndex === b
4344
4346
  )),
4345
4347
  onCheckedChange: (y) => d(b, y)
@@ -4352,7 +4354,7 @@ function Ee() {
4352
4354
  children: h
4353
4355
  }
4354
4356
  ),
4355
- /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: ((r = a == null ? void 0 : a.onClickFilter) == null ? void 0 : r.find(
4357
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: ((i = a == null ? void 0 : a.onClickFilter) == null ? void 0 : i.find(
4356
4358
  (y) => y.columnIndex === b
4357
4359
  )) && /* @__PURE__ */ e(
4358
4360
  da,
@@ -4379,10 +4381,10 @@ function gt() {
4379
4381
  var c, d, u;
4380
4382
  const t = m((f) => f.card.preferences), s = m(
4381
4383
  (f) => f.card.cfg
4382
- ), { setCardCfg: a, setCardPreferences: l, setChartOrientation: i } = m((f) => f.actions);
4384
+ ), { setCardCfg: a, setCardPreferences: l, setChartOrientation: r } = m((f) => f.actions);
4383
4385
  (c = s == null ? void 0 : s.options) != null && c.indexAxis;
4384
4386
  function o(f) {
4385
- i(f);
4387
+ r(f);
4386
4388
  }
4387
4389
  return /* @__PURE__ */ n(
4388
4390
  ft,
@@ -4406,43 +4408,43 @@ function gt() {
4406
4408
  }
4407
4409
  const at = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
4408
4410
  function aa(t, s) {
4409
- var l, i, o;
4410
- const a = Ea(t, s);
4411
- return ((o = (i = (l = t == null ? void 0 : t.chartOptions) == null ? void 0 : l.scales) == null ? void 0 : i[a]) == null ? void 0 : o.type) || "linear";
4411
+ var l, r, o;
4412
+ const a = Va(t, s);
4413
+ return ((o = (r = (l = t == null ? void 0 : t.chartOptions) == null ? void 0 : l.scales) == null ? void 0 : r[a]) == null ? void 0 : o.type) || "linear";
4412
4414
  }
4413
- function un() {
4414
- var V, N, I, H, Z, X;
4415
- const [t, s] = P(!1), a = m((j) => {
4415
+ function hn() {
4416
+ var P, v, I, R, Z, X;
4417
+ const [t, s] = H(!1), a = m((q) => {
4416
4418
  var L;
4417
- return (L = j.card) == null ? void 0 : L.preferences;
4418
- }), l = m((j) => {
4419
+ return (L = q.card) == null ? void 0 : L.preferences;
4420
+ }), l = m((q) => {
4419
4421
  var L;
4420
- return (L = j.card) == null ? void 0 : L.cfg;
4421
- }), i = Ea(a, l), [o, c] = P(
4422
+ return (L = q.card) == null ? void 0 : L.cfg;
4423
+ }), r = Va(a, l), [o, c] = H(
4422
4424
  aa(a)
4423
- ), [d, u] = P(
4424
- ((I = (N = (V = a == null ? void 0 : a.chartOptions) == null ? void 0 : V.scales) == null ? void 0 : N[i]) == null ? void 0 : I.min) || ""
4425
- ), [f, h] = P(
4426
- ((X = (Z = (H = a == null ? void 0 : a.chartOptions) == null ? void 0 : H.scales) == null ? void 0 : Z[i]) == null ? void 0 : X.max) || ""
4427
- ), [b, v] = P(d || f ? "custom" : "auto"), [r, y] = P(""), [g, C] = P(0), [x, O] = P(""), [S, M] = P(""), [q, F] = P(""), G = m(
4428
- (j) => j.actions.setCardPreferences
4429
- ), { updateCardInFrame: _ } = ie(), B = m((j) => j.card), p = m((j) => {
4425
+ ), [d, u] = H(
4426
+ ((I = (v = (P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : v[r]) == null ? void 0 : I.min) || ""
4427
+ ), [f, h] = H(
4428
+ ((X = (Z = (R = a == null ? void 0 : a.chartOptions) == null ? void 0 : R.scales) == null ? void 0 : Z[r]) == null ? void 0 : X.max) || ""
4429
+ ), [b, N] = H(d || f ? "custom" : "auto"), [i, y] = H(""), [g, C] = H(0), [x, O] = H(""), [S, M] = H(""), [V, F] = H(""), G = m(
4430
+ (q) => q.actions.setCardPreferences
4431
+ ), { updateCardInFrame: _ } = re(), B = m((q) => q.card), p = m((q) => {
4430
4432
  var L;
4431
- return (L = j.card) == null ? void 0 : L.type;
4433
+ return (L = q.card) == null ? void 0 : L.type;
4432
4434
  }), E = ["pie", "doughnut", "polarArea"].includes(p);
4433
4435
  de(() => {
4434
- var j, L, ue, k, J, se, oe, Se, xe, Y, ce, T, re, ye;
4436
+ var q, L, ue, k, J, se, oe, Se, xe, Y, ce, T, ie, ye;
4435
4437
  c(aa(a)), u(
4436
- ((ue = (L = (j = a == null ? void 0 : a.chartOptions) == null ? void 0 : j.scales) == null ? void 0 : L[i]) == null ? void 0 : ue.min) === 0 ? 0 : ""
4437
- ), h(((se = (J = (k = a == null ? void 0 : a.chartOptions) == null ? void 0 : k.scales) == null ? void 0 : J[i]) == null ? void 0 : se.max) || ""), y(
4438
- ((Y = (xe = (Se = (oe = a == null ? void 0 : a.chartOptions) == null ? void 0 : oe.scales) == null ? void 0 : Se[i]) == null ? void 0 : xe.ticks) == null ? void 0 : Y.stepSize) || ""
4439
- ), C(((ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ce.decimalPlaces) || 0), O(((T = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : T.suffix) || ""), M(((re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : re.currency) || ""), F(((ye = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ye.locale) || "");
4440
- }, [t, a, i]);
4441
- function W(j, L) {
4442
- return L === "" || /^[0-9\b]+$/.test(L) ? Number(L) : Number(j);
4438
+ ((ue = (L = (q = a == null ? void 0 : a.chartOptions) == null ? void 0 : q.scales) == null ? void 0 : L[r]) == null ? void 0 : ue.min) === 0 ? 0 : ""
4439
+ ), h(((se = (J = (k = a == null ? void 0 : a.chartOptions) == null ? void 0 : k.scales) == null ? void 0 : J[r]) == null ? void 0 : se.max) || ""), y(
4440
+ ((Y = (xe = (Se = (oe = a == null ? void 0 : a.chartOptions) == null ? void 0 : oe.scales) == null ? void 0 : Se[r]) == null ? void 0 : xe.ticks) == null ? void 0 : Y.stepSize) || ""
4441
+ ), C(((ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ce.decimalPlaces) || 0), O(((T = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : T.suffix) || ""), M(((ie = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ie.currency) || ""), F(((ye = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ye.locale) || "");
4442
+ }, [t, a, r]);
4443
+ function W(q, L) {
4444
+ return L === "" || /^[0-9\b]+$/.test(L) ? Number(L) : Number(q);
4443
4445
  }
4444
4446
  function A() {
4445
- const j = [
4447
+ const q = [
4446
4448
  ...new Set(ct.map((L) => L.currency))
4447
4449
  ];
4448
4450
  return /* @__PURE__ */ n(le, { children: [
@@ -4472,12 +4474,12 @@ function un() {
4472
4474
  /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ n(ke, { children: [
4473
4475
  /* @__PURE__ */ e(Ce, { children: "Currency" }),
4474
4476
  /* @__PURE__ */ e(Q, { value: "none", children: "None" }),
4475
- j.map((L) => /* @__PURE__ */ e(Q, { value: L, children: L }, L))
4477
+ q.map((L) => /* @__PURE__ */ e(Q, { value: L, children: L }, L))
4476
4478
  ] }) })
4477
4479
  ]
4478
4480
  }
4479
4481
  ),
4480
- /* @__PURE__ */ n(me, { value: q, onValueChange: (L) => F(L), children: [
4482
+ /* @__PURE__ */ n(me, { value: V, onValueChange: (L) => F(L), children: [
4481
4483
  /* @__PURE__ */ e(
4482
4484
  pe,
4483
4485
  {
@@ -4514,7 +4516,7 @@ function un() {
4514
4516
  {
4515
4517
  id: "min",
4516
4518
  value: d,
4517
- onChange: (j) => u((L) => W(L, j.target.value)),
4519
+ onChange: (q) => u((L) => W(L, q.target.value)),
4518
4520
  className: `col-span-1 h-8 w-full ${at}`
4519
4521
  }
4520
4522
  ),
@@ -4522,7 +4524,7 @@ function un() {
4522
4524
  he,
4523
4525
  {
4524
4526
  value: f,
4525
- onChange: (j) => h((L) => W(L, j.target.value)),
4527
+ onChange: (q) => h((L) => W(L, q.target.value)),
4526
4528
  id: "max",
4527
4529
  className: `col-span-1 h-8 w-full ${at}`
4528
4530
  }
@@ -4533,8 +4535,8 @@ function un() {
4533
4535
  /* @__PURE__ */ e(
4534
4536
  he,
4535
4537
  {
4536
- value: r,
4537
- onChange: (j) => y((L) => W(L, j.target.value)),
4538
+ value: i,
4539
+ onChange: (q) => y((L) => W(L, q.target.value)),
4538
4540
  id: "step-size",
4539
4541
  className: `col-span-1 h-8 w-full ${at}`
4540
4542
  }
@@ -4544,12 +4546,12 @@ function un() {
4544
4546
  }
4545
4547
  function K() {
4546
4548
  var k;
4547
- let j = {};
4548
- b === "custom" && (j = {
4549
+ let q = {};
4550
+ b === "custom" && (q = {
4549
4551
  min: d,
4550
4552
  max: f,
4551
4553
  ticks: {
4552
- stepSize: r
4554
+ stepSize: i
4553
4555
  }
4554
4556
  });
4555
4557
  const L = {
@@ -4558,10 +4560,10 @@ function un() {
4558
4560
  ...a == null ? void 0 : a.chartOptions,
4559
4561
  scales: {
4560
4562
  ...(k = a == null ? void 0 : a.chartOptions) == null ? void 0 : k.scales,
4561
- [i]: {
4563
+ [r]: {
4562
4564
  // ...cardPreferences?.chartOptions?.scales?.[axis],
4563
4565
  type: o,
4564
- ...o === "linear" ? j : {}
4566
+ ...o === "linear" ? q : {}
4565
4567
  }
4566
4568
  }
4567
4569
  },
@@ -4569,7 +4571,7 @@ function un() {
4569
4571
  decimalPlaces: g,
4570
4572
  suffix: x,
4571
4573
  currency: S,
4572
- locale: q
4574
+ locale: V
4573
4575
  }
4574
4576
  };
4575
4577
  console.log(L), G(L);
@@ -4579,7 +4581,7 @@ function un() {
4579
4581
  };
4580
4582
  _(ue);
4581
4583
  }
4582
- return /* @__PURE__ */ n(Re, { onOpenChange: (j) => s(j), children: [
4584
+ return /* @__PURE__ */ n(Re, { onOpenChange: (q) => s(q), children: [
4583
4585
  /* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ e(ks, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
4584
4586
  /* @__PURE__ */ e(He, { align: "center", className: "max-w-65", children: /* @__PURE__ */ n("div", { className: "grid gap-4", children: [
4585
4587
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
@@ -4594,7 +4596,7 @@ function un() {
4594
4596
  {
4595
4597
  disabled: E,
4596
4598
  value: o,
4597
- onValueChange: (j) => c(j),
4599
+ onValueChange: (q) => c(q),
4598
4600
  children: [
4599
4601
  /* @__PURE__ */ e(pe, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e(fe, {}) }),
4600
4602
  /* @__PURE__ */ e(ge, { id: "type", children: /* @__PURE__ */ n(ke, { children: [
@@ -4614,7 +4616,7 @@ function un() {
4614
4616
  disabled: E,
4615
4617
  id: "scale-option",
4616
4618
  value: b,
4617
- onValueChange: (j) => v(j),
4619
+ onValueChange: (q) => N(q),
4618
4620
  className: "col-span-2 flex gap-3",
4619
4621
  defaultValue: "x",
4620
4622
  children: [
@@ -4646,7 +4648,7 @@ function un() {
4646
4648
  ] }) })
4647
4649
  ] });
4648
4650
  }
4649
- function pi({ idx: t }) {
4651
+ function pr({ idx: t }) {
4650
4652
  var d;
4651
4653
  const s = m((u) => {
4652
4654
  var f;
@@ -4658,7 +4660,7 @@ function pi({ idx: t }) {
4658
4660
  }
4659
4661
  ), l = m(
4660
4662
  (u) => u.actions.setCardPreferences
4661
- ), i = (d = s == null ? void 0 : s.chartOptions) == null ? void 0 : d.indexAxis, o = a == null ? void 0 : a.find((u) => u.idx === t);
4663
+ ), r = (d = s == null ? void 0 : s.chartOptions) == null ? void 0 : d.indexAxis, o = a == null ? void 0 : a.find((u) => u.idx === t);
4662
4664
  function c(u, f) {
4663
4665
  (u === "end" || u === "start") && Is(Ms());
4664
4666
  const h = {
@@ -4681,12 +4683,12 @@ function pi({ idx: t }) {
4681
4683
  else {
4682
4684
  const b = { ...o };
4683
4685
  b.datalabels = h;
4684
- const v = a == null ? void 0 : a.map(
4685
- (r) => r.idx === f ? b : r
4686
+ const N = a == null ? void 0 : a.map(
4687
+ (i) => i.idx === f ? b : i
4686
4688
  );
4687
4689
  l({
4688
4690
  ...s,
4689
- datasetOptions: v
4691
+ datasetOptions: N
4690
4692
  });
4691
4693
  }
4692
4694
  }
@@ -4714,7 +4716,7 @@ function pi({ idx: t }) {
4714
4716
  ol,
4715
4717
  {
4716
4718
  className: ee("h-4 w-4", {
4717
- "rotate-90": i === "y"
4719
+ "rotate-90": r === "y"
4718
4720
  })
4719
4721
  }
4720
4722
  )
@@ -4731,7 +4733,7 @@ function pi({ idx: t }) {
4731
4733
  dl,
4732
4734
  {
4733
4735
  className: ee("h-4 w-4", {
4734
- "rotate-90": i === "y"
4736
+ "rotate-90": r === "y"
4735
4737
  })
4736
4738
  }
4737
4739
  )
@@ -4748,7 +4750,7 @@ function pi({ idx: t }) {
4748
4750
  cl,
4749
4751
  {
4750
4752
  className: ee("h-4 w-4", {
4751
- "rotate-90": i === "y"
4753
+ "rotate-90": r === "y"
4752
4754
  })
4753
4755
  }
4754
4756
  )
@@ -4757,13 +4759,13 @@ function pi({ idx: t }) {
4757
4759
  ] }) })
4758
4760
  ] });
4759
4761
  }
4760
- function hn() {
4762
+ function mn() {
4761
4763
  const t = m((f) => f.card), s = m(
4762
4764
  (f) => {
4763
- var h, b, v;
4764
- return (v = (b = (h = f == null ? void 0 : f.card) == null ? void 0 : h.preferences) == null ? void 0 : b.chartOptions) == null ? void 0 : v.indexAxis;
4765
+ var h, b, N;
4766
+ return (N = (b = (h = f == null ? void 0 : f.card) == null ? void 0 : h.preferences) == null ? void 0 : b.chartOptions) == null ? void 0 : N.indexAxis;
4765
4767
  }
4766
- ), { data: a } = Le(t), l = s === "y" ? "Y axis" : "X axis", i = s === "y" ? "X axis" : "Y axis", {
4768
+ ), { data: a } = Le(t), l = s === "y" ? "Y axis" : "X axis", r = s === "y" ? "X axis" : "Y axis", {
4767
4769
  keys: o,
4768
4770
  metricKeys: c,
4769
4771
  dimensionKeys: d
@@ -4781,21 +4783,21 @@ function hn() {
4781
4783
  return o.length === 0 ? null : /* @__PURE__ */ n("div", { className: "space-y-4", children: [
4782
4784
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
4783
4785
  /* @__PURE__ */ e($, { children: l }),
4784
- /* @__PURE__ */ e("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e("div", { className: "rounded-md bg-muted/70 px-3 py-2 hover:bg-muted", children: /* @__PURE__ */ e("p", { title: d[0], children: mn(d[0]) }) }) })
4786
+ /* @__PURE__ */ e("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e("div", { className: "rounded-md bg-muted/70 px-3 py-2 hover:bg-muted", children: /* @__PURE__ */ e("p", { title: d[0], children: pn(d[0]) }) }) })
4785
4787
  ] }),
4786
4788
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
4787
4789
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-5", children: [
4788
- /* @__PURE__ */ e($, { children: i }),
4789
- /* @__PURE__ */ e(un, {})
4790
+ /* @__PURE__ */ e($, { children: r }),
4791
+ /* @__PURE__ */ e(hn, {})
4790
4792
  ] }),
4791
- /* @__PURE__ */ e("div", { className: "my-1 max-h-[125px] space-y-1 overflow-y-auto", children: u.map((f, h) => /* @__PURE__ */ e(fi, { col: f, idx: h }, f)) })
4793
+ /* @__PURE__ */ e("div", { className: "my-1 max-h-[125px] space-y-1 overflow-y-auto", children: u.map((f, h) => /* @__PURE__ */ e(fr, { col: f, idx: h }, f)) })
4792
4794
  ] })
4793
4795
  ] });
4794
4796
  }
4795
- function mn(t, s = 30) {
4797
+ function pn(t, s = 30) {
4796
4798
  return t.length > s ? t.slice(0, s) + "..." : t;
4797
4799
  }
4798
- function fi({ col: t, idx: s }) {
4800
+ function fr({ col: t, idx: s }) {
4799
4801
  const a = m((d) => {
4800
4802
  var u;
4801
4803
  return (u = d.card) == null ? void 0 : u.preferences;
@@ -4804,9 +4806,9 @@ function fi({ col: t, idx: s }) {
4804
4806
  var u;
4805
4807
  return (u = d.card.preferences) == null ? void 0 : u.datasetOptions;
4806
4808
  }
4807
- ), i = l == null ? void 0 : l.find((d) => d.idx === s), { setCardPreferences: o } = m((d) => d.actions);
4809
+ ), r = l == null ? void 0 : l.find((d) => d.idx === s), { setCardPreferences: o } = m((d) => d.actions);
4808
4810
  function c(d) {
4809
- if (!i)
4811
+ if (!r)
4810
4812
  o({
4811
4813
  ...a,
4812
4814
  datasetOptions: [
@@ -4819,7 +4821,7 @@ function fi({ col: t, idx: s }) {
4819
4821
  ]
4820
4822
  });
4821
4823
  else {
4822
- const u = { ...i };
4824
+ const u = { ...r };
4823
4825
  u.type = d === "area" ? "line" : d, u.fill = d === "area" ? "origin" : "";
4824
4826
  const f = l == null ? void 0 : l.map(
4825
4827
  (h) => h.idx === s ? u : h
@@ -4831,7 +4833,7 @@ function fi({ col: t, idx: s }) {
4831
4833
  }
4832
4834
  }
4833
4835
  return /* @__PURE__ */ n("div", { className: "group flex items-center justify-between gap-5 rounded-md bg-muted/70 px-3 py-2 hover:bg-muted", children: [
4834
- /* @__PURE__ */ e("p", { title: t, children: mn(t) }),
4836
+ /* @__PURE__ */ e("p", { title: t, children: pn(t) }),
4835
4837
  /* @__PURE__ */ n("div", { className: "flex gap-2", children: [
4836
4838
  /* @__PURE__ */ e(
4837
4839
  qt,
@@ -4854,24 +4856,24 @@ function fi({ col: t, idx: s }) {
4854
4856
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
4855
4857
  }
4856
4858
  ),
4857
- /* @__PURE__ */ e(pi, { idx: s })
4859
+ /* @__PURE__ */ e(pr, { idx: s })
4858
4860
  ] })
4859
4861
  ] });
4860
4862
  }
4861
- function pn() {
4862
- const t = m((r) => r.selectedConnectionId), s = m((r) => r.selectedDatamodelId), a = m((r) => r.selectedDatabaseName), l = m((r) => r.selectedSchemaName), i = m((r) => r.selectedTableName), o = D((r) => r.dashboard.filters) || [], c = D((r) => r.actions.addFilter), d = D((r) => r.actions.removeFilter), { removeFilterValues: u } = Xe(), { modelItems: f, tableName: h, connectionType: b } = Ae();
4863
- function v(r, y = "dashboard") {
4863
+ function fn() {
4864
+ const t = m((i) => i.selectedConnectionId), s = m((i) => i.selectedDatamodelId), a = m((i) => i.selectedDatabaseName), l = m((i) => i.selectedSchemaName), r = m((i) => i.selectedTableName), o = D((i) => i.dashboard.filters) || [], c = D((i) => i.actions.addFilter), d = D((i) => i.actions.removeFilter), { removeFilterValues: u } = Xe(), { modelItems: f, tableName: h, connectionType: b } = Ae();
4865
+ function N(i, y = "dashboard") {
4864
4866
  var G;
4865
- const g = ve(r.column_name), C = ve(a || ""), x = ve(l || ""), O = ve(h);
4867
+ const g = ve(i.column_name), C = ve(a || ""), x = ve(l || ""), O = ve(h);
4866
4868
  let S = Ds(
4867
4869
  x,
4868
4870
  O,
4869
4871
  b
4870
4872
  ), M = `${S}.${g}`;
4871
- const q = (G = f == null ? void 0 : f.find(
4873
+ const V = (G = f == null ? void 0 : f.find(
4872
4874
  (_) => _.id === s
4873
4875
  )) == null ? void 0 : G.name;
4874
- s && s !== "none" && (M = `${Zt}.${q}.${g}`, S = `${Zt}.${q}`);
4876
+ s && s !== "none" && (M = `${Zt}.${V}.${g}`, S = `${Zt}.${V}`);
4875
4877
  const F = o == null ? void 0 : o.find(
4876
4878
  (_) => _.column === M && _.table === O && (_.database === C || _.database === a)
4877
4879
  );
@@ -4884,15 +4886,15 @@ function pn() {
4884
4886
  id: _,
4885
4887
  //uuidv4(),
4886
4888
  column: M,
4887
- title: r.column_name,
4888
- dataType: r.data_type,
4889
+ title: i.column_name,
4890
+ dataType: i.data_type,
4889
4891
  table: "api",
4890
4892
  database: "",
4891
4893
  // database: 'NA',
4892
4894
  connectionId: t,
4893
4895
  operation: "in",
4894
4896
  sql: Qt(
4895
- r.data_type,
4897
+ i.data_type,
4896
4898
  S,
4897
4899
  g
4898
4900
  )
@@ -4903,14 +4905,14 @@ function pn() {
4903
4905
  location: y,
4904
4906
  column: M,
4905
4907
  //columnName, //`${qualifiedTableName}.${formattedColumnName}`,
4906
- title: r.column_name,
4907
- dataType: r.data_type,
4908
- table: i || "",
4908
+ title: i.column_name,
4909
+ dataType: i.data_type,
4910
+ table: r || "",
4909
4911
  database: a || "",
4910
4912
  connectionId: t || "",
4911
4913
  operation: "in",
4912
4914
  sql: Qt(
4913
- r.data_type,
4915
+ i.data_type,
4914
4916
  S,
4915
4917
  g
4916
4918
  )
@@ -4918,29 +4920,29 @@ function pn() {
4918
4920
  }), _);
4919
4921
  }
4920
4922
  }
4921
- return { assignFilter: v };
4923
+ return { assignFilter: N };
4922
4924
  }
4923
4925
  function $e() {
4924
4926
  const t = D(
4925
4927
  (d) => d.dashboard.filters
4926
- ), s = m((d) => d.frame), { setFrame: a } = ie(), { columns: l } = Ae(), { assignFilter: i } = pn();
4928
+ ), s = m((d) => d.frame), { setFrame: a } = re(), { columns: l } = Ae(), { assignFilter: r } = fn();
4927
4929
  function o(d) {
4928
- const u = i(d, "frame");
4930
+ const u = r(d, "frame");
4929
4931
  a({ ...s, filterId: u });
4930
4932
  }
4931
4933
  const c = t == null ? void 0 : t.find((d) => d.id === s.filterId);
4932
4934
  return /* @__PURE__ */ n("div", { className: "space-y-3", children: [
4933
4935
  /* @__PURE__ */ e($, { children: "Card Filter" }),
4934
- /* @__PURE__ */ e(gi, { onSelect: o, columns: l }),
4935
- c && /* @__PURE__ */ e(Va, { filter: c })
4936
+ /* @__PURE__ */ e(gr, { onSelect: o, columns: l }),
4937
+ c && /* @__PURE__ */ e(qa, { filter: c })
4936
4938
  ] });
4937
4939
  }
4938
- function gi({
4940
+ function gr({
4939
4941
  columns: t,
4940
4942
  onSelect: s
4941
4943
  }) {
4942
4944
  var c;
4943
- const [a, l] = qe.useState(!1), [i, o] = qe.useState("");
4945
+ const [a, l] = qe.useState(!1), [r, o] = qe.useState("");
4944
4946
  return /* @__PURE__ */ n(Re, { open: a, onOpenChange: l, children: [
4945
4947
  /* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ n(
4946
4948
  z,
@@ -4951,7 +4953,7 @@ function gi({
4951
4953
  "aria-expanded": a,
4952
4954
  className: "w-full justify-between font-normal",
4953
4955
  children: [
4954
- i ? (c = t.find((d) => d.column_name === i)) == null ? void 0 : c.column_name : "Select Column...",
4956
+ r ? (c = t.find((d) => d.column_name === r)) == null ? void 0 : c.column_name : "Select Column...",
4955
4957
  /* @__PURE__ */ e(zs, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
4956
4958
  ]
4957
4959
  }
@@ -4965,7 +4967,7 @@ function gi({
4965
4967
  {
4966
4968
  value: d.column_name,
4967
4969
  onSelect: (u) => {
4968
- const f = u === i ? "" : u;
4970
+ const f = u === r ? "" : u;
4969
4971
  o(f), l(!1), f && s(d);
4970
4972
  },
4971
4973
  children: [
@@ -4975,7 +4977,7 @@ function gi({
4975
4977
  {
4976
4978
  className: ee(
4977
4979
  "ml-auto h-4 w-4",
4978
- i === d.column_name ? "opacity-100" : "opacity-0"
4980
+ r === d.column_name ? "opacity-100" : "opacity-0"
4979
4981
  )
4980
4982
  }
4981
4983
  )
@@ -4987,7 +4989,7 @@ function gi({
4987
4989
  ] }) })
4988
4990
  ] });
4989
4991
  }
4990
- function yi({
4992
+ function yr({
4991
4993
  cardType: t
4992
4994
  }) {
4993
4995
  return /* @__PURE__ */ e("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ n(Fe, { defaultValue: ["item-2"], type: "multiple", children: [
@@ -5020,7 +5022,7 @@ function yi({
5020
5022
  /* @__PURE__ */ e(ae, { children: "Settings" }),
5021
5023
  /* @__PURE__ */ n(ne, { className: "space-y-4 px-2", children: [
5022
5024
  /* @__PURE__ */ e(gt, {}),
5023
- /* @__PURE__ */ e(hn, {})
5025
+ /* @__PURE__ */ e(mn, {})
5024
5026
  ] })
5025
5027
  ] }),
5026
5028
  /* @__PURE__ */ n(te, { value: "item-3", children: [
@@ -5033,7 +5035,7 @@ function yi({
5033
5035
  ] }) });
5034
5036
  }
5035
5037
  function Rt() {
5036
- var i, o, c;
5038
+ var r, o, c;
5037
5039
  const t = m(
5038
5040
  (d) => d.card.cfg
5039
5041
  ), s = m((d) => d.actions.setCardCfg), a = m((d) => d.card.type);
@@ -5061,12 +5063,12 @@ function Rt() {
5061
5063
  return /* @__PURE__ */ n("div", { className: "space-y-2", children: [
5062
5064
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
5063
5065
  /* @__PURE__ */ e("label", { className: "font-medium", children: "Data Labels" }),
5064
- !["pyramid"].includes(a) && /* @__PURE__ */ e(un, {})
5066
+ !["pyramid"].includes(a) && /* @__PURE__ */ e(hn, {})
5065
5067
  ] }),
5066
5068
  /* @__PURE__ */ n(
5067
5069
  me,
5068
5070
  {
5069
- value: (c = (o = (i = t == null ? void 0 : t.options) == null ? void 0 : i.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : c.anchor,
5071
+ value: (c = (o = (r = t == null ? void 0 : t.options) == null ? void 0 : r.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : c.anchor,
5070
5072
  onValueChange: l,
5071
5073
  defaultValue: "none",
5072
5074
  children: [
@@ -5083,7 +5085,7 @@ function Rt() {
5083
5085
  )
5084
5086
  ] });
5085
5087
  }
5086
- function bi({
5088
+ function br({
5087
5089
  cardType: t
5088
5090
  }) {
5089
5091
  function s(a) {
@@ -5130,7 +5132,7 @@ function bi({
5130
5132
  ] })
5131
5133
  ] }) });
5132
5134
  }
5133
- const xi = {
5135
+ const xr = {
5134
5136
  datasets: [
5135
5137
  {
5136
5138
  type: "line",
@@ -5143,7 +5145,7 @@ const xi = {
5143
5145
  data: []
5144
5146
  }
5145
5147
  ]
5146
- }, vi = {
5148
+ }, vr = {
5147
5149
  datasets: [
5148
5150
  {
5149
5151
  fill: "origin",
@@ -5153,7 +5155,7 @@ const xi = {
5153
5155
  }
5154
5156
  ]
5155
5157
  };
5156
- function Ni() {
5158
+ function Nr() {
5157
5159
  const t = m((s) => s.card.type);
5158
5160
  return /* @__PURE__ */ n("div", { className: "space-y-6 p-6", children: [
5159
5161
  /* @__PURE__ */ e(
@@ -5162,7 +5164,7 @@ function Ni() {
5162
5164
  className: " ",
5163
5165
  type: "single",
5164
5166
  collapsible: !0,
5165
- children: Ci(t)
5167
+ children: Cr(t)
5166
5168
  }
5167
5169
  ),
5168
5170
  /* @__PURE__ */ e("section", { className: "", children: ["line", "bar"].includes(t) && /* @__PURE__ */ e(gt, {}) }),
@@ -5173,7 +5175,7 @@ function Ni() {
5173
5175
  ] })
5174
5176
  ] });
5175
5177
  }
5176
- function Ci(t) {
5178
+ function Cr(t) {
5177
5179
  if (["line", "bar"].includes(t))
5178
5180
  return /* @__PURE__ */ n(le, { children: [
5179
5181
  /* @__PURE__ */ n(te, { value: "item-1", children: [
@@ -5194,7 +5196,7 @@ function Ci(t) {
5194
5196
  /* @__PURE__ */ e("b", { children: "Customize" }),
5195
5197
  " and change the `type` property in the dataset."
5196
5198
  ] }),
5197
- /* @__PURE__ */ e("pre", { children: JSON.stringify(xi, null, 2) })
5199
+ /* @__PURE__ */ e("pre", { children: JSON.stringify(xr, null, 2) })
5198
5200
  ] })
5199
5201
  ] }),
5200
5202
  /* @__PURE__ */ n(te, { value: "item-3", children: [
@@ -5215,7 +5217,7 @@ function Ci(t) {
5215
5217
  ),
5216
5218
  "for more options."
5217
5219
  ] }),
5218
- /* @__PURE__ */ e("pre", { children: JSON.stringify(vi, null, 2) })
5220
+ /* @__PURE__ */ e("pre", { children: JSON.stringify(vr, null, 2) })
5219
5221
  ] })
5220
5222
  ] })
5221
5223
  ] });
@@ -5270,53 +5272,53 @@ function Ci(t) {
5270
5272
  ] })
5271
5273
  ] }) });
5272
5274
  }
5273
- function Si() {
5274
- var u, f, h, b, v;
5275
- const t = m((r) => r.card.preferences), s = m(
5276
- (r) => r.actions.setCardPreferences
5275
+ function Sr() {
5276
+ var u, f, h, b, N;
5277
+ const t = m((i) => i.card.preferences), s = m(
5278
+ (i) => i.actions.setCardPreferences
5277
5279
  ), a = m(
5278
- (r) => r.actions.setNumberFormat
5280
+ (i) => i.actions.setNumberFormat
5279
5281
  );
5280
5282
  m(
5281
- (r) => {
5283
+ (i) => {
5282
5284
  var y, g;
5283
- return (g = (y = r.card.preferences) == null ? void 0 : y.formatNumber) == null ? void 0 : g.decimalPlaces;
5285
+ return (g = (y = i.card.preferences) == null ? void 0 : y.formatNumber) == null ? void 0 : g.decimalPlaces;
5284
5286
  }
5285
5287
  );
5286
5288
  const l = m(
5287
- (r) => {
5289
+ (i) => {
5288
5290
  var y, g;
5289
- return (g = (y = r.card.preferences) == null ? void 0 : y.formatNumber) == null ? void 0 : g.locale;
5291
+ return (g = (y = i.card.preferences) == null ? void 0 : y.formatNumber) == null ? void 0 : g.locale;
5290
5292
  }
5291
- ), i = m(
5292
- (r) => {
5293
+ ), r = m(
5294
+ (i) => {
5293
5295
  var y, g;
5294
- return (g = (y = r.card.preferences) == null ? void 0 : y.formatNumber) == null ? void 0 : g.currency;
5296
+ return (g = (y = i.card.preferences) == null ? void 0 : y.formatNumber) == null ? void 0 : g.currency;
5295
5297
  }
5296
5298
  );
5297
5299
  m(
5298
- (r) => r.actions.setFilterOnClickField
5300
+ (i) => i.actions.setFilterOnClickField
5299
5301
  );
5300
5302
  const o = m(
5301
- (r) => {
5303
+ (i) => {
5302
5304
  var y, g;
5303
- return (g = (y = r.card.preferences) == null ? void 0 : y.formatNumber) == null ? void 0 : g.colorRanges;
5305
+ return (g = (y = i.card.preferences) == null ? void 0 : y.formatNumber) == null ? void 0 : g.colorRanges;
5304
5306
  }
5305
5307
  ) || [], c = m(
5306
- (r) => r.actions.setColorRanges
5307
- ), d = [...new Set(ct.map((r) => r.currency))];
5308
+ (i) => i.actions.setColorRanges
5309
+ ), d = [...new Set(ct.map((i) => i.currency))];
5308
5310
  return /* @__PURE__ */ n("div", { children: [
5309
5311
  /* @__PURE__ */ n("div", { className: "mb-3 flex items-center gap-2", children: [
5310
5312
  /* @__PURE__ */ e(
5311
5313
  Et,
5312
5314
  {
5313
5315
  checked: !!((u = t == null ? void 0 : t.formatNumber) != null && u.enabled),
5314
- onCheckedChange: (r) => {
5316
+ onCheckedChange: (i) => {
5315
5317
  s({
5316
5318
  ...t,
5317
5319
  formatNumber: {
5318
5320
  ...t == null ? void 0 : t.formatNumber,
5319
- enabled: r
5321
+ enabled: i
5320
5322
  }
5321
5323
  });
5322
5324
  }
@@ -5333,12 +5335,12 @@ function Si() {
5333
5335
  me,
5334
5336
  {
5335
5337
  value: l || "none",
5336
- onValueChange: (r) => {
5338
+ onValueChange: (i) => {
5337
5339
  var y, g, C;
5338
5340
  return a(
5339
5341
  ((y = t == null ? void 0 : t.formatNumber) == null ? void 0 : y.decimalPlaces) || 0,
5340
5342
  ((g = t == null ? void 0 : t.formatNumber) == null ? void 0 : g.currency) || "",
5341
- r,
5343
+ i,
5342
5344
  ((C = t == null ? void 0 : t.formatNumber) == null ? void 0 : C.suffix) || ""
5343
5345
  );
5344
5346
  },
@@ -5347,7 +5349,7 @@ function Si() {
5347
5349
  /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ n(ke, { children: [
5348
5350
  /* @__PURE__ */ e(Ce, { children: "Format" }),
5349
5351
  /* @__PURE__ */ e(Q, { value: "none", children: "None" }, "none"),
5350
- ct.map((r) => /* @__PURE__ */ e(Q, { value: r.locale, children: r.locale }, r.locale))
5352
+ ct.map((i) => /* @__PURE__ */ e(Q, { value: i.locale, children: i.locale }, i.locale))
5351
5353
  ] }) })
5352
5354
  ]
5353
5355
  }
@@ -5358,12 +5360,12 @@ function Si() {
5358
5360
  /* @__PURE__ */ n(
5359
5361
  me,
5360
5362
  {
5361
- value: i || "none",
5362
- onValueChange: (r) => {
5363
+ value: r || "none",
5364
+ onValueChange: (i) => {
5363
5365
  var y, g, C;
5364
- console.log("currency", r), a(
5366
+ console.log("currency", i), a(
5365
5367
  ((y = t == null ? void 0 : t.formatNumber) == null ? void 0 : y.decimalPlaces) || 0,
5366
- r === "none" ? "" : r,
5368
+ i === "none" ? "" : i,
5367
5369
  ((g = t == null ? void 0 : t.formatNumber) == null ? void 0 : g.locale) || "",
5368
5370
  ((C = t == null ? void 0 : t.formatNumber) == null ? void 0 : C.suffix) || ""
5369
5371
  );
@@ -5373,7 +5375,7 @@ function Si() {
5373
5375
  /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ n(ke, { children: [
5374
5376
  /* @__PURE__ */ e(Ce, { children: "Currency" }),
5375
5377
  /* @__PURE__ */ e(Q, { value: "none", children: "None" }, "none"),
5376
- d.map((r) => /* @__PURE__ */ e(Q, { value: r, children: r }, r))
5378
+ d.map((i) => /* @__PURE__ */ e(Q, { value: i, children: i }, i))
5377
5379
  ] }) })
5378
5380
  ]
5379
5381
  }
@@ -5387,10 +5389,10 @@ function Si() {
5387
5389
  me,
5388
5390
  {
5389
5391
  value: ((b = (h = t == null ? void 0 : t.formatNumber) == null ? void 0 : h.decimalPlaces) == null ? void 0 : b.toString()) || "0",
5390
- onValueChange: (r) => {
5392
+ onValueChange: (i) => {
5391
5393
  var y, g, C;
5392
5394
  return a(
5393
- Number(r),
5395
+ Number(i),
5394
5396
  ((y = t == null ? void 0 : t.formatNumber) == null ? void 0 : y.currency) || "",
5395
5397
  ((g = t == null ? void 0 : t.formatNumber) == null ? void 0 : g.locale) || "",
5396
5398
  ((C = t == null ? void 0 : t.formatNumber) == null ? void 0 : C.suffix) || ""
@@ -5398,7 +5400,7 @@ function Si() {
5398
5400
  },
5399
5401
  children: [
5400
5402
  /* @__PURE__ */ e(pe, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e(fe, {}) }),
5401
- /* @__PURE__ */ e(ge, { children: ["0", "1", "2", "3", "4"].map((r) => /* @__PURE__ */ e(Q, { value: r, children: r }, r)) })
5403
+ /* @__PURE__ */ e(ge, { children: ["0", "1", "2", "3", "4"].map((i) => /* @__PURE__ */ e(Q, { value: i, children: i }, i)) })
5402
5404
  ]
5403
5405
  }
5404
5406
  )
@@ -5408,16 +5410,16 @@ function Si() {
5408
5410
  /* @__PURE__ */ e(
5409
5411
  he,
5410
5412
  {
5411
- value: ((v = t == null ? void 0 : t.formatNumber) == null ? void 0 : v.suffix) || "",
5413
+ value: ((N = t == null ? void 0 : t.formatNumber) == null ? void 0 : N.suffix) || "",
5412
5414
  className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
5413
5415
  placeholder: "K, M, B, %",
5414
- onChange: (r) => {
5416
+ onChange: (i) => {
5415
5417
  var y, g, C;
5416
5418
  return a(
5417
5419
  ((y = t == null ? void 0 : t.formatNumber) == null ? void 0 : y.decimalPlaces) || 0,
5418
5420
  ((g = t == null ? void 0 : t.formatNumber) == null ? void 0 : g.currency) || "",
5419
5421
  ((C = t == null ? void 0 : t.formatNumber) == null ? void 0 : C.locale) || "",
5420
- r.target.value
5422
+ i.target.value
5421
5423
  );
5422
5424
  }
5423
5425
  }
@@ -5436,7 +5438,7 @@ function Si() {
5436
5438
  ] })
5437
5439
  ] });
5438
5440
  }
5439
- function wi() {
5441
+ function wr() {
5440
5442
  return /* @__PURE__ */ n("div", { className: "space-y-6 px-6 py-2", children: [
5441
5443
  /* @__PURE__ */ e(Fe, { type: "single", collapsible: !0, children: /* @__PURE__ */ n(te, { value: "item-1", children: [
5442
5444
  /* @__PURE__ */ e(ae, { className: "", children: "KPI Query" }),
@@ -5462,12 +5464,12 @@ function wi() {
5462
5464
  ] })
5463
5465
  ] })
5464
5466
  ] }) }),
5465
- /* @__PURE__ */ e("section", { className: "", children: /* @__PURE__ */ e(Si, {}) }),
5467
+ /* @__PURE__ */ e("section", { className: "", children: /* @__PURE__ */ e(Sr, {}) }),
5466
5468
  /* @__PURE__ */ e("div", {}),
5467
5469
  /* @__PURE__ */ e("div", {})
5468
5470
  ] });
5469
5471
  }
5470
- const ki = [
5472
+ const kr = [
5471
5473
  {
5472
5474
  label: "Mercator",
5473
5475
  value: "mercator"
@@ -5524,7 +5526,7 @@ const ki = [
5524
5526
  label: "Natural Earth 1",
5525
5527
  value: "naturalEarth1"
5526
5528
  }
5527
- ], Oi = [
5529
+ ], Or = [
5528
5530
  "blues",
5529
5531
  "brBG",
5530
5532
  "buGn",
@@ -5563,15 +5565,15 @@ const ki = [
5563
5565
  "ylGnBu",
5564
5566
  "ylOrBr",
5565
5567
  "ylOrRd"
5566
- ], Ii = Oi.map((t) => ({
5568
+ ], Ir = Or.map((t) => ({
5567
5569
  label: t,
5568
5570
  value: t
5569
5571
  }));
5570
- function Mi() {
5571
- var u, f, h, b, v, r, y, g, C, x, O, S, M, q, F, G, _, B;
5572
- const t = m((p) => p.card), s = (f = (u = t == null ? void 0 : t.preferences) == null ? void 0 : u.mapVisualOptions) == null ? void 0 : f.topoJsonUrl, [a, l] = P(
5572
+ function Mr() {
5573
+ var u, f, h, b, N, i, y, g, C, x, O, S, M, V, F, G, _, B;
5574
+ const t = m((p) => p.card), s = (f = (u = t == null ? void 0 : t.preferences) == null ? void 0 : u.mapVisualOptions) == null ? void 0 : f.topoJsonUrl, [a, l] = H(
5573
5575
  ((b = (h = t == null ? void 0 : t.preferences) == null ? void 0 : h.mapVisualOptions) == null ? void 0 : b.customTopoJsonUrl) || ""
5574
- ), { setCardPreferences: i } = ie(), { data: o } = At(t), c = Object.keys((o == null ? void 0 : o.objects) || {}).map((p) => ({
5576
+ ), { setCardPreferences: r } = re(), { data: o } = At(t), c = Object.keys((o == null ? void 0 : o.objects) || {}).map((p) => ({
5575
5577
  label: p,
5576
5578
  value: p
5577
5579
  })) || [];
@@ -5598,7 +5600,7 @@ function Mi() {
5598
5600
  }
5599
5601
  ],
5600
5602
  onValueChange: (p) => {
5601
- console.log("value", p), i({
5603
+ console.log("value", p), r({
5602
5604
  ...t.preferences,
5603
5605
  mapVisualOptions: {
5604
5606
  topoJsonUrl: p
@@ -5618,7 +5620,7 @@ function Mi() {
5618
5620
  },
5619
5621
  onBlur: () => {
5620
5622
  var p;
5621
- console.log("onBlur", a), i({
5623
+ console.log("onBlur", a), r({
5622
5624
  ...t.preferences,
5623
5625
  mapVisualOptions: {
5624
5626
  ...(p = t.preferences) == null ? void 0 : p.mapVisualOptions,
@@ -5639,11 +5641,11 @@ function Mi() {
5639
5641
  {
5640
5642
  className: "h-9",
5641
5643
  options: c,
5642
- value: ((r = (v = t.preferences) == null ? void 0 : v.mapVisualOptions) == null ? void 0 : r.objectKey) || "",
5644
+ value: ((i = (N = t.preferences) == null ? void 0 : N.mapVisualOptions) == null ? void 0 : i.objectKey) || "",
5643
5645
  label: "Map Object",
5644
5646
  onValueChange: (p) => {
5645
5647
  var E;
5646
- i({
5648
+ r({
5647
5649
  ...t.preferences,
5648
5650
  mapVisualOptions: {
5649
5651
  ...(E = t.preferences) == null ? void 0 : E.mapVisualOptions,
@@ -5660,12 +5662,12 @@ function Mi() {
5660
5662
  Ne,
5661
5663
  {
5662
5664
  className: "h-9",
5663
- options: ki,
5665
+ options: kr,
5664
5666
  value: ((g = (y = t.preferences) == null ? void 0 : y.mapVisualOptions) == null ? void 0 : g.projection) || "",
5665
5667
  label: "Projection",
5666
5668
  onValueChange: (p) => {
5667
5669
  var E;
5668
- i({
5670
+ r({
5669
5671
  ...t.preferences,
5670
5672
  mapVisualOptions: {
5671
5673
  ...(E = t.preferences) == null ? void 0 : E.mapVisualOptions,
@@ -5682,12 +5684,12 @@ function Mi() {
5682
5684
  Ne,
5683
5685
  {
5684
5686
  className: "h-9",
5685
- options: Ii,
5687
+ options: Ir,
5686
5688
  value: ((x = (C = t.preferences) == null ? void 0 : C.mapVisualOptions) == null ? void 0 : x.colorScale) || "",
5687
5689
  label: "Select Color Scale",
5688
5690
  onValueChange: (p) => {
5689
5691
  var E;
5690
- i({
5692
+ r({
5691
5693
  ...t.preferences,
5692
5694
  mapVisualOptions: {
5693
5695
  ...(E = t.preferences) == null ? void 0 : E.mapVisualOptions,
@@ -5711,7 +5713,7 @@ function Mi() {
5711
5713
  value: ((S = (O = t.preferences) == null ? void 0 : O.mapVisualOptions) == null ? void 0 : S.projectionScale) || 1,
5712
5714
  onChange: (p) => {
5713
5715
  var E;
5714
- i({
5716
+ r({
5715
5717
  ...t.preferences,
5716
5718
  mapVisualOptions: {
5717
5719
  ...(E = t.preferences) == null ? void 0 : E.mapVisualOptions,
@@ -5728,10 +5730,10 @@ function Mi() {
5728
5730
  className: `h-9 w-full ${Ue}`,
5729
5731
  type: "number",
5730
5732
  step: 10,
5731
- value: ((F = (q = (M = t.preferences) == null ? void 0 : M.mapVisualOptions) == null ? void 0 : q.projectionOffset) == null ? void 0 : F[0]) || 0,
5733
+ value: ((F = (V = (M = t.preferences) == null ? void 0 : M.mapVisualOptions) == null ? void 0 : V.projectionOffset) == null ? void 0 : F[0]) || 0,
5732
5734
  onChange: (p) => {
5733
5735
  var E, W, A, U;
5734
- i({
5736
+ r({
5735
5737
  ...t.preferences,
5736
5738
  mapVisualOptions: {
5737
5739
  ...(E = t.preferences) == null ? void 0 : E.mapVisualOptions,
@@ -5754,7 +5756,7 @@ function Mi() {
5754
5756
  value: ((B = (_ = (G = t.preferences) == null ? void 0 : G.mapVisualOptions) == null ? void 0 : _.projectionOffset) == null ? void 0 : B[1]) || 0,
5755
5757
  onChange: (p) => {
5756
5758
  var E, W, A, U;
5757
- i({
5759
+ r({
5758
5760
  ...t.preferences,
5759
5761
  mapVisualOptions: {
5760
5762
  ...(E = t.preferences) == null ? void 0 : E.mapVisualOptions,
@@ -5772,15 +5774,15 @@ function Mi() {
5772
5774
  /* @__PURE__ */ e(Ee, {})
5773
5775
  ] });
5774
5776
  }
5775
- function Ti() {
5777
+ function Tr() {
5776
5778
  var l;
5777
- const t = m((i) => i.card.preferences), { setCardPreferences: s } = m((i) => i.actions);
5778
- function a(i) {
5779
+ const t = m((r) => r.card.preferences), { setCardPreferences: s } = m((r) => r.actions);
5780
+ function a(r) {
5779
5781
  s({
5780
5782
  ...t,
5781
5783
  textVisualOptions: {
5782
5784
  ...t == null ? void 0 : t.textVisualOptions,
5783
- isDynamicText: i === "dynamic"
5785
+ isDynamicText: r === "dynamic"
5784
5786
  }
5785
5787
  });
5786
5788
  }
@@ -5839,7 +5841,7 @@ function nt({
5839
5841
  /* @__PURE__ */ n(ne, { className: "space-y-4 px-2", children: [
5840
5842
  t === "range" && /* @__PURE__ */ e(gt, {}),
5841
5843
  t !== "text" && /* @__PURE__ */ e(Rt, {}),
5842
- t === "text" && /* @__PURE__ */ e(Ti, {})
5844
+ t === "text" && /* @__PURE__ */ e(Tr, {})
5843
5845
  ] })
5844
5846
  ] }),
5845
5847
  !["range", "text"].includes(t) && /* @__PURE__ */ n(te, { value: "item-3", children: [
@@ -5851,13 +5853,13 @@ function nt({
5851
5853
  ] })
5852
5854
  ] }) });
5853
5855
  }
5854
- function Di() {
5856
+ function Dr() {
5855
5857
  const t = m(
5856
5858
  (l) => {
5857
- var i, o;
5858
- return (o = (i = l == null ? void 0 : l.card) == null ? void 0 : i.preferences) == null ? void 0 : o.sortChart;
5859
+ var r, o;
5860
+ return (o = (r = l == null ? void 0 : l.card) == null ? void 0 : r.preferences) == null ? void 0 : o.sortChart;
5859
5861
  }
5860
- ), { setSortChart: s } = ie();
5862
+ ), { setSortChart: s } = re();
5861
5863
  function a() {
5862
5864
  return /* @__PURE__ */ n("div", { className: "space-y-2", children: [
5863
5865
  /* @__PURE__ */ e($, { children: "Sort" }),
@@ -5919,7 +5921,7 @@ function Di() {
5919
5921
  /* @__PURE__ */ n(ne, { className: "space-y-4 px-2", children: [
5920
5922
  /* @__PURE__ */ e(gt, {}),
5921
5923
  a(),
5922
- /* @__PURE__ */ e(hn, {})
5924
+ /* @__PURE__ */ e(mn, {})
5923
5925
  ] })
5924
5926
  ] }),
5925
5927
  /* @__PURE__ */ n(te, { value: "item-3", children: [
@@ -5931,15 +5933,15 @@ function Di() {
5931
5933
  ] })
5932
5934
  ] }) });
5933
5935
  }
5934
- function zi({
5936
+ function zr({
5935
5937
  cardType: t = "table"
5936
5938
  }) {
5937
5939
  console.log("cardType", t);
5938
- const s = m((i) => {
5940
+ const s = m((r) => {
5939
5941
  var o;
5940
- return (o = i.card) == null ? void 0 : o.preferences;
5942
+ return (o = r.card) == null ? void 0 : o.preferences;
5941
5943
  }), a = m(
5942
- (i) => i.actions.setCardPreferences
5944
+ (r) => r.actions.setCardPreferences
5943
5945
  );
5944
5946
  return /* @__PURE__ */ n("div", { className: "space-y-6 px-6 py-2", children: [
5945
5947
  /* @__PURE__ */ e(Fe, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ n(te, { value: "item-3", children: [
@@ -5950,10 +5952,10 @@ function zi({
5950
5952
  ] })
5951
5953
  ] }) }),
5952
5954
  /* @__PURE__ */ n("div", { className: "flex items-center space-x-2", children: [
5953
- /* @__PURE__ */ e(Et, { onCheckedChange: (i) => {
5955
+ /* @__PURE__ */ e(Et, { onCheckedChange: (r) => {
5954
5956
  a({
5955
5957
  ...s,
5956
- allowDownload: i
5958
+ allowDownload: r
5957
5959
  });
5958
5960
  }, id: "allow-download" }),
5959
5961
  /* @__PURE__ */ e(
@@ -5967,7 +5969,7 @@ function zi({
5967
5969
  ] })
5968
5970
  ] });
5969
5971
  }
5970
- const Li = /* @__PURE__ */ n("div", { className: "space-y-4 font-mono text-xs", children: [
5972
+ const Lr = /* @__PURE__ */ n("div", { className: "space-y-4 font-mono text-xs", children: [
5971
5973
  /* @__PURE__ */ e("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
5972
5974
  /* @__PURE__ */ n("div", { children: [
5973
5975
  "See ",
@@ -5983,7 +5985,7 @@ const Li = /* @__PURE__ */ n("div", { className: "space-y-4 font-mono text-xs",
5983
5985
  ),
5984
5986
  " in the docs."
5985
5987
  ] })
5986
- ] }), Fi = /* @__PURE__ */ n("div", { className: "space-y-4 font-mono text-xs", children: [
5988
+ ] }), Fr = /* @__PURE__ */ n("div", { className: "space-y-4 font-mono text-xs", children: [
5987
5989
  /* @__PURE__ */ e("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT y-axis, label, range-from, range-to, range-value FROM table" }),
5988
5990
  /* @__PURE__ */ n("div", { children: [
5989
5991
  "See ",
@@ -5999,7 +6001,7 @@ const Li = /* @__PURE__ */ n("div", { className: "space-y-4 font-mono text-xs",
5999
6001
  ),
6000
6002
  " in the docs."
6001
6003
  ] })
6002
- ] }), Ai = /* @__PURE__ */ n("div", { className: "space-y-4 font-mono text-xs", children: [
6004
+ ] }), Ar = /* @__PURE__ */ n("div", { className: "space-y-4 font-mono text-xs", children: [
6003
6005
  /* @__PURE__ */ e("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT text FROM table limit 1" }),
6004
6006
  /* @__PURE__ */ n("div", { children: [
6005
6007
  "See ",
@@ -6016,22 +6018,22 @@ const Li = /* @__PURE__ */ n("div", { className: "space-y-4 font-mono text-xs",
6016
6018
  " in the docs."
6017
6019
  ] })
6018
6020
  ] });
6019
- function Ei() {
6021
+ function Er() {
6020
6022
  const t = m((a) => a.card.type);
6021
6023
  function s(a) {
6022
6024
  switch (a) {
6023
6025
  case "stackedBar":
6024
6026
  case "stackedLine":
6025
- return /* @__PURE__ */ e(Di, {});
6027
+ return /* @__PURE__ */ e(Dr, {});
6026
6028
  case "pyramid":
6027
- return /* @__PURE__ */ e(nt, { docContent: Li, cardType: a });
6029
+ return /* @__PURE__ */ e(nt, { docContent: Lr, cardType: a });
6028
6030
  case "kpi":
6029
- return /* @__PURE__ */ e(wi, {});
6031
+ return /* @__PURE__ */ e(wr, {});
6030
6032
  case "line":
6031
6033
  case "bar":
6032
- return /* @__PURE__ */ e(yi, { cardType: a });
6034
+ return /* @__PURE__ */ e(yr, { cardType: a });
6033
6035
  case "range":
6034
- return /* @__PURE__ */ e(nt, { docContent: Fi, cardType: a });
6036
+ return /* @__PURE__ */ e(nt, { docContent: Fr, cardType: a });
6035
6037
  case "pie":
6036
6038
  case "doughnut":
6037
6039
  case "polarArea":
@@ -6039,24 +6041,24 @@ function Ei() {
6039
6041
  return /* @__PURE__ */ e(nt, { cardType: a });
6040
6042
  case "bubble":
6041
6043
  case "scatter":
6042
- return /* @__PURE__ */ e(bi, { cardType: a });
6044
+ return /* @__PURE__ */ e(br, { cardType: a });
6043
6045
  case "table":
6044
- return /* @__PURE__ */ e(zi, { cardType: a });
6046
+ return /* @__PURE__ */ e(zr, { cardType: a });
6045
6047
  case "text":
6046
6048
  return /* @__PURE__ */ e(
6047
6049
  nt,
6048
6050
  {
6049
- docContent: Ai,
6051
+ docContent: Ar,
6050
6052
  cardType: a,
6051
6053
  suffix: "Visual"
6052
6054
  }
6053
6055
  );
6054
6056
  case "map":
6055
- return /* @__PURE__ */ e(Mi, {});
6057
+ return /* @__PURE__ */ e(Mr, {});
6056
6058
  case "custom":
6057
- return /* @__PURE__ */ e(mi, {});
6059
+ return /* @__PURE__ */ e(mr, {});
6058
6060
  default:
6059
- return /* @__PURE__ */ e(Ni, {});
6061
+ return /* @__PURE__ */ e(Nr, {});
6060
6062
  }
6061
6063
  }
6062
6064
  return /* @__PURE__ */ n(Me, { className: "h-full w-full text-sm", children: [
@@ -6064,10 +6066,10 @@ function Ei() {
6064
6066
  /* @__PURE__ */ e(je, { orientation: "horizontal" })
6065
6067
  ] });
6066
6068
  }
6067
- function Vi() {
6069
+ function Vr() {
6068
6070
  const t = m((s) => s.isShowingVisual);
6069
6071
  return /* @__PURE__ */ n(
6070
- rt,
6072
+ it,
6071
6073
  {
6072
6074
  direction: "vertical",
6073
6075
  className: "min-h-[250px] min-w-full max-w-lg",
@@ -6090,7 +6092,7 @@ function Vi() {
6090
6092
  role: "visual-section",
6091
6093
  minSize: 0,
6092
6094
  defaultSize: 60,
6093
- children: t ? /* @__PURE__ */ n(rt, { direction: "horizontal", children: [
6095
+ children: t ? /* @__PURE__ */ n(it, { direction: "horizontal", children: [
6094
6096
  /* @__PURE__ */ e(le, { children: /* @__PURE__ */ e(
6095
6097
  we,
6096
6098
  {
@@ -6098,7 +6100,7 @@ function Vi() {
6098
6100
  minSize: 20,
6099
6101
  defaultSize: 25,
6100
6102
  maxSize: 30,
6101
- children: /* @__PURE__ */ e(Ei, {})
6103
+ children: /* @__PURE__ */ e(Er, {})
6102
6104
  }
6103
6105
  ) }),
6104
6106
  /* @__PURE__ */ e(ot, { className: "border" }),
@@ -6110,14 +6112,14 @@ function Vi() {
6110
6112
  }
6111
6113
  );
6112
6114
  }
6113
- function qi({ authToken: t, onSave: s, onClose: a }) {
6115
+ function qr({ authToken: t, onSave: s, onClose: a }) {
6114
6116
  D((c) => c.themeStyle);
6115
- const l = m((c) => c.actions.setOnSave), i = m((c) => c.actions.setOnClose), o = D((c) => c.actions.setAuthToken);
6117
+ const l = m((c) => c.actions.setOnSave), r = m((c) => c.actions.setOnClose), o = D((c) => c.actions.setAuthToken);
6116
6118
  return de(() => {
6117
- s && l(s), a && i(a);
6118
- }, [s, l, a, i]), de(() => {
6119
+ s && l(s), a && r(a);
6120
+ }, [s, l, a, r]), de(() => {
6119
6121
  t && t.accessToken && o(t);
6120
- }, [t, o]), /* @__PURE__ */ e(pt, { FallbackComponent: qa, children: /* @__PURE__ */ n(
6122
+ }, [t, o]), /* @__PURE__ */ e(pt, { FallbackComponent: ja, children: /* @__PURE__ */ n(
6121
6123
  As,
6122
6124
  {
6123
6125
  style: {
@@ -6127,16 +6129,16 @@ function qi({ authToken: t, onSave: s, onClose: a }) {
6127
6129
  className: "rounded-none",
6128
6130
  role: "editor-panel",
6129
6131
  children: [
6130
- /* @__PURE__ */ e(Es, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e(Ya, {}) }),
6131
- /* @__PURE__ */ e(Vs, { children: /* @__PURE__ */ e(Vi, {}) })
6132
+ /* @__PURE__ */ e(Es, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e(en, {}) }),
6133
+ /* @__PURE__ */ e(Vs, { children: /* @__PURE__ */ e(Vr, {}) })
6132
6134
  ]
6133
6135
  }
6134
6136
  ) });
6135
6137
  }
6136
- function ji() {
6138
+ function jr() {
6137
6139
  D((c) => c.selectedCardId);
6138
6140
  const t = D((c) => c.selectedSheetId), { setIsVisualEditing: s } = D((c) => c.actions), a = D((c) => c.isVisualEditing), l = D((c) => c.actions.updateFrame);
6139
- function i(c) {
6141
+ function r(c) {
6140
6142
  t && (l(t, c), s(!1));
6141
6143
  }
6142
6144
  function o() {
@@ -6149,12 +6151,12 @@ function ji() {
6149
6151
  className: ee("flex grow", {
6150
6152
  "max-h-0 overflow-hidden": !a
6151
6153
  }),
6152
- children: /* @__PURE__ */ e(qi, { onSave: i, onClose: o })
6154
+ children: /* @__PURE__ */ e(qr, { onSave: r, onClose: o })
6153
6155
  }
6154
6156
  );
6155
6157
  }
6156
- function Ri() {
6157
- const t = m((o) => o.selectedDatabaseName), s = m((o) => o.selectedTableName), a = D((o) => o.dashboard.filters) || [], { columns: l } = Ae(), { assignFilter: i } = pn();
6158
+ function Rr() {
6159
+ const t = m((o) => o.selectedDatabaseName), s = m((o) => o.selectedTableName), a = D((o) => o.dashboard.filters) || [], { columns: l } = Ae(), { assignFilter: r } = fn();
6158
6160
  return /* @__PURE__ */ e(Me, { className: "flex-1 basis-0 flex-col px-3", children: l == null ? void 0 : l.map((o) => {
6159
6161
  const c = a == null ? void 0 : a.find(
6160
6162
  (d) => d.column === ve(o.column_name) && d.table === s && d.database === t
@@ -6162,7 +6164,7 @@ function Ri() {
6162
6164
  return /* @__PURE__ */ e(
6163
6165
  "div",
6164
6166
  {
6165
- onClick: () => i(o),
6167
+ onClick: () => r(o),
6166
6168
  className: ee(
6167
6169
  "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",
6168
6170
  {
@@ -6170,7 +6172,7 @@ function Ri() {
6170
6172
  }
6171
6173
  ),
6172
6174
  children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
6173
- /* @__PURE__ */ e(Xa, { column: o }),
6175
+ /* @__PURE__ */ e(Ya, { column: o }),
6174
6176
  /* @__PURE__ */ e("span", { children: o.column_name })
6175
6177
  ] })
6176
6178
  },
@@ -6178,7 +6180,7 @@ function Ri() {
6178
6180
  );
6179
6181
  }) });
6180
6182
  }
6181
- function _i() {
6183
+ function _r() {
6182
6184
  D((s) => s.showFilters);
6183
6185
  const t = D(
6184
6186
  (s) => s.actions.setShowFilters
@@ -6197,12 +6199,12 @@ function _i() {
6197
6199
  )
6198
6200
  ] }),
6199
6201
  /* @__PURE__ */ e("div", { className: "flex grow", children: /* @__PURE__ */ e(
6200
- Ya,
6202
+ en,
6201
6203
  {
6202
6204
  ColumnsComponent: () => (
6203
6205
  // schemaName, tableName, columns
6204
6206
  /* @__PURE__ */ e(
6205
- Ri,
6207
+ Rr,
6206
6208
  {}
6207
6209
  )
6208
6210
  )
@@ -6210,7 +6212,7 @@ function _i() {
6210
6212
  ) })
6211
6213
  ] });
6212
6214
  }
6213
- function Hi() {
6215
+ function Hr() {
6214
6216
  const t = D((l) => l.dashboard.filters), s = D((l) => l.theme), a = t == null ? void 0 : t.filter((l) => l.hide);
6215
6217
  return a != null && a.length ? /* @__PURE__ */ e(
6216
6218
  "div",
@@ -6224,7 +6226,7 @@ function Hi() {
6224
6226
  {
6225
6227
  className: "flex min-w-[250px] max-w-fit flex-col gap-1 p-2",
6226
6228
  children: [
6227
- /* @__PURE__ */ e(Va, { filter: l }),
6229
+ /* @__PURE__ */ e(qa, { filter: l }),
6228
6230
  /* @__PURE__ */ e(za, { filter: l })
6229
6231
  ]
6230
6232
  },
@@ -6233,7 +6235,7 @@ function Hi() {
6233
6235
  }
6234
6236
  ) : null;
6235
6237
  }
6236
- function Pi() {
6238
+ function Pr() {
6237
6239
  const t = D((l) => l.showFilters), s = D((l) => l.isVisualEditing), a = D(
6238
6240
  (l) => l.isDashboardEditing
6239
6241
  );
@@ -6249,19 +6251,19 @@ function Pi() {
6249
6251
  }),
6250
6252
  children: [
6251
6253
  /* @__PURE__ */ n("section", { className: "flex grow flex-col", children: [
6252
- a && /* @__PURE__ */ e(Hi, {}),
6254
+ a && /* @__PURE__ */ e(Hr, {}),
6253
6255
  /* @__PURE__ */ e(qs, {})
6254
6256
  ] }),
6255
- t && /* @__PURE__ */ e("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e(_i, {}) })
6257
+ t && /* @__PURE__ */ e("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e(_r, {}) })
6256
6258
  ]
6257
6259
  }
6258
6260
  );
6259
6261
  }
6260
- function $i() {
6261
- const t = D((i) => i.dashboard), s = D((i) => i.actions.setDashboard), a = D(
6262
- (i) => i.showDashboardJSON
6262
+ function $r() {
6263
+ const t = D((r) => r.dashboard), s = D((r) => r.actions.setDashboard), a = D(
6264
+ (r) => r.showDashboardJSON
6263
6265
  ), l = D(
6264
- (i) => i.actions.setShowDashboardJSON
6266
+ (r) => r.actions.setShowDashboardJSON
6265
6267
  );
6266
6268
  return /* @__PURE__ */ n(
6267
6269
  "div",
@@ -6286,10 +6288,10 @@ function $i() {
6286
6288
  /* @__PURE__ */ e(
6287
6289
  js,
6288
6290
  {
6289
- onChange: (i) => {
6290
- if (i)
6291
+ onChange: (r) => {
6292
+ if (r)
6291
6293
  try {
6292
- JSON.parse(i), s(JSON.parse(i));
6294
+ JSON.parse(r), s(JSON.parse(r));
6293
6295
  } catch {
6294
6296
  }
6295
6297
  },
@@ -6316,54 +6318,54 @@ function $i() {
6316
6318
  }
6317
6319
  );
6318
6320
  }
6319
- function Wi({
6321
+ function Wr({
6320
6322
  showControls: t = !1,
6321
6323
  showFooter: s = !0,
6322
6324
  ...a
6323
6325
  }) {
6324
- return /* @__PURE__ */ e(pt, { FallbackComponent: qa, children: /* @__PURE__ */ n(Rs, { dashboardProps: a, children: [
6326
+ return /* @__PURE__ */ e(pt, { FallbackComponent: ja, children: /* @__PURE__ */ n(Rs, { dashboardProps: a, children: [
6325
6327
  /* @__PURE__ */ e(_s, {}),
6326
6328
  /* @__PURE__ */ n(Hs, { children: [
6327
- /* @__PURE__ */ e($i, {}),
6329
+ /* @__PURE__ */ e($r, {}),
6328
6330
  /* @__PURE__ */ n(Ps, { ...a, children: [
6329
6331
  t && /* @__PURE__ */ e(zl, {}),
6330
- /* @__PURE__ */ e(ji, {}),
6331
- /* @__PURE__ */ e(Pi, {})
6332
+ /* @__PURE__ */ e(jr, {}),
6333
+ /* @__PURE__ */ e(Pr, {})
6332
6334
  ] })
6333
6335
  ] })
6334
6336
  ] }) });
6335
6337
  }
6336
6338
  export {
6337
- Zi as Dashboard,
6338
- Xi as DashboardWC,
6339
+ Zr as Dashboard,
6340
+ Xr as DashboardWC,
6339
6341
  Be as SelectComponent,
6340
- Yi as SemaphorDataProvider,
6341
- er as SemaphorQueryClient,
6342
- Wi as Surfboard,
6342
+ Yr as SemaphorDataProvider,
6343
+ ei as SemaphorQueryClient,
6344
+ Wr as Surfboard,
6343
6345
  Sl as cleanCard,
6344
6346
  wa as createSqlGenConfig,
6345
6347
  Tl as downloadPdf,
6346
6348
  ve as fmt,
6347
- tr as getColumnDataType,
6348
- Za as getDashbaordStateWithoutData,
6349
- ar as getFilterValueType,
6349
+ ti as getColumnDataType,
6350
+ Xa as getDashbaordStateWithoutData,
6351
+ ai as getFilterValueType,
6350
6352
  Nt as getFormattedTableNameForQuery,
6351
6353
  Ds as getQualifiedTableName,
6352
6354
  ka as getSql,
6353
- Cn as invalidateToken,
6354
- Tn as isBooleanDataType,
6355
- Dn as isColumnInSqlGen,
6356
- In as isDateDataType,
6355
+ Sn as invalidateToken,
6356
+ Dn as isBooleanDataType,
6357
+ zn as isColumnInSqlGen,
6358
+ Mn as isDateDataType,
6357
6359
  Oa as isNumberDataType,
6358
- On as isTextDataType,
6359
- nr as resolveDataType,
6360
- it as resolveDatamodelName,
6361
- sr as useCard,
6360
+ In as isTextDataType,
6361
+ ni as resolveDataType,
6362
+ rt as resolveDatamodelName,
6363
+ si as useCard,
6362
6364
  Xe as useDashboardActions,
6363
6365
  D as useDashboardStore,
6364
- lr as useDateFilterHook,
6365
- ie as useEditorActions,
6366
+ li as useDateFilterHook,
6367
+ re as useEditorActions,
6366
6368
  Ae as useEditorAside,
6367
6369
  m as useEditorStore,
6368
- ir as useTextFilterHook
6370
+ ri as useTextFilterHook
6369
6371
  };