chordia-ui 3.3.8 → 3.3.9

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.
Files changed (159) hide show
  1. package/dist/AgentLiftCard.cjs.js.map +1 -1
  2. package/dist/AgentLiftCard.es.js +5 -3
  3. package/dist/AgentLiftCard.es.js.map +1 -1
  4. package/dist/CustomFilterChips.cjs.js.map +1 -1
  5. package/dist/CustomFilterChips.es.js +2 -1
  6. package/dist/CustomFilterChips.es.js.map +1 -1
  7. package/dist/FileUploadingState.cjs.js.map +1 -1
  8. package/dist/FileUploadingState.es.js +16 -10
  9. package/dist/FileUploadingState.es.js.map +1 -1
  10. package/dist/IntegrationCard.cjs.js.map +1 -1
  11. package/dist/IntegrationCard.es.js +3 -3
  12. package/dist/IntegrationCard.es.js.map +1 -1
  13. package/dist/SectionLabel.cjs.js.map +1 -1
  14. package/dist/SectionLabel.es.js.map +1 -1
  15. package/dist/SmallButton.cjs.js.map +1 -1
  16. package/dist/SmallButton.es.js +16 -16
  17. package/dist/SmallButton.es.js.map +1 -1
  18. package/dist/SummarySection.cjs.js.map +1 -1
  19. package/dist/SummarySection.es.js +11 -9
  20. package/dist/SummarySection.es.js.map +1 -1
  21. package/dist/TextInput.cjs.js.map +1 -1
  22. package/dist/TextInput.es.js.map +1 -1
  23. package/dist/Timeline.cjs.js.map +1 -1
  24. package/dist/Timeline.es.js +14 -8
  25. package/dist/Timeline.es.js.map +1 -1
  26. package/dist/Tooltip.cjs.js +1 -1
  27. package/dist/Tooltip.cjs.js.map +1 -1
  28. package/dist/Tooltip.es.js +31 -20
  29. package/dist/Tooltip.es.js.map +1 -1
  30. package/dist/TourGuideTooltip.cjs.js.map +1 -1
  31. package/dist/TourGuideTooltip.es.js +2 -1
  32. package/dist/TourGuideTooltip.es.js.map +1 -1
  33. package/dist/UpdatedInteractionRecording.cjs.js +1 -1
  34. package/dist/UpdatedInteractionRecording.cjs.js.map +1 -1
  35. package/dist/UpdatedInteractionRecording.es.js +79 -97
  36. package/dist/UpdatedInteractionRecording.es.js.map +1 -1
  37. package/dist/UploadInteraction.cjs.js.map +1 -1
  38. package/dist/UploadInteraction.es.js.map +1 -1
  39. package/dist/colors.cjs.js +2 -0
  40. package/dist/colors.cjs.js.map +1 -0
  41. package/dist/colors.es.js +2 -0
  42. package/dist/colors.es.js.map +1 -0
  43. package/dist/components/UpdatedInteractionDetails.cjs.js +10 -1
  44. package/dist/components/UpdatedInteractionDetails.cjs.js.map +1 -1
  45. package/dist/components/UpdatedInteractionDetails.es.js +1531 -9
  46. package/dist/components/UpdatedInteractionDetails.es.js.map +1 -1
  47. package/dist/components/chat.cjs.js +30 -1
  48. package/dist/components/chat.cjs.js.map +1 -1
  49. package/dist/components/chat.es.js +2222 -7
  50. package/dist/components/chat.es.js.map +1 -1
  51. package/dist/components/common.cjs.js +1 -1
  52. package/dist/components/common.es.js +32 -25
  53. package/dist/components/common.es.js.map +1 -1
  54. package/dist/components/data.cjs.js +1 -1
  55. package/dist/components/data.cjs.js.map +1 -1
  56. package/dist/components/data.es.js +1033 -4
  57. package/dist/components/data.es.js.map +1 -1
  58. package/dist/components/layout.cjs.js +3 -1
  59. package/dist/components/layout.cjs.js.map +1 -1
  60. package/dist/components/layout.es.js +1533 -8
  61. package/dist/components/layout.es.js.map +1 -1
  62. package/dist/components/login.cjs.js +1 -1
  63. package/dist/components/login.es.js +6 -2
  64. package/dist/components/login.es.js.map +1 -1
  65. package/dist/components/media.cjs.js +1 -1
  66. package/dist/components/media.cjs.js.map +1 -1
  67. package/dist/components/media.es.js +220 -6
  68. package/dist/components/media.es.js.map +1 -1
  69. package/dist/components/models.cjs.js +1 -1
  70. package/dist/components/models.cjs.js.map +1 -1
  71. package/dist/components/models.es.js +91 -2
  72. package/dist/components/models.es.js.map +1 -1
  73. package/dist/components/navigation.cjs.js +1 -1
  74. package/dist/components/navigation.cjs.js.map +1 -1
  75. package/dist/components/navigation.es.js +766 -7
  76. package/dist/components/navigation.es.js.map +1 -1
  77. package/dist/components/notifications.cjs.js +1 -1
  78. package/dist/components/notifications.cjs.js.map +1 -1
  79. package/dist/components/notifications.es.js +368 -3
  80. package/dist/components/notifications.es.js.map +1 -1
  81. package/dist/components/onboarding.cjs.js +1 -1
  82. package/dist/components/onboarding.cjs.js.map +1 -1
  83. package/dist/components/onboarding.es.js +985 -7
  84. package/dist/components/onboarding.es.js.map +1 -1
  85. package/dist/components/primitives.cjs.js +1 -1
  86. package/dist/components/primitives.cjs.js.map +1 -1
  87. package/dist/components/primitives.es.js +635 -25
  88. package/dist/components/primitives.es.js.map +1 -1
  89. package/dist/debugger-wc.cjs.js +4 -4
  90. package/dist/debugger-wc.cjs.js.map +1 -1
  91. package/dist/debugger-wc.es.js +15 -11
  92. package/dist/debugger-wc.es.js.map +1 -1
  93. package/dist/index.cjs.js +1 -1
  94. package/dist/index.cjs2.js +2 -49
  95. package/dist/index.cjs2.js.map +1 -1
  96. package/dist/index.cjs3.js +50 -0
  97. package/dist/index.cjs3.js.map +1 -0
  98. package/dist/index.es.js +104 -99
  99. package/dist/index.es.js.map +1 -1
  100. package/dist/index.es2.js +2632 -1776
  101. package/dist/index.es2.js.map +1 -1
  102. package/dist/index.es3.js +1944 -0
  103. package/dist/index.es3.js.map +1 -0
  104. package/dist/pages/interactionDetails.cjs.js +1 -1
  105. package/dist/pages/interactionDetails.cjs.js.map +1 -1
  106. package/dist/pages/interactionDetails.es.js +70 -47
  107. package/dist/pages/interactionDetails.es.js.map +1 -1
  108. package/dist/sortable.esm.cjs.js +1 -1
  109. package/dist/sortable.esm.cjs.js.map +1 -1
  110. package/dist/sortable.esm.es.js +55 -53
  111. package/dist/sortable.esm.es.js.map +1 -1
  112. package/dist/{chordia-ui.css → style.css} +1 -1
  113. package/package.json +1 -1
  114. package/src/components/UpdatedInteractionDetails/UpdatedInteractionDetails.jsx +318 -77
  115. package/src/components/UpdatedInteractionDetails/UpdatedInteractionRecording.jsx +7 -17
  116. package/dist/ChartRenderer.cjs.js +0 -31
  117. package/dist/ChartRenderer.cjs.js.map +0 -1
  118. package/dist/ChartRenderer.es.js +0 -2210
  119. package/dist/ChartRenderer.es.js.map +0 -1
  120. package/dist/GettingStarted.cjs.js +0 -2
  121. package/dist/GettingStarted.cjs.js.map +0 -1
  122. package/dist/GettingStarted.es.js +0 -983
  123. package/dist/GettingStarted.es.js.map +0 -1
  124. package/dist/InlineConfirm.cjs.js +0 -2
  125. package/dist/InlineConfirm.cjs.js.map +0 -1
  126. package/dist/InlineConfirm.es.js +0 -618
  127. package/dist/InlineConfirm.es.js.map +0 -1
  128. package/dist/InteractionSummaryCard.cjs.js +0 -2
  129. package/dist/InteractionSummaryCard.cjs.js.map +0 -1
  130. package/dist/InteractionSummaryCard.es.js +0 -216
  131. package/dist/InteractionSummaryCard.es.js.map +0 -1
  132. package/dist/LoginPage.cjs.js +0 -3
  133. package/dist/LoginPage.cjs.js.map +0 -1
  134. package/dist/LoginPage.es.js +0 -2618
  135. package/dist/LoginPage.es.js.map +0 -1
  136. package/dist/NavigationBar.cjs.js +0 -2
  137. package/dist/NavigationBar.cjs.js.map +0 -1
  138. package/dist/NavigationBar.es.js +0 -762
  139. package/dist/NavigationBar.es.js.map +0 -1
  140. package/dist/NotificationPanel.cjs.js +0 -2
  141. package/dist/NotificationPanel.cjs.js.map +0 -1
  142. package/dist/NotificationPanel.es.js +0 -371
  143. package/dist/NotificationPanel.es.js.map +0 -1
  144. package/dist/OverlayPanel.cjs.js +0 -2
  145. package/dist/OverlayPanel.cjs.js.map +0 -1
  146. package/dist/OverlayPanel.es.js +0 -93
  147. package/dist/OverlayPanel.es.js.map +0 -1
  148. package/dist/SplitPane.cjs.js +0 -4
  149. package/dist/SplitPane.cjs.js.map +0 -1
  150. package/dist/SplitPane.es.js +0 -1531
  151. package/dist/SplitPane.es.js.map +0 -1
  152. package/dist/SummaryStatsPanel.cjs.js +0 -2
  153. package/dist/SummaryStatsPanel.cjs.js.map +0 -1
  154. package/dist/SummaryStatsPanel.es.js +0 -1027
  155. package/dist/SummaryStatsPanel.es.js.map +0 -1
  156. package/dist/UpdatedInteractionDetails.cjs.js +0 -11
  157. package/dist/UpdatedInteractionDetails.cjs.js.map +0 -1
  158. package/dist/UpdatedInteractionDetails.es.js +0 -1310
  159. package/dist/UpdatedInteractionDetails.es.js.map +0 -1
