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