react-semaphor 0.0.332 → 0.0.334

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import { X as q, ao as Os, ap as z, aq as Is, ar as Oe, as as e, at as Fs, au as Ds, av as O, ae as Ls, aw as Ms, ax as Ts, ay as Es, az as As, aA as _, aB as re, aC as la, aD as ra, aE as ia, aF as oa, aG as st, aH as at, aI as tt, aJ as Ks, aK as K, aL as Je, a5 as nt, aM as m, aN as lt, ac as ca, a6 as da, aO as Ke, aP as We, aQ as ua, aR as rt, aS as ma, aT as me, aU as he, aV as xe, aW as pe, aX as Se, aY as fe, aZ as Y, aj as Vs, a_ as qs, a$ as Rs, b0 as _s, b1 as ha, b2 as xa, b3 as de, b4 as it, b5 as ot, b6 as pa, b7 as ct, Z as dt, b8 as ut, b9 as fa, Y as mt, ba as ze, bb as ht, bc as Ye, bd as ga, be as Ns, bf as Ce, bg as De, bh as we, bi as ja, bj as xt, bk as pt, bl as ft, bm as gt, a9 as jt, bn as bt, bo as yt, bp as vt, bq as Re, br as Ss, bs as Ct, _ as Nt, bt as Ge, bu as cs, bv as Ne, bw as ds, bx as St, by as wt, bz as kt, bA as zt, bB as Ot, bC as Cs, bD as It, bE as Ws, bF as Ft, bG as Ys, bH as Dt, bI as Lt, bJ as Mt, bK as Tt, bL as ba, bM as ie, bN as Et, bO as Hs, bP as ya, bQ as At, bR as Vt, bS as rs, bT as qt, bU as Rt, bV as _t, bW as Ht, ak as $t, bX as Pt, bY as Bt, ai as Ut, bZ as xs, b_ as va, b$ as Ca, c0 as Na, c1 as is, c2 as Sa, c3 as os, c4 as Xs, c5 as Gt, c6 as Qt, c7 as ps, c8 as fs, c9 as gs, ca as Jt, am as wa, cb as Kt, cc as Wt, cd as Yt, ce as js, cf as Le, a3 as Xt, cg as Ue, ch as $s, ci as ka, cj as Zt, ck as en, cl as us, cm as sn, cn as an, co as tn, cp as Zs, cq as nn, cr as ln, cs as rn, ct as on, cu as cn, cv as dn, cw as un, cx as mn, cy as Me, cz as G, cA as Q, cB as Ps, cC as J, cD as hn, cE as za, cF as xn, cG as pn, cH as fn, cI as gn, cJ as jn, cK as bn, cL as yn, cM as vn, cN as Cn } from "./index-HSAFthpc.js";
1
+ import { c as R, t as Is, u as I, v as xs, w as Oe, x as e, y as Ds, z as Fs, A as z, n as Ts, E as Ls, H as Ms, J as Es, K as As, M as _, N as re, O as la, Q as ra, R as ia, V as oa, W as st, Y as at, Z as tt, _ as Ks, $ as K, a0 as Je, i as nt, a1 as m, a2 as lt, P as ca, F as da, a3 as Ke, a4 as We, a5 as ua, a6 as rt, a7 as ma, a8 as me, a9 as he, aa as xe, ab as pe, ac as Se, ad as fe, ae as Y, T as Vs, af as qs, ag as Rs, ah as _s, ai as ha, aj as xa, ak as de, al as it, am as ot, an as pa, ao as ct, C as dt, ap as ut, aq as fa, B as mt, ar as ze, as as ht, at as Ye, au as ga, av as Ss, aw as Ce, ax as Fe, ay as we, az as ja, aA as xt, aB as pt, aC as ft, aD as gt, k as jt, aE as bt, aF as yt, aG as vt, aH as Re, aI as ws, aJ as Ct, a as Nt, aK as Ge, aL as cs, aM as Ne, aN as ds, aO as St, aP as wt, aQ as kt, aR as zt, aS as Ot, aT as Ns, aU as It, aV as Ws, aW as Dt, aX as Ys, aY as Ft, aZ as Tt, a_ as Lt, a$ as Mt, b0 as ba, b1 as ie, b2 as Et, b3 as Hs, b4 as ya, b5 as At, b6 as Vt, b7 as rs, b8 as qt, b9 as Rt, ba as _t, bb as Ht, r as $t, bc as Pt, bd as Bt, q as Ut, be as ps, bf as va, bg as Ca, bh as Na, bi as is, bj as Sa, bk as os, bl as Xs, bm as Gt, bn as Qt, bo as fs, bp as gs, bq as js, br as Jt, I as Kt, X as wa, bs as Wt, bt as Yt, bu as Xt, bv as bs, bw as Te, f as Zt, bx as Ue, by as $s, bz as ka, bA as en, bB as sn, bC as us, bD as an, bE as tn, bF as nn, bG as Zs, bH as ln, bI as rn, bJ as on, bK as cn, bL as dn, bM as un, bN as mn, bO as hn, bP as Le, bQ as G, bR as Q, bS as Ps, bT as J, bU as xn, bV as za, bW as pn, bX as fn, bY as gn, bZ as jn, b_ as bn, b$ as yn, c0 as vn, c1 as Cn, c2 as Nn } from "./index-BbJlIYmF.js";
2
2
  import * as ea from "react";
3
- import ke, { useState as V, useMemo as ws, useEffect as se, useRef as ks, useCallback as Nn, Suspense as Sn } from "react";
3
+ import ke, { useState as V, useMemo as ks, useEffect as se, useRef as zs, useCallback as Sn, Suspense as wn } from "react";
4
4
  import "react-dom";
5
5
  /**
6
6
  * @license lucide-react v0.453.0 - ISC
@@ -8,7 +8,7 @@ import "react-dom";
8
8
  * This source code is licensed under the ISC license.
9
9
  * See the LICENSE file in the root directory of this source tree.
10
10
  */