@@ -1,1027 +0,0 @@
1
- import { jsxs as l, jsx as o, Fragment as je } from "react/jsx-runtime";
2
- import xe, { useState as m, useRef as T, useEffect as P, Suspense as ft, useMemo as I, useCallback as de } from "react";
3
- import { u as gt, a as _e, D as mt, c as ht, S as xt, h as yt, b as bt, d as ye, e as vt, C as wt, s as St, K as kt, P as Ct } from "./sortable.esm.es.js";
4
- import { CalendarClock as Ae, Download as Dt, ChevronDown as ve, ChevronUp as Ie, Filter as Pe, GripVertical as Re } from "lucide-react";
5
- import { createPortal as Nt } from "react-dom";
6
- import { C as Ft, P as zt } from "./CustomFilterChips.es.js";
7
- import "./TourGuideTooltip.es.js";
8
- function Ot({
9
- dateRangePicker: g,
10
- onWeekToDate: d,
11
- exportConfig: y,
12
- filterChipsConfig: p,
13
- trailingActions: C
14
- // Optional extra actions rendered after Export (e.g., Add Users button)
15
- }) {
16
- const [R, j] = m(!1), v = T(null), E = T(null);
17
- P(() => {
18
- const c = (z) => {
19
- E.current && !E.current.contains(z.target) && v.current && !v.current.contains(z.target) && j(!1);
20
- };
21
- if (R)
22
- return document.addEventListener("mousedown", c), () => {
23
- document.removeEventListener("mousedown", c);
24
- };
25
- }, [R]);
26
- const J = () => {
27
- j((c) => !c);
28
- }, q = (c) => {
29
- j(!1), y != null && y.onExport && y.onExport(c);
30
- }, S = (() => {
31
- if (!(p != null && p.filters)) return !1;
32
- const c = p.filters, z = p.customFilters || [], O = Object.entries(c).some(([h, w]) => !!(Array.isArray(w) && w.length || typeof w == "string" && w.trim() !== "" || w && typeof w == "object" && (w.min != null || w.max != null))), G = z.some((h) => h.active);
33
- return O || G;
34
- })();
35
- return /* @__PURE__ */ l("div", { className: "flex items-center gap-3 flex-wrap", children: [
36
- d && /* @__PURE__ */ l(
37
- "button",
38
- {
39
- onClick: d,
40
- className: "inline-flex items-center gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 transition-colors hover:bg-white text-sm font-medium text-gray-900",
41
- style: { fontFamily: "var(--font-sans)" },
42
- children: [
43
- /* @__PURE__ */ o(Ae, { size: 16 }),
44
- /* @__PURE__ */ o("span", { children: "Week to Date" })
45
- ]
46
- }
47
- ),
48
- g && /* @__PURE__ */ o(
49
- ft,
50
- {
51
- fallback: /* @__PURE__ */ l("div", { className: "inline-flex items-center gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 text-sm font-medium text-gray-400", children: [
52
- /* @__PURE__ */ o(Ae, { size: 16 }),
53
- /* @__PURE__ */ o("span", { children: "Loading..." })
54
- ] }),
55
- children: g
56
- }
57
- ),
58
- y && /* @__PURE__ */ l("div", { className: "relative", children: [
59
- /* @__PURE__ */ l(
60
- "button",
61
- {
62
- ref: v,
63
- onClick: J,
64
- disabled: y.isExporting,
65
- className: "inline-flex items-center justify-between gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 transition-colors hover:bg-white text-sm font-medium text-gray-900 disabled:opacity-50 disabled:cursor-not-allowed min-w-[120px]",
66
- style: { fontFamily: "var(--font-sans)" },
67
- children: [
68
- /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
69
- /* @__PURE__ */ o(Dt, { size: 16 }),
70
- /* @__PURE__ */ o("span", { children: y.isExporting ? "Exporting..." : "Export" })
71
- ] }),
72
- /* @__PURE__ */ o(ve, { size: 16 })
73
- ]
74
- }
75
- ),
76
- R && /* @__PURE__ */ o(
77
- "div",
78
- {
79
- ref: E,
80
- className: "absolute top-full right-0 mt-2 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50 min-w-[120px]",
81
- children: (y.types || ["csv"]).map((c) => /* @__PURE__ */ l(
82
- "button",
83
- {
84
- onClick: () => q(c),
85
- className: "w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",
86
- style: { fontFamily: "var(--font-sans)" },
87
- children: [
88
- "Export ",
89
- c.toUpperCase()
90
- ]
91
- },
92
- c
93
- ))
94
- }
95
- )
96
- ] }),
97
- (S || C) && /* @__PURE__ */ l(je, { children: [
98
- S && /* @__PURE__ */ o("div", { className: "h-9 mt-1 w-px bg-gray-300 flex-shrink-0" }),
99
- /* @__PURE__ */ l("div", { className: "flex items-center gap-3 justify-end", children: [
100
- S && p && /* @__PURE__ */ o(
101
- Ft,
102
- {
103
- filters: p.filters,
104
- onChange: p.onChange,
105
- onClear: p.onClear,
106
- customFilters: p.customFilters || [],
107
- fieldOptions: p.fieldOptions || {}
108
- }
109
- ),
110
- C && /* @__PURE__ */ o("div", { className: "flex-shrink-0", children: C })
111
- ] })
112
- ] })
113
- ] });
114
- }
115
- function be() {
116
- return /* @__PURE__ */ o("div", { style: { height: 1, background: "rgba(52,58,64,0.08)" } });
117
- }
118
- const Lt = () => ({ userData: { email: "anonymous" } }), Tt = (g) => /* @__PURE__ */ o("img", { ...g });
119
- function Et({ children: g }) {
120
- return g;
121
- }
122
- function Bt({
123
- data: g = [],
124
- columns: d = [],
125
- initialPageSize: y = 10,
126
- onRowClick: p,
127
- // Server-side pagination props (optional)
128
- totalCount: C = null,
129
- // Total count from server (null = use client-side pagination)
130
- page: R = null,
131
- // Controlled page (null = use internal state)
132
- pageSize: j = null,
133
- // Controlled pageSize (null = use internal state)
134
- onPageChange: v = null,
135
- // Callback for page changes (null = use internal state)
136
- onPageSizeChange: E = null,
137
- // Callback for pageSize changes (null = use internal state)
138
- onFilterChange: J = null,
139
- // Callback for filter changes (null = use client-side filtering)
140
- // Optional callback to surface column limit errors to host app
141
- onMaxColumnsError: q = null,
142
- // Server-side sorting props (optional)
143
- onSort: Q = null,
144
- // Callback for sort changes (null = use client-side sorting)
145
- sortFields: S = [],
146
- // Array of [field, direction] tuples from parent (null = use internal state)
147
- tableId: c = null,
148
- // Optional unique identifier for localStorage persistence (e.g., "history", "agents")
149
- isLoading: z = !1,
150
- // Loading state to show overlay inside table
151
- // Filter props (optional)
152
- filtersConfig: O = null
153
- // Configuration for filters (dateRangePicker, onWeekToDate, exportConfig, filterChipsConfig)
154
- }) {
155
- var Me;
156
- const { userData: G } = Lt(), h = G == null ? void 0 : G.email, w = xe.memo(({ children: e, content: t, className: r = "" }) => {
157
- const n = T(null), [s, a] = m(!1);
158
- P(() => {
159
- const u = () => {
160
- if (n.current) {
161
- const X = n.current.scrollWidth > n.current.clientWidth;
162
- a(X);
163
- }
164
- };
165
- u();
166
- const U = setTimeout(u, 0);
167
- return window.addEventListener("resize", u), () => {
168
- clearTimeout(U), window.removeEventListener("resize", u);
169
- };
170
- }, [e, t]);
171
- const i = /* @__PURE__ */ o("span", { className: `truncate block ${r}`, ref: n, children: e });
172
- return s && t ? /* @__PURE__ */ o(
173
- Et,
174
- {
175
- content: t,
176
- styling: "bg-green-2 text-gray-900 px-3 py-2 text-sm rounded-lg shadow-md border border-gray-300 max-w-xs whitespace-normal",
177
- indicatorColor: "bg-green-2",
178
- direction: "top",
179
- children: i
180
- }
181
- ) : i;
182
- });
183
- w.displayName = "TruncatedCell";
184
- const Z = C !== null && v !== null, ce = J !== null, B = Q !== null, [Be, ue] = m(1), [We, Ve] = m(y), pe = R !== null ? R : Be, ee = j !== null ? j : We, te = (e) => {
185
- v ? v(e) : ue(e);
186
- }, we = (e) => {
187
- E ? E(e) : Ve(e);
188
- }, D = 9, b = "action", $ = T(!1), W = I(() => c ? `dataTable_columns_${c}:${h}` : `dataTable_columns_${d.map((t) => t.id || t.key).sort().join("_")}:${h}`, [c, d, h]), V = I(() => c ? `dataTable_manual_change_${c}:${h}` : null, [c, h]);
189
- de((e, t) => {
190
- if (typeof window > "u" || !e || !t || t.length === 0) return null;
191
- try {
192
- const r = localStorage.getItem(e);
193
- if (r) {
194
- const s = JSON.parse(r).filter(
195
- (a) => t.some((i) => (i.id || i.key) === a)
196
- );
197
- if (s.length > 0)
198
- return s;
199
- }
200
- } catch (r) {
201
- console.warn("Failed to load saved columns from localStorage:", r);
202
- }
203
- return null;
204
- }, []);
205
- const [M, He] = m({}), [Se, Ke] = m(null), [ke, Ce] = m("asc");
206
- de((e, t) => e === "csat_score" && t === "evaluation.csat_score" ? t : e, []);
207
- const Y = B && S.length > 0 ? S[0][0] : Se, re = B && S.length > 0 ? S[0][1] : ke, [$t, De] = m(
208
- () => d.map((e) => e.id || e.key)
209
- ), L = de((e) => {
210
- if (!e || e.length === 0) return e;
211
- let t = Array.from(new Set(e));
212
- t.length > D && (t = t.slice(0, D));
213
- const n = d.map((i) => i.id || i.key).includes(b);
214
- return !t.includes(b) && n && (t.length >= D ? t = [...t.slice(0, D - 1), b] : t = [...t, b]), [...t.filter((i) => i !== b), b];
215
- }, [d]), [f, _] = m(() => {
216
- if (typeof window < "u" && c)
217
- try {
218
- if (localStorage.getItem(`dataTable_manual_change_${c}:${h}`) === "true") {
219
- const n = localStorage.getItem(`dataTable_columns_${c}:${h}`);
220
- if (n) {
221
- const s = JSON.parse(n);
222
- if (Array.isArray(s) && s.length > 0) {
223
- $.current = !0;
224
- const a = s.filter(
225
- (i) => d.some((u) => (u.id || u.key) === i)
226
- );
227
- if (a.length > 0)
228
- return a.slice(0, D);
229
- }
230
- }
231
- }
232
- } catch (r) {
233
- console.warn("Failed to load saved columns from localStorage:", r);
234
- }
235
- const t = d.map((r) => r.id || r.key).slice(0, D);
236
- return L(t);
237
- }), [k, Ne] = m(!1), [fe, Ue] = m({ top: 0, left: 0, width: 0 }), [Je, Fe] = m(/* @__PURE__ */ new Set()), [ze, Oe] = m(/* @__PURE__ */ new Set()), [N, ge] = m(null), [Ge, ne] = m(null), H = T(null), me = T(null), K = T(null), [Le, Te] = m(null), Ye = T(null), x = (e) => e.id || e.key, Xe = gt(
238
- _e(Ct),
239
- _e(kt, {
240
- coordinateGetter: St
241
- })
242
- ), qe = (e) => {
243
- const { active: t, over: r } = e;
244
- r && t.id !== r.id && ($.current = !0, _((n) => {
245
- const s = n.indexOf(t.id), a = n.indexOf(r.id);
246
- if (s !== -1 && a !== -1) {
247
- const i = ye(n, s, a);
248
- return ie(i), i;
249
- }
250
- return n;
251
- }), De((n) => {
252
- const s = n.indexOf(t.id), a = n.indexOf(r.id);
253
- return ye(n, s, a);
254
- })), Te(null);
255
- }, Qe = (e) => {
256
- Te(e.active.id);
257
- }, oe = I(() => ce ? g || [] : !g || g.length === 0 ? [] : g.filter((e) => Object.keys(M).every((t) => {
258
- const r = M[t];
259
- if (!r || r.trim() === "") return !0;
260
- const n = e[t];
261
- if (n == null) return !1;
262
- const s = String(n).toLowerCase();
263
- return r.toLowerCase().trim().split(/\s+/).filter((u) => u.length > 0).every((u) => s.includes(u));
264
- })), [g, M, ce]), se = I(() => B || !Y ? oe : [...oe].sort((e, t) => {
265
- const r = e[Y], n = t[Y];
266
- if (r == null) return 1;
267
- if (n == null) return -1;
268
- if (typeof r == "number" && typeof n == "number")
269
- return re === "asc" ? r - n : n - r;
270
- const s = String(r).toLowerCase(), a = String(n).toLowerCase();
271
- return re === "asc" ? s.localeCompare(a) : a.localeCompare(s);
272
- }), [oe, Y, re, B]), ae = I(() => {
273
- if (Z)
274
- return g || [];
275
- {
276
- const e = (pe - 1) * ee, t = e + ee;
277
- return se.slice(e, t);
278
- }
279
- }, [g, se, pe, ee, Z]), Ze = (e) => {
280
- B && Q ? (Q(e), v ? v(1) : ue(1)) : (Se === e ? Ce(ke === "asc" ? "desc" : "asc") : (Ke(e), Ce("asc")), te(1));
281
- }, Ee = (e, t) => {
282
- const r = t && t.trim() !== "" ? { ...M, [e]: t } : Object.fromEntries(Object.entries(M).filter(([n]) => n !== e));
283
- He(r), ce && J && J(r), v ? v(1) : ue(1);
284
- }, et = (e) => {
285
- K.current || (typeof q == "function" && q(e), K.current = setTimeout(() => {
286
- K.current = null;
287
- }, 3e3));
288
- }, ie = de((e) => {
289
- if (typeof window < "u" && W && e.length > 0 && $.current)
290
- try {
291
- localStorage.setItem(W, JSON.stringify(e)), V && localStorage.setItem(V, "true");
292
- } catch (t) {
293
- console.warn("Failed to save columns to localStorage:", t);
294
- }
295
- }, [W, V]), he = (e) => {
296
- e !== b && ($.current = !0, _((t) => t.includes(e) ? (K.current && (clearTimeout(K.current), K.current = null), t.length === 1 || (Oe((r) => new Set(r).add(e)), setTimeout(() => {
297
- _((r) => {
298
- const n = r.filter((a) => a !== e), s = L(n);
299
- return ie(s), s;
300
- }), Oe((r) => {
301
- const n = new Set(r);
302
- return n.delete(e), n;
303
- });
304
- }, 200)), t) : t.length >= D ? (et("Maximum 9 column selection allowed"), t) : (Fe((r) => new Set(r).add(e)), setTimeout(() => {
305
- _((r) => {
306
- const n = r.includes(e) ? r : [...r, e], s = L(n);
307
- return ie(s), s;
308
- }), Fe((r) => {
309
- const n = new Set(r);
310
- return n.delete(e), n;
311
- });
312
- }, 200), t)));
313
- }, tt = (e, t) => {
314
- f[t] !== b && ge(t);
315
- }, rt = () => {
316
- ge(null), ne(null);
317
- }, nt = (e, t) => {
318
- e.preventDefault(), N !== null && N !== t && ne(t);
319
- }, ot = () => {
320
- ne(null);
321
- }, st = (e, t) => {
322
- e.preventDefault(), N !== null && N !== t && f[t] !== b && f[N] !== b && ($.current = !0, _((r) => {
323
- const n = ye(r, N, t), s = L(n);
324
- return ie(s), s;
325
- })), ge(null), ne(null);
326
- };
327
- P(() => {
328
- De((e) => {
329
- const t = f.filter((s) => e.includes(s)), r = f.filter((s) => !e.includes(s)), n = e.filter((s) => !f.includes(s));
330
- return [...t, ...r, ...n];
331
- });
332
- }, [f]), P(() => {
333
- if (typeof window < "u" && W && f.length > 0 && $.current)
334
- try {
335
- const e = L(f);
336
- localStorage.setItem(W, JSON.stringify(e)), V && localStorage.setItem(V, "true");
337
- } catch (e) {
338
- console.warn("Failed to save columns to localStorage:", e);
339
- }
340
- }, [f, W, V]), P(() => {
341
- if (d.length > 0 && f.length === 0) {
342
- if (typeof window < "u" && c)
343
- try {
344
- if (localStorage.getItem(`dataTable_manual_change_${c}:${h}`) === "true") {
345
- const r = localStorage.getItem(`dataTable_columns_${c}:${h}`);
346
- if (r) {
347
- const n = JSON.parse(r);
348
- if (Array.isArray(n) && n.length > 0) {
349
- const s = n.filter(
350
- (a) => d.some((i) => (i.id || i.key) === a)
351
- );
352
- if (s.length > 0) {
353
- $.current = !0, _(s.slice(0, D));
354
- return;
355
- }
356
- }
357
- }
358
- }
359
- } catch (t) {
360
- console.warn("Failed to load saved columns from localStorage:", t);
361
- }
362
- const e = d.map((t) => t.id || t.key);
363
- _(L(e.slice(0, D)));
364
- }
365
- }, [d, c, h, L]);
366
- const A = I(() => {
367
- const e = f.map((t) => d.find((r) => x(r) === t)).filter(Boolean);
368
- return L(e.map(x)).map((t) => d.find((r) => x(r) === t)).filter(Boolean);
369
- }, [d, f]), at = I(() => A.some((e) => e.filterable === !0), [A]);
370
- P(() => {
371
- if (!k || !H.current) return;
372
- const e = () => {
373
- if (H.current) {
374
- const t = H.current.getBoundingClientRect();
375
- Ue({
376
- top: t.bottom,
377
- // No gap - connect directly
378
- left: t.left,
379
- width: Math.max(t.width || 220, 220)
380
- });
381
- }
382
- };
383
- return e(), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
384
- window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
385
- };
386
- }, [k]), P(() => {
387
- const e = (t) => {
388
- k && H.current && !H.current.contains(t.target) && me.current && !me.current.contains(t.target) && Ne(!1);
389
- };
390
- if (k)
391
- return document.addEventListener("mousedown", e), () => {
392
- document.removeEventListener("mousedown", e);
393
- };
394
- }, [k]);
395
- const it = f.length === 1 ? ((Me = d.find((e) => (e.id || e.key) === f[0])) == null ? void 0 : Me.label) || "1 selected" : `${f.length} selected`;
396
- function lt({ column: e, isHeaderRow: t = !0 }) {
397
- const r = x(e), n = r === b, {
398
- attributes: s,
399
- listeners: a,
400
- setNodeRef: i,
401
- transform: u,
402
- transition: U,
403
- isDragging: X
404
- } = vt({ id: r }), ct = {
405
- transform: wt.Transform.toString(u),
406
- transition: U,
407
- opacity: X ? 0.5 : 1,
408
- width: e.width || "auto",
409
- minWidth: e.width || "auto"
410
- };
411
- let le = !1;
412
- if (B && S.length > 0) {
413
- const F = S[0][0];
414
- (F === r || F === "csat_score" && r === "evaluation.csat_score") && (le = !0);
415
- } else
416
- le = Y === r;
417
- const ut = re === "asc", pt = e.filterable === !0;
418
- return t ? /* @__PURE__ */ o(
419
- "th",
420
- {
421
- ref: i,
422
- style: {
423
- ...ct,
424
- padding: "12px 14px",
425
- textAlign: n ? "center" : "left",
426
- fontWeight: 650,
427
- fontSize: "11px",
428
- letterSpacing: "0.14em",
429
- textTransform: "uppercase",
430
- color: "rgba(30, 33, 37, 0.62)",
431
- cursor: e.sortable !== !1 ? "pointer" : "default",
432
- width: e.width || "auto",
433
- borderRight: "1px solid rgba(52, 58, 64, 0.06)",
434
- userSelect: "none",
435
- background: "var(--primary-foreground)",
436
- borderBottom: "1px solid rgba(52, 58, 64, 0.12)",
437
- position: "sticky",
438
- top: 0,
439
- zIndex: 10,
440
- fontFamily: "var(--font-sans)"
441
- },
442
- children: /* @__PURE__ */ l(
443
- "div",
444
- {
445
- style: {
446
- display: "flex",
447
- alignItems: "center",
448
- gap: "6px",
449
- justifyContent: n ? "center" : "flex-start"
450
- },
451
- children: [
452
- !n && /* @__PURE__ */ o(
453
- "div",
454
- {
455
- ...s,
456
- ...a,
457
- style: { cursor: "grab", color: "rgba(30, 33, 37, 0.32)" },
458
- children: /* @__PURE__ */ o(Re, { size: 12 })
459
- }
460
- ),
461
- /* @__PURE__ */ o(
462
- "span",
463
- {
464
- onClick: () => e.sortable !== !1 && Ze(r),
465
- style: { cursor: e.sortable !== !1 ? "pointer" : "default" },
466
- children: e.label.toUpperCase()
467
- }
468
- ),
469
- e.sortable !== !1 && le && /* @__PURE__ */ o("span", { children: ut ? /* @__PURE__ */ o(Ie, { size: 12 }) : /* @__PURE__ */ o(ve, { size: 12 }) })
470
- ]
471
- }
472
- )
473
- }
474
- ) : /* @__PURE__ */ o(
475
- "th",
476
- {
477
- style: {
478
- width: e.width || "auto",
479
- minWidth: e.width || "auto",
480
- backgroundColor: "var(--primary-foreground)"
481
- },
482
- className: "sticky top-[57px] z-10 border-b border-[var(--border-strong)] px-4 py-2 text-left",
483
- children: pt ? /* @__PURE__ */ l("div", { className: "relative", children: [
484
- /* @__PURE__ */ o(
485
- Pe,
486
- {
487
- size: 12,
488
- className: "absolute left-2 top-1/2 -translate-y-1/2 text-[var(--text-faint)] pointer-events-none"
489
- }
490
- ),
491
- /* @__PURE__ */ o(
492
- "input",
493
- {
494
- type: "text",
495
- placeholder: "Filter...",
496
- value: M[r] || "",
497
- onChange: (F) => {
498
- F.stopPropagation(), Ee(r, F.target.value);
499
- },
500
- onKeyDown: (F) => F.stopPropagation(),
501
- onMouseDown: (F) => F.stopPropagation(),
502
- className: "w-full pl-7 pr-2 py-1.5 text-xs border border-[var(--border)] rounded text-[var(--text-ink)] placeholder:text-[var(--text-faint)] focus:outline-none focus:border-[var(--border-hover)] focus:ring-1 focus:ring-[var(--focus)] transition-colors",
503
- style: { fontFamily: "var(--font-sans)", backgroundColor: "var(--primary-foreground)" },
504
- autoComplete: "off"
505
- }
506
- )
507
- ] }) : /* @__PURE__ */ o("div", { className: "h-[34px]" })
508
- }
509
- );
510
- }
511
- const $e = Le ? d.find((e) => x(e) === Le) : null, dt = k ? /* @__PURE__ */ l(
512
- "div",
513
- {
514
- ref: me,
515
- className: "flex flex-col overflow-auto z-[49] min-w-[220px]",
516
- style: {
517
- position: "fixed",
518
- top: `${fe.top}px`,
519
- left: `${fe.left}px`,
520
- width: fe.width || 220,
521
- maxHeight: "400px",
522
- fontFamily: "var(--font-sans)",
523
- backgroundColor: "var(--primary-foreground)",
524
- borderRadius: "0 0 8px 8px",
525
- // Rounded corners only on bottom
526
- boxShadow: "4px 4px 6px 0px #6D70681A, -4px 0px 6px 0px #6D70681A",
527
- border: "1px solid rgba(52, 58, 64, 0.12)",
528
- borderTop: "none"
529
- // No top border to connect seamlessly
530
- },
531
- children: [
532
- f.map((e, t) => {
533
- const r = d.find((u) => x(u) === e);
534
- if (!r) return null;
535
- const n = f.indexOf(e), s = N === n, a = Ge === n, i = e === b;
536
- return /* @__PURE__ */ l(xe.Fragment, { children: [
537
- /* @__PURE__ */ l(
538
- "div",
539
- {
540
- draggable: !i,
541
- onDragStart: i ? void 0 : (u) => tt(u, n),
542
- onDragEnd: i ? void 0 : rt,
543
- onDragOver: i ? void 0 : (u) => nt(u, n),
544
- onDragLeave: i ? void 0 : ot,
545
- onDrop: i ? void 0 : (u) => st(u, n),
546
- className: `flex items-center gap-2 px-3 py-2 rounded transition-all ${i ? "cursor-default opacity-100" : "cursor-move"} ${!i && s ? "opacity-50" : ""} ${!i && a && N !== null && N !== n ? "ring-2 ring-green-2 ring-offset-1" : ""}`,
547
- children: [
548
- !i && /* @__PURE__ */ o(
549
- "svg",
550
- {
551
- className: "h-4 w-4 text-gray-600 flex-shrink-0",
552
- fill: "none",
553
- stroke: "currentColor",
554
- viewBox: "0 0 24 24",
555
- children: /* @__PURE__ */ o(
556
- "path",
557
- {
558
- strokeLinecap: "round",
559
- strokeLinejoin: "round",
560
- strokeWidth: 2,
561
- d: "M4 8h16M4 12h16M4 16h16"
562
- }
563
- )
564
- }
565
- ),
566
- /* @__PURE__ */ o(
567
- "button",
568
- {
569
- type: "button",
570
- onClick: (u) => {
571
- u.preventDefault(), u.stopPropagation(), i || he(e);
572
- },
573
- className: `h-4 w-4 rounded-[2px] border flex items-center justify-center transition-colors flex-shrink-0 ${i ? "bg-green-2 border-green-2 cursor-default" : ze.has(e) ? "bg-white border-gray-300" : "bg-green-2 border-green-2"}`,
574
- children: !ze.has(e) && /* @__PURE__ */ o(
575
- "svg",
576
- {
577
- className: "h-3 w-3",
578
- fill: "none",
579
- stroke: "currentColor",
580
- viewBox: "0 0 24 24",
581
- strokeWidth: 3,
582
- style: { color: "#1E2125" },
583
- children: /* @__PURE__ */ o(
584
- "path",
585
- {
586
- strokeLinecap: "round",
587
- strokeLinejoin: "round",
588
- d: "M5 13l4 4L19 7"
589
- }
590
- )
591
- }
592
- )
593
- }
594
- ),
595
- /* @__PURE__ */ o("span", { className: "text-sm text-gray-900 flex-1", style: { fontFamily: "var(--font-sans)" }, children: r.label })
596
- ]
597
- }
598
- ),
599
- t < f.length - 1 && /* @__PURE__ */ o(be, {})
600
- ] }, `selected-${e}-${t}`);
601
- }),
602
- d.filter((e) => !f.includes(x(e))).map((e, t) => {
603
- const r = x(e), n = Je.has(r), s = d.filter((a) => !f.includes(x(a))).indexOf(e);
604
- return /* @__PURE__ */ l(xe.Fragment, { children: [
605
- f.length > 0 && s === 0 && /* @__PURE__ */ o(be, {}),
606
- /* @__PURE__ */ l(
607
- "label",
608
- {
609
- className: "flex items-center gap-2 px-3 py-2 hover:bg-gray-50 rounded cursor-pointer transition-colors",
610
- onClick: (a) => {
611
- a.preventDefault(), he(r);
612
- },
613
- children: [
614
- /* @__PURE__ */ o(
615
- "button",
616
- {
617
- type: "button",
618
- onClick: (a) => {
619
- a.preventDefault(), a.stopPropagation(), he(r);
620
- },
621
- className: `h-4 w-4 rounded-[2px] border flex items-center justify-center transition-colors flex-shrink-0 ${n ? "bg-green-2 border-green-2" : "bg-white border-gray-300"}`,
622
- children: n && /* @__PURE__ */ o(
623
- "svg",
624
- {
625
- className: "h-3 w-3",
626
- fill: "none",
627
- stroke: "currentColor",
628
- viewBox: "0 0 24 24",
629
- strokeWidth: 3,
630
- style: { color: "#1E2125" },
631
- children: /* @__PURE__ */ o(
632
- "path",
633
- {
634
- strokeLinecap: "round",
635
- strokeLinejoin: "round",
636
- d: "M5 13l4 4L19 7"
637
- }
638
- )
639
- }
640
- )
641
- }
642
- ),
643
- /* @__PURE__ */ o("span", { className: "text-sm text-gray-900 flex-1", children: e.label })
644
- ]
645
- }
646
- ),
647
- s < d.filter((a) => !f.includes(x(a))).length - 1 && /* @__PURE__ */ o(be, {})
648
- ] }, `unselected-${r}`);
649
- })
650
- ]
651
- }
652
- ) : null;
653
- return /* @__PURE__ */ l("div", { className: "w-full", style: { top: "130px", position: "sticky", zIndex: 35, backgroundColor: "var(--primary-foreground)" }, children: [
654
- d.length > 0 && /* @__PURE__ */ o(
655
- "div",
656
- {
657
- className: "pt-2 pb-1",
658
- style: {
659
- position: "sticky",
660
- zIndex: 35,
661
- backgroundColor: "var(--primary-foreground)"
662
- },
663
- children: /* @__PURE__ */ l("div", { className: "flex items-center gap-3 flex-wrap", children: [
664
- /* @__PURE__ */ l("div", { className: "flex-shrink-0", children: [
665
- /* @__PURE__ */ o("div", { className: "mb-1 ml-1.5", children: /* @__PURE__ */ o("p", { className: "text-xs font-medium text-gray-600", style: { fontFamily: "var(--font-sans)" }, children: "Select Columns" }) }),
666
- /* @__PURE__ */ l(
667
- "div",
668
- {
669
- ref: H,
670
- className: "inline-flex items-center justify-between gap-2 px-4 py-2.5 cursor-pointer transition-colors text-sm font-medium text-gray-900 border border-gray-300 min-w-[220px]",
671
- onClick: () => Ne(!k),
672
- style: {
673
- fontFamily: "var(--font-sans)",
674
- backgroundColor: "var(--primary-foreground)",
675
- borderRadius: k ? "8px 8px 0 0" : "8px"
676
- // Rounded top corners when open, all corners when closed
677
- },
678
- children: [
679
- /* @__PURE__ */ o("span", { children: it }),
680
- k ? /* @__PURE__ */ o(Ie, { size: 16 }) : /* @__PURE__ */ o(ve, { size: 16 })
681
- ]
682
- }
683
- ),
684
- k && Nt(dt, document.body)
685
- ] }),
686
- O && /* @__PURE__ */ l(je, { children: [
687
- /* @__PURE__ */ o("div", { className: "h-9 mt-[1.5rem] w-px bg-gray-300 flex-shrink-0" }),
688
- /* @__PURE__ */ o("div", { className: "flex-shrink-0 mt-[1.5rem]", children: /* @__PURE__ */ o(
689
- Ot,
690
- {
691
- dateRangePicker: O.dateRangePicker,
692
- onWeekToDate: O.onWeekToDate,
693
- exportConfig: O.exportConfig,
694
- filterChipsConfig: O.filterChipsConfig,
695
- trailingActions: O.trailingActions
696
- }
697
- ) })
698
- ] })
699
- ] })
700
- }
701
- ),
702
- d.length > 0 && A.length > 0 ? /* @__PURE__ */ l(
703
- mt,
704
- {
705
- sensors: Xe,
706
- collisionDetection: ht,
707
- onDragStart: Qe,
708
- onDragEnd: qe,
709
- children: [
710
- /* @__PURE__ */ l("div", { className: "rounded-t-[14px]", style: {
711
- border: "1px solid rgba(52, 58, 64, 0.12)",
712
- borderBottom: "1px solid rgba(52, 58, 64, 0.12)",
713
- overflow: "hidden",
714
- background: "var(--primary-foreground)",
715
- position: "relative",
716
- top: "0.5rem"
717
- }, children: [
718
- z && /* @__PURE__ */ o("div", { style: {
719
- position: "absolute",
720
- inset: 0,
721
- background: "rgba(255, 255, 255, 0.9)",
722
- backdropFilter: "blur(2px)",
723
- zIndex: 20,
724
- display: "flex",
725
- flexDirection: "column",
726
- alignItems: "center",
727
- justifyContent: "center",
728
- borderRadius: "14px"
729
- }, children: /* @__PURE__ */ l("div", { style: {
730
- display: "flex",
731
- flexDirection: "column",
732
- alignItems: "center",
733
- gap: "12px"
734
- }, children: [
735
- /* @__PURE__ */ o("p", { style: {
736
- fontSize: "13px",
737
- color: "rgba(30, 33, 37, 0.6)",
738
- margin: 0
739
- }, children: "Loading..." }),
740
- /* @__PURE__ */ o(
741
- Tt,
742
- {
743
- src: "/BrandLoading.gif",
744
- alt: "Loading",
745
- width: 50,
746
- height: 50,
747
- unoptimized: !0,
748
- className: "mt-1"
749
- }
750
- )
751
- ] }) }),
752
- /* @__PURE__ */ o("div", { className: "overflow-x-auto custom-thin-scrollbar-hidden", ref: Ye, style: { maxHeight: "500px", overflowY: "auto", position: "relative", zIndex: 1 }, children: /* @__PURE__ */ l("table", { style: {
753
- width: "100%",
754
- borderCollapse: "collapse",
755
- fontSize: "13px",
756
- fontFamily: "var(--font-sans)"
757
- }, children: [
758
- /* @__PURE__ */ l("thead", { children: [
759
- /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o(
760
- xt,
761
- {
762
- items: f,
763
- strategy: yt,
764
- children: A.map((e) => /* @__PURE__ */ o(lt, { column: e, isHeaderRow: !0 }, `header-${x(e)}`))
765
- }
766
- ) }),
767
- at && /* @__PURE__ */ o("tr", { children: A.map((e) => {
768
- const t = x(e), r = e.filterable === !0;
769
- return /* @__PURE__ */ o(
770
- "th",
771
- {
772
- style: {
773
- padding: "8px 14px",
774
- background: "var(--primary-foreground)",
775
- borderBottom: "1px solid rgba(52, 58, 64, 0.10)",
776
- position: "sticky",
777
- top: "41px",
778
- zIndex: 10,
779
- width: e.width || "auto",
780
- fontFamily: "var(--font-sans)"
781
- },
782
- children: r ? /* @__PURE__ */ l("div", { style: { position: "relative" }, children: [
783
- /* @__PURE__ */ o(
784
- "input",
785
- {
786
- type: "text",
787
- placeholder: "Filter...",
788
- value: M[t] || "",
789
- onChange: (n) => {
790
- n.stopPropagation(), Ee(t, n.target.value);
791
- },
792
- onKeyDown: (n) => n.stopPropagation(),
793
- onMouseDown: (n) => n.stopPropagation(),
794
- style: {
795
- width: "100%",
796
- padding: "4px 8px 4px 26px",
797
- fontSize: "11.5px",
798
- border: "1px solid rgba(52, 58, 64, 0.16)",
799
- borderRadius: "6px",
800
- background: "var(--primary-foreground)",
801
- color: "rgba(30, 33, 37, 0.78)",
802
- outline: "none",
803
- fontFamily: "var(--font-sans)"
804
- },
805
- onFocus: (n) => {
806
- n.target.style.borderColor = "rgba(231, 212, 162, 0.65)", n.target.style.background = "var(--primary-foreground)";
807
- },
808
- onBlur: (n) => {
809
- n.target.style.borderColor = "rgba(52, 58, 64, 0.16)", n.target.style.background = "var(--primary-foreground)";
810
- },
811
- autoComplete: "off"
812
- }
813
- ),
814
- /* @__PURE__ */ o(
815
- Pe,
816
- {
817
- size: 11,
818
- style: {
819
- position: "absolute",
820
- left: "8px",
821
- top: "50%",
822
- transform: "translateY(-50%)",
823
- color: "rgba(30, 33, 37, 0.42)",
824
- pointerEvents: "none"
825
- }
826
- }
827
- )
828
- ] }) : /* @__PURE__ */ o("div", { className: "h-[34px]" })
829
- },
830
- `filter-${t}`
831
- );
832
- }) })
833
- ] }),
834
- /* @__PURE__ */ o("tbody", { children: !z && ae.length === 0 ? /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o(
835
- "td",
836
- {
837
- colSpan: A.length,
838
- style: {
839
- padding: "32px",
840
- textAlign: "center",
841
- color: "rgba(30, 33, 37, 0.42)",
842
- fontSize: "12px",
843
- fontFamily: "var(--font-sans)"
844
- },
845
- children: "No results found"
846
- }
847
- ) }) : !z && ae.length > 0 ? ae.map((e, t) => /* @__PURE__ */ o(
848
- "tr",
849
- {
850
- "data-row-id": e.id || t,
851
- style: {
852
- borderBottom: "1px solid rgba(52, 58, 64, 0.08)",
853
- cursor: p ? "pointer" : "default",
854
- transition: "background 0.15s ease"
855
- },
856
- onClick: p ? (r) => {
857
- r.stopPropagation(), p(e, t);
858
- } : void 0,
859
- onMouseEnter: (r) => {
860
- r.currentTarget.style.background = "rgba(231, 212, 162, 0.12)";
861
- },
862
- onMouseLeave: (r) => {
863
- r.currentTarget.style.background = "transparent";
864
- },
865
- children: A.map((r) => {
866
- const n = x(r), s = e[n], a = r.render ? r.render(s, e) : s, i = r.width && r.width !== "auto", u = typeof a == "string" && a.trim() !== "", U = i && u, X = U ? /* @__PURE__ */ o(w, { content: a, children: a }) : a;
867
- return /* @__PURE__ */ o(
868
- "td",
869
- {
870
- style: {
871
- padding: "10px 14px",
872
- color: "rgba(30, 33, 37, 0.78)",
873
- fontSize: "13px",
874
- borderRight: "1px solid rgba(52, 58, 64, 0.04)",
875
- width: r.width || "auto",
876
- fontFamily: "var(--font-sans)",
877
- ...U && { maxWidth: r.width || "200px", overflow: "hidden" }
878
- },
879
- children: X
880
- },
881
- n
882
- );
883
- })
884
- },
885
- t
886
- )) : null })
887
- ] }) })
888
- ] }),
889
- /* @__PURE__ */ o(bt, { children: $e ? /* @__PURE__ */ o("div", { className: "bg-[var(--paper-high)] border border-[var(--border-strong)] rounded px-4 py-2 shadow-lg", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
890
- /* @__PURE__ */ o(Re, { size: 14, className: "text-[var(--text-faint)]" }),
891
- /* @__PURE__ */ o("span", { className: "text-sm font-semibold text-[var(--text-ink)]", children: $e.label })
892
- ] }) }) : null })
893
- ]
894
- }
895
- ) : null,
896
- (Z ? C > 0 : se.length > 0) && /* @__PURE__ */ o("div", { className: "border-t border-gray-200 rounded-b-[14px]", style: { backgroundColor: "var(--primary-foreground)" }, children: /* @__PURE__ */ o(
897
- zt,
898
- {
899
- page: pe,
900
- pageSizeOptions: [5, 10, 20, 50, 100],
901
- pageSize: ee,
902
- totalCount: Z ? C : se.length,
903
- currentDataLength: ae.length,
904
- onPageChange: te,
905
- onPageSizeChange: E ? (e) => {
906
- we(e), te(1);
907
- } : (e) => {
908
- we(e), te(1);
909
- },
910
- showPageSizeSelector: !0
911
- }
912
- ) })
913
- ] });
914
- }
915
- function Wt({
916
- title: g = "Summary stats",
917
- stats: d = [],
918
- columns: y = 2
919
- }) {
920
- return /* @__PURE__ */ l("div", { style: { fontFamily: "system-ui, -apple-system, sans-serif" }, children: [
921
- /* @__PURE__ */ o(
922
- "div",
923
- {
924
- className: "text-[11px] tracking-[0.14em] uppercase mb-[10px]",
925
- style: { color: "rgba(30, 33, 37, 0.42)", fontWeight: 650 },
926
- children: g
927
- }
928
- ),
929
- /* @__PURE__ */ o(
930
- "div",
931
- {
932
- style: {
933
- display: "grid",
934
- gridTemplateColumns: `repeat(${y}, minmax(0, 1fr))`,
935
- gap: "10px"
936
- },
937
- children: d.map((p, C) => /* @__PURE__ */ l(
938
- "div",
939
- {
940
- style: {
941
- position: "relative",
942
- border: "1px solid rgba(52, 58, 64, 0.12)",
943
- borderRadius: "12px",
944
- background: "rgba(255, 255, 255, 0.72)",
945
- padding: p.accentColor ? "10px 10px 10px 14px" : "10px",
946
- minHeight: "62px",
947
- display: "flex",
948
- flexDirection: "column",
949
- justifyContent: "center",
950
- gap: "5px",
951
- overflow: "hidden"
952
- },
953
- children: [
954
- p.accentColor && /* @__PURE__ */ o(
955
- "div",
956
- {
957
- style: {
958
- position: "absolute",
959
- left: 0,
960
- top: 0,
961
- bottom: 0,
962
- width: "4px",
963
- background: p.accentColor,
964
- borderTopLeftRadius: "12px",
965
- borderBottomLeftRadius: "12px"
966
- }
967
- }
968
- ),
969
- /* @__PURE__ */ o(
970
- "div",
971
- {
972
- className: "text-[10px] tracking-[0.14em] uppercase",
973
- style: {
974
- color: "rgba(30, 33, 37, 0.42)",
975
- fontWeight: 650,
976
- lineHeight: 1.1,
977
- whiteSpace: "nowrap",
978
- overflow: "hidden",
979
- textOverflow: "ellipsis"
980
- },
981
- children: p.label
982
- }
983
- ),
984
- /* @__PURE__ */ o(
985
- "div",
986
- {
987
- style: {
988
- fontSize: "13px",
989
- color: p.valueStyle === "muted" ? "rgba(30, 33, 37, 0.56)" : "rgba(30, 33, 37, 0.78)",
990
- fontWeight: 700,
991
- lineHeight: 1.15,
992
- whiteSpace: "nowrap",
993
- overflow: "hidden",
994
- textOverflow: "ellipsis",
995
- fontFamily: p.valueStyle === "mono" ? "ui-monospace, monospace" : "inherit"
996
- },
997
- children: p.value
998
- }
999
- ),
1000
- p.subtext && /* @__PURE__ */ o(
1001
- "div",
1002
- {
1003
- style: {
1004
- fontSize: "11px",
1005
- color: "rgba(30, 33, 37, 0.52)",
1006
- lineHeight: 1.15,
1007
- whiteSpace: "nowrap",
1008
- overflow: "hidden",
1009
- textOverflow: "ellipsis"
1010
- },
1011
- children: p.subtext
1012
- }
1013
- )
1014
- ]
1015
- },
1016
- C
1017
- ))
1018
- }
1019
- )
1020
- ] });
1021
- }
1022
- export {
1023
- Bt as D,
1024
- Wt as S,
1025
- Ot as a
1026
- };
1027
- //# sourceMappingURL=SummaryStatsPanel.es.js.map