react-semaphor 0.0.373 → 0.0.376
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{index-pk0uZ8VC.js → index-BHFp3m2S.js} +582 -576
- package/dist/chunks/{index-PwLsV4fg.js → index-BOpp3w2L.js} +4649 -4585
- package/dist/chunks/{index-DBKBp-W0.js → index-CrjQ8QqC.js} +3 -3
- package/dist/chunks/{index-B0RxketE.js → index-F8s-l6Wu.js} +55 -55
- package/dist/chunks/{lucide-react-DXbiJQ14.js → lucide-react-BCNS53ze.js} +3 -3
- package/dist/chunks/{lucide-react-D0ZbXxNx.js → lucide-react-CxAXGpsK.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as P, x as ks, y as
|
|
1
|
+
import { c as P, x as ks, y as O, z as Ze, A as Ie, B as e, H as zs, J as Os, K as M, p as Xe, M as Is, N as Ts, Q as Ms, R as Ds, V as $, W as de, Y as ha, Z as Fs, _ as Ls, $ as Es, a0 as ma, a1 as xa, a2 as it, a3 as ea, a4 as Y, a5 as Je, i as ot, a6 as h, a7 as ct, a8 as dt, P as pa, F as fa, a9 as We, aa as Ke, ab as ga, ac as ut, ad as ja, ae as ge, af as je, ag as be, ah as ve, ai as ke, aj as ye, ak as se, al as Vs, am as As, an as qs, ao as ba, ap as va, aq as pe, ar as ht, as as mt, at as ya, au as xt, C as pt, av as ft, aw as Na, ax as Ne, ay as gt, az as _e, aA as Ns, aB as De, aC as Re, aD as ze, aE as jt, aF as bt, aG as sa, aH as vt, X as ds, aI as yt, aJ as Nt, aK as Ct, aL as St, aM as vs, l as wt, aN as kt, aO as zt, aP as Le, aQ as le, aR as Ca, aS as Ot, aT as us, aU as It, aV as Tt, aW as Cs, o as Mt, a as Dt, aX as ls, aY as we, aZ as rs, a_ as Ft, a$ as Lt, b0 as Et, b1 as Vt, b2 as ys, b3 as At, b4 as aa, b5 as qt, b6 as ta, b7 as Rt, b8 as _t, b9 as Ht, ba as Pt, bb as Sa, bc as $t, bd as Rs, be as wa, bf as Bt, bg as Ut, bh as as, bi as Gt, bj as Jt, bk as ka, bl as Wt, u as Kt, bm as Qt, bn as Zt, s as Xt, bo as hs, bp as za, bq as Oa, br as Ia, bs as ts, bt as ns, bu as Yt, bv as Se, bw as en, bx as sn, by as ms, bz as xs, bA as ps, bB as an, I as tn, bC as nn, bD as ln, bE as rn, bF as on, E as cn, bG as fs, bH as Fe, f as dn, bI as Be, bJ as _s, bK as Ta, bL as un, bM as hn, bN as is, bO as mn, bP as xn, bQ as pn, bR as fn, bS as na, bT as la, bU as Ma, bV as gn, bW as jn, bX as bn, bY as vn, bZ as yn, b_ as Nn, b$ as Cn, c0 as Sn, c1 as Ee, c2 as Q, c3 as Z, c4 as Hs, c5 as X, c6 as wn, c7 as Da, c8 as kn, c9 as zn, ca as On, cb as In, cc as Tn, cd as Mn, ce as Dn, cf as Fn, cg as Ln } from "./index-BOpp3w2L.js";
|
|
2
2
|
import * as ra from "react";
|
|
3
|
-
import
|
|
3
|
+
import Oe, { useState as H, useMemo as Ss, useEffect as te, useRef as Ue, useCallback as Fa, Suspense as En } 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
|
|
11
|
+
const Vn = P("Box", [
|
|
12
12
|
[
|
|
13
13
|
"path",
|
|
14
14
|
{
|
|
@@ -25,7 +25,7 @@ const En = P("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
|
|
28
|
+
const An = P("Braces", [
|
|
29
29
|
[
|
|
30
30
|
"path",
|
|
31
31
|
{ d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1", key: "ezmyqa" }
|
|
@@ -44,7 +44,7 @@ const Vn = P("Braces", [
|
|
|
44
44
|
* This source code is licensed under the ISC license.
|
|
45
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
|
-
const
|
|
47
|
+
const qn = P("ChartArea", [
|
|
48
48
|
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
|
|
49
49
|
[
|
|
50
50
|
"path",
|
|
@@ -123,7 +123,7 @@ const Va = P("ChartScatter", [
|
|
|
123
123
|
* This source code is licensed under the ISC license.
|
|
124
124
|
* See the LICENSE file in the root directory of this source tree.
|
|
125
125
|
*/
|
|
126
|
-
const
|
|
126
|
+
const Rn = P("CircleX", [
|
|
127
127
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
128
128
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
129
129
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
@@ -134,7 +134,7 @@ const qn = P("CircleX", [
|
|
|
134
134
|
* This source code is licensed under the ISC license.
|
|
135
135
|
* See the LICENSE file in the root directory of this source tree.
|
|
136
136
|
*/
|
|
137
|
-
const
|
|
137
|
+
const _n = P("CopyPlus", [
|
|
138
138
|
["line", { x1: "15", x2: "15", y1: "12", y2: "18", key: "1p7wdc" }],
|
|
139
139
|
["line", { x1: "12", x2: "18", y1: "15", y2: "15", key: "1nscbv" }],
|
|
140
140
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
@@ -146,7 +146,7 @@ const Rn = P("CopyPlus", [
|
|
|
146
146
|
* This source code is licensed under the ISC license.
|
|
147
147
|
* See the LICENSE file in the root directory of this source tree.
|
|
148
148
|
*/
|
|
149
|
-
const
|
|
149
|
+
const Hn = P("Database", [
|
|
150
150
|
["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
|
|
151
151
|
["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
|
|
152
152
|
["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
|
|
@@ -168,7 +168,7 @@ const Bs = P("EllipsisVertical", [
|
|
|
168
168
|
* This source code is licensed under the ISC license.
|
|
169
169
|
* See the LICENSE file in the root directory of this source tree.
|
|
170
170
|
*/
|
|
171
|
-
const
|
|
171
|
+
const Pn = P("Eraser", [
|
|
172
172
|
[
|
|
173
173
|
"path",
|
|
174
174
|
{
|
|
@@ -185,7 +185,7 @@ const Hn = P("Eraser", [
|
|
|
185
185
|
* This source code is licensed under the ISC license.
|
|
186
186
|
* See the LICENSE file in the root directory of this source tree.
|
|
187
187
|
*/
|
|
188
|
-
const
|
|
188
|
+
const $n = P("EyeClosed", [
|
|
189
189
|
["path", { d: "m15 18-.722-3.25", key: "1j64jw" }],
|
|
190
190
|
["path", { d: "M2 8a10.645 10.645 0 0 0 20 0", key: "1e7gxb" }],
|
|
191
191
|
["path", { d: "m20 15-1.726-2.05", key: "1cnuld" }],
|
|
@@ -198,7 +198,7 @@ const Pn = P("EyeClosed", [
|
|
|
198
198
|
* This source code is licensed under the ISC license.
|
|
199
199
|
* See the LICENSE file in the root directory of this source tree.
|
|
200
200
|
*/
|
|
201
|
-
const
|
|
201
|
+
const Bn = P("FileJson2", [
|
|
202
202
|
["path", { d: "M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4", key: "1pf5j1" }],
|
|
203
203
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
204
204
|
[
|
|
@@ -216,7 +216,7 @@ const $n = P("FileJson2", [
|
|
|
216
216
|
* This source code is licensed under the ISC license.
|
|
217
217
|
* See the LICENSE file in the root directory of this source tree.
|
|
218
218
|
*/
|
|
219
|
-
const
|
|
219
|
+
const Un = P("Glasses", [
|
|
220
220
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
221
221
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
222
222
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -229,7 +229,7 @@ const Bn = P("Glasses", [
|
|
|
229
229
|
* This source code is licensed under the ISC license.
|
|
230
230
|
* See the LICENSE file in the root directory of this source tree.
|
|
231
231
|
*/
|
|
232
|
-
const
|
|
232
|
+
const Gn = P("Hammer", [
|
|
233
233
|
["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
|
|
234
234
|
["path", { d: "m18 15 4-4", key: "16gjal" }],
|
|
235
235
|
[
|
|
@@ -246,7 +246,7 @@ const Un = P("Hammer", [
|
|
|
246
246
|
* This source code is licensed under the ISC license.
|
|
247
247
|
* See the LICENSE file in the root directory of this source tree.
|
|
248
248
|
*/
|
|
249
|
-
const
|
|
249
|
+
const Jn = P("Hash", [
|
|
250
250
|
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
251
251
|
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
252
252
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
@@ -258,7 +258,7 @@ const Gn = P("Hash", [
|
|
|
258
258
|
* This source code is licensed under the ISC license.
|
|
259
259
|
* See the LICENSE file in the root directory of this source tree.
|
|
260
260
|
*/
|
|
261
|
-
const
|
|
261
|
+
const Wn = P("House", [
|
|
262
262
|
["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
|
|
263
263
|
[
|
|
264
264
|
"path",
|
|
@@ -274,7 +274,7 @@ const Jn = P("House", [
|
|
|
274
274
|
* This source code is licensed under the ISC license.
|
|
275
275
|
* See the LICENSE file in the root directory of this source tree.
|
|
276
276
|
*/
|
|
277
|
-
const
|
|
277
|
+
const Kn = P("ListEnd", [
|
|
278
278
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
279
279
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
280
280
|
["path", { d: "M10 18H3", key: "13769t" }],
|
|
@@ -287,7 +287,7 @@ const Wn = P("ListEnd", [
|
|
|
287
287
|
* This source code is licensed under the ISC license.
|
|
288
288
|
* See the LICENSE file in the root directory of this source tree.
|
|
289
289
|
*/
|
|
290
|
-
const
|
|
290
|
+
const Qn = P("ListStart", [
|
|
291
291
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
292
292
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
293
293
|
["path", { d: "M10 6H3", key: "lf8lx7" }],
|
|
@@ -300,7 +300,7 @@ const Kn = P("ListStart", [
|
|
|
300
300
|
* This source code is licensed under the ISC license.
|
|
301
301
|
* See the LICENSE file in the root directory of this source tree.
|
|
302
302
|
*/
|
|
303
|
-
const
|
|
303
|
+
const Zn = P("ListX", [
|
|
304
304
|
["path", { d: "M11 12H3", key: "51ecnj" }],
|
|
305
305
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
306
306
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
@@ -339,7 +339,7 @@ const Aa = P("Map", [
|
|
|
339
339
|
* This source code is licensed under the ISC license.
|
|
340
340
|
* See the LICENSE file in the root directory of this source tree.
|
|
341
341
|
*/
|
|
342
|
-
const
|
|
342
|
+
const Xn = P("MessageSquareMore", [
|
|
343
343
|
["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" }],
|
|
344
344
|
["path", { d: "M8 10h.01", key: "19clt8" }],
|
|
345
345
|
["path", { d: "M12 10h.01", key: "1nrarc" }],
|
|
@@ -351,7 +351,7 @@ const Zn = P("MessageSquareMore", [
|
|
|
351
351
|
* This source code is licensed under the ISC license.
|
|
352
352
|
* See the LICENSE file in the root directory of this source tree.
|
|
353
353
|
*/
|
|
354
|
-
const
|
|
354
|
+
const Yn = P("Network", [
|
|
355
355
|
["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
|
|
356
356
|
["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
|
|
357
357
|
["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
|
|
@@ -364,7 +364,7 @@ const Xn = P("Network", [
|
|
|
364
364
|
* This source code is licensed under the ISC license.
|
|
365
365
|
* See the LICENSE file in the root directory of this source tree.
|
|
366
366
|
*/
|
|
367
|
-
const
|
|
367
|
+
const el = P("Plug2", [
|
|
368
368
|
["path", { d: "M9 2v6", key: "17ngun" }],
|
|
369
369
|
["path", { d: "M15 2v6", key: "s7yy2p" }],
|
|
370
370
|
["path", { d: "M12 17v5", key: "bb1du9" }],
|
|
@@ -377,7 +377,7 @@ const Yn = P("Plug2", [
|
|
|
377
377
|
* This source code is licensed under the ISC license.
|
|
378
378
|
* See the LICENSE file in the root directory of this source tree.
|
|
379
379
|
*/
|
|
380
|
-
const
|
|
380
|
+
const sl = P("RefreshCw", [
|
|
381
381
|
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
382
382
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
383
383
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
@@ -389,7 +389,7 @@ const el = P("RefreshCw", [
|
|
|
389
389
|
* This source code is licensed under the ISC license.
|
|
390
390
|
* See the LICENSE file in the root directory of this source tree.
|
|
391
391
|
*/
|
|
392
|
-
const
|
|
392
|
+
const al = P("Save", [
|
|
393
393
|
[
|
|
394
394
|
"path",
|
|
395
395
|
{
|
|
@@ -423,7 +423,7 @@ const qa = P("Shapes", [
|
|
|
423
423
|
* This source code is licensed under the ISC license.
|
|
424
424
|
* See the LICENSE file in the root directory of this source tree.
|
|
425
425
|
*/
|
|
426
|
-
const
|
|
426
|
+
const tl = P("ShieldQuestion", [
|
|
427
427
|
[
|
|
428
428
|
"path",
|
|
429
429
|
{
|
|
@@ -440,7 +440,7 @@ const al = P("ShieldQuestion", [
|
|
|
440
440
|
* This source code is licensed under the ISC license.
|
|
441
441
|
* See the LICENSE file in the root directory of this source tree.
|
|
442
442
|
*/
|
|
443
|
-
const
|
|
443
|
+
const nl = P("Sigma", [
|
|
444
444
|
[
|
|
445
445
|
"path",
|
|
446
446
|
{
|
|
@@ -455,7 +455,7 @@ const tl = P("Sigma", [
|
|
|
455
455
|
* This source code is licensed under the ISC license.
|
|
456
456
|
* See the LICENSE file in the root directory of this source tree.
|
|
457
457
|
*/
|
|
458
|
-
const
|
|
458
|
+
const ll = P("SwatchBook", [
|
|
459
459
|
["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
|
|
460
460
|
["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
|
|
461
461
|
["path", { d: "M 7 17h.01", key: "1euzgo" }],
|
|
@@ -485,7 +485,7 @@ const Us = P("Table", [
|
|
|
485
485
|
* This source code is licensed under the ISC license.
|
|
486
486
|
* See the LICENSE file in the root directory of this source tree.
|
|
487
487
|
*/
|
|
488
|
-
const
|
|
488
|
+
const rl = P("Tag", [
|
|
489
489
|
[
|
|
490
490
|
"path",
|
|
491
491
|
{
|
|
@@ -501,7 +501,7 @@ const ll = P("Tag", [
|
|
|
501
501
|
* This source code is licensed under the ISC license.
|
|
502
502
|
* See the LICENSE file in the root directory of this source tree.
|
|
503
503
|
*/
|
|
504
|
-
const
|
|
504
|
+
const il = P("TicketX", [
|
|
505
505
|
[
|
|
506
506
|
"path",
|
|
507
507
|
{
|
|
@@ -518,7 +518,7 @@ const rl = P("TicketX", [
|
|
|
518
518
|
* This source code is licensed under the ISC license.
|
|
519
519
|
* See the LICENSE file in the root directory of this source tree.
|
|
520
520
|
*/
|
|
521
|
-
const
|
|
521
|
+
const ol = P("ToggleLeft", [
|
|
522
522
|
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
|
|
523
523
|
["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
|
|
524
524
|
]);
|
|
@@ -545,14 +545,14 @@ function Ra(s) {
|
|
|
545
545
|
var r;
|
|
546
546
|
return {
|
|
547
547
|
...l,
|
|
548
|
-
cards: (r = l.cards) == null ? void 0 : r.map((i) =>
|
|
548
|
+
cards: (r = l.cards) == null ? void 0 : r.map((i) => cl(i))
|
|
549
549
|
};
|
|
550
550
|
})
|
|
551
551
|
};
|
|
552
552
|
})
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
|
-
function
|
|
555
|
+
function cl(s) {
|
|
556
556
|
var t, a, n, l;
|
|
557
557
|
return {
|
|
558
558
|
...s,
|
|
@@ -567,12 +567,12 @@ function ol(s) {
|
|
|
567
567
|
}))
|
|
568
568
|
}
|
|
569
569
|
},
|
|
570
|
-
customCfg:
|
|
570
|
+
customCfg: dl(s.customCfg),
|
|
571
571
|
// if customCfg is present, clean it, otherwise return null{
|
|
572
572
|
data: []
|
|
573
573
|
};
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function dl(s) {
|
|
576
576
|
var t, a;
|
|
577
577
|
return s ? {
|
|
578
578
|
...s,
|
|
@@ -586,7 +586,7 @@ function cl(s) {
|
|
|
586
586
|
}
|
|
587
587
|
} : null;
|
|
588
588
|
}
|
|
589
|
-
async function
|
|
589
|
+
async function ul(s, t, a, n) {
|
|
590
590
|
if (!n)
|
|
591
591
|
return null;
|
|
592
592
|
const l = JSON.stringify(t);
|
|
@@ -610,19 +610,19 @@ async function ws(s, t) {
|
|
|
610
610
|
operation: "update"
|
|
611
611
|
});
|
|
612
612
|
}
|
|
613
|
-
async function
|
|
613
|
+
async function hl(s, t) {
|
|
614
614
|
return t ? await ks("https://semaphor.cloud/api/v1/lens", t, {
|
|
615
615
|
operation: "delete",
|
|
616
616
|
lensId: s
|
|
617
617
|
}) : null;
|
|
618
618
|
}
|
|
619
|
-
function
|
|
620
|
-
const [s, t] = H(""), [a, n] = H(!1), l =
|
|
619
|
+
function ml() {
|
|
620
|
+
const [s, t] = H(""), [a, n] = H(!1), l = O((p) => p.lenses), { setLenses: r, setSelectedLensId: i } = Ze(), [o, d] = H(!1), [u, m] = H(!1), g = O((p) => p.dashboard), v = O((p) => p.filterValues), { authToken: c } = Ie();
|
|
621
621
|
async function x() {
|
|
622
622
|
d(!0);
|
|
623
623
|
const p = Ra(
|
|
624
624
|
g
|
|
625
|
-
), S = await
|
|
625
|
+
), S = await ul(
|
|
626
626
|
s,
|
|
627
627
|
p,
|
|
628
628
|
v,
|
|
@@ -630,9 +630,9 @@ function hl() {
|
|
|
630
630
|
);
|
|
631
631
|
S && (r([...l || [], S]), i(S.id), m(!1)), d(!1);
|
|
632
632
|
}
|
|
633
|
-
return /* @__PURE__ */ e.jsxs(
|
|
634
|
-
/* @__PURE__ */ e.jsx(
|
|
635
|
-
|
|
633
|
+
return /* @__PURE__ */ e.jsxs(zs, { open: u, onOpenChange: m, children: [
|
|
634
|
+
/* @__PURE__ */ e.jsx(Os, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
635
|
+
M,
|
|
636
636
|
{
|
|
637
637
|
variant: "secondary",
|
|
638
638
|
className: "h-7 p-2",
|
|
@@ -644,8 +644,8 @@ function hl() {
|
|
|
644
644
|
}
|
|
645
645
|
) }),
|
|
646
646
|
/* @__PURE__ */ e.jsxs(Is, { className: "sm:max-w-[425px]", children: [
|
|
647
|
-
/* @__PURE__ */ e.jsxs(
|
|
648
|
-
/* @__PURE__ */ e.jsx(
|
|
647
|
+
/* @__PURE__ */ e.jsxs(Ts, { children: [
|
|
648
|
+
/* @__PURE__ */ e.jsx(Ms, { children: "Create Lens" }),
|
|
649
649
|
/* @__PURE__ */ e.jsx(Ds, { children: "Lenses are private by default and are only visible to you." })
|
|
650
650
|
] }),
|
|
651
651
|
/* @__PURE__ */ e.jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-8 items-center gap-4", children: [
|
|
@@ -664,7 +664,7 @@ function hl() {
|
|
|
664
664
|
] }) }),
|
|
665
665
|
a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
|
|
666
666
|
/* @__PURE__ */ e.jsx(ha, { children: /* @__PURE__ */ e.jsx(
|
|
667
|
-
|
|
667
|
+
M,
|
|
668
668
|
{
|
|
669
669
|
size: "sm",
|
|
670
670
|
variant: "outline",
|
|
@@ -677,13 +677,13 @@ function hl() {
|
|
|
677
677
|
] })
|
|
678
678
|
] });
|
|
679
679
|
}
|
|
680
|
-
function
|
|
681
|
-
const [s, t] = H(!1), a =
|
|
680
|
+
function xl() {
|
|
681
|
+
const [s, t] = H(!1), a = O((m) => m.lenses), n = O((m) => m.selectedLensId), { setLenses: l, setSelectedLensId: r } = Ze(), { authToken: i } = Ie();
|
|
682
682
|
async function o(m) {
|
|
683
683
|
r(m);
|
|
684
684
|
}
|
|
685
685
|
async function d(m) {
|
|
686
|
-
if (await
|
|
686
|
+
if (await hl(m, i == null ? void 0 : i.accessToken)) {
|
|
687
687
|
const v = a == null ? void 0 : a.filter((c) => c.id !== m);
|
|
688
688
|
l(v || []), r("original");
|
|
689
689
|
}
|
|
@@ -712,12 +712,12 @@ function ml() {
|
|
|
712
712
|
}
|
|
713
713
|
}
|
|
714
714
|
return /* @__PURE__ */ e.jsxs(Fs, { open: s, onOpenChange: t, children: [
|
|
715
|
-
/* @__PURE__ */ e.jsx(Ls, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
715
|
+
/* @__PURE__ */ e.jsx(Ls, { asChild: !0, children: /* @__PURE__ */ e.jsx(M, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Un, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
|
|
716
716
|
/* @__PURE__ */ e.jsxs(Es, { align: "end", className: "w-60", children: [
|
|
717
717
|
/* @__PURE__ */ e.jsx(ma, { className: "px-3", children: "Lenses" }),
|
|
718
718
|
/* @__PURE__ */ e.jsx(xa, {}),
|
|
719
719
|
/* @__PURE__ */ e.jsxs(
|
|
720
|
-
|
|
720
|
+
it,
|
|
721
721
|
{
|
|
722
722
|
value: n,
|
|
723
723
|
onValueChange: o,
|
|
@@ -732,7 +732,7 @@ function ml() {
|
|
|
732
732
|
/* @__PURE__ */ e.jsx("p", { children: m.name }),
|
|
733
733
|
/* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-3", children: [
|
|
734
734
|
/* @__PURE__ */ e.jsx(
|
|
735
|
-
|
|
735
|
+
Wn,
|
|
736
736
|
{
|
|
737
737
|
onClick: (g) => {
|
|
738
738
|
g.preventDefault(), u(m);
|
|
@@ -748,7 +748,7 @@ function ml() {
|
|
|
748
748
|
}
|
|
749
749
|
),
|
|
750
750
|
/* @__PURE__ */ e.jsx(
|
|
751
|
-
|
|
751
|
+
Je,
|
|
752
752
|
{
|
|
753
753
|
onClick: (g) => {
|
|
754
754
|
g.preventDefault(), d(m.id);
|
|
@@ -768,15 +768,15 @@ function ml() {
|
|
|
768
768
|
] })
|
|
769
769
|
] });
|
|
770
770
|
}
|
|
771
|
-
async function
|
|
771
|
+
async function pl() {
|
|
772
772
|
var c;
|
|
773
|
-
const s =
|
|
773
|
+
const s = O.getState().authToken, t = O.getState().theme, a = O.getState().filterValues, n = (c = O.getState().dashboard) == null ? void 0 : c.title, l = O.getState().isDownloadingPdf, r = O.getState().selectedSheetId;
|
|
774
774
|
if (l)
|
|
775
775
|
return;
|
|
776
776
|
const i = new URLSearchParams();
|
|
777
777
|
i.set("token", (s == null ? void 0 : s.accessToken) || ""), i.set("theme", t || "light"), i.set("filterValues", JSON.stringify(a)), i.set("selectedSheetId", r || "");
|
|
778
778
|
const o = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(i.toString())}`;
|
|
779
|
-
|
|
779
|
+
O.setState({ isDownloadingPdf: !0 });
|
|
780
780
|
const m = (await (await fetch(o, {
|
|
781
781
|
method: "GET",
|
|
782
782
|
headers: {
|
|
@@ -785,28 +785,28 @@ async function xl() {
|
|
|
785
785
|
})).json()).url, g = document.createElement("a");
|
|
786
786
|
g.href = m;
|
|
787
787
|
const v = `${n}-${(/* @__PURE__ */ new Date()).toISOString()}.pdf`;
|
|
788
|
-
g.download = v, g.click(),
|
|
788
|
+
g.download = v, g.click(), O.setState({ isDownloadingPdf: !1 });
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function fl({
|
|
791
791
|
iconClassName: s
|
|
792
792
|
}) {
|
|
793
|
-
Ie(),
|
|
793
|
+
Ie(), O((n) => {
|
|
794
794
|
var l;
|
|
795
795
|
return (l = n.dashboard) == null ? void 0 : l.title;
|
|
796
|
-
}),
|
|
797
|
-
const t =
|
|
796
|
+
}), O((n) => n.theme), O((n) => n.filterValues);
|
|
797
|
+
const t = O((n) => n.isDownloadingPdf);
|
|
798
798
|
async function a() {
|
|
799
|
-
await
|
|
799
|
+
await pl();
|
|
800
800
|
}
|
|
801
801
|
return /* @__PURE__ */ e.jsx(
|
|
802
|
-
|
|
802
|
+
M,
|
|
803
803
|
{
|
|
804
804
|
variant: "link",
|
|
805
805
|
className: "group h-7 p-2",
|
|
806
806
|
size: "sm",
|
|
807
807
|
onClick: a,
|
|
808
808
|
children: t ? /* @__PURE__ */ e.jsx(Qe, { className: Y("size-3.5 animate-spin", s) }) : /* @__PURE__ */ e.jsx(
|
|
809
|
-
|
|
809
|
+
ot,
|
|
810
810
|
{
|
|
811
811
|
className: Y("size-3.5", s),
|
|
812
812
|
strokeWidth: 1.5
|
|
@@ -815,31 +815,31 @@ function pl({
|
|
|
815
815
|
}
|
|
816
816
|
);
|
|
817
817
|
}
|
|
818
|
-
function
|
|
818
|
+
function gl() {
|
|
819
819
|
const { authToken: s } = Ie();
|
|
820
|
-
|
|
821
|
-
const t =
|
|
822
|
-
|
|
823
|
-
const r =
|
|
820
|
+
O((f) => f.theme);
|
|
821
|
+
const t = O((f) => f.lenses), a = O((f) => f.selectedLensId), n = t == null ? void 0 : t.find((f) => f.id === a), l = O((f) => f.dashboard);
|
|
822
|
+
O((f) => f.selectedSheetId);
|
|
823
|
+
const r = O(
|
|
824
824
|
(f) => f.isDashboardEditing
|
|
825
825
|
), i = h(
|
|
826
826
|
(f) => f.selectedConnectionId
|
|
827
|
-
), [o, d] = H(!1), u =
|
|
828
|
-
|
|
827
|
+
), [o, d] = H(!1), u = O((f) => f.filterValues), m = O((f) => f.isVisualEditing), g = O((f) => f.showFilters);
|
|
828
|
+
O(
|
|
829
829
|
(f) => f.showDashboardJSON
|
|
830
830
|
);
|
|
831
|
-
const v =
|
|
831
|
+
const v = O((f) => f.onSaveFunction), c = O(
|
|
832
832
|
(f) => f.actions.setShowFilters
|
|
833
|
-
), { addFrame: x, setSelectedFrameId: p } =
|
|
833
|
+
), { addFrame: x, setSelectedFrameId: p } = O(
|
|
834
834
|
(f) => f.actions
|
|
835
|
-
), { getSelectedSheet: S, setIsDashboardEditing: j, setShowDashboardJSON: A } =
|
|
836
|
-
() =>
|
|
835
|
+
), { getSelectedSheet: S, setIsDashboardEditing: j, setShowDashboardJSON: A } = O((f) => f.actions), D = S(), { tenantId: k, endUserId: C } = Ss(
|
|
836
|
+
() => ct(s == null ? void 0 : s.accessToken),
|
|
837
837
|
[s == null ? void 0 : s.accessToken]
|
|
838
838
|
), E = Ss(() => k || C, [k, C]), R = () => {
|
|
839
839
|
if (!r || !D) return;
|
|
840
840
|
const f = {
|
|
841
841
|
connectionId: i,
|
|
842
|
-
id:
|
|
842
|
+
id: We(),
|
|
843
843
|
title: "Title",
|
|
844
844
|
description: "Description",
|
|
845
845
|
preferences: {
|
|
@@ -854,7 +854,7 @@ function fl() {
|
|
|
854
854
|
sql: "select COUNT(*) from YOUR_TABLE",
|
|
855
855
|
data: []
|
|
856
856
|
}, b = {
|
|
857
|
-
id:
|
|
857
|
+
id: We(),
|
|
858
858
|
cards: [f],
|
|
859
859
|
activeCardId: f.id
|
|
860
860
|
};
|
|
@@ -871,7 +871,7 @@ function fl() {
|
|
|
871
871
|
template: b,
|
|
872
872
|
filterValues: u
|
|
873
873
|
};
|
|
874
|
-
await ws(N, s == null ? void 0 : s.accessToken),
|
|
874
|
+
await ws(N, s == null ? void 0 : s.accessToken), Ke.success("Lens saved"), v == null || v(f), d(!1);
|
|
875
875
|
}
|
|
876
876
|
return m ? null : /* @__PURE__ */ e.jsxs(
|
|
877
877
|
"div",
|
|
@@ -881,12 +881,12 @@ function fl() {
|
|
|
881
881
|
children: [
|
|
882
882
|
!m && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx($, { children: n == null ? void 0 : n.name }) }),
|
|
883
883
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
884
|
-
/* @__PURE__ */ e.jsx("button", { onClick:
|
|
885
|
-
/* @__PURE__ */ e.jsx(
|
|
886
|
-
r && !m && E && /* @__PURE__ */ e.jsx(
|
|
887
|
-
!m && E && /* @__PURE__ */ e.jsx(
|
|
884
|
+
/* @__PURE__ */ e.jsx("button", { onClick: dt, children: /* @__PURE__ */ e.jsx(il, { className: "h-4 w-4", strokeWidth: 1.5 }) }),
|
|
885
|
+
/* @__PURE__ */ e.jsx(fl, {}),
|
|
886
|
+
r && !m && E && /* @__PURE__ */ e.jsx(ml, {}),
|
|
887
|
+
!m && E && /* @__PURE__ */ e.jsx(xl, {}),
|
|
888
888
|
r && !m && /* @__PURE__ */ e.jsxs(
|
|
889
|
-
|
|
889
|
+
M,
|
|
890
890
|
{
|
|
891
891
|
variant: "secondary",
|
|
892
892
|
className: "h-7 p-2",
|
|
@@ -900,7 +900,7 @@ function fl() {
|
|
|
900
900
|
}
|
|
901
901
|
),
|
|
902
902
|
!r && /* @__PURE__ */ e.jsx(
|
|
903
|
-
|
|
903
|
+
M,
|
|
904
904
|
{
|
|
905
905
|
variant: "ghost",
|
|
906
906
|
className: "h-7 p-2",
|
|
@@ -910,7 +910,7 @@ function fl() {
|
|
|
910
910
|
}
|
|
911
911
|
),
|
|
912
912
|
r && !m && /* @__PURE__ */ e.jsx(
|
|
913
|
-
|
|
913
|
+
M,
|
|
914
914
|
{
|
|
915
915
|
variant: "ghost",
|
|
916
916
|
role: "close",
|
|
@@ -919,22 +919,22 @@ function fl() {
|
|
|
919
919
|
j(!1), A(!1);
|
|
920
920
|
},
|
|
921
921
|
size: "sm",
|
|
922
|
-
children: /* @__PURE__ */ e.jsx(
|
|
922
|
+
children: /* @__PURE__ */ e.jsx(Je, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
923
923
|
}
|
|
924
924
|
),
|
|
925
925
|
r && !m && E && /* @__PURE__ */ e.jsx(
|
|
926
|
-
|
|
926
|
+
M,
|
|
927
927
|
{
|
|
928
928
|
className: "h-7 p-2",
|
|
929
929
|
variant: "ghost",
|
|
930
930
|
disabled: o,
|
|
931
931
|
onClick: y,
|
|
932
932
|
size: "sm",
|
|
933
|
-
children: /* @__PURE__ */ e.jsx(
|
|
933
|
+
children: /* @__PURE__ */ e.jsx(al, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
934
934
|
}
|
|
935
935
|
),
|
|
936
936
|
!g && !m && r && /* @__PURE__ */ e.jsx(
|
|
937
|
-
|
|
937
|
+
M,
|
|
938
938
|
{
|
|
939
939
|
className: "h-7 p-2",
|
|
940
940
|
variant: "ghost",
|
|
@@ -950,7 +950,7 @@ function fl() {
|
|
|
950
950
|
}
|
|
951
951
|
);
|
|
952
952
|
}
|
|
953
|
-
function
|
|
953
|
+
function $e({
|
|
954
954
|
title: s,
|
|
955
955
|
items: t,
|
|
956
956
|
value: a,
|
|
@@ -967,19 +967,19 @@ function Pe({
|
|
|
967
967
|
const v = n ? "Loading..." : l ? "Error" : a;
|
|
968
968
|
function c() {
|
|
969
969
|
if (s === "Connection")
|
|
970
|
-
return /* @__PURE__ */ e.jsx(
|
|
970
|
+
return /* @__PURE__ */ e.jsx(el, { className: "size-4 rotate-90" });
|
|
971
971
|
if (s === "Database")
|
|
972
|
-
return /* @__PURE__ */ e.jsx(
|
|
972
|
+
return /* @__PURE__ */ e.jsx(Hn, { className: "size-4" });
|
|
973
973
|
if (s === "Schema")
|
|
974
|
-
return /* @__PURE__ */ e.jsx(
|
|
974
|
+
return /* @__PURE__ */ e.jsx(Yn, { className: "size-4" });
|
|
975
975
|
if (s === "Table")
|
|
976
976
|
return /* @__PURE__ */ e.jsx(Us, { className: "size-4" });
|
|
977
977
|
if (s === "Model")
|
|
978
|
-
return /* @__PURE__ */ e.jsx(
|
|
978
|
+
return /* @__PURE__ */ e.jsx(Vn, { className: "size-4" });
|
|
979
979
|
}
|
|
980
980
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
981
981
|
m && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: i ? /* @__PURE__ */ e.jsxs(ga, { children: [
|
|
982
|
-
/* @__PURE__ */ e.jsx(
|
|
982
|
+
/* @__PURE__ */ e.jsx(ut, { children: c() }),
|
|
983
983
|
/* @__PURE__ */ e.jsx(ja, { className: "text-xs", align: "start", children: i })
|
|
984
984
|
] }) : c() }),
|
|
985
985
|
/* @__PURE__ */ e.jsxs(ge, { disabled: g, value: v, onValueChange: o, children: [
|
|
@@ -1002,7 +1002,7 @@ function Pe({
|
|
|
1002
1002
|
n ? /* @__PURE__ */ e.jsx(ye, { children: "Loading..." }) : /* @__PURE__ */ e.jsxs(ye, { className: "flex items-center justify-between gap-2", children: [
|
|
1003
1003
|
s,
|
|
1004
1004
|
/* @__PURE__ */ e.jsx(
|
|
1005
|
-
|
|
1005
|
+
sl,
|
|
1006
1006
|
{
|
|
1007
1007
|
className: "mr-1 size-3 cursor-pointer text-muted-foreground hover:text-foreground",
|
|
1008
1008
|
onClick: r
|
|
@@ -1018,7 +1018,7 @@ function Pe({
|
|
|
1018
1018
|
] })
|
|
1019
1019
|
] });
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1021
|
+
function jl({ column: s }) {
|
|
1022
1022
|
const [t, a] = H(!1), n = h((x) => x.selectedTableName), l = h(
|
|
1023
1023
|
(x) => x.selectedSchemaName
|
|
1024
1024
|
), r = h(
|
|
@@ -1097,11 +1097,11 @@ function gl({ column: s }) {
|
|
|
1097
1097
|
}
|
|
1098
1098
|
function _a({ column: s }) {
|
|
1099
1099
|
return /* @__PURE__ */ e.jsxs(ga, { children: [
|
|
1100
|
-
/* @__PURE__ */ e.jsx(
|
|
1100
|
+
/* @__PURE__ */ e.jsx(ht, { asChild: !0, children: mt(s.data_type) ? /* @__PURE__ */ e.jsx(Gs, { className: "size-3" }) : ya(s.data_type) ? /* @__PURE__ */ e.jsx(Jn, { className: "size-3" }) : xt(s.data_type) ? /* @__PURE__ */ e.jsx(pt, { className: "size-3" }) : ft(s.data_type) ? /* @__PURE__ */ e.jsx(ol, { className: "size-3" }) : s.data_type.toLowerCase() === "json" ? /* @__PURE__ */ e.jsx(An, { className: "size-3" }) : /* @__PURE__ */ e.jsx(tl, { className: "size-3" }) }),
|
|
1101
1101
|
/* @__PURE__ */ e.jsx(ja, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
|
|
1102
1102
|
] });
|
|
1103
1103
|
}
|
|
1104
|
-
function
|
|
1104
|
+
function bl({
|
|
1105
1105
|
schemaName: s,
|
|
1106
1106
|
tableName: t,
|
|
1107
1107
|
columns: a,
|
|
@@ -1115,20 +1115,20 @@ function jl({
|
|
|
1115
1115
|
(y) => y.selectedSchemaName
|
|
1116
1116
|
), d = h((y) => y.selectedTableName), u = h(
|
|
1117
1117
|
(y) => y.selectedDatamodelId
|
|
1118
|
-
), m =
|
|
1118
|
+
), m = O(
|
|
1119
1119
|
(y) => y.dashboard.aiScopeTables
|
|
1120
1120
|
), { addToAIScope: g, removeFromAIScope: v } = Ze();
|
|
1121
|
-
|
|
1121
|
+
O((y) => y.actions);
|
|
1122
1122
|
const c = h((y) => y.actions.setRunSql), x = h((y) => y.actions.setSqlGen), p = h(
|
|
1123
1123
|
(y) => y.actions.setIsShowingVisual
|
|
1124
1124
|
), S = h((y) => y.actions.setCardSql), { connectionType: j, modelItems: A, selectedDatamodelName: D } = Ve();
|
|
1125
1125
|
function k(y) {
|
|
1126
|
-
var
|
|
1126
|
+
var T;
|
|
1127
1127
|
const f = ba(y, l);
|
|
1128
1128
|
x(f);
|
|
1129
|
-
const b = (
|
|
1129
|
+
const b = (T = A == null ? void 0 : A.find(
|
|
1130
1130
|
(q) => q.id === u
|
|
1131
|
-
)) == null ? void 0 :
|
|
1131
|
+
)) == null ? void 0 : T.name, N = va(
|
|
1132
1132
|
f,
|
|
1133
1133
|
pe(s),
|
|
1134
1134
|
pe(t),
|
|
@@ -1150,7 +1150,7 @@ function jl({
|
|
|
1150
1150
|
schemaName: o,
|
|
1151
1151
|
tableName: d,
|
|
1152
1152
|
datamodelName: D
|
|
1153
|
-
}),
|
|
1153
|
+
}), Ke.success("Added to Assistant Scope", {
|
|
1154
1154
|
position: "top-right",
|
|
1155
1155
|
duration: 2500,
|
|
1156
1156
|
richColors: !0
|
|
@@ -1159,7 +1159,7 @@ function jl({
|
|
|
1159
1159
|
connectionType: j || "",
|
|
1160
1160
|
tableName: d || "",
|
|
1161
1161
|
datamodelName: D || ""
|
|
1162
|
-
}),
|
|
1162
|
+
}), Ke("Removed from Assistant Scope", {
|
|
1163
1163
|
position: "top-right",
|
|
1164
1164
|
duration: 2e3,
|
|
1165
1165
|
richColors: !0
|
|
@@ -1212,7 +1212,7 @@ function jl({
|
|
|
1212
1212
|
}
|
|
1213
1213
|
),
|
|
1214
1214
|
/* @__PURE__ */ e.jsxs(
|
|
1215
|
-
|
|
1215
|
+
M,
|
|
1216
1216
|
{
|
|
1217
1217
|
disabled: n !== "Success",
|
|
1218
1218
|
onClick: R,
|
|
@@ -1220,13 +1220,13 @@ function jl({
|
|
|
1220
1220
|
variant: "secondary",
|
|
1221
1221
|
className: "flex",
|
|
1222
1222
|
children: [
|
|
1223
|
-
n !== "Success" ? /* @__PURE__ */ e.jsx(Qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(
|
|
1223
|
+
n !== "Success" ? /* @__PURE__ */ e.jsx(Qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(ll, { className: "mr-2 size-4" }),
|
|
1224
1224
|
"Top 10"
|
|
1225
1225
|
]
|
|
1226
1226
|
}
|
|
1227
1227
|
),
|
|
1228
1228
|
/* @__PURE__ */ e.jsxs(
|
|
1229
|
-
|
|
1229
|
+
M,
|
|
1230
1230
|
{
|
|
1231
1231
|
disabled: n !== "Success",
|
|
1232
1232
|
onClick: V,
|
|
@@ -1234,7 +1234,7 @@ function jl({
|
|
|
1234
1234
|
variant: "secondary",
|
|
1235
1235
|
className: "w-full",
|
|
1236
1236
|
children: [
|
|
1237
|
-
n !== "Success" ? /* @__PURE__ */ e.jsx(Qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(
|
|
1237
|
+
n !== "Success" ? /* @__PURE__ */ e.jsx(Qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(nl, { className: "mr-2 size-4" }),
|
|
1238
1238
|
"Count"
|
|
1239
1239
|
]
|
|
1240
1240
|
}
|
|
@@ -1252,7 +1252,7 @@ function jl({
|
|
|
1252
1252
|
className: Y(
|
|
1253
1253
|
"group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-1 text-sm transition-colors hover:bg-muted/50",
|
|
1254
1254
|
{
|
|
1255
|
-
"border border-dashed border-muted-foreground bg-muted":
|
|
1255
|
+
"border border-dashed border-muted-foreground bg-muted": gt(y, l)
|
|
1256
1256
|
}
|
|
1257
1257
|
),
|
|
1258
1258
|
children: [
|
|
@@ -1265,15 +1265,15 @@ function jl({
|
|
|
1265
1265
|
{
|
|
1266
1266
|
onClick: (f) => f.stopPropagation(),
|
|
1267
1267
|
className: "flex items-center justify-end",
|
|
1268
|
-
children: ya(y.data_type) && /* @__PURE__ */ e.jsx(
|
|
1268
|
+
children: ya(y.data_type) && /* @__PURE__ */ e.jsx(jl, { column: y })
|
|
1269
1269
|
}
|
|
1270
1270
|
)
|
|
1271
1271
|
]
|
|
1272
1272
|
},
|
|
1273
1273
|
y.column_name
|
|
1274
1274
|
)) }),
|
|
1275
|
-
/* @__PURE__ */ e.jsx(
|
|
1276
|
-
/* @__PURE__ */ e.jsx(
|
|
1275
|
+
/* @__PURE__ */ e.jsx(_e, { orientation: "vertical" }),
|
|
1276
|
+
/* @__PURE__ */ e.jsx(_e, { orientation: "horizontal" })
|
|
1277
1277
|
]
|
|
1278
1278
|
}
|
|
1279
1279
|
)
|
|
@@ -1345,7 +1345,7 @@ function Ve(s, t) {
|
|
|
1345
1345
|
}), f = D == null ? void 0 : D.connections.find(
|
|
1346
1346
|
(w) => w.id === l
|
|
1347
1347
|
), b = f == null ? void 0 : f.type, N = (f == null ? void 0 : f.type) === "API" || (f == null ? void 0 : f.type) === "S3", {
|
|
1348
|
-
data:
|
|
1348
|
+
data: T,
|
|
1349
1349
|
isLoading: q,
|
|
1350
1350
|
isFetching: J,
|
|
1351
1351
|
isError: B,
|
|
@@ -1405,7 +1405,7 @@ function Ve(s, t) {
|
|
|
1405
1405
|
}), {
|
|
1406
1406
|
data: ae,
|
|
1407
1407
|
isLoading: he,
|
|
1408
|
-
isFetching:
|
|
1408
|
+
isFetching: z,
|
|
1409
1409
|
isError: L,
|
|
1410
1410
|
refetch: G
|
|
1411
1411
|
} = De({
|
|
@@ -1450,7 +1450,7 @@ function Ve(s, t) {
|
|
|
1450
1450
|
g
|
|
1451
1451
|
]);
|
|
1452
1452
|
const Ce = (f == null ? void 0 : f.type) === "API" ? (Ws = f == null ? void 0 : f.type) == null ? void 0 : Ws.toLowerCase() : d || "", qe = N ? "" : o || "";
|
|
1453
|
-
function
|
|
1453
|
+
function Te(w) {
|
|
1454
1454
|
c(w), x("");
|
|
1455
1455
|
}
|
|
1456
1456
|
function I(w) {
|
|
@@ -1459,10 +1459,10 @@ function Ve(s, t) {
|
|
|
1459
1459
|
function ce(w) {
|
|
1460
1460
|
m(w);
|
|
1461
1461
|
}
|
|
1462
|
-
function
|
|
1462
|
+
function Me(w) {
|
|
1463
1463
|
g(w === "none" ? "" : w), w !== "none" && w !== "" && v("");
|
|
1464
1464
|
}
|
|
1465
|
-
|
|
1465
|
+
T && ((Ks = T == null ? void 0 : T.databases) == null ? void 0 : Ks.length) > 0, K && ((Qs = K == null ? void 0 : K.schemas) == null ? void 0 : Qs.length) > 0, ae && ((Zs = ae == null ? void 0 : ae.columns) == null ? void 0 : Zs.length) > 0 && (a = ae.columns.map((w) => ({
|
|
1466
1466
|
...w,
|
|
1467
1467
|
data_type: w.data_type.toLowerCase()
|
|
1468
1468
|
}))), B && (a = []), (L || C) && (a = []);
|
|
@@ -1472,10 +1472,10 @@ function Ve(s, t) {
|
|
|
1472
1472
|
name: w.name,
|
|
1473
1473
|
type: w.type
|
|
1474
1474
|
})
|
|
1475
|
-
),
|
|
1475
|
+
), Pe = (Xs = R == null ? void 0 : R.datamodels) == null ? void 0 : Xs.map((w) => ({
|
|
1476
1476
|
id: w.id,
|
|
1477
1477
|
name: w.name
|
|
1478
|
-
})), js =
|
|
1478
|
+
})), js = T == null ? void 0 : T.databases.map((w) => ({
|
|
1479
1479
|
id: w.database_name,
|
|
1480
1480
|
name: w.database_name
|
|
1481
1481
|
})), Ye = K == null ? void 0 : K.schemas.map((w) => ({
|
|
@@ -1484,16 +1484,16 @@ function Ve(s, t) {
|
|
|
1484
1484
|
})), bs = F == null ? void 0 : F.tables.map((w) => ({
|
|
1485
1485
|
id: w.table_name,
|
|
1486
1486
|
name: w.table_name
|
|
1487
|
-
})),
|
|
1487
|
+
})), rt = (Ys = R == null ? void 0 : R.datamodels.find(
|
|
1488
1488
|
(w) => w.id === r
|
|
1489
1489
|
)) == null ? void 0 : Ys.name;
|
|
1490
1490
|
return {
|
|
1491
1491
|
connectionItems: me,
|
|
1492
1492
|
isConnectionsLoading: k,
|
|
1493
1493
|
isConnectionsError: C,
|
|
1494
|
-
modelItems:
|
|
1494
|
+
modelItems: Pe,
|
|
1495
1495
|
selectedDatamodelId: r,
|
|
1496
|
-
selectedDatamodelName:
|
|
1496
|
+
selectedDatamodelName: rt,
|
|
1497
1497
|
isModelsLoading: V,
|
|
1498
1498
|
isModelsError: y,
|
|
1499
1499
|
databaseItems: js,
|
|
@@ -1506,7 +1506,7 @@ function Ve(s, t) {
|
|
|
1506
1506
|
isTableLoadingOrFetching: ie || ee,
|
|
1507
1507
|
isTableError: oe,
|
|
1508
1508
|
columns: a,
|
|
1509
|
-
isColumnsLoadingOrFetching: he ||
|
|
1509
|
+
isColumnsLoadingOrFetching: he || z,
|
|
1510
1510
|
isColumnsError: L,
|
|
1511
1511
|
isNonDbConnection: N,
|
|
1512
1512
|
connectionType: b,
|
|
@@ -1519,15 +1519,15 @@ function Ve(s, t) {
|
|
|
1519
1519
|
refetchTables: ne,
|
|
1520
1520
|
refetchColumns: G,
|
|
1521
1521
|
handleConnectionChange: ce,
|
|
1522
|
-
handleDatamodelChange:
|
|
1522
|
+
handleDatamodelChange: Me,
|
|
1523
1523
|
handleDatabaseChange: I,
|
|
1524
|
-
handleSchemaChange:
|
|
1524
|
+
handleSchemaChange: Te
|
|
1525
1525
|
};
|
|
1526
1526
|
}
|
|
1527
1527
|
function Ha({
|
|
1528
1528
|
ColumnsComponent: s
|
|
1529
1529
|
}) {
|
|
1530
|
-
var
|
|
1530
|
+
var z;
|
|
1531
1531
|
const t = h(
|
|
1532
1532
|
(L) => L.selectedConnectionId
|
|
1533
1533
|
), a = h(
|
|
@@ -1561,7 +1561,7 @@ function Ha({
|
|
|
1561
1561
|
isNonDbConnection: f,
|
|
1562
1562
|
refetchDatabases: b,
|
|
1563
1563
|
refetchModels: N,
|
|
1564
|
-
refetchSchemas:
|
|
1564
|
+
refetchSchemas: T,
|
|
1565
1565
|
refetchTables: q,
|
|
1566
1566
|
refetchColumns: J,
|
|
1567
1567
|
refetchConnections: B,
|
|
@@ -1574,7 +1574,7 @@ function Ha({
|
|
|
1574
1574
|
} = Ve();
|
|
1575
1575
|
function F() {
|
|
1576
1576
|
return s ? s(_, U, v) : /* @__PURE__ */ e.jsx(
|
|
1577
|
-
|
|
1577
|
+
bl,
|
|
1578
1578
|
{
|
|
1579
1579
|
schemaName: _,
|
|
1580
1580
|
tableName: U,
|
|
@@ -1590,7 +1590,7 @@ function Ha({
|
|
|
1590
1590
|
if (!t || y === "S3" || y === "API") return null;
|
|
1591
1591
|
if (!a || a === "none")
|
|
1592
1592
|
return /* @__PURE__ */ e.jsx(
|
|
1593
|
-
|
|
1593
|
+
$e,
|
|
1594
1594
|
{
|
|
1595
1595
|
refetch: b,
|
|
1596
1596
|
showNone: !0,
|
|
@@ -1606,16 +1606,16 @@ function Ha({
|
|
|
1606
1606
|
function oe() {
|
|
1607
1607
|
if (t && !f && (!n || n === "none") && (!a || a === "none"))
|
|
1608
1608
|
return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3", children: [
|
|
1609
|
-
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(
|
|
1609
|
+
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(ze, {}) }),
|
|
1610
1610
|
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx($, { children: "OR" }) }),
|
|
1611
|
-
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(
|
|
1611
|
+
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(ze, {}) })
|
|
1612
1612
|
] });
|
|
1613
1613
|
}
|
|
1614
1614
|
function ne() {
|
|
1615
1615
|
if (!t || y === "S3" || y === "API") return null;
|
|
1616
1616
|
if (!n || n === "none")
|
|
1617
1617
|
return /* @__PURE__ */ e.jsx(
|
|
1618
|
-
|
|
1618
|
+
$e,
|
|
1619
1619
|
{
|
|
1620
1620
|
refetch: N,
|
|
1621
1621
|
showNone: !0,
|
|
@@ -1630,9 +1630,9 @@ function Ha({
|
|
|
1630
1630
|
}
|
|
1631
1631
|
function ae() {
|
|
1632
1632
|
return !t || y === "S3" || y === "API" || !n || n === "none" ? null : /* @__PURE__ */ e.jsx(
|
|
1633
|
-
|
|
1633
|
+
$e,
|
|
1634
1634
|
{
|
|
1635
|
-
refetch:
|
|
1635
|
+
refetch: T,
|
|
1636
1636
|
onChange: ue,
|
|
1637
1637
|
isError: k,
|
|
1638
1638
|
isLoading: D,
|
|
@@ -1648,7 +1648,7 @@ function Ha({
|
|
|
1648
1648
|
return y === "API" ? (G = !1, G) : ((y === "S3" || t && n && n !== "none" && l) && (G = !0), G);
|
|
1649
1649
|
}
|
|
1650
1650
|
return L() ? /* @__PURE__ */ e.jsx(
|
|
1651
|
-
|
|
1651
|
+
$e,
|
|
1652
1652
|
{
|
|
1653
1653
|
refetch: q,
|
|
1654
1654
|
onChange: i,
|
|
@@ -1663,7 +1663,7 @@ function Ha({
|
|
|
1663
1663
|
return /* @__PURE__ */ e.jsxs("aside", { className: "flex grow flex-col justify-between", children: [
|
|
1664
1664
|
/* @__PURE__ */ e.jsxs("section", { className: "space-y-3 px-6 py-4", children: [
|
|
1665
1665
|
/* @__PURE__ */ e.jsx(
|
|
1666
|
-
|
|
1666
|
+
$e,
|
|
1667
1667
|
{
|
|
1668
1668
|
refetch: B,
|
|
1669
1669
|
items: o,
|
|
@@ -1672,9 +1672,9 @@ function Ha({
|
|
|
1672
1672
|
onChange: W,
|
|
1673
1673
|
isLoading: c,
|
|
1674
1674
|
isError: p,
|
|
1675
|
-
connectionTooltip: ((
|
|
1675
|
+
connectionTooltip: ((z = o == null ? void 0 : o.find(
|
|
1676
1676
|
(L) => L.id === t
|
|
1677
|
-
)) == null ? void 0 :
|
|
1677
|
+
)) == null ? void 0 : z.type) || ""
|
|
1678
1678
|
}
|
|
1679
1679
|
),
|
|
1680
1680
|
ee(),
|
|
@@ -1685,21 +1685,21 @@ function Ha({
|
|
|
1685
1685
|
] }),
|
|
1686
1686
|
F(),
|
|
1687
1687
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
|
|
1688
|
-
|
|
1688
|
+
M,
|
|
1689
1689
|
{
|
|
1690
1690
|
onClick: ie,
|
|
1691
1691
|
size: "sm",
|
|
1692
1692
|
variant: "secondary",
|
|
1693
1693
|
className: "w-full",
|
|
1694
1694
|
children: [
|
|
1695
|
-
/* @__PURE__ */ e.jsx(
|
|
1695
|
+
/* @__PURE__ */ e.jsx(Xn, { className: "mr-2 size-4" }),
|
|
1696
1696
|
"Help"
|
|
1697
1697
|
]
|
|
1698
1698
|
}
|
|
1699
1699
|
) })
|
|
1700
1700
|
] });
|
|
1701
1701
|
}
|
|
1702
|
-
function
|
|
1702
|
+
function vl(s) {
|
|
1703
1703
|
const t = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), n = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
|
|
1704
1704
|
let r = s.length;
|
|
1705
1705
|
if (l !== -1 && (r = l), n !== -1 && n < r && (r = n), t !== -1) {
|
|
@@ -1715,14 +1715,14 @@ function bl(s) {
|
|
|
1715
1715
|
return console.log("beforeClause", i), console.log("afterClause", o), o ? `${i} {{ filters | where }} ${o}` : `${i.replace(/;$/, "")} {{ filters | where }}`;
|
|
1716
1716
|
}
|
|
1717
1717
|
}
|
|
1718
|
-
function
|
|
1718
|
+
function yl({
|
|
1719
1719
|
error: s,
|
|
1720
1720
|
setShowAIDialog: t,
|
|
1721
1721
|
setUserInputforAI: a,
|
|
1722
1722
|
setTriggerAIRun: n
|
|
1723
1723
|
}) {
|
|
1724
1724
|
return /* @__PURE__ */ e.jsxs(Vs, { openDelay: 0, children: [
|
|
1725
|
-
/* @__PURE__ */ e.jsx(As, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1725
|
+
/* @__PURE__ */ e.jsx(As, { asChild: !0, children: /* @__PURE__ */ e.jsx(M, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(Rn, { className: "h-4 w-4 text-red-500" }) }) }),
|
|
1726
1726
|
/* @__PURE__ */ e.jsx(
|
|
1727
1727
|
qs,
|
|
1728
1728
|
{
|
|
@@ -1731,7 +1731,7 @@ function vl({
|
|
|
1731
1731
|
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: [
|
|
1732
1732
|
/* @__PURE__ */ e.jsx(Ne, { 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 }) }),
|
|
1733
1733
|
/* @__PURE__ */ e.jsxs(
|
|
1734
|
-
|
|
1734
|
+
M,
|
|
1735
1735
|
{
|
|
1736
1736
|
onClick: () => {
|
|
1737
1737
|
t(!0), a(s), n(!0);
|
|
@@ -1739,7 +1739,7 @@ function vl({
|
|
|
1739
1739
|
size: "sm",
|
|
1740
1740
|
variant: "outline",
|
|
1741
1741
|
children: [
|
|
1742
|
-
/* @__PURE__ */ e.jsx(
|
|
1742
|
+
/* @__PURE__ */ e.jsx(Gn, { className: "mr-2 h-4 w-4" }),
|
|
1743
1743
|
"Debug with AI"
|
|
1744
1744
|
]
|
|
1745
1745
|
}
|
|
@@ -1749,41 +1749,41 @@ function vl({
|
|
|
1749
1749
|
)
|
|
1750
1750
|
] });
|
|
1751
1751
|
}
|
|
1752
|
-
function
|
|
1752
|
+
function Nl({
|
|
1753
1753
|
userInput: s,
|
|
1754
1754
|
triggerAIRun: t,
|
|
1755
1755
|
setTriggerAIRun: a,
|
|
1756
1756
|
open: n,
|
|
1757
1757
|
setOpen: l
|
|
1758
1758
|
}) {
|
|
1759
|
-
const r =
|
|
1759
|
+
const r = Ue(null), i = Ue(null), [o, d] = H([]), [u, m] = H(""), [g, v] = H(null), { authToken: c } = Ie(), x = h((z) => {
|
|
1760
1760
|
var L;
|
|
1761
|
-
return (L =
|
|
1762
|
-
}), p = h((
|
|
1761
|
+
return (L = z == null ? void 0 : z.card) == null ? void 0 : L.sql;
|
|
1762
|
+
}), p = h((z) => {
|
|
1763
1763
|
var L;
|
|
1764
|
-
return (L =
|
|
1765
|
-
}), S = h((
|
|
1766
|
-
(
|
|
1764
|
+
return (L = z == null ? void 0 : z.card) == null ? void 0 : L.python;
|
|
1765
|
+
}), S = h((z) => z.actions.setCardSql), j = h((z) => z.actions.setRunSql), A = h(
|
|
1766
|
+
(z) => z.actions.switchCardType
|
|
1767
1767
|
), D = h(
|
|
1768
|
-
(
|
|
1769
|
-
), k = h((
|
|
1770
|
-
(
|
|
1768
|
+
(z) => z.selectedDatabaseName
|
|
1769
|
+
), k = h((z) => z.selectedTableName), C = h(
|
|
1770
|
+
(z) => z.selectedConnectionId
|
|
1771
1771
|
), E = h(
|
|
1772
|
-
(
|
|
1773
|
-
), R =
|
|
1774
|
-
(
|
|
1772
|
+
(z) => z.selectedSchemaName
|
|
1773
|
+
), R = O(
|
|
1774
|
+
(z) => z.dashboard.aiScopeTables
|
|
1775
1775
|
), { selectedDatamodelName: V, connectionType: y } = Ve(), {
|
|
1776
1776
|
messages: f,
|
|
1777
1777
|
setMessages: b,
|
|
1778
1778
|
reload: N,
|
|
1779
|
-
append:
|
|
1779
|
+
append: T,
|
|
1780
1780
|
input: q,
|
|
1781
1781
|
status: J,
|
|
1782
1782
|
handleInputChange: B,
|
|
1783
1783
|
handleSubmit: W,
|
|
1784
1784
|
addToolResult: K,
|
|
1785
1785
|
stop: ue
|
|
1786
|
-
} =
|
|
1786
|
+
} = jt({
|
|
1787
1787
|
api: "https://semaphor.cloud/api/v1/assistant",
|
|
1788
1788
|
headers: {
|
|
1789
1789
|
Authorization: `Bearer ${c == null ? void 0 : c.accessToken}`
|
|
@@ -1794,8 +1794,8 @@ function yl({
|
|
|
1794
1794
|
maxSteps: 10,
|
|
1795
1795
|
//maxToolRoundtrips: 5,
|
|
1796
1796
|
onToolCall: F,
|
|
1797
|
-
onFinish(
|
|
1798
|
-
U(L.usage), m(""), console.log("onFinish",
|
|
1797
|
+
onFinish(z, L) {
|
|
1798
|
+
U(L.usage), m(""), console.log("onFinish", z, L), L.finishReason === "stop" && m("");
|
|
1799
1799
|
}
|
|
1800
1800
|
});
|
|
1801
1801
|
te(() => {
|
|
@@ -1811,45 +1811,45 @@ function yl({
|
|
|
1811
1811
|
a,
|
|
1812
1812
|
B
|
|
1813
1813
|
]);
|
|
1814
|
-
const re =
|
|
1814
|
+
const re = Ue(n);
|
|
1815
1815
|
te(() => {
|
|
1816
|
-
const
|
|
1816
|
+
const z = re.current ? "smooth" : "auto";
|
|
1817
1817
|
re.current = n;
|
|
1818
1818
|
const L = setTimeout(() => {
|
|
1819
1819
|
var G;
|
|
1820
1820
|
i.current && (i.current.scroll({
|
|
1821
1821
|
top: i.current.scrollHeight,
|
|
1822
|
-
behavior:
|
|
1822
|
+
behavior: z
|
|
1823
1823
|
}), (G = r.current) == null || G.focus());
|
|
1824
1824
|
}, 50);
|
|
1825
1825
|
return () => clearTimeout(L);
|
|
1826
1826
|
}, [f, n]);
|
|
1827
|
-
function U(
|
|
1827
|
+
function U(z) {
|
|
1828
1828
|
v((L) => L ? {
|
|
1829
|
-
promptTokens: L.promptTokens +
|
|
1830
|
-
completionTokens: L.completionTokens +
|
|
1831
|
-
totalTokens: L.totalTokens +
|
|
1832
|
-
} :
|
|
1829
|
+
promptTokens: L.promptTokens + z.promptTokens,
|
|
1830
|
+
completionTokens: L.completionTokens + z.completionTokens,
|
|
1831
|
+
totalTokens: L.totalTokens + z.totalTokens
|
|
1832
|
+
} : z);
|
|
1833
1833
|
}
|
|
1834
|
-
function _(
|
|
1835
|
-
const L =
|
|
1834
|
+
function _(z) {
|
|
1835
|
+
const L = bt(o, z);
|
|
1836
1836
|
ee(L);
|
|
1837
1837
|
}
|
|
1838
1838
|
async function F({
|
|
1839
|
-
toolCall:
|
|
1839
|
+
toolCall: z
|
|
1840
1840
|
}) {
|
|
1841
|
-
if (
|
|
1842
|
-
console.log("createChart",
|
|
1843
|
-
const L =
|
|
1841
|
+
if (z.toolName === "createChart") {
|
|
1842
|
+
console.log("createChart", z.args);
|
|
1843
|
+
const L = z.args.sql, G = z.args.chartType;
|
|
1844
1844
|
return A(G), S(L), j(!0), {
|
|
1845
1845
|
status: "success",
|
|
1846
1846
|
message: "Let the user know that chart is created"
|
|
1847
1847
|
// query: sql,
|
|
1848
1848
|
};
|
|
1849
|
-
} else if (
|
|
1849
|
+
} else if (z.toolName === "getTableColumns")
|
|
1850
1850
|
m("Getting table columns...");
|
|
1851
1851
|
else {
|
|
1852
|
-
if (
|
|
1852
|
+
if (z.toolName === "getUserSql")
|
|
1853
1853
|
return x ? (console.log("cardSql", x), console.log("cardPython", p), {
|
|
1854
1854
|
status: "success",
|
|
1855
1855
|
sql: x,
|
|
@@ -1861,14 +1861,14 @@ function yl({
|
|
|
1861
1861
|
m("Thinking...");
|
|
1862
1862
|
}
|
|
1863
1863
|
}
|
|
1864
|
-
function ie(
|
|
1865
|
-
return
|
|
1864
|
+
function ie(z) {
|
|
1865
|
+
return z.map((G) => ({
|
|
1866
1866
|
...G,
|
|
1867
1867
|
connectionType: G.connectionType === "API" || G.connectionType === "S3" ? "DuckDb" : G.connectionType
|
|
1868
1868
|
}));
|
|
1869
1869
|
}
|
|
1870
|
-
function ee(
|
|
1871
|
-
const L = ie(
|
|
1870
|
+
function ee(z) {
|
|
1871
|
+
const L = ie(z);
|
|
1872
1872
|
d(L), b((G) => [
|
|
1873
1873
|
...G,
|
|
1874
1874
|
{
|
|
@@ -1879,48 +1879,48 @@ function yl({
|
|
|
1879
1879
|
]);
|
|
1880
1880
|
}
|
|
1881
1881
|
function oe() {
|
|
1882
|
-
const
|
|
1882
|
+
const z = {
|
|
1883
1883
|
databaseName: D || "",
|
|
1884
1884
|
schemaName: E || "",
|
|
1885
1885
|
tableName: k || "",
|
|
1886
1886
|
datamodelName: V || "",
|
|
1887
1887
|
connectionId: C || "",
|
|
1888
1888
|
connectionType: y || ""
|
|
1889
|
-
}, L = sa([...o,
|
|
1889
|
+
}, L = sa([...o, z]);
|
|
1890
1890
|
ee(L);
|
|
1891
1891
|
}
|
|
1892
1892
|
function ne() {
|
|
1893
|
-
const
|
|
1893
|
+
const z = {
|
|
1894
1894
|
databaseName: D || "",
|
|
1895
1895
|
schemaName: E || "",
|
|
1896
1896
|
tableName: k || "",
|
|
1897
1897
|
datamodelName: V || "",
|
|
1898
1898
|
connectionId: C || "",
|
|
1899
1899
|
connectionType: y || ""
|
|
1900
|
-
}, L =
|
|
1900
|
+
}, L = vt(
|
|
1901
1901
|
[...R || [], ...o],
|
|
1902
|
-
|
|
1902
|
+
z
|
|
1903
1903
|
);
|
|
1904
1904
|
if (console.log("isInScope", L), !L || o.length === 0) {
|
|
1905
1905
|
const G = sa([
|
|
1906
1906
|
...R || [],
|
|
1907
1907
|
...o,
|
|
1908
|
-
|
|
1908
|
+
z
|
|
1909
1909
|
]).filter(
|
|
1910
|
-
(Ce) => Ce.connectionId ===
|
|
1910
|
+
(Ce) => Ce.connectionId === z.connectionId
|
|
1911
1911
|
);
|
|
1912
1912
|
ee(G);
|
|
1913
1913
|
}
|
|
1914
1914
|
}
|
|
1915
|
-
function ae(
|
|
1916
|
-
l(!1), S(
|
|
1915
|
+
function ae(z) {
|
|
1916
|
+
l(!1), S(z), j(!0);
|
|
1917
1917
|
}
|
|
1918
1918
|
const he = !["ready", "error"].includes(J);
|
|
1919
1919
|
return {
|
|
1920
1920
|
messages: f,
|
|
1921
1921
|
setMessages: b,
|
|
1922
1922
|
reload: N,
|
|
1923
|
-
append:
|
|
1923
|
+
append: T,
|
|
1924
1924
|
input: q,
|
|
1925
1925
|
isLoading: he,
|
|
1926
1926
|
handleRun: ae,
|
|
@@ -1939,15 +1939,15 @@ function yl({
|
|
|
1939
1939
|
llmUsage: g
|
|
1940
1940
|
};
|
|
1941
1941
|
}
|
|
1942
|
-
const
|
|
1943
|
-
function
|
|
1942
|
+
const Cl = !1;
|
|
1943
|
+
function Sl({
|
|
1944
1944
|
open: s,
|
|
1945
1945
|
setOpen: t,
|
|
1946
1946
|
userInput: a,
|
|
1947
1947
|
triggerAIRun: n,
|
|
1948
1948
|
setTriggerAIRun: l
|
|
1949
1949
|
}) {
|
|
1950
|
-
const [r, i] = H(!1), [o, d] = H(
|
|
1950
|
+
const [r, i] = H(!1), [o, d] = H(Cl), [u, m] = H(!1), {
|
|
1951
1951
|
messages: g,
|
|
1952
1952
|
setMessages: v,
|
|
1953
1953
|
reload: c,
|
|
@@ -1966,9 +1966,9 @@ function Cl({
|
|
|
1966
1966
|
handleSubmit: f,
|
|
1967
1967
|
stop: b,
|
|
1968
1968
|
chatStatus: N,
|
|
1969
|
-
toolStatus:
|
|
1969
|
+
toolStatus: T,
|
|
1970
1970
|
llmUsage: q
|
|
1971
|
-
} =
|
|
1971
|
+
} = Nl({
|
|
1972
1972
|
userInput: a,
|
|
1973
1973
|
triggerAIRun: n,
|
|
1974
1974
|
setTriggerAIRun: l,
|
|
@@ -2008,9 +2008,9 @@ function Cl({
|
|
|
2008
2008
|
] })
|
|
2009
2009
|
] });
|
|
2010
2010
|
}
|
|
2011
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2012
|
-
/* @__PURE__ */ e.jsx(
|
|
2013
|
-
|
|
2011
|
+
return /* @__PURE__ */ e.jsxs(zs, { open: s, onOpenChange: t, children: [
|
|
2012
|
+
/* @__PURE__ */ e.jsx(Os, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2013
|
+
M,
|
|
2014
2014
|
{
|
|
2015
2015
|
onClick: A,
|
|
2016
2016
|
size: "sm",
|
|
@@ -2020,9 +2020,9 @@ function Cl({
|
|
|
2020
2020
|
}
|
|
2021
2021
|
) }),
|
|
2022
2022
|
/* @__PURE__ */ e.jsxs(Is, { className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]", children: [
|
|
2023
|
-
/* @__PURE__ */ e.jsx(
|
|
2023
|
+
/* @__PURE__ */ e.jsx(Ts, { children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-start justify-between gap-2 pr-5", children: [
|
|
2024
2024
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2025
|
-
/* @__PURE__ */ e.jsx(
|
|
2025
|
+
/* @__PURE__ */ e.jsx(Ms, { children: "Assistant" }),
|
|
2026
2026
|
/* @__PURE__ */ e.jsx(Ds, { children: "What can I help you with?" }),
|
|
2027
2027
|
C && C.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: [
|
|
2028
2028
|
/* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: "Tables in scope:" }),
|
|
@@ -2054,7 +2054,7 @@ function Cl({
|
|
|
2054
2054
|
(C == null ? void 0 : C.length) === 0 && /* @__PURE__ */ e.jsxs("div", { className: "mt-2 flex items-center gap-2", children: [
|
|
2055
2055
|
/* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: "Tables in scope: None" }),
|
|
2056
2056
|
/* @__PURE__ */ e.jsxs(
|
|
2057
|
-
|
|
2057
|
+
M,
|
|
2058
2058
|
{
|
|
2059
2059
|
className: "h-6 text-xs",
|
|
2060
2060
|
size: "sm",
|
|
@@ -2071,7 +2071,7 @@ function Cl({
|
|
|
2071
2071
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2072
2072
|
J(),
|
|
2073
2073
|
/* @__PURE__ */ e.jsx(
|
|
2074
|
-
|
|
2074
|
+
M,
|
|
2075
2075
|
{
|
|
2076
2076
|
className: "h-8",
|
|
2077
2077
|
size: "sm",
|
|
@@ -2091,7 +2091,7 @@ function Cl({
|
|
|
2091
2091
|
className: "h-[625px] w-full overflow-auto border-t border-t-muted",
|
|
2092
2092
|
children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: [
|
|
2093
2093
|
/* @__PURE__ */ e.jsx(
|
|
2094
|
-
|
|
2094
|
+
yt,
|
|
2095
2095
|
{
|
|
2096
2096
|
messages: g,
|
|
2097
2097
|
showTools: o,
|
|
@@ -2100,9 +2100,9 @@ function Cl({
|
|
|
2100
2100
|
}
|
|
2101
2101
|
),
|
|
2102
2102
|
/* @__PURE__ */ e.jsx(
|
|
2103
|
-
|
|
2103
|
+
Nt,
|
|
2104
2104
|
{
|
|
2105
|
-
status:
|
|
2105
|
+
status: Ct(N, T),
|
|
2106
2106
|
isLoading: S
|
|
2107
2107
|
}
|
|
2108
2108
|
)
|
|
@@ -2110,7 +2110,7 @@ function Cl({
|
|
|
2110
2110
|
}
|
|
2111
2111
|
),
|
|
2112
2112
|
/* @__PURE__ */ e.jsx(
|
|
2113
|
-
|
|
2113
|
+
St,
|
|
2114
2114
|
{
|
|
2115
2115
|
stop: b,
|
|
2116
2116
|
ref: V,
|
|
@@ -2140,10 +2140,10 @@ var Pa = {
|
|
|
2140
2140
|
className: void 0,
|
|
2141
2141
|
style: void 0,
|
|
2142
2142
|
attr: void 0
|
|
2143
|
-
}, ia =
|
|
2144
|
-
function
|
|
2143
|
+
}, ia = Oe.createContext && /* @__PURE__ */ Oe.createContext(Pa), wl = ["attr", "size", "title"];
|
|
2144
|
+
function kl(s, t) {
|
|
2145
2145
|
if (s == null) return {};
|
|
2146
|
-
var a =
|
|
2146
|
+
var a = zl(s, t), n, l;
|
|
2147
2147
|
if (Object.getOwnPropertySymbols) {
|
|
2148
2148
|
var r = Object.getOwnPropertySymbols(s);
|
|
2149
2149
|
for (l = 0; l < r.length; l++)
|
|
@@ -2151,7 +2151,7 @@ function wl(s, t) {
|
|
|
2151
2151
|
}
|
|
2152
2152
|
return a;
|
|
2153
2153
|
}
|
|
2154
|
-
function
|
|
2154
|
+
function zl(s, t) {
|
|
2155
2155
|
if (s == null) return {};
|
|
2156
2156
|
var a = {};
|
|
2157
2157
|
for (var n in s)
|
|
@@ -2193,13 +2193,13 @@ function cs(s) {
|
|
|
2193
2193
|
return s;
|
|
2194
2194
|
}
|
|
2195
2195
|
function Ol(s, t, a) {
|
|
2196
|
-
return t =
|
|
2196
|
+
return t = Il(t), t in s ? Object.defineProperty(s, t, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[t] = a, s;
|
|
2197
2197
|
}
|
|
2198
|
-
function
|
|
2199
|
-
var t =
|
|
2198
|
+
function Il(s) {
|
|
2199
|
+
var t = Tl(s, "string");
|
|
2200
2200
|
return typeof t == "symbol" ? t : t + "";
|
|
2201
2201
|
}
|
|
2202
|
-
function
|
|
2202
|
+
function Tl(s, t) {
|
|
2203
2203
|
if (typeof s != "object" || !s) return s;
|
|
2204
2204
|
var a = s[Symbol.toPrimitive];
|
|
2205
2205
|
if (a !== void 0) {
|
|
@@ -2210,12 +2210,12 @@ function Il(s, t) {
|
|
|
2210
2210
|
return (t === "string" ? String : Number)(s);
|
|
2211
2211
|
}
|
|
2212
2212
|
function $a(s) {
|
|
2213
|
-
return s && s.map((t, a) => /* @__PURE__ */
|
|
2213
|
+
return s && s.map((t, a) => /* @__PURE__ */ Oe.createElement(t.tag, cs({
|
|
2214
2214
|
key: a
|
|
2215
2215
|
}, t.attr), $a(t.child)));
|
|
2216
2216
|
}
|
|
2217
2217
|
function xe(s) {
|
|
2218
|
-
return (t) => /* @__PURE__ */
|
|
2218
|
+
return (t) => /* @__PURE__ */ Oe.createElement(Ml, os({
|
|
2219
2219
|
attr: cs({}, s.attr)
|
|
2220
2220
|
}, t), $a(s.child));
|
|
2221
2221
|
}
|
|
@@ -2225,8 +2225,8 @@ function Ml(s) {
|
|
|
2225
2225
|
attr: n,
|
|
2226
2226
|
size: l,
|
|
2227
2227
|
title: r
|
|
2228
|
-
} = s, i =
|
|
2229
|
-
return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */
|
|
2228
|
+
} = s, i = kl(s, wl), o = l || a.size || "1em", d;
|
|
2229
|
+
return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ Oe.createElement("svg", os({
|
|
2230
2230
|
stroke: "currentColor",
|
|
2231
2231
|
fill: "currentColor",
|
|
2232
2232
|
strokeWidth: "0"
|
|
@@ -2238,16 +2238,16 @@ function Ml(s) {
|
|
|
2238
2238
|
height: o,
|
|
2239
2239
|
width: o,
|
|
2240
2240
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2241
|
-
}), r && /* @__PURE__ */
|
|
2241
|
+
}), r && /* @__PURE__ */ Oe.createElement("title", null, r), s.children);
|
|
2242
2242
|
};
|
|
2243
|
-
return ia !== void 0 ? /* @__PURE__ */
|
|
2243
|
+
return ia !== void 0 ? /* @__PURE__ */ Oe.createElement(ia.Consumer, null, (a) => t(a)) : t(Pa);
|
|
2244
2244
|
}
|
|
2245
|
-
function
|
|
2245
|
+
function Dl(s) {
|
|
2246
2246
|
return xe({ tag: "svg", attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z" }, child: [] }] })(s);
|
|
2247
2247
|
}
|
|
2248
|
-
function
|
|
2248
|
+
function Fl({ sql: s }) {
|
|
2249
2249
|
return /* @__PURE__ */ e.jsxs(Vs, { children: [
|
|
2250
|
-
/* @__PURE__ */ e.jsx(As, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2250
|
+
/* @__PURE__ */ e.jsx(As, { asChild: !0, children: /* @__PURE__ */ e.jsx(M, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(wt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
|
|
2251
2251
|
/* @__PURE__ */ e.jsx(
|
|
2252
2252
|
qs,
|
|
2253
2253
|
{
|
|
@@ -2262,7 +2262,7 @@ function Dl({ sql: s }) {
|
|
|
2262
2262
|
] });
|
|
2263
2263
|
}
|
|
2264
2264
|
function Ba(s) {
|
|
2265
|
-
const { theme: t } =
|
|
2265
|
+
const { theme: t } = kt(), a = O((p) => p.theme), n = h((p) => p.frame), l = h((p) => p.card), r = h((p) => p.activeTabCardId), i = zt(), { refetch: o } = Le(l), { updateCardTab: d, setRunSql: u } = le(), m = Ue(), g = Ue({}), v = n.cards.find((p) => p.id === r), c = Fa(() => {
|
|
2266
2266
|
let p = "";
|
|
2267
2267
|
return s === "python" && (p = (v == null ? void 0 : v.python) || Ca), s === "sql" && (p = (v == null ? void 0 : v.sql) || ""), p;
|
|
2268
2268
|
}, [s, v]);
|
|
@@ -2322,10 +2322,10 @@ function Ba(s) {
|
|
|
2322
2322
|
}
|
|
2323
2323
|
return { handleEditorDidMount: x };
|
|
2324
2324
|
}
|
|
2325
|
-
function
|
|
2325
|
+
function Ll() {
|
|
2326
2326
|
const s = h((i) => i.card.sql), t = h((i) => i.sqlGen), { setCardSql: a, setSqlGen: n } = le(), { handleEditorDidMount: l } = Ba("sql");
|
|
2327
2327
|
function r(i) {
|
|
2328
|
-
a(i),
|
|
2328
|
+
a(i), It(t) || n({});
|
|
2329
2329
|
}
|
|
2330
2330
|
return /* @__PURE__ */ e.jsx(
|
|
2331
2331
|
us,
|
|
@@ -2351,7 +2351,7 @@ function Fl() {
|
|
|
2351
2351
|
}
|
|
2352
2352
|
);
|
|
2353
2353
|
}
|
|
2354
|
-
function
|
|
2354
|
+
function El() {
|
|
2355
2355
|
const s = h((l) => l.card.python), { setCardPython: t } = le(), { handleEditorDidMount: a } = Ba("python");
|
|
2356
2356
|
function n(l) {
|
|
2357
2357
|
t(l);
|
|
@@ -2380,8 +2380,8 @@ function Ll() {
|
|
|
2380
2380
|
}
|
|
2381
2381
|
);
|
|
2382
2382
|
}
|
|
2383
|
-
function
|
|
2384
|
-
const s =
|
|
2383
|
+
function Vl() {
|
|
2384
|
+
const s = O((r) => r.dashboard.filters), t = O((r) => r.filterValues), a = O((r) => r.selectedSheetId), n = s == null ? void 0 : s.filter(
|
|
2385
2385
|
(r) => r.sheetId === a || !r.sheetId
|
|
2386
2386
|
), l = t == null ? void 0 : t.filter(
|
|
2387
2387
|
(r) => (n == null ? void 0 : n.some((i) => i.id === r.filterId)) || r.filterId.endsWith(a)
|
|
@@ -2411,12 +2411,12 @@ function El() {
|
|
|
2411
2411
|
}
|
|
2412
2412
|
);
|
|
2413
2413
|
}
|
|
2414
|
-
function
|
|
2415
|
-
var
|
|
2414
|
+
function Al() {
|
|
2415
|
+
var Te;
|
|
2416
2416
|
const [s, t] = H({
|
|
2417
2417
|
queryKey: [],
|
|
2418
2418
|
queryData: null
|
|
2419
|
-
}), a =
|
|
2419
|
+
}), a = Tt(), [n, l] = H(!1), [r, i] = H(!1), [o, d] = H(!1), [u, m] = H(""), [g, v] = H(!1), c = h((I) => I.frame), x = h((I) => I.card), p = h((I) => I.isShowingVisual), S = h(
|
|
2420
2420
|
(I) => I.selectedConnectionId
|
|
2421
2421
|
), j = h(
|
|
2422
2422
|
(I) => I.selectedDatabaseName
|
|
@@ -2435,7 +2435,7 @@ function Vl() {
|
|
|
2435
2435
|
setPythonStdOut: f,
|
|
2436
2436
|
setCardPreferences: b,
|
|
2437
2437
|
setCardType: N,
|
|
2438
|
-
setCardPython:
|
|
2438
|
+
setCardPython: T
|
|
2439
2439
|
} = le(), q = h((I) => I.onSave), J = h((I) => I.onClose), B = h((I) => I.actions.setSqlGen), W = h((I) => I.runSql), K = h((I) => I.actions.setRunSql), ue = h((I) => I.actions.setCardCfg), re = h(
|
|
2440
2440
|
(I) => I.actions.setIsSqlRunning
|
|
2441
2441
|
), {
|
|
@@ -2449,7 +2449,7 @@ function Vl() {
|
|
|
2449
2449
|
refetch: ae
|
|
2450
2450
|
} = Le(x);
|
|
2451
2451
|
te(() => {
|
|
2452
|
-
if (U && (U.rowLimitExceeded &&
|
|
2452
|
+
if (U && (U.rowLimitExceeded && Ke.error("Row limit (10,000) exceeded. Refine your query.", {
|
|
2453
2453
|
position: "top-center",
|
|
2454
2454
|
richColors: !0
|
|
2455
2455
|
}), f((U == null ? void 0 : U.output) || ""), U.records.length > 0)) {
|
|
@@ -2477,15 +2477,15 @@ function Vl() {
|
|
|
2477
2477
|
s.queryData || t({
|
|
2478
2478
|
queryKey: ne,
|
|
2479
2479
|
queryData: I
|
|
2480
|
-
}), a.setQueryData(ne, null), a.removeQueries({ queryKey: ne, exact: !0 }), y(""), B({}),
|
|
2480
|
+
}), a.setQueryData(ne, null), a.removeQueries({ queryKey: ne, exact: !0 }), y(""), B({}), T(""), ue(void 0), R(""), b({}), N("bar");
|
|
2481
2481
|
}
|
|
2482
|
-
function
|
|
2482
|
+
function z(I, ce) {
|
|
2483
2483
|
if (I.length === 0)
|
|
2484
2484
|
return "";
|
|
2485
2485
|
if (ce) {
|
|
2486
|
-
const
|
|
2487
|
-
if (
|
|
2488
|
-
const me =
|
|
2486
|
+
const Me = I.find((me) => me.id === ce);
|
|
2487
|
+
if (Me) {
|
|
2488
|
+
const me = Me.tabTitle;
|
|
2489
2489
|
if (me == "All__Header")
|
|
2490
2490
|
return I[0].id;
|
|
2491
2491
|
if (me && me.endsWith("__Header")) {
|
|
@@ -2501,7 +2501,7 @@ function Vl() {
|
|
|
2501
2501
|
}
|
|
2502
2502
|
function L() {
|
|
2503
2503
|
let I = C;
|
|
2504
|
-
C && !C.includes("{{") && (I =
|
|
2504
|
+
C && !C.includes("{{") && (I = vl(C), y(I));
|
|
2505
2505
|
const ce = {
|
|
2506
2506
|
...x,
|
|
2507
2507
|
lastSelectedSchema: D,
|
|
@@ -2512,12 +2512,12 @@ function Vl() {
|
|
|
2512
2512
|
type: p ? x.type : "table",
|
|
2513
2513
|
sql: I,
|
|
2514
2514
|
customCfg: p ? x.customCfg : null
|
|
2515
|
-
},
|
|
2516
|
-
(
|
|
2515
|
+
}, Me = c.cards.map(
|
|
2516
|
+
(Pe) => Pe.id === x.id ? ce : Pe
|
|
2517
2517
|
), me = {
|
|
2518
2518
|
...c,
|
|
2519
|
-
cards:
|
|
2520
|
-
activeCardId:
|
|
2519
|
+
cards: Me,
|
|
2520
|
+
activeCardId: z(Me, c.activeCardId)
|
|
2521
2521
|
};
|
|
2522
2522
|
q == null || q(me);
|
|
2523
2523
|
}
|
|
@@ -2536,14 +2536,14 @@ function Vl() {
|
|
|
2536
2536
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
|
|
2537
2537
|
/* @__PURE__ */ e.jsx($, { className: "ml-6 text-xs font-semibold", children: "Filters" }),
|
|
2538
2538
|
r && /* @__PURE__ */ e.jsx(
|
|
2539
|
-
|
|
2539
|
+
Je,
|
|
2540
2540
|
{
|
|
2541
2541
|
onClick: () => i(!1),
|
|
2542
2542
|
className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
|
|
2543
2543
|
}
|
|
2544
2544
|
)
|
|
2545
2545
|
] }),
|
|
2546
|
-
/* @__PURE__ */ e.jsx(
|
|
2546
|
+
/* @__PURE__ */ e.jsx(Vl, {})
|
|
2547
2547
|
] })
|
|
2548
2548
|
}
|
|
2549
2549
|
),
|
|
@@ -2582,7 +2582,7 @@ function Vl() {
|
|
|
2582
2582
|
{
|
|
2583
2583
|
id: "sql-container",
|
|
2584
2584
|
className: "relative flex w-[99%]",
|
|
2585
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2585
|
+
children: /* @__PURE__ */ e.jsx(Ll, {})
|
|
2586
2586
|
}
|
|
2587
2587
|
),
|
|
2588
2588
|
n && /* @__PURE__ */ e.jsx("code", { className: "absolute right-6 top-3 text-xs text-muted-foreground/70", children: "sql" })
|
|
@@ -2604,7 +2604,7 @@ function Vl() {
|
|
|
2604
2604
|
{
|
|
2605
2605
|
id: "python-container",
|
|
2606
2606
|
className: "relative flex w-[99%] pt-0",
|
|
2607
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2607
|
+
children: /* @__PURE__ */ e.jsx(El, {})
|
|
2608
2608
|
}
|
|
2609
2609
|
),
|
|
2610
2610
|
/* @__PURE__ */ e.jsx("code", { className: "absolute right-6 top-3 text-xs text-muted-foreground/70", children: "python" })
|
|
@@ -2636,7 +2636,7 @@ function Vl() {
|
|
|
2636
2636
|
children: [
|
|
2637
2637
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
2638
2638
|
/* @__PURE__ */ e.jsxs(
|
|
2639
|
-
|
|
2639
|
+
M,
|
|
2640
2640
|
{
|
|
2641
2641
|
title: "Shift + Enter",
|
|
2642
2642
|
disabled: _ || F,
|
|
@@ -2653,23 +2653,23 @@ function Vl() {
|
|
|
2653
2653
|
}
|
|
2654
2654
|
),
|
|
2655
2655
|
(ee || (U == null ? void 0 : U.error)) && /* @__PURE__ */ e.jsx(
|
|
2656
|
-
|
|
2656
|
+
yl,
|
|
2657
2657
|
{
|
|
2658
|
-
error: (oe == null ? void 0 : oe.message) || ((
|
|
2658
|
+
error: (oe == null ? void 0 : oe.message) || ((Te = U == null ? void 0 : U.error) == null ? void 0 : Te.message),
|
|
2659
2659
|
setShowAIDialog: d,
|
|
2660
2660
|
setTriggerAIRun: v,
|
|
2661
2661
|
setUserInputforAI: m
|
|
2662
2662
|
}
|
|
2663
2663
|
),
|
|
2664
2664
|
/* @__PURE__ */ e.jsxs(
|
|
2665
|
-
|
|
2665
|
+
M,
|
|
2666
2666
|
{
|
|
2667
2667
|
onClick: he,
|
|
2668
2668
|
className: "",
|
|
2669
2669
|
size: "sm",
|
|
2670
2670
|
variant: "outline",
|
|
2671
2671
|
children: [
|
|
2672
|
-
/* @__PURE__ */ e.jsx(
|
|
2672
|
+
/* @__PURE__ */ e.jsx(Pn, { className: "mr-2 size-4" }),
|
|
2673
2673
|
"Clear"
|
|
2674
2674
|
]
|
|
2675
2675
|
}
|
|
@@ -2682,11 +2682,11 @@ function Vl() {
|
|
|
2682
2682
|
className: "",
|
|
2683
2683
|
size: "sm",
|
|
2684
2684
|
variant: "outline",
|
|
2685
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2685
|
+
children: /* @__PURE__ */ e.jsx(Dl, { className: "size-4 text-foreground/70" })
|
|
2686
2686
|
}
|
|
2687
2687
|
),
|
|
2688
2688
|
/* @__PURE__ */ e.jsx(
|
|
2689
|
-
|
|
2689
|
+
Sl,
|
|
2690
2690
|
{
|
|
2691
2691
|
open: o,
|
|
2692
2692
|
setOpen: d,
|
|
@@ -2697,28 +2697,28 @@ function Vl() {
|
|
|
2697
2697
|
)
|
|
2698
2698
|
] }),
|
|
2699
2699
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2700
|
-
(U == null ? void 0 : U.sql) && /* @__PURE__ */ e.jsx(
|
|
2700
|
+
(U == null ? void 0 : U.sql) && /* @__PURE__ */ e.jsx(Fl, { sql: U.sql }),
|
|
2701
2701
|
/* @__PURE__ */ e.jsxs(
|
|
2702
|
-
|
|
2702
|
+
M,
|
|
2703
2703
|
{
|
|
2704
2704
|
onClick: G,
|
|
2705
2705
|
className: "w-full",
|
|
2706
2706
|
size: "sm",
|
|
2707
2707
|
variant: "outline",
|
|
2708
2708
|
children: [
|
|
2709
|
-
/* @__PURE__ */ e.jsx(
|
|
2709
|
+
/* @__PURE__ */ e.jsx(Je, { className: "mr-2 size-4" }),
|
|
2710
2710
|
"Close"
|
|
2711
2711
|
]
|
|
2712
2712
|
}
|
|
2713
2713
|
),
|
|
2714
2714
|
/* @__PURE__ */ e.jsxs(
|
|
2715
|
-
|
|
2715
|
+
M,
|
|
2716
2716
|
{
|
|
2717
2717
|
onClick: L,
|
|
2718
2718
|
size: "sm",
|
|
2719
2719
|
variant: "outline",
|
|
2720
2720
|
children: [
|
|
2721
|
-
/* @__PURE__ */ e.jsx(
|
|
2721
|
+
/* @__PURE__ */ e.jsx(Dt, { className: "mr-2 size-4 font-bold text-green-600" }),
|
|
2722
2722
|
"Accept"
|
|
2723
2723
|
]
|
|
2724
2724
|
}
|
|
@@ -2732,9 +2732,9 @@ function Vl() {
|
|
|
2732
2732
|
)
|
|
2733
2733
|
);
|
|
2734
2734
|
}
|
|
2735
|
-
function
|
|
2735
|
+
function ql({ data: s }) {
|
|
2736
2736
|
var i;
|
|
2737
|
-
const [t, a] =
|
|
2737
|
+
const [t, a] = Oe.useState([]), l = Object.keys(s[0]).map((o) => ({
|
|
2738
2738
|
// header: key,
|
|
2739
2739
|
accessorKey: o,
|
|
2740
2740
|
header: ({ column: d }) => {
|
|
@@ -2746,26 +2746,26 @@ function Al({ data: s }) {
|
|
|
2746
2746
|
onClick: () => d.toggleSorting(d.getIsSorted() === "asc"),
|
|
2747
2747
|
children: [
|
|
2748
2748
|
o,
|
|
2749
|
-
u === "asc" ? /* @__PURE__ */ e.jsx(
|
|
2749
|
+
u === "asc" ? /* @__PURE__ */ e.jsx(Ft, { className: "ml-2 h-5 w-5" }) : u === "desc" ? /* @__PURE__ */ e.jsx(Lt, { className: "ml-2 h-5 w-5" }) : null
|
|
2750
2750
|
]
|
|
2751
2751
|
}
|
|
2752
2752
|
) });
|
|
2753
2753
|
}
|
|
2754
|
-
})), r =
|
|
2754
|
+
})), r = Et({
|
|
2755
2755
|
data: s,
|
|
2756
2756
|
columns: l,
|
|
2757
|
-
getCoreRowModel:
|
|
2758
|
-
getPaginationRowModel:
|
|
2757
|
+
getCoreRowModel: Rt(),
|
|
2758
|
+
getPaginationRowModel: _t(),
|
|
2759
2759
|
onSortingChange: a,
|
|
2760
|
-
getSortedRowModel:
|
|
2760
|
+
getSortedRowModel: Ht(),
|
|
2761
2761
|
manualPagination: !0,
|
|
2762
2762
|
state: {
|
|
2763
2763
|
sorting: t
|
|
2764
2764
|
}
|
|
2765
2765
|
});
|
|
2766
2766
|
return /* @__PURE__ */ e.jsx("div", { className: "font-mono text-xs text-foreground/95", children: /* @__PURE__ */ e.jsxs("table", { className: "w-full", children: [
|
|
2767
|
-
/* @__PURE__ */ e.jsx(
|
|
2768
|
-
|
|
2767
|
+
/* @__PURE__ */ e.jsx(Vt, { children: r.getHeaderGroups().map((o) => /* @__PURE__ */ e.jsx(ys, { children: o.headers.map((d) => /* @__PURE__ */ e.jsx(
|
|
2768
|
+
At,
|
|
2769
2769
|
{
|
|
2770
2770
|
className: "sticky top-0 h-11 bg-muted font-semibold",
|
|
2771
2771
|
children: d.isPlaceholder ? null : aa(
|
|
@@ -2775,7 +2775,7 @@ function Al({ data: s }) {
|
|
|
2775
2775
|
},
|
|
2776
2776
|
d.id
|
|
2777
2777
|
)) }, o.id)) }),
|
|
2778
|
-
/* @__PURE__ */ e.jsx(
|
|
2778
|
+
/* @__PURE__ */ e.jsx(qt, { children: (i = r.getRowModel().rows) != null && i.length ? r.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
|
|
2779
2779
|
ys,
|
|
2780
2780
|
{
|
|
2781
2781
|
className: "whitespace-nowrap py-2",
|
|
@@ -2786,20 +2786,20 @@ function Al({ data: s }) {
|
|
|
2786
2786
|
)) : /* @__PURE__ */ e.jsx(ys, { children: /* @__PURE__ */ e.jsx(ta, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
2787
2787
|
] }) });
|
|
2788
2788
|
}
|
|
2789
|
-
function
|
|
2789
|
+
function Rl({ card: s }) {
|
|
2790
2790
|
var j, A, D, k, C, E, R, V, y, f, b;
|
|
2791
2791
|
const [t, a] = H(!1), [n, l] = H(
|
|
2792
2792
|
[]
|
|
2793
|
-
), { authToken: r } = Ie(), i =
|
|
2793
|
+
), { authToken: r } = Ie(), i = Pt(r == null ? void 0 : r.accessToken), o = O((N) => N.themeStyle), d = {
|
|
2794
2794
|
colors: ((A = (j = o == null ? void 0 : o.chart) == null ? void 0 : j.dataset) == null ? void 0 : A.backgroundColor) || []
|
|
2795
2795
|
};
|
|
2796
2796
|
(D = s.customCardPreferences) != null && D.inputData;
|
|
2797
2797
|
const { getCard: u } = Sa(((k = s.customCardPreferences) == null ? void 0 : k.url) || ""), m = ((C = s.customCardPreferences) == null ? void 0 : C.visualType) || "single", g = h((N) => N.frame);
|
|
2798
2798
|
le();
|
|
2799
|
-
const { data: v } = Le(s), c = Fa((N,
|
|
2799
|
+
const { data: v } = Le(s), c = Fa((N, T) => {
|
|
2800
2800
|
l((q) => ({
|
|
2801
2801
|
...q,
|
|
2802
|
-
[N]:
|
|
2802
|
+
[N]: T
|
|
2803
2803
|
}));
|
|
2804
2804
|
}, []);
|
|
2805
2805
|
if (!((E = s.customCardPreferences) != null && E.componentName))
|
|
@@ -2814,11 +2814,11 @@ function ql({ card: s }) {
|
|
|
2814
2814
|
((V = s.customCardPreferences) == null ? void 0 : V.dataInputCardIds) || {}
|
|
2815
2815
|
).map((N) => {
|
|
2816
2816
|
var J, B, W;
|
|
2817
|
-
const
|
|
2817
|
+
const T = (B = (J = s.customCardPreferences) == null ? void 0 : J.dataInputCardIds) == null ? void 0 : B[N].cardId, q = (W = g == null ? void 0 : g.cards) == null ? void 0 : W.find((K) => K.id === T);
|
|
2818
2818
|
return q || null;
|
|
2819
2819
|
});
|
|
2820
2820
|
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(
|
|
2821
|
-
|
|
2821
|
+
En,
|
|
2822
2822
|
{
|
|
2823
2823
|
fallback: /* @__PURE__ */ e.jsx(e.Fragment, {}),
|
|
2824
2824
|
children: [
|
|
@@ -2837,12 +2837,12 @@ function ql({ card: s }) {
|
|
|
2837
2837
|
((f = s.customCardPreferences) == null ? void 0 : f.dataInputCardIds) || {}
|
|
2838
2838
|
).map((N) => {
|
|
2839
2839
|
var J, B, W;
|
|
2840
|
-
const
|
|
2841
|
-
(K) => K.id ===
|
|
2840
|
+
const T = (B = (J = s.customCardPreferences) == null ? void 0 : J.dataInputCardIds) == null ? void 0 : B[N].cardId, q = (W = g == null ? void 0 : g.cards) == null ? void 0 : W.find(
|
|
2841
|
+
(K) => K.id === T
|
|
2842
2842
|
);
|
|
2843
2843
|
if (q)
|
|
2844
2844
|
return /* @__PURE__ */ e.jsx(
|
|
2845
|
-
|
|
2845
|
+
$t,
|
|
2846
2846
|
{
|
|
2847
2847
|
onLoadingStatus: p,
|
|
2848
2848
|
onDataChange: c,
|
|
@@ -2859,8 +2859,8 @@ function ql({ card: s }) {
|
|
|
2859
2859
|
onDataChange: c,
|
|
2860
2860
|
settings: S.map(
|
|
2861
2861
|
(N) => {
|
|
2862
|
-
var
|
|
2863
|
-
return (
|
|
2862
|
+
var T;
|
|
2863
|
+
return (T = N == null ? void 0 : N.customCardPreferences) == null ? void 0 : T.settings;
|
|
2864
2864
|
}
|
|
2865
2865
|
),
|
|
2866
2866
|
data: S.map((N) => N != null && N.id ? n == null ? void 0 : n[N.id] : [])
|
|
@@ -2879,7 +2879,7 @@ function Ua({
|
|
|
2879
2879
|
...t
|
|
2880
2880
|
}) {
|
|
2881
2881
|
var S;
|
|
2882
|
-
const a = h((j) => j.card), n = ((S = a.customCardPreferences) == null ? void 0 : S.showCardHeader) ?? !0, l = h((j) => j.frame), r =
|
|
2882
|
+
const a = h((j) => j.card), n = ((S = a.customCardPreferences) == null ? void 0 : S.showCardHeader) ?? !0, l = h((j) => j.frame), r = O((j) => j.dashboard.filters);
|
|
2883
2883
|
h((j) => j.actions.setRunSql);
|
|
2884
2884
|
const { updateFilter: i } = Ze(), o = r == null ? void 0 : r.find((j) => j.id === l.filterId), { data: d, isLoading: u, isFetching: m } = Le(a), { setCard: g } = le(), { data: v } = Rs(a);
|
|
2885
2885
|
if (!a.id) return null;
|
|
@@ -2893,20 +2893,20 @@ function Ua({
|
|
|
2893
2893
|
topoJson: v
|
|
2894
2894
|
}));
|
|
2895
2895
|
function x(j) {
|
|
2896
|
-
return /* @__PURE__ */ e.jsx(
|
|
2896
|
+
return /* @__PURE__ */ e.jsx(Rl, { card: j });
|
|
2897
2897
|
}
|
|
2898
2898
|
function p() {
|
|
2899
2899
|
var j;
|
|
2900
2900
|
if (d != null && d.records && (d == null ? void 0 : d.records.length) === 0 && !u && !m)
|
|
2901
2901
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-2", children: [
|
|
2902
|
-
/* @__PURE__ */ e.jsx(
|
|
2902
|
+
/* @__PURE__ */ e.jsx(Kt, { className: "size-8 text-muted-foreground" }),
|
|
2903
2903
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "No records to display" })
|
|
2904
2904
|
] });
|
|
2905
2905
|
if (a.type === "custom")
|
|
2906
2906
|
return x(a);
|
|
2907
2907
|
if (!["table", "custom"].includes(a.type) && c)
|
|
2908
2908
|
return /* @__PURE__ */ e.jsx(
|
|
2909
|
-
|
|
2909
|
+
Qt,
|
|
2910
2910
|
{
|
|
2911
2911
|
cfg: c
|
|
2912
2912
|
},
|
|
@@ -2914,25 +2914,25 @@ function Ua({
|
|
|
2914
2914
|
);
|
|
2915
2915
|
if (a.type === "table" && (d != null && d.records) && (d == null ? void 0 : d.records.length) > 0)
|
|
2916
2916
|
return /* @__PURE__ */ e.jsxs(Ne, { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: [
|
|
2917
|
-
/* @__PURE__ */ e.jsx(
|
|
2918
|
-
/* @__PURE__ */ e.jsx(
|
|
2917
|
+
/* @__PURE__ */ e.jsx(Zt, { card: a, data: d == null ? void 0 : d.records }),
|
|
2918
|
+
/* @__PURE__ */ e.jsx(_e, { orientation: "horizontal" })
|
|
2919
2919
|
] });
|
|
2920
2920
|
}
|
|
2921
2921
|
return /* @__PURE__ */ e.jsxs(
|
|
2922
|
-
|
|
2922
|
+
Bt,
|
|
2923
2923
|
{
|
|
2924
2924
|
role: "editor-visual-card",
|
|
2925
2925
|
className: Y("relative flex h-full flex-col rounded-none", s),
|
|
2926
2926
|
...t,
|
|
2927
2927
|
children: [
|
|
2928
|
-
n && /* @__PURE__ */ e.jsxs(
|
|
2928
|
+
n && /* @__PURE__ */ e.jsxs(Ut, { className: "flex flex-row items-start justify-between py-4", children: [
|
|
2929
2929
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2930
2930
|
/* @__PURE__ */ e.jsx(
|
|
2931
2931
|
as,
|
|
2932
2932
|
{
|
|
2933
2933
|
text: a.title,
|
|
2934
2934
|
onSave: (j) => g({ ...a, title: j }),
|
|
2935
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(
|
|
2935
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(Gt, { className: "text-base", children: a.title || "Edit title..." }) })
|
|
2936
2936
|
},
|
|
2937
2937
|
a.title
|
|
2938
2938
|
),
|
|
@@ -2941,7 +2941,7 @@ function Ua({
|
|
|
2941
2941
|
{
|
|
2942
2942
|
text: a.description || "",
|
|
2943
2943
|
onSave: (j) => g({ ...a, description: j }),
|
|
2944
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2944
|
+
children: /* @__PURE__ */ e.jsx(Jt, { children: a.description || "Edit description..." })
|
|
2945
2945
|
},
|
|
2946
2946
|
a.description
|
|
2947
2947
|
)
|
|
@@ -2959,7 +2959,7 @@ function Ua({
|
|
|
2959
2959
|
/* @__PURE__ */ e.jsx(ka, { filter: o })
|
|
2960
2960
|
] })
|
|
2961
2961
|
] }),
|
|
2962
|
-
/* @__PURE__ */ e.jsx(
|
|
2962
|
+
/* @__PURE__ */ e.jsx(Wt, { className: "flex grow flex-col", children: p() })
|
|
2963
2963
|
]
|
|
2964
2964
|
}
|
|
2965
2965
|
);
|
|
@@ -2984,8 +2984,8 @@ const ca = ({ language: s, value: t, onChange: a }) => /* @__PURE__ */ e.jsx(
|
|
|
2984
2984
|
value: t,
|
|
2985
2985
|
onChange: a
|
|
2986
2986
|
}
|
|
2987
|
-
),
|
|
2988
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(
|
|
2987
|
+
), _l = () => /* @__PURE__ */ e.jsxs(Ts, { children: [
|
|
2988
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(Ms, { children: "Customize Card" }) }),
|
|
2989
2989
|
/* @__PURE__ */ e.jsxs(Ds, { children: [
|
|
2990
2990
|
"See the configuration options and documentation",
|
|
2991
2991
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2998,13 +2998,13 @@ const ca = ({ language: s, value: t, onChange: a }) => /* @__PURE__ */ e.jsx(
|
|
|
2998
2998
|
}
|
|
2999
2999
|
)
|
|
3000
3000
|
] })
|
|
3001
|
-
] }),
|
|
3001
|
+
] }), Hl = ({
|
|
3002
3002
|
defaultConfig: s,
|
|
3003
3003
|
customCode: t,
|
|
3004
3004
|
customConfig: a,
|
|
3005
3005
|
onConfigChange: n,
|
|
3006
3006
|
onCodeChange: l
|
|
3007
|
-
}) => /* @__PURE__ */ e.jsxs(
|
|
3007
|
+
}) => /* @__PURE__ */ e.jsxs(Oa, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
|
|
3008
3008
|
/* @__PURE__ */ e.jsxs(Ia, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
|
|
3009
3009
|
/* @__PURE__ */ e.jsx(ts, { value: "custom-config", children: a ? "Custom Config" : "Default Config" }),
|
|
3010
3010
|
/* @__PURE__ */ e.jsx(ts, { value: "output", children: "Output" }),
|
|
@@ -3016,7 +3016,7 @@ const ca = ({ language: s, value: t, onChange: a }) => /* @__PURE__ */ e.jsx(
|
|
|
3016
3016
|
value: "output",
|
|
3017
3017
|
className: "mt-0 grow rounded-b border border-t-0 p-2",
|
|
3018
3018
|
children: /* @__PURE__ */ e.jsx(
|
|
3019
|
-
|
|
3019
|
+
Yt,
|
|
3020
3020
|
{
|
|
3021
3021
|
readOnly: !0,
|
|
3022
3022
|
value: s,
|
|
@@ -3055,7 +3055,7 @@ const ca = ({ language: s, value: t, onChange: a }) => /* @__PURE__ */ e.jsx(
|
|
|
3055
3055
|
)
|
|
3056
3056
|
}
|
|
3057
3057
|
)
|
|
3058
|
-
] }),
|
|
3058
|
+
] }), Pl = ({
|
|
3059
3059
|
error: s,
|
|
3060
3060
|
hasCustomConfig: t,
|
|
3061
3061
|
onReset: a,
|
|
@@ -3063,11 +3063,11 @@ const ca = ({ language: s, value: t, onChange: a }) => /* @__PURE__ */ e.jsx(
|
|
|
3063
3063
|
onClose: l
|
|
3064
3064
|
}) => /* @__PURE__ */ e.jsxs(ha, { className: "flex items-center", children: [
|
|
3065
3065
|
/* @__PURE__ */ e.jsx($, { className: "mr-2 text-red-500", children: s }),
|
|
3066
|
-
/* @__PURE__ */ e.jsx(
|
|
3067
|
-
/* @__PURE__ */ e.jsx(
|
|
3068
|
-
/* @__PURE__ */ e.jsx(
|
|
3066
|
+
/* @__PURE__ */ e.jsx(M, { disabled: !t, onClick: a, variant: "outline", children: "Reset" }),
|
|
3067
|
+
/* @__PURE__ */ e.jsx(M, { onClick: n, variant: "outline", children: "Apply" }),
|
|
3068
|
+
/* @__PURE__ */ e.jsx(M, { onClick: l, variant: "outline", children: "Close" })
|
|
3069
3069
|
] });
|
|
3070
|
-
function
|
|
3070
|
+
function $l() {
|
|
3071
3071
|
const [s, t] = H(!1), [a, n] = H(""), [l, r] = H(""), [i, o] = H(""), [d, u] = H(""), m = h((k) => k.card), g = h((k) => k.card.customCfg), { data: v } = Le(m), { data: c } = Rs(m), { setCardCustomCfg: x, setCustomVisualCode: p } = le(), S = (k, C) => Se.transform(k, (E, R, V) => {
|
|
3072
3072
|
if (!Se.isEqual(R, C[V]))
|
|
3073
3073
|
if (Se.isArray(R) && Se.isArray(C[V]))
|
|
@@ -3123,23 +3123,23 @@ function Pl() {
|
|
|
3123
3123
|
u("Invalid JSON configuration");
|
|
3124
3124
|
}
|
|
3125
3125
|
};
|
|
3126
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3127
|
-
/* @__PURE__ */ e.jsx(
|
|
3128
|
-
|
|
3126
|
+
return /* @__PURE__ */ e.jsxs(zs, { open: s, onOpenChange: t, children: [
|
|
3127
|
+
/* @__PURE__ */ e.jsx(Os, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
3128
|
+
M,
|
|
3129
3129
|
{
|
|
3130
3130
|
onClick: A,
|
|
3131
3131
|
size: "sm",
|
|
3132
3132
|
variant: "outline",
|
|
3133
3133
|
className: g ? "border-foreground/50 dark:border-foreground/70" : "",
|
|
3134
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3134
|
+
children: /* @__PURE__ */ e.jsx(Xt, { className: "h-4 w-4" })
|
|
3135
3135
|
}
|
|
3136
3136
|
) }),
|
|
3137
3137
|
/* @__PURE__ */ e.jsxs(Is, { className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]", children: [
|
|
3138
|
-
/* @__PURE__ */ e.jsx(
|
|
3138
|
+
/* @__PURE__ */ e.jsx(_l, {}),
|
|
3139
3139
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
|
|
3140
|
-
/* @__PURE__ */ e.jsx(hs, { FallbackComponent:
|
|
3140
|
+
/* @__PURE__ */ e.jsx(hs, { FallbackComponent: za, children: /* @__PURE__ */ e.jsx(Ua, { className: "w-1/2 rounded shadow-none" }) }),
|
|
3141
3141
|
/* @__PURE__ */ e.jsx(
|
|
3142
|
-
|
|
3142
|
+
Hl,
|
|
3143
3143
|
{
|
|
3144
3144
|
defaultConfig: a,
|
|
3145
3145
|
customCode: i,
|
|
@@ -3150,7 +3150,7 @@ function Pl() {
|
|
|
3150
3150
|
)
|
|
3151
3151
|
] }),
|
|
3152
3152
|
/* @__PURE__ */ e.jsx(
|
|
3153
|
-
|
|
3153
|
+
Pl,
|
|
3154
3154
|
{
|
|
3155
3155
|
error: d,
|
|
3156
3156
|
hasCustomConfig: !!g,
|
|
@@ -3173,7 +3173,7 @@ function Ja(s) {
|
|
|
3173
3173
|
function Wa(s) {
|
|
3174
3174
|
return xe({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z" }, child: [] }] })(s);
|
|
3175
3175
|
}
|
|
3176
|
-
function
|
|
3176
|
+
function Bl(s) {
|
|
3177
3177
|
return xe({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M48,180c0,11,7.18,20,16,20a14.24,14.24,0,0,0,10.22-4.66A8,8,0,0,1,85.78,206.4,30.06,30.06,0,0,1,64,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a30.06,30.06,0,0,1,21.78,9.6,8,8,0,0,1-11.56,11.06A14.24,14.24,0,0,0,64,160C55.18,160,48,169,48,180Zm79.6-8.69c-4-1.16-8.14-2.35-10.45-3.84-1.25-.81-1.23-1-1.12-1.9a4.57,4.57,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.82-.56A8,8,0,0,0,142,145.86c-2.12-.55-21-5.22-32.84,2.76a20.58,20.58,0,0,0-9,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.14,3.93-4.6,3.06-15.17,1.56-19.55.36A8,8,0,0,0,109.94,214a61.34,61.34,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C154,179,137.49,174.17,127.6,171.31Zm83.09-26.84a8,8,0,0,0-10.23,4.84L188,184.21l-12.47-34.9a8,8,0,0,0-15.07,5.38l20,56a8,8,0,0,0,15.07,0l20-56A8,8,0,0,0,210.69,144.47ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z" }, child: [] }] })(s);
|
|
3178
3178
|
}
|
|
3179
3179
|
function Ka(s) {
|
|
@@ -3195,7 +3195,7 @@ function et(s) {
|
|
|
3195
3195
|
const [t, a] = H(null);
|
|
3196
3196
|
return te(() => {
|
|
3197
3197
|
s && (async () => {
|
|
3198
|
-
const r = (await import("./lucide-react-
|
|
3198
|
+
const r = (await import("./lucide-react-BCNS53ze.js"))[s];
|
|
3199
3199
|
a(r);
|
|
3200
3200
|
})();
|
|
3201
3201
|
}, [s]), t;
|
|
@@ -3203,12 +3203,12 @@ function et(s) {
|
|
|
3203
3203
|
function st() {
|
|
3204
3204
|
const { authToken: s } = Ie(), { data: t, isLoading: a, isFetching: n, isError: l } = De({
|
|
3205
3205
|
queryKey: ["plugins", s == null ? void 0 : s.accessToken],
|
|
3206
|
-
queryFn: () =>
|
|
3206
|
+
queryFn: () => en(s == null ? void 0 : s.accessToken)
|
|
3207
3207
|
// staleTime: Infinity,
|
|
3208
3208
|
});
|
|
3209
3209
|
return { data: t, isLoading: a, isFetching: n, isError: l };
|
|
3210
3210
|
}
|
|
3211
|
-
function
|
|
3211
|
+
function Ul({
|
|
3212
3212
|
onChartTypeChange: s
|
|
3213
3213
|
}) {
|
|
3214
3214
|
const [t, a] = H([]), { data: n } = st();
|
|
@@ -3217,7 +3217,7 @@ function Bl({
|
|
|
3217
3217
|
var r;
|
|
3218
3218
|
if (n) {
|
|
3219
3219
|
const o = (await Promise.all(
|
|
3220
|
-
(r = n == null ? void 0 : n.plugins) == null ? void 0 : r.map(async (d) => (await
|
|
3220
|
+
(r = n == null ? void 0 : n.plugins) == null ? void 0 : r.map(async (d) => (await sn(d.value)).visuals.map((g) => ({
|
|
3221
3221
|
name: g.name,
|
|
3222
3222
|
icon: g.icon,
|
|
3223
3223
|
url: d.value
|
|
@@ -3227,9 +3227,9 @@ function Bl({
|
|
|
3227
3227
|
}
|
|
3228
3228
|
})();
|
|
3229
3229
|
}, [n]), t.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3230
|
-
/* @__PURE__ */ e.jsx(
|
|
3230
|
+
/* @__PURE__ */ e.jsx(ze, { className: "my-2" }),
|
|
3231
3231
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l, r) => /* @__PURE__ */ e.jsx(
|
|
3232
|
-
|
|
3232
|
+
Gl,
|
|
3233
3233
|
{
|
|
3234
3234
|
text: l.name,
|
|
3235
3235
|
onClick: () => s("custom", l),
|
|
@@ -3239,15 +3239,15 @@ function Bl({
|
|
|
3239
3239
|
)) })
|
|
3240
3240
|
] });
|
|
3241
3241
|
}
|
|
3242
|
-
const
|
|
3242
|
+
const Gl = ({
|
|
3243
3243
|
text: s,
|
|
3244
3244
|
icon: t,
|
|
3245
3245
|
onClick: a
|
|
3246
3246
|
}) => {
|
|
3247
3247
|
const n = et(t || ""), l = s.charAt(0).toUpperCase();
|
|
3248
|
-
return /* @__PURE__ */ e.jsx(
|
|
3248
|
+
return /* @__PURE__ */ e.jsx(M, { onClick: a, title: s, variant: "ghost", children: n ? /* @__PURE__ */ e.jsx(n, { className: "h-4 w-4" }) : l });
|
|
3249
3249
|
};
|
|
3250
|
-
function
|
|
3250
|
+
function Jl() {
|
|
3251
3251
|
var m, g;
|
|
3252
3252
|
const [s, t] = H(!1), a = h((v) => v.card), n = a.type, { setCardType: l, setCardPreferences: r, setChartOrientation: i } = h((v) => v.actions), { setCardCustomCfg: o, setCustomCardPreferences: d } = le();
|
|
3253
3253
|
function u(v, c) {
|
|
@@ -3260,8 +3260,8 @@ function Gl() {
|
|
|
3260
3260
|
}), t(!1);
|
|
3261
3261
|
}
|
|
3262
3262
|
return /* @__PURE__ */ e.jsxs(ms, { open: s, onOpenChange: t, children: [
|
|
3263
|
-
/* @__PURE__ */ e.jsx(xs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
3264
|
-
|
|
3263
|
+
/* @__PURE__ */ e.jsx(xs, { asChild: !0, children: /* @__PURE__ */ e.jsx(M, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
|
|
3264
|
+
Wl,
|
|
3265
3265
|
{
|
|
3266
3266
|
className: "h-4 w-4",
|
|
3267
3267
|
chartType: n,
|
|
@@ -3272,7 +3272,7 @@ function Gl() {
|
|
|
3272
3272
|
/* @__PURE__ */ e.jsxs(ps, { className: "w-50", children: [
|
|
3273
3273
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-4 place-items-center", children: [
|
|
3274
3274
|
/* @__PURE__ */ e.jsx(
|
|
3275
|
-
|
|
3275
|
+
M,
|
|
3276
3276
|
{
|
|
3277
3277
|
onClick: () => u("bar"),
|
|
3278
3278
|
className: "font-normal",
|
|
@@ -3281,7 +3281,7 @@ function Gl() {
|
|
|
3281
3281
|
}
|
|
3282
3282
|
),
|
|
3283
3283
|
/* @__PURE__ */ e.jsx(
|
|
3284
|
-
|
|
3284
|
+
M,
|
|
3285
3285
|
{
|
|
3286
3286
|
onClick: () => u("line"),
|
|
3287
3287
|
variant: "ghost",
|
|
@@ -3289,7 +3289,7 @@ function Gl() {
|
|
|
3289
3289
|
}
|
|
3290
3290
|
),
|
|
3291
3291
|
/* @__PURE__ */ e.jsx(
|
|
3292
|
-
|
|
3292
|
+
M,
|
|
3293
3293
|
{
|
|
3294
3294
|
onClick: () => u("stackedBar"),
|
|
3295
3295
|
variant: "ghost",
|
|
@@ -3297,7 +3297,7 @@ function Gl() {
|
|
|
3297
3297
|
}
|
|
3298
3298
|
),
|
|
3299
3299
|
/* @__PURE__ */ e.jsx(
|
|
3300
|
-
|
|
3300
|
+
M,
|
|
3301
3301
|
{
|
|
3302
3302
|
onClick: () => u("stackedLine"),
|
|
3303
3303
|
variant: "ghost",
|
|
@@ -3305,7 +3305,7 @@ function Gl() {
|
|
|
3305
3305
|
}
|
|
3306
3306
|
),
|
|
3307
3307
|
/* @__PURE__ */ e.jsx(
|
|
3308
|
-
|
|
3308
|
+
M,
|
|
3309
3309
|
{
|
|
3310
3310
|
onClick: () => u("scatter"),
|
|
3311
3311
|
variant: "ghost",
|
|
@@ -3313,7 +3313,7 @@ function Gl() {
|
|
|
3313
3313
|
}
|
|
3314
3314
|
),
|
|
3315
3315
|
/* @__PURE__ */ e.jsx(
|
|
3316
|
-
|
|
3316
|
+
M,
|
|
3317
3317
|
{
|
|
3318
3318
|
onClick: () => u("bubble"),
|
|
3319
3319
|
variant: "ghost",
|
|
@@ -3321,7 +3321,7 @@ function Gl() {
|
|
|
3321
3321
|
}
|
|
3322
3322
|
),
|
|
3323
3323
|
/* @__PURE__ */ e.jsx(
|
|
3324
|
-
|
|
3324
|
+
M,
|
|
3325
3325
|
{
|
|
3326
3326
|
onClick: () => u("pie"),
|
|
3327
3327
|
variant: "ghost",
|
|
@@ -3329,7 +3329,7 @@ function Gl() {
|
|
|
3329
3329
|
}
|
|
3330
3330
|
),
|
|
3331
3331
|
/* @__PURE__ */ e.jsx(
|
|
3332
|
-
|
|
3332
|
+
M,
|
|
3333
3333
|
{
|
|
3334
3334
|
onClick: () => u("doughnut"),
|
|
3335
3335
|
variant: "ghost",
|
|
@@ -3337,7 +3337,7 @@ function Gl() {
|
|
|
3337
3337
|
}
|
|
3338
3338
|
),
|
|
3339
3339
|
/* @__PURE__ */ e.jsx(
|
|
3340
|
-
|
|
3340
|
+
M,
|
|
3341
3341
|
{
|
|
3342
3342
|
onClick: () => u("radar"),
|
|
3343
3343
|
variant: "ghost",
|
|
@@ -3351,7 +3351,7 @@ function Gl() {
|
|
|
3351
3351
|
}
|
|
3352
3352
|
),
|
|
3353
3353
|
/* @__PURE__ */ e.jsx(
|
|
3354
|
-
|
|
3354
|
+
M,
|
|
3355
3355
|
{
|
|
3356
3356
|
onClick: () => u("polarArea"),
|
|
3357
3357
|
variant: "ghost",
|
|
@@ -3359,7 +3359,7 @@ function Gl() {
|
|
|
3359
3359
|
}
|
|
3360
3360
|
),
|
|
3361
3361
|
/* @__PURE__ */ e.jsx(
|
|
3362
|
-
|
|
3362
|
+
M,
|
|
3363
3363
|
{
|
|
3364
3364
|
onClick: () => u("pyramid"),
|
|
3365
3365
|
variant: "ghost",
|
|
@@ -3367,7 +3367,7 @@ function Gl() {
|
|
|
3367
3367
|
}
|
|
3368
3368
|
),
|
|
3369
3369
|
/* @__PURE__ */ e.jsx(
|
|
3370
|
-
|
|
3370
|
+
M,
|
|
3371
3371
|
{
|
|
3372
3372
|
onClick: () => u("range"),
|
|
3373
3373
|
variant: "ghost",
|
|
@@ -3375,7 +3375,7 @@ function Gl() {
|
|
|
3375
3375
|
}
|
|
3376
3376
|
),
|
|
3377
3377
|
/* @__PURE__ */ e.jsx(
|
|
3378
|
-
|
|
3378
|
+
M,
|
|
3379
3379
|
{
|
|
3380
3380
|
onClick: () => u("table"),
|
|
3381
3381
|
variant: "ghost",
|
|
@@ -3383,7 +3383,7 @@ function Gl() {
|
|
|
3383
3383
|
}
|
|
3384
3384
|
),
|
|
3385
3385
|
/* @__PURE__ */ e.jsx(
|
|
3386
|
-
|
|
3386
|
+
M,
|
|
3387
3387
|
{
|
|
3388
3388
|
onClick: () => u("kpi"),
|
|
3389
3389
|
variant: "ghost",
|
|
@@ -3391,7 +3391,7 @@ function Gl() {
|
|
|
3391
3391
|
}
|
|
3392
3392
|
),
|
|
3393
3393
|
/* @__PURE__ */ e.jsx(
|
|
3394
|
-
|
|
3394
|
+
M,
|
|
3395
3395
|
{
|
|
3396
3396
|
onClick: () => u("text"),
|
|
3397
3397
|
variant: "ghost",
|
|
@@ -3399,7 +3399,7 @@ function Gl() {
|
|
|
3399
3399
|
}
|
|
3400
3400
|
),
|
|
3401
3401
|
/* @__PURE__ */ e.jsx(
|
|
3402
|
-
|
|
3402
|
+
M,
|
|
3403
3403
|
{
|
|
3404
3404
|
onClick: () => u("map"),
|
|
3405
3405
|
variant: "ghost",
|
|
@@ -3407,7 +3407,7 @@ function Gl() {
|
|
|
3407
3407
|
}
|
|
3408
3408
|
),
|
|
3409
3409
|
/* @__PURE__ */ e.jsx(
|
|
3410
|
-
|
|
3410
|
+
M,
|
|
3411
3411
|
{
|
|
3412
3412
|
onClick: () => u("custom"),
|
|
3413
3413
|
variant: "ghost",
|
|
@@ -3415,11 +3415,11 @@ function Gl() {
|
|
|
3415
3415
|
}
|
|
3416
3416
|
)
|
|
3417
3417
|
] }),
|
|
3418
|
-
/* @__PURE__ */ e.jsx(
|
|
3418
|
+
/* @__PURE__ */ e.jsx(Ul, { onChartTypeChange: u })
|
|
3419
3419
|
] })
|
|
3420
3420
|
] });
|
|
3421
3421
|
}
|
|
3422
|
-
function
|
|
3422
|
+
function Wl({
|
|
3423
3423
|
chartType: s,
|
|
3424
3424
|
className: t,
|
|
3425
3425
|
customIcon: a,
|
|
@@ -3463,20 +3463,20 @@ function Jl({
|
|
|
3463
3463
|
return /* @__PURE__ */ e.jsx(Us, { className: t });
|
|
3464
3464
|
}
|
|
3465
3465
|
}
|
|
3466
|
-
function
|
|
3466
|
+
function Kl() {
|
|
3467
3467
|
var t;
|
|
3468
3468
|
const s = h((a) => a.card);
|
|
3469
3469
|
return (t = s.customCardPreferences) == null || t.showCardHeader, le(), /* @__PURE__ */ e.jsxs(Fs, { children: [
|
|
3470
3470
|
/* @__PURE__ */ e.jsx(Ls, { asChild: !0, children: /* @__PURE__ */ e.jsx(Bs, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
|
|
3471
3471
|
/* @__PURE__ */ e.jsx(Es, { align: "start", className: "w-40 text-muted-foreground", children: /* @__PURE__ */ e.jsxs(
|
|
3472
|
-
|
|
3472
|
+
an,
|
|
3473
3473
|
{
|
|
3474
3474
|
onClick: () => {
|
|
3475
|
-
navigator.clipboard.writeText(s.id),
|
|
3475
|
+
navigator.clipboard.writeText(s.id), Ke.success("Card ID copied to clipboard");
|
|
3476
3476
|
},
|
|
3477
3477
|
className: "cursor-pointer space-x-2",
|
|
3478
3478
|
children: [
|
|
3479
|
-
/* @__PURE__ */ e.jsx(
|
|
3479
|
+
/* @__PURE__ */ e.jsx(tn, { className: "size-5" }),
|
|
3480
3480
|
/* @__PURE__ */ e.jsx("span", { children: "Copy Card ID" })
|
|
3481
3481
|
]
|
|
3482
3482
|
}
|
|
@@ -3492,7 +3492,7 @@ function da() {
|
|
|
3492
3492
|
function c() {
|
|
3493
3493
|
const b = {
|
|
3494
3494
|
connectionId: t.connectionId,
|
|
3495
|
-
id:
|
|
3495
|
+
id: We(),
|
|
3496
3496
|
title: "Title",
|
|
3497
3497
|
description: "Description",
|
|
3498
3498
|
preferences: {
|
|
@@ -3520,20 +3520,20 @@ function da() {
|
|
|
3520
3520
|
function p() {
|
|
3521
3521
|
const b = {
|
|
3522
3522
|
...t,
|
|
3523
|
-
id:
|
|
3523
|
+
id: We(),
|
|
3524
3524
|
title: `${t.title} Copy`,
|
|
3525
3525
|
tabTitle: `${t.tabTitle || t.title} Copy`
|
|
3526
3526
|
};
|
|
3527
3527
|
x(b);
|
|
3528
3528
|
}
|
|
3529
3529
|
function S(b) {
|
|
3530
|
-
const N = s.cards.filter((J) => J.id !== b),
|
|
3530
|
+
const N = s.cards.filter((J) => J.id !== b), T = N[0], q = {
|
|
3531
3531
|
...s,
|
|
3532
3532
|
cards: N,
|
|
3533
3533
|
// update the active card to the first card in the frame
|
|
3534
|
-
activeCardId:
|
|
3534
|
+
activeCardId: T.id
|
|
3535
3535
|
};
|
|
3536
|
-
r(q), d(
|
|
3536
|
+
r(q), d(T.id), i(T);
|
|
3537
3537
|
}
|
|
3538
3538
|
function j(b) {
|
|
3539
3539
|
d(b);
|
|
@@ -3543,9 +3543,9 @@ function da() {
|
|
|
3543
3543
|
}, D = (b) => {
|
|
3544
3544
|
b.preventDefault();
|
|
3545
3545
|
}, k = (b, N) => {
|
|
3546
|
-
const
|
|
3547
|
-
if (
|
|
3548
|
-
const q = Array.from(s.cards), [J] = q.splice(parseInt(
|
|
3546
|
+
const T = b.dataTransfer.getData("tabIndex");
|
|
3547
|
+
if (T === N.toString()) return;
|
|
3548
|
+
const q = Array.from(s.cards), [J] = q.splice(parseInt(T), 1);
|
|
3549
3549
|
q.splice(N, 0, J), r({ ...s, cards: q });
|
|
3550
3550
|
};
|
|
3551
3551
|
function C(b, N) {
|
|
@@ -3553,19 +3553,19 @@ function da() {
|
|
|
3553
3553
|
"div",
|
|
3554
3554
|
{
|
|
3555
3555
|
onClick: () => {
|
|
3556
|
-
const
|
|
3557
|
-
i({ ...N, displayTab:
|
|
3556
|
+
const T = N.displayTab === void 0 ? !1 : !N.displayTab;
|
|
3557
|
+
i({ ...N, displayTab: T }), o({
|
|
3558
3558
|
...N,
|
|
3559
|
-
displayTab:
|
|
3559
|
+
displayTab: T
|
|
3560
3560
|
});
|
|
3561
3561
|
},
|
|
3562
|
-
children: N.displayTab === !0 || N.displayTab === void 0 ? /* @__PURE__ */ e.jsx(
|
|
3562
|
+
children: N.displayTab === !0 || N.displayTab === void 0 ? /* @__PURE__ */ e.jsx(cn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx($n, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
|
|
3563
3563
|
}
|
|
3564
3564
|
);
|
|
3565
3565
|
}
|
|
3566
3566
|
function E() {
|
|
3567
3567
|
return /* @__PURE__ */ e.jsxs(
|
|
3568
|
-
|
|
3568
|
+
Oa,
|
|
3569
3569
|
{
|
|
3570
3570
|
onValueChange: j,
|
|
3571
3571
|
value: s.activeCardId,
|
|
@@ -3577,16 +3577,16 @@ function da() {
|
|
|
3577
3577
|
as,
|
|
3578
3578
|
{
|
|
3579
3579
|
text: b.tabTitle || b.title,
|
|
3580
|
-
onSave: (
|
|
3581
|
-
i({ ...t, tabTitle:
|
|
3580
|
+
onSave: (T) => {
|
|
3581
|
+
i({ ...t, tabTitle: T }), o({ ...t, tabTitle: T });
|
|
3582
3582
|
},
|
|
3583
3583
|
children: /* @__PURE__ */ e.jsxs(
|
|
3584
3584
|
ts,
|
|
3585
3585
|
{
|
|
3586
3586
|
draggable: !0,
|
|
3587
|
-
onDragStart: (
|
|
3587
|
+
onDragStart: (T) => A(T, N),
|
|
3588
3588
|
onDragOver: D,
|
|
3589
|
-
onDrop: (
|
|
3589
|
+
onDrop: (T) => k(T, N),
|
|
3590
3590
|
className: "",
|
|
3591
3591
|
value: b.id,
|
|
3592
3592
|
children: [
|
|
@@ -3606,7 +3606,7 @@ function da() {
|
|
|
3606
3606
|
b.id
|
|
3607
3607
|
)),
|
|
3608
3608
|
/* @__PURE__ */ e.jsx(
|
|
3609
|
-
|
|
3609
|
+
M,
|
|
3610
3610
|
{
|
|
3611
3611
|
className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
|
|
3612
3612
|
variant: "outline",
|
|
@@ -3615,12 +3615,12 @@ function da() {
|
|
|
3615
3615
|
}
|
|
3616
3616
|
),
|
|
3617
3617
|
/* @__PURE__ */ e.jsx(
|
|
3618
|
-
|
|
3618
|
+
M,
|
|
3619
3619
|
{
|
|
3620
3620
|
className: "invisible ml-1 h-8 px-2 hover:bg-muted-foreground/50 group-hover:visible",
|
|
3621
3621
|
variant: "outline",
|
|
3622
3622
|
onClick: p,
|
|
3623
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3623
|
+
children: /* @__PURE__ */ e.jsx(_n, { className: "h-4 w-4" })
|
|
3624
3624
|
}
|
|
3625
3625
|
)
|
|
3626
3626
|
] }) })
|
|
@@ -3629,18 +3629,18 @@ function da() {
|
|
|
3629
3629
|
);
|
|
3630
3630
|
}
|
|
3631
3631
|
function R() {
|
|
3632
|
-
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(
|
|
3633
|
-
|
|
3632
|
+
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(ln, { 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(Ne, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e.jsx(
|
|
3633
|
+
rn,
|
|
3634
3634
|
{
|
|
3635
3635
|
isLoading: n,
|
|
3636
3636
|
card: t,
|
|
3637
3637
|
data: u == null ? void 0 : u.records
|
|
3638
3638
|
}
|
|
3639
|
-
) }) }) }) : /* @__PURE__ */ e.jsx(hs, { FallbackComponent:
|
|
3639
|
+
) }) }) }) : /* @__PURE__ */ e.jsx(hs, { FallbackComponent: za, children: /* @__PURE__ */ e.jsx(Ua, { className: "grow border-none shadow-none" }) });
|
|
3640
3640
|
}
|
|
3641
3641
|
function V() {
|
|
3642
|
-
const b = JSON.stringify(u == null ? void 0 : u.records, null, 2), N = new Blob([b], { type: "application/json" }),
|
|
3643
|
-
q.href =
|
|
3642
|
+
const b = JSON.stringify(u == null ? void 0 : u.records, null, 2), N = new Blob([b], { type: "application/json" }), T = URL.createObjectURL(N), q = document.createElement("a");
|
|
3643
|
+
q.href = T, q.download = `${t.title}.json`, q.click();
|
|
3644
3644
|
}
|
|
3645
3645
|
function y() {
|
|
3646
3646
|
const N = [
|
|
@@ -3649,47 +3649,47 @@ function da() {
|
|
|
3649
3649
|
).join(","),
|
|
3650
3650
|
...((u == null ? void 0 : u.records) || []).map((B) => Object.values(B).join(","))
|
|
3651
3651
|
].join(`
|
|
3652
|
-
`),
|
|
3652
|
+
`), T = new Blob([N], { type: "text/csv" }), q = URL.createObjectURL(T), J = document.createElement("a");
|
|
3653
3653
|
J.href = q, J.download = `${t.title}.csv`, J.click();
|
|
3654
3654
|
}
|
|
3655
3655
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col py-3", children: [
|
|
3656
3656
|
(m || g) && /* @__PURE__ */ e.jsx("div", { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto flex h-10 w-10 items-center justify-center rounded-md bg-muted", children: /* @__PURE__ */ e.jsx(Qe, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }),
|
|
3657
3657
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
|
|
3658
3658
|
a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
3659
|
-
/* @__PURE__ */ e.jsx(
|
|
3660
|
-
!["table", "custom"].includes(t.type) && /* @__PURE__ */ e.jsx(
|
|
3661
|
-
/* @__PURE__ */ e.jsx(
|
|
3659
|
+
/* @__PURE__ */ e.jsx(Jl, {}),
|
|
3660
|
+
!["table", "custom"].includes(t.type) && /* @__PURE__ */ e.jsx($l, {}),
|
|
3661
|
+
/* @__PURE__ */ e.jsx(Kl, {})
|
|
3662
3662
|
] }),
|
|
3663
3663
|
!a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-1", children: [
|
|
3664
3664
|
/* @__PURE__ */ e.jsx(
|
|
3665
|
-
|
|
3665
|
+
M,
|
|
3666
3666
|
{
|
|
3667
3667
|
className: "h-7 w-fit px-1 font-mono text-xs text-muted-foreground/70",
|
|
3668
3668
|
variant: "ghost",
|
|
3669
3669
|
size: "icon",
|
|
3670
3670
|
onClick: y,
|
|
3671
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3671
|
+
children: /* @__PURE__ */ e.jsx(Bl, { className: "size-4" })
|
|
3672
3672
|
}
|
|
3673
3673
|
),
|
|
3674
3674
|
/* @__PURE__ */ e.jsx(
|
|
3675
|
-
|
|
3675
|
+
M,
|
|
3676
3676
|
{
|
|
3677
3677
|
className: "h-7 w-fit px-1 font-mono text-xs text-muted-foreground/70",
|
|
3678
3678
|
variant: "ghost",
|
|
3679
3679
|
size: "icon",
|
|
3680
3680
|
onClick: V,
|
|
3681
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3681
|
+
children: /* @__PURE__ */ e.jsx(Bn, { strokeWidth: 1.5, className: "size-4" })
|
|
3682
3682
|
}
|
|
3683
3683
|
),
|
|
3684
3684
|
/* @__PURE__ */ e.jsx(
|
|
3685
|
-
|
|
3685
|
+
nn,
|
|
3686
3686
|
{
|
|
3687
3687
|
text: JSON.stringify(u == null ? void 0 : u.records, null, 2),
|
|
3688
3688
|
className: "h-7 w-fit px-1 font-mono text-xs text-muted-foreground/70"
|
|
3689
3689
|
}
|
|
3690
3690
|
)
|
|
3691
3691
|
] }),
|
|
3692
|
-
/* @__PURE__ */ e.jsx(
|
|
3692
|
+
/* @__PURE__ */ e.jsx(Zl, {})
|
|
3693
3693
|
] }),
|
|
3694
3694
|
a ? E() : /* @__PURE__ */ e.jsxs(
|
|
3695
3695
|
ls,
|
|
@@ -3706,7 +3706,7 @@ function da() {
|
|
|
3706
3706
|
defaultSize: 30,
|
|
3707
3707
|
minSize: 10,
|
|
3708
3708
|
className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
|
|
3709
|
-
children: l && /* @__PURE__ */ e.jsx(
|
|
3709
|
+
children: l && /* @__PURE__ */ e.jsx(Ql, {})
|
|
3710
3710
|
}
|
|
3711
3711
|
),
|
|
3712
3712
|
/* @__PURE__ */ e.jsx(rs, {})
|
|
@@ -3719,9 +3719,9 @@ function da() {
|
|
|
3719
3719
|
minSize: 10,
|
|
3720
3720
|
className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
|
|
3721
3721
|
children: /* @__PURE__ */ e.jsxs(Ne, { className: "relative flex h-full min-h-0 w-full flex-1 basis-0", children: [
|
|
3722
|
-
(u == null ? void 0 : u.records) && (u == null ? void 0 : u.records.length) > 0 && /* @__PURE__ */ e.jsx(
|
|
3722
|
+
(u == null ? void 0 : u.records) && (u == null ? void 0 : u.records.length) > 0 && /* @__PURE__ */ e.jsx(ql, { data: (u == null ? void 0 : u.records) || [] }),
|
|
3723
3723
|
(v || (u == null ? void 0 : u.error)) && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs", children: (v == null ? void 0 : v.message) || ((f = u == null ? void 0 : u.error) == null ? void 0 : f.message) }),
|
|
3724
|
-
/* @__PURE__ */ e.jsx(
|
|
3724
|
+
/* @__PURE__ */ e.jsx(_e, { orientation: "horizontal" })
|
|
3725
3725
|
] })
|
|
3726
3726
|
}
|
|
3727
3727
|
)
|
|
@@ -3730,7 +3730,7 @@ function da() {
|
|
|
3730
3730
|
)
|
|
3731
3731
|
] });
|
|
3732
3732
|
}
|
|
3733
|
-
function
|
|
3733
|
+
function Ql() {
|
|
3734
3734
|
const s = h((a) => a.pythonStdOut);
|
|
3735
3735
|
if (!s) return null;
|
|
3736
3736
|
const t = s.replace(/\n/g, "<br>");
|
|
@@ -3738,18 +3738,18 @@ function Kl() {
|
|
|
3738
3738
|
/* @__PURE__ */ e.jsx("div", { className: "sticky top-0 flex max-h-11 min-h-11 grow items-center border-b bg-muted px-3 font-mono text-xs font-semibold text-foreground/70", children: "Python Output" }),
|
|
3739
3739
|
/* @__PURE__ */ e.jsxs(Ne, { className: "overflow-y-auto px-2 pt-1 font-mono text-xs text-foreground/90", children: [
|
|
3740
3740
|
/* @__PURE__ */ e.jsx("div", { dangerouslySetInnerHTML: { __html: t } }),
|
|
3741
|
-
/* @__PURE__ */ e.jsx(
|
|
3741
|
+
/* @__PURE__ */ e.jsx(_e, { orientation: "horizontal" })
|
|
3742
3742
|
] })
|
|
3743
3743
|
] });
|
|
3744
3744
|
}
|
|
3745
|
-
function
|
|
3745
|
+
function Zl() {
|
|
3746
3746
|
const s = h((a) => a.isShowingVisual), t = h(
|
|
3747
3747
|
(a) => a.actions.setIsShowingVisual
|
|
3748
3748
|
);
|
|
3749
3749
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3750
3750
|
/* @__PURE__ */ e.jsx($, { htmlFor: "visualize", children: "Chart" }),
|
|
3751
3751
|
/* @__PURE__ */ e.jsx(
|
|
3752
|
-
|
|
3752
|
+
on,
|
|
3753
3753
|
{
|
|
3754
3754
|
checked: s,
|
|
3755
3755
|
onCheckedChange: () => t(!s),
|
|
@@ -3759,7 +3759,7 @@ function Ql() {
|
|
|
3759
3759
|
)
|
|
3760
3760
|
] });
|
|
3761
3761
|
}
|
|
3762
|
-
function
|
|
3762
|
+
function Xl({
|
|
3763
3763
|
options: s,
|
|
3764
3764
|
value: t,
|
|
3765
3765
|
onValueChange: a
|
|
@@ -3799,7 +3799,7 @@ function fe({
|
|
|
3799
3799
|
] }) })
|
|
3800
3800
|
] });
|
|
3801
3801
|
}
|
|
3802
|
-
function
|
|
3802
|
+
function Ge({
|
|
3803
3803
|
children: s,
|
|
3804
3804
|
summary: t,
|
|
3805
3805
|
open: a,
|
|
@@ -3813,14 +3813,14 @@ function Ue({
|
|
|
3813
3813
|
children: [
|
|
3814
3814
|
/* @__PURE__ */ e.jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4", children: [
|
|
3815
3815
|
/* @__PURE__ */ e.jsx($, { children: t }),
|
|
3816
|
-
/* @__PURE__ */ e.jsx(
|
|
3816
|
+
/* @__PURE__ */ e.jsx(dn, { className: "h-4 w-4" })
|
|
3817
3817
|
] }),
|
|
3818
3818
|
/* @__PURE__ */ e.jsx("div", { className: "transition-all ease-in-out", children: s })
|
|
3819
3819
|
]
|
|
3820
3820
|
}
|
|
3821
3821
|
);
|
|
3822
3822
|
}
|
|
3823
|
-
function
|
|
3823
|
+
function Yl() {
|
|
3824
3824
|
var p, S;
|
|
3825
3825
|
const s = h(
|
|
3826
3826
|
(j) => j.card.customCardPreferences
|
|
@@ -3881,7 +3881,7 @@ function Xl() {
|
|
|
3881
3881
|
return s ? j === "input" ? /* @__PURE__ */ e.jsx(
|
|
3882
3882
|
de,
|
|
3883
3883
|
{
|
|
3884
|
-
className: `h-8 w-full ${
|
|
3884
|
+
className: `h-8 w-full ${Be}`,
|
|
3885
3885
|
value: ((k = s == null ? void 0 : s.settings) == null ? void 0 : k[A]) || "",
|
|
3886
3886
|
onChange: (E) => {
|
|
3887
3887
|
i({
|
|
@@ -3933,7 +3933,7 @@ function Xl() {
|
|
|
3933
3933
|
{
|
|
3934
3934
|
className: "p-6",
|
|
3935
3935
|
children: [
|
|
3936
|
-
/* @__PURE__ */ e.jsx(
|
|
3936
|
+
/* @__PURE__ */ e.jsx(Ge, { summary: "Plugin Settings", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 text-sm", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 text-sm", children: [
|
|
3937
3937
|
/* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
3938
3938
|
fe,
|
|
3939
3939
|
{
|
|
@@ -3951,7 +3951,7 @@ function Xl() {
|
|
|
3951
3951
|
}
|
|
3952
3952
|
) }) }),
|
|
3953
3953
|
((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && /* @__PURE__ */ e.jsx(
|
|
3954
|
-
|
|
3954
|
+
Xl,
|
|
3955
3955
|
{
|
|
3956
3956
|
options: [
|
|
3957
3957
|
{ value: "single", label: "Single Visual" },
|
|
@@ -3985,8 +3985,8 @@ function Xl() {
|
|
|
3985
3985
|
) })
|
|
3986
3986
|
] }) })
|
|
3987
3987
|
] }) }) }),
|
|
3988
|
-
/* @__PURE__ */ e.jsx(
|
|
3989
|
-
((S = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : S.componentName) && /* @__PURE__ */ e.jsxs(
|
|
3988
|
+
/* @__PURE__ */ e.jsx(ze, { className: "my-4" }),
|
|
3989
|
+
((S = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : S.componentName) && /* @__PURE__ */ e.jsxs(Ge, { summary: "Component Settings", children: [
|
|
3990
3990
|
u && u.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
3991
3991
|
/* @__PURE__ */ e.jsx($, { children: "Input Mapping" }),
|
|
3992
3992
|
/* @__PURE__ */ e.jsx("div", { className: "px-2", children: g(u) })
|
|
@@ -4148,7 +4148,7 @@ function gs() {
|
|
|
4148
4148
|
const es = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
|
|
4149
4149
|
function ua(s, t) {
|
|
4150
4150
|
var n, l, r;
|
|
4151
|
-
const a =
|
|
4151
|
+
const a = Ta(s, t);
|
|
4152
4152
|
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";
|
|
4153
4153
|
}
|
|
4154
4154
|
function at() {
|
|
@@ -4159,7 +4159,7 @@ function at() {
|
|
|
4159
4159
|
}), n = h((_) => {
|
|
4160
4160
|
var F;
|
|
4161
4161
|
return (F = _.card) == null ? void 0 : F.cfg;
|
|
4162
|
-
}), l =
|
|
4162
|
+
}), l = Ta(a, n), [r, i] = H(
|
|
4163
4163
|
ua(a)
|
|
4164
4164
|
), [o, d] = H(
|
|
4165
4165
|
((K = (W = (B = a == null ? void 0 : a.chartOptions) == null ? void 0 : B.scales) == null ? void 0 : W[l]) == null ? void 0 : K.min) || ""
|
|
@@ -4172,17 +4172,17 @@ function at() {
|
|
|
4172
4172
|
return (F = _.card) == null ? void 0 : F.type;
|
|
4173
4173
|
}), b = ["pie", "doughnut", "polarArea"].includes(f);
|
|
4174
4174
|
te(() => {
|
|
4175
|
-
var _, F, ie, ee, oe, ne, ae, he,
|
|
4175
|
+
var _, F, ie, ee, oe, ne, ae, he, z, L, G, Ce, qe, Te;
|
|
4176
4176
|
i(ua(a)), d(
|
|
4177
4177
|
((ie = (F = (_ = a == null ? void 0 : a.chartOptions) == null ? void 0 : _.scales) == null ? void 0 : F[l]) == null ? void 0 : ie.min) === 0 ? 0 : ""
|
|
4178
4178
|
), m(((ne = (oe = (ee = a == null ? void 0 : a.chartOptions) == null ? void 0 : ee.scales) == null ? void 0 : oe[l]) == null ? void 0 : ne.max) || ""), x(
|
|
4179
|
-
((L = (
|
|
4180
|
-
), S(((G = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : G.decimalPlaces) || 0), A(((Ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ce.suffix) || ""), k(((qe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : qe.currency) || ""), E(((
|
|
4179
|
+
((L = (z = (he = (ae = a == null ? void 0 : a.chartOptions) == null ? void 0 : ae.scales) == null ? void 0 : he[l]) == null ? void 0 : z.ticks) == null ? void 0 : L.stepSize) || ""
|
|
4180
|
+
), S(((G = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : G.decimalPlaces) || 0), A(((Ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ce.suffix) || ""), k(((qe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : qe.currency) || ""), E(((Te = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Te.locale) || "");
|
|
4181
4181
|
}, [s, a, l]);
|
|
4182
4182
|
function N(_, F) {
|
|
4183
4183
|
return F === "" || /^[0-9\b]+$/.test(F) ? Number(F) : Number(_);
|
|
4184
4184
|
}
|
|
4185
|
-
function
|
|
4185
|
+
function T() {
|
|
4186
4186
|
const _ = [
|
|
4187
4187
|
...new Set(is.map((F) => F.currency))
|
|
4188
4188
|
];
|
|
@@ -4321,7 +4321,7 @@ function at() {
|
|
|
4321
4321
|
V(ie);
|
|
4322
4322
|
}
|
|
4323
4323
|
return /* @__PURE__ */ e.jsxs(ms, { onOpenChange: (_) => t(_), children: [
|
|
4324
|
-
/* @__PURE__ */ e.jsx(xs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
4324
|
+
/* @__PURE__ */ e.jsx(xs, { asChild: !0, children: /* @__PURE__ */ e.jsx(un, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
4325
4325
|
/* @__PURE__ */ e.jsx(ps, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
|
|
4326
4326
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4327
4327
|
/* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
|
|
@@ -4372,10 +4372,10 @@ function at() {
|
|
|
4372
4372
|
)
|
|
4373
4373
|
] }),
|
|
4374
4374
|
g === "custom" && r == "linear" && q(),
|
|
4375
|
-
|
|
4376
|
-
/* @__PURE__ */ e.jsx(
|
|
4375
|
+
T(),
|
|
4376
|
+
/* @__PURE__ */ e.jsx(hn, {}),
|
|
4377
4377
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
4378
|
-
|
|
4378
|
+
M,
|
|
4379
4379
|
{
|
|
4380
4380
|
onClick: J,
|
|
4381
4381
|
variant: "secondary",
|
|
@@ -4387,7 +4387,7 @@ function at() {
|
|
|
4387
4387
|
] }) })
|
|
4388
4388
|
] });
|
|
4389
4389
|
}
|
|
4390
|
-
function
|
|
4390
|
+
function er({ idx: s }) {
|
|
4391
4391
|
var o;
|
|
4392
4392
|
const t = h((d) => {
|
|
4393
4393
|
var u;
|
|
@@ -4401,7 +4401,7 @@ function Yl({ idx: s }) {
|
|
|
4401
4401
|
(d) => d.actions.setCardPreferences
|
|
4402
4402
|
), l = (o = t == null ? void 0 : t.chartOptions) == null ? void 0 : o.indexAxis, r = a == null ? void 0 : a.find((d) => d.idx === s);
|
|
4403
4403
|
function i(d, u) {
|
|
4404
|
-
(d === "end" || d === "start") &&
|
|
4404
|
+
(d === "end" || d === "start") && mn(xn());
|
|
4405
4405
|
const m = {
|
|
4406
4406
|
display: d !== "none",
|
|
4407
4407
|
align: d,
|
|
@@ -4432,10 +4432,10 @@ function Yl({ idx: s }) {
|
|
|
4432
4432
|
}
|
|
4433
4433
|
}
|
|
4434
4434
|
return /* @__PURE__ */ e.jsxs(ms, { children: [
|
|
4435
|
-
/* @__PURE__ */ e.jsx(xs, { children: /* @__PURE__ */ e.jsx(
|
|
4435
|
+
/* @__PURE__ */ e.jsx(xs, { children: /* @__PURE__ */ e.jsx(rl, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
|
|
4436
4436
|
/* @__PURE__ */ e.jsx(ps, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
4437
4437
|
/* @__PURE__ */ e.jsx(
|
|
4438
|
-
|
|
4438
|
+
M,
|
|
4439
4439
|
{
|
|
4440
4440
|
onClick: () => i("none", s),
|
|
4441
4441
|
size: "sm",
|
|
@@ -4445,14 +4445,14 @@ function Yl({ idx: s }) {
|
|
|
4445
4445
|
}
|
|
4446
4446
|
),
|
|
4447
4447
|
/* @__PURE__ */ e.jsx(
|
|
4448
|
-
|
|
4448
|
+
M,
|
|
4449
4449
|
{
|
|
4450
4450
|
onClick: () => i("start", s),
|
|
4451
4451
|
size: "sm",
|
|
4452
4452
|
variant: "secondary",
|
|
4453
4453
|
className: "h-7 p-1 text-xs font-normal",
|
|
4454
4454
|
children: /* @__PURE__ */ e.jsx(
|
|
4455
|
-
|
|
4455
|
+
Kn,
|
|
4456
4456
|
{
|
|
4457
4457
|
className: Y("h-4 w-4", {
|
|
4458
4458
|
"rotate-90": l === "y"
|
|
@@ -4462,14 +4462,14 @@ function Yl({ idx: s }) {
|
|
|
4462
4462
|
}
|
|
4463
4463
|
),
|
|
4464
4464
|
/* @__PURE__ */ e.jsx(
|
|
4465
|
-
|
|
4465
|
+
M,
|
|
4466
4466
|
{
|
|
4467
4467
|
onClick: () => i("center", s),
|
|
4468
4468
|
size: "sm",
|
|
4469
4469
|
variant: "secondary",
|
|
4470
4470
|
className: "h-7 p-1 text-xs font-normal",
|
|
4471
4471
|
children: /* @__PURE__ */ e.jsx(
|
|
4472
|
-
|
|
4472
|
+
Zn,
|
|
4473
4473
|
{
|
|
4474
4474
|
className: Y("h-4 w-4", {
|
|
4475
4475
|
"rotate-90": l === "y"
|
|
@@ -4479,14 +4479,14 @@ function Yl({ idx: s }) {
|
|
|
4479
4479
|
}
|
|
4480
4480
|
),
|
|
4481
4481
|
/* @__PURE__ */ e.jsx(
|
|
4482
|
-
|
|
4482
|
+
M,
|
|
4483
4483
|
{
|
|
4484
4484
|
onClick: () => i("end", s),
|
|
4485
4485
|
size: "sm",
|
|
4486
4486
|
variant: "secondary",
|
|
4487
4487
|
className: "h-7 p-1 text-xs font-normal",
|
|
4488
4488
|
children: /* @__PURE__ */ e.jsx(
|
|
4489
|
-
|
|
4489
|
+
Qn,
|
|
4490
4490
|
{
|
|
4491
4491
|
className: Y("h-4 w-4", {
|
|
4492
4492
|
"rotate-90": l === "y"
|
|
@@ -4511,7 +4511,7 @@ function tt() {
|
|
|
4511
4511
|
} = Cs((a == null ? void 0 : a.records) || []);
|
|
4512
4512
|
let d = i;
|
|
4513
4513
|
if (["stackedBar", "stackedLine"].includes(s.type)) {
|
|
4514
|
-
const u =
|
|
4514
|
+
const u = pn({
|
|
4515
4515
|
dataArray: (a == null ? void 0 : a.records) || [],
|
|
4516
4516
|
groupKey: o[0],
|
|
4517
4517
|
pivotKey: o[1],
|
|
@@ -4522,18 +4522,21 @@ function tt() {
|
|
|
4522
4522
|
return r.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
4523
4523
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4524
4524
|
/* @__PURE__ */ e.jsx($, { children: n }),
|
|
4525
|
-
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-
|
|
4525
|
+
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-3 py-2 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { title: o[0], children: nt(o[0]) }) }) })
|
|
4526
4526
|
] }),
|
|
4527
4527
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4528
4528
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
|
|
4529
4529
|
/* @__PURE__ */ e.jsx($, { children: l }),
|
|
4530
4530
|
/* @__PURE__ */ e.jsx(at, {})
|
|
4531
4531
|
] }),
|
|
4532
|
-
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: d.map((u, m) => /* @__PURE__ */ e.jsx(
|
|
4532
|
+
/* @__PURE__ */ e.jsx("div", { className: "my-1 max-h-[125px] space-y-1 overflow-y-auto", children: d.map((u, m) => /* @__PURE__ */ e.jsx(sr, { col: u, idx: m }, u)) })
|
|
4533
4533
|
] })
|
|
4534
4534
|
] });
|
|
4535
4535
|
}
|
|
4536
|
-
function
|
|
4536
|
+
function nt(s, t = 30) {
|
|
4537
|
+
return s.length > t ? s.slice(0, t) + "..." : s;
|
|
4538
|
+
}
|
|
4539
|
+
function sr({ col: s, idx: t }) {
|
|
4537
4540
|
const a = h((o) => {
|
|
4538
4541
|
var d;
|
|
4539
4542
|
return (d = o.card) == null ? void 0 : d.preferences;
|
|
@@ -4568,8 +4571,8 @@ function er({ col: s, idx: t }) {
|
|
|
4568
4571
|
});
|
|
4569
4572
|
}
|
|
4570
4573
|
}
|
|
4571
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "group flex items-center justify-between gap-5 rounded-md bg-muted/70 px-
|
|
4572
|
-
/* @__PURE__ */ e.jsx("p", { children: s }),
|
|
4574
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "group flex items-center justify-between gap-5 rounded-md bg-muted/70 px-3 py-2 hover:bg-muted", children: [
|
|
4575
|
+
/* @__PURE__ */ e.jsx("p", { title: s, children: nt(s) }),
|
|
4573
4576
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
4574
4577
|
/* @__PURE__ */ e.jsx(
|
|
4575
4578
|
Ps,
|
|
@@ -4586,22 +4589,22 @@ function er({ col: s, idx: t }) {
|
|
|
4586
4589
|
}
|
|
4587
4590
|
),
|
|
4588
4591
|
/* @__PURE__ */ e.jsx(
|
|
4589
|
-
|
|
4592
|
+
qn,
|
|
4590
4593
|
{
|
|
4591
4594
|
onClick: () => i("area"),
|
|
4592
4595
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4593
4596
|
}
|
|
4594
4597
|
),
|
|
4595
|
-
/* @__PURE__ */ e.jsx(
|
|
4598
|
+
/* @__PURE__ */ e.jsx(er, { idx: t })
|
|
4596
4599
|
] })
|
|
4597
4600
|
] });
|
|
4598
4601
|
}
|
|
4599
|
-
function
|
|
4600
|
-
const s = h((c) => c.selectedConnectionId), t = h((c) => c.selectedDatamodelId), a = h((c) => c.selectedDatabaseName), n = h((c) => c.selectedSchemaName), l = h((c) => c.selectedTableName), r =
|
|
4602
|
+
function lt() {
|
|
4603
|
+
const s = h((c) => c.selectedConnectionId), t = h((c) => c.selectedDatamodelId), a = h((c) => c.selectedDatabaseName), n = h((c) => c.selectedSchemaName), l = h((c) => c.selectedTableName), r = O((c) => c.dashboard.filters) || [], i = O((c) => c.actions.addFilter), o = O((c) => c.actions.removeFilter), { removeFilterValues: d } = Ze(), { modelItems: u, tableName: m, connectionType: g } = Ve();
|
|
4601
4604
|
function v(c, x = "dashboard") {
|
|
4602
4605
|
var R;
|
|
4603
4606
|
const p = pe(c.column_name), S = pe(a || ""), j = pe(n || ""), A = pe(m);
|
|
4604
|
-
let D =
|
|
4607
|
+
let D = fn(
|
|
4605
4608
|
j,
|
|
4606
4609
|
A,
|
|
4607
4610
|
g
|
|
@@ -4616,7 +4619,7 @@ function nt() {
|
|
|
4616
4619
|
if (E)
|
|
4617
4620
|
d(E.id), o(E.id);
|
|
4618
4621
|
else {
|
|
4619
|
-
const V =
|
|
4622
|
+
const V = We();
|
|
4620
4623
|
return m === "api" && s ? (i({
|
|
4621
4624
|
location: x,
|
|
4622
4625
|
id: V,
|
|
@@ -4658,10 +4661,10 @@ function nt() {
|
|
|
4658
4661
|
}
|
|
4659
4662
|
return { assignFilter: v };
|
|
4660
4663
|
}
|
|
4661
|
-
function
|
|
4662
|
-
const s =
|
|
4664
|
+
function He() {
|
|
4665
|
+
const s = O(
|
|
4663
4666
|
(o) => o.dashboard.filters
|
|
4664
|
-
), t = h((o) => o.frame), { setFrame: a } = le(), { columns: n } = Ve(), { assignFilter: l } =
|
|
4667
|
+
), t = h((o) => o.frame), { setFrame: a } = le(), { columns: n } = Ve(), { assignFilter: l } = lt();
|
|
4665
4668
|
function r(o) {
|
|
4666
4669
|
const d = l(o, "frame");
|
|
4667
4670
|
a({ ...t, filterId: d });
|
|
@@ -4669,11 +4672,11 @@ function _e() {
|
|
|
4669
4672
|
const i = s == null ? void 0 : s.find((o) => o.id === t.filterId);
|
|
4670
4673
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
4671
4674
|
/* @__PURE__ */ e.jsx($, { children: "Card Filter" }),
|
|
4672
|
-
/* @__PURE__ */ e.jsx(
|
|
4673
|
-
i && /* @__PURE__ */ e.jsx(
|
|
4675
|
+
/* @__PURE__ */ e.jsx(ar, { onSelect: r, columns: n }),
|
|
4676
|
+
i && /* @__PURE__ */ e.jsx(Ma, { filter: i })
|
|
4674
4677
|
] });
|
|
4675
4678
|
}
|
|
4676
|
-
function
|
|
4679
|
+
function ar({
|
|
4677
4680
|
columns: s,
|
|
4678
4681
|
onSelect: t
|
|
4679
4682
|
}) {
|
|
@@ -4681,7 +4684,7 @@ function sr({
|
|
|
4681
4684
|
const [a, n] = ra.useState(!1), [l, r] = ra.useState("");
|
|
4682
4685
|
return /* @__PURE__ */ e.jsxs(ms, { open: a, onOpenChange: n, children: [
|
|
4683
4686
|
/* @__PURE__ */ e.jsx(xs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
4684
|
-
|
|
4687
|
+
M,
|
|
4685
4688
|
{
|
|
4686
4689
|
size: "sm",
|
|
4687
4690
|
variant: "outline",
|
|
@@ -4690,16 +4693,16 @@ function sr({
|
|
|
4690
4693
|
className: "w-full justify-between font-normal",
|
|
4691
4694
|
children: [
|
|
4692
4695
|
l ? (i = s.find((o) => o.column_name === l)) == null ? void 0 : i.column_name : "Select Column...",
|
|
4693
|
-
/* @__PURE__ */ e.jsx(
|
|
4696
|
+
/* @__PURE__ */ e.jsx(gn, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
4694
4697
|
]
|
|
4695
4698
|
}
|
|
4696
4699
|
) }),
|
|
4697
|
-
/* @__PURE__ */ e.jsx(ps, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(
|
|
4698
|
-
/* @__PURE__ */ e.jsx(
|
|
4699
|
-
/* @__PURE__ */ e.jsxs(
|
|
4700
|
-
/* @__PURE__ */ e.jsx(
|
|
4701
|
-
/* @__PURE__ */ e.jsx(
|
|
4702
|
-
|
|
4700
|
+
/* @__PURE__ */ e.jsx(ps, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(jn, { children: [
|
|
4701
|
+
/* @__PURE__ */ e.jsx(bn, { placeholder: "Search column", className: "h-9" }),
|
|
4702
|
+
/* @__PURE__ */ e.jsxs(vn, { children: [
|
|
4703
|
+
/* @__PURE__ */ e.jsx(yn, { children: "No framework found." }),
|
|
4704
|
+
/* @__PURE__ */ e.jsx(Nn, { children: s.map((o) => /* @__PURE__ */ e.jsxs(
|
|
4705
|
+
Cn,
|
|
4703
4706
|
{
|
|
4704
4707
|
value: o.column_name,
|
|
4705
4708
|
onSelect: (d) => {
|
|
@@ -4709,7 +4712,7 @@ function sr({
|
|
|
4709
4712
|
children: [
|
|
4710
4713
|
o.column_name,
|
|
4711
4714
|
/* @__PURE__ */ e.jsx(
|
|
4712
|
-
|
|
4715
|
+
Sn,
|
|
4713
4716
|
{
|
|
4714
4717
|
className: Y(
|
|
4715
4718
|
"ml-auto h-4 w-4",
|
|
@@ -4725,7 +4728,7 @@ function sr({
|
|
|
4725
4728
|
] }) })
|
|
4726
4729
|
] });
|
|
4727
4730
|
}
|
|
4728
|
-
function
|
|
4731
|
+
function tr({
|
|
4729
4732
|
cardType: s
|
|
4730
4733
|
}) {
|
|
4731
4734
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ee, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
@@ -4765,7 +4768,7 @@ function ar({
|
|
|
4765
4768
|
/* @__PURE__ */ e.jsx(Z, { children: "Filters" }),
|
|
4766
4769
|
/* @__PURE__ */ e.jsxs(X, { className: "space-y-4 px-2", children: [
|
|
4767
4770
|
/* @__PURE__ */ e.jsx(Ae, {}),
|
|
4768
|
-
/* @__PURE__ */ e.jsx(
|
|
4771
|
+
/* @__PURE__ */ e.jsx(He, {})
|
|
4769
4772
|
] })
|
|
4770
4773
|
] })
|
|
4771
4774
|
] }) });
|
|
@@ -4821,7 +4824,7 @@ function Js() {
|
|
|
4821
4824
|
)
|
|
4822
4825
|
] });
|
|
4823
4826
|
}
|
|
4824
|
-
function
|
|
4827
|
+
function nr({
|
|
4825
4828
|
cardType: s
|
|
4826
4829
|
}) {
|
|
4827
4830
|
function t(a) {
|
|
@@ -4863,12 +4866,12 @@ function tr({
|
|
|
4863
4866
|
/* @__PURE__ */ e.jsx(Z, { children: "Filters" }),
|
|
4864
4867
|
/* @__PURE__ */ e.jsxs(X, { className: "space-y-4 px-2", children: [
|
|
4865
4868
|
/* @__PURE__ */ e.jsx(Ae, {}),
|
|
4866
|
-
/* @__PURE__ */ e.jsx(
|
|
4869
|
+
/* @__PURE__ */ e.jsx(He, {})
|
|
4867
4870
|
] })
|
|
4868
4871
|
] })
|
|
4869
4872
|
] }) });
|
|
4870
4873
|
}
|
|
4871
|
-
const
|
|
4874
|
+
const lr = {
|
|
4872
4875
|
datasets: [
|
|
4873
4876
|
{
|
|
4874
4877
|
type: "line",
|
|
@@ -4881,7 +4884,7 @@ const nr = {
|
|
|
4881
4884
|
data: []
|
|
4882
4885
|
}
|
|
4883
4886
|
]
|
|
4884
|
-
},
|
|
4887
|
+
}, rr = {
|
|
4885
4888
|
datasets: [
|
|
4886
4889
|
{
|
|
4887
4890
|
fill: "origin",
|
|
@@ -4891,7 +4894,7 @@ const nr = {
|
|
|
4891
4894
|
}
|
|
4892
4895
|
]
|
|
4893
4896
|
};
|
|
4894
|
-
function
|
|
4897
|
+
function ir() {
|
|
4895
4898
|
const s = h((t) => t.card.type);
|
|
4896
4899
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
|
|
4897
4900
|
/* @__PURE__ */ e.jsx(
|
|
@@ -4900,18 +4903,18 @@ function rr() {
|
|
|
4900
4903
|
className: " ",
|
|
4901
4904
|
type: "single",
|
|
4902
4905
|
collapsible: !0,
|
|
4903
|
-
children:
|
|
4906
|
+
children: or(s)
|
|
4904
4907
|
}
|
|
4905
4908
|
),
|
|
4906
4909
|
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(gs, {}) }),
|
|
4907
4910
|
!["kpi"].includes(s) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
4908
4911
|
/* @__PURE__ */ e.jsx(Js, {}),
|
|
4909
4912
|
/* @__PURE__ */ e.jsx(Ae, {}),
|
|
4910
|
-
/* @__PURE__ */ e.jsx(
|
|
4913
|
+
/* @__PURE__ */ e.jsx(He, {})
|
|
4911
4914
|
] })
|
|
4912
4915
|
] });
|
|
4913
4916
|
}
|
|
4914
|
-
function
|
|
4917
|
+
function or(s) {
|
|
4915
4918
|
if (["line", "bar"].includes(s))
|
|
4916
4919
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
4917
4920
|
/* @__PURE__ */ e.jsxs(Q, { value: "item-1", children: [
|
|
@@ -4932,7 +4935,7 @@ function ir(s) {
|
|
|
4932
4935
|
/* @__PURE__ */ e.jsx("b", { children: "Customize" }),
|
|
4933
4936
|
" and change the `type` property in the dataset."
|
|
4934
4937
|
] }),
|
|
4935
|
-
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(
|
|
4938
|
+
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(lr, null, 2) })
|
|
4936
4939
|
] })
|
|
4937
4940
|
] }),
|
|
4938
4941
|
/* @__PURE__ */ e.jsxs(Q, { value: "item-3", children: [
|
|
@@ -4953,7 +4956,7 @@ function ir(s) {
|
|
|
4953
4956
|
),
|
|
4954
4957
|
"for more options."
|
|
4955
4958
|
] }),
|
|
4956
|
-
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(
|
|
4959
|
+
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(rr, null, 2) })
|
|
4957
4960
|
] })
|
|
4958
4961
|
] })
|
|
4959
4962
|
] });
|
|
@@ -5008,7 +5011,7 @@ function ir(s) {
|
|
|
5008
5011
|
] })
|
|
5009
5012
|
] }) });
|
|
5010
5013
|
}
|
|
5011
|
-
function
|
|
5014
|
+
function cr() {
|
|
5012
5015
|
var d, u, m, g, v;
|
|
5013
5016
|
const s = h((c) => c.card.preferences), t = h(
|
|
5014
5017
|
(c) => c.actions.setCardPreferences
|
|
@@ -5163,9 +5166,9 @@ function or() {
|
|
|
5163
5166
|
] })
|
|
5164
5167
|
] })
|
|
5165
5168
|
] }) }),
|
|
5166
|
-
/* @__PURE__ */ e.jsx(
|
|
5169
|
+
/* @__PURE__ */ e.jsx(ze, { className: "my-3" }),
|
|
5167
5170
|
/* @__PURE__ */ e.jsx(
|
|
5168
|
-
|
|
5171
|
+
wn,
|
|
5169
5172
|
{
|
|
5170
5173
|
colorRanges: r,
|
|
5171
5174
|
setColorRanges: i
|
|
@@ -5174,7 +5177,7 @@ function or() {
|
|
|
5174
5177
|
] })
|
|
5175
5178
|
] });
|
|
5176
5179
|
}
|
|
5177
|
-
function
|
|
5180
|
+
function dr() {
|
|
5178
5181
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
5179
5182
|
/* @__PURE__ */ e.jsx(Ee, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(Q, { value: "item-1", children: [
|
|
5180
5183
|
/* @__PURE__ */ e.jsx(Z, { className: "", children: "KPI Query" }),
|
|
@@ -5200,12 +5203,12 @@ function cr() {
|
|
|
5200
5203
|
] })
|
|
5201
5204
|
] })
|
|
5202
5205
|
] }) }),
|
|
5203
|
-
/* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(
|
|
5206
|
+
/* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(cr, {}) }),
|
|
5204
5207
|
/* @__PURE__ */ e.jsx("div", {}),
|
|
5205
5208
|
/* @__PURE__ */ e.jsx("div", {})
|
|
5206
5209
|
] });
|
|
5207
5210
|
}
|
|
5208
|
-
const
|
|
5211
|
+
const ur = [
|
|
5209
5212
|
{
|
|
5210
5213
|
label: "Mercator",
|
|
5211
5214
|
value: "mercator"
|
|
@@ -5262,7 +5265,7 @@ const dr = [
|
|
|
5262
5265
|
label: "Natural Earth 1",
|
|
5263
5266
|
value: "naturalEarth1"
|
|
5264
5267
|
}
|
|
5265
|
-
],
|
|
5268
|
+
], hr = [
|
|
5266
5269
|
"blues",
|
|
5267
5270
|
"brBG",
|
|
5268
5271
|
"buGn",
|
|
@@ -5301,11 +5304,11 @@ const dr = [
|
|
|
5301
5304
|
"ylGnBu",
|
|
5302
5305
|
"ylOrBr",
|
|
5303
5306
|
"ylOrRd"
|
|
5304
|
-
],
|
|
5307
|
+
], mr = hr.map((s) => ({
|
|
5305
5308
|
label: s,
|
|
5306
5309
|
value: s
|
|
5307
5310
|
}));
|
|
5308
|
-
function
|
|
5311
|
+
function xr() {
|
|
5309
5312
|
var d, u, m, g, v, c, x, p, S, j, A, D, k, C, E, R, V, y;
|
|
5310
5313
|
const s = h((f) => f.card), t = (u = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : u.topoJsonUrl, [a, n] = H(
|
|
5311
5314
|
((g = (m = s == null ? void 0 : s.preferences) == null ? void 0 : m.mapVisualOptions) == null ? void 0 : g.customTopoJsonUrl) || ""
|
|
@@ -5327,9 +5330,9 @@ function mr() {
|
|
|
5327
5330
|
}
|
|
5328
5331
|
];
|
|
5329
5332
|
return /* @__PURE__ */ e.jsxs("div", { className: "p-6", children: [
|
|
5330
|
-
/* @__PURE__ */ e.jsx(
|
|
5331
|
-
/* @__PURE__ */ e.jsx(
|
|
5332
|
-
/* @__PURE__ */ e.jsx(
|
|
5333
|
+
/* @__PURE__ */ e.jsx(Ge, { summary: "Map Query", children: /* @__PURE__ */ e.jsx("p", { className: "rounded-md bg-muted p-2 font-mono text-xs", children: "SELECT country, value FROM table" }) }),
|
|
5334
|
+
/* @__PURE__ */ e.jsx(ze, { className: "my-4" }),
|
|
5335
|
+
/* @__PURE__ */ e.jsx(Ge, { open: !0, summary: "Settings", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-3 px-2", children: [
|
|
5333
5336
|
/* @__PURE__ */ e.jsx(
|
|
5334
5337
|
fe,
|
|
5335
5338
|
{
|
|
@@ -5365,7 +5368,7 @@ function mr() {
|
|
|
5365
5368
|
});
|
|
5366
5369
|
},
|
|
5367
5370
|
value: a,
|
|
5368
|
-
className: `h-9 w-full ${
|
|
5371
|
+
className: `h-9 w-full ${Be}`,
|
|
5369
5372
|
placeholder: "Custom URL"
|
|
5370
5373
|
}
|
|
5371
5374
|
),
|
|
@@ -5398,7 +5401,7 @@ function mr() {
|
|
|
5398
5401
|
fe,
|
|
5399
5402
|
{
|
|
5400
5403
|
className: "h-9",
|
|
5401
|
-
options:
|
|
5404
|
+
options: ur,
|
|
5402
5405
|
value: ((p = (x = s.preferences) == null ? void 0 : x.mapVisualOptions) == null ? void 0 : p.projection) || "",
|
|
5403
5406
|
label: "Projection",
|
|
5404
5407
|
onValueChange: (f) => {
|
|
@@ -5420,7 +5423,7 @@ function mr() {
|
|
|
5420
5423
|
fe,
|
|
5421
5424
|
{
|
|
5422
5425
|
className: "h-9",
|
|
5423
|
-
options:
|
|
5426
|
+
options: mr,
|
|
5424
5427
|
value: ((j = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : j.colorScale) || "",
|
|
5425
5428
|
label: "Select Color Scale",
|
|
5426
5429
|
onValueChange: (f) => {
|
|
@@ -5438,12 +5441,12 @@ function mr() {
|
|
|
5438
5441
|
] })
|
|
5439
5442
|
] })
|
|
5440
5443
|
] }) }),
|
|
5441
|
-
/* @__PURE__ */ e.jsx(
|
|
5442
|
-
/* @__PURE__ */ e.jsx(
|
|
5444
|
+
/* @__PURE__ */ e.jsx(ze, { className: "my-4" }),
|
|
5445
|
+
/* @__PURE__ */ e.jsx(Ge, { className: "", summary: "Scale Options", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
5443
5446
|
/* @__PURE__ */ e.jsx(
|
|
5444
5447
|
de,
|
|
5445
5448
|
{
|
|
5446
|
-
className: `h-9 w-full ${
|
|
5449
|
+
className: `h-9 w-full ${Be}`,
|
|
5447
5450
|
type: "number",
|
|
5448
5451
|
step: 0.1,
|
|
5449
5452
|
value: ((D = (A = s.preferences) == null ? void 0 : A.mapVisualOptions) == null ? void 0 : D.projectionScale) || 1,
|
|
@@ -5463,19 +5466,19 @@ function mr() {
|
|
|
5463
5466
|
/* @__PURE__ */ e.jsx(
|
|
5464
5467
|
de,
|
|
5465
5468
|
{
|
|
5466
|
-
className: `h-9 w-full ${
|
|
5469
|
+
className: `h-9 w-full ${Be}`,
|
|
5467
5470
|
type: "number",
|
|
5468
5471
|
step: 10,
|
|
5469
5472
|
value: ((E = (C = (k = s.preferences) == null ? void 0 : k.mapVisualOptions) == null ? void 0 : C.projectionOffset) == null ? void 0 : E[0]) || 0,
|
|
5470
5473
|
onChange: (f) => {
|
|
5471
|
-
var b, N,
|
|
5474
|
+
var b, N, T, q;
|
|
5472
5475
|
l({
|
|
5473
5476
|
...s.preferences,
|
|
5474
5477
|
mapVisualOptions: {
|
|
5475
5478
|
...(b = s.preferences) == null ? void 0 : b.mapVisualOptions,
|
|
5476
5479
|
projectionOffset: [
|
|
5477
5480
|
Number(f.target.value),
|
|
5478
|
-
((q = (
|
|
5481
|
+
((q = (T = (N = s.preferences) == null ? void 0 : N.mapVisualOptions) == null ? void 0 : T.projectionOffset) == null ? void 0 : q[1]) || 0
|
|
5479
5482
|
]
|
|
5480
5483
|
}
|
|
5481
5484
|
});
|
|
@@ -5486,18 +5489,18 @@ function mr() {
|
|
|
5486
5489
|
/* @__PURE__ */ e.jsx(
|
|
5487
5490
|
de,
|
|
5488
5491
|
{
|
|
5489
|
-
className: `h-9 w-full ${
|
|
5492
|
+
className: `h-9 w-full ${Be}`,
|
|
5490
5493
|
type: "number",
|
|
5491
5494
|
step: 10,
|
|
5492
5495
|
value: ((y = (V = (R = s.preferences) == null ? void 0 : R.mapVisualOptions) == null ? void 0 : V.projectionOffset) == null ? void 0 : y[1]) || 0,
|
|
5493
5496
|
onChange: (f) => {
|
|
5494
|
-
var b, N,
|
|
5497
|
+
var b, N, T, q;
|
|
5495
5498
|
l({
|
|
5496
5499
|
...s.preferences,
|
|
5497
5500
|
mapVisualOptions: {
|
|
5498
5501
|
...(b = s.preferences) == null ? void 0 : b.mapVisualOptions,
|
|
5499
5502
|
projectionOffset: [
|
|
5500
|
-
((q = (
|
|
5503
|
+
((q = (T = (N = s.preferences) == null ? void 0 : N.mapVisualOptions) == null ? void 0 : T.projectionOffset) == null ? void 0 : q[0]) || 0,
|
|
5501
5504
|
Number(f.target.value)
|
|
5502
5505
|
]
|
|
5503
5506
|
}
|
|
@@ -5506,11 +5509,11 @@ function mr() {
|
|
|
5506
5509
|
}
|
|
5507
5510
|
)
|
|
5508
5511
|
] }) }),
|
|
5509
|
-
/* @__PURE__ */ e.jsx(
|
|
5512
|
+
/* @__PURE__ */ e.jsx(ze, { className: "my-4" }),
|
|
5510
5513
|
/* @__PURE__ */ e.jsx(Ae, {})
|
|
5511
5514
|
] });
|
|
5512
5515
|
}
|
|
5513
|
-
function
|
|
5516
|
+
function pr() {
|
|
5514
5517
|
var n;
|
|
5515
5518
|
const s = h((l) => l.card.preferences), { setCardPreferences: t } = h((l) => l.actions);
|
|
5516
5519
|
function a(l) {
|
|
@@ -5578,19 +5581,19 @@ function ss({
|
|
|
5578
5581
|
/* @__PURE__ */ e.jsxs(X, { className: "space-y-4 px-2", children: [
|
|
5579
5582
|
s === "range" && /* @__PURE__ */ e.jsx(gs, {}),
|
|
5580
5583
|
s !== "text" && /* @__PURE__ */ e.jsx(Js, {}),
|
|
5581
|
-
s === "text" && /* @__PURE__ */ e.jsx(
|
|
5584
|
+
s === "text" && /* @__PURE__ */ e.jsx(pr, {})
|
|
5582
5585
|
] })
|
|
5583
5586
|
] }),
|
|
5584
5587
|
!["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(Q, { value: "item-3", children: [
|
|
5585
5588
|
/* @__PURE__ */ e.jsx(Z, { children: "Filters" }),
|
|
5586
5589
|
/* @__PURE__ */ e.jsxs(X, { className: "space-y-4 px-2", children: [
|
|
5587
5590
|
/* @__PURE__ */ e.jsx(Ae, {}),
|
|
5588
|
-
/* @__PURE__ */ e.jsx(
|
|
5591
|
+
/* @__PURE__ */ e.jsx(He, {})
|
|
5589
5592
|
] })
|
|
5590
5593
|
] })
|
|
5591
5594
|
] }) });
|
|
5592
5595
|
}
|
|
5593
|
-
function
|
|
5596
|
+
function fr() {
|
|
5594
5597
|
const s = h(
|
|
5595
5598
|
(n) => {
|
|
5596
5599
|
var l, r;
|
|
@@ -5665,12 +5668,12 @@ function pr() {
|
|
|
5665
5668
|
/* @__PURE__ */ e.jsx(Z, { children: "Filters" }),
|
|
5666
5669
|
/* @__PURE__ */ e.jsxs(X, { className: "space-y-4 px-2", children: [
|
|
5667
5670
|
/* @__PURE__ */ e.jsx(Ae, {}),
|
|
5668
|
-
/* @__PURE__ */ e.jsx(
|
|
5671
|
+
/* @__PURE__ */ e.jsx(He, {})
|
|
5669
5672
|
] })
|
|
5670
5673
|
] })
|
|
5671
5674
|
] }) });
|
|
5672
5675
|
}
|
|
5673
|
-
function
|
|
5676
|
+
function gr({}) {
|
|
5674
5677
|
const s = h((n) => {
|
|
5675
5678
|
var l;
|
|
5676
5679
|
return (l = n.card) == null ? void 0 : l.preferences;
|
|
@@ -5687,7 +5690,7 @@ function fr({}) {
|
|
|
5687
5690
|
/* @__PURE__ */ e.jsx(Z, { children: "Filters" }),
|
|
5688
5691
|
/* @__PURE__ */ e.jsxs(X, { className: "space-y-4 px-2", children: [
|
|
5689
5692
|
/* @__PURE__ */ e.jsx(Ae, {}),
|
|
5690
|
-
/* @__PURE__ */ e.jsx(
|
|
5693
|
+
/* @__PURE__ */ e.jsx(He, {})
|
|
5691
5694
|
] })
|
|
5692
5695
|
] }) }),
|
|
5693
5696
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
@@ -5703,7 +5706,7 @@ function fr({}) {
|
|
|
5703
5706
|
] })
|
|
5704
5707
|
] });
|
|
5705
5708
|
}
|
|
5706
|
-
const
|
|
5709
|
+
const jr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
5707
5710
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
|
|
5708
5711
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
5709
5712
|
"See ",
|
|
@@ -5719,7 +5722,7 @@ const gr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
5719
5722
|
),
|
|
5720
5723
|
" in the docs."
|
|
5721
5724
|
] })
|
|
5722
|
-
] }),
|
|
5725
|
+
] }), br = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
5723
5726
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT y-axis, label, range-from, range-to, range-value FROM table" }),
|
|
5724
5727
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
5725
5728
|
"See ",
|
|
@@ -5735,7 +5738,7 @@ const gr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
5735
5738
|
),
|
|
5736
5739
|
" in the docs."
|
|
5737
5740
|
] })
|
|
5738
|
-
] }),
|
|
5741
|
+
] }), vr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
5739
5742
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT text FROM table limit 1" }),
|
|
5740
5743
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
5741
5744
|
"See ",
|
|
@@ -5752,22 +5755,22 @@ const gr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
5752
5755
|
" in the docs."
|
|
5753
5756
|
] })
|
|
5754
5757
|
] });
|
|
5755
|
-
function
|
|
5758
|
+
function yr() {
|
|
5756
5759
|
const s = h((a) => a.card.type);
|
|
5757
5760
|
function t(a) {
|
|
5758
5761
|
switch (a) {
|
|
5759
5762
|
case "stackedBar":
|
|
5760
5763
|
case "stackedLine":
|
|
5761
|
-
return /* @__PURE__ */ e.jsx(
|
|
5764
|
+
return /* @__PURE__ */ e.jsx(fr, {});
|
|
5762
5765
|
case "pyramid":
|
|
5763
|
-
return /* @__PURE__ */ e.jsx(ss, { docContent:
|
|
5766
|
+
return /* @__PURE__ */ e.jsx(ss, { docContent: jr, cardType: a });
|
|
5764
5767
|
case "kpi":
|
|
5765
|
-
return /* @__PURE__ */ e.jsx(
|
|
5768
|
+
return /* @__PURE__ */ e.jsx(dr, {});
|
|
5766
5769
|
case "line":
|
|
5767
5770
|
case "bar":
|
|
5768
|
-
return /* @__PURE__ */ e.jsx(
|
|
5771
|
+
return /* @__PURE__ */ e.jsx(tr, { cardType: a });
|
|
5769
5772
|
case "range":
|
|
5770
|
-
return /* @__PURE__ */ e.jsx(ss, { docContent:
|
|
5773
|
+
return /* @__PURE__ */ e.jsx(ss, { docContent: br, cardType: a });
|
|
5771
5774
|
case "pie":
|
|
5772
5775
|
case "doughnut":
|
|
5773
5776
|
case "polarArea":
|
|
@@ -5775,29 +5778,32 @@ function vr() {
|
|
|
5775
5778
|
return /* @__PURE__ */ e.jsx(ss, { cardType: a });
|
|
5776
5779
|
case "bubble":
|
|
5777
5780
|
case "scatter":
|
|
5778
|
-
return /* @__PURE__ */ e.jsx(
|
|
5781
|
+
return /* @__PURE__ */ e.jsx(nr, { cardType: a });
|
|
5779
5782
|
case "table":
|
|
5780
|
-
return /* @__PURE__ */ e.jsx(
|
|
5783
|
+
return /* @__PURE__ */ e.jsx(gr, { cardType: a });
|
|
5781
5784
|
case "text":
|
|
5782
5785
|
return /* @__PURE__ */ e.jsx(
|
|
5783
5786
|
ss,
|
|
5784
5787
|
{
|
|
5785
|
-
docContent:
|
|
5788
|
+
docContent: vr,
|
|
5786
5789
|
cardType: a,
|
|
5787
5790
|
suffix: "Visual"
|
|
5788
5791
|
}
|
|
5789
5792
|
);
|
|
5790
5793
|
case "map":
|
|
5791
|
-
return /* @__PURE__ */ e.jsx(
|
|
5794
|
+
return /* @__PURE__ */ e.jsx(xr, {});
|
|
5792
5795
|
case "custom":
|
|
5793
|
-
return /* @__PURE__ */ e.jsx(
|
|
5796
|
+
return /* @__PURE__ */ e.jsx(Yl, {});
|
|
5794
5797
|
default:
|
|
5795
|
-
return /* @__PURE__ */ e.jsx(
|
|
5798
|
+
return /* @__PURE__ */ e.jsx(ir, {});
|
|
5796
5799
|
}
|
|
5797
5800
|
}
|
|
5798
|
-
return /* @__PURE__ */ e.
|
|
5801
|
+
return /* @__PURE__ */ e.jsxs(Ne, { className: "h-full w-full text-sm", children: [
|
|
5802
|
+
t(s),
|
|
5803
|
+
/* @__PURE__ */ e.jsx(_e, { orientation: "horizontal" })
|
|
5804
|
+
] });
|
|
5799
5805
|
}
|
|
5800
|
-
function
|
|
5806
|
+
function Nr() {
|
|
5801
5807
|
const s = h((t) => t.isShowingVisual);
|
|
5802
5808
|
return /* @__PURE__ */ e.jsxs(
|
|
5803
5809
|
ls,
|
|
@@ -5812,7 +5818,7 @@ function yr() {
|
|
|
5812
5818
|
className: "flex",
|
|
5813
5819
|
minSize: 20,
|
|
5814
5820
|
defaultSize: 40,
|
|
5815
|
-
children: /* @__PURE__ */ e.jsx(
|
|
5821
|
+
children: /* @__PURE__ */ e.jsx(Al, {})
|
|
5816
5822
|
}
|
|
5817
5823
|
),
|
|
5818
5824
|
/* @__PURE__ */ e.jsx(rs, { withHandle: !0, className: "border" }),
|
|
@@ -5831,7 +5837,7 @@ function yr() {
|
|
|
5831
5837
|
minSize: 20,
|
|
5832
5838
|
defaultSize: 25,
|
|
5833
5839
|
maxSize: 30,
|
|
5834
|
-
children: /* @__PURE__ */ e.jsx(
|
|
5840
|
+
children: /* @__PURE__ */ e.jsx(yr, {})
|
|
5835
5841
|
}
|
|
5836
5842
|
) }),
|
|
5837
5843
|
/* @__PURE__ */ e.jsx(rs, { className: "border" }),
|
|
@@ -5843,15 +5849,15 @@ function yr() {
|
|
|
5843
5849
|
}
|
|
5844
5850
|
);
|
|
5845
5851
|
}
|
|
5846
|
-
function
|
|
5847
|
-
|
|
5848
|
-
const n = h((i) => i.actions.setOnSave), l = h((i) => i.actions.setOnClose), r =
|
|
5852
|
+
function Cr({ authToken: s, onSave: t, onClose: a }) {
|
|
5853
|
+
O((i) => i.themeStyle);
|
|
5854
|
+
const n = h((i) => i.actions.setOnSave), l = h((i) => i.actions.setOnClose), r = O((i) => i.actions.setAuthToken);
|
|
5849
5855
|
return te(() => {
|
|
5850
5856
|
t && n(t), a && l(a);
|
|
5851
5857
|
}, [t, n, a, l]), te(() => {
|
|
5852
5858
|
s && s.accessToken && r(s);
|
|
5853
5859
|
}, [s, r]), /* @__PURE__ */ e.jsx(hs, { FallbackComponent: Da, children: /* @__PURE__ */ e.jsxs(
|
|
5854
|
-
|
|
5860
|
+
kn,
|
|
5855
5861
|
{
|
|
5856
5862
|
style: {
|
|
5857
5863
|
// borderRadius: currentStyle?.chart?.options?.borderRadius,
|
|
@@ -5860,15 +5866,15 @@ function Nr({ authToken: s, onSave: t, onClose: a }) {
|
|
|
5860
5866
|
className: "rounded-none",
|
|
5861
5867
|
role: "editor-panel",
|
|
5862
5868
|
children: [
|
|
5863
|
-
/* @__PURE__ */ e.jsx(
|
|
5864
|
-
/* @__PURE__ */ e.jsx(On, { children: /* @__PURE__ */ e.jsx(
|
|
5869
|
+
/* @__PURE__ */ e.jsx(zn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Ha, {}) }),
|
|
5870
|
+
/* @__PURE__ */ e.jsx(On, { children: /* @__PURE__ */ e.jsx(Nr, {}) })
|
|
5865
5871
|
]
|
|
5866
5872
|
}
|
|
5867
5873
|
) });
|
|
5868
5874
|
}
|
|
5869
|
-
function
|
|
5870
|
-
|
|
5871
|
-
const s =
|
|
5875
|
+
function Sr() {
|
|
5876
|
+
O((i) => i.selectedCardId);
|
|
5877
|
+
const s = O((i) => i.selectedSheetId), { setIsVisualEditing: t } = O((i) => i.actions), a = O((i) => i.isVisualEditing), n = O((i) => i.actions.updateFrame);
|
|
5872
5878
|
function l(i) {
|
|
5873
5879
|
s && (n(s, i), t(!1));
|
|
5874
5880
|
}
|
|
@@ -5882,12 +5888,12 @@ function Cr() {
|
|
|
5882
5888
|
className: Y("flex grow", {
|
|
5883
5889
|
"max-h-0 overflow-hidden": !a
|
|
5884
5890
|
}),
|
|
5885
|
-
children: /* @__PURE__ */ e.jsx(
|
|
5891
|
+
children: /* @__PURE__ */ e.jsx(Cr, { onSave: l, onClose: r })
|
|
5886
5892
|
}
|
|
5887
5893
|
);
|
|
5888
5894
|
}
|
|
5889
|
-
function
|
|
5890
|
-
const s = h((r) => r.selectedDatabaseName), t = h((r) => r.selectedTableName), a =
|
|
5895
|
+
function wr() {
|
|
5896
|
+
const s = h((r) => r.selectedDatabaseName), t = h((r) => r.selectedTableName), a = O((r) => r.dashboard.filters) || [], { columns: n } = Ve(), { assignFilter: l } = lt();
|
|
5891
5897
|
return /* @__PURE__ */ e.jsx(Ne, { className: "flex-1 basis-0 flex-col px-3", children: n == null ? void 0 : n.map((r) => {
|
|
5892
5898
|
const i = a == null ? void 0 : a.find(
|
|
5893
5899
|
(o) => o.column === pe(r.column_name) && o.table === t && o.database === s
|
|
@@ -5911,21 +5917,21 @@ function Sr() {
|
|
|
5911
5917
|
);
|
|
5912
5918
|
}) });
|
|
5913
5919
|
}
|
|
5914
|
-
function
|
|
5915
|
-
|
|
5916
|
-
const s =
|
|
5920
|
+
function kr() {
|
|
5921
|
+
O((t) => t.showFilters);
|
|
5922
|
+
const s = O(
|
|
5917
5923
|
(t) => t.actions.setShowFilters
|
|
5918
5924
|
);
|
|
5919
5925
|
return /* @__PURE__ */ e.jsxs("section", { className: "relative flex min-w-[320px] grow flex-col border-l px-1", children: [
|
|
5920
5926
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
|
|
5921
5927
|
/* @__PURE__ */ e.jsx($, { className: "px-2 text-lg", children: "Filters" }),
|
|
5922
5928
|
/* @__PURE__ */ e.jsx(
|
|
5923
|
-
|
|
5929
|
+
M,
|
|
5924
5930
|
{
|
|
5925
5931
|
onClick: () => s(!1),
|
|
5926
5932
|
className: "h-7 w-7 p-0",
|
|
5927
5933
|
variant: "ghost",
|
|
5928
|
-
children: /* @__PURE__ */ e.jsx(
|
|
5934
|
+
children: /* @__PURE__ */ e.jsx(Je, {})
|
|
5929
5935
|
}
|
|
5930
5936
|
)
|
|
5931
5937
|
] }),
|
|
@@ -5935,7 +5941,7 @@ function wr() {
|
|
|
5935
5941
|
ColumnsComponent: () => (
|
|
5936
5942
|
// schemaName, tableName, columns
|
|
5937
5943
|
/* @__PURE__ */ e.jsx(
|
|
5938
|
-
|
|
5944
|
+
wr,
|
|
5939
5945
|
{}
|
|
5940
5946
|
)
|
|
5941
5947
|
)
|
|
@@ -5943,8 +5949,8 @@ function wr() {
|
|
|
5943
5949
|
) })
|
|
5944
5950
|
] });
|
|
5945
5951
|
}
|
|
5946
|
-
function
|
|
5947
|
-
const s =
|
|
5952
|
+
function zr() {
|
|
5953
|
+
const s = O((n) => n.dashboard.filters), t = O((n) => n.theme), a = s == null ? void 0 : s.filter((n) => n.hide);
|
|
5948
5954
|
return a != null && a.length ? /* @__PURE__ */ e.jsx(
|
|
5949
5955
|
"div",
|
|
5950
5956
|
{
|
|
@@ -5957,7 +5963,7 @@ function kr() {
|
|
|
5957
5963
|
{
|
|
5958
5964
|
className: "flex min-w-[250px] max-w-fit flex-col gap-1 p-2",
|
|
5959
5965
|
children: [
|
|
5960
|
-
/* @__PURE__ */ e.jsx(
|
|
5966
|
+
/* @__PURE__ */ e.jsx(Ma, { filter: n }),
|
|
5961
5967
|
/* @__PURE__ */ e.jsx(ka, { filter: n })
|
|
5962
5968
|
]
|
|
5963
5969
|
},
|
|
@@ -5967,7 +5973,7 @@ function kr() {
|
|
|
5967
5973
|
) : null;
|
|
5968
5974
|
}
|
|
5969
5975
|
function Or() {
|
|
5970
|
-
const s =
|
|
5976
|
+
const s = O((n) => n.showFilters), t = O((n) => n.isVisualEditing), a = O(
|
|
5971
5977
|
(n) => n.isDashboardEditing
|
|
5972
5978
|
);
|
|
5973
5979
|
return /* @__PURE__ */ e.jsxs(
|
|
@@ -5982,18 +5988,18 @@ function Or() {
|
|
|
5982
5988
|
}),
|
|
5983
5989
|
children: [
|
|
5984
5990
|
/* @__PURE__ */ e.jsxs("section", { className: "flex grow flex-col", children: [
|
|
5985
|
-
a && /* @__PURE__ */ e.jsx(
|
|
5986
|
-
/* @__PURE__ */ e.jsx(
|
|
5991
|
+
a && /* @__PURE__ */ e.jsx(zr, {}),
|
|
5992
|
+
/* @__PURE__ */ e.jsx(In, {})
|
|
5987
5993
|
] }),
|
|
5988
|
-
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(
|
|
5994
|
+
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(kr, {}) })
|
|
5989
5995
|
]
|
|
5990
5996
|
}
|
|
5991
5997
|
);
|
|
5992
5998
|
}
|
|
5993
|
-
function
|
|
5994
|
-
const s =
|
|
5999
|
+
function Ir() {
|
|
6000
|
+
const s = O((l) => l.dashboard), t = O((l) => l.actions.setDashboard), a = O(
|
|
5995
6001
|
(l) => l.showDashboardJSON
|
|
5996
|
-
), n =
|
|
6002
|
+
), n = O(
|
|
5997
6003
|
(l) => l.actions.setShowDashboardJSON
|
|
5998
6004
|
);
|
|
5999
6005
|
return /* @__PURE__ */ e.jsxs(
|
|
@@ -6004,7 +6010,7 @@ function zr() {
|
|
|
6004
6010
|
}),
|
|
6005
6011
|
children: [
|
|
6006
6012
|
/* @__PURE__ */ e.jsxs(
|
|
6007
|
-
|
|
6013
|
+
M,
|
|
6008
6014
|
{
|
|
6009
6015
|
variant: "secondary",
|
|
6010
6016
|
size: "sm",
|
|
@@ -6017,7 +6023,7 @@ function zr() {
|
|
|
6017
6023
|
}
|
|
6018
6024
|
),
|
|
6019
6025
|
/* @__PURE__ */ e.jsx(
|
|
6020
|
-
|
|
6026
|
+
Tn,
|
|
6021
6027
|
{
|
|
6022
6028
|
onChange: (l) => {
|
|
6023
6029
|
if (l)
|
|
@@ -6049,18 +6055,18 @@ function zr() {
|
|
|
6049
6055
|
}
|
|
6050
6056
|
);
|
|
6051
6057
|
}
|
|
6052
|
-
function
|
|
6058
|
+
function Fr({
|
|
6053
6059
|
showControls: s = !1,
|
|
6054
6060
|
showFooter: t = !0,
|
|
6055
6061
|
...a
|
|
6056
6062
|
}) {
|
|
6057
6063
|
return /* @__PURE__ */ e.jsx(hs, { FallbackComponent: Da, children: /* @__PURE__ */ e.jsxs(Mn, { dashboardProps: a, children: [
|
|
6058
|
-
/* @__PURE__ */ e.jsx(
|
|
6059
|
-
/* @__PURE__ */ e.jsxs(
|
|
6060
|
-
/* @__PURE__ */ e.jsx(
|
|
6061
|
-
/* @__PURE__ */ e.jsxs(
|
|
6062
|
-
s && /* @__PURE__ */ e.jsx(
|
|
6063
|
-
/* @__PURE__ */ e.jsx(
|
|
6064
|
+
/* @__PURE__ */ e.jsx(Dn, {}),
|
|
6065
|
+
/* @__PURE__ */ e.jsxs(Fn, { children: [
|
|
6066
|
+
/* @__PURE__ */ e.jsx(Ir, {}),
|
|
6067
|
+
/* @__PURE__ */ e.jsxs(Ln, { ...a, children: [
|
|
6068
|
+
s && /* @__PURE__ */ e.jsx(gl, {}),
|
|
6069
|
+
/* @__PURE__ */ e.jsx(Sr, {}),
|
|
6064
6070
|
/* @__PURE__ */ e.jsx(Or, {})
|
|
6065
6071
|
] })
|
|
6066
6072
|
] })
|
|
@@ -6068,47 +6074,47 @@ function Dr({
|
|
|
6068
6074
|
}
|
|
6069
6075
|
export {
|
|
6070
6076
|
Ve as A,
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6077
|
+
Vn as B,
|
|
6078
|
+
qn as C,
|
|
6079
|
+
Fr as D,
|
|
6074
6080
|
Bs as E,
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6081
|
+
Bn as F,
|
|
6082
|
+
Un as G,
|
|
6083
|
+
Gn as H,
|
|
6084
|
+
$e as I,
|
|
6079
6085
|
Ra as J,
|
|
6080
|
-
|
|
6081
|
-
|
|
6086
|
+
cl as K,
|
|
6087
|
+
Kn as L,
|
|
6082
6088
|
Aa as M,
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6089
|
+
Yn as N,
|
|
6090
|
+
el as P,
|
|
6091
|
+
sl as R,
|
|
6092
|
+
al as S,
|
|
6087
6093
|
Us as T,
|
|
6088
|
-
|
|
6094
|
+
An as a,
|
|
6089
6095
|
Ps as b,
|
|
6090
6096
|
$s as c,
|
|
6091
6097
|
La as d,
|
|
6092
6098
|
Ea as e,
|
|
6093
6099
|
Va as f,
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6100
|
+
Rn as g,
|
|
6101
|
+
_n as h,
|
|
6102
|
+
Hn as i,
|
|
6103
|
+
Pn as j,
|
|
6104
|
+
$n as k,
|
|
6105
|
+
Jn as l,
|
|
6106
|
+
Wn as m,
|
|
6107
|
+
Qn as n,
|
|
6108
|
+
Zn as o,
|
|
6103
6109
|
Qe as p,
|
|
6104
|
-
|
|
6110
|
+
Xn as q,
|
|
6105
6111
|
qa as r,
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
+
tl as s,
|
|
6113
|
+
nl as t,
|
|
6114
|
+
ll as u,
|
|
6115
|
+
rl as v,
|
|
6116
|
+
il as w,
|
|
6117
|
+
ol as x,
|
|
6112
6118
|
Gs as y,
|
|
6113
|
-
|
|
6119
|
+
pl as z
|
|
6114
6120
|
};
|