11
- const wn = q("Box", [
11
+ const kn = R("Box", [
12
12
  [
13
13
  "path",
14
14
  {
@@ -25,7 +25,7 @@ const wn = q("Box", [
25
25
  * This source code is licensed under the ISC license.
26
26
  * See the LICENSE file in the root directory of this source tree.
27
27
  */
28
- const kn = q("ChartArea", [
28
+ const zn = R("ChartArea", [
29
29
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
30
30
  [
31
31
  "path",
@@ -41,7 +41,7 @@ const kn = q("ChartArea", [
41
41
  * This source code is licensed under the ISC license.
42
42
  * See the LICENSE file in the root directory of this source tree.
43
43
  */
44
- const Bs = q("ChartColumnIncreasing", [
44
+ const Bs = R("ChartColumnIncreasing", [
45
45
  ["path", { d: "M13 17V9", key: "1fwyjl" }],
46
46
  ["path", { d: "M18 17V5", key: "sfb6ij" }],
47
47
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
@@ -53,7 +53,7 @@ const Bs = q("ChartColumnIncreasing", [
53
53
  * This source code is licensed under the ISC license.
54
54
  * See the LICENSE file in the root directory of this source tree.
55
55
  */
56
- const Us = q("ChartLine", [
56
+ const Us = R("ChartLine", [
57
57
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
58
58
  ["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
59
59
  ]);
@@ -63,7 +63,7 @@ const Us = q("ChartLine", [
63
63
  * This source code is licensed under the ISC license.
64
64
  * See the LICENSE file in the root directory of this source tree.
65
65
  */
66
- const Oa = q("ChartNoAxesGantt", [
66
+ const Oa = R("ChartNoAxesGantt", [
67
67
  ["path", { d: "M8 6h10", key: "9lnwnk" }],
68
68
  ["path", { d: "M6 12h9", key: "1g9pqf" }],
69
69
  ["path", { d: "M11 18h7", key: "c8dzvl" }]
@@ -74,7 +74,7 @@ const Oa = q("ChartNoAxesGantt", [
74
74
  * This source code is licensed under the ISC license.
75
75
  * See the LICENSE file in the root directory of this source tree.
76
76
  */
77
- const Ia = q("ChartPie", [
77
+ const Ia = R("ChartPie", [
78
78
  [
79
79
  "path",
80
80
  {
@@ -90,7 +90,7 @@ const Ia = q("ChartPie", [
90
90
  * This source code is licensed under the ISC license.
91
91
  * See the LICENSE file in the root directory of this source tree.
92
92
  */
93
- const Fa = q("ChartScatter", [
93
+ const Da = R("ChartScatter", [
94
94
  ["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
95
95
  ["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
96
96
  ["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
@@ -104,7 +104,7 @@ const Fa = q("ChartScatter", [
104
104
  * This source code is licensed under the ISC license.
105
105
  * See the LICENSE file in the root directory of this source tree.
106
106
  */
107
- const zn = q("CircleX", [
107
+ const On = R("CircleX", [
108
108
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
109
109
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
110
110
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
@@ -115,7 +115,7 @@ const zn = q("CircleX", [
115
115
  * This source code is licensed under the ISC license.
116
116
  * See the LICENSE file in the root directory of this source tree.
117
117
  */
118
- const On = q("CopyPlus", [
118
+ const In = R("CopyPlus", [
119
119
  ["line", { x1: "15", x2: "15", y1: "12", y2: "18", key: "1p7wdc" }],
120
120
  ["line", { x1: "12", x2: "18", y1: "15", y2: "15", key: "1nscbv" }],
121
121
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
@@ -127,7 +127,7 @@ const On = q("CopyPlus", [
127
127
  * This source code is licensed under the ISC license.
128
128
  * See the LICENSE file in the root directory of this source tree.
129
129
  */
130
- const In = q("Database", [
130
+ const Dn = R("Database", [
131
131
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
132
132
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
133
133
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
@@ -138,7 +138,7 @@ const In = q("Database", [
138
138
  * This source code is licensed under the ISC license.
139
139
  * See the LICENSE file in the root directory of this source tree.
140
140
  */
141
- const Da = q("EllipsisVertical", [
141
+ const Fa = R("EllipsisVertical", [
142
142
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
143
143
  ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
144
144
  ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
@@ -149,7 +149,7 @@ const Da = q("EllipsisVertical", [
149
149
  * This source code is licensed under the ISC license.
150
150
  * See the LICENSE file in the root directory of this source tree.
151
151
  */
152
- const Fn = q("Eraser", [
152
+ const Fn = R("Eraser", [
153
153
  [
154
154
  "path",
155
155
  {
@@ -166,7 +166,7 @@ const Fn = q("Eraser", [
166
166
  * This source code is licensed under the ISC license.
167
167
  * See the LICENSE file in the root directory of this source tree.
168
168
  */
169
- const Dn = q("EyeClosed", [
169
+ const Tn = R("EyeClosed", [
170
170
  ["path", { d: "m15 18-.722-3.25", key: "1j64jw" }],
171
171
  ["path", { d: "M2 8a10.645 10.645 0 0 0 20 0", key: "1e7gxb" }],
172
172
  ["path", { d: "m20 15-1.726-2.05", key: "1cnuld" }],
@@ -179,7 +179,7 @@ const Dn = q("EyeClosed", [
179
179
  * This source code is licensed under the ISC license.
180
180
  * See the LICENSE file in the root directory of this source tree.
181
181
  */
182
- const Ln = q("Eye", [
182
+ const Ln = R("Eye", [
183
183
  [
184
184
  "path",
185
185
  {
@@ -195,7 +195,7 @@ const Ln = q("Eye", [
195
195
  * This source code is licensed under the ISC license.
196
196
  * See the LICENSE file in the root directory of this source tree.
197
197
  */
198
- const Mn = q("Glasses", [
198
+ const Mn = R("Glasses", [
199
199
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
200
200
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
201
201
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -208,7 +208,7 @@ const Mn = q("Glasses", [
208
208
  * This source code is licensed under the ISC license.
209
209
  * See the LICENSE file in the root directory of this source tree.
210
210
  */
211
- const Tn = q("Hammer", [
211
+ const En = R("Hammer", [
212
212
  ["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
213
213
  ["path", { d: "m18 15 4-4", key: "16gjal" }],
214
214
  [
@@ -225,7 +225,7 @@ const Tn = q("Hammer", [
225
225
  * This source code is licensed under the ISC license.
226
226
  * See the LICENSE file in the root directory of this source tree.
227
227
  */
228
- const En = q("Hash", [
228
+ const An = R("Hash", [
229
229
  ["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
230
230
  ["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
231
231
  ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
@@ -237,7 +237,7 @@ const En = q("Hash", [
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 An = q("House", [
240
+ const Vn = R("House", [
241
241
  ["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
242
242
  [
243
243
  "path",
@@ -253,20 +253,7 @@ const An = q("House", [
253
253
  * This source code is licensed under the ISC license.
254
254
  * See the LICENSE file in the root directory of this source tree.
255
255
  */
256
- const Vn = q("IdCard", [
257
- ["path", { d: "M16 10h2", key: "8sgtl7" }],
258
- ["path", { d: "M16 14h2", key: "epxaof" }],
259
- ["path", { d: "M6.17 15a3 3 0 0 1 5.66 0", key: "n6f512" }],
260
- ["circle", { cx: "9", cy: "11", r: "2", key: "yxgjnd" }],
261
- ["rect", { x: "2", y: "5", width: "20", height: "14", rx: "2", key: "qneu4z" }]
262
- ]);
263
- /**
264
- * @license lucide-react v0.453.0 - ISC
265
- *
266
- * This source code is licensed under the ISC license.
267
- * See the LICENSE file in the root directory of this source tree.
268
- */
269
- const qn = q("ListEnd", [
256
+ const qn = R("ListEnd", [
270
257
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
271
258
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
272
259
  ["path", { d: "M10 18H3", key: "13769t" }],
@@ -279,7 +266,7 @@ const qn = q("ListEnd", [
279
266
  * This source code is licensed under the ISC license.
280
267
  * See the LICENSE file in the root directory of this source tree.
281
268
  */
282
- const Rn = q("ListStart", [
269
+ const Rn = R("ListStart", [
283
270
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
284
271
  ["path", { d: "M16 18H3", key: "12xzn7" }],
285
272
  ["path", { d: "M10 6H3", key: "lf8lx7" }],
@@ -292,7 +279,7 @@ const Rn = q("ListStart", [
292
279
  * This source code is licensed under the ISC license.
293
280
  * See the LICENSE file in the root directory of this source tree.
294
281
  */
295
- const _n = q("ListX", [
282
+ const _n = R("ListX", [
296
283
  ["path", { d: "M11 12H3", key: "51ecnj" }],
297
284
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
298
285
  ["path", { d: "M16 18H3", key: "12xzn7" }],
@@ -305,7 +292,7 @@ const _n = q("ListX", [
305
292
  * This source code is licensed under the ISC license.
306
293
  * See the LICENSE file in the root directory of this source tree.
307
294
  */
308
- const qe = q("LoaderCircle", [
295
+ const qe = R("LoaderCircle", [
309
296
  ["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
310
297
  ]);
311
298
  /**
@@ -314,7 +301,7 @@ const qe = q("LoaderCircle", [
314
301
  * This source code is licensed under the ISC license.
315
302
  * See the LICENSE file in the root directory of this source tree.
316
303
  */
317
- const La = q("Map", [
304
+ const Ta = R("Map", [
318
305
  [
319
306
  "path",
320
307
  {
@@ -331,7 +318,7 @@ const La = q("Map", [
331
318
  * This source code is licensed under the ISC license.
332
319
  * See the LICENSE file in the root directory of this source tree.
333
320
  */
334
- const Hn = q("MessageSquareMore", [
321
+ const Hn = R("MessageSquareMore", [
335
322
  ["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" }],
336
323
  ["path", { d: "M8 10h.01", key: "19clt8" }],
337
324
  ["path", { d: "M12 10h.01", key: "1nrarc" }],
@@ -343,7 +330,7 @@ const Hn = q("MessageSquareMore", [
343
330
  * This source code is licensed under the ISC license.
344
331
  * See the LICENSE file in the root directory of this source tree.
345
332
  */
346
- const $n = q("Network", [
333
+ const $n = R("Network", [
347
334
  ["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
348
335
  ["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
349
336
  ["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
@@ -356,7 +343,7 @@ const $n = q("Network", [
356
343
  * This source code is licensed under the ISC license.
357
344
  * See the LICENSE file in the root directory of this source tree.
358
345
  */
359
- const Pn = q("Play", [
346
+ const Pn = R("Play", [
360
347
  ["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
361
348
  ]);
362
349
  /**
@@ -365,7 +352,7 @@ const Pn = q("Play", [
365
352
  * This source code is licensed under the ISC license.
366
353
  * See the LICENSE file in the root directory of this source tree.
367
354
  */
368
- const Bn = q("Plug2", [
355
+ const Bn = R("Plug2", [
369
356
  ["path", { d: "M9 2v6", key: "17ngun" }],
370
357
  ["path", { d: "M15 2v6", key: "s7yy2p" }],
371
358
  ["path", { d: "M12 17v5", key: "bb1du9" }],
@@ -378,7 +365,7 @@ const Bn = q("Plug2", [
378
365
  * This source code is licensed under the ISC license.
379
366
  * See the LICENSE file in the root directory of this source tree.
380
367
  */
381
- const Un = q("Save", [
368
+ const Un = R("Save", [
382
369
  [
383
370
  "path",
384
371
  {
@@ -395,7 +382,7 @@ const Un = q("Save", [
395
382
  * This source code is licensed under the ISC license.
396
383
  * See the LICENSE file in the root directory of this source tree.
397
384
  */
398
- const Ma = q("Shapes", [
385
+ const La = R("Shapes", [
399
386
  [
400
387
  "path",
401
388
  {
@@ -412,7 +399,7 @@ const Ma = q("Shapes", [
412
399
  * This source code is licensed under the ISC license.
413
400
  * See the LICENSE file in the root directory of this source tree.
414
401
  */
415
- const Gn = q("ShieldQuestion", [
402
+ const Gn = R("ShieldQuestion", [
416
403
  [
417
404
  "path",
418
405
  {
@@ -429,7 +416,7 @@ const Gn = q("ShieldQuestion", [
429
416
  * This source code is licensed under the ISC license.
430
417
  * See the LICENSE file in the root directory of this source tree.
431
418
  */
432
- const Qn = q("Sigma", [
419
+ const Qn = R("Sigma", [
433
420
  [
434
421
  "path",
435
422
  {
@@ -444,7 +431,7 @@ const Qn = q("Sigma", [
444
431
  * This source code is licensed under the ISC license.
445
432
  * See the LICENSE file in the root directory of this source tree.
446
433
  */
447
- const Jn = q("SwatchBook", [
434
+ const Jn = R("SwatchBook", [
448
435
  ["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
449
436
  ["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
450
437
  ["path", { d: "M 7 17h.01", key: "1euzgo" }],
@@ -462,7 +449,7 @@ const Jn = q("SwatchBook", [
462
449
  * This source code is licensed under the ISC license.
463
450
  * See the LICENSE file in the root directory of this source tree.
464
451
  */
465
- const Kn = q("Tag", [
452
+ const Kn = R("Tag", [
466
453
  [
467
454
  "path",
468
455
  {
@@ -478,7 +465,7 @@ const Kn = q("Tag", [
478
465
  * This source code is licensed under the ISC license.
479
466
  * See the LICENSE file in the root directory of this source tree.
480
467
  */
481
- const Wn = q("ToggleLeft", [
468
+ const Wn = R("ToggleLeft", [
482
469
  ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
483
470
  ["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
484
471
  ]);
@@ -488,7 +475,7 @@ const Wn = q("ToggleLeft", [
488
475
  * This source code is licensed under the ISC license.
489
476
  * See the LICENSE file in the root directory of this source tree.
490
477
  */
491
- const Gs = q("Type", [
478
+ const Gs = R("Type", [
492
479
  ["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
493
480
  ["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
494
481
  ["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
@@ -499,11 +486,11 @@ const Gs = q("Type", [
499
486
  * This source code is licensed under the ISC license.
500
487
  * See the LICENSE file in the root directory of this source tree.
501
488
  */
502
- const Yn = q("User", [
489
+ const Yn = R("User", [
503
490
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
504
491
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
505
492
  ]);
506
- function Ta(s) {
493
+ function Ma(s) {
507
494
  var t;
508
495
  return {
509
496
  ...s,
@@ -512,10 +499,10 @@ function Ta(s) {
512
499
  return {
513
500
  ...a,
514
501
  frames: (n = a.frames) == null ? void 0 : n.map((l) => {
515
- var d;
502
+ var r;
516
503
  return {
517
504
  ...l,
518
- cards: (d = l.cards) == null ? void 0 : d.map((i) => Xn(i))
505
+ cards: (r = l.cards) == null ? void 0 : r.map((u) => Xn(u))
519
506
  };
520
507
  })
521
508
  };
@@ -531,8 +518,8 @@ function Xn(s) {
531
518
  data: {
532
519
  ...(t = s.cfg) == null ? void 0 : t.data,
533
520
  labels: [],
534
- datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((d) => ({
535
- ...d,
521
+ datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((r) => ({
522
+ ...r,
536
523
  data: []
537
524
  }))
538
525
  }
@@ -560,61 +547,61 @@ async function el(s, t, a, n) {
560
547
  if (!n)
561
548
  return null;
562
549
  const l = JSON.stringify(t);
563
- return await Os("https://semaphor.cloud/api/v1/lens", n, {
550
+ return await Is("https://semaphor.cloud/api/v1/lens", n, {
564
551
  name: s,
565
552
  template: l,
566
553
  filterValues: a,
567
554
  operation: "create"
568
555
  });
569
556
  }
570
- async function zs(s, t) {
557
+ async function Os(s, t) {
571
558
  if (!t)
572
559
  return null;
573
- const { id: a, template: n, filterValues: l, isDefault: d, shared: i } = s;
574
- return await Os("https://semaphor.cloud/api/v1/lens", t, {
560
+ const { id: a, template: n, filterValues: l, isDefault: r, shared: u } = s;
561
+ return await Is("https://semaphor.cloud/api/v1/lens", t, {
575
562
  lensId: a,
576
563
  template: n,
577
564
  filterValues: l,
578
- isDefault: d,
579
- shared: i,
565
+ isDefault: r,
566
+ shared: u,
580
567
  operation: "update"
581
568
  });
582
569
  }
583
570
  async function sl(s, t) {
584
- return t ? await Os("https://semaphor.cloud/api/v1/lens", t, {
571
+ return t ? await Is("https://semaphor.cloud/api/v1/lens", t, {
585
572
  operation: "delete",
586
573
  lensId: s
587
574
  }) : null;
588
575
  }
589
576
  function al() {
590
- const [s, t] = V(""), [a, n] = V(!1), l = z((C) => C.lenses), { setLenses: d, setSelectedLensId: i } = Is(), [o, c] = V(!1), [p, u] = V(!1), b = z((C) => C.dashboard), g = z((C) => C.filterValues), { authToken: h } = Oe();
591
- async function j() {
577
+ const [s, t] = V(""), [a, n] = V(!1), l = I((C) => C.lenses), { setLenses: r, setSelectedLensId: u } = xs(), [o, c] = V(!1), [p, d] = V(!1), b = I((C) => C.dashboard), j = I((C) => C.filterValues), { authToken: h } = Oe();
578
+ async function g() {
592
579
  c(!0);
593
- const C = Ta(
580
+ const C = Ma(
594
581
  b
595
- ), I = await el(
582
+ ), O = await el(
596
583
  s,
597
584
  C,
598
- g,
585
+ j,
599
586
  h == null ? void 0 : h.accessToken
600
587
  );
601
- I && (d([...l || [], I]), i(I.id), u(!1)), c(!1);
588
+ O && (r([...l || [], O]), u(O.id), d(!1)), c(!1);
602
589
  }
603
- return /* @__PURE__ */ e.jsxs(Fs, { open: p, onOpenChange: u, children: [
604
- /* @__PURE__ */ e.jsx(Ds, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
605
- O,
590
+ return /* @__PURE__ */ e.jsxs(Ds, { open: p, onOpenChange: d, children: [
591
+ /* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
592
+ z,
606
593
  {
607
594
  variant: "secondary",
608
595
  className: "h-7 p-2",
609
596
  size: "sm",
610
597
  children: [
611
- /* @__PURE__ */ e.jsx(Ls, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
598
+ /* @__PURE__ */ e.jsx(Ts, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
612
599
  "Lens"
613
600
  ]
614
601
  }
615
602
  ) }),
616
- /* @__PURE__ */ e.jsxs(Ms, { className: "sm:max-w-[425px]", children: [
617
- /* @__PURE__ */ e.jsxs(Ts, { children: [
603
+ /* @__PURE__ */ e.jsxs(Ls, { className: "sm:max-w-[425px]", children: [
604
+ /* @__PURE__ */ e.jsxs(Ms, { children: [
618
605
  /* @__PURE__ */ e.jsx(Es, { children: "Create Lens" }),
619
606
  /* @__PURE__ */ e.jsx(As, { children: "Lenses are private by default and are only visible to you." })
620
607
  ] }),
@@ -634,12 +621,12 @@ function al() {
634
621
  ] }) }),
635
622
  a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
636
623
  /* @__PURE__ */ e.jsx(la, { children: /* @__PURE__ */ e.jsx(
637
- O,
624
+ z,
638
625
  {
639
626
  size: "sm",
640
627
  variant: "outline",
641
628
  type: "submit",
642
- onClick: j,
629
+ onClick: g,
643
630
  disabled: o,
644
631
  children: o ? "Creating..." : "Add"
645
632
  }
@@ -648,41 +635,41 @@ function al() {
648
635
  ] });
649
636
  }
650
637
  function tl() {
651
- const [s, t] = V(!1), a = z((u) => u.lenses), n = z((u) => u.selectedLensId), { setLenses: l, setSelectedLensId: d } = Is(), { authToken: i } = Oe();
652
- async function o(u) {
653
- d(u);
638
+ const [s, t] = V(!1), a = I((d) => d.lenses), n = I((d) => d.selectedLensId), { setLenses: l, setSelectedLensId: r } = xs(), { authToken: u } = Oe();
639
+ async function o(d) {
640
+ r(d);
654
641
  }
655
- async function c(u) {
656
- if (await sl(u, i == null ? void 0 : i.accessToken)) {
657
- const g = a == null ? void 0 : a.filter((h) => h.id !== u);
658
- l(g || []), d("original");
642
+ async function c(d) {
643
+ if (await sl(d, u == null ? void 0 : u.accessToken)) {
644
+ const j = a == null ? void 0 : a.filter((h) => h.id !== d);
645
+ l(j || []), r("original");
659
646
  }
660
647
  }
661
- async function p(u) {
662
- const b = a == null ? void 0 : a.map((j) => j.id === u.id ? {
663
- ...j,
664
- isDefault: !u.isDefault
648
+ async function p(d) {
649
+ const b = a == null ? void 0 : a.map((g) => g.id === d.id ? {
650
+ ...g,
651
+ isDefault: !d.isDefault
665
652
  } : {
666
- ...j,
653
+ ...g,
667
654
  isDefault: !1
668
655
  });
669
656
  l(b || []);
670
- const g = {
671
- ...u,
672
- isDefault: !u.isDefault
657
+ const j = {
658
+ ...d,
659
+ isDefault: !d.isDefault
673
660
  };
674
- await zs(g, i == null ? void 0 : i.accessToken);
675
- const h = a == null ? void 0 : a.find((j) => j.isDefault);
676
- if (h && h.id !== u.id) {
677
- const j = {
661
+ await Os(j, u == null ? void 0 : u.accessToken);
662
+ const h = a == null ? void 0 : a.find((g) => g.isDefault);
663
+ if (h && h.id !== d.id) {
664
+ const g = {
678
665
  ...h,
679
666
  isDefault: !1
680
667
  };
681
- await zs(j, i == null ? void 0 : i.accessToken);
668
+ await Os(g, u == null ? void 0 : u.accessToken);
682
669
  }
683
670
  }
684
671
  return /* @__PURE__ */ e.jsxs(ra, { open: s, onOpenChange: t, children: [
685
- /* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Mn, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
672
+ /* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Mn, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
686
673
  /* @__PURE__ */ e.jsxs(oa, { align: "end", className: "w-60", children: [
687
674
  /* @__PURE__ */ e.jsx(st, { className: "px-3", children: "Lenses" }),
688
675
  /* @__PURE__ */ e.jsx(at, {}),
@@ -693,25 +680,25 @@ function tl() {
693
680
  onValueChange: o,
694
681
  children: [
695
682
  /* @__PURE__ */ e.jsx(Ks, { value: "original", children: "Original" }),
696
- a == null ? void 0 : a.map((u) => /* @__PURE__ */ e.jsxs(
683
+ a == null ? void 0 : a.map((d) => /* @__PURE__ */ e.jsxs(
697
684
  Ks,
698
685
  {
699
686
  className: "group flex justify-between gap-2",
700
- value: u.id,
687
+ value: d.id,
701
688
  children: [
702
- /* @__PURE__ */ e.jsx("p", { children: u.name }),
689
+ /* @__PURE__ */ e.jsx("p", { children: d.name }),
703
690
  /* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-3", children: [
704
691
  /* @__PURE__ */ e.jsx(
705
- An,
692
+ Vn,
706
693
  {
707
694
  onClick: (b) => {
708
- b.preventDefault(), p(u);
695
+ b.preventDefault(), p(d);
709
696
  },
710
697
  className: K(
711
698
  "size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
712
699
  {
713
- invisible: !u.isDefault,
714
- "text-green-500": u.isDefault
700
+ invisible: !d.isDefault,
701
+ "text-green-500": d.isDefault
715
702
  }
716
703
  ),
717
704
  strokeWidth: 1.5
@@ -721,7 +708,7 @@ function tl() {
721
708
  Je,
722
709
  {
723
710
  onClick: (b) => {
724
- b.preventDefault(), c(u.id);
711
+ b.preventDefault(), c(d.id);
725
712
  },
726
713
  className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
727
714
  strokeWidth: 1.5
@@ -730,7 +717,7 @@ function tl() {
730
717
  ] })
731
718
  ]
732
719
  },
733
- u.id
720
+ d.id
734
721
  ))
735
722
  ]
736
723
  }
@@ -741,28 +728,28 @@ function tl() {
741
728
  function nl({
742
729
  iconClassName: s
743
730
  }) {
744
- const [t, a] = V(!1), { authToken: n } = Oe(), l = z((o) => o.theme), d = z((o) => o.filterValues);
745
- async function i() {
731
+ const [t, a] = V(!1), { authToken: n } = Oe(), l = I((o) => o.theme), r = I((o) => o.filterValues);
732
+ async function u() {
746
733
  {
747
734
  a(!0);
748
735
  const o = new URLSearchParams();
749
- o.set("token", (n == null ? void 0 : n.accessToken) || ""), o.set("theme", l || "light"), o.set("filterValues", JSON.stringify(d));
750
- const c = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(o.toString())}`, u = await (await fetch(c, {
736
+ o.set("token", (n == null ? void 0 : n.accessToken) || ""), o.set("theme", l || "light"), o.set("filterValues", JSON.stringify(r));
737
+ const c = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(o.toString())}`, d = await (await fetch(c, {
751
738
  method: "GET",
752
739
  headers: {
753
740
  Authorization: `Bearer ${n == null ? void 0 : n.accessToken}`
754
741
  }
755
- })).blob(), b = URL.createObjectURL(u);
742
+ })).blob(), b = URL.createObjectURL(d);
756
743
  window.open(b, "_blank"), a(!1);
757
744
  }
758
745
  }
759
746
  return /* @__PURE__ */ e.jsx(
760
- O,
747
+ z,
761
748
  {
762
749
  variant: "link",
763
750
  className: "group h-7 p-2",
764
751
  size: "sm",
765
- onClick: i,
752
+ onClick: u,
766
753
  children: t ? /* @__PURE__ */ e.jsx(qe, { className: K("size-3.5 animate-spin", s) }) : /* @__PURE__ */ e.jsx(
767
754
  nt,
768
755
  {
@@ -776,28 +763,28 @@ function nl({
776
763
  function ll() {
777
764
  V(!1);
778
765
  const { authToken: s } = Oe();
779
- z((f) => f.theme);
780
- const t = z((f) => f.lenses), a = z((f) => f.selectedLensId), n = t == null ? void 0 : t.find((f) => f.id === a), l = z((f) => f.dashboard);
781
- z((f) => f.selectedSheetId);
782
- const d = z(
766
+ I((f) => f.theme);
767
+ const t = I((f) => f.lenses), a = I((f) => f.selectedLensId), n = t == null ? void 0 : t.find((f) => f.id === a), l = I((f) => f.dashboard);
768
+ I((f) => f.selectedSheetId);
769
+ const r = I(
783
770
  (f) => f.isDashboardEditing
784
- ), i = m(
771
+ ), u = m(
785
772
  (f) => f.selectedConnectionId
786
- ), [o, c] = V(!1), p = z((f) => f.filterValues), u = z((f) => f.isVisualEditing), b = z((f) => f.showFilters);
787
- z(
773
+ ), [o, c] = V(!1), p = I((f) => f.filterValues), d = I((f) => f.isVisualEditing), b = I((f) => f.showFilters);
774
+ I(
788
775
  (f) => f.showDashboardJSON
789
776
  );
790
- const g = z((f) => f.onSaveFunction), h = z(
777
+ const j = I((f) => f.onSaveFunction), h = I(
791
778
  (f) => f.actions.setShowFilters
792
- ), { addFrame: j, setSelectedFrameId: C } = z(
779
+ ), { addFrame: g, setSelectedFrameId: C } = I(
793
780
  (f) => f.actions
794
- ), { getSelectedSheet: I, setIsDashboardEditing: y, setShowDashboardJSON: M } = z((f) => f.actions), F = I(), { tenantId: A, endUserId: N } = ws(
781
+ ), { getSelectedSheet: O, setIsDashboardEditing: y, setShowDashboardJSON: L } = I((f) => f.actions), D = O(), { tenantId: A, endUserId: N } = ks(
795
782
  () => lt(s == null ? void 0 : s.accessToken),
796
783
  [s == null ? void 0 : s.accessToken]
797
- ), D = ws(() => A || N, [A, N]), E = () => {
798
- if (!d || !F) return;
784
+ ), F = ks(() => A || N, [A, N]), E = () => {
785
+ if (!r || !D) return;
799
786
  const f = {
800
- connectionId: i,
787
+ connectionId: u,
801
788
  id: Ke(),
802
789
  title: "Title",
803
790
  description: "Description",
@@ -817,48 +804,48 @@ function ll() {
817
804
  cards: [f],
818
805
  activeCardId: f.id
819
806
  };
820
- j(F.id, k), C(k.id);
807
+ g(D.id, k), C(k.id);
821
808
  }, x = () => {
822
809
  y(!0);
823
810
  };
824
811
  async function v() {
825
812
  if (c(!0), !a || !n) return;
826
- const f = Ta(
813
+ const f = Ma(
827
814
  l
828
815
  ), k = JSON.stringify(f), S = {
829
816
  ...n,
830
817
  template: k,
831
818
  filterValues: p
832
819
  };
833
- await zs(S, s == null ? void 0 : s.accessToken), We.success("Lens saved"), g == null || g(f), c(!1);
820
+ await Os(S, s == null ? void 0 : s.accessToken), We.success("Lens saved"), j == null || j(f), c(!1);
834
821
  }
835
- return u ? null : /* @__PURE__ */ e.jsxs(
822
+ return d ? null : /* @__PURE__ */ e.jsxs(
836
823
  "div",
837
824
  {
838
825
  className: "flex items-center justify-between gap-2 border-b bg-muted/50 py-2 pl-3 pr-2",
839
826
  role: "dashboard-controls",
840
827
  children: [
841
- !u && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(_, { children: n == null ? void 0 : n.name }) }),
828
+ !d && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(_, { children: n == null ? void 0 : n.name }) }),
842
829
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
843
830
  /* @__PURE__ */ e.jsx(nl, {}),
844
- d && !u && D && /* @__PURE__ */ e.jsx(al, {}),
845
- !u && D && /* @__PURE__ */ e.jsx(tl, {}),
846
- d && !u && /* @__PURE__ */ e.jsxs(
847
- O,
831
+ r && !d && F && /* @__PURE__ */ e.jsx(al, {}),
832
+ !d && F && /* @__PURE__ */ e.jsx(tl, {}),
833
+ r && !d && /* @__PURE__ */ e.jsxs(
834
+ z,
848
835
  {
849
836
  variant: "secondary",
850
837
  className: "h-7 p-2",
851
838
  size: "sm",
852
- disabled: !d,
839
+ disabled: !r,
853
840
  onClick: E,
854
841
  children: [
855
- /* @__PURE__ */ e.jsx(Ls, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
842
+ /* @__PURE__ */ e.jsx(Ts, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
856
843
  "Frame"
857
844
  ]
858
845
  }
859
846
  ),
860
- !d && /* @__PURE__ */ e.jsx(
861
- O,
847
+ !r && /* @__PURE__ */ e.jsx(
848
+ z,
862
849
  {
863
850
  variant: "ghost",
864
851
  className: "h-7 p-2",
@@ -867,21 +854,21 @@ function ll() {
867
854
  children: /* @__PURE__ */ e.jsx(ca, { className: "h-4 w-4", strokeWidth: 1.5 })
868
855
  }
869
856
  ),
870
- d && !u && /* @__PURE__ */ e.jsx(
871
- O,
857
+ r && !d && /* @__PURE__ */ e.jsx(
858
+ z,
872
859
  {
873
860
  variant: "ghost",
874
861
  role: "close",
875
862
  className: "h-7 p-2",
876
863
  onClick: () => {
877
- y(!1), M(!1);
864
+ y(!1), L(!1);
878
865
  },
879
866
  size: "sm",
880
867
  children: /* @__PURE__ */ e.jsx(Je, { className: "h-4 w-4", strokeWidth: 1.5 })
881
868
  }
882
869
  ),
883
- d && !u && D && /* @__PURE__ */ e.jsx(
884
- O,
870
+ r && !d && F && /* @__PURE__ */ e.jsx(
871
+ z,
885
872
  {
886
873
  className: "h-7 p-2",
887
874
  variant: "ghost",
@@ -891,8 +878,8 @@ function ll() {
891
878
  children: /* @__PURE__ */ e.jsx(Un, { className: "h-4 w-4", strokeWidth: 1.5 })
892
879
  }
893
880
  ),
894
- !b && !u && d && /* @__PURE__ */ e.jsx(
895
- O,
881
+ !b && !d && r && /* @__PURE__ */ e.jsx(
882
+ z,
896
883
  {
897
884
  className: "h-7 p-2",
898
885
  variant: "ghost",
@@ -901,8 +888,8 @@ function ll() {
901
888
  children: /* @__PURE__ */ e.jsx(da, { className: "h-4 w-4", strokeWidth: 1.5 })
902
889
  }
903
890
  ),
904
- !u && d && !1,
905
- !u && !1
891
+ !d && r && !1,
892
+ !d && !1
906
893
  ] })
907
894
  ]
908
895
  }
@@ -914,32 +901,32 @@ function Be({
914
901
  value: a,
915
902
  isLoading: n,
916
903
  isError: l,
917
- connectionTooltip: d,
918
- onChange: i,
904
+ connectionTooltip: r,
905
+ onChange: u,
919
906
  showNone: o = !1,
920
907
  className: c,
921
908
  showIcon: p = !0,
922
- disabled: u = !1
909
+ disabled: d = !1
923
910
  }) {
924
911
  const b = n ? "Loading..." : l ? "Error" : a;
925
- function g() {
912
+ function j() {
926
913
  if (s === "Connection")
927
914
  return /* @__PURE__ */ e.jsx(Bn, { className: "size-4 rotate-90" });
928
915
  if (s === "Database")
929
- return /* @__PURE__ */ e.jsx(In, { className: "size-4" });
916
+ return /* @__PURE__ */ e.jsx(Dn, { className: "size-4" });
930
917
  if (s === "Schema")
931
918
  return /* @__PURE__ */ e.jsx($n, { className: "size-4" });
932
919
  if (s === "Table")
933
920
  return /* @__PURE__ */ e.jsx(Vs, { className: "size-4" });
934
921
  if (s === "Model")
935
- return /* @__PURE__ */ e.jsx(wn, { className: "size-4" });
922
+ return /* @__PURE__ */ e.jsx(kn, { className: "size-4" });
936
923
  }
937
924
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
938
- p && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: d ? /* @__PURE__ */ e.jsxs(ua, { children: [
939
- /* @__PURE__ */ e.jsx(rt, { children: g() }),
940
- /* @__PURE__ */ e.jsx(ma, { className: "text-xs", align: "start", children: d })
941
- ] }) : g() }),
942
- /* @__PURE__ */ e.jsxs(me, { disabled: u, value: b, onValueChange: i, children: [
925
+ p && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: r ? /* @__PURE__ */ e.jsxs(ua, { children: [
926
+ /* @__PURE__ */ e.jsx(rt, { children: j() }),
927
+ /* @__PURE__ */ e.jsx(ma, { className: "text-xs", align: "start", children: r })
928
+ ] }) : j() }),
929
+ /* @__PURE__ */ e.jsxs(me, { disabled: d, value: b, onValueChange: u, children: [
943
930
  /* @__PURE__ */ e.jsx(
944
931
  he,
945
932
  {
@@ -959,7 +946,7 @@ function Be({
959
946
  n ? /* @__PURE__ */ e.jsx(fe, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(fe, { children: s }),
960
947
  /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
961
948
  o && /* @__PURE__ */ e.jsx(Y, { value: "none", children: "None" }, "none"),
962
- t && t.map((h, j) => /* @__PURE__ */ e.jsx(Y, { value: h.id, children: h.name }, j))
949
+ t && t.map((h, g) => /* @__PURE__ */ e.jsx(Y, { value: h.id, children: h.name }, g))
963
950
  ] }),
964
951
  (n || l) && /* @__PURE__ */ e.jsx(Y, { value: b, children: b })
965
952
  ] }) })
@@ -969,24 +956,24 @@ function Be({
969
956
  function rl({ column: s }) {
970
957
  const [t, a] = V(!1), n = m((h) => h.selectedTableName), l = m(
971
958
  (h) => h.selectedSchemaName
972
- ), d = m(
959
+ ), r = m(
973
960
  (h) => h.selectedDatamodelId
974
- ), i = m((h) => h.sqlGen), { modelItems: o } = _e(), c = m((h) => h.actions.setSqlGen), p = m((h) => h.actions.setCardSql), u = m((h) => h.actions.setRunSql);
975
- function b(h, j) {
976
- var M;
977
- const C = ha(h, i, j), I = (M = o == null ? void 0 : o.find(
978
- (F) => F.id === d
979
- )) == null ? void 0 : M.name;
961
+ ), u = m((h) => h.sqlGen), { modelItems: o } = _e(), c = m((h) => h.actions.setSqlGen), p = m((h) => h.actions.setCardSql), d = m((h) => h.actions.setRunSql);
962
+ function b(h, g) {
963
+ var L;
964
+ const C = ha(h, u, g), O = (L = o == null ? void 0 : o.find(
965
+ (D) => D.id === r
966
+ )) == null ? void 0 : L.name;
980
967
  c(C);
981
968
  const y = xa(
982
969
  C,
983
970
  de(l || ""),
984
971
  de(n),
985
- I
972
+ O
986
973
  );
987
- y && (p(y), u(!0)), a(!1);
974
+ y && (p(y), d(!0)), a(!1);
988
975
  }
989
- function g() {
976
+ function j() {
990
977
  return /* @__PURE__ */ e.jsxs("ul", { className: "text-xs", children: [
991
978
  /* @__PURE__ */ e.jsx(
992
979
  "li",
@@ -1031,13 +1018,13 @@ function rl({ column: s }) {
1031
1018
  ] });
1032
1019
  }
1033
1020
  return /* @__PURE__ */ e.jsxs(qs, { openDelay: 0, open: t, onOpenChange: a, children: [
1034
- /* @__PURE__ */ e.jsx(Rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(Da, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
1021
+ /* @__PURE__ */ e.jsx(Rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(Fa, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
1035
1022
  /* @__PURE__ */ e.jsx(
1036
1023
  _s,
1037
1024
  {
1038
1025
  align: "center",
1039
1026
  className: "w-20 rounded-md p-0 shadow-none",
1040
- children: g()
1027
+ children: j()
1041
1028
  }
1042
1029
  )
1043
1030
  ] });
@@ -1049,7 +1036,7 @@ function Ea({ column: s }) {
1049
1036
  /* @__PURE__ */ e.jsx(Gs, { className: "size-3" })
1050
1037
  ) : pa.includes(s.data_type.toLowerCase()) ? (
1051
1038
  //
1052
- /* @__PURE__ */ e.jsx(En, { className: "size-3" })
1039
+ /* @__PURE__ */ e.jsx(An, { className: "size-3" })
1053
1040
  ) : ct.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(dt, { className: "size-3" }) : ut.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Wn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Gn, { className: "size-3" }) }),
1054
1041
  /* @__PURE__ */ e.jsx(ma, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
1055
1042
  ] });
@@ -1060,45 +1047,45 @@ function il({
1060
1047
  columns: a,
1061
1048
  status: n
1062
1049
  }) {
1063
- const l = m((x) => x.sqlGen), d = m(
1050
+ const l = m((x) => x.sqlGen), r = m(
1064
1051
  (x) => x.selectedConnectionId
1065
- ), i = m(
1052
+ ), u = m(
1066
1053
  (x) => x.selectedDatabaseName
1067
1054
  ), o = m(
1068
1055
  (x) => x.selectedSchemaName
1069
1056
  ), c = m((x) => x.selectedTableName), p = m(
1070
1057
  (x) => x.selectedDatamodelId
1071
- ), u = z(
1058
+ ), d = I(
1072
1059
  (x) => x.dashboard.aiScopeTables
1073
- ), { setAIScopeTables: b } = z((x) => x.actions), g = m((x) => x.actions.setRunSql), h = m((x) => x.actions.setSqlGen), j = m(
1060
+ ), { setAIScopeTables: b } = I((x) => x.actions), j = m((x) => x.actions.setRunSql), h = m((x) => x.actions.setSqlGen), g = m(
1074
1061
  (x) => x.actions.setIsShowingVisual
1075
- ), C = m((x) => x.actions.setCardSql), { connectionType: I, modelItems: y } = _e();
1076
- function M(x) {
1062
+ ), C = m((x) => x.actions.setCardSql), { connectionType: O, modelItems: y } = _e();
1063
+ function L(x) {
1077
1064
  var S;
1078
1065
  const v = ha(x, l);
1079
1066
  h(v);
1080
1067
  const f = (S = y == null ? void 0 : y.find(
1081
- (R) => R.id === p
1068
+ (q) => q.id === p
1082
1069
  )) == null ? void 0 : S.name, k = xa(v, de(s), de(t), f);
1083
- k && (C(k), g(!0));
1070
+ k && (C(k), j(!0));
1084
1071
  }
1085
- function F() {
1086
- return (u == null ? void 0 : u.find(
1087
- (x) => x.connectinonId === d && x.tableName === c
1072
+ function D() {
1073
+ return (d == null ? void 0 : d.find(
1074
+ (x) => x.connectinonId === r && x.tableName === c
1088
1075
  )) !== void 0;
1089
1076
  }
1090
1077
  function A(x) {
1091
- if (x === !0 && c && d) {
1078
+ if (x === !0 && c && r) {
1092
1079
  const v = {
1093
- connectinonId: d,
1094
- connectionType: I,
1095
- databaseName: i,
1080
+ connectinonId: r,
1081
+ connectionType: O,
1082
+ databaseName: u,
1096
1083
  schemaName: o,
1097
1084
  tableName: c
1098
- }, k = [...u || [], v].filter(
1099
- (S, R, $) => $.findIndex(
1085
+ }, k = [...d || [], v].filter(
1086
+ (S, q, $) => $.findIndex(
1100
1087
  (U) => U.connectinonId === S.connectinonId && U.tableName === S.tableName
1101
- ) === R
1088
+ ) === q
1102
1089
  );
1103
1090
  b(k), We.success(`Added '${c}' to AI Scope`, {
1104
1091
  position: "top-right",
@@ -1106,8 +1093,8 @@ function il({
1106
1093
  richColors: !0
1107
1094
  });
1108
1095
  } else {
1109
- const v = (u || []).filter(
1110
- (f) => f.connectinonId !== d && f.tableName !== c
1096
+ const v = (d || []).filter(
1097
+ (f) => f.connectinonId !== r && f.tableName !== c
1111
1098
  );
1112
1099
  b(v), We(`Removed '${c}' from AI Scope`, {
1113
1100
  position: "top-right",
@@ -1120,29 +1107,29 @@ function il({
1120
1107
  var S;
1121
1108
  let x = ga(s, t);
1122
1109
  const v = (S = y == null ? void 0 : y.find(
1123
- (R) => R.id === p
1110
+ (q) => q.id === p
1124
1111
  )) == null ? void 0 : S.name;
1125
- p && p !== "none" && (x = `${Ns}.${v}`);
1112
+ p && p !== "none" && (x = `${Ss}.${v}`);
1126
1113
  let f = x;
1127
- return ((R) => /[A-Z]/.test(R))(t) && (f = f.split(".").map(($) => `"${$}"`).join(".")), f;
1114
+ return ((q) => /[A-Z]/.test(q))(t) && (f = f.split(".").map(($) => `"${$}"`).join(".")), f;
1128
1115
  }
1129
- function D() {
1116
+ function F() {
1130
1117
  const x = N();
1131
- j(!1);
1132
- const v = I === "MSSQL" ? `SELECT top 10 * FROM ${x}` : `SELECT * FROM ${x} LIMIT 10`;
1133
- C(v), g(!0);
1118
+ g(!1);
1119
+ const v = O === "MSSQL" ? `SELECT top 10 * FROM ${x}` : `SELECT * FROM ${x} LIMIT 10`;
1120
+ C(v), j(!0);
1134
1121
  }
1135
1122
  function E() {
1136
1123
  const x = N();
1137
- C(`SELECT COUNT(*) as count FROM ${x}`), g(!0);
1124
+ C(`SELECT COUNT(*) as count FROM ${x}`), j(!0);
1138
1125
  }
1139
1126
  return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
1140
1127
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
1141
1128
  /* @__PURE__ */ e.jsx(
1142
1129
  fa,
1143
1130
  {
1144
- title: `${F() ? "Remove from" : "Add to"} AI Scope`,
1145
- pressed: F(),
1131
+ title: `${D() ? "Remove from" : "Add to"} AI Scope`,
1132
+ pressed: D(),
1146
1133
  onPressedChange: A,
1147
1134
  variant: "outline",
1148
1135
  className: "h-9 px-2",
@@ -1150,18 +1137,18 @@ function il({
1150
1137
  mt,
1151
1138
  {
1152
1139
  className: K("size-4", {
1153
- "text-primary": F(),
1154
- "text-muted-foreground": !F()
1140
+ "text-primary": D(),
1141
+ "text-muted-foreground": !D()
1155
1142
  })
1156
1143
  }
1157
1144
  )
1158
1145
  }
1159
1146
  ),
1160
1147
  /* @__PURE__ */ e.jsxs(
1161
- O,
1148
+ z,
1162
1149
  {
1163
1150
  disabled: n !== "Success",
1164
- onClick: D,
1151
+ onClick: F,
1165
1152
  size: "sm",
1166
1153
  variant: "secondary",
1167
1154
  className: "flex",
@@ -1172,7 +1159,7 @@ function il({
1172
1159
  }
1173
1160
  ),
1174
1161
  /* @__PURE__ */ e.jsxs(
1175
- O,
1162
+ z,
1176
1163
  {
1177
1164
  disabled: n !== "Success",
1178
1165
  onClick: E,
@@ -1194,7 +1181,7 @@ function il({
1194
1181
  a == null ? void 0 : a.map((x) => /* @__PURE__ */ e.jsxs(
1195
1182
  "div",
1196
1183
  {
1197
- onClick: () => M(x),
1184
+ onClick: () => L(x),
1198
1185
  className: K(
1199
1186
  "group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
1200
1187
  {
@@ -1227,56 +1214,56 @@ function il({
1227
1214
  }
1228
1215
  function _e(s, t) {
1229
1216
  var Ze, es, ss, as, ts;
1230
- let a = ws(() => [], []);
1217
+ let a = ks(() => [], []);
1231
1218
  const n = Oe().authToken || s, l = m(
1232
- (r) => r.selectedConnectionId
1233
- ), d = m(
1234
- (r) => r.selectedDatamodelId
1235
- ), i = m(
1236
- (r) => r.selectedDatabaseName
1237
- ), o = m(
1238
- (r) => r.selectedSchemaName
1239
- ), c = m((r) => r.selectedTableName), p = m(
1240
- (r) => r.actions.setCurrentColumns
1219
+ (i) => i.selectedConnectionId
1220
+ ), r = m(
1221
+ (i) => i.selectedDatamodelId
1241
1222
  ), u = m(
1242
- (r) => r.actions.setSelectedConnectionId
1223
+ (i) => i.selectedDatabaseName
1224
+ ), o = m(
1225
+ (i) => i.selectedSchemaName
1226
+ ), c = m((i) => i.selectedTableName), p = m(
1227
+ (i) => i.actions.setCurrentColumns
1228
+ ), d = m(
1229
+ (i) => i.actions.setSelectedConnectionId
1243
1230
  ), b = m(
1244
- (r) => r.actions.setSelectedDatamodelId
1245
- ), g = m(
1246
- (r) => r.actions.setSelectedDatabaseName
1247
- ), h = m(
1248
- (r) => r.actions.setSelectedSchemaName
1231
+ (i) => i.actions.setSelectedDatamodelId
1249
1232
  ), j = m(
1250
- (r) => r.actions.setSelectedTableName
1251
- ), C = m((r) => r.actions.setCardSql);
1252
- function I(r) {
1253
- return l && i && o && i !== "NA" ? !0 : l && r === "API" ? !1 : !!(l && r === "S3");
1233
+ (i) => i.actions.setSelectedDatabaseName
1234
+ ), h = m(
1235
+ (i) => i.actions.setSelectedSchemaName
1236
+ ), g = m(
1237
+ (i) => i.actions.setSelectedTableName
1238
+ ), C = m((i) => i.actions.setCardSql);
1239
+ function O(i) {
1240
+ return l && u && o && u !== "NA" ? !0 : l && i === "API" ? !1 : !!(l && i === "S3");
1254
1241
  }
1255
- function y(r) {
1256
- return !!(l && i && i !== "NA" && o && c || l && (r === "S3" || r === "API") || d && d);
1242
+ function y(i) {
1243
+ return !!(l && u && u !== "NA" && o && c || l && (i === "S3" || i === "API") || r && r);
1257
1244
  }
1258
- function M(r) {
1259
- return l && r ? !(r === "API" || r === "S3") : !1;
1245
+ function L(i) {
1246
+ return l && i ? !(i === "API" || i === "S3") : !1;
1260
1247
  }
1261
1248
  const {
1262
- data: F,
1249
+ data: D,
1263
1250
  isLoading: A,
1264
1251
  isError: N
1265
1252
  } = Ce({
1266
1253
  queryKey: ["connections"],
1267
- queryFn: () => De(
1254
+ queryFn: () => Fe(
1268
1255
  "https://semaphor.cloud/api/v1/connections",
1269
1256
  (n == null ? void 0 : n.accessToken) || ""
1270
1257
  ),
1271
1258
  enabled: !!(n != null && n.accessToken)
1272
1259
  // Only fetch if authToken is present
1273
1260
  }), {
1274
- data: D,
1261
+ data: F,
1275
1262
  isLoading: E,
1276
1263
  isError: x
1277
1264
  } = Ce({
1278
1265
  queryKey: ["models", l],
1279
- queryFn: () => De(
1266
+ queryFn: () => Fe(
1280
1267
  "https://semaphor.cloud/api/v1/datamodels",
1281
1268
  (n == null ? void 0 : n.accessToken) || "",
1282
1269
  {
@@ -1285,24 +1272,24 @@ function _e(s, t) {
1285
1272
  ),
1286
1273
  enabled: !!(n != null && n.accessToken) && !!l
1287
1274
  // Only fetch if authToken is present
1288
- }), v = F == null ? void 0 : F.connections.find(
1289
- (r) => r.id === l
1275
+ }), v = D == null ? void 0 : D.connections.find(
1276
+ (i) => i.id === l
1290
1277
  ), f = v == null ? void 0 : v.type, k = (v == null ? void 0 : v.type) === "API" || (v == null ? void 0 : v.type) === "S3", {
1291
1278
  data: S,
1292
- isLoading: R,
1279
+ isLoading: q,
1293
1280
  isFetching: $,
1294
1281
  isError: U,
1295
1282
  refetch: Z
1296
1283
  } = Ce({
1297
1284
  queryKey: ["databases", l],
1298
- queryFn: () => De(
1285
+ queryFn: () => Fe(
1299
1286
  "https://semaphor.cloud/api/v1/databases",
1300
1287
  (n == null ? void 0 : n.accessToken) || "",
1301
1288
  {
1302
1289
  connection_id: l
1303
1290
  }
1304
1291
  ),
1305
- enabled: M(f)
1292
+ enabled: L(f)
1306
1293
  // !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
1307
1294
  }), {
1308
1295
  data: B,
@@ -1311,20 +1298,20 @@ function _e(s, t) {
1311
1298
  isError: H,
1312
1299
  refetch: ae
1313
1300
  } = Ce({
1314
- queryKey: ["schemas", l, i],
1315
- queryFn: () => De(
1301
+ queryKey: ["schemas", l, u],
1302
+ queryFn: () => Fe(
1316
1303
  "https://semaphor.cloud/api/v1/schemas",
1317
1304
  (n == null ? void 0 : n.accessToken) || "",
1318
1305
  {
1319
1306
  connection_id: l,
1320
- database_name: i
1307
+ database_name: u
1321
1308
  }
1322
1309
  ),
1323
- enabled: !!l && !!i && !k && i !== "NA"
1310
+ enabled: !!l && !!u && !k && u !== "NA"
1324
1311
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
1325
1312
  }), {
1326
- data: T,
1327
- isLoading: L,
1313
+ data: M,
1314
+ isLoading: T,
1328
1315
  isFetching: te,
1329
1316
  isError: P,
1330
1317
  refetch: ee
@@ -1332,19 +1319,19 @@ function _e(s, t) {
1332
1319
  queryKey: [
1333
1320
  "tables",
1334
1321
  l,
1335
- i,
1322
+ u,
1336
1323
  o
1337
1324
  ],
1338
- queryFn: () => De(
1325
+ queryFn: () => Fe(
1339
1326
  "https://semaphor.cloud/api/v1/tables",
1340
1327
  (n == null ? void 0 : n.accessToken) || "",
1341
1328
  {
1342
1329
  connection_id: l,
1343
- database_name: i,
1330
+ database_name: u,
1344
1331
  schema_name: o
1345
1332
  }
1346
1333
  ),
1347
- enabled: I(f)
1334
+ enabled: O(f)
1348
1335
  }), {
1349
1336
  data: ne,
1350
1337
  isLoading: Ee,
@@ -1354,19 +1341,19 @@ function _e(s, t) {
1354
1341
  queryKey: [
1355
1342
  "columns",
1356
1343
  l,
1357
- i,
1358
- d,
1344
+ u,
1345
+ r,
1359
1346
  o,
1360
1347
  c
1361
1348
  ],
1362
- queryFn: () => De(
1349
+ queryFn: () => Fe(
1363
1350
  "https://semaphor.cloud/api/v1/columns",
1364
1351
  (n == null ? void 0 : n.accessToken) || "",
1365
1352
  {
1366
1353
  connection_id: l,
1367
- datamodel_id: d || "",
1354
+ datamodel_id: r || "",
1368
1355
  // don't pass undefined. Pass empty string
1369
- database_name: i,
1356
+ database_name: u,
1370
1357
  schema_name: o,
1371
1358
  table_name: c
1372
1359
  }
@@ -1386,46 +1373,46 @@ function _e(s, t) {
1386
1373
  }, [
1387
1374
  k,
1388
1375
  C,
1389
- j,
1390
- h,
1391
1376
  g,
1377
+ h,
1378
+ j,
1392
1379
  v
1393
1380
  ]);
1394
1381
  const be = (v == null ? void 0 : v.type) === "API" ? (Ze = v == null ? void 0 : v.type) == null ? void 0 : Ze.toLowerCase() : c || "", W = k ? "" : o || "";
1395
- function oe(r) {
1396
- h(r), j("");
1382
+ function oe(i) {
1383
+ h(i), g("");
1397
1384
  }
1398
- function ce(r) {
1399
- g(r === "none" ? "" : r), h(""), j(""), r !== "none" && r !== "" && b("");
1385
+ function ce(i) {
1386
+ j(i === "none" ? "" : i), h(""), g(""), i !== "none" && i !== "" && b("");
1400
1387
  }
1401
- function Fe(r) {
1402
- u(r);
1388
+ function De(i) {
1389
+ d(i);
1403
1390
  }
1404
- function Ae(r) {
1405
- b(r === "none" ? "" : r), r !== "none" && r !== "" && g("");
1391
+ function Ae(i) {
1392
+ b(i === "none" ? "" : i), i !== "none" && i !== "" && j("");
1406
1393
  }
1407
- S && ((es = S == null ? void 0 : S.databases) == null ? void 0 : es.length) > 0, B && ((ss = B == null ? void 0 : B.schemas) == null ? void 0 : ss.length) > 0, ne && ((as = ne == null ? void 0 : ne.columns) == null ? void 0 : as.length) > 0 && (a = ne.columns.map((r) => ({
1408
- ...r,
1409
- data_type: r.data_type.toLowerCase()
1394
+ S && ((es = S == null ? void 0 : S.databases) == null ? void 0 : es.length) > 0, B && ((ss = B == null ? void 0 : B.schemas) == null ? void 0 : ss.length) > 0, ne && ((as = ne == null ? void 0 : ne.columns) == null ? void 0 : as.length) > 0 && (a = ne.columns.map((i) => ({
1395
+ ...i,
1396
+ data_type: i.data_type.toLowerCase()
1410
1397
  }))), U && (a = []), (je || N) && (a = []);
1411
- const $e = F == null ? void 0 : F.connections.map(
1412
- (r) => ({
1413
- id: r.id,
1414
- name: r.name,
1415
- type: r.type
1398
+ const $e = D == null ? void 0 : D.connections.map(
1399
+ (i) => ({
1400
+ id: i.id,
1401
+ name: i.name,
1402
+ type: i.type
1416
1403
  })
1417
- ), Pe = (ts = D == null ? void 0 : D.datamodels) == null ? void 0 : ts.map((r) => ({
1418
- id: r.id,
1419
- name: r.name
1420
- })), Ve = S == null ? void 0 : S.databases.map((r) => ({
1421
- id: r.database_name,
1422
- name: r.database_name
1423
- })), ys = B == null ? void 0 : B.schemas.map((r) => ({
1424
- id: r.schema_name,
1425
- name: r.schema_name
1426
- })), Xe = T == null ? void 0 : T.tables.map((r) => ({
1427
- id: r.table_name,
1428
- name: r.table_name
1404
+ ), Pe = (ts = F == null ? void 0 : F.datamodels) == null ? void 0 : ts.map((i) => ({
1405
+ id: i.id,
1406
+ name: i.name
1407
+ })), Ve = S == null ? void 0 : S.databases.map((i) => ({
1408
+ id: i.database_name,
1409
+ name: i.database_name
1410
+ })), vs = B == null ? void 0 : B.schemas.map((i) => ({
1411
+ id: i.schema_name,
1412
+ name: i.schema_name
1413
+ })), Xe = M == null ? void 0 : M.tables.map((i) => ({
1414
+ id: i.table_name,
1415
+ name: i.table_name
1429
1416
  }));
1430
1417
  return {
1431
1418
  connectionItems: $e,
@@ -1435,13 +1422,13 @@ function _e(s, t) {
1435
1422
  isModelsLoading: E,
1436
1423
  isModelsError: x,
1437
1424
  databaseItems: Ve,
1438
- isDatabasesLoadingOrFetching: R || $,
1425
+ isDatabasesLoadingOrFetching: q || $,
1439
1426
  isDatabaseError: U,
1440
- schemaItems: ys,
1427
+ schemaItems: vs,
1441
1428
  isSchemaLoadingOrFetching: X || w,
1442
1429
  isSchemaError: H,
1443
1430
  tableItems: Xe,
1444
- isTableLoadingOrFetching: L || te,
1431
+ isTableLoadingOrFetching: T || te,
1445
1432
  isTableError: P,
1446
1433
  columns: a,
1447
1434
  isColumnsLoadingOrFetching: Ee || Ie,
@@ -1450,7 +1437,7 @@ function _e(s, t) {
1450
1437
  connectionType: f,
1451
1438
  tableName: be,
1452
1439
  schemaName: W,
1453
- handleConnectionChange: Fe,
1440
+ handleConnectionChange: De,
1454
1441
  handleDatamodelChange: Ae,
1455
1442
  handleDatabaseChange: ce,
1456
1443
  handleSchemaChange: oe
@@ -1468,44 +1455,44 @@ function Aa({
1468
1455
  (P) => P.selectedDatabaseName
1469
1456
  ), l = m(
1470
1457
  (P) => P.selectedSchemaName
1471
- ), d = m((P) => P.selectedTableName), i = m(
1458
+ ), r = m((P) => P.selectedTableName), u = m(
1472
1459
  (P) => P.actions.setSelectedTableName
1473
1460
  ), {
1474
1461
  connectionItems: o,
1475
1462
  modelItems: c,
1476
1463
  schemaItems: p,
1477
- databaseItems: u,
1464
+ databaseItems: d,
1478
1465
  tableItems: b,
1479
- columns: g,
1466
+ columns: j,
1480
1467
  isConnectionsLoading: h,
1481
- isModelsLoading: j,
1468
+ isModelsLoading: g,
1482
1469
  isConnectionsError: C,
1483
- isModelsError: I,
1470
+ isModelsError: O,
1484
1471
  isDatabasesLoadingOrFetching: y,
1485
- isDatabaseError: M,
1486
- isSchemaLoadingOrFetching: F,
1472
+ isDatabaseError: L,
1473
+ isSchemaLoadingOrFetching: D,
1487
1474
  isSchemaError: A,
1488
1475
  isColumnsError: N,
1489
- isColumnsLoadingOrFetching: D,
1476
+ isColumnsLoadingOrFetching: F,
1490
1477
  isTableLoadingOrFetching: E,
1491
1478
  isTableError: x,
1492
1479
  connectionType: v,
1493
1480
  isNonDbConnection: f,
1494
1481
  handleConnectionChange: k,
1495
1482
  handleDatabaseChange: S,
1496
- handleSchemaChange: R,
1483
+ handleSchemaChange: q,
1497
1484
  handleDatamodelChange: $,
1498
1485
  tableName: U,
1499
1486
  schemaName: Z
1500
1487
  } = _e();
1501
1488
  function B() {
1502
- return s ? s(Z, U, g) : /* @__PURE__ */ e.jsx(
1489
+ return s ? s(Z, U, j) : /* @__PURE__ */ e.jsx(
1503
1490
  il,
1504
1491
  {
1505
1492
  schemaName: Z,
1506
1493
  tableName: U,
1507
- columns: g,
1508
- status: D ? "Loading..." : N ? "Error" : "Success"
1494
+ columns: j,
1495
+ status: F ? "Loading..." : N ? "Error" : "Success"
1509
1496
  }
1510
1497
  );
1511
1498
  }
@@ -1520,9 +1507,9 @@ function Aa({
1520
1507
  {
1521
1508
  showNone: !0,
1522
1509
  onChange: S,
1523
- isError: M,
1510
+ isError: L,
1524
1511
  isLoading: y,
1525
- items: u,
1512
+ items: d,
1526
1513
  value: n || "",
1527
1514
  title: "Database"
1528
1515
  }
@@ -1544,28 +1531,28 @@ function Aa({
1544
1531
  {
1545
1532
  showNone: !0,
1546
1533
  onChange: $,
1547
- isError: I,
1548
- isLoading: j,
1534
+ isError: O,
1535
+ isLoading: g,
1549
1536
  items: c,
1550
1537
  value: a || "",
1551
1538
  title: "Model"
1552
1539
  }
1553
1540
  );
1554
1541
  }
1555
- function T() {
1542
+ function M() {
1556
1543
  return !t || v === "S3" || v === "API" || !n || n === "none" ? null : /* @__PURE__ */ e.jsx(
1557
1544
  Be,
1558
1545
  {
1559
- onChange: R,
1546
+ onChange: q,
1560
1547
  isError: A,
1561
- isLoading: F,
1548
+ isLoading: D,
1562
1549
  items: p,
1563
1550
  value: l || "",
1564
1551
  title: "Schema"
1565
1552
  }
1566
1553
  );
1567
1554
  }
1568
- function L() {
1555
+ function T() {
1569
1556
  function P() {
1570
1557
  let ee = !1;
1571
1558
  return v === "API" ? (ee = !1, ee) : ((v === "S3" || t && n && n !== "none" && l) && (ee = !0), ee);
@@ -1573,11 +1560,11 @@ function Aa({
1573
1560
  return P() ? /* @__PURE__ */ e.jsx(
1574
1561
  Be,
1575
1562
  {
1576
- onChange: i,
1563
+ onChange: u,
1577
1564
  isError: x,
1578
1565
  items: b,
1579
1566
  isLoading: E,
1580
- value: d || "",
1567
+ value: r || "",
1581
1568
  title: "Table"
1582
1569
  }
1583
1570
  ) : null;
@@ -1601,12 +1588,12 @@ function Aa({
1601
1588
  ae(),
1602
1589
  H(),
1603
1590
  w(),
1604
- T(),
1605
- L()
1591
+ M(),
1592
+ T()
1606
1593
  ] }),
1607
1594
  B(),
1608
1595
  /* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
1609
- O,
1596
+ z,
1610
1597
  {
1611
1598
  onClick: X,
1612
1599
  size: "sm",
@@ -1622,18 +1609,18 @@ function Aa({
1622
1609
  }
1623
1610
  function ol(s) {
1624
1611
  const t = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), n = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
1625
- let d = s.length;
1626
- if (l !== -1 && (d = l), n !== -1 && n < d && (d = n), t !== -1) {
1627
- const i = s.substring(0, t), o = s.substring(t);
1628
- return `${i} {{ filters | where }} AND ${o.substring(
1612
+ let r = s.length;
1613
+ if (l !== -1 && (r = l), n !== -1 && n < r && (r = n), t !== -1) {
1614
+ const u = s.substring(0, t), o = s.substring(t);
1615
+ return `${u} {{ filters | where }} AND ${o.substring(
1629
1616
  6
1630
1617
  )}`;
1631
1618
  } else if (a !== -1) {
1632
- const i = s.substring(0, a), o = s.substring(a);
1633
- return `${i} {{ filters | where }} ${o}`;
1619
+ const u = s.substring(0, a), o = s.substring(a);
1620
+ return `${u} {{ filters | where }} ${o}`;
1634
1621
  } else {
1635
- const i = s.substring(0, d), o = s.substring(d);
1636
- return `${i} {{ filters | where }} ${o}`;
1622
+ const u = s.substring(0, r), o = s.substring(r);
1623
+ return `${u} {{ filters | where }} ${o}`;
1637
1624
  }
1638
1625
  }
1639
1626
  function cl({
@@ -1643,7 +1630,7 @@ function cl({
1643
1630
  setTriggerAIRun: n
1644
1631
  }) {
1645
1632
  return /* @__PURE__ */ e.jsxs(qs, { openDelay: 0, children: [
1646
- /* @__PURE__ */ e.jsx(Rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(zn, { className: "h-4 w-4 text-red-500" }) }) }),
1633
+ /* @__PURE__ */ e.jsx(Rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(On, { className: "h-4 w-4 text-red-500" }) }) }),
1647
1634
  /* @__PURE__ */ e.jsx(
1648
1635
  _s,
1649
1636
  {
@@ -1652,7 +1639,7 @@ function cl({
1652
1639
  children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-2", children: [
1653
1640
  /* @__PURE__ */ e.jsx(ze, { className: "max-h-[250px] min-h-0 overflow-scroll", children: /* @__PURE__ */ e.jsx("p", { className: "overflow-auto rounded-md bg-muted p-2 text-xs leading-relaxed", children: s }) }),
1654
1641
  /* @__PURE__ */ e.jsxs(
1655
- O,
1642
+ z,
1656
1643
  {
1657
1644
  onClick: () => {
1658
1645
  t(!0), a(s), n(!0);
@@ -1660,7 +1647,7 @@ function cl({
1660
1647
  size: "sm",
1661
1648
  variant: "outline",
1662
1649
  children: [
1663
- /* @__PURE__ */ e.jsx(Tn, { className: "mr-2 h-4 w-4" }),
1650
+ /* @__PURE__ */ e.jsx(En, { className: "mr-2 h-4 w-4" }),
1664
1651
  "Debug with AI"
1665
1652
  ]
1666
1653
  }
@@ -1723,19 +1710,19 @@ function ul({
1723
1710
  userInput: a,
1724
1711
  setUserInput: n,
1725
1712
  triggerAIRun: l,
1726
- setTriggerAIRun: d
1713
+ setTriggerAIRun: r
1727
1714
  }) {
1728
- const i = ks(null), o = ks(null), { authToken: c } = Oe(), [p, u] = V(!1), b = m((w) => w.actions.setCardSql), g = z((w) => w.dashboard.baseQueries), h = m((w) => w.actions.setRunSql), j = m((w) => w.actions.setCardType), [C, I] = V([]), y = m((w) => w.currentColumns), M = m((w) => w.card.sql), F = m((w) => w.selectedTableName), A = `
1715
+ const u = zs(null), o = zs(null), { authToken: c } = Oe(), [p, d] = V(!1), b = m((w) => w.actions.setCardSql), j = I((w) => w.dashboard.baseQueries), h = m((w) => w.actions.setRunSql), g = m((w) => w.actions.setCardType), [C, O] = V([]), y = m((w) => w.currentColumns), L = m((w) => w.card.sql), D = m((w) => w.selectedTableName), A = `
1729
1716
  ${a}
1730
1717
 
1731
- Database Query Dialect: ${F === "api" || F === "s3" ? "DuckDb" : ""}
1732
- Table Name: ${F}
1718
+ Database Query Dialect: ${D === "api" || D === "s3" ? "DuckDb" : ""}
1719
+ Table Name: ${D}
1733
1720
  Table Columns: ${y == null ? void 0 : y.map((w) => `${w.column_name} | ${w.data_type}`).join(", ")}
1734
- User SQL: ${M}
1735
- ${g && `Base Queries: ${JSON.stringify(g)} `}`, N = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
1736
- Visual Query Syntax: ${dl}`, { data: D, isLoading: E, isFetching: x, isError: v, refetch: f } = Ce({
1721
+ User SQL: ${L}
1722
+ ${j && `Base Queries: ${JSON.stringify(j)} `}`, N = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
1723
+ Visual Query Syntax: ${dl}`, { data: F, isLoading: E, isFetching: x, isError: v, refetch: f } = Ce({
1737
1724
  queryKey: ["ai-query"],
1738
- queryFn: () => De(
1725
+ queryFn: () => Fe(
1739
1726
  "https://semaphor.cloud/api/v1/ai",
1740
1727
  (c == null ? void 0 : c.accessToken) || "",
1741
1728
  {
@@ -1747,44 +1734,44 @@ function ul({
1747
1734
  });
1748
1735
  function k(w) {
1749
1736
  if (w.toLowerCase().includes("bar"))
1750
- j("bar");
1737
+ g("bar");
1751
1738
  else if (w.toLowerCase().includes("line"))
1752
- j("line");
1739
+ g("line");
1753
1740
  else if (w.toLowerCase().includes("bubble"))
1754
- j("bubble");
1741
+ g("bubble");
1755
1742
  else if (w.toLowerCase().includes("scatter"))
1756
- j("scatter");
1743
+ g("scatter");
1757
1744
  else if (w.toLowerCase().includes("stacked"))
1758
- j("stackedBar");
1745
+ g("stackedBar");
1759
1746
  else if (w.toLowerCase().includes("pie"))
1760
- j("pie");
1747
+ g("pie");
1761
1748
  else if (w.toLowerCase().includes("donut") || w.toLowerCase().includes("doughnut"))
1762
- j("doughnut");
1749
+ g("doughnut");
1763
1750
  else if (w.toLowerCase().includes("radar"))
1764
- j("radar");
1751
+ g("radar");
1765
1752
  else
1766
- return j("bar"), !1;
1753
+ return g("bar"), !1;
1767
1754
  return !0;
1768
1755
  }
1769
1756
  se(() => {
1770
- D && I((w) => [...w, { role: "ai", content: D.response }]);
1771
- }, [D]), se(() => {
1757
+ F && O((w) => [...w, { role: "ai", content: F.response }]);
1758
+ }, [F]), se(() => {
1772
1759
  const w = setTimeout(() => {
1773
1760
  var H;
1774
1761
  o.current && (o.current.scroll({
1775
1762
  top: o.current.scrollHeight,
1776
1763
  behavior: "smooth"
1777
- }), (H = i.current) == null || H.focus());
1764
+ }), (H = u.current) == null || H.focus());
1778
1765
  }, 100);
1779
1766
  return () => clearTimeout(w);
1780
1767
  }, [C]);
1781
1768
  function S() {
1782
- a && (I((w) => [...w, { role: "user", content: a }]), k(a) && u(!0), n(""), f());
1769
+ a && (O((w) => [...w, { role: "user", content: a }]), k(a) && d(!0), n(""), f());
1783
1770
  }
1784
1771
  se(() => {
1785
- l && (S(), d(!1));
1786
- }, [l, d]);
1787
- const R = {
1772
+ l && (S(), r(!1));
1773
+ }, [l, r]);
1774
+ const q = {
1788
1775
  //seleect a darker color
1789
1776
  // color: '#000',
1790
1777
  fontFamily: "Arial, sans-serif",
@@ -1811,18 +1798,18 @@ function ul({
1811
1798
  listStyleType: "disc"
1812
1799
  }, Z = {
1813
1800
  // Override how paragraphs are rendered
1814
- p: ({ node: w, ...H }) => /* @__PURE__ */ e.jsx("p", { style: R, ...H }),
1801
+ p: ({ node: w, ...H }) => /* @__PURE__ */ e.jsx("p", { style: q, ...H }),
1815
1802
  code: ({ node: w, ...H }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...H }),
1816
1803
  pre: ({ node: w, ...H }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: $, children: [
1817
1804
  /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: H.children }),
1818
1805
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
1819
- /* @__PURE__ */ e.jsx(O, { onClick: B, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ft, {}) }),
1806
+ /* @__PURE__ */ e.jsx(z, { onClick: B, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ft, {}) }),
1820
1807
  /* @__PURE__ */ e.jsx(
1821
- O,
1808
+ z,
1822
1809
  {
1823
1810
  onClick: (ae) => {
1824
- const T = B(ae);
1825
- T && (t(!1), b(T), h(!0));
1811
+ const M = B(ae);
1812
+ M && (t(!1), b(M), h(!0));
1826
1813
  },
1827
1814
  size: "sm",
1828
1815
  variant: "outline",
@@ -1838,7 +1825,7 @@ function ul({
1838
1825
  const H = w.currentTarget.closest("pre");
1839
1826
  if (!H) return;
1840
1827
  const ae = H.textContent || H.innerText;
1841
- return navigator.clipboard.writeText(ae).then(() => console.log("Text copied to clipboard")).catch((T) => console.error("Error in copying text: ", T)), ae;
1828
+ return navigator.clipboard.writeText(ae).then(() => console.log("Text copied to clipboard")).catch((M) => console.error("Error in copying text: ", M)), ae;
1842
1829
  }
1843
1830
  function X() {
1844
1831
  return C == null ? void 0 : C.map((w, H) => w.role === "user" ? /* @__PURE__ */ e.jsxs(
@@ -1856,14 +1843,14 @@ function ul({
1856
1843
  {
1857
1844
  className: "w-full overflow-auto py-1",
1858
1845
  components: Z,
1859
- children: D == null ? void 0 : D.response.replace(/DuckDB/gi, "Semaphor")
1846
+ children: F == null ? void 0 : F.response.replace(/DuckDB/gi, "Semaphor")
1860
1847
  },
1861
1848
  H
1862
1849
  ) : /* @__PURE__ */ e.jsx("div", {}, H));
1863
1850
  }
1864
- return /* @__PURE__ */ e.jsxs(Fs, { open: s, onOpenChange: t, children: [
1865
- /* @__PURE__ */ e.jsx(Ds, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1866
- O,
1851
+ return /* @__PURE__ */ e.jsxs(Ds, { open: s, onOpenChange: t, children: [
1852
+ /* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1853
+ z,
1867
1854
  {
1868
1855
  size: "sm",
1869
1856
  className: "w-full justify-start border font-normal text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",
@@ -1872,11 +1859,11 @@ function ul({
1872
1859
  }
1873
1860
  ) }),
1874
1861
  /* @__PURE__ */ e.jsxs(
1875
- Ms,
1862
+ Ls,
1876
1863
  {
1877
1864
  className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]",
1878
1865
  children: [
1879
- /* @__PURE__ */ e.jsxs(Ts, { children: [
1866
+ /* @__PURE__ */ e.jsxs(Ms, { children: [
1880
1867
  /* @__PURE__ */ e.jsx(Es, { children: "Assistant" }),
1881
1868
  /* @__PURE__ */ e.jsx(As, { children: "What can I help you with?" })
1882
1869
  ] }),
@@ -1896,7 +1883,7 @@ function ul({
1896
1883
  ja,
1897
1884
  {
1898
1885
  autoFocus: !0,
1899
- ref: i,
1886
+ ref: u,
1900
1887
  onKeyDown: (w) => {
1901
1888
  w.key === "Enter" && !w.shiftKey && (w.preventDefault(), n(""), S());
1902
1889
  },
@@ -1915,7 +1902,7 @@ function ul({
1915
1902
  ),
1916
1903
  " ",
1917
1904
  /* @__PURE__ */ e.jsx(
1918
- O,
1905
+ z,
1919
1906
  {
1920
1907
  className: "h-8",
1921
1908
  size: "sm",
@@ -1943,9 +1930,9 @@ function hl(s, t) {
1943
1930
  if (s == null) return {};
1944
1931
  var a = xl(s, t), n, l;
1945
1932
  if (Object.getOwnPropertySymbols) {
1946
- var d = Object.getOwnPropertySymbols(s);
1947
- for (l = 0; l < d.length; l++)
1948
- n = d[l], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(s, n) && (a[n] = s[n]);
1933
+ var r = Object.getOwnPropertySymbols(s);
1934
+ for (l = 0; l < r.length; l++)
1935
+ n = r[l], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(s, n) && (a[n] = s[n]);
1949
1936
  }
1950
1937
  return a;
1951
1938
  }
@@ -2022,13 +2009,13 @@ function jl(s) {
2022
2009
  var {
2023
2010
  attr: n,
2024
2011
  size: l,
2025
- title: d
2026
- } = s, i = hl(s, ml), o = l || a.size || "1em", c;
2012
+ title: r
2013
+ } = s, u = hl(s, ml), o = l || a.size || "1em", c;
2027
2014
  return a.className && (c = a.className), s.className && (c = (c ? c + " " : "") + s.className), /* @__PURE__ */ ke.createElement("svg", ms({
2028
2015
  stroke: "currentColor",
2029
2016
  fill: "currentColor",
2030
2017
  strokeWidth: "0"
2031
- }, a.attr, n, i, {
2018
+ }, a.attr, n, u, {
2032
2019
  className: c,
2033
2020
  style: hs(hs({
2034
2021
  color: s.color || a.color
@@ -2036,7 +2023,7 @@ function jl(s) {
2036
2023
  height: o,
2037
2024
  width: o,
2038
2025
  xmlns: "http://www.w3.org/2000/svg"
2039
- }), d && /* @__PURE__ */ ke.createElement("title", null, d), s.children);
2026
+ }), r && /* @__PURE__ */ ke.createElement("title", null, r), s.children);
2040
2027
  };
2041
2028
  return sa !== void 0 ? /* @__PURE__ */ ke.createElement(sa.Consumer, null, (a) => t(a)) : t(Va);
2042
2029
  }
@@ -2045,7 +2032,7 @@ function bl(s) {
2045
2032
  }
2046
2033
  function yl({ sql: s }) {
2047
2034
  return /* @__PURE__ */ e.jsxs(qs, { children: [
2048
- /* @__PURE__ */ e.jsx(Rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(jt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
2035
+ /* @__PURE__ */ e.jsx(Rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(jt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
2049
2036
  /* @__PURE__ */ e.jsx(
2050
2037
  _s,
2051
2038
  {
@@ -2063,49 +2050,49 @@ function vl() {
2063
2050
  const [s, t] = V({
2064
2051
  queryKey: [],
2065
2052
  queryData: null
2066
- }), { theme: a } = bt(), n = yt(), l = ks(), d = vt(), [i, o] = V(!1), [c, p] = V(!1), [u, b] = V(!1), [g, h] = V(""), [j, C] = V(!1), I = z((r) => r.selectedSheetId);
2067
- z((r) => r.dashboard.baseQueries);
2068
- const y = m((r) => r.card), M = z((r) => r.theme), F = m((r) => r.isShowingVisual);
2069
- z((r) => r.onAcceptChanges);
2053
+ }), { theme: a } = bt(), n = yt(), l = zs(), r = vt(), [u, o] = V(!1), [c, p] = V(!1), [d, b] = V(!1), [j, h] = V(""), [g, C] = V(!1), O = I((i) => i.selectedSheetId);
2054
+ I((i) => i.dashboard.baseQueries);
2055
+ const y = m((i) => i.card), L = I((i) => i.theme), D = m((i) => i.isShowingVisual);
2056
+ I((i) => i.onAcceptChanges);
2070
2057
  const A = m(
2071
- (r) => r.selectedConnectionId
2058
+ (i) => i.selectedConnectionId
2072
2059
  ), N = m(
2073
- (r) => r.selectedDatabaseName
2074
- ), D = m(
2075
- (r) => r.selectedDatamodelId
2060
+ (i) => i.selectedDatabaseName
2061
+ ), F = m(
2062
+ (i) => i.selectedDatamodelId
2076
2063
  ), E = m(
2077
- (r) => r.selectedSchemaName
2064
+ (i) => i.selectedSchemaName
2078
2065
  );
2079
- z(
2080
- (r) => r.actions.updateFrameCard
2066
+ I(
2067
+ (i) => i.actions.updateFrameCard
2081
2068
  );
2082
- const x = m((r) => r.selectedTableName), v = m((r) => r.card.sql), f = m((r) => r.card.python), k = m((r) => r.frame), S = z((r) => r.dashboard.filters), R = z((r) => r.filterValues), $ = S == null ? void 0 : S.filter(
2083
- (r) => r.sheetId === I || !r.sheetId
2084
- ), U = R == null ? void 0 : R.filter(
2085
- (r) => ($ == null ? void 0 : $.some((le) => le.id === r.filterId)) || r.filterId.endsWith(I)
2086
- ), Z = m((r) => r.applyFilters), {
2069
+ const x = m((i) => i.selectedTableName), v = m((i) => i.card.sql), f = m((i) => i.card.python), k = m((i) => i.frame), S = I((i) => i.dashboard.filters), q = I((i) => i.filterValues), $ = S == null ? void 0 : S.filter(
2070
+ (i) => i.sheetId === O || !i.sheetId
2071
+ ), U = q == null ? void 0 : q.filter(
2072
+ (i) => ($ == null ? void 0 : $.some((le) => le.id === i.filterId)) || i.filterId.endsWith(O)
2073
+ ), Z = m((i) => i.applyFilters), {
2087
2074
  setCardCustomCfg: B,
2088
2075
  setQueryResultColumns: X,
2089
2076
  setFilterValues: w,
2090
2077
  setCardSql: H,
2091
2078
  setCard: ae,
2092
- setCardPython: T,
2093
- setQueryError: L,
2079
+ setCardPython: M,
2080
+ setQueryError: T,
2094
2081
  setPythonStdOut: te,
2095
2082
  setCardPreferences: P
2096
- } = m((r) => r.actions), ee = m((r) => r.onSave);
2083
+ } = m((i) => i.actions), ee = m((i) => i.onSave);
2097
2084
  m(
2098
- (r) => r.actions.setApplyFilters
2085
+ (i) => i.actions.setApplyFilters
2099
2086
  );
2100
- const ne = m((r) => r.onClose), Ee = m((r) => r.actions.setSqlGen), Ie = m((r) => r.runSql), je = m((r) => r.actions.setRunSql);
2101
- m((r) => r.actions.setCardCfg);
2087
+ const ne = m((i) => i.onClose), Ee = m((i) => i.actions.setSqlGen), Ie = m((i) => i.runSql), je = m((i) => i.actions.setRunSql);
2088
+ m((i) => i.actions.setCardCfg);
2102
2089
  const be = m(
2103
- (r) => r.actions.setIsSqlRunning
2090
+ (i) => i.actions.setIsSqlRunning
2104
2091
  ), {
2105
2092
  data: W,
2106
2093
  isLoading: oe,
2107
2094
  isFetching: ce,
2108
- isSuccess: Fe,
2095
+ isSuccess: De,
2109
2096
  isError: Ae,
2110
2097
  error: $e,
2111
2098
  queryKey: Pe,
@@ -2116,8 +2103,8 @@ function vl() {
2116
2103
  position: "top-center",
2117
2104
  richColors: !0
2118
2105
  }), te((W == null ? void 0 : W.output) || ""), W.records.length > 0)) {
2119
- const { dimensionKeys: r } = Ss(W.records);
2120
- X(r);
2106
+ const { dimensionKeys: i } = ws(W.records);
2107
+ X(i);
2121
2108
  }
2122
2109
  }, [
2123
2110
  W,
@@ -2125,66 +2112,66 @@ function vl() {
2125
2112
  X,
2126
2113
  te
2127
2114
  ]), se(() => {
2128
- (oe || ce) && be(!0), (Ae || Fe) && be(!1), Ae ? (L($e.message), X([]), te("")) : L("");
2115
+ (oe || ce) && be(!0), (Ae || De) && be(!1), Ae ? (T($e.message), X([]), te("")) : T("");
2129
2116
  }, [
2130
2117
  oe,
2131
2118
  ce,
2132
2119
  W,
2133
2120
  te,
2134
2121
  Ae,
2135
- Fe,
2122
+ De,
2136
2123
  be,
2137
2124
  X,
2138
- L,
2125
+ T,
2139
2126
  $e
2140
2127
  ]), se(() => {
2141
2128
  Ie && (Ve(), je(!1));
2142
2129
  }, [Ie, Ve, je]);
2143
- function ys() {
2144
- const r = n.getQueryData(Pe);
2130
+ function vs() {
2131
+ const i = n.getQueryData(Pe);
2145
2132
  s.queryData || t({
2146
2133
  queryKey: Pe,
2147
- queryData: r
2134
+ queryData: i
2148
2135
  }), n.setQueryData(Pe, null), H(""), Ee({}), B(""), P({});
2149
2136
  }
2150
- const Xe = (r) => {
2151
- l.current = r;
2137
+ const Xe = (i) => {
2138
+ l.current = i;
2152
2139
  };
2153
- function Ze(r, le) {
2154
- if (r.length === 0)
2140
+ function Ze(i, le) {
2141
+ if (i.length === 0)
2155
2142
  return "";
2156
2143
  if (le) {
2157
- const ye = r.find((ve) => ve.id === le);
2144
+ const ye = i.find((ve) => ve.id === le);
2158
2145
  if (ye) {
2159
2146
  const ve = ye.tabTitle;
2160
2147
  if (ve == "All__Header")
2161
- return r[0].id;
2148
+ return i[0].id;
2162
2149
  if (ve && ve.endsWith("__Header")) {
2163
- const Za = ve.split("__")[0], Js = r.find(
2150
+ const Za = ve.split("__")[0], Js = i.find(
2164
2151
  (et) => et.tabTitle === Za
2165
2152
  );
2166
- return Js ? Js.id : r[0].id;
2153
+ return Js ? Js.id : i[0].id;
2167
2154
  }
2168
2155
  return le;
2169
2156
  }
2170
2157
  }
2171
- return r[0].id;
2158
+ return i[0].id;
2172
2159
  }
2173
2160
  function es() {
2174
- let r = v;
2175
- v && !v.includes("{{") && (r = ol(v), H(r));
2161
+ let i = v;
2162
+ v && !v.includes("{{") && (i = ol(v), H(i));
2176
2163
  const le = {
2177
2164
  ...y,
2178
2165
  lastSelectedSchema: E,
2179
- lastSelectedDatamodelId: D,
2166
+ lastSelectedDatamodelId: F,
2180
2167
  lastSelectedDatabase: N,
2181
2168
  lastSelectedTable: x,
2182
2169
  connectionId: A,
2183
- type: F ? y.type : "table",
2184
- sql: r,
2185
- customCfg: F ? y.customCfg : null
2170
+ type: D ? y.type : "table",
2171
+ sql: i,
2172
+ customCfg: D ? y.customCfg : null
2186
2173
  }, ye = k.cards.map(
2187
- (vs) => vs.id === y.id ? le : vs
2174
+ (Cs) => Cs.id === y.id ? le : Cs
2188
2175
  ), ve = {
2189
2176
  ...k,
2190
2177
  cards: ye,
@@ -2193,13 +2180,13 @@ function vl() {
2193
2180
  ee == null || ee(ve);
2194
2181
  }
2195
2182
  function ss() {
2196
- const { queryKey: r, queryData: le } = s;
2197
- r && le && n.setQueryData(r, le), ne == null || ne();
2183
+ const { queryKey: i, queryData: le } = s;
2184
+ i && le && n.setQueryData(i, le), ne == null || ne();
2198
2185
  }
2199
2186
  se(() => {
2200
- if (!d) return;
2201
- const r = l.current, le = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ye = M === "system" ? le : M;
2202
- return d.editor.defineTheme("default", {
2187
+ if (!r) return;
2188
+ const i = l.current, le = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ye = L === "system" ? le : L;
2189
+ return r.editor.defineTheme("default", {
2203
2190
  // base: theme === 'light' ? 'hc-light' : 'vs-dark',
2204
2191
  base: ye === "light" ? "vs" : "vs-dark",
2205
2192
  inherit: !0,
@@ -2211,14 +2198,14 @@ function vl() {
2211
2198
  // ? '#ffffff'
2212
2199
  // : getCssVariableValue('--semaphor-background'),
2213
2200
  }
2214
- }), d.editor.setTheme("default"), r && d && r.addCommand(
2215
- d.KeyMod.Shift | d.KeyCode.Enter,
2201
+ }), r.editor.setTheme("default"), i && r && i.addCommand(
2202
+ r.KeyMod.Shift | r.KeyCode.Enter,
2216
2203
  function() {
2217
2204
  return Ve(), !1;
2218
2205
  }
2219
2206
  ), () => {
2220
2207
  };
2221
- }, [a, M, d]);
2208
+ }, [a, L, r]);
2222
2209
  function as() {
2223
2210
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2224
2211
  c && /* @__PURE__ */ e.jsx(
@@ -2241,10 +2228,10 @@ function vl() {
2241
2228
  Ge,
2242
2229
  {
2243
2230
  theme: "default",
2244
- onChange: (r) => {
2245
- if (r)
2231
+ onChange: (i) => {
2232
+ if (i)
2246
2233
  try {
2247
- JSON.parse(r), w(JSON.parse(r));
2234
+ JSON.parse(i), w(JSON.parse(i));
2248
2235
  } catch {
2249
2236
  }
2250
2237
  },
@@ -2267,7 +2254,7 @@ function vl() {
2267
2254
  renderLineHighlight: "none"
2268
2255
  }
2269
2256
  },
2270
- M
2257
+ L
2271
2258
  )
2272
2259
  ] })
2273
2260
  }
@@ -2299,7 +2286,7 @@ function vl() {
2299
2286
  {
2300
2287
  id: "1",
2301
2288
  order: 1,
2302
- defaultSize: i ? 20 : 100,
2289
+ defaultSize: u ? 20 : 100,
2303
2290
  className: "relative flex grow",
2304
2291
  children: [
2305
2292
  /* @__PURE__ */ e.jsx(
@@ -2312,8 +2299,8 @@ function vl() {
2312
2299
  {
2313
2300
  theme: "default",
2314
2301
  className: "pt-3",
2315
- onChange: (r) => {
2316
- H(r);
2302
+ onChange: (i) => {
2303
+ H(i);
2317
2304
  },
2318
2305
  value: v,
2319
2306
  options: {
@@ -2334,11 +2321,11 @@ function vl() {
2334
2321
  )
2335
2322
  }
2336
2323
  ),
2337
- i && /* @__PURE__ */ e.jsx("code", { className: "absolute right-6 top-3 text-sm text-muted-foreground/70", children: "sql" })
2324
+ u && /* @__PURE__ */ e.jsx("code", { className: "absolute right-6 top-3 text-sm text-muted-foreground/70", children: "sql" })
2338
2325
  ]
2339
2326
  }
2340
2327
  ),
2341
- i && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2328
+ u && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2342
2329
  /* @__PURE__ */ e.jsx(ds, { withHandle: !0, className: "border" }),
2343
2330
  /* @__PURE__ */ e.jsxs(
2344
2331
  Ne,
@@ -2358,8 +2345,8 @@ function vl() {
2358
2345
  {
2359
2346
  className: "pt-3",
2360
2347
  theme: "default",
2361
- onChange: (r) => {
2362
- T(r && r.trim() || "");
2348
+ onChange: (i) => {
2349
+ M(i && i.trim() || "");
2363
2350
  },
2364
2351
  value: f || St,
2365
2352
  options: {
@@ -2416,7 +2403,7 @@ function vl() {
2416
2403
  children: [
2417
2404
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
2418
2405
  /* @__PURE__ */ e.jsxs(
2419
- O,
2406
+ z,
2420
2407
  {
2421
2408
  title: "Shift + Enter",
2422
2409
  disabled: oe || ce,
@@ -2442,9 +2429,9 @@ function vl() {
2442
2429
  }
2443
2430
  ),
2444
2431
  /* @__PURE__ */ e.jsxs(
2445
- O,
2432
+ z,
2446
2433
  {
2447
- onClick: ys,
2434
+ onClick: vs,
2448
2435
  className: "",
2449
2436
  size: "sm",
2450
2437
  variant: "outline",
@@ -2457,8 +2444,8 @@ function vl() {
2457
2444
  /* @__PURE__ */ e.jsx(
2458
2445
  fa,
2459
2446
  {
2460
- pressed: i,
2461
- onPressedChange: (r) => o(r),
2447
+ pressed: u,
2448
+ onPressedChange: (i) => o(i),
2462
2449
  className: "",
2463
2450
  size: "sm",
2464
2451
  variant: "outline",
@@ -2468,19 +2455,19 @@ function vl() {
2468
2455
  /* @__PURE__ */ e.jsx(
2469
2456
  ul,
2470
2457
  {
2471
- open: u,
2458
+ open: d,
2472
2459
  setOpen: b,
2473
- userInput: g,
2474
- triggerAIRun: j,
2460
+ userInput: j,
2461
+ triggerAIRun: g,
2475
2462
  setTriggerAIRun: C,
2476
- setUserInput: (r) => h(r)
2463
+ setUserInput: (i) => h(i)
2477
2464
  }
2478
2465
  )
2479
2466
  ] }),
2480
2467
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2481
2468
  (W == null ? void 0 : W.sql) && /* @__PURE__ */ e.jsx(yl, { sql: W.sql }),
2482
2469
  /* @__PURE__ */ e.jsxs(
2483
- O,
2470
+ z,
2484
2471
  {
2485
2472
  onClick: ss,
2486
2473
  className: "w-full",
@@ -2493,7 +2480,7 @@ function vl() {
2493
2480
  }
2494
2481
  ),
2495
2482
  /* @__PURE__ */ e.jsxs(
2496
- O,
2483
+ z,
2497
2484
  {
2498
2485
  onClick: es,
2499
2486
  size: "sm",
@@ -2514,7 +2501,7 @@ function vl() {
2514
2501
  );
2515
2502
  }
2516
2503
  function Cl({ data: s }) {
2517
- var i;
2504
+ var u;
2518
2505
  const [t, a] = ke.useState([]), l = Object.keys(s[0]).map((o) => ({
2519
2506
  // header: key,
2520
2507
  accessorKey: o,
@@ -2532,20 +2519,20 @@ function Cl({ data: s }) {
2532
2519
  }
2533
2520
  ) });
2534
2521
  }
2535
- })), d = zt({
2522
+ })), r = zt({
2536
2523
  data: s,
2537
2524
  columns: l,
2538
- getCoreRowModel: Dt(),
2539
- getPaginationRowModel: Lt(),
2525
+ getCoreRowModel: Ft(),
2526
+ getPaginationRowModel: Tt(),
2540
2527
  onSortingChange: a,
2541
- getSortedRowModel: Mt(),
2528
+ getSortedRowModel: Lt(),
2542
2529
  manualPagination: !0,
2543
2530
  state: {
2544
2531
  sorting: t
2545
2532
  }
2546
2533
  });
2547
2534
  return /* @__PURE__ */ e.jsx("div", { className: "font-mono text-xs text-foreground/95", children: /* @__PURE__ */ e.jsxs("table", { className: "w-full", children: [
2548
- /* @__PURE__ */ e.jsx(Ot, { children: d.getHeaderGroups().map((o) => /* @__PURE__ */ e.jsx(Cs, { children: o.headers.map((c) => /* @__PURE__ */ e.jsx(
2535
+ /* @__PURE__ */ e.jsx(Ot, { children: r.getHeaderGroups().map((o) => /* @__PURE__ */ e.jsx(Ns, { children: o.headers.map((c) => /* @__PURE__ */ e.jsx(
2549
2536
  It,
2550
2537
  {
2551
2538
  className: "sticky top-0 h-11 bg-muted font-semibold",
@@ -2556,70 +2543,70 @@ function Cl({ data: s }) {
2556
2543
  },
2557
2544
  c.id
2558
2545
  )) }, o.id)) }),
2559
- /* @__PURE__ */ e.jsx(Ft, { children: (i = d.getRowModel().rows) != null && i.length ? d.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
2560
- Cs,
2546
+ /* @__PURE__ */ e.jsx(Dt, { children: (u = r.getRowModel().rows) != null && u.length ? r.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
2547
+ Ns,
2561
2548
  {
2562
2549
  className: "whitespace-nowrap py-2",
2563
2550
  "data-state": o.getIsSelected() && "selected",
2564
2551
  children: o.getVisibleCells().map((c) => /* @__PURE__ */ e.jsx(Ys, { className: "py-3", children: Ws(c.column.columnDef.cell, c.getContext()) }, c.id))
2565
2552
  },
2566
2553
  o.id
2567
- )) : /* @__PURE__ */ e.jsx(Cs, { children: /* @__PURE__ */ e.jsx(Ys, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
2554
+ )) : /* @__PURE__ */ e.jsx(Ns, { children: /* @__PURE__ */ e.jsx(Ys, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
2568
2555
  ] }) });
2569
2556
  }
2570
2557
  function Nl({ card: s }) {
2571
- var y, M, F, A, N, D, E, x, v, f, k;
2558
+ var y, L, D, A, N, F, E, x, v, f, k;
2572
2559
  const [t, a] = V(!1), [n, l] = V(
2573
2560
  []
2574
- ), { authToken: d } = Oe(), i = Tt(d == null ? void 0 : d.accessToken), o = z((S) => S.themeStyle), c = {
2575
- colors: ((M = (y = o == null ? void 0 : o.chart) == null ? void 0 : y.dataset) == null ? void 0 : M.backgroundColor) || []
2561
+ ), { authToken: r } = Oe(), u = Mt(r == null ? void 0 : r.accessToken), o = I((S) => S.themeStyle), c = {
2562
+ colors: ((L = (y = o == null ? void 0 : o.chart) == null ? void 0 : y.dataset) == null ? void 0 : L.backgroundColor) || []
2576
2563
  };
2577
- (F = s.customCardPreferences) != null && F.inputData;
2578
- const { getCard: p } = ba(((A = s.customCardPreferences) == null ? void 0 : A.url) || ""), u = ((N = s.customCardPreferences) == null ? void 0 : N.visualType) || "single", b = m((S) => S.frame);
2564
+ (D = s.customCardPreferences) != null && D.inputData;
2565
+ const { getCard: p } = ba(((A = s.customCardPreferences) == null ? void 0 : A.url) || ""), d = ((N = s.customCardPreferences) == null ? void 0 : N.visualType) || "single", b = m((S) => S.frame);
2579
2566
  ie();
2580
- const { data: g } = Re(s), h = Nn((S, R) => {
2567
+ const { data: j } = Re(s), h = Sn((S, q) => {
2581
2568
  l(($) => ({
2582
2569
  ...$,
2583
- [S]: R
2570
+ [S]: q
2584
2571
  }));
2585
2572
  }, []);
2586
- if (!((D = s.customCardPreferences) != null && D.componentName))
2573
+ if (!((F = s.customCardPreferences) != null && F.componentName))
2587
2574
  return null;
2588
- const j = p(
2575
+ const g = p(
2589
2576
  (E = s.customCardPreferences) == null ? void 0 : E.componentName
2590
2577
  );
2591
2578
  function C(S) {
2592
2579
  a(S);
2593
2580
  }
2594
- const I = Object.keys(
2581
+ const O = Object.keys(
2595
2582
  ((x = s.customCardPreferences) == null ? void 0 : x.dataInputCardIds) || {}
2596
2583
  ).map((S) => {
2597
2584
  var U, Z, B;
2598
- const R = (Z = (U = s.customCardPreferences) == null ? void 0 : U.dataInputCardIds) == null ? void 0 : Z[S].cardId, $ = (B = b == null ? void 0 : b.cards) == null ? void 0 : B.find((X) => X.id === R);
2585
+ const q = (Z = (U = s.customCardPreferences) == null ? void 0 : U.dataInputCardIds) == null ? void 0 : Z[S].cardId, $ = (B = b == null ? void 0 : b.cards) == null ? void 0 : B.find((X) => X.id === q);
2599
2586
  return $ || null;
2600
2587
  });
2601
2588
  return /* @__PURE__ */ e.jsx("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs(
2602
- Sn,
2589
+ wn,
2603
2590
  {
2604
2591
  fallback: /* @__PURE__ */ e.jsx(e.Fragment, {}),
2605
2592
  children: [
2606
- j && u === "single" && /* @__PURE__ */ e.jsx(
2607
- j,
2593
+ g && d === "single" && /* @__PURE__ */ e.jsx(
2594
+ g,
2608
2595
  {
2609
- params: i,
2596
+ params: u,
2610
2597
  theme: c,
2611
2598
  settings: (v = s.customCardPreferences) == null ? void 0 : v.settings,
2612
2599
  onDataChange: h,
2613
- data: (g == null ? void 0 : g.records) || []
2600
+ data: (j == null ? void 0 : j.records) || []
2614
2601
  }
2615
2602
  ),
2616
- j && u === "multiple" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2603
+ g && d === "multiple" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2617
2604
  Object.keys(
2618
2605
  ((f = s.customCardPreferences) == null ? void 0 : f.dataInputCardIds) || {}
2619
2606
  ).map((S) => {
2620
2607
  var U, Z, B;
2621
- const R = (Z = (U = s.customCardPreferences) == null ? void 0 : U.dataInputCardIds) == null ? void 0 : Z[S].cardId, $ = (B = b == null ? void 0 : b.cards) == null ? void 0 : B.find(
2622
- (X) => X.id === R
2608
+ const q = (Z = (U = s.customCardPreferences) == null ? void 0 : U.dataInputCardIds) == null ? void 0 : Z[S].cardId, $ = (B = b == null ? void 0 : b.cards) == null ? void 0 : B.find(
2609
+ (X) => X.id === q
2623
2610
  );
2624
2611
  if ($)
2625
2612
  return /* @__PURE__ */ e.jsx(
@@ -2634,17 +2621,17 @@ function Nl({ card: s }) {
2634
2621
  );
2635
2622
  }),
2636
2623
  /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsx(
2637
- j,
2624
+ g,
2638
2625
  {
2639
2626
  theme: c,
2640
2627
  onDataChange: h,
2641
- settings: I.map(
2628
+ settings: O.map(
2642
2629
  (S) => {
2643
- var R;
2644
- return (R = S == null ? void 0 : S.customCardPreferences) == null ? void 0 : R.settings;
2630
+ var q;
2631
+ return (q = S == null ? void 0 : S.customCardPreferences) == null ? void 0 : q.settings;
2645
2632
  }
2646
2633
  ),
2647
- data: I.map((S) => S != null && S.id ? n == null ? void 0 : n[S.id] : [])
2634
+ data: O.map((S) => S != null && S.id ? n == null ? void 0 : n[S.id] : [])
2648
2635
  }
2649
2636
  ) })
2650
2637
  ] })
@@ -2659,10 +2646,10 @@ function Ra({
2659
2646
  className: s,
2660
2647
  ...t
2661
2648
  }) {
2662
- var I;
2663
- const a = m((y) => y.card), n = ((I = a.customCardPreferences) == null ? void 0 : I.showCardHeader) ?? !0, l = m((y) => y.frame), d = z((y) => y.dashboard.filters);
2649
+ var O;
2650
+ const a = m((y) => y.card), n = ((O = a.customCardPreferences) == null ? void 0 : O.showCardHeader) ?? !0, l = m((y) => y.frame), r = I((y) => y.dashboard.filters);
2664
2651
  m((y) => y.actions.setRunSql);
2665
- const { updateFilter: i } = Is(), o = d == null ? void 0 : d.find((y) => y.id === l.filterId), { data: c, isLoading: p, isFetching: u } = Re(a), { setCard: b } = ie(), { data: g } = Hs(a);
2652
+ const { updateFilter: u } = xs(), o = r == null ? void 0 : r.find((y) => y.id === l.filterId), { data: c, isLoading: p, isFetching: d } = Re(a), { setCard: b } = ie(), { data: j } = Hs(a);
2666
2653
  if (!a.id) return null;
2667
2654
  let h;
2668
2655
  c != null && c.records && (c == null ? void 0 : c.records.length) > 0 && (h = ya({
@@ -2671,20 +2658,20 @@ function Ra({
2671
2658
  cfg: a.cfg,
2672
2659
  customCfg: a.customCfg,
2673
2660
  preferences: a.preferences,
2674
- topoJson: g
2661
+ topoJson: j
2675
2662
  }));
2676
- function j(y) {
2663
+ function g(y) {
2677
2664
  return /* @__PURE__ */ e.jsx(Nl, { card: y });
2678
2665
  }
2679
2666
  function C() {
2680
2667
  var y;
2681
- if (c != null && c.records && (c == null ? void 0 : c.records.length) === 0 && !p && !u)
2668
+ if (c != null && c.records && (c == null ? void 0 : c.records.length) === 0 && !p && !d)
2682
2669
  return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-2", children: [
2683
2670
  /* @__PURE__ */ e.jsx($t, { className: "size-8 text-muted-foreground" }),
2684
2671
  /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "No records to display" })
2685
2672
  ] });
2686
2673
  if (a.type === "custom")
2687
- return j(a);
2674
+ return g(a);
2688
2675
  if (!["table", "custom"].includes(a.type) && h)
2689
2676
  return /* @__PURE__ */ e.jsx(
2690
2677
  Pt,
@@ -2733,7 +2720,7 @@ function Ra({
2733
2720
  {
2734
2721
  className: "my-1",
2735
2722
  text: o.title || o.column,
2736
- onSave: (y) => i({ ...o, title: y }),
2723
+ onSave: (y) => u({ ...o, title: y }),
2737
2724
  children: /* @__PURE__ */ e.jsx(_, { children: o.title })
2738
2725
  }
2739
2726
  ),
@@ -2746,12 +2733,12 @@ function Ra({
2746
2733
  );
2747
2734
  }
2748
2735
  function Sl() {
2749
- const [s, t] = V(!1), [a, n] = V(""), [l, d] = V(""), [i, o] = V(""), [c, p] = V(""), u = m((N) => N.card), b = m(
2736
+ const [s, t] = V(!1), [a, n] = V(""), [l, r] = V(""), [u, o] = V(""), [c, p] = V(""), d = m((N) => N.card), b = m(
2750
2737
  (N) => N.card.customCfg
2751
- ), { data: g } = Re(u), { data: h } = Hs(u), { setCardCustomCfg: j, setCustomVisualCode: C } = ie();
2752
- function I(N) {
2738
+ ), { data: j } = Re(d), { data: h } = Hs(d), { setCardCustomCfg: g, setCustomVisualCode: C } = ie();
2739
+ function O(N) {
2753
2740
  var x, v;
2754
- const D = {
2741
+ const F = {
2755
2742
  ...N,
2756
2743
  data: {
2757
2744
  ...N == null ? void 0 : N.data,
@@ -2761,43 +2748,43 @@ function Sl() {
2761
2748
  }))
2762
2749
  }
2763
2750
  };
2764
- return JSON.stringify(D, null, 1);
2751
+ return JSON.stringify(F, null, 1);
2765
2752
  }
2766
2753
  function y() {
2767
- var D, E;
2768
- if (!(g != null && g.records) || (g == null ? void 0 : g.records.length) === 0) return;
2754
+ var F, E;
2755
+ if (!(j != null && j.records) || (j == null ? void 0 : j.records.length) === 0) return;
2769
2756
  const N = ya({
2770
- data: g == null ? void 0 : g.records,
2771
- cardType: u.type,
2772
- cfg: u.cfg,
2773
- preferences: u.preferences,
2757
+ data: j == null ? void 0 : j.records,
2758
+ cardType: d.type,
2759
+ cfg: d.cfg,
2760
+ preferences: d.preferences,
2774
2761
  topoJson: h
2775
2762
  });
2776
- N && (n(JSON.stringify(N, null, 1)), (D = u == null ? void 0 : u.preferences) != null && D.customVisualCode && o((E = u == null ? void 0 : u.preferences) == null ? void 0 : E.customVisualCode), b && d(JSON.stringify(b, null, 1)));
2763
+ N && (n(JSON.stringify(N, null, 1)), (F = d == null ? void 0 : d.preferences) != null && F.customVisualCode && o((E = d == null ? void 0 : d.preferences) == null ? void 0 : E.customVisualCode), b && r(JSON.stringify(b, null, 1)));
2777
2764
  }
2778
- function M() {
2779
- if (i && C(i), !!l)
2765
+ function L() {
2766
+ if (u && C(u), !!l)
2780
2767
  try {
2781
2768
  const N = JSON.parse(l);
2782
- return N ? (j(N), p(""), d(""), N) : void 0;
2769
+ return N ? (g(N), p(""), r(""), N) : void 0;
2783
2770
  } catch (N) {
2784
2771
  console.log(N), p("Invalid JSON");
2785
2772
  }
2786
2773
  }
2787
- function F() {
2788
- d(""), j(null);
2774
+ function D() {
2775
+ r(""), g(null);
2789
2776
  }
2790
2777
  function A() {
2791
2778
  let N;
2792
2779
  if (b) {
2793
- const D = Xs.cloneDeep(u.cfg), E = Xs.merge(D, b);
2794
- return N = I(E), N;
2780
+ const F = Xs.cloneDeep(d.cfg), E = Xs.merge(F, b);
2781
+ return N = O(E), N;
2795
2782
  }
2796
- return a ? (N = I(JSON.parse(a)), N) : "";
2783
+ return a ? (N = O(JSON.parse(a)), N) : "";
2797
2784
  }
2798
- return /* @__PURE__ */ e.jsxs(Fs, { open: s, onOpenChange: t, children: [
2799
- /* @__PURE__ */ e.jsx(Ds, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2800
- O,
2785
+ return /* @__PURE__ */ e.jsxs(Ds, { open: s, onOpenChange: t, children: [
2786
+ /* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2787
+ z,
2801
2788
  {
2802
2789
  onClick: y,
2803
2790
  className: ` ${b && "border-foreground/50 dark:border-foreground/70"}`,
@@ -2807,11 +2794,11 @@ function Sl() {
2807
2794
  }
2808
2795
  ) }),
2809
2796
  /* @__PURE__ */ e.jsxs(
2810
- Ms,
2797
+ Ls,
2811
2798
  {
2812
2799
  className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]",
2813
2800
  children: [
2814
- /* @__PURE__ */ e.jsxs(Ts, { className: "", children: [
2801
+ /* @__PURE__ */ e.jsxs(Ms, { className: "", children: [
2815
2802
  /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(Es, { children: "Customize Card" }) }),
2816
2803
  /* @__PURE__ */ e.jsxs(As, { children: [
2817
2804
  "See the configuration options and documentation",
@@ -2827,7 +2814,7 @@ function Sl() {
2827
2814
  ] })
2828
2815
  ] }),
2829
2816
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
2830
- /* @__PURE__ */ e.jsx(xs, { FallbackComponent: va, children: /* @__PURE__ */ e.jsx(Ra, { className: "w-1/2 rounded shadow-none" }) }),
2817
+ /* @__PURE__ */ e.jsx(ps, { FallbackComponent: va, children: /* @__PURE__ */ e.jsx(Ra, { className: "w-1/2 rounded shadow-none" }) }),
2831
2818
  /* @__PURE__ */ e.jsxs(Ca, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2832
2819
  /* @__PURE__ */ e.jsxs(Na, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2833
2820
  /* @__PURE__ */ e.jsxs(is, { value: "custom-config", children: [
@@ -2876,7 +2863,7 @@ function Sl() {
2876
2863
  },
2877
2864
  defaultLanguage: "json",
2878
2865
  value: A(),
2879
- onChange: (N) => d(N)
2866
+ onChange: (N) => r(N)
2880
2867
  }
2881
2868
  )
2882
2869
  }
@@ -2904,7 +2891,7 @@ function Sl() {
2904
2891
  renderLineHighlight: "none"
2905
2892
  },
2906
2893
  defaultLanguage: "javascript",
2907
- value: i,
2894
+ value: u,
2908
2895
  onChange: (N) => o(N || "")
2909
2896
  }
2910
2897
  )
@@ -2915,16 +2902,16 @@ function Sl() {
2915
2902
  /* @__PURE__ */ e.jsxs(la, { className: "flex items-center", children: [
2916
2903
  /* @__PURE__ */ e.jsx(_, { className: "mr-2 text-red-500", children: c }),
2917
2904
  /* @__PURE__ */ e.jsx(
2918
- O,
2905
+ z,
2919
2906
  {
2920
2907
  disabled: !b,
2921
- onClick: F,
2908
+ onClick: D,
2922
2909
  variant: "outline",
2923
2910
  children: "Reset"
2924
2911
  }
2925
2912
  ),
2926
- /* @__PURE__ */ e.jsx(O, { onClick: M, variant: "outline", children: "Apply" }),
2927
- /* @__PURE__ */ e.jsx(O, { onClick: () => t(!1), variant: "outline", children: "Close" })
2913
+ /* @__PURE__ */ e.jsx(z, { onClick: L, variant: "outline", children: "Apply" }),
2914
+ /* @__PURE__ */ e.jsx(z, { onClick: () => t(!1), variant: "outline", children: "Close" })
2928
2915
  ] })
2929
2916
  ]
2930
2917
  }
@@ -2959,8 +2946,8 @@ function Ja(s) {
2959
2946
  const [t, a] = V(null);
2960
2947
  return se(() => {
2961
2948
  s && (async () => {
2962
- const d = (await import("./lucide-react-DWPc-x9m.js"))[s];
2963
- a(d);
2949
+ const r = (await import("./lucide-react-DN-djCId.js"))[s];
2950
+ a(r);
2964
2951
  })();
2965
2952
  }, [s]), t;
2966
2953
  }
@@ -2978,10 +2965,10 @@ function wl({
2978
2965
  const [t, a] = V([]), { data: n } = Ka();
2979
2966
  return se(() => {
2980
2967
  (async () => {
2981
- var d;
2968
+ var r;
2982
2969
  if (n) {
2983
2970
  const o = (await Promise.all(
2984
- (d = n == null ? void 0 : n.plugins) == null ? void 0 : d.map(async (c) => (await Qt(c.value)).visuals.map((b) => ({
2971
+ (r = n == null ? void 0 : n.plugins) == null ? void 0 : r.map(async (c) => (await Qt(c.value)).visuals.map((b) => ({
2985
2972
  name: b.name,
2986
2973
  icon: b.icon,
2987
2974
  url: c.value
@@ -2992,14 +2979,14 @@ function wl({
2992
2979
  })();
2993
2980
  }, [n]), t.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2994
2981
  /* @__PURE__ */ e.jsx(we, { className: "my-2" }),
2995
- /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l, d) => /* @__PURE__ */ e.jsx(
2982
+ /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l, r) => /* @__PURE__ */ e.jsx(
2996
2983
  kl,
2997
2984
  {
2998
2985
  text: l.name,
2999
2986
  onClick: () => s("custom", l),
3000
2987
  icon: l.icon
3001
2988
  },
3002
- l.url + l.name + d
2989
+ l.url + l.name + r
3003
2990
  )) })
3004
2991
  ] });
3005
2992
  }
@@ -3009,13 +2996,13 @@ const kl = ({
3009
2996
  onClick: a
3010
2997
  }) => {
3011
2998
  const n = Ja(t || ""), l = s.charAt(0).toUpperCase();
3012
- return /* @__PURE__ */ e.jsx(O, { onClick: a, title: s, variant: "ghost", children: n ? /* @__PURE__ */ e.jsx(n, { className: "h-4 w-4" }) : l });
2999
+ return /* @__PURE__ */ e.jsx(z, { onClick: a, title: s, variant: "ghost", children: n ? /* @__PURE__ */ e.jsx(n, { className: "h-4 w-4" }) : l });
3013
3000
  };
3014
3001
  function zl() {
3015
- var u, b;
3016
- const [s, t] = V(!1), a = m((g) => g.card), n = a.type, { setCardType: l, setCardPreferences: d, setChartOrientation: i } = m((g) => g.actions), { setCardCustomCfg: o, setCustomCardPreferences: c } = ie();
3017
- function p(g, h) {
3018
- o(null), d({}), l(g), h && c({
3002
+ var d, b;
3003
+ const [s, t] = V(!1), a = m((j) => j.card), n = a.type, { setCardType: l, setCardPreferences: r, setChartOrientation: u } = m((j) => j.actions), { setCardCustomCfg: o, setCustomCardPreferences: c } = ie();
3004
+ function p(j, h) {
3005
+ o(null), r({}), l(j), h && c({
3019
3006
  type: "component",
3020
3007
  visualType: "single",
3021
3008
  url: h.url,
@@ -3023,20 +3010,20 @@ function zl() {
3023
3010
  icon: h.icon
3024
3011
  }), t(!1);
3025
3012
  }
3026
- return /* @__PURE__ */ e.jsxs(ps, { open: s, onOpenChange: t, children: [
3027
- /* @__PURE__ */ e.jsx(fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
3013
+ return /* @__PURE__ */ e.jsxs(fs, { open: s, onOpenChange: t, children: [
3014
+ /* @__PURE__ */ e.jsx(gs, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
3028
3015
  Ol,
3029
3016
  {
3030
3017
  className: "h-4 w-4",
3031
3018
  chartType: n,
3032
- customIcon: (u = a.customCardPreferences) == null ? void 0 : u.icon,
3019
+ customIcon: (d = a.customCardPreferences) == null ? void 0 : d.icon,
3033
3020
  componentName: (b = a.customCardPreferences) == null ? void 0 : b.componentName
3034
3021
  }
3035
3022
  ) }) }),
3036
- /* @__PURE__ */ e.jsxs(gs, { className: "w-50", children: [
3023
+ /* @__PURE__ */ e.jsxs(js, { className: "w-50", children: [
3037
3024
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-4 place-items-center", children: [
3038
3025
  /* @__PURE__ */ e.jsx(
3039
- O,
3026
+ z,
3040
3027
  {
3041
3028
  onClick: () => p("bar"),
3042
3029
  className: "font-normal",
@@ -3045,7 +3032,7 @@ function zl() {
3045
3032
  }
3046
3033
  ),
3047
3034
  /* @__PURE__ */ e.jsx(
3048
- O,
3035
+ z,
3049
3036
  {
3050
3037
  onClick: () => p("line"),
3051
3038
  variant: "ghost",
@@ -3053,7 +3040,7 @@ function zl() {
3053
3040
  }
3054
3041
  ),
3055
3042
  /* @__PURE__ */ e.jsx(
3056
- O,
3043
+ z,
3057
3044
  {
3058
3045
  onClick: () => p("stackedBar"),
3059
3046
  variant: "ghost",
@@ -3061,7 +3048,7 @@ function zl() {
3061
3048
  }
3062
3049
  ),
3063
3050
  /* @__PURE__ */ e.jsx(
3064
- O,
3051
+ z,
3065
3052
  {
3066
3053
  onClick: () => p("stackedLine"),
3067
3054
  variant: "ghost",
@@ -3069,15 +3056,15 @@ function zl() {
3069
3056
  }
3070
3057
  ),
3071
3058
  /* @__PURE__ */ e.jsx(
3072
- O,
3059
+ z,
3073
3060
  {
3074
3061
  onClick: () => p("scatter"),
3075
3062
  variant: "ghost",
3076
- children: /* @__PURE__ */ e.jsx(Fa, { className: "size-5" })
3063
+ children: /* @__PURE__ */ e.jsx(Da, { className: "size-5" })
3077
3064
  }
3078
3065
  ),
3079
3066
  /* @__PURE__ */ e.jsx(
3080
- O,
3067
+ z,
3081
3068
  {
3082
3069
  onClick: () => p("bubble"),
3083
3070
  variant: "ghost",
@@ -3085,7 +3072,7 @@ function zl() {
3085
3072
  }
3086
3073
  ),
3087
3074
  /* @__PURE__ */ e.jsx(
3088
- O,
3075
+ z,
3089
3076
  {
3090
3077
  onClick: () => p("pie"),
3091
3078
  variant: "ghost",
@@ -3093,7 +3080,7 @@ function zl() {
3093
3080
  }
3094
3081
  ),
3095
3082
  /* @__PURE__ */ e.jsx(
3096
- O,
3083
+ z,
3097
3084
  {
3098
3085
  onClick: () => p("doughnut"),
3099
3086
  variant: "ghost",
@@ -3101,7 +3088,7 @@ function zl() {
3101
3088
  }
3102
3089
  ),
3103
3090
  /* @__PURE__ */ e.jsx(
3104
- O,
3091
+ z,
3105
3092
  {
3106
3093
  onClick: () => p("radar"),
3107
3094
  variant: "ghost",
@@ -3115,7 +3102,7 @@ function zl() {
3115
3102
  }
3116
3103
  ),
3117
3104
  /* @__PURE__ */ e.jsx(
3118
- O,
3105
+ z,
3119
3106
  {
3120
3107
  onClick: () => p("polarArea"),
3121
3108
  variant: "ghost",
@@ -3123,7 +3110,7 @@ function zl() {
3123
3110
  }
3124
3111
  ),
3125
3112
  /* @__PURE__ */ e.jsx(
3126
- O,
3113
+ z,
3127
3114
  {
3128
3115
  onClick: () => p("pyramid"),
3129
3116
  variant: "ghost",
@@ -3131,7 +3118,7 @@ function zl() {
3131
3118
  }
3132
3119
  ),
3133
3120
  /* @__PURE__ */ e.jsx(
3134
- O,
3121
+ z,
3135
3122
  {
3136
3123
  onClick: () => p("range"),
3137
3124
  variant: "ghost",
@@ -3139,7 +3126,7 @@ function zl() {
3139
3126
  }
3140
3127
  ),
3141
3128
  /* @__PURE__ */ e.jsx(
3142
- O,
3129
+ z,
3143
3130
  {
3144
3131
  onClick: () => p("table"),
3145
3132
  variant: "ghost",
@@ -3147,7 +3134,7 @@ function zl() {
3147
3134
  }
3148
3135
  ),
3149
3136
  /* @__PURE__ */ e.jsx(
3150
- O,
3137
+ z,
3151
3138
  {
3152
3139
  onClick: () => p("kpi"),
3153
3140
  variant: "ghost",
@@ -3155,7 +3142,7 @@ function zl() {
3155
3142
  }
3156
3143
  ),
3157
3144
  /* @__PURE__ */ e.jsx(
3158
- O,
3145
+ z,
3159
3146
  {
3160
3147
  onClick: () => p("text"),
3161
3148
  variant: "ghost",
@@ -3163,19 +3150,19 @@ function zl() {
3163
3150
  }
3164
3151
  ),
3165
3152
  /* @__PURE__ */ e.jsx(
3166
- O,
3153
+ z,
3167
3154
  {
3168
3155
  onClick: () => p("map"),
3169
3156
  variant: "ghost",
3170
- children: /* @__PURE__ */ e.jsx(La, { className: "size-4" })
3157
+ children: /* @__PURE__ */ e.jsx(Ta, { className: "size-4" })
3171
3158
  }
3172
3159
  ),
3173
3160
  /* @__PURE__ */ e.jsx(
3174
- O,
3161
+ z,
3175
3162
  {
3176
3163
  onClick: () => p("custom"),
3177
3164
  variant: "ghost",
3178
- children: /* @__PURE__ */ e.jsx(Ma, { className: "size-4" })
3165
+ children: /* @__PURE__ */ e.jsx(La, { className: "size-4" })
3179
3166
  }
3180
3167
  )
3181
3168
  ] }),
@@ -3200,7 +3187,7 @@ function Ol({
3200
3187
  case "radar":
3201
3188
  return /* @__PURE__ */ e.jsx(_a, { className: t });
3202
3189
  case "scatter":
3203
- return /* @__PURE__ */ e.jsx(Fa, { className: t });
3190
+ return /* @__PURE__ */ e.jsx(Da, { className: t });
3204
3191
  case "bubble":
3205
3192
  return /* @__PURE__ */ e.jsx(Pa, { className: t });
3206
3193
  case "doughnut":
@@ -3220,9 +3207,9 @@ function Ol({
3220
3207
  case "text":
3221
3208
  return /* @__PURE__ */ e.jsx(Gs, { className: t });
3222
3209
  case "map":
3223
- return /* @__PURE__ */ e.jsx(La, { className: t });
3210
+ return /* @__PURE__ */ e.jsx(Ta, { className: t });
3224
3211
  case "custom":
3225
- return a && l ? /* @__PURE__ */ e.jsx(l, { className: t }) : n ? n == null ? void 0 : n.charAt(0).toUpperCase() : /* @__PURE__ */ e.jsx(Ma, { className: t });
3212
+ return a && l ? /* @__PURE__ */ e.jsx(l, { className: t }) : n ? n == null ? void 0 : n.charAt(0).toUpperCase() : /* @__PURE__ */ e.jsx(La, { className: t });
3226
3213
  default:
3227
3214
  return /* @__PURE__ */ e.jsx(Vs, { className: t });
3228
3215
  }
@@ -3231,7 +3218,7 @@ function Il() {
3231
3218
  var t;
3232
3219
  const s = m((a) => a.card);
3233
3220
  return (t = s.customCardPreferences) == null || t.showCardHeader, ie(), /* @__PURE__ */ e.jsxs(ra, { children: [
3234
- /* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(Da, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
3221
+ /* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(Fa, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
3235
3222
  /* @__PURE__ */ e.jsx(oa, { align: "start", className: "w-40 text-muted-foreground", children: /* @__PURE__ */ e.jsxs(
3236
3223
  Jt,
3237
3224
  {
@@ -3240,7 +3227,7 @@ function Il() {
3240
3227
  },
3241
3228
  className: "cursor-pointer space-x-2",
3242
3229
  children: [
3243
- /* @__PURE__ */ e.jsx(Vn, { className: "size-5" }),
3230
+ /* @__PURE__ */ e.jsx(Kt, { className: "size-5" }),
3244
3231
  /* @__PURE__ */ e.jsx("span", { children: "Copy Card ID" })
3245
3232
  ]
3246
3233
  }
@@ -3248,9 +3235,9 @@ function Il() {
3248
3235
  ] });
3249
3236
  }
3250
3237
  function ta() {
3251
- const s = m((x) => x.frame), t = m((x) => x.card), a = m((x) => x.isShowingVisual), n = m((x) => x.isSqlRunning), l = m((x) => x.queryError), d = m((x) => x.pythonStdOut), i = m((x) => x.actions.setRunSql);
3238
+ const s = m((x) => x.frame), t = m((x) => x.card), a = m((x) => x.isShowingVisual), n = m((x) => x.isSqlRunning), l = m((x) => x.queryError), r = m((x) => x.pythonStdOut), u = m((x) => x.actions.setRunSql);
3252
3239
  m((x) => x.onSave), m((x) => x.onClose), m((x) => x.actions.setCardSql), m((x) => x.actions.setCardType), m((x) => x.actions.setSqlGen);
3253
- const { setFrame: o, setCard: c, updateCardInFrame: p } = ie(), { data: u, isLoading: b, isFetching: g } = Re(t);
3240
+ const { setFrame: o, setCard: c, updateCardInFrame: p } = ie(), { data: d, isLoading: b, isFetching: j } = Re(t);
3254
3241
  if (!t) return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
3255
3242
  function h() {
3256
3243
  const x = {
@@ -3270,9 +3257,9 @@ function ta() {
3270
3257
  sql: "",
3271
3258
  data: []
3272
3259
  };
3273
- j(x);
3260
+ g(x);
3274
3261
  }
3275
- function j(x) {
3262
+ function g(x) {
3276
3263
  const v = {
3277
3264
  ...s,
3278
3265
  cards: [...s.cards, x],
@@ -3287,9 +3274,9 @@ function ta() {
3287
3274
  title: `${t.title} Copy`,
3288
3275
  tabTitle: `${t.tabTitle || t.title} Copy`
3289
3276
  };
3290
- j(x);
3277
+ g(x);
3291
3278
  }
3292
- function I(x) {
3279
+ function O(x) {
3293
3280
  const v = s.cards.filter((S) => S.id !== x), f = v[0], k = {
3294
3281
  ...s,
3295
3282
  cards: v,
@@ -3306,11 +3293,11 @@ function ta() {
3306
3293
  };
3307
3294
  o(v);
3308
3295
  const f = v.cards.find((k) => k.id === x);
3309
- f.sql && i(!0), c(f);
3296
+ f.sql && u(!0), c(f);
3310
3297
  }
3311
- const M = (x, v) => {
3298
+ const L = (x, v) => {
3312
3299
  console.log("handleDragStart", v), x.dataTransfer.setData("tabIndex", v.toString());
3313
- }, F = (x) => {
3300
+ }, D = (x) => {
3314
3301
  x.preventDefault();
3315
3302
  }, A = (x, v) => {
3316
3303
  const f = x.dataTransfer.getData("tabIndex");
@@ -3329,11 +3316,11 @@ function ta() {
3329
3316
  displayTab: f
3330
3317
  });
3331
3318
  },
3332
- children: v.displayTab === !0 || v.displayTab === void 0 ? /* @__PURE__ */ e.jsx(Ln, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(Dn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
3319
+ children: v.displayTab === !0 || v.displayTab === void 0 ? /* @__PURE__ */ e.jsx(Ln, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(Tn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
3333
3320
  }
3334
3321
  );
3335
3322
  }
3336
- function D() {
3323
+ function F() {
3337
3324
  return /* @__PURE__ */ e.jsxs(
3338
3325
  Ca,
3339
3326
  {
@@ -3354,8 +3341,8 @@ function ta() {
3354
3341
  is,
3355
3342
  {
3356
3343
  draggable: !0,
3357
- onDragStart: (f) => M(f, v),
3358
- onDragOver: F,
3344
+ onDragStart: (f) => L(f, v),
3345
+ onDragOver: D,
3359
3346
  onDrop: (f) => A(f, v),
3360
3347
  className: "",
3361
3348
  value: x.id,
@@ -3366,7 +3353,7 @@ function ta() {
3366
3353
  wa,
3367
3354
  {
3368
3355
  className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
3369
- onClick: () => I(x.id)
3356
+ onClick: () => O(x.id)
3370
3357
  }
3371
3358
  )
3372
3359
  ]
@@ -3376,21 +3363,21 @@ function ta() {
3376
3363
  x.id
3377
3364
  )),
3378
3365
  /* @__PURE__ */ e.jsx(
3379
- O,
3366
+ z,
3380
3367
  {
3381
3368
  className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
3382
3369
  variant: "outline",
3383
3370
  onClick: h,
3384
- children: /* @__PURE__ */ e.jsx(Ls, { className: "h-4 w-4" })
3371
+ children: /* @__PURE__ */ e.jsx(Ts, { className: "h-4 w-4" })
3385
3372
  }
3386
3373
  ),
3387
3374
  /* @__PURE__ */ e.jsx(
3388
- O,
3375
+ z,
3389
3376
  {
3390
3377
  className: "invisible ml-1 h-8 px-2 hover:bg-muted-foreground/50 group-hover:visible",
3391
3378
  variant: "outline",
3392
3379
  onClick: C,
3393
- children: /* @__PURE__ */ e.jsx(On, { className: "h-4 w-4" })
3380
+ children: /* @__PURE__ */ e.jsx(In, { className: "h-4 w-4" })
3394
3381
  }
3395
3382
  )
3396
3383
  ] }) })
@@ -3399,32 +3386,32 @@ function ta() {
3399
3386
  );
3400
3387
  }
3401
3388
  function E() {
3402
- return t.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Kt, { card: t, data: u == null ? void 0 : u.records }) }) }) : t.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(ze, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e.jsx(
3403
- Wt,
3389
+ return t.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Wt, { card: t, data: d == null ? void 0 : d.records }) }) }) : t.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(ze, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e.jsx(
3390
+ Yt,
3404
3391
  {
3405
3392
  isLoading: n,
3406
3393
  card: t,
3407
- data: u == null ? void 0 : u.records
3394
+ data: d == null ? void 0 : d.records
3408
3395
  }
3409
- ) }) }) }) : /* @__PURE__ */ e.jsx(xs, { FallbackComponent: va, children: /* @__PURE__ */ e.jsx(Ra, { className: "grow border-none shadow-none" }) });
3396
+ ) }) }) }) : /* @__PURE__ */ e.jsx(ps, { FallbackComponent: va, children: /* @__PURE__ */ e.jsx(Ra, { className: "grow border-none shadow-none" }) });
3410
3397
  }
3411
3398
  return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col py-3", children: [
3412
- (b || g) && /* @__PURE__ */ e.jsx(qe, { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto h-10 w-10 animate-spin text-foreground/10" }),
3399
+ (b || j) && /* @__PURE__ */ e.jsx(qe, { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto h-10 w-10 animate-spin text-foreground/10" }),
3413
3400
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
3414
3401
  a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
3415
3402
  /* @__PURE__ */ e.jsx(zl, {}),
3416
3403
  !["table", "custom"].includes(t.type) && /* @__PURE__ */ e.jsx(Sl, {}),
3417
3404
  /* @__PURE__ */ e.jsx(Il, {})
3418
3405
  ] }),
3419
- /* @__PURE__ */ e.jsx(Dl, {})
3406
+ /* @__PURE__ */ e.jsx(Fl, {})
3420
3407
  ] }),
3421
- a ? D() : /* @__PURE__ */ e.jsxs(
3408
+ a ? F() : /* @__PURE__ */ e.jsxs(
3422
3409
  cs,
3423
3410
  {
3424
3411
  className: "px-6",
3425
3412
  direction: "horizontal",
3426
3413
  children: [
3427
- d && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3414
+ r && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3428
3415
  /* @__PURE__ */ e.jsx(
3429
3416
  Ne,
3430
3417
  {
@@ -3433,7 +3420,7 @@ function ta() {
3433
3420
  defaultSize: 30,
3434
3421
  minSize: 10,
3435
3422
  className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
3436
- children: d && /* @__PURE__ */ e.jsx(Fl, {})
3423
+ children: r && /* @__PURE__ */ e.jsx(Dl, {})
3437
3424
  }
3438
3425
  ),
3439
3426
  /* @__PURE__ */ e.jsx(ds, {})
@@ -3446,7 +3433,7 @@ function ta() {
3446
3433
  minSize: 10,
3447
3434
  className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
3448
3435
  children: /* @__PURE__ */ e.jsxs(ze, { className: "relative flex h-full min-h-0 w-full flex-1 basis-0", children: [
3449
- (u == null ? void 0 : u.records) && (u == null ? void 0 : u.records.length) > 0 && /* @__PURE__ */ e.jsx(Cl, { data: (u == null ? void 0 : u.records) || [] }),
3436
+ (d == null ? void 0 : d.records) && (d == null ? void 0 : d.records.length) > 0 && /* @__PURE__ */ e.jsx(Cl, { data: (d == null ? void 0 : d.records) || [] }),
3450
3437
  l && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs", children: l }),
3451
3438
  /* @__PURE__ */ e.jsx(Ye, { orientation: "horizontal" })
3452
3439
  ] })
@@ -3457,7 +3444,7 @@ function ta() {
3457
3444
  )
3458
3445
  ] });
3459
3446
  }
3460
- function Fl() {
3447
+ function Dl() {
3461
3448
  const s = m((a) => a.pythonStdOut);
3462
3449
  if (!s) return null;
3463
3450
  const t = s.replace(/\n/g, "<br>");
@@ -3469,14 +3456,14 @@ function Fl() {
3469
3456
  ] })
3470
3457
  ] });
3471
3458
  }
3472
- function Dl() {
3459
+ function Fl() {
3473
3460
  const s = m((a) => a.isShowingVisual), t = m(
3474
3461
  (a) => a.actions.setIsShowingVisual
3475
3462
  );
3476
3463
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3477
3464
  /* @__PURE__ */ e.jsx(_, { htmlFor: "visualize", children: "Chart" }),
3478
3465
  /* @__PURE__ */ e.jsx(
3479
- Yt,
3466
+ Xt,
3480
3467
  {
3481
3468
  checked: s,
3482
3469
  onCheckedChange: () => t(!s),
@@ -3486,20 +3473,20 @@ function Dl() {
3486
3473
  )
3487
3474
  ] });
3488
3475
  }
3489
- function Ll({
3476
+ function Tl({
3490
3477
  options: s,
3491
3478
  value: t,
3492
3479
  onValueChange: a
3493
3480
  }) {
3494
3481
  return /* @__PURE__ */ e.jsx(
3495
- js,
3482
+ bs,
3496
3483
  {
3497
3484
  value: t,
3498
3485
  onValueChange: a,
3499
3486
  className: "flex gap-4",
3500
3487
  defaultValue: s[0].value,
3501
3488
  children: s.map((n) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3502
- /* @__PURE__ */ e.jsx(Le, { value: n.value, id: n.value }),
3489
+ /* @__PURE__ */ e.jsx(Te, { value: n.value, id: n.value }),
3503
3490
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: n.value, children: n.label })
3504
3491
  ] }, n.value))
3505
3492
  }
@@ -3522,7 +3509,7 @@ function ue({
3522
3509
  ),
3523
3510
  /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
3524
3511
  /* @__PURE__ */ e.jsx(fe, { children: s }),
3525
- t.map((d) => /* @__PURE__ */ e.jsx(Y, { value: d.value, children: d.label }, d.value))
3512
+ t.map((r) => /* @__PURE__ */ e.jsx(Y, { value: r.value, children: r.label }, r.value))
3526
3513
  ] }) })
3527
3514
  ] });
3528
3515
  }
@@ -3540,46 +3527,46 @@ function Qe({
3540
3527
  children: [
3541
3528
  /* @__PURE__ */ e.jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4", children: [
3542
3529
  /* @__PURE__ */ e.jsx(_, { children: t }),
3543
- /* @__PURE__ */ e.jsx(Xt, { className: "h-4 w-4" })
3530
+ /* @__PURE__ */ e.jsx(Zt, { className: "h-4 w-4" })
3544
3531
  ] }),
3545
3532
  /* @__PURE__ */ e.jsx("div", { className: "transition-all ease-in-out", children: s })
3546
3533
  ]
3547
3534
  }
3548
3535
  );
3549
3536
  }
3550
- function Ml() {
3551
- var C, I;
3537
+ function Ll() {
3538
+ var C, O;
3552
3539
  const s = m(
3553
3540
  (y) => y.card.customCardPreferences
3554
- ), { data: t } = Ka(), a = (t == null ? void 0 : t.plugins) || [], n = m((y) => y.card), l = m((y) => y.frame), d = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: i } = ie(), { components: o, manifest: c } = ba(
3541
+ ), { data: t } = Ka(), a = (t == null ? void 0 : t.plugins) || [], n = m((y) => y.card), l = m((y) => y.frame), r = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: u } = ie(), { components: o, manifest: c } = ba(
3555
3542
  (s == null ? void 0 : s.url) || ""
3556
3543
  ), p = (C = c == null ? void 0 : c.visuals) == null ? void 0 : C.find(
3557
3544
  (y) => y.name === (s == null ? void 0 : s.componentName)
3558
3545
  );
3559
- function u(y, M) {
3546
+ function d(y, L) {
3560
3547
  if (!s) return;
3561
3548
  const A = {
3562
3549
  ...(s == null ? void 0 : s.dataInputCardIds) || {},
3563
3550
  [y]: {
3564
- cardId: M,
3551
+ cardId: L,
3565
3552
  hookRef: null
3566
3553
  }
3567
3554
  };
3568
- i({
3555
+ u({
3569
3556
  ...s,
3570
3557
  dataInputCardIds: A
3571
3558
  });
3572
3559
  }
3573
3560
  function b(y) {
3574
- var F, A;
3575
- const M = (F = l == null ? void 0 : l.cards) == null ? void 0 : F.filter((N) => {
3576
- var D;
3577
- return ((D = N == null ? void 0 : N.customCardPreferences) == null ? void 0 : D.visualType) !== "multiple";
3561
+ var D, A;
3562
+ const L = (D = l == null ? void 0 : l.cards) == null ? void 0 : D.filter((N) => {
3563
+ var F;
3564
+ return ((F = N == null ? void 0 : N.customCardPreferences) == null ? void 0 : F.visualType) !== "multiple";
3578
3565
  }).map((N) => ({
3579
3566
  value: N.id,
3580
3567
  label: N.tabTitle || N.title
3581
3568
  }));
3582
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (A = y == null ? void 0 : y.dataInputs) == null ? void 0 : A.map((N, D) => {
3569
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (A = y == null ? void 0 : y.dataInputs) == null ? void 0 : A.map((N, F) => {
3583
3570
  var E, x;
3584
3571
  return /* @__PURE__ */ e.jsxs(
3585
3572
  "div",
@@ -3592,64 +3579,64 @@ function Ml() {
3592
3579
  {
3593
3580
  className: "col-span-6 h-8 w-full justify-between",
3594
3581
  label: "",
3595
- options: M || [],
3596
- value: ((x = (E = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : E[D]) == null ? void 0 : x.cardId) || "",
3597
- onValueChange: (v) => u(D, v)
3582
+ options: L || [],
3583
+ value: ((x = (E = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : E[F]) == null ? void 0 : x.cardId) || "",
3584
+ onValueChange: (v) => d(F, v)
3598
3585
  }
3599
3586
  )
3600
3587
  ]
3601
3588
  },
3602
- D + Math.random()
3589
+ F + Math.random()
3603
3590
  );
3604
3591
  }) });
3605
3592
  }
3606
- function g(y, M, F = []) {
3593
+ function j(y, L, D = []) {
3607
3594
  var A, N;
3608
3595
  return s ? y === "input" ? /* @__PURE__ */ e.jsx(
3609
3596
  re,
3610
3597
  {
3611
3598
  className: `h-8 w-full ${Ue}`,
3612
- value: ((A = s == null ? void 0 : s.settings) == null ? void 0 : A[M]) || "",
3613
- onChange: (D) => {
3614
- i({
3599
+ value: ((A = s == null ? void 0 : s.settings) == null ? void 0 : A[L]) || "",
3600
+ onChange: (F) => {
3601
+ u({
3615
3602
  ...s,
3616
3603
  settings: {
3617
3604
  ...s == null ? void 0 : s.settings,
3618
- [M]: D.target.value
3605
+ [L]: F.target.value
3619
3606
  }
3620
3607
  });
3621
3608
  }
3622
3609
  },
3623
- M
3610
+ L
3624
3611
  ) : y === "select" ? /* @__PURE__ */ e.jsx(
3625
3612
  ue,
3626
3613
  {
3627
3614
  className: "h-8 w-full",
3628
3615
  label: "",
3629
- options: F,
3630
- value: ((N = s == null ? void 0 : s.settings) == null ? void 0 : N[M]) || "",
3631
- onValueChange: (D) => {
3632
- i({
3616
+ options: D,
3617
+ value: ((N = s == null ? void 0 : s.settings) == null ? void 0 : N[L]) || "",
3618
+ onValueChange: (F) => {
3619
+ u({
3633
3620
  ...s,
3634
- settings: { ...s == null ? void 0 : s.settings, [M]: D }
3621
+ settings: { ...s == null ? void 0 : s.settings, [L]: F }
3635
3622
  });
3636
3623
  }
3637
3624
  }
3638
3625
  ) : null : null;
3639
3626
  }
3640
3627
  function h(y) {
3641
- const M = Object.entries((y == null ? void 0 : y.settings) || {});
3642
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: M.map(([F, A]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3628
+ const L = Object.entries((y == null ? void 0 : y.settings) || {});
3629
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: L.map(([D, A]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3643
3630
  /* @__PURE__ */ e.jsx(_, { children: A.title }),
3644
- g(
3631
+ j(
3645
3632
  A.ui,
3646
- F,
3633
+ D,
3647
3634
  A.options
3648
3635
  )
3649
- ] }, F)) });
3636
+ ] }, D)) });
3650
3637
  }
3651
- function j(y) {
3652
- s && i({
3638
+ function g(y) {
3639
+ s && u({
3653
3640
  ...s,
3654
3641
  visualType: y,
3655
3642
  componentName: ""
@@ -3668,7 +3655,7 @@ function Ml() {
3668
3655
  label: "",
3669
3656
  options: a,
3670
3657
  value: (s == null ? void 0 : s.url) || "",
3671
- onValueChange: (y) => i({
3658
+ onValueChange: (y) => u({
3672
3659
  ...s || {
3673
3660
  url: "",
3674
3661
  componentName: ""
@@ -3678,14 +3665,14 @@ function Ml() {
3678
3665
  }
3679
3666
  ) }) }),
3680
3667
  ((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && /* @__PURE__ */ e.jsx(
3681
- Ll,
3668
+ Tl,
3682
3669
  {
3683
3670
  options: [
3684
3671
  { value: "single", label: "Single Visual" },
3685
3672
  { value: "multiple", label: "Multi-Visual" }
3686
3673
  ],
3687
- value: d,
3688
- onValueChange: j
3674
+ value: r,
3675
+ onValueChange: g
3689
3676
  }
3690
3677
  ),
3691
3678
  ((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && s && /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
@@ -3696,14 +3683,14 @@ function Ml() {
3696
3683
  className: "h-8 w-full",
3697
3684
  label: "",
3698
3685
  options: (o == null ? void 0 : o.filter(
3699
- (y) => y.type === d
3686
+ (y) => y.type === r
3700
3687
  ).map((y) => ({
3701
3688
  value: y.name,
3702
3689
  label: y.name
3703
3690
  }))) || [],
3704
3691
  value: s.componentName,
3705
3692
  onValueChange: (y) => {
3706
- console.log("changing value", y), i({
3693
+ console.log("changing value", y), u({
3707
3694
  ...s,
3708
3695
  componentName: y
3709
3696
  });
@@ -3713,7 +3700,7 @@ function Ml() {
3713
3700
  ] }) })
3714
3701
  ] }) }) }),
3715
3702
  /* @__PURE__ */ e.jsx(we, { className: "my-4" }),
3716
- ((I = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : I.componentName) && /* @__PURE__ */ e.jsxs(Qe, { summary: "Component Settings", children: [
3703
+ ((O = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : O.componentName) && /* @__PURE__ */ e.jsxs(Qe, { summary: "Component Settings", children: [
3717
3704
  p && p.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
3718
3705
  /* @__PURE__ */ e.jsx(_, { children: "Input Mapping" }),
3719
3706
  /* @__PURE__ */ e.jsx("div", { className: "px-2", children: b(p) })
@@ -3724,70 +3711,70 @@ function Ml() {
3724
3711
  }
3725
3712
  );
3726
3713
  }
3727
- function Te() {
3714
+ function Me() {
3728
3715
  const [s, t] = V([]);
3729
3716
  m(
3730
- (u) => u.card.cfg
3717
+ (d) => d.card.cfg
3731
3718
  );
3732
- const a = m((u) => u.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences: d } = m((u) => u.actions), i = m(
3733
- (u) => u.queryResultColumns
3719
+ const a = m((d) => d.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences: r } = m((d) => d.actions), u = m(
3720
+ (d) => d.queryResultColumns
3734
3721
  );
3735
3722
  m(
3736
- (u) => {
3723
+ (d) => {
3737
3724
  var b;
3738
- return (b = u.card.preferences) == null ? void 0 : b.filterOnClickColumnIndex;
3725
+ return (b = d.card.preferences) == null ? void 0 : b.filterOnClickColumnIndex;
3739
3726
  }
3740
3727
  ), se(() => {
3741
- i && t(new Array(i.length).fill(!1));
3742
- }, [i]);
3743
- function o(u, b) {
3744
- var g, h;
3745
- b ? a != null && a.onClickFilter && ((g = a == null ? void 0 : a.onClickFilter) == null ? void 0 : g.length) > 0 ? d({
3728
+ u && t(new Array(u.length).fill(!1));
3729
+ }, [u]);
3730
+ function o(d, b) {
3731
+ var j, h;
3732
+ b ? a != null && a.onClickFilter && ((j = a == null ? void 0 : a.onClickFilter) == null ? void 0 : j.length) > 0 ? r({
3746
3733
  ...a,
3747
3734
  onClickFilter: [
3748
3735
  ...a.onClickFilter,
3749
3736
  {
3750
- columnIndex: u,
3737
+ columnIndex: d,
3751
3738
  expression: ""
3752
3739
  }
3753
3740
  ]
3754
- }) : d({
3741
+ }) : r({
3755
3742
  ...a,
3756
3743
  onClickFilter: [
3757
3744
  {
3758
- columnIndex: u,
3745
+ columnIndex: d,
3759
3746
  expression: ""
3760
3747
  }
3761
3748
  ]
3762
- }) : (d({
3749
+ }) : (r({
3763
3750
  ...a,
3764
3751
  onClickFilter: (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.filter(
3765
- (j) => j.columnIndex !== u
3752
+ (g) => g.columnIndex !== d
3766
3753
  )
3767
- }), t((j) => {
3768
- const C = [...j];
3769
- return C[u] = !1, C;
3754
+ }), t((g) => {
3755
+ const C = [...g];
3756
+ return C[d] = !1, C;
3770
3757
  }));
3771
3758
  }
3772
- function c(u, b) {
3759
+ function c(d, b) {
3773
3760
  var h;
3774
- const g = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.map((j) => j.columnIndex === u ? {
3775
- ...j,
3761
+ const j = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.map((g) => g.columnIndex === d ? {
3762
+ ...g,
3776
3763
  expression: b.target.value
3777
- } : j);
3778
- d({
3764
+ } : g);
3765
+ r({
3779
3766
  ...a,
3780
- onClickFilter: g
3767
+ onClickFilter: j
3781
3768
  });
3782
3769
  }
3783
- function p(u) {
3784
- var b, g, h, j;
3785
- if (s != null && s[u] || (g = (b = a == null ? void 0 : a.onClickFilter) == null ? void 0 : b.find((C) => C.columnIndex === u)) != null && g.expression)
3770
+ function p(d) {
3771
+ var b, j, h, g;
3772
+ if (s != null && s[d] || (j = (b = a == null ? void 0 : a.onClickFilter) == null ? void 0 : b.find((C) => C.columnIndex === d)) != null && j.expression)
3786
3773
  return /* @__PURE__ */ e.jsx(
3787
3774
  re,
3788
3775
  {
3789
- value: (j = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find((C) => C.columnIndex === u)) == null ? void 0 : j.expression,
3790
- onChange: (C) => c(u, C),
3776
+ value: (g = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find((C) => C.columnIndex === d)) == null ? void 0 : g.expression,
3777
+ onChange: (C) => c(d, C),
3791
3778
  type: "text",
3792
3779
  className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
3793
3780
  placeholder: "Expression"
@@ -3796,8 +3783,8 @@ function Te() {
3796
3783
  }
3797
3784
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3798
3785
  /* @__PURE__ */ e.jsx(_, { children: "On Click" }),
3799
- i == null ? void 0 : i.map((u, b) => {
3800
- var g, h;
3786
+ u == null ? void 0 : u.map((d, b) => {
3787
+ var j, h;
3801
3788
  return /* @__PURE__ */ e.jsx(
3802
3789
  "div",
3803
3790
  {
@@ -3807,28 +3794,28 @@ function Te() {
3807
3794
  /* @__PURE__ */ e.jsx(
3808
3795
  $s,
3809
3796
  {
3810
- checked: !!((g = a == null ? void 0 : a.onClickFilter) != null && g.find(
3811
- (j) => j.columnIndex === b
3797
+ checked: !!((j = a == null ? void 0 : a.onClickFilter) != null && j.find(
3798
+ (g) => g.columnIndex === b
3812
3799
  )),
3813
- onCheckedChange: (j) => o(b, j)
3800
+ onCheckedChange: (g) => o(b, g)
3814
3801
  }
3815
3802
  ),
3816
3803
  /* @__PURE__ */ e.jsx(
3817
3804
  "label",
3818
3805
  {
3819
3806
  className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
3820
- children: u
3807
+ children: d
3821
3808
  }
3822
3809
  ),
3823
3810
  /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find(
3824
- (j) => j.columnIndex === b
3811
+ (g) => g.columnIndex === b
3825
3812
  )) && /* @__PURE__ */ e.jsx(
3826
3813
  ca,
3827
3814
  {
3828
3815
  onClick: () => {
3829
- t((j) => {
3830
- const C = [...j];
3831
- return C[b] = !j[b], C;
3816
+ t((g) => {
3817
+ const C = [...g];
3818
+ return C[b] = !g[b], C;
3832
3819
  });
3833
3820
  },
3834
3821
  className: "invisible size-3 cursor-pointer text-gray-400 group-hover:visible"
@@ -3838,34 +3825,34 @@ function Te() {
3838
3825
  p(b)
3839
3826
  ] })
3840
3827
  },
3841
- u
3828
+ d
3842
3829
  );
3843
3830
  })
3844
3831
  ] });
3845
3832
  }
3846
- function bs() {
3847
- var i, o, c;
3833
+ function ys() {
3834
+ var u, o, c;
3848
3835
  const s = m((p) => p.card.preferences), t = m(
3849
3836
  (p) => p.card.cfg
3850
3837
  ), { setCardCfg: a, setCardPreferences: n, setChartOrientation: l } = m((p) => p.actions);
3851
- (i = t == null ? void 0 : t.options) != null && i.indexAxis;
3852
- function d(p) {
3838
+ (u = t == null ? void 0 : t.options) != null && u.indexAxis;
3839
+ function r(p) {
3853
3840
  l(p);
3854
3841
  }
3855
3842
  return /* @__PURE__ */ e.jsxs(
3856
- js,
3843
+ bs,
3857
3844
  {
3858
3845
  value: ((o = s == null ? void 0 : s.chartOptions) == null ? void 0 : o.indexAxis) || ((c = t == null ? void 0 : t.options) == null ? void 0 : c.indexAxis) || "x",
3859
- onValueChange: d,
3846
+ onValueChange: r,
3860
3847
  className: "flex gap-3",
3861
3848
  defaultValue: "x",
3862
3849
  children: [
3863
3850
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3864
- /* @__PURE__ */ e.jsx(Le, { value: "x", id: "r1" }),
3851
+ /* @__PURE__ */ e.jsx(Te, { value: "x", id: "r1" }),
3865
3852
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
3866
3853
  ] }),
3867
3854
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3868
- /* @__PURE__ */ e.jsx(Le, { value: "y", id: "r2" }),
3855
+ /* @__PURE__ */ e.jsx(Te, { value: "y", id: "r2" }),
3869
3856
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
3870
3857
  ] })
3871
3858
  ]
@@ -3874,44 +3861,44 @@ function bs() {
3874
3861
  }
3875
3862
  const ns = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
3876
3863
  function na(s, t) {
3877
- var n, l, d;
3864
+ var n, l, r;
3878
3865
  const a = ka(s, t);
3879
- return ((d = (l = (n = s == null ? void 0 : s.chartOptions) == null ? void 0 : n.scales) == null ? void 0 : l[a]) == null ? void 0 : d.type) || "linear";
3866
+ return ((r = (l = (n = s == null ? void 0 : s.chartOptions) == null ? void 0 : n.scales) == null ? void 0 : l[a]) == null ? void 0 : r.type) || "linear";
3880
3867
  }
3881
3868
  function Wa() {
3882
3869
  var Z, B, X, w, H, ae;
3883
- const [s, t] = V(!1), a = m((T) => {
3884
- var L;
3885
- return (L = T.card) == null ? void 0 : L.preferences;
3886
- }), n = m((T) => {
3887
- var L;
3888
- return (L = T.card) == null ? void 0 : L.cfg;
3889
- }), l = ka(a, n), [d, i] = V(
3870
+ const [s, t] = V(!1), a = m((M) => {
3871
+ var T;
3872
+ return (T = M.card) == null ? void 0 : T.preferences;
3873
+ }), n = m((M) => {
3874
+ var T;
3875
+ return (T = M.card) == null ? void 0 : T.cfg;
3876
+ }), l = ka(a, n), [r, u] = V(
3890
3877
  na(a)
3891
3878
  ), [o, c] = V(
3892
3879
  ((X = (B = (Z = a == null ? void 0 : a.chartOptions) == null ? void 0 : Z.scales) == null ? void 0 : B[l]) == null ? void 0 : X.min) || ""
3893
- ), [p, u] = V(
3880
+ ), [p, d] = V(
3894
3881
  ((ae = (H = (w = a == null ? void 0 : a.chartOptions) == null ? void 0 : w.scales) == null ? void 0 : H[l]) == null ? void 0 : ae.max) || ""
3895
- ), [b, g] = V(o || p ? "custom" : "auto"), [h, j] = V(""), [C, I] = V(0), [y, M] = V(""), [F, A] = V(""), [N, D] = V(""), E = m(
3896
- (T) => T.actions.setCardPreferences
3897
- ), { updateCardInFrame: x } = ie(), v = m((T) => T.card), f = m((T) => {
3898
- var L;
3899
- return (L = T.card) == null ? void 0 : L.type;
3882
+ ), [b, j] = V(o || p ? "custom" : "auto"), [h, g] = V(""), [C, O] = V(0), [y, L] = V(""), [D, A] = V(""), [N, F] = V(""), E = m(
3883
+ (M) => M.actions.setCardPreferences
3884
+ ), { updateCardInFrame: x } = ie(), v = m((M) => M.card), f = m((M) => {
3885
+ var T;
3886
+ return (T = M.card) == null ? void 0 : T.type;
3900
3887
  }), k = ["pie", "doughnut", "polarArea"].includes(f);
3901
3888
  se(() => {
3902
- var T, L, te, P, ee, ne, Ee, Ie, je, be, W, oe, ce, Fe;
3903
- i(na(a)), c(
3904
- ((te = (L = (T = a == null ? void 0 : a.chartOptions) == null ? void 0 : T.scales) == null ? void 0 : L[l]) == null ? void 0 : te.min) === 0 ? 0 : ""
3905
- ), u(((ne = (ee = (P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : ee[l]) == null ? void 0 : ne.max) || ""), j(
3889
+ var M, T, te, P, ee, ne, Ee, Ie, je, be, W, oe, ce, De;
3890
+ u(na(a)), c(
3891
+ ((te = (T = (M = a == null ? void 0 : a.chartOptions) == null ? void 0 : M.scales) == null ? void 0 : T[l]) == null ? void 0 : te.min) === 0 ? 0 : ""
3892
+ ), d(((ne = (ee = (P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : ee[l]) == null ? void 0 : ne.max) || ""), g(
3906
3893
  ((be = (je = (Ie = (Ee = a == null ? void 0 : a.chartOptions) == null ? void 0 : Ee.scales) == null ? void 0 : Ie[l]) == null ? void 0 : je.ticks) == null ? void 0 : be.stepSize) || ""
3907
- ), I(((W = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : W.decimalPlaces) || 0), M(((oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : oe.suffix) || ""), A(((ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ce.currency) || ""), D(((Fe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Fe.locale) || "");
3894
+ ), O(((W = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : W.decimalPlaces) || 0), L(((oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : oe.suffix) || ""), A(((ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ce.currency) || ""), F(((De = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : De.locale) || "");
3908
3895
  }, [s, a, l]);
3909
- function S(T, L) {
3910
- return L === "" || /^[0-9\b]+$/.test(L) ? Number(L) : Number(T);
3896
+ function S(M, T) {
3897
+ return T === "" || /^[0-9\b]+$/.test(T) ? Number(T) : Number(M);
3911
3898
  }
3912
- function R() {
3913
- const T = [
3914
- ...new Set(us.map((L) => L.currency))
3899
+ function q() {
3900
+ const M = [
3901
+ ...new Set(us.map((T) => T.currency))
3915
3902
  ];
3916
3903
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3917
3904
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
@@ -3933,19 +3920,19 @@ function Wa() {
3933
3920
  /* @__PURE__ */ e.jsxs(
3934
3921
  me,
3935
3922
  {
3936
- value: F || "none",
3937
- onValueChange: (L) => A(L === "none" ? "" : L),
3923
+ value: D || "none",
3924
+ onValueChange: (T) => A(T === "none" ? "" : T),
3938
3925
  children: [
3939
3926
  /* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
3940
3927
  /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
3941
3928
  /* @__PURE__ */ e.jsx(fe, { children: "Currency" }),
3942
3929
  /* @__PURE__ */ e.jsx(Y, { value: "none", children: "None" }),
3943
- T.map((L) => /* @__PURE__ */ e.jsx(Y, { value: L, children: L }, L))
3930
+ M.map((T) => /* @__PURE__ */ e.jsx(Y, { value: T, children: T }, T))
3944
3931
  ] }) })
3945
3932
  ]
3946
3933
  }
3947
3934
  ),
3948
- /* @__PURE__ */ e.jsxs(me, { value: N, onValueChange: (L) => D(L), children: [
3935
+ /* @__PURE__ */ e.jsxs(me, { value: N, onValueChange: (T) => F(T), children: [
3949
3936
  /* @__PURE__ */ e.jsx(
3950
3937
  he,
3951
3938
  {
@@ -3955,7 +3942,7 @@ function Wa() {
3955
3942
  ),
3956
3943
  /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
3957
3944
  /* @__PURE__ */ e.jsx(fe, { children: "Locale" }),
3958
- us.map((L) => /* @__PURE__ */ e.jsx(Y, { value: L.locale, children: L.locale }, L.locale))
3945
+ us.map((T) => /* @__PURE__ */ e.jsx(Y, { value: T.locale, children: T.locale }, T.locale))
3959
3946
  ] }) })
3960
3947
  ] })
3961
3948
  ] }),
@@ -3965,7 +3952,7 @@ function Wa() {
3965
3952
  re,
3966
3953
  {
3967
3954
  value: C,
3968
- onChange: (L) => I(Number(L.target.value)),
3955
+ onChange: (T) => O(Number(T.target.value)),
3969
3956
  id: "format",
3970
3957
  className: `col-span-6 h-8 w-full tracking-wide ${ns}`
3971
3958
  }
@@ -3982,7 +3969,7 @@ function Wa() {
3982
3969
  {
3983
3970
  id: "min",
3984
3971
  value: o,
3985
- onChange: (T) => c((L) => S(L, T.target.value)),
3972
+ onChange: (M) => c((T) => S(T, M.target.value)),
3986
3973
  className: `col-span-1 h-8 w-full ${ns}`
3987
3974
  }
3988
3975
  ),
@@ -3990,7 +3977,7 @@ function Wa() {
3990
3977
  re,
3991
3978
  {
3992
3979
  value: p,
3993
- onChange: (T) => u((L) => S(L, T.target.value)),
3980
+ onChange: (M) => d((T) => S(T, M.target.value)),
3994
3981
  id: "max",
3995
3982
  className: `col-span-1 h-8 w-full ${ns}`
3996
3983
  }
@@ -4002,7 +3989,7 @@ function Wa() {
4002
3989
  re,
4003
3990
  {
4004
3991
  value: h,
4005
- onChange: (T) => j((L) => S(L, T.target.value)),
3992
+ onChange: (M) => g((T) => S(T, M.target.value)),
4006
3993
  id: "step-size",
4007
3994
  className: `col-span-1 h-8 w-full ${ns}`
4008
3995
  }
@@ -4012,15 +3999,15 @@ function Wa() {
4012
3999
  }
4013
4000
  function U() {
4014
4001
  var P;
4015
- let T = {};
4016
- b === "custom" && (T = {
4002
+ let M = {};
4003
+ b === "custom" && (M = {
4017
4004
  min: o,
4018
4005
  max: p,
4019
4006
  ticks: {
4020
4007
  stepSize: h
4021
4008
  }
4022
4009
  });
4023
- const L = {
4010
+ const T = {
4024
4011
  ...a || {},
4025
4012
  chartOptions: {
4026
4013
  ...a == null ? void 0 : a.chartOptions,
@@ -4028,28 +4015,28 @@ function Wa() {
4028
4015
  ...(P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales,
4029
4016
  [l]: {
4030
4017
  // ...cardPreferences?.chartOptions?.scales?.[axis],
4031
- type: d,
4032
- ...d === "linear" ? T : {}
4018
+ type: r,
4019
+ ...r === "linear" ? M : {}
4033
4020
  }
4034
4021
  }
4035
4022
  },
4036
4023
  numberAxisFormat: {
4037
4024
  decimalPlaces: C,
4038
4025
  suffix: y,
4039
- currency: F,
4026
+ currency: D,
4040
4027
  locale: N
4041
4028
  }
4042
4029
  };
4043
- console.log(L), E(L);
4030
+ console.log(T), E(T);
4044
4031
  const te = {
4045
4032
  ...v,
4046
- preferences: L
4033
+ preferences: T
4047
4034
  };
4048
4035
  x(te);
4049
4036
  }
4050
- return /* @__PURE__ */ e.jsxs(ps, { onOpenChange: (T) => t(T), children: [
4051
- /* @__PURE__ */ e.jsx(fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(Zt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
4052
- /* @__PURE__ */ e.jsx(gs, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
4037
+ return /* @__PURE__ */ e.jsxs(fs, { onOpenChange: (M) => t(M), children: [
4038
+ /* @__PURE__ */ e.jsx(gs, { asChild: !0, children: /* @__PURE__ */ e.jsx(en, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
4039
+ /* @__PURE__ */ e.jsx(js, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
4053
4040
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4054
4041
  /* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
4055
4042
  /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
@@ -4061,8 +4048,8 @@ function Wa() {
4061
4048
  me,
4062
4049
  {
4063
4050
  disabled: k,
4064
- value: d,
4065
- onValueChange: (T) => i(T),
4051
+ value: r,
4052
+ onValueChange: (M) => u(M),
4066
4053
  children: [
4067
4054
  /* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
4068
4055
  /* @__PURE__ */ e.jsx(pe, { id: "type", children: /* @__PURE__ */ e.jsxs(Se, { children: [
@@ -4074,35 +4061,35 @@ function Wa() {
4074
4061
  }
4075
4062
  )
4076
4063
  ] }),
4077
- d == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
4064
+ r == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
4078
4065
  /* @__PURE__ */ e.jsx(_, { htmlFor: "scale-option", children: "Setup" }),
4079
4066
  /* @__PURE__ */ e.jsxs(
4080
- js,
4067
+ bs,
4081
4068
  {
4082
4069
  disabled: k,
4083
4070
  id: "scale-option",
4084
4071
  value: b,
4085
- onValueChange: (T) => g(T),
4072
+ onValueChange: (M) => j(M),
4086
4073
  className: "col-span-2 flex gap-3",
4087
4074
  defaultValue: "x",
4088
4075
  children: [
4089
4076
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
4090
- /* @__PURE__ */ e.jsx(Le, { value: "auto", id: "r1" }),
4077
+ /* @__PURE__ */ e.jsx(Te, { value: "auto", id: "r1" }),
4091
4078
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Auto" })
4092
4079
  ] }),
4093
4080
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
4094
- /* @__PURE__ */ e.jsx(Le, { value: "custom", id: "r2" }),
4081
+ /* @__PURE__ */ e.jsx(Te, { value: "custom", id: "r2" }),
4095
4082
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Custom" })
4096
4083
  ] })
4097
4084
  ]
4098
4085
  }
4099
4086
  )
4100
4087
  ] }),
4101
- b === "custom" && d == "linear" && $(),
4102
- R(),
4103
- /* @__PURE__ */ e.jsx(en, {}),
4088
+ b === "custom" && r == "linear" && $(),
4089
+ q(),
4090
+ /* @__PURE__ */ e.jsx(sn, {}),
4104
4091
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
4105
- O,
4092
+ z,
4106
4093
  {
4107
4094
  onClick: U,
4108
4095
  variant: "secondary",
@@ -4114,7 +4101,7 @@ function Wa() {
4114
4101
  ] }) })
4115
4102
  ] });
4116
4103
  }
4117
- function Tl({ idx: s }) {
4104
+ function Ml({ idx: s }) {
4118
4105
  var o;
4119
4106
  const t = m((c) => {
4120
4107
  var p;
@@ -4126,45 +4113,45 @@ function Tl({ idx: s }) {
4126
4113
  }
4127
4114
  ), n = m(
4128
4115
  (c) => c.actions.setCardPreferences
4129
- ), l = (o = t == null ? void 0 : t.chartOptions) == null ? void 0 : o.indexAxis, d = a == null ? void 0 : a.find((c) => c.idx === s);
4130
- function i(c, p) {
4131
- (c === "end" || c === "start") && sn(an());
4132
- const u = {
4116
+ ), l = (o = t == null ? void 0 : t.chartOptions) == null ? void 0 : o.indexAxis, r = a == null ? void 0 : a.find((c) => c.idx === s);
4117
+ function u(c, p) {
4118
+ (c === "end" || c === "start") && an(tn());
4119
+ const d = {
4133
4120
  display: c !== "none",
4134
4121
  align: c,
4135
4122
  anchor: c,
4136
4123
  clamp: !0
4137
4124
  };
4138
- if (!d)
4125
+ if (!r)
4139
4126
  n({
4140
4127
  ...t,
4141
4128
  datasetOptions: [
4142
4129
  ...a || [],
4143
4130
  {
4144
4131
  idx: p,
4145
- datalabels: u
4132
+ datalabels: d
4146
4133
  }
4147
4134
  ]
4148
4135
  });
4149
4136
  else {
4150
- const b = { ...d };
4151
- b.datalabels = u;
4152
- const g = a == null ? void 0 : a.map(
4137
+ const b = { ...r };
4138
+ b.datalabels = d;
4139
+ const j = a == null ? void 0 : a.map(
4153
4140
  (h) => h.idx === p ? b : h
4154
4141
  );
4155
4142
  n({
4156
4143
  ...t,
4157
- datasetOptions: g
4144
+ datasetOptions: j
4158
4145
  });
4159
4146
  }
4160
4147
  }
4161
- return /* @__PURE__ */ e.jsxs(ps, { children: [
4162
- /* @__PURE__ */ e.jsx(fs, { children: /* @__PURE__ */ e.jsx(Kn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
4163
- /* @__PURE__ */ e.jsx(gs, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
4148
+ return /* @__PURE__ */ e.jsxs(fs, { children: [
4149
+ /* @__PURE__ */ e.jsx(gs, { children: /* @__PURE__ */ e.jsx(Kn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
4150
+ /* @__PURE__ */ e.jsx(js, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
4164
4151
  /* @__PURE__ */ e.jsx(
4165
- O,
4152
+ z,
4166
4153
  {
4167
- onClick: () => i("none", s),
4154
+ onClick: () => u("none", s),
4168
4155
  size: "sm",
4169
4156
  variant: "secondary",
4170
4157
  className: "h-7 p-1 text-xs font-normal",
@@ -4172,9 +4159,9 @@ function Tl({ idx: s }) {
4172
4159
  }
4173
4160
  ),
4174
4161
  /* @__PURE__ */ e.jsx(
4175
- O,
4162
+ z,
4176
4163
  {
4177
- onClick: () => i("start", s),
4164
+ onClick: () => u("start", s),
4178
4165
  size: "sm",
4179
4166
  variant: "secondary",
4180
4167
  className: "h-7 p-1 text-xs font-normal",
@@ -4189,9 +4176,9 @@ function Tl({ idx: s }) {
4189
4176
  }
4190
4177
  ),
4191
4178
  /* @__PURE__ */ e.jsx(
4192
- O,
4179
+ z,
4193
4180
  {
4194
- onClick: () => i("center", s),
4181
+ onClick: () => u("center", s),
4195
4182
  size: "sm",
4196
4183
  variant: "secondary",
4197
4184
  className: "h-7 p-1 text-xs font-normal",
@@ -4206,9 +4193,9 @@ function Tl({ idx: s }) {
4206
4193
  }
4207
4194
  ),
4208
4195
  /* @__PURE__ */ e.jsx(
4209
- O,
4196
+ z,
4210
4197
  {
4211
- onClick: () => i("end", s),
4198
+ onClick: () => u("end", s),
4212
4199
  size: "sm",
4213
4200
  variant: "secondary",
4214
4201
  className: "h-7 p-1 text-xs font-normal",
@@ -4228,25 +4215,25 @@ function Tl({ idx: s }) {
4228
4215
  function Ya() {
4229
4216
  const s = m((p) => p.card), t = m(
4230
4217
  (p) => {
4231
- var u, b, g;
4232
- return (g = (b = (u = p == null ? void 0 : p.card) == null ? void 0 : u.preferences) == null ? void 0 : b.chartOptions) == null ? void 0 : g.indexAxis;
4218
+ var d, b, j;
4219
+ return (j = (b = (d = p == null ? void 0 : p.card) == null ? void 0 : d.preferences) == null ? void 0 : b.chartOptions) == null ? void 0 : j.indexAxis;
4233
4220
  }
4234
4221
  ), { data: a } = Re(s), n = t === "y" ? "Y axis" : "X axis", l = t === "y" ? "X axis" : "Y axis", {
4235
- keys: d,
4236
- metricKeys: i,
4222
+ keys: r,
4223
+ metricKeys: u,
4237
4224
  dimensionKeys: o
4238
- } = Ss((a == null ? void 0 : a.records) || []);
4239
- let c = i;
4225
+ } = ws((a == null ? void 0 : a.records) || []);
4226
+ let c = u;
4240
4227
  if (["stackedBar", "stackedLine"].includes(s.type)) {
4241
- const p = tn({
4228
+ const p = nn({
4242
4229
  dataArray: (a == null ? void 0 : a.records) || [],
4243
4230
  groupKey: o[0],
4244
4231
  pivotKey: o[1],
4245
4232
  valueKey: c[0]
4246
- }), { metricKeys: u } = Ss(p);
4247
- c = u;
4233
+ }), { metricKeys: d } = ws(p);
4234
+ c = d;
4248
4235
  }
4249
- return d.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4236
+ return r.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4250
4237
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4251
4238
  /* @__PURE__ */ e.jsx(_, { children: n }),
4252
4239
  /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: o[0] }) }) })
@@ -4256,7 +4243,7 @@ function Ya() {
4256
4243
  /* @__PURE__ */ e.jsx(_, { children: l }),
4257
4244
  /* @__PURE__ */ e.jsx(Wa, {})
4258
4245
  ] }),
4259
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((p, u) => /* @__PURE__ */ e.jsx(El, { col: p, idx: u }, p)) })
4246
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((p, d) => /* @__PURE__ */ e.jsx(El, { col: p, idx: d }, p)) })
4260
4247
  ] })
4261
4248
  ] });
4262
4249
  }
@@ -4269,10 +4256,10 @@ function El({ col: s, idx: t }) {
4269
4256
  var c;
4270
4257
  return (c = o.card.preferences) == null ? void 0 : c.datasetOptions;
4271
4258
  }
4272
- ), l = n == null ? void 0 : n.find((o) => o.idx === t), { setCardPreferences: d } = m((o) => o.actions);
4273
- function i(o) {
4259
+ ), l = n == null ? void 0 : n.find((o) => o.idx === t), { setCardPreferences: r } = m((o) => o.actions);
4260
+ function u(o) {
4274
4261
  if (!l)
4275
- d({
4262
+ r({
4276
4263
  ...a,
4277
4264
  datasetOptions: [
4278
4265
  ...n || [],
@@ -4287,9 +4274,9 @@ function El({ col: s, idx: t }) {
4287
4274
  const c = { ...l };
4288
4275
  c.type = o === "area" ? "line" : o, c.fill = o === "area" ? "origin" : "";
4289
4276
  const p = n == null ? void 0 : n.map(
4290
- (u) => u.idx === t ? c : u
4277
+ (d) => d.idx === t ? c : d
4291
4278
  );
4292
- d({
4279
+ r({
4293
4280
  ...a,
4294
4281
  datasetOptions: p
4295
4282
  });
@@ -4301,84 +4288,82 @@ function El({ col: s, idx: t }) {
4301
4288
  /* @__PURE__ */ e.jsx(
4302
4289
  Bs,
4303
4290
  {
4304
- onClick: () => i("bar"),
4291
+ onClick: () => u("bar"),
4305
4292
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
4306
4293
  }
4307
4294
  ),
4308
4295
  /* @__PURE__ */ e.jsx(
4309
4296
  Us,
4310
4297
  {
4311
- onClick: () => i("line"),
4298
+ onClick: () => u("line"),
4312
4299
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
4313
4300
  }
4314
4301
  ),
4315
4302
  /* @__PURE__ */ e.jsx(
4316
- kn,
4303
+ zn,
4317
4304
  {
4318
- onClick: () => i("area"),
4305
+ onClick: () => u("area"),
4319
4306
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
4320
4307
  }
4321
4308
  ),
4322
- /* @__PURE__ */ e.jsx(Tl, { idx: t })
4309
+ /* @__PURE__ */ e.jsx(Ml, { idx: t })
4323
4310
  ] })
4324
4311
  ] });
4325
4312
  }
4326
4313
  function Xa() {
4327
- const s = m((g) => g.selectedConnectionId), t = m((g) => g.selectedDatamodelId), a = m((g) => g.selectedDatabaseName), n = m((g) => g.selectedSchemaName), l = m((g) => g.selectedTableName), d = z((g) => g.dashboard.filters) || [], i = z((g) => g.actions.addFilter), o = z((g) => g.actions.removeFilter), c = z(
4328
- (g) => g.actions.removeFilterValue
4329
- ), { modelItems: p, tableName: u } = _e();
4330
- function b(g, h = "dashboard") {
4331
- var D;
4332
- const j = de(g.column_name), C = de(a || ""), I = de(n || ""), y = de(u);
4333
- let M = ga(
4334
- I,
4314
+ const s = m((j) => j.selectedConnectionId), t = m((j) => j.selectedDatamodelId), a = m((j) => j.selectedDatabaseName), n = m((j) => j.selectedSchemaName), l = m((j) => j.selectedTableName), r = I((j) => j.dashboard.filters) || [], u = I((j) => j.actions.addFilter), o = I((j) => j.actions.removeFilter), { removeFilterValues: c } = xs(), { modelItems: p, tableName: d } = _e();
4315
+ function b(j, h = "dashboard") {
4316
+ var F;
4317
+ const g = de(j.column_name), C = de(a || ""), O = de(n || ""), y = de(d);
4318
+ let L = ga(
4319
+ O,
4335
4320
  y
4336
- ), F = `${M}.${j}`;
4337
- const A = (D = p == null ? void 0 : p.find(
4321
+ ), D = `${L}.${g}`;
4322
+ const A = (F = p == null ? void 0 : p.find(
4338
4323
  (E) => E.id === t
4339
- )) == null ? void 0 : D.name;
4340
- t && t !== "none" && (F = `${Ns}.${A}.${j}`, M = `${Ns}.${A}`);
4341
- const N = d == null ? void 0 : d.find(
4342
- (E) => E.column === F && E.table === y && (E.database === C || E.database === a)
4324
+ )) == null ? void 0 : F.name;
4325
+ t && t !== "none" && (D = `${Ss}.${A}.${g}`, L = `${Ss}.${A}`);
4326
+ const N = r == null ? void 0 : r.find(
4327
+ (E) => E.column === D && E.table === y && (E.database === C || E.database === a)
4343
4328
  );
4344
4329
  if (N)
4345
4330
  c(N.id), o(N.id);
4346
4331
  else {
4347
4332
  const E = Ke();
4348
- return u === "api" && s ? (i({
4333
+ return d === "api" && s ? (u({
4349
4334
  location: h,
4350
4335
  id: E,
4351
4336
  //uuidv4(),
4352
- column: F,
4353
- title: g.column_name,
4354
- dataType: g.data_type,
4337
+ column: D,
4338
+ title: j.column_name,
4339
+ dataType: j.data_type,
4355
4340
  table: "api",
4356
4341
  database: "",
4357
4342
  // database: 'NA',
4358
4343
  connectionId: s,
4359
4344
  operation: "in",
4360
4345
  sql: Zs(
4361
- g.data_type,
4362
- M,
4363
- j
4346
+ j.data_type,
4347
+ L,
4348
+ g
4364
4349
  )
4365
4350
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
4366
- }), E) : (i({
4351
+ }), E) : (u({
4367
4352
  id: E,
4368
4353
  //uuidv4(),
4369
4354
  location: h,
4370
- column: F,
4355
+ column: D,
4371
4356
  //columnName, //`${qualifiedTableName}.${formattedColumnName}`,
4372
- title: g.column_name,
4373
- dataType: g.data_type,
4357
+ title: j.column_name,
4358
+ dataType: j.data_type,
4374
4359
  table: l || "",
4375
4360
  database: a || "",
4376
4361
  connectionId: s || "",
4377
4362
  operation: "in",
4378
4363
  sql: Zs(
4379
- g.data_type,
4380
- M,
4381
- j
4364
+ j.data_type,
4365
+ L,
4366
+ g
4382
4367
  )
4383
4368
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
4384
4369
  }), E);
@@ -4387,29 +4372,29 @@ function Xa() {
4387
4372
  return { assignFilter: b };
4388
4373
  }
4389
4374
  function He() {
4390
- const s = z(
4375
+ const s = I(
4391
4376
  (o) => o.dashboard.filters
4392
4377
  ), t = m((o) => o.frame), { setFrame: a } = ie(), { columns: n } = _e(), { assignFilter: l } = Xa();
4393
- function d(o) {
4378
+ function r(o) {
4394
4379
  const c = l(o, "frame");
4395
4380
  a({ ...t, filterId: c });
4396
4381
  }
4397
- const i = s == null ? void 0 : s.find((o) => o.id === t.filterId);
4382
+ const u = s == null ? void 0 : s.find((o) => o.id === t.filterId);
4398
4383
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
4399
4384
  /* @__PURE__ */ e.jsx(_, { children: "Card Filter" }),
4400
- /* @__PURE__ */ e.jsx(Al, { onSelect: d, columns: n }),
4401
- i && /* @__PURE__ */ e.jsx(nn, { filter: i })
4385
+ /* @__PURE__ */ e.jsx(Al, { onSelect: r, columns: n }),
4386
+ u && /* @__PURE__ */ e.jsx(ln, { filter: u })
4402
4387
  ] });
4403
4388
  }
4404
4389
  function Al({
4405
4390
  columns: s,
4406
4391
  onSelect: t
4407
4392
  }) {
4408
- var i;
4409
- const [a, n] = ea.useState(!1), [l, d] = ea.useState("");
4410
- return /* @__PURE__ */ e.jsxs(ps, { open: a, onOpenChange: n, children: [
4411
- /* @__PURE__ */ e.jsx(fs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
4412
- O,
4393
+ var u;
4394
+ const [a, n] = ea.useState(!1), [l, r] = ea.useState("");
4395
+ return /* @__PURE__ */ e.jsxs(fs, { open: a, onOpenChange: n, children: [
4396
+ /* @__PURE__ */ e.jsx(gs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
4397
+ z,
4413
4398
  {
4414
4399
  size: "sm",
4415
4400
  variant: "outline",
@@ -4417,22 +4402,22 @@ function Al({
4417
4402
  "aria-expanded": a,
4418
4403
  className: "w-full justify-between font-normal",
4419
4404
  children: [
4420
- l ? (i = s.find((o) => o.column_name === l)) == null ? void 0 : i.column_name : "Select Column...",
4421
- /* @__PURE__ */ e.jsx(ln, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
4405
+ l ? (u = s.find((o) => o.column_name === l)) == null ? void 0 : u.column_name : "Select Column...",
4406
+ /* @__PURE__ */ e.jsx(rn, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
4422
4407
  ]
4423
4408
  }
4424
4409
  ) }),
4425
- /* @__PURE__ */ e.jsx(gs, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(rn, { children: [
4426
- /* @__PURE__ */ e.jsx(on, { placeholder: "Search column", className: "h-9" }),
4427
- /* @__PURE__ */ e.jsxs(cn, { children: [
4428
- /* @__PURE__ */ e.jsx(dn, { children: "No framework found." }),
4429
- /* @__PURE__ */ e.jsx(un, { children: s.map((o) => /* @__PURE__ */ e.jsxs(
4430
- mn,
4410
+ /* @__PURE__ */ e.jsx(js, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(on, { children: [
4411
+ /* @__PURE__ */ e.jsx(cn, { placeholder: "Search column", className: "h-9" }),
4412
+ /* @__PURE__ */ e.jsxs(dn, { children: [
4413
+ /* @__PURE__ */ e.jsx(un, { children: "No framework found." }),
4414
+ /* @__PURE__ */ e.jsx(mn, { children: s.map((o) => /* @__PURE__ */ e.jsxs(
4415
+ hn,
4431
4416
  {
4432
4417
  value: o.column_name,
4433
4418
  onSelect: (c) => {
4434
4419
  const p = c === l ? "" : c;
4435
- d(p), n(!1), p && t(o);
4420
+ r(p), n(!1), p && t(o);
4436
4421
  },
4437
4422
  children: [
4438
4423
  o.column_name,
@@ -4456,7 +4441,7 @@ function Al({
4456
4441
  function Vl({
4457
4442
  cardType: s
4458
4443
  }) {
4459
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Me, { defaultValue: ["item-2"], type: "multiple", children: [
4444
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
4460
4445
  /* @__PURE__ */ e.jsxs(G, { value: "item-1", children: [
4461
4446
  /* @__PURE__ */ e.jsx(Q, { children: `${Ps(s)} Chart` }),
4462
4447
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 font-mono text-xs", children: [
@@ -4485,26 +4470,26 @@ function Vl({
4485
4470
  /* @__PURE__ */ e.jsxs(G, { value: "item-2", children: [
4486
4471
  /* @__PURE__ */ e.jsx(Q, { children: "Settings" }),
4487
4472
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
4488
- /* @__PURE__ */ e.jsx(bs, {}),
4473
+ /* @__PURE__ */ e.jsx(ys, {}),
4489
4474
  /* @__PURE__ */ e.jsx(Ya, {})
4490
4475
  ] })
4491
4476
  ] }),
4492
4477
  /* @__PURE__ */ e.jsxs(G, { value: "item-3", children: [
4493
4478
  /* @__PURE__ */ e.jsx(Q, { children: "Filters" }),
4494
4479
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
4495
- /* @__PURE__ */ e.jsx(Te, {}),
4480
+ /* @__PURE__ */ e.jsx(Me, {}),
4496
4481
  /* @__PURE__ */ e.jsx(He, {})
4497
4482
  ] })
4498
4483
  ] })
4499
4484
  ] }) });
4500
4485
  }
4501
4486
  function Qs() {
4502
- var l, d, i;
4487
+ var l, r, u;
4503
4488
  const s = m(
4504
4489
  (o) => o.card.cfg
4505
4490
  ), t = m((o) => o.actions.setCardCfg), a = m((o) => o.card.type);
4506
4491
  function n(o) {
4507
- var u;
4492
+ var d;
4508
4493
  const c = {
4509
4494
  datalabels: {
4510
4495
  display: o !== "none",
@@ -4517,7 +4502,7 @@ function Qs() {
4517
4502
  options: {
4518
4503
  ...s == null ? void 0 : s.options,
4519
4504
  plugins: {
4520
- ...(u = s == null ? void 0 : s.options) == null ? void 0 : u.plugins,
4505
+ ...(d = s == null ? void 0 : s.options) == null ? void 0 : d.plugins,
4521
4506
  ...c
4522
4507
  }
4523
4508
  }
@@ -4532,7 +4517,7 @@ function Qs() {
4532
4517
  /* @__PURE__ */ e.jsxs(
4533
4518
  me,
4534
4519
  {
4535
- value: (i = (d = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : d.datalabels) == null ? void 0 : i.anchor,
4520
+ value: (u = (r = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : r.datalabels) == null ? void 0 : u.anchor,
4536
4521
  onValueChange: n,
4537
4522
  defaultValue: "none",
4538
4523
  children: [
@@ -4568,7 +4553,7 @@ function ql({
4568
4553
  "a",
4569
4554
  {
4570
4555
  target: "_blank",
4571
- onClick: (d) => d.stopPropagation(),
4556
+ onClick: (r) => r.stopPropagation(),
4572
4557
  className: "text-blue-700",
4573
4558
  href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
4574
4559
  children: "example"
@@ -4578,7 +4563,7 @@ function ql({
4578
4563
  ] })
4579
4564
  ] });
4580
4565
  }
4581
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Me, { defaultValue: ["item-2"], type: "multiple", children: [
4566
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
4582
4567
  /* @__PURE__ */ e.jsxs(G, { value: "item-1", children: [
4583
4568
  /* @__PURE__ */ e.jsx(Q, { children: `${Ps(s)} Chart` }),
4584
4569
  /* @__PURE__ */ e.jsx(J, { className: "space-y-4 font-mono text-xs", children: t(s) })
@@ -4590,7 +4575,7 @@ function ql({
4590
4575
  /* @__PURE__ */ e.jsxs(G, { value: "item-3", children: [
4591
4576
  /* @__PURE__ */ e.jsx(Q, { children: "Filters" }),
4592
4577
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
4593
- /* @__PURE__ */ e.jsx(Te, {}),
4578
+ /* @__PURE__ */ e.jsx(Me, {}),
4594
4579
  /* @__PURE__ */ e.jsx(He, {})
4595
4580
  ] })
4596
4581
  ] })
@@ -4623,7 +4608,7 @@ function Hl() {
4623
4608
  const s = m((t) => t.card.type);
4624
4609
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
4625
4610
  /* @__PURE__ */ e.jsx(
4626
- Me,
4611
+ Le,
4627
4612
  {
4628
4613
  className: " ",
4629
4614
  type: "single",
@@ -4631,10 +4616,10 @@ function Hl() {
4631
4616
  children: $l(s)
4632
4617
  }
4633
4618
  ),
4634
- /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(bs, {}) }),
4619
+ /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(ys, {}) }),
4635
4620
  !["kpi"].includes(s) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4636
4621
  /* @__PURE__ */ e.jsx(Qs, {}),
4637
- /* @__PURE__ */ e.jsx(Te, {}),
4622
+ /* @__PURE__ */ e.jsx(Me, {}),
4638
4623
  /* @__PURE__ */ e.jsx(He, {})
4639
4624
  ] })
4640
4625
  ] });
@@ -4737,7 +4722,7 @@ function $l(s) {
4737
4722
  ] }) });
4738
4723
  }
4739
4724
  function Pl() {
4740
- var c, p, u, b, g;
4725
+ var c, p, d, b, j;
4741
4726
  const s = m((h) => h.card.preferences), t = m(
4742
4727
  (h) => h.actions.setCardPreferences
4743
4728
  ), a = m(
@@ -4745,30 +4730,30 @@ function Pl() {
4745
4730
  );
4746
4731
  m(
4747
4732
  (h) => {
4748
- var j, C;
4749
- return (C = (j = h.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : C.decimalPlaces;
4733
+ var g, C;
4734
+ return (C = (g = h.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : C.decimalPlaces;
4750
4735
  }
4751
4736
  );
4752
4737
  const n = m(
4753
4738
  (h) => {
4754
- var j, C;
4755
- return (C = (j = h.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : C.locale;
4739
+ var g, C;
4740
+ return (C = (g = h.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : C.locale;
4756
4741
  }
4757
4742
  ), l = m(
4758
4743
  (h) => {
4759
- var j, C;
4760
- return (C = (j = h.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : C.currency;
4744
+ var g, C;
4745
+ return (C = (g = h.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : C.currency;
4761
4746
  }
4762
4747
  );
4763
4748
  m(
4764
4749
  (h) => h.actions.setFilterOnClickField
4765
4750
  );
4766
- const d = m(
4751
+ const r = m(
4767
4752
  (h) => {
4768
- var j, C;
4769
- return (C = (j = h.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : C.colorRanges;
4753
+ var g, C;
4754
+ return (C = (g = h.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : C.colorRanges;
4770
4755
  }
4771
- ) || [], i = m(
4756
+ ) || [], u = m(
4772
4757
  (h) => h.actions.setColorRanges
4773
4758
  ), o = [...new Set(us.map((h) => h.currency))];
4774
4759
  return /* @__PURE__ */ e.jsxs("div", { children: [
@@ -4800,12 +4785,12 @@ function Pl() {
4800
4785
  {
4801
4786
  value: n || "none",
4802
4787
  onValueChange: (h) => {
4803
- var j, C, I;
4788
+ var g, C, O;
4804
4789
  return a(
4805
- ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.decimalPlaces) || 0,
4790
+ ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.decimalPlaces) || 0,
4806
4791
  ((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.currency) || "",
4807
4792
  h,
4808
- ((I = s == null ? void 0 : s.formatNumber) == null ? void 0 : I.suffix) || ""
4793
+ ((O = s == null ? void 0 : s.formatNumber) == null ? void 0 : O.suffix) || ""
4809
4794
  );
4810
4795
  },
4811
4796
  children: [
@@ -4826,12 +4811,12 @@ function Pl() {
4826
4811
  {
4827
4812
  value: l || "none",
4828
4813
  onValueChange: (h) => {
4829
- var j, C, I;
4814
+ var g, C, O;
4830
4815
  console.log("currency", h), a(
4831
- ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.decimalPlaces) || 0,
4816
+ ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.decimalPlaces) || 0,
4832
4817
  h === "none" ? "" : h,
4833
4818
  ((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.locale) || "",
4834
- ((I = s == null ? void 0 : s.formatNumber) == null ? void 0 : I.suffix) || ""
4819
+ ((O = s == null ? void 0 : s.formatNumber) == null ? void 0 : O.suffix) || ""
4835
4820
  );
4836
4821
  },
4837
4822
  children: [
@@ -4852,14 +4837,14 @@ function Pl() {
4852
4837
  /* @__PURE__ */ e.jsxs(
4853
4838
  me,
4854
4839
  {
4855
- value: ((b = (u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.decimalPlaces) == null ? void 0 : b.toString()) || "0",
4840
+ value: ((b = (d = s == null ? void 0 : s.formatNumber) == null ? void 0 : d.decimalPlaces) == null ? void 0 : b.toString()) || "0",
4856
4841
  onValueChange: (h) => {
4857
- var j, C, I;
4842
+ var g, C, O;
4858
4843
  return a(
4859
4844
  Number(h),
4860
- ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.currency) || "",
4845
+ ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.currency) || "",
4861
4846
  ((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.locale) || "",
4862
- ((I = s == null ? void 0 : s.formatNumber) == null ? void 0 : I.suffix) || ""
4847
+ ((O = s == null ? void 0 : s.formatNumber) == null ? void 0 : O.suffix) || ""
4863
4848
  );
4864
4849
  },
4865
4850
  children: [
@@ -4874,15 +4859,15 @@ function Pl() {
4874
4859
  /* @__PURE__ */ e.jsx(
4875
4860
  re,
4876
4861
  {
4877
- value: ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.suffix) || "",
4862
+ value: ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.suffix) || "",
4878
4863
  className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
4879
4864
  placeholder: "K, M, B, %",
4880
4865
  onChange: (h) => {
4881
- var j, C, I;
4866
+ var g, C, O;
4882
4867
  return a(
4883
- ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.decimalPlaces) || 0,
4868
+ ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.decimalPlaces) || 0,
4884
4869
  ((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.currency) || "",
4885
- ((I = s == null ? void 0 : s.formatNumber) == null ? void 0 : I.locale) || "",
4870
+ ((O = s == null ? void 0 : s.formatNumber) == null ? void 0 : O.locale) || "",
4886
4871
  h.target.value
4887
4872
  );
4888
4873
  }
@@ -4893,10 +4878,10 @@ function Pl() {
4893
4878
  ] }) }),
4894
4879
  /* @__PURE__ */ e.jsx(we, { className: "my-3" }),
4895
4880
  /* @__PURE__ */ e.jsx(
4896
- hn,
4881
+ xn,
4897
4882
  {
4898
- colorRanges: d,
4899
- setColorRanges: i
4883
+ colorRanges: r,
4884
+ setColorRanges: u
4900
4885
  }
4901
4886
  )
4902
4887
  ] })
@@ -4904,7 +4889,7 @@ function Pl() {
4904
4889
  }
4905
4890
  function Bl() {
4906
4891
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
4907
- /* @__PURE__ */ e.jsx(Me, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(G, { value: "item-1", children: [
4892
+ /* @__PURE__ */ e.jsx(Le, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(G, { value: "item-1", children: [
4908
4893
  /* @__PURE__ */ e.jsx(Q, { className: "", children: "KPI Query" }),
4909
4894
  /* @__PURE__ */ e.jsxs(J, { className: "font-mono", children: [
4910
4895
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
@@ -5034,10 +5019,10 @@ const Ul = [
5034
5019
  value: s
5035
5020
  }));
5036
5021
  function Jl() {
5037
- var c, p, u, b, g, h, j, C, I, y, M, F, A, N, D, E, x, v;
5022
+ var c, p, d, b, j, h, g, C, O, y, L, D, A, N, F, E, x, v;
5038
5023
  const s = m((f) => f.card), t = (p = (c = s == null ? void 0 : s.preferences) == null ? void 0 : c.mapVisualOptions) == null ? void 0 : p.topoJsonUrl, [a, n] = V(
5039
- ((b = (u = s == null ? void 0 : s.preferences) == null ? void 0 : u.mapVisualOptions) == null ? void 0 : b.customTopoJsonUrl) || ""
5040
- ), { setCardPreferences: l } = ie(), { data: d } = Hs(s), i = Object.keys((d == null ? void 0 : d.objects) || {}).map((f) => ({
5024
+ ((b = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : b.customTopoJsonUrl) || ""
5025
+ ), { setCardPreferences: l } = ie(), { data: r } = Hs(s), u = Object.keys((r == null ? void 0 : r.objects) || {}).map((f) => ({
5041
5026
  label: f,
5042
5027
  value: f
5043
5028
  })) || [], o = [
@@ -5097,15 +5082,15 @@ function Jl() {
5097
5082
  placeholder: "Custom URL"
5098
5083
  }
5099
5084
  ),
5100
- d && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
5085
+ r && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
5101
5086
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
5102
5087
  /* @__PURE__ */ e.jsx(_, { children: "Map Object" }),
5103
5088
  /* @__PURE__ */ e.jsx(
5104
5089
  ue,
5105
5090
  {
5106
5091
  className: "h-9",
5107
- options: i,
5108
- value: ((h = (g = s.preferences) == null ? void 0 : g.mapVisualOptions) == null ? void 0 : h.objectKey) || "",
5092
+ options: u,
5093
+ value: ((h = (j = s.preferences) == null ? void 0 : j.mapVisualOptions) == null ? void 0 : h.objectKey) || "",
5109
5094
  label: "Map Object",
5110
5095
  onValueChange: (f) => {
5111
5096
  var k;
@@ -5127,7 +5112,7 @@ function Jl() {
5127
5112
  {
5128
5113
  className: "h-9",
5129
5114
  options: Ul,
5130
- value: ((C = (j = s.preferences) == null ? void 0 : j.mapVisualOptions) == null ? void 0 : C.projection) || "",
5115
+ value: ((C = (g = s.preferences) == null ? void 0 : g.mapVisualOptions) == null ? void 0 : C.projection) || "",
5131
5116
  label: "Projection",
5132
5117
  onValueChange: (f) => {
5133
5118
  var k;
@@ -5149,7 +5134,7 @@ function Jl() {
5149
5134
  {
5150
5135
  className: "h-9",
5151
5136
  options: Ql,
5152
- value: ((y = (I = s.preferences) == null ? void 0 : I.mapVisualOptions) == null ? void 0 : y.colorScale) || "",
5137
+ value: ((y = (O = s.preferences) == null ? void 0 : O.mapVisualOptions) == null ? void 0 : y.colorScale) || "",
5153
5138
  label: "Select Color Scale",
5154
5139
  onValueChange: (f) => {
5155
5140
  var k;
@@ -5174,7 +5159,7 @@ function Jl() {
5174
5159
  className: `h-9 w-full ${Ue}`,
5175
5160
  type: "number",
5176
5161
  step: 0.1,
5177
- value: ((F = (M = s.preferences) == null ? void 0 : M.mapVisualOptions) == null ? void 0 : F.projectionScale) || 1,
5162
+ value: ((D = (L = s.preferences) == null ? void 0 : L.mapVisualOptions) == null ? void 0 : D.projectionScale) || 1,
5178
5163
  onChange: (f) => {
5179
5164
  var k;
5180
5165
  l({
@@ -5194,16 +5179,16 @@ function Jl() {
5194
5179
  className: `h-9 w-full ${Ue}`,
5195
5180
  type: "number",
5196
5181
  step: 10,
5197
- value: ((D = (N = (A = s.preferences) == null ? void 0 : A.mapVisualOptions) == null ? void 0 : N.projectionOffset) == null ? void 0 : D[0]) || 0,
5182
+ value: ((F = (N = (A = s.preferences) == null ? void 0 : A.mapVisualOptions) == null ? void 0 : N.projectionOffset) == null ? void 0 : F[0]) || 0,
5198
5183
  onChange: (f) => {
5199
- var k, S, R, $;
5184
+ var k, S, q, $;
5200
5185
  l({
5201
5186
  ...s.preferences,
5202
5187
  mapVisualOptions: {
5203
5188
  ...(k = s.preferences) == null ? void 0 : k.mapVisualOptions,
5204
5189
  projectionOffset: [
5205
5190
  Number(f.target.value),
5206
- (($ = (R = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : R.projectionOffset) == null ? void 0 : $[1]) || 0
5191
+ (($ = (q = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : q.projectionOffset) == null ? void 0 : $[1]) || 0
5207
5192
  ]
5208
5193
  }
5209
5194
  });
@@ -5219,13 +5204,13 @@ function Jl() {
5219
5204
  step: 10,
5220
5205
  value: ((v = (x = (E = s.preferences) == null ? void 0 : E.mapVisualOptions) == null ? void 0 : x.projectionOffset) == null ? void 0 : v[1]) || 0,
5221
5206
  onChange: (f) => {
5222
- var k, S, R, $;
5207
+ var k, S, q, $;
5223
5208
  l({
5224
5209
  ...s.preferences,
5225
5210
  mapVisualOptions: {
5226
5211
  ...(k = s.preferences) == null ? void 0 : k.mapVisualOptions,
5227
5212
  projectionOffset: [
5228
- (($ = (R = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : R.projectionOffset) == null ? void 0 : $[0]) || 0,
5213
+ (($ = (q = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : q.projectionOffset) == null ? void 0 : $[0]) || 0,
5229
5214
  Number(f.target.value)
5230
5215
  ]
5231
5216
  }
@@ -5235,7 +5220,7 @@ function Jl() {
5235
5220
  )
5236
5221
  ] }) }),
5237
5222
  /* @__PURE__ */ e.jsx(we, { className: "my-4" }),
5238
- /* @__PURE__ */ e.jsx(Te, {})
5223
+ /* @__PURE__ */ e.jsx(Me, {})
5239
5224
  ] });
5240
5225
  }
5241
5226
  function Kl() {
@@ -5251,7 +5236,7 @@ function Kl() {
5251
5236
  });
5252
5237
  }
5253
5238
  return /* @__PURE__ */ e.jsxs(
5254
- js,
5239
+ bs,
5255
5240
  {
5256
5241
  value: (n = s == null ? void 0 : s.textVisualOptions) != null && n.isDynamicText ? "dynamic" : "static",
5257
5242
  onValueChange: a,
@@ -5259,11 +5244,11 @@ function Kl() {
5259
5244
  defaultValue: "x",
5260
5245
  children: [
5261
5246
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
5262
- /* @__PURE__ */ e.jsx(Le, { value: "static", id: "r1" }),
5247
+ /* @__PURE__ */ e.jsx(Te, { value: "static", id: "r1" }),
5263
5248
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Static" })
5264
5249
  ] }),
5265
5250
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
5266
- /* @__PURE__ */ e.jsx(Le, { value: "dynamic", id: "r2" }),
5251
+ /* @__PURE__ */ e.jsx(Te, { value: "dynamic", id: "r2" }),
5267
5252
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Dynamic" })
5268
5253
  ] })
5269
5254
  ]
@@ -5276,7 +5261,7 @@ function ls({
5276
5261
  suffix: a = "Chart"
5277
5262
  }) {
5278
5263
  let n = "pie-chart";
5279
- return s === "radar" && (n = "radar-chart"), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Me, { defaultValue: ["item-2"], type: "multiple", children: [
5264
+ return s === "radar" && (n = "radar-chart"), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
5280
5265
  /* @__PURE__ */ e.jsxs(G, { value: "item-1", children: [
5281
5266
  /* @__PURE__ */ e.jsx(Q, { children: `${Ps(s)} ${a}` }),
5282
5267
  /* @__PURE__ */ e.jsx(J, { children: t || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
@@ -5304,7 +5289,7 @@ function ls({
5304
5289
  /* @__PURE__ */ e.jsxs(G, { value: "item-2", children: [
5305
5290
  /* @__PURE__ */ e.jsx(Q, { children: "Settings" }),
5306
5291
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
5307
- s === "range" && /* @__PURE__ */ e.jsx(bs, {}),
5292
+ s === "range" && /* @__PURE__ */ e.jsx(ys, {}),
5308
5293
  s !== "text" && /* @__PURE__ */ e.jsx(Qs, {}),
5309
5294
  s === "text" && /* @__PURE__ */ e.jsx(Kl, {})
5310
5295
  ] })
@@ -5312,7 +5297,7 @@ function ls({
5312
5297
  !["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(G, { value: "item-3", children: [
5313
5298
  /* @__PURE__ */ e.jsx(Q, { children: "Filters" }),
5314
5299
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
5315
- /* @__PURE__ */ e.jsx(Te, {}),
5300
+ /* @__PURE__ */ e.jsx(Me, {}),
5316
5301
  /* @__PURE__ */ e.jsx(He, {})
5317
5302
  ] })
5318
5303
  ] })
@@ -5321,8 +5306,8 @@ function ls({
5321
5306
  function Wl() {
5322
5307
  const s = m(
5323
5308
  (n) => {
5324
- var l, d;
5325
- return (d = (l = n == null ? void 0 : n.card) == null ? void 0 : l.preferences) == null ? void 0 : d.sortChart;
5309
+ var l, r;
5310
+ return (r = (l = n == null ? void 0 : n.card) == null ? void 0 : l.preferences) == null ? void 0 : r.sortChart;
5326
5311
  }
5327
5312
  ), { setSortChart: t } = ie();
5328
5313
  function a() {
@@ -5355,7 +5340,7 @@ function Wl() {
5355
5340
  )
5356
5341
  ] });
5357
5342
  }
5358
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Me, { defaultValue: ["item-2"], type: "multiple", children: [
5343
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
5359
5344
  /* @__PURE__ */ e.jsxs(G, { value: "item-1", children: [
5360
5345
  /* @__PURE__ */ e.jsx(Q, { children: "Stacked Chart" }),
5361
5346
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 font-mono text-xs", children: [
@@ -5384,7 +5369,7 @@ function Wl() {
5384
5369
  /* @__PURE__ */ e.jsxs(G, { value: "item-2", children: [
5385
5370
  /* @__PURE__ */ e.jsx(Q, { children: "Settings" }),
5386
5371
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
5387
- /* @__PURE__ */ e.jsx(bs, {}),
5372
+ /* @__PURE__ */ e.jsx(ys, {}),
5388
5373
  a(),
5389
5374
  /* @__PURE__ */ e.jsx(Ya, {})
5390
5375
  ] })
@@ -5392,7 +5377,7 @@ function Wl() {
5392
5377
  /* @__PURE__ */ e.jsxs(G, { value: "item-3", children: [
5393
5378
  /* @__PURE__ */ e.jsx(Q, { children: "Filters" }),
5394
5379
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
5395
- /* @__PURE__ */ e.jsx(Te, {}),
5380
+ /* @__PURE__ */ e.jsx(Me, {}),
5396
5381
  /* @__PURE__ */ e.jsx(He, {})
5397
5382
  ] })
5398
5383
  ] })
@@ -5411,10 +5396,10 @@ function Yl({}) {
5411
5396
  });
5412
5397
  };
5413
5398
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
5414
- /* @__PURE__ */ e.jsx(Me, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(G, { value: "item-3", children: [
5399
+ /* @__PURE__ */ e.jsx(Le, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(G, { value: "item-3", children: [
5415
5400
  /* @__PURE__ */ e.jsx(Q, { children: "Filters" }),
5416
5401
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
5417
- /* @__PURE__ */ e.jsx(Te, {}),
5402
+ /* @__PURE__ */ e.jsx(Me, {}),
5418
5403
  /* @__PURE__ */ e.jsx(He, {})
5419
5404
  ] })
5420
5405
  ] }) }),
@@ -5518,7 +5503,7 @@ function sr() {
5518
5503
  case "map":
5519
5504
  return /* @__PURE__ */ e.jsx(Jl, {});
5520
5505
  case "custom":
5521
- return /* @__PURE__ */ e.jsx(Ml, {});
5506
+ return /* @__PURE__ */ e.jsx(Ll, {});
5522
5507
  default:
5523
5508
  return /* @__PURE__ */ e.jsx(Hl, {});
5524
5509
  }
@@ -5572,14 +5557,14 @@ function ar() {
5572
5557
  );
5573
5558
  }
5574
5559
  function tr({ authToken: s, onSave: t, onClose: a }) {
5575
- z((i) => i.themeStyle);
5576
- const n = m((i) => i.actions.setOnSave), l = m((i) => i.actions.setOnClose), d = z((i) => i.actions.setAuthToken);
5560
+ I((u) => u.themeStyle);
5561
+ const n = m((u) => u.actions.setOnSave), l = m((u) => u.actions.setOnClose), r = I((u) => u.actions.setAuthToken);
5577
5562
  return se(() => {
5578
5563
  t && n(t), a && l(a);
5579
5564
  }, [t, n, a, l]), se(() => {
5580
- s && s.accessToken && d(s);
5581
- }, [s, d]), /* @__PURE__ */ e.jsx(xs, { FallbackComponent: za, children: /* @__PURE__ */ e.jsxs(
5582
- xn,
5565
+ s && s.accessToken && r(s);
5566
+ }, [s, r]), /* @__PURE__ */ e.jsx(ps, { FallbackComponent: za, children: /* @__PURE__ */ e.jsxs(
5567
+ pn,
5583
5568
  {
5584
5569
  style: {
5585
5570
  // borderRadius: currentStyle?.chart?.options?.borderRadius,
@@ -5588,19 +5573,19 @@ function tr({ authToken: s, onSave: t, onClose: a }) {
5588
5573
  className: "rounded-none",
5589
5574
  role: "editor-panel",
5590
5575
  children: [
5591
- /* @__PURE__ */ e.jsx(pn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Aa, {}) }),
5592
- /* @__PURE__ */ e.jsx(fn, { children: /* @__PURE__ */ e.jsx(ar, {}) })
5576
+ /* @__PURE__ */ e.jsx(fn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Aa, {}) }),
5577
+ /* @__PURE__ */ e.jsx(gn, { children: /* @__PURE__ */ e.jsx(ar, {}) })
5593
5578
  ]
5594
5579
  }
5595
5580
  ) });
5596
5581
  }
5597
5582
  function nr() {
5598
- z((i) => i.selectedCardId);
5599
- const s = z((i) => i.selectedSheetId), { setIsVisualEditing: t } = z((i) => i.actions), a = z((i) => i.isVisualEditing), n = z((i) => i.actions.updateFrame);
5600
- function l(i) {
5601
- s && (n(s, i), t(!1));
5583
+ I((u) => u.selectedCardId);
5584
+ const s = I((u) => u.selectedSheetId), { setIsVisualEditing: t } = I((u) => u.actions), a = I((u) => u.isVisualEditing), n = I((u) => u.actions.updateFrame);
5585
+ function l(u) {
5586
+ s && (n(s, u), t(!1));
5602
5587
  }
5603
- function d() {
5588
+ function r() {
5604
5589
  t(!1);
5605
5590
  }
5606
5591
  return /* @__PURE__ */ e.jsx(
@@ -5610,52 +5595,45 @@ function nr() {
5610
5595
  className: K("flex grow", {
5611
5596
  "max-h-0 overflow-hidden": !a
5612
5597
  }),
5613
- children: /* @__PURE__ */ e.jsx(tr, { onSave: l, onClose: d })
5598
+ children: /* @__PURE__ */ e.jsx(tr, { onSave: l, onClose: r })
5614
5599
  }
5615
5600
  );
5616
5601
  }
5617
5602
  function lr() {
5618
- m((i) => i.selectedConnectionId), m((i) => i.selectedDatamodelId);
5619
- const s = m((i) => i.selectedDatabaseName);
5620
- m((i) => i.selectedSchemaName);
5621
- const t = m((i) => i.selectedTableName), a = z((i) => i.dashboard.filters) || [];
5622
- z((i) => i.actions.addFilter), z((i) => i.actions.removeFilter), z(
5623
- (i) => i.actions.removeFilterValue
5624
- );
5625
- const { modelItems: n, columns: l } = _e(), { assignFilter: d } = Xa();
5626
- return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: l == null ? void 0 : l.map((i) => {
5627
- const o = a == null ? void 0 : a.find(
5628
- (c) => c.column === de(i.column_name) && c.table === t && c.database === s
5603
+ const s = m((r) => r.selectedDatabaseName), t = m((r) => r.selectedTableName), a = I((r) => r.dashboard.filters) || [], { columns: n } = _e(), { assignFilter: l } = Xa();
5604
+ return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: n == null ? void 0 : n.map((r) => {
5605
+ const u = a == null ? void 0 : a.find(
5606
+ (o) => o.column === de(r.column_name) && o.table === t && o.database === s
5629
5607
  );
5630
5608
  return /* @__PURE__ */ e.jsx(
5631
5609
  "div",
5632
5610
  {
5633
- onClick: () => d(i),
5611
+ onClick: () => l(r),
5634
5612
  className: K(
5635
5613
  "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",
5636
5614
  {
5637
- "bg-muted": o
5615
+ "bg-muted": u
5638
5616
  }
5639
5617
  ),
5640
5618
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
5641
- /* @__PURE__ */ e.jsx(Ea, { column: i }),
5642
- /* @__PURE__ */ e.jsx("span", { children: i.column_name })
5619
+ /* @__PURE__ */ e.jsx(Ea, { column: r }),
5620
+ /* @__PURE__ */ e.jsx("span", { children: r.column_name })
5643
5621
  ] })
5644
5622
  },
5645
- i.column_name
5623
+ r.column_name
5646
5624
  );
5647
5625
  }) });
5648
5626
  }
5649
5627
  function rr() {
5650
- z((t) => t.showFilters);
5651
- const s = z(
5628
+ I((t) => t.showFilters);
5629
+ const s = I(
5652
5630
  (t) => t.actions.setShowFilters
5653
5631
  );
5654
5632
  return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
5655
5633
  /* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
5656
5634
  /* @__PURE__ */ e.jsx(_, { className: "text-lg", children: "Filters" }),
5657
5635
  /* @__PURE__ */ e.jsx(
5658
- O,
5636
+ z,
5659
5637
  {
5660
5638
  onClick: () => s(!1),
5661
5639
  className: "h-7 w-7 p-0",
@@ -5679,7 +5657,7 @@ function rr() {
5679
5657
  ] });
5680
5658
  }
5681
5659
  function ir() {
5682
- const s = z((a) => a.showFilters), t = z((a) => a.isVisualEditing);
5660
+ const s = I((a) => a.showFilters), t = I((a) => a.isVisualEditing);
5683
5661
  return /* @__PURE__ */ e.jsxs(
5684
5662
  "div",
5685
5663
  {
@@ -5689,17 +5667,17 @@ function ir() {
5689
5667
  "flex grow": !t
5690
5668
  }),
5691
5669
  children: [
5692
- /* @__PURE__ */ e.jsx(gn, {}),
5670
+ /* @__PURE__ */ e.jsx(jn, {}),
5693
5671
  s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(rr, {}) })
5694
5672
  ]
5695
5673
  }
5696
5674
  );
5697
5675
  }
5698
5676
  function or() {
5699
- const s = z((n) => n.dashboard), t = z((n) => n.actions.setDashboard), a = z(
5677
+ const s = I((n) => n.dashboard), t = I((n) => n.actions.setDashboard), a = I(
5700
5678
  (n) => n.showDashboardJSON
5701
5679
  );
5702
- return z(
5680
+ return I(
5703
5681
  (n) => n.actions.setShowDashboardJSON
5704
5682
  ), /* @__PURE__ */ e.jsx(
5705
5683
  "div",
@@ -5708,7 +5686,7 @@ function or() {
5708
5686
  hidden: !a
5709
5687
  }),
5710
5688
  children: /* @__PURE__ */ e.jsx(
5711
- jn,
5689
+ bn,
5712
5690
  {
5713
5691
  onChange: (n) => {
5714
5692
  if (n)
@@ -5744,11 +5722,11 @@ function mr({
5744
5722
  showFooter: t = !0,
5745
5723
  ...a
5746
5724
  }) {
5747
- return /* @__PURE__ */ e.jsx(xs, { FallbackComponent: za, children: /* @__PURE__ */ e.jsxs(bn, { dashboardProps: a, children: [
5748
- /* @__PURE__ */ e.jsx(yn, {}),
5749
- /* @__PURE__ */ e.jsxs(vn, { children: [
5725
+ return /* @__PURE__ */ e.jsx(ps, { FallbackComponent: za, children: /* @__PURE__ */ e.jsxs(yn, { dashboardProps: a, children: [
5726
+ /* @__PURE__ */ e.jsx(vn, {}),
5727
+ /* @__PURE__ */ e.jsxs(Cn, { children: [
5750
5728
  /* @__PURE__ */ e.jsx(or, {}),
5751
- /* @__PURE__ */ e.jsxs(Cn, { ...a, children: [
5729
+ /* @__PURE__ */ e.jsxs(Nn, { ...a, children: [
5752
5730
  s && /* @__PURE__ */ e.jsx(ll, {}),
5753
5731
  /* @__PURE__ */ e.jsx(nr, {}),
5754
5732
  /* @__PURE__ */ e.jsx(ir, {})
@@ -5757,17 +5735,16 @@ function mr({
5757
5735
  ] }) });
5758
5736
  }
5759
5737
  export {
5760
- Ta as A,
5761
- wn as B,
5762
- kn as C,
5738
+ Ma as A,
5739
+ kn as B,
5740
+ zn as C,
5763
5741
  mr as D,
5764
- Da as E,
5742
+ Fa as E,
5765
5743
  Xn as F,
5766
5744
  Mn as G,
5767
- Tn as H,
5768
- Vn as I,
5745
+ En as H,
5769
5746
  qn as L,
5770
- La as M,
5747
+ Ta as M,
5771
5748
  $n as N,
5772
5749
  Pn as P,
5773
5750
  Un as S,
@@ -5777,21 +5754,21 @@ export {
5777
5754
  Us as b,
5778
5755
  Oa as c,
5779
5756
  Ia as d,
5780
- Fa as e,
5781
- zn as f,
5782
- On as g,
5783
- In as h,
5757
+ Da as e,
5758
+ On as f,
5759
+ In as g,
5760
+ Dn as h,
5784
5761
  Fn as i,
5785
5762
  Ln as j,
5786
- Dn as k,
5787
- En as l,
5788
- An as m,
5763
+ Tn as k,
5764
+ An as l,
5765
+ Vn as m,
5789
5766
  Rn as n,
5790
5767
  _n as o,
5791
5768
  qe as p,
5792
5769
  Hn as q,
5793
5770
  Bn as r,
5794
- Ma as s,
5771
+ La as s,
5795
5772
  Gn as t,
5796
5773
  Qn as u,
5797
5774
  Jn as v,