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