react-semaphor 0.1.207 → 0.1.209
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{dashboard-controls-HlEsqiRq.js → dashboard-controls-BNTI4r0_.js} +581 -553
- package/dist/chunks/{dashboard-controls-CwMm9_ki.js → dashboard-controls-Dcpx9_an.js} +8 -8
- package/dist/chunks/{dashboard-json-DoYcT7tI.js → dashboard-json-BjOqpGbW.js} +1 -1
- package/dist/chunks/{dashboard-json-CI8wIOzY.js → dashboard-json-kIoBtmBF.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-ioe7ZyFE.js → dashboard-summary-settings-dialog-BoX18wiA.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-eQcHYcAI.js → dashboard-summary-settings-dialog-CO1SwHHD.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-Cl_qfIV_.js → edit-dashboard-visual-B9HuGExj.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-BotbTTiL.js → edit-dashboard-visual-DG4VLoJF.js} +1108 -1122
- package/dist/chunks/editor-action-buttons-CDTIx_Jc.js +11 -0
- package/dist/chunks/editor-action-buttons-CszdZ4Fw.js +345 -0
- package/dist/chunks/{index-CqOQuBxB.js → index-D0TdW88i.js} +24716 -24254
- package/dist/chunks/index-DSA80lEg.js +1104 -0
- package/dist/chunks/{notification-bell-BSBRPw38.js → notification-bell-D2V1-ARa.js} +1 -1
- package/dist/chunks/{notification-bell-BI-XywDI.js → notification-bell-DFiRaeJQ.js} +52 -52
- package/dist/chunks/resource-management-panel-BhiWNPcw.js +6 -0
- package/dist/chunks/resource-management-panel-DS_WEv1x.js +902 -0
- package/dist/chunks/{use-role-aware-display-preferences-BWghO18e.js → use-role-aware-display-preferences-D8j5_cnK.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-C-m9KEuJ.js → use-role-aware-display-preferences-DfihB5pN.js} +1 -1
- package/dist/chunks/{use-visual-utils-BbVM0bck.js → use-visual-utils-BfLXO_vi.js} +34 -34
- package/dist/chunks/{use-visual-utils-DHmGIepC.js → use-visual-utils-CzcVz3zB.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +5 -5
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +12 -1
- package/dist/types/main.d.ts +13 -1
- package/dist/types/surfboard.d.ts +12 -1
- package/dist/types/types.d.ts +12 -1
- package/package.json +1 -1
- package/dist/chunks/editor-action-buttons-B0-mScSZ.js +0 -340
- package/dist/chunks/editor-action-buttons-CcXUQDy4.js +0 -11
- package/dist/chunks/index-plgMsXq1.js +0 -1104
- package/dist/chunks/resource-management-panel-D0q51oXw.js +0 -6
- package/dist/chunks/resource-management-panel-Z8x52dx2.js +0 -914
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const p=require("react"),t=require("./index-
|
|
1
|
+
"use strict";const p=require("react"),t=require("./index-DSA80lEg.js"),e=require("react/jsx-runtime"),N=require("./editor-action-buttons-CDTIx_Jc.js"),T=require("./use-visual-utils-CzcVz3zB.js"),I=require("./date-formatter-Sz6QDaM8.js");/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import oe, { useState as A, useRef as
|
|
2
|
-
import {
|
|
3
|
-
import { jsx as t, jsxs as r, Fragment as
|
|
4
|
-
import { E as
|
|
5
|
-
import { a as ne } from "./use-visual-utils-
|
|
1
|
+
import oe, { useState as A, useRef as V, useCallback as P, useEffect as D, useContext as ie } from "react";
|
|
2
|
+
import { bP as te, l as R, bC as S, aW as B, aH as se, aG as $, bB as ae, aI as le, m as ce, n as de, o as ue, p as me, q as he, L as O, cs as pe, cC as fe, cD as H, G as ge, B as E, H as _, bA as M, bK as ve, u as I, bL as xe, bs as re, cE as be, cF as j, I as U, bE as we, cG as Ce, c as T, b_ as G, b$ as q, c0 as X, c1 as W, c2 as K, by as Ne, cH as ye, cI as Ae, cJ as Ee, cg as De, ch as Se, ci as Ie, cK as ke, cj as Ue, ck as Te, cl as Fe, cm as Pe, cn as Me, am as Le, a2 as Ve, cL as ze, cM as Oe, aw as Re, X as Be, cN as $e, cO as _e, cP as He, al as Q, a3 as je, bD as Ge, P as qe, s as Xe, cQ as We, t as Ke } from "./index-D0TdW88i.js";
|
|
3
|
+
import { jsx as t, jsxs as r, Fragment as L } from "react/jsx-runtime";
|
|
4
|
+
import { E as Qe, V as Je, a as Ye, b as Ze, S as J, c as et, C as tt } from "./editor-action-buttons-CszdZ4Fw.js";
|
|
5
|
+
import { a as ne } from "./use-visual-utils-BfLXO_vi.js";
|
|
6
6
|
import { c as Y } from "./date-formatter-Y8Za1ib3.js";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -32,15 +32,15 @@ function lt(e) {
|
|
|
32
32
|
return s < ot ? at : s < it ? rt : nt;
|
|
33
33
|
}
|
|
34
34
|
function wt() {
|
|
35
|
-
const { authToken: e, tokenProps: s } = R(), m =
|
|
35
|
+
const { authToken: e, tokenProps: s } = R(), m = S((f) => f.activeExports), [o, c] = A(
|
|
36
36
|
typeof document < "u" ? !document.hidden : !0
|
|
37
|
-
), d =
|
|
38
|
-
const f =
|
|
37
|
+
), d = V(null), a = V(!1), n = V(void 0), x = s == null ? void 0 : s.apiServiceUrl, u = e == null ? void 0 : e.accessToken, g = P(() => {
|
|
38
|
+
const f = S.getState().activeExports;
|
|
39
39
|
return Array.from(f.values()).filter(
|
|
40
40
|
(b) => B(b.status)
|
|
41
41
|
);
|
|
42
42
|
}, []);
|
|
43
|
-
|
|
43
|
+
D(() => {
|
|
44
44
|
if (typeof document > "u") return;
|
|
45
45
|
const f = () => {
|
|
46
46
|
c(!document.hidden);
|
|
@@ -63,7 +63,7 @@ function wt() {
|
|
|
63
63
|
(l) => b - l.startedAt.getTime() > ee
|
|
64
64
|
);
|
|
65
65
|
if (y.length > 0) {
|
|
66
|
-
const { updateExport: l } =
|
|
66
|
+
const { updateExport: l } = S.getState().actions;
|
|
67
67
|
for (const i of y)
|
|
68
68
|
l(i.id, {
|
|
69
69
|
status: "failed",
|
|
@@ -110,7 +110,7 @@ function wt() {
|
|
|
110
110
|
), null;
|
|
111
111
|
}
|
|
112
112
|
})
|
|
113
|
-
), { updateExport: N } =
|
|
113
|
+
), { updateExport: N } = S.getState().actions;
|
|
114
114
|
for (const l of v)
|
|
115
115
|
l.status === "fulfilled" && l.value && N(l.value.id, l.value);
|
|
116
116
|
const h = g();
|
|
@@ -126,18 +126,18 @@ function wt() {
|
|
|
126
126
|
} else
|
|
127
127
|
a.current = !1;
|
|
128
128
|
}, [x, u, g]);
|
|
129
|
-
return
|
|
129
|
+
return D(() => {
|
|
130
130
|
n.current = C;
|
|
131
|
-
}, [C]),
|
|
131
|
+
}, [C]), D(() => {
|
|
132
132
|
var b;
|
|
133
133
|
g().length > 0 && o && !a.current && (a.current = !0, (b = n.current) == null || b.call(n));
|
|
134
|
-
}, [m, o, g]),
|
|
134
|
+
}, [m, o, g]), D(() => {
|
|
135
135
|
var b;
|
|
136
136
|
const f = g();
|
|
137
137
|
o && f.length > 0 && !a.current && (a.current = !0, (b = n.current) == null || b.call(n));
|
|
138
|
-
}, [o, g]),
|
|
138
|
+
}, [o, g]), D(() => {
|
|
139
139
|
!o && d.current && (clearTimeout(d.current), d.current = null, a.current = !1);
|
|
140
|
-
}, [o]),
|
|
140
|
+
}, [o]), D(() => () => {
|
|
141
141
|
d.current && (clearTimeout(d.current), d.current = null);
|
|
142
142
|
}, []), {
|
|
143
143
|
isPolling: a.current,
|
|
@@ -146,8 +146,8 @@ function wt() {
|
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
function Ct() {
|
|
149
|
-
const { authToken: e, tokenProps: s } = R(), m =
|
|
150
|
-
|
|
149
|
+
const { authToken: e, tokenProps: s } = R(), m = S((n) => n.activeExports), { addExport: o } = ae(), c = V(!1), d = s == null ? void 0 : s.apiServiceUrl, a = e == null ? void 0 : e.accessToken;
|
|
150
|
+
D(() => {
|
|
151
151
|
if (c.current || !d || !a) return;
|
|
152
152
|
(async () => {
|
|
153
153
|
try {
|
|
@@ -261,7 +261,7 @@ function dt({
|
|
|
261
261
|
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
262
262
|
/* @__PURE__ */ r("div", { className: "flex items-center space-x-2", children: [
|
|
263
263
|
/* @__PURE__ */ t(
|
|
264
|
-
|
|
264
|
+
H,
|
|
265
265
|
{
|
|
266
266
|
id: "save-to-dashboard",
|
|
267
267
|
checked: f,
|
|
@@ -283,7 +283,7 @@ function dt({
|
|
|
283
283
|
] }),
|
|
284
284
|
/* @__PURE__ */ r("div", { className: "flex items-center space-x-2", children: [
|
|
285
285
|
/* @__PURE__ */ t(
|
|
286
|
-
|
|
286
|
+
H,
|
|
287
287
|
{
|
|
288
288
|
id: "save-to-library",
|
|
289
289
|
checked: g,
|
|
@@ -318,7 +318,7 @@ function dt({
|
|
|
318
318
|
}
|
|
319
319
|
),
|
|
320
320
|
/* @__PURE__ */ r(E, { onClick: y, disabled: !p || c, children: [
|
|
321
|
-
c && /* @__PURE__ */ t(
|
|
321
|
+
c && /* @__PURE__ */ t(_, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
322
322
|
c ? "Saving..." : "Save"
|
|
323
323
|
] })
|
|
324
324
|
] })
|
|
@@ -408,10 +408,10 @@ function Nt({
|
|
|
408
408
|
const h = await v(o);
|
|
409
409
|
h.success ? (U.success("Visual added to dashboard"), a(!1)) : U.error(h.error || "Failed to add visual to dashboard");
|
|
410
410
|
};
|
|
411
|
-
return /* @__PURE__ */ r(
|
|
412
|
-
!n && /* @__PURE__ */ t(
|
|
413
|
-
n && /* @__PURE__ */ r(
|
|
414
|
-
x && /* @__PURE__ */ t(
|
|
411
|
+
return /* @__PURE__ */ r(L, { children: [
|
|
412
|
+
!n && /* @__PURE__ */ t(Qe, { className: e, variant: "default" }),
|
|
413
|
+
n && /* @__PURE__ */ r(L, { children: [
|
|
414
|
+
x && /* @__PURE__ */ t(Je, { className: e }),
|
|
415
415
|
u && d && m && (m.sql || Ce(m.config)) && /* @__PURE__ */ r(
|
|
416
416
|
E,
|
|
417
417
|
{
|
|
@@ -437,14 +437,14 @@ function Nt({
|
|
|
437
437
|
children: /* @__PURE__ */ t(X, { className: "h-4 w-4" })
|
|
438
438
|
}
|
|
439
439
|
) }),
|
|
440
|
-
/* @__PURE__ */ t(
|
|
441
|
-
|
|
440
|
+
/* @__PURE__ */ t(W, { align: "end", children: /* @__PURE__ */ r(
|
|
441
|
+
K,
|
|
442
442
|
{
|
|
443
443
|
onClick: (h) => {
|
|
444
444
|
h.stopPropagation(), C(!0);
|
|
445
445
|
},
|
|
446
446
|
children: [
|
|
447
|
-
/* @__PURE__ */ t(
|
|
447
|
+
/* @__PURE__ */ t(J, { className: "mr-2 h-4 w-4" }),
|
|
448
448
|
"Save As..."
|
|
449
449
|
]
|
|
450
450
|
}
|
|
@@ -461,8 +461,8 @@ function Nt({
|
|
|
461
461
|
children: /* @__PURE__ */ t(X, { className: "h-4 w-4" })
|
|
462
462
|
}
|
|
463
463
|
) }),
|
|
464
|
-
/* @__PURE__ */ t(
|
|
465
|
-
/* @__PURE__ */ t(
|
|
464
|
+
/* @__PURE__ */ t(W, { align: "end", children: /* @__PURE__ */ r(K, { onClick: () => C(!0), children: [
|
|
465
|
+
/* @__PURE__ */ t(J, { className: "mr-2 h-4 w-4" }),
|
|
466
466
|
"Save As..."
|
|
467
467
|
] }) })
|
|
468
468
|
] }),
|
|
@@ -510,9 +510,9 @@ function At({
|
|
|
510
510
|
onDiscard: o,
|
|
511
511
|
isSaving: c
|
|
512
512
|
}) {
|
|
513
|
-
return /* @__PURE__ */ t(
|
|
513
|
+
return /* @__PURE__ */ t(De, { open: e, onOpenChange: (a) => {
|
|
514
514
|
!a && c || s(a);
|
|
515
|
-
}, children: /* @__PURE__ */ r(
|
|
515
|
+
}, children: /* @__PURE__ */ r(Se, { className: "max-w-md", children: [
|
|
516
516
|
/* @__PURE__ */ r(Ie, { children: [
|
|
517
517
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
|
|
518
518
|
/* @__PURE__ */ t("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-amber-100", children: /* @__PURE__ */ t(ke, { className: "h-5 w-5 text-amber-600" }) }),
|
|
@@ -544,8 +544,8 @@ function At({
|
|
|
544
544
|
onClick: m,
|
|
545
545
|
disabled: c,
|
|
546
546
|
className: "order-3 m-0 bg-primary text-primary-foreground hover:bg-primary/90 sm:order-3",
|
|
547
|
-
children: c ? /* @__PURE__ */ r(
|
|
548
|
-
/* @__PURE__ */ t(
|
|
547
|
+
children: c ? /* @__PURE__ */ r(L, { children: [
|
|
548
|
+
/* @__PURE__ */ t(_, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
549
549
|
"Saving..."
|
|
550
550
|
] }) : "Save & Close"
|
|
551
551
|
}
|
|
@@ -554,11 +554,11 @@ function At({
|
|
|
554
554
|
] }) });
|
|
555
555
|
}
|
|
556
556
|
function Et(e, s, m, o) {
|
|
557
|
-
|
|
558
|
-
e && !m && s && o(
|
|
557
|
+
D(() => {
|
|
558
|
+
e && !m && s && o(Le(s));
|
|
559
559
|
}, [e, m, s, o]);
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function Dt({
|
|
562
562
|
triggerButtonClassName: e,
|
|
563
563
|
variant: s = "ghost"
|
|
564
564
|
}) {
|
|
@@ -569,9 +569,9 @@ function St({
|
|
|
569
569
|
var n;
|
|
570
570
|
return (n = a.dashboard) == null ? void 0 : n.title;
|
|
571
571
|
});
|
|
572
|
-
return c ? /* @__PURE__ */ r(
|
|
572
|
+
return c ? /* @__PURE__ */ r(L, { children: [
|
|
573
573
|
/* @__PURE__ */ t(
|
|
574
|
-
|
|
574
|
+
Ve,
|
|
575
575
|
{
|
|
576
576
|
tooltip: "Schedule Dashboard",
|
|
577
577
|
className: T("h-7 p-2", e),
|
|
@@ -602,11 +602,11 @@ function mt({
|
|
|
602
602
|
}, c = () => {
|
|
603
603
|
switch (e.status) {
|
|
604
604
|
case "completed":
|
|
605
|
-
return /* @__PURE__ */ t(
|
|
605
|
+
return /* @__PURE__ */ t(He, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
|
|
606
606
|
case "failed":
|
|
607
607
|
return /* @__PURE__ */ t(tt, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
|
|
608
608
|
default:
|
|
609
|
-
return /* @__PURE__ */ t(
|
|
609
|
+
return /* @__PURE__ */ t(_, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
|
|
610
610
|
}
|
|
611
611
|
}, d = B(e.status), a = (() => {
|
|
612
612
|
switch (e.status) {
|
|
@@ -633,7 +633,7 @@ function mt({
|
|
|
633
633
|
e.totalRows.toLocaleString(),
|
|
634
634
|
" rows"
|
|
635
635
|
] }),
|
|
636
|
-
e.fileSize && /* @__PURE__ */ r(
|
|
636
|
+
e.fileSize && /* @__PURE__ */ r(L, { children: [
|
|
637
637
|
/* @__PURE__ */ t("span", { children: "•" }),
|
|
638
638
|
/* @__PURE__ */ t("span", { children: Re(e.fileSize) })
|
|
639
639
|
] })
|
|
@@ -672,7 +672,7 @@ function mt({
|
|
|
672
672
|
)
|
|
673
673
|
] }),
|
|
674
674
|
d && /* @__PURE__ */ r("div", { children: [
|
|
675
|
-
/* @__PURE__ */ t(
|
|
675
|
+
/* @__PURE__ */ t(_e, { value: e.progress, className: "h-1.5" }),
|
|
676
676
|
/* @__PURE__ */ r("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
|
|
677
677
|
e.progress,
|
|
678
678
|
"% complete"
|
|
@@ -683,7 +683,7 @@ function mt({
|
|
|
683
683
|
] });
|
|
684
684
|
}
|
|
685
685
|
function ht() {
|
|
686
|
-
const { authToken: e, tokenProps: s } = R(), m =
|
|
686
|
+
const { authToken: e, tokenProps: s } = R(), m = S((p) => p.activeExports), { clearCompleted: o, removeExport: c, updateExport: d } = ae(), [a, n] = A(!1), [x, u] = A(!1), g = Array.from(m.values()).sort(
|
|
687
687
|
(p, v) => v.startedAt.getTime() - p.startedAt.getTime()
|
|
688
688
|
), C = g.some(
|
|
689
689
|
(p) => p.status === "completed" || p.status === "failed"
|
|
@@ -743,7 +743,7 @@ function ht() {
|
|
|
743
743
|
const N = g.filter(
|
|
744
744
|
(l) => l.status === "completed" || l.status === "failed"
|
|
745
745
|
), h = await Promise.allSettled(
|
|
746
|
-
N.map(async (l) => (await
|
|
746
|
+
N.map(async (l) => (await Q(p, v, l.id), l.id))
|
|
747
747
|
);
|
|
748
748
|
for (const l of h)
|
|
749
749
|
l.status === "fulfilled" ? c(l.value) : console.error("Failed to delete export:", l.reason);
|
|
@@ -761,7 +761,7 @@ function ht() {
|
|
|
761
761
|
const v = s == null ? void 0 : s.apiServiceUrl, N = e == null ? void 0 : e.accessToken;
|
|
762
762
|
if (v && N)
|
|
763
763
|
try {
|
|
764
|
-
await
|
|
764
|
+
await Q(v, N, p), c(p);
|
|
765
765
|
return;
|
|
766
766
|
} catch (h) {
|
|
767
767
|
console.error(`Failed to cancel export ${p}:`, h);
|
|
@@ -821,8 +821,8 @@ function ht() {
|
|
|
821
821
|
)) }) })
|
|
822
822
|
] });
|
|
823
823
|
}
|
|
824
|
-
function
|
|
825
|
-
const e =
|
|
824
|
+
function St() {
|
|
825
|
+
const e = S((n) => n.activeExports), s = Ge(), m = e.size > 0, o = Array.from(e.values()).some(
|
|
826
826
|
(n) => n.status === "completed" || n.status === "failed"
|
|
827
827
|
), d = s > 0 ? s > 9 ? "9+" : String(s) : null;
|
|
828
828
|
return /* @__PURE__ */ r(qe, { children: [
|
|
@@ -834,7 +834,7 @@ function Dt() {
|
|
|
834
834
|
className: "relative h-8 w-8",
|
|
835
835
|
"aria-label": "Export notifications",
|
|
836
836
|
children: [
|
|
837
|
-
/* @__PURE__ */ t(
|
|
837
|
+
/* @__PURE__ */ t(We, { className: "h-4 w-4" }),
|
|
838
838
|
m && /* @__PURE__ */ t(
|
|
839
839
|
"span",
|
|
840
840
|
{
|
|
@@ -845,14 +845,14 @@ function Dt() {
|
|
|
845
845
|
]
|
|
846
846
|
}
|
|
847
847
|
) }),
|
|
848
|
-
/* @__PURE__ */ t(
|
|
848
|
+
/* @__PURE__ */ t(Ke, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(ht, {}) })
|
|
849
849
|
] });
|
|
850
850
|
}
|
|
851
851
|
export {
|
|
852
852
|
yt as A,
|
|
853
853
|
mt as E,
|
|
854
|
-
|
|
855
|
-
|
|
854
|
+
St as N,
|
|
855
|
+
Dt as S,
|
|
856
856
|
At as U,
|
|
857
857
|
Nt as V,
|
|
858
858
|
ht as a,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-DSA80lEg.js"),c=require("react"),le=require("./use-visual-utils-CzcVz3zB.js"),he=require("./use-role-aware-display-preferences-D8j5_cnK.js");/**
|
|
2
|
+
* @license lucide-react v0.453.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const me=s.createLucideIcon("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);function xe(t,f={}){const{enabled:p=!0,eventType:o="mousedown"}=f,r=c.useRef(null);return c.useEffect(()=>{const u=j=>{const i=j.target;r.current&&r.current.contains(i)||i instanceof Element&&(i.closest("[data-radix-popper-content-wrapper]")||i.closest("[data-radix-select-content]")||i.closest("[data-radix-popover-content]")||i.closest("[data-radix-dropdown-menu-content]")||i.closest("[data-radix-tooltip-content]")||i.closest('[role="listbox"]')||i.closest('[role="option"]')||i.closest('[role="combobox"]'))||i instanceof Element&&i.hasAttribute("data-radix-")||t()};return p&&document.addEventListener(o,u),()=>{document.removeEventListener(o,u)}},[t,p,o]),r}function de(){return e.jsx("div",{className:"space-y-1 px-2 py-2",children:[...Array(5)].map((t,f)=>e.jsxs("div",{className:"flex animate-pulse items-start gap-3 rounded-md px-2 py-2",children:[e.jsx("div",{className:"mt-0.5 h-4 w-4 flex-shrink-0 rounded bg-muted/60"}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx("div",{className:"h-4 w-3/5 rounded bg-muted/60"}),e.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40"})]})]},f))})}const pe=t=>{const f=s.useDashboardStore(r=>r.isVisualEditing),p=s.useDashboardStore(r=>r.selectedFrameId),o=s.useEditorStore(r=>r.frame);return!!(f&&p&&(o==null?void 0:o.visualId)===t)};function fe({visual:t,isDeleting:f,isDuplicating:p,onAddVisual:o,onOpenVisual:r,onEditDetails:u,onDeleteClick:j,onDuplicateVisual:i,onShareVisual:D,formatDate:v}){var M,R,P,w;const{selectVisual:h}=s.useManagementActions(),m=s.useIsVisualSelected(t.id),d=pe(t.id),{isConsoleMode:L}=s.useDashboardPreferences(),E=c.useRef(null),[N,y]=c.useState(!1),[S,b]=c.useState(!1);c.useEffect(()=>{p?(y(!0),b(!0)):S&&(y(!1),b(!1))},[p,S]),c.useEffect(()=>{d&&E.current&&E.current.scrollIntoView({behavior:"smooth",block:"center"})},[d]);const H=()=>{h(t),r==null||r(t)};return e.jsx("div",{ref:E,className:s.cn("group flex cursor-pointer items-start rounded-md px-2 py-2 transition-colors hover:bg-muted",d?"bg-purple-500/10":m&&"bg-muted/80"),onClick:H,children:e.jsx("div",{className:"min-w-0 flex-1",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium text-foreground",title:t.title||"Untitled Visual",children:t.title||"Untitled Visual"}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",title:t.description||"No description",children:(M=t.description)!=null&&M.trim()?t.description:"No description"})]}),e.jsxs("div",{className:"flex flex-shrink-0 items-center gap-1",onClick:g=>g.stopPropagation(),children:[e.jsx("div",{className:"opacity-0 transition-opacity group-hover:opacity-100",children:e.jsxs(s.DropdownMenu,{modal:!1,open:N,onOpenChange:y,children:[e.jsx(s.DropdownMenuTrigger,{asChild:!0,children:e.jsx(s.Button,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",children:e.jsx(s.EllipsisVertical,{className:"h-3 w-3"})})}),e.jsxs(s.DropdownMenuContent,{align:"end",className:"z-[51] w-40",children:[e.jsxs(s.DropdownMenuItem,{onClick:g=>{g.stopPropagation(),o(t)},children:[e.jsx(s.Plus,{className:"mr-2 h-3 w-3"}),"Add"]}),e.jsxs(s.DropdownMenuItem,{onClick:g=>{g.stopPropagation(),r==null||r(t)},children:[e.jsx(me,{className:"mr-2 h-3 w-3"}),"Open"]}),e.jsxs(s.DropdownMenuItem,{onClick:g=>{g.preventDefault(),g.stopPropagation(),i(t.id)},disabled:p,children:[p?e.jsx(s.LoaderCircle,{className:"mr-2 h-3 w-3 animate-spin"}):e.jsx(s.Copy,{className:"mr-2 h-3 w-3"}),p?"Duplicating...":"Duplicate"]}),t.ownership.isOwner&&e.jsxs(e.Fragment,{children:[e.jsxs(s.DropdownMenuItem,{onClick:g=>{g.stopPropagation(),u==null||u(t)},children:[e.jsx(s.PenLine,{className:"mr-2 h-3 w-3"}),"Edit details"]}),e.jsxs(s.DropdownMenuItem,{onClick:g=>{g.stopPropagation(),D(t)},children:[e.jsx(s.Users,{className:"mr-2 h-3 w-3"}),"Share"]}),e.jsx(s.DropdownMenuSeparator,{}),e.jsxs(s.DropdownMenuItem,{onClick:g=>{g.stopPropagation(),j(t)},className:"text-destructive",disabled:f,children:[e.jsx(s.Trash2,{className:"mr-2 h-3 w-3"}),f?"Deleting...":"Delete"]})]}),e.jsx(s.DropdownMenuSeparator,{}),e.jsxs("div",{className:"space-y-1 px-2 py-2 text-xs text-slate-500 dark:text-slate-400",children:[(((R=t.ownership.createdBy)==null?void 0:R.type)==="tenant"||((P=t.ownership.createdBy)==null?void 0:P.type)==="organization"&&L)&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(s.User,{className:"h-3 w-3"}),e.jsx("span",{children:((w=t.ownership.createdBy)==null?void 0:w.name)||"Unknown"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(s.Calendar,{className:"h-3 w-3"}),e.jsx("span",{children:v(t.lastModified)})]})]})]})]})}),e.jsxs(s.Button,{size:"sm",variant:"outline",className:"h-7 gap-1 px-2 text-xs",onClick:g=>{g.stopPropagation(),o(t)},children:[e.jsx(s.Plus,{className:"h-3.5 w-3.5"}),"Add"]})]})]})})},t.id)}function ge({searchQuery:t}){const[f,p]=c.useState(!1),[o,r]=c.useState(null),[u,j]=c.useState(!1),[i,D]=c.useState(null),[v,h]=c.useState(null),[m,d]=c.useState(null),{selectVisual:L}=s.useManagementActions(),{handleEditLibraryVisual:E,handleAddLibraryVisual:N}=le.useVisualUtils(),{resources:y,isLoading:S,isError:b,isFetching:H,updateResource:M,deleteResource:R,duplicateResource:P,isDeleting:w,isDuplicating:g,isUpdating:Z}=s.useVisualManagement(()=>{j(!1),D(null)});s.useCurrentUserInfo();const G=y.filter(a=>{var V,l;return((V=a==null?void 0:a.title)==null?void 0:V.toLowerCase().includes(t.toLowerCase()))||((l=a==null?void 0:a.description)==null?void 0:l.toLowerCase().includes(t.toLowerCase()))}),q=a=>new Date(a).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),I=a=>{D(a),j(!0)},U=()=>{i&&R(i.id)},{startUpdating:te,stopUpdating:A,isUpdating:k}=s.useResourceUpdateState(),W=(a,V,l)=>{var se;const Q=Object.fromEntries(Object.entries(V).filter(([,O])=>O!==void 0));if(Object.keys(Q).length===0){(se=l==null?void 0:l.onSuccess)==null||se.call(l);return}const ee=Object.keys(Q),X=ee.length===1?ee[0]:void 0;te(a,X),M({resourceId:a,data:Q},{onSuccess:()=>{var O;A(a,X),(O=l==null?void 0:l.onSuccess)==null||O.call(l)},onError:()=>{var O;A(a,X),(O=l==null?void 0:l.onError)==null||O.call(l)}})},B=a=>{h(a),P(a,{onSettled:()=>h(null)})},F=a=>{E(a)},Y=a=>{N(a)},_=a=>{const V=y.find(l=>l.id===a);V&&M({resourceId:a,data:{isPrivate:!V.isPrivate}})},J=a=>{r(a),p(!0)},$=a=>{d(a)},K=()=>{d(null)},C=({title:a,description:V})=>{if(!m)return;const l={};a!==m.title&&(l.title=a),(m.description||"")!==V&&(l.description=V),W(m.id,l,{onSuccess:()=>{d(null)}})};return S?e.jsx(de,{}):b?e.jsx(s.ScrollArea,{className:"w-full flex-1 pr-2",children:e.jsxs("div",{className:"py-8 text-center text-muted-foreground",children:[e.jsx("p",{className:"text-sm text-destructive",children:"Failed to load visuals"}),e.jsx(s.Button,{variant:"outline",size:"sm",className:"mt-2",onClick:()=>window.location.reload(),children:"Retry"})]})}):e.jsxs("div",{className:"flex h-full flex-1 flex-col",children:[e.jsx("div",{className:"flex flex-1 basis-0 flex-col gap-3 overflow-y-auto",children:G.length===0?e.jsxs("div",{className:"py-8 text-center",children:[e.jsx("div",{className:"mb-3",children:e.jsx(s.Grid3x3,{className:"mx-auto h-12 w-12 text-muted-foreground/50"})}),e.jsx("h3",{className:"mb-1 font-medium text-foreground",children:t?"No visuals found":"No visuals yet"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t?"Try adjusting your search":'Click "New" above to add your first visual'})]}):G.map(a=>e.jsx(fe,{visual:a,onAddVisual:Y,onOpenVisual:F,onEditDetails:$,onDeleteClick:I,onDuplicateVisual:B,onTogglePrivacy:_,onShareVisual:J,isDeleting:w,isDuplicating:v===a.id,formatDate:q},a.id))}),f&&o&&e.jsx(s.ShareDialog,{resource:o,resourceType:s.ResourceType.VISUAL,onClose:()=>{p(!1),r(null)}}),m&&e.jsx(s.ResourceEditDialog,{open:!!m,resourceLabel:"Visual",initialTitle:m.title||"",initialDescription:m.description||"",onClose:K,onSave:C,isSaving:k(m.id)}),e.jsx(s.AlertDialog,{open:u,onOpenChange:a=>{!a&&w||(j(a),a||D(null))},children:e.jsxs(s.AlertDialogContent,{children:[e.jsxs(s.AlertDialogHeader,{children:[e.jsx(s.AlertDialogTitle,{children:"Delete Visual"}),e.jsxs(s.AlertDialogDescription,{children:['Are you sure you want to delete "',i==null?void 0:i.title,'"? This action cannot be undone.']})]}),e.jsxs(s.AlertDialogFooter,{children:[e.jsx(s.AlertDialogCancel,{disabled:w,children:"Cancel"}),e.jsxs(s.AlertDialogAction,{onClick:a=>{a.preventDefault(),a.stopPropagation(),U()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",disabled:w,children:[w?e.jsx(s.LoaderCircle,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):e.jsx(s.Trash2,{className:"mr-2 h-3.5 w-3.5"}),w?"Deleting...":"Delete"]})]})]})})]})}function je({dashboard:t,isDeleting:f,isDuplicating:p,onLoadDashboard:o,onEditDetails:r,onDeleteClick:u,onDuplicateDashboard:j,onShareDashboard:i,formatDate:D,onDashboardItemClick:v}){var S,b;const{selectDashboard:h}=s.useManagementActions(),m=s.useIsDashboardSelected(t.id),{userContext:d,isLoading:L}=s.useCurrentUserInfo(),E=((S=d==null?void 0:d.permissions)==null?void 0:S.canEdit)??!1,N=L||!E,y=()=>{h(t),o(t.id),v==null||v(t.id)};return e.jsx("div",{className:s.cn("group flex cursor-pointer items-start rounded-md px-2 py-2 transition-colors hover:bg-muted",m&&"bg-muted/80"),onClick:y,children:e.jsx("div",{className:"min-w-0 flex-1",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium text-foreground",title:t.title||"Untitled Dashboard",children:t.title||"Untitled Dashboard"}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",title:t.description||"No description",children:(b=t.description)!=null&&b.trim()?t.description:"No description"})]}),e.jsx("div",{className:"flex-shrink-0 opacity-0 transition-opacity group-hover:opacity-100",children:e.jsx(s.DashboardActionsMenu,{dashboard:t,isDeleting:f,isDuplicating:p,shouldHideActions:N,onEditDetails:r,onDeleteClick:u,onDuplicateDashboard:j,onShareDashboard:i,formatDate:D})})]})})},t.id)}function De({onRetry:t}){return e.jsx(s.ScrollArea,{className:"w-full flex-1 pr-2",children:e.jsxs("div",{className:"py-8 text-center text-muted-foreground",children:[e.jsx("p",{className:"text-sm text-destructive",children:"Failed to load dashboards"}),e.jsx(s.Button,{variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})})}function Ne(t){var ie;const{searchQuery:f,onLoadDashboard:p,onEditDashboard:o,onDashboardItemClick:r}=t,[u,j]=c.useState(!1),[i,D]=c.useState(null),[v,h]=c.useState(!1),[m,d]=c.useState(null),[L,E]=c.useState(null),[N,y]=c.useState(null),S=s.useManagementStore(n=>n.lastSelectedDashboard),b=s.useManagementStore(n=>n.selectedDashboard),H=s.useManagementStore(n=>n.actions.selectDashboard),M=s.useManagementStore(n=>n.actions.clearSelectedDashboard),{tokenProps:R,id:P}=s.useSemaphorContext();he.useRoleAwareDisplayPreferences();const{resources:w,isLoading:g,isError:Z,isFetching:G,updateResource:q,deleteResource:I,duplicateResource:U,isUpdating:te,isDeleting:A,isDuplicating:k,refetch:W}=s.useDashboardManagement(()=>{h(!1);const n=m==null?void 0:m.id;d(null),(b==null?void 0:b.id)===n&&(!(R!=null&&R.dashboard_id)&&!P?M():S&&S.id!==n&&H(S))}),{currentUser:B,userContext:F}=s.useCurrentUserInfo(),Y=((ie=F==null?void 0:F.permissions)==null?void 0:ie.canCreateDashboard)??!1,_=w.filter(n=>{var T,x;return((T=n==null?void 0:n.title)==null?void 0:T.toLowerCase().includes(f.toLowerCase()))||((x=n==null?void 0:n.description)==null?void 0:x.toLowerCase().includes(f.toLowerCase()))}),J=n=>new Date(n).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),$=n=>{p==null||p(n)},K=n=>{d(n),h(!0)},C=()=>{m&&I(m.id)},a=n=>{E(n),U(n,{onSettled:()=>E(null)})},{startUpdating:V,stopUpdating:l,isUpdating:Q}=s.useResourceUpdateState(),ee=(n,T,x)=>{var oe;const ne=Object.fromEntries(Object.entries(T).filter(([,z])=>z!==void 0));if(Object.keys(ne).length===0){(oe=x==null?void 0:x.onSuccess)==null||oe.call(x);return}const re=Object.keys(ne),ae=re.length===1?re[0]:void 0;V(n,ae),q({resourceId:n,data:ne},{onSuccess:()=>{var z;l(n,ae),(z=x==null?void 0:x.onSuccess)==null||z.call(x)},onError:()=>{var z;l(n,ae),(z=x==null?void 0:x.onError)==null||z.call(x)}})},X=n=>{const T=w.find(x=>x.id===n);T&&q({resourceId:n,data:{isPrivate:!T.isPrivate}})},se=n=>{D(n),B==null||B.type,j(!0)},O=n=>{o==null||o(n.id),y(n)},ce=()=>{y(null)},ue=({title:n,description:T})=>{if(!N)return;const x={};n!==N.title&&(x.title=n),(N.description||"")!==T&&(x.description=T),ee(N.id,x,{onSuccess:()=>{y(null)}})};return g?e.jsx(de,{}):Z?e.jsx(De,{onRetry:()=>window.location.reload()}):e.jsxs("div",{className:"flex h-full flex-1 flex-col",children:[e.jsx("div",{className:"flex flex-1 basis-0 flex-col gap-3 overflow-y-auto",children:_.length===0?e.jsxs("div",{className:"py-8 text-center",children:[e.jsx("div",{className:"mb-3",children:e.jsx(s.ChartColumn,{className:"mx-auto h-12 w-12 text-muted-foreground/50"})}),e.jsx("h3",{className:"mb-1 font-medium text-foreground",children:f?"No dashboards found":"No dashboards yet"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:f?"Try adjusting your search":Y?'Click "New" above to add your first dashboard':"No dashboards have been shared with you yet"})]}):_.map(n=>e.jsx(je,{dashboard:n,isDeleting:A,isDuplicating:L===n.id,onLoadDashboard:$,onEditDetails:O,onDeleteClick:K,onDuplicateDashboard:a,onTogglePrivacy:X,onShareDashboard:se,formatDate:J,onDashboardItemClick:r},n.id))}),u&&i&&e.jsx(s.ShareDialog,{resource:i,resourceType:s.ResourceType.DASHBOARD,onClose:()=>{j(!1),D(null)}}),e.jsx(s.AlertDialog,{open:v,onOpenChange:n=>{!n&&A||(h(n),n||d(null))},children:e.jsxs(s.AlertDialogContent,{children:[e.jsxs(s.AlertDialogHeader,{children:[e.jsx(s.AlertDialogTitle,{children:"Delete Dashboard"}),e.jsxs(s.AlertDialogDescription,{children:['Are you sure you want to delete "',m==null?void 0:m.title,'"? This action cannot be undone.']})]}),e.jsxs(s.AlertDialogFooter,{children:[e.jsx(s.AlertDialogCancel,{disabled:A,children:"Cancel"}),e.jsxs(s.AlertDialogAction,{onClick:n=>{n.preventDefault(),n.stopPropagation(),C()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",disabled:A,children:[A?e.jsx(s.LoaderCircle,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):e.jsx(s.Trash2,{className:"mr-2 h-3.5 w-3.5"}),A?"Deleting...":"Delete"]})]})]})}),N&&e.jsx(s.ResourceEditDialog,{open:!!N,resourceLabel:"Dashboard",initialTitle:N.title||"",initialDescription:N.description||"",onClose:ce,onSave:ue,isSaving:Q(N.id)})]})}function we({open:t,onOpenChange:f,onSubmit:p,isCreating:o}){const[r,u]=c.useState(""),[j,i]=c.useState("");c.useEffect(()=>{t||(u(""),i(""))},[t]);const D=()=>{r.trim()&&p({title:r,description:j})},v=h=>{f(h)};return e.jsx(s.Dialog,{open:t,onOpenChange:v,children:e.jsxs(s.DialogContent,{children:[e.jsxs(s.DialogHeader,{children:[e.jsx(s.DialogTitle,{children:"Create New Visual"}),e.jsx(s.DialogDescription,{children:"Add a new visual to your library. You can configure it after creation."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(s.Label,{htmlFor:"title",children:"Visual Title"}),e.jsx(s.Input$1,{id:"title",placeholder:"Enter visual title...",value:r,onChange:h=>u(h.target.value),disabled:o,onKeyDown:h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),D())}})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(s.Label,{htmlFor:"description",children:"Description (optional)"}),e.jsx(s.Input$1,{id:"description",placeholder:"Enter visual description...",value:j,onChange:h=>i(h.target.value),disabled:o})]})]}),e.jsxs(s.DialogFooter,{children:[e.jsx(s.Button,{variant:"outline",onClick:()=>v(!1),disabled:o,children:"Cancel"}),e.jsx(s.Button,{onClick:D,disabled:!r.trim()||o,children:o?e.jsxs(e.Fragment,{children:[e.jsx(s.LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating..."]}):"Create Visual"})]})]})})}function Ce({isOpen:t,onClose:f,className:p,onDashboardItemClick:o,variant:r="inline"}){var $,K;const u=s.useDashboardStore(C=>C.isDashboardEditing),[j,i]=c.useState(!1),[D,v]=c.useState(""),[h,m]=c.useState(!1),{currentUser:d,userContext:L}=s.useCurrentUserInfo(),E=(($=L==null?void 0:L.permissions)==null?void 0:$.canCreateDashboard)??!1,{onCreateSuccess:N}=s.useDashboardCreation({onDashboardSelect:o}),{selectVisual:y}=s.useManagementActions(),{handleEditLibraryVisual:S}=le.useVisualUtils(),{createResource:b,isCreating:H,refetch:M}=s.useDashboardManagement(),{createResource:R,isCreating:P}=s.useVisualManagement(void 0,C=>{i(!1),C&&(y(C),S(C))}),w=r==="overlay",g=u?"New Visual":"New",Z=u?"New Visual":"New Dashboard",G=u?"Search visuals...":"Search dashboards...",q=u?"Collapse visuals panel":"Collapse dashboard panel",I=((d==null?void 0:d.name)??"").trim(),U=((d==null?void 0:d.email)??"").trim(),A=I&&I.toLowerCase()!=="undefined"?I:U||"Current user",k=((K=A.charAt(0))==null?void 0:K.toUpperCase())||"?",W=U&&U.toLowerCase()!=="undefined"?U:"",B=xe(f,{enabled:t&&w}),F=s.cn("flex h-full flex-col border-r bg-background",w?s.cn("absolute inset-y-0 left-0 z-[51] w-60 shadow-lg transition-transform duration-300 ease-in-out",t?"translate-x-0":"pointer-events-none -translate-x-full"):"w-full max-w-[17rem] min-w-[11rem] overflow-hidden shadow-sm",p),Y=C=>{},_=C=>{console.log("Editing dashboard:",C)},J=C=>{b(C,{onSuccess:a=>{i(!1),N(a,M)}})};return e.jsx(e.Fragment,{children:(!w||t)&&e.jsxs("div",{ref:B,className:F,children:[e.jsxs("div",{className:"border-b border-border",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-1.5",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("h2",{className:"whitespace-nowrap text-sm font-semibold",children:u?"Visuals":"Dashboards"})}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(s.Button,{size:"sm",variant:"ghost",onClick:()=>m(!h),className:"h-8 w-8 p-0","aria-label":h?"Hide search":"Show search",children:e.jsx(s.Search,{className:"h-3.5 w-3.5"})}),(u||E)&&e.jsxs(s.Button,{size:"sm",variant:"ghost",className:"h-8 gap-1.5 whitespace-nowrap px-2 text-xs",onClick:()=>i(!0),"aria-label":Z,children:[e.jsx(s.Plus,{className:"h-3.5 w-3.5"}),g]}),e.jsx(s.Button,{size:"sm",variant:"secondary",className:"h-7 w-7 p-0.5",onClick:f,"aria-label":q,children:e.jsx(s.ChevronLeft,{className:"h-3.5 w-3.5"})})]})]}),h&&e.jsx("div",{className:"bg-muted/30 px-4 pb-3",children:e.jsx(s.Input$1,{placeholder:G,value:D,onChange:C=>v(C.target.value),className:"h-8 border-muted-foreground/20 bg-background text-sm focus-visible:border-muted-foreground/40 focus-visible:ring-0 focus-visible:ring-offset-0",autoFocus:!0})})]}),e.jsx("div",{className:"flex flex-1 flex-col overflow-auto px-2 py-2",children:u?e.jsx(ge,{searchQuery:D}):e.jsx(Ne,{searchQuery:D,onLoadDashboard:Y,onEditDashboard:_,onDashboardItemClick:o})}),d&&e.jsx(s.TooltipProvider,{children:e.jsx("div",{className:"border-t border-border px-4 py-2",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(s.Tooltip,{children:[e.jsx(s.TooltipTrigger,{asChild:!0,children:e.jsx("div",{className:"flex h-6 w-6 cursor-default items-center justify-center rounded-full bg-primary/10",children:e.jsx("span",{className:"text-xs font-medium text-primary",children:k})})}),e.jsx(s.TooltipContent,{side:"top",className:"max-w-xs",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"font-medium",children:A}),W&&e.jsx("div",{className:"text-xs text-muted-foreground",children:W}),d.role&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Role: ",s.toTitleCase(d.role.replace(/_/g," "))]})]})})]}),e.jsx("span",{className:"truncate text-xs text-muted-foreground",children:A})]})})}),u?e.jsx(we,{open:j,onOpenChange:i,onSubmit:R,isCreating:P}):e.jsx(s.CreateDashboardDialog,{open:j,onOpenChange:i,onSubmit:J,isCreating:H})]})})}exports.ResourceManagementPanel=Ce;
|