@epam/statgpt-ui-components 0.5.0-rc.2 → 0.5.0-rc.21

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/index.mjs CHANGED
@@ -1,63 +1,75 @@
1
- import { jsx as r, jsxs as o, Fragment as H } from "react/jsx-runtime";
2
- import * as oe from "react";
3
- import { useEffect as M, useState as j, useRef as B, useCallback as P, useMemo as W, createContext as U, useContext as V } from "react";
4
- import f from "classnames";
5
- import { IconX as de, IconCalendarEvent as ue, IconSquareCheckFilled as me, IconChevronDown as he, IconGripVertical as Q, IconChevronRight as K, IconDatabase as fe } from "@tabler/icons-react";
6
- import { extendTailwindMerge as pe } from "tailwind-merge";
7
- import ge from "react-flatpickr";
8
- import { CalendarResolution as O } from "@epam/statgpt-shared-toolkit";
9
- import { useFloating as X, useRole as xe, useDismiss as Z, useInteractions as J, FloatingPortal as be, FloatingOverlay as Ne, FloatingFocusManager as Ce, autoUpdate as ve, offset as ye, flip as we, shift as Ee, useClick as Se } from "@floating-ui/react";
10
- import { useSensors as Ie, useSensor as ke, PointerSensor as De, DndContext as Re, closestCenter as Le, DragOverlay as Fe } from "@dnd-kit/core";
11
- import { useSortable as Oe, SortableContext as _e, verticalListSortingStrategy as Ae, arrayMove as Pe } from "@dnd-kit/sortable";
12
- import { CSS as Te } from "@dnd-kit/utilities";
13
- const ee = () => /* @__PURE__ */ r("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ r("div", { className: "loader" }) }), te = ({
1
+ import { jsx as s, jsxs as u, Fragment as q } from "react/jsx-runtime";
2
+ import * as de from "react";
3
+ import { useEffect as O, useState as j, useRef as W, useCallback as P, useMemo as U, useId as ue, createContext as Q, useContext as K } from "react";
4
+ import p from "classnames";
5
+ import { IconX as me, IconCalendarEvent as he, IconSquareCheckFilled as fe, IconChevronDown as pe, IconGripVertical as X, IconChevronRight as Z, IconDatabase as ge } from "@tabler/icons-react";
6
+ import { extendTailwindMerge as xe } from "tailwind-merge";
7
+ import be from "react-flatpickr";
8
+ import { CalendarResolution as A } from "@epam/statgpt-shared-toolkit";
9
+ import { useFloating as J, useRole as Ne, useDismiss as ee, useInteractions as te, FloatingPortal as we, FloatingOverlay as ve, FloatingFocusManager as Ce, autoUpdate as ye, offset as Ee, flip as Ie, size as Se, shift as ke, useClick as De } from "@floating-ui/react";
10
+ import { useSensors as Le, useSensor as Oe, PointerSensor as Fe, DndContext as Re, closestCenter as _e, DragOverlay as Ae } from "@dnd-kit/core";
11
+ import { useSortable as Me, SortableContext as Te, verticalListSortingStrategy as Pe, arrayMove as Ye } from "@dnd-kit/sortable";
12
+ import { CSS as je } from "@dnd-kit/utilities";
13
+ const ne = ({
14
14
  title: e,
15
15
  btnClassNames: t,
16
16
  iconWidth: n,
17
- iconHeight: s,
18
- onClick: l
19
- }) => /* @__PURE__ */ r(
17
+ iconHeight: r,
18
+ onClick: a
19
+ }) => /* @__PURE__ */ s(
20
20
  "button",
21
21
  {
22
22
  type: "button",
23
23
  "aria-label": "button",
24
24
  className: t,
25
25
  title: e,
26
- onClick: l,
27
- children: /* @__PURE__ */ r(de, { height: s || 20, width: n || 20 })
26
+ onClick: a,
27
+ children: /* @__PURE__ */ s(me, { height: r || 20, width: n || 20 })
28
28
  }
29
29
  );
30
- var F = /* @__PURE__ */ ((e) => (e.ERROR = "error", e.SUCCESS = "success", e.IN_PROGRESS = "in_progress", e))(F || {});
31
- const mt = ({
30
+ var _ = /* @__PURE__ */ ((e) => (e.INFO = "info", e.ERROR = "error", e.SUCCESS = "success", e.IN_PROGRESS = "in_progress", e))(_ || {});
31
+ const ze = 3e4, bt = ({
32
32
  alertDetails: e,
33
- successIcon: t,
34
- errorIcon: n,
35
- onClose: s,
36
- closeButtonTitle: l
33
+ infoIcon: t,
34
+ successIcon: n,
35
+ errorIcon: r,
36
+ onClose: a,
37
+ closeButtonTitle: l,
38
+ children: c
37
39
  }) => {
38
- const a = () => e?.type === F.IN_PROGRESS ? "alert-in-progress" : e?.type === F.SUCCESS ? "alert-success" : "alert-error";
39
- return M(() => {
40
- e?.type !== F.IN_PROGRESS && setTimeout(() => {
41
- s?.();
42
- }, 5e3);
43
- }, [e?.type, s]), /* @__PURE__ */ r(
40
+ const i = e?.type, m = i === _.IN_PROGRESS || i === _.INFO, h = () => m ? "alert-in-progress" : i === _.SUCCESS ? "alert-success" : "alert-error", f = m ? t : i === _.SUCCESS ? n : i === _.ERROR ? r : null, g = e?.text;
41
+ return O(() => {
42
+ if (!e || m)
43
+ return;
44
+ const C = setTimeout(() => {
45
+ a?.();
46
+ }, ze);
47
+ return () => clearTimeout(C);
48
+ }, [e, m, a]), /* @__PURE__ */ s(
44
49
  "div",
45
50
  {
46
- className: f(
47
- "alert alert-shadow fixed bottom-3 right-3 z-10",
48
- a()
51
+ className: p(
52
+ "alert alert-shadow fixed bottom-3 right-3 z-10 w-[min(380px,calc(100vw-24px))] max-w-[calc(100vw-24px)]",
53
+ h()
49
54
  ),
50
- children: /* @__PURE__ */ o("div", { className: "alert-content flex items-start", children: [
51
- /* @__PURE__ */ r("div", { className: "alert-icon", children: e?.type === F.IN_PROGRESS ? /* @__PURE__ */ r(ee, {}) : e?.type === F.SUCCESS ? t : n }),
52
- /* @__PURE__ */ o("div", { className: "flex max-w-[300px] flex-col gap-2", children: [
53
- /* @__PURE__ */ r("h3", { className: "truncate", children: e?.title }),
54
- e?.text && /* @__PURE__ */ r("div", { className: "alert-text truncate", title: e?.text, children: e?.text })
55
+ children: /* @__PURE__ */ u("div", { className: "alert-content flex items-start", children: [
56
+ f && /* @__PURE__ */ s("div", { className: "alert-icon", children: f }),
57
+ /* @__PURE__ */ u("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
58
+ /* @__PURE__ */ s("h3", { className: "alert-title truncate", children: e?.title }),
59
+ c ?? (g && /* @__PURE__ */ s(
60
+ "div",
61
+ {
62
+ className: "alert-text whitespace-pre-line break-words",
63
+ title: g,
64
+ children: g
65
+ }
66
+ ))
55
67
  ] }),
56
- /* @__PURE__ */ r(te, { title: l, onClick: s })
68
+ /* @__PURE__ */ s(ne, { title: l, onClick: a })
57
69
  ] })
58
70
  }
59
71
  );
60
- }, Me = pe({
72
+ }, He = () => /* @__PURE__ */ s("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ s("div", { className: "loader" }) }), $e = xe({
61
73
  extend: {
62
74
  classGroups: {
63
75
  typography: [
@@ -74,416 +86,416 @@ const mt = ({
74
86
  }
75
87
  }
76
88
  });
77
- function R(...e) {
78
- return Me(f(...e));
89
+ function F(...e) {
90
+ return $e(p(...e));
79
91
  }
80
- const je = ({
92
+ const Ge = ({
81
93
  buttonClassName: e,
82
94
  textClassName: t,
83
95
  isLoading: n = !1,
84
- title: s,
85
- disabled: l,
86
- iconAfter: a,
87
- iconBefore: d,
88
- onClick: u,
89
- isSmallButton: h
96
+ title: r,
97
+ disabled: a,
98
+ iconAfter: l,
99
+ iconBefore: c,
100
+ onClick: i,
101
+ isSmallButton: m
90
102
  }) => {
91
- const m = R([
92
- h ? "font-semibold" : "",
93
- a ? "mr-2" : "",
94
- d ? "ml-2" : "",
103
+ const h = F([
104
+ m ? "font-semibold" : "",
105
+ l ? "mr-2" : "",
106
+ c ? "ml-2" : "",
95
107
  t
96
108
  ]);
97
- return /* @__PURE__ */ o(
109
+ return /* @__PURE__ */ u(
98
110
  "button",
99
111
  {
100
112
  type: "button",
101
- className: f(
113
+ className: p(
102
114
  "base-button",
103
115
  e,
104
- h ? "small-button" : ""
116
+ m ? "small-button" : ""
105
117
  ),
106
- disabled: l || n,
118
+ disabled: a || n,
107
119
  "aria-label": "button",
108
- onClick: (p) => u?.(p),
109
- title: s,
120
+ onClick: (f) => i?.(f),
121
+ title: r,
110
122
  children: [
111
- d,
112
- n && /* @__PURE__ */ r(ee, {}),
113
- s ? h ? /* @__PURE__ */ r("h4", { className: m, children: s }) : /* @__PURE__ */ r("h3", { className: m, children: s }) : null,
114
- a
123
+ c,
124
+ n && /* @__PURE__ */ s(He, {}),
125
+ r ? m ? /* @__PURE__ */ s("h4", { className: h, children: r }) : /* @__PURE__ */ s("h3", { className: h, children: r }) : null,
126
+ l
115
127
  ]
116
128
  }
117
129
  );
118
130
  };
119
- function Ye(e = 719) {
131
+ function Be(e = 719) {
120
132
  const [t, n] = j(
121
133
  () => typeof window < "u" ? window.innerWidth < e : !1
122
134
  );
123
- return M(() => {
124
- const s = window.matchMedia(`(max-width: ${e}px)`), l = (a) => {
125
- n(a.matches);
135
+ return O(() => {
136
+ const r = window.matchMedia(`(max-width: ${e}px)`), a = (l) => {
137
+ n(l.matches);
126
138
  };
127
- return n(s.matches), s.addEventListener("change", l), () => s.removeEventListener("change", l);
139
+ return n(r.matches), r.addEventListener("change", a), () => r.removeEventListener("change", a);
128
140
  }, [e]), t;
129
141
  }
130
- function ht(e, t) {
131
- const n = B(null);
142
+ function Nt(e, t) {
143
+ const n = W(null);
132
144
  return P(
133
- (...l) => {
145
+ (...a) => {
134
146
  n.current && clearTimeout(n.current), n.current = setTimeout(() => {
135
- e(...l);
147
+ e(...a);
136
148
  }, t);
137
149
  },
138
150
  [e, t]
139
151
  );
140
152
  }
141
- const ft = 24, pt = 24, q = 1e3, Ge = 24, gt = ({
153
+ const wt = 24, vt = 24, V = 1e3, We = 24, Ct = ({
142
154
  label: e,
143
155
  onChange: t,
144
156
  value: n,
145
- options: s,
146
- calendarResolution: l = O.DAY,
147
- id: a,
148
- icon: d,
149
- isEndDate: u
157
+ options: r,
158
+ calendarResolution: a = A.DAY,
159
+ id: l,
160
+ icon: c,
161
+ isEndDate: i
150
162
  }) => {
151
- const h = B(null), m = Ye();
152
- M(() => {
153
- const b = h?.current;
154
- b && b.querySelector("input")?.setAttribute("aria-label", e);
163
+ const m = W(null), h = Be();
164
+ O(() => {
165
+ const N = m?.current;
166
+ N && N.querySelector("input")?.setAttribute("aria-label", e);
155
167
  }, [e]);
156
- const p = {
157
- ...s,
168
+ const f = {
169
+ ...r,
158
170
  disableMobile: !0,
159
- defaultDate: l === O.MONTH ? new Date(n.getFullYear(), n.getMonth()) : n
160
- }, g = (b, N, x) => {
161
- const c = `calendar__${l === O.MONTH ? "month" : "day"}`;
162
- x.calendarContainer && x.calendarContainer.classList.add(c);
163
- }, C = (b, N, x) => {
164
- if (l === O.MONTH && b.length > 0) {
165
- const c = s.minDate, i = s.maxDate, v = b[0].getFullYear(), k = x.calendarContainer, S = "flatpickr-disabled", y = k.querySelectorAll(
171
+ defaultDate: a === A.MONTH ? new Date(n.getFullYear(), n.getMonth()) : n
172
+ }, g = (N, v, b) => {
173
+ const d = `calendar__${a === A.MONTH ? "month" : "day"}`;
174
+ b.calendarContainer && b.calendarContainer.classList.add(d);
175
+ }, C = (N, v, b) => {
176
+ if (a === A.MONTH && N.length > 0) {
177
+ const d = r.minDate, o = r.maxDate, x = N[0].getFullYear(), w = b.calendarContainer, S = "flatpickr-disabled", y = w.querySelectorAll(
166
178
  ".flatpickr-monthSelect-month"
167
- ), w = k.querySelectorAll(
179
+ ), E = w.querySelectorAll(
168
180
  ".flatpickr-next-month"
169
- )[0], D = k.querySelectorAll(
181
+ )[0], D = w.querySelectorAll(
170
182
  ".flatpickr-prev-month"
171
183
  )[0];
172
- v === i.getFullYear() && w.classList.add(S), v === c.getFullYear() && D.classList.add(S), (v === c.getFullYear() || v === i.getFullYear()) && y.forEach((I) => {
173
- I.classList.remove(S);
174
- const E = new Date(I.getAttribute("aria-label")), L = E.getFullYear() === c.getFullYear() && E.getMonth() === c.getMonth(), Y = E.getFullYear() === i.getFullYear() && E.getMonth() === i.getMonth();
175
- L || Y || (E < c || E > i) && I.classList.add(S);
184
+ x === o.getFullYear() && E.classList.add(S), x === d.getFullYear() && D.classList.add(S), (x === d.getFullYear() || x === o.getFullYear()) && y.forEach((k) => {
185
+ k.classList.remove(S);
186
+ const I = new Date(k.getAttribute("aria-label")), R = I.getFullYear() === d.getFullYear() && I.getMonth() === d.getMonth(), z = I.getFullYear() === o.getFullYear() && I.getMonth() === o.getMonth();
187
+ R || z || (I < d || I > o) && k.classList.add(S);
176
188
  });
177
189
  }
178
190
  setTimeout(() => {
179
- const c = x.calendarContainer, i = x._input?.getBoundingClientRect();
180
- c && (c.style.top = `${i.top - c.offsetHeight - 8}px`, c.style.width = `${c.style.width}px`, u ? (c.style.right = `${window.innerWidth - i.right - (m ? Ge : 0)}px`, c.style.left = "auto") : c.style.left = `${i.left}px`);
191
+ const d = b.calendarContainer, o = b._input?.getBoundingClientRect();
192
+ d && (d.style.top = `${o.top - d.offsetHeight - 8}px`, d.style.width = `${d.style.width}px`, i ? (d.style.right = `${window.innerWidth - o.right - (h ? We : 0)}px`, d.style.left = "auto") : d.style.left = `${o.left}px`);
181
193
  }, 0);
182
194
  };
183
- return /* @__PURE__ */ o("div", { className: "calendar relative", ref: h, children: [
184
- /* @__PURE__ */ r("div", { className: "calendar-title mb-1", children: e }),
185
- /* @__PURE__ */ r(
195
+ return /* @__PURE__ */ u("div", { className: "calendar relative", ref: m, children: [
196
+ /* @__PURE__ */ s("div", { className: "calendar-title mb-1", children: e }),
197
+ /* @__PURE__ */ s(
186
198
  "label",
187
199
  {
188
- htmlFor: a,
200
+ htmlFor: l,
189
201
  className: "absolute right-[11px] top-[29px] cursor-pointer",
190
- children: d || /* @__PURE__ */ r(ue, {})
202
+ children: c || /* @__PURE__ */ s(he, {})
191
203
  }
192
204
  ),
193
- /* @__PURE__ */ r(
194
- ge,
205
+ /* @__PURE__ */ s(
206
+ be,
195
207
  {
196
- defaultValue: (l === O.MONTH ? new Date(n.getFullYear(), n.getMonth()) : n)?.toDateString(),
197
- options: p,
198
- onChange: (b) => {
199
- t(b[0]);
208
+ defaultValue: (a === A.MONTH ? new Date(n.getFullYear(), n.getMonth()) : n)?.toDateString(),
209
+ options: f,
210
+ onChange: (N) => {
211
+ t(N[0]);
200
212
  },
201
213
  onOpen: [C],
202
214
  onReady: [g],
203
- id: a
215
+ id: l
204
216
  }
205
217
  )
206
218
  ] });
207
- }, ne = ({
219
+ }, re = ({
208
220
  label: e,
209
221
  id: t,
210
222
  checked: n,
211
- checkboxIcon: s,
212
- onChange: l,
213
- disabled: a = !1,
214
- className: d,
215
- stopPropagation: u = !0
223
+ checkboxIcon: r,
224
+ onChange: a,
225
+ disabled: l = !1,
226
+ className: c,
227
+ stopPropagation: i = !0
216
228
  }) => {
217
- const h = P(
229
+ const m = P(
218
230
  (g) => {
219
- u && g.stopPropagation();
231
+ i && g.stopPropagation();
220
232
  },
221
- [u]
222
- ), m = P(
233
+ [i]
234
+ ), h = P(
223
235
  (g) => {
224
- u && g.stopPropagation(), l?.(t, g.target.checked);
236
+ i && g.stopPropagation(), a?.(t, g.target.checked);
225
237
  },
226
- [l, t, u]
227
- ), p = () => {
238
+ [a, t, i]
239
+ ), f = () => {
228
240
  if (n)
229
- return s || /* @__PURE__ */ r(me, { className: "absolute size-4" });
241
+ return r || /* @__PURE__ */ s(fe, { className: "absolute size-4" });
230
242
  };
231
- return /* @__PURE__ */ o(
243
+ return /* @__PURE__ */ u(
232
244
  "label",
233
245
  {
234
246
  htmlFor: t,
235
- onClick: h,
236
- className: R(
247
+ onClick: m,
248
+ className: F(
237
249
  "flex min-w-0 items-center py-1 shrink-0",
238
- a ? "cursor-not-allowed opacity-50" : "cursor-pointer",
239
- d
250
+ l ? "cursor-not-allowed opacity-50" : "cursor-pointer",
251
+ c
240
252
  ),
241
253
  children: [
242
- /* @__PURE__ */ r(
254
+ /* @__PURE__ */ s(
243
255
  "span",
244
256
  {
245
- className: f(
257
+ className: p(
246
258
  "checkbox-button relative flex size-[14px] items-center justify-center"
247
259
  ),
248
260
  "aria-hidden": !0,
249
- children: p()
261
+ children: f()
250
262
  }
251
263
  ),
252
- e ? /* @__PURE__ */ r(
264
+ e ? /* @__PURE__ */ s(
253
265
  "p",
254
266
  {
255
- className: f(
267
+ className: p(
256
268
  "checkbox-button-text text-neutrals-1000 min-w-0 ml-2 flex-1 truncate pr-2"
257
269
  ),
258
270
  title: e,
259
271
  children: e
260
272
  }
261
273
  ) : null,
262
- /* @__PURE__ */ r(
274
+ /* @__PURE__ */ s(
263
275
  "input",
264
276
  {
265
277
  id: t,
266
278
  type: "checkbox",
267
279
  checked: n,
268
- disabled: a,
269
- onChange: m,
280
+ disabled: l,
281
+ onChange: h,
270
282
  className: "hidden"
271
283
  }
272
284
  )
273
285
  ]
274
286
  }
275
287
  );
276
- }, xt = ({
288
+ }, yt = ({
277
289
  title: e,
278
290
  icon: t,
279
291
  children: n,
280
- value: s
292
+ value: r
281
293
  }) => {
282
- const [l, a] = j(!1);
283
- return /* @__PURE__ */ o(
294
+ const [a, l] = j(!1);
295
+ return /* @__PURE__ */ u(
284
296
  "div",
285
297
  {
286
- className: `collapsible-block flex flex-col border-t-2 border-neutrals-600 ${l ? "collapsible-block-open" : ""}`,
298
+ className: `collapsible-block flex flex-col border-t-2 border-neutrals-600 ${a ? "collapsible-block-open" : ""}`,
287
299
  children: [
288
- /* @__PURE__ */ o(
300
+ /* @__PURE__ */ u(
289
301
  "div",
290
302
  {
291
303
  className: "collapsible-block-title flex cursor-pointer items-center py-4",
292
- onClick: () => a(!l),
304
+ onClick: () => l(!a),
293
305
  children: [
294
- /* @__PURE__ */ r("div", { className: `${l ? "rotate-180" : ""} transition-transform`, children: t || /* @__PURE__ */ r(he, { className: "mr-3 size-5" }) }),
295
- /* @__PURE__ */ o("div", { className: "flex flex-1 items-center justify-between", children: [
296
- /* @__PURE__ */ r("span", { children: e }),
297
- s && /* @__PURE__ */ r("p", { className: "body-1 text-neutrals-800", children: s })
306
+ /* @__PURE__ */ s("div", { className: `${a ? "rotate-180" : ""} transition-transform`, children: t || /* @__PURE__ */ s(pe, { className: "mr-3 size-5" }) }),
307
+ /* @__PURE__ */ u("div", { className: "flex flex-1 items-center justify-between", children: [
308
+ /* @__PURE__ */ s("span", { children: e }),
309
+ r && /* @__PURE__ */ s("p", { className: "body-1 text-neutrals-800", children: r })
298
310
  ] })
299
311
  ]
300
312
  }
301
313
  ),
302
- l && /* @__PURE__ */ r("div", { className: "collapsible-block-content pb-4", children: n })
314
+ a && /* @__PURE__ */ s("div", { className: "collapsible-block-content pb-4", children: n })
303
315
  ]
304
316
  }
305
317
  );
306
- }, bt = ({ text: e, highlightText: t }) => {
307
- const n = W(() => {
308
- const s = [];
318
+ }, Et = ({ text: e, highlightText: t }) => {
319
+ const n = U(() => {
320
+ const r = [];
309
321
  if (!t)
310
322
  return [{ id: 0, text: e, highlight: !1 }];
311
- const l = t?.toLowerCase() || "", a = e?.toLowerCase()?.split(l) || "";
312
- for (let d = 0, u = 0; d < a?.length; d++) {
313
- const h = a?.[d], m = h.length;
314
- h !== "" && s.push({
315
- id: s.length,
323
+ const a = t?.toLowerCase() || "", l = e?.toLowerCase()?.split(a) || "";
324
+ for (let c = 0, i = 0; c < l?.length; c++) {
325
+ const m = l?.[c], h = m.length;
326
+ m !== "" && r.push({
327
+ id: r.length,
316
328
  highlight: !1,
317
329
  text: e?.substring(
318
- u,
319
- u + m
330
+ i,
331
+ i + h
320
332
  )
321
- }), u += m, d !== a?.length - 1 && (s.push({
322
- id: s.length,
333
+ }), i += h, c !== l?.length - 1 && (r.push({
334
+ id: r.length,
323
335
  highlight: !0,
324
336
  text: e?.substring(
325
- u,
326
- u + t.length
337
+ i,
338
+ i + t.length
327
339
  )
328
- }), u += t.length);
340
+ }), i += t.length);
329
341
  }
330
- return s;
342
+ return r;
331
343
  }, [t, e]);
332
- return /* @__PURE__ */ r(H, { children: n.map((s) => /* @__PURE__ */ r(
344
+ return /* @__PURE__ */ s(q, { children: n.map((r) => /* @__PURE__ */ s(
333
345
  "span",
334
346
  {
335
- className: f(s?.highlight && "bg-highlight"),
336
- children: s?.text
347
+ className: p(r?.highlight && "bg-highlight"),
348
+ children: r?.text
337
349
  },
338
- s?.id
350
+ r?.id
339
351
  )) });
340
- }, Nt = ({
352
+ }, It = ({
341
353
  icon: e,
342
354
  onClick: t,
343
355
  buttonClassName: n,
344
- disabled: s,
345
- title: l,
346
- isBaseIconStyles: a = !0
347
- }) => /* @__PURE__ */ r(
356
+ disabled: r,
357
+ title: a,
358
+ isBaseIconStyles: l = !0
359
+ }) => /* @__PURE__ */ s(
348
360
  "button",
349
361
  {
350
362
  type: "button",
351
- className: f(
352
- a && "base-icon-button",
363
+ className: p(
364
+ l && "base-icon-button",
353
365
  n
354
366
  ),
355
- onClick: (d) => t?.(d),
356
- disabled: s,
357
- title: l,
367
+ onClick: (c) => t?.(c),
368
+ disabled: r,
369
+ title: a,
358
370
  "aria-label": "button",
359
371
  children: e
360
372
  }
361
- ), ze = ({
373
+ ), Ue = ({
362
374
  value: e,
363
375
  inputId: t,
364
376
  placeholder: n = "",
365
- cssClass: s = "",
366
- type: l = "text",
367
- disabled: a,
368
- readonly: d,
369
- onChange: u,
370
- onKeyDown: h,
371
- onFocus: m,
372
- onBlur: p
377
+ cssClass: r = "",
378
+ type: a = "text",
379
+ disabled: l,
380
+ readonly: c,
381
+ onChange: i,
382
+ onKeyDown: m,
383
+ onFocus: h,
384
+ onBlur: f
373
385
  }) => {
374
- const g = f(
386
+ const g = p(
375
387
  "truncate outline-none shadow-none body-1",
376
- s,
377
- d ? "pointer-events-none" : ""
388
+ r,
389
+ c ? "pointer-events-none" : ""
378
390
  );
379
- return /* @__PURE__ */ r(
391
+ return /* @__PURE__ */ s(
380
392
  "input",
381
393
  {
382
- type: l,
394
+ type: a,
383
395
  autoComplete: "off",
384
396
  id: t,
385
397
  placeholder: n,
386
398
  value: e || "",
387
399
  title: e ? String(e) : "",
388
- disabled: a,
400
+ disabled: l,
389
401
  className: g,
390
- onKeyDown: h,
391
- onFocus: m,
392
- onBlur: p,
393
- onChange: (C) => u?.(C.currentTarget.value)
402
+ onKeyDown: m,
403
+ onFocus: h,
404
+ onBlur: f,
405
+ onChange: (C) => i?.(C.currentTarget.value)
394
406
  }
395
407
  );
396
- }, Ct = ({
408
+ }, St = ({
397
409
  iconBeforeInput: e,
398
410
  iconAfterInput: t,
399
411
  containerClasses: n,
400
- cssClass: s,
401
- ...l
402
- }) => /* @__PURE__ */ o("div", { className: f("input w-full flex flex-row", n), children: [
412
+ cssClass: r,
413
+ ...a
414
+ }) => /* @__PURE__ */ u("div", { className: p("input w-full flex flex-row", n), children: [
403
415
  e,
404
- /* @__PURE__ */ r(
405
- ze,
416
+ /* @__PURE__ */ s(
417
+ Ue,
406
418
  {
407
- cssClass: f(
419
+ cssClass: p(
408
420
  "border-0 bg-transparent p-0 h-full shadow-none flex-1 min-w-0 rounded-none",
409
- s
421
+ r
410
422
  ),
411
- ...l
423
+ ...a
412
424
  }
413
425
  ),
414
426
  t
415
- ] }), vt = ({
427
+ ] }), kt = ({
416
428
  url: e,
417
429
  title: t,
418
430
  linkClassName: n = "",
419
- iconBefore: s,
420
- iconAfter: l
431
+ iconBefore: r,
432
+ iconAfter: a
421
433
  }) => {
422
- const a = f(
423
- l ? "mr-2" : "",
424
- s ? "ml-2" : ""
434
+ const l = p(
435
+ a ? "mr-2" : "",
436
+ r ? "ml-2" : ""
425
437
  );
426
- return /* @__PURE__ */ o(
438
+ return /* @__PURE__ */ u(
427
439
  "a",
428
440
  {
429
441
  href: e,
430
442
  target: "_blank",
431
443
  rel: "noopener noreferrer",
432
- className: f("base-link", n),
444
+ className: p("base-link", n),
433
445
  title: t,
434
446
  children: [
435
- s,
436
- /* @__PURE__ */ r("span", { className: a, children: t }),
437
- l
447
+ r,
448
+ /* @__PURE__ */ s("span", { className: l, children: t }),
449
+ a
438
450
  ]
439
451
  }
440
452
  );
441
- }, yt = ({ title: e, text: t, disabled: n, onClick: s }) => /* @__PURE__ */ r(
453
+ }, Dt = ({ title: e, text: t, disabled: n, onClick: r }) => /* @__PURE__ */ s(
442
454
  "button",
443
455
  {
444
456
  type: "button",
445
- className: f(
457
+ className: p(
446
458
  "tag flex items-center justify-center",
447
459
  "disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-neutrals-100"
448
460
  ),
449
461
  disabled: n,
450
- onClick: () => s?.(t || e),
462
+ onClick: () => r?.(t || e),
451
463
  "aria-label": "button",
452
- children: /* @__PURE__ */ r("h4", { children: e })
464
+ children: /* @__PURE__ */ s("h4", { children: e })
453
465
  }
454
- ), wt = ({
466
+ ), Lt = ({
455
467
  label: e,
456
468
  id: t,
457
469
  checked: n,
458
- radioIcon: s,
459
- description: l,
460
- onChange: a
470
+ radioIcon: r,
471
+ description: a,
472
+ onChange: l
461
473
  }) => {
462
- const d = P(
463
- (u) => {
464
- u.stopPropagation(), a?.(t, u.target.checked);
474
+ const c = P(
475
+ (i) => {
476
+ i.stopPropagation(), l?.(t, i.target.checked);
465
477
  },
466
- [a, t]
478
+ [l, t]
467
479
  );
468
- return /* @__PURE__ */ o(
480
+ return /* @__PURE__ */ u(
469
481
  "label",
470
482
  {
471
483
  className: "flex min-w-0 cursor-pointer flex-col py-[6px]",
472
484
  htmlFor: t,
473
485
  children: [
474
- /* @__PURE__ */ o("p", { className: "radio-label flex min-w-0 items-center", children: [
475
- /* @__PURE__ */ r(
486
+ /* @__PURE__ */ u("p", { className: "radio-label flex min-w-0 items-center", children: [
487
+ /* @__PURE__ */ s(
476
488
  "span",
477
489
  {
478
- className: f(
490
+ className: p(
479
491
  "flex justify-center items-center w-4 h-4 mr-2 relative",
480
492
  "radio-button",
481
493
  n ? "radio-button-active" : ""
482
494
  ),
483
- children: n && s
495
+ children: n && r
484
496
  }
485
497
  ),
486
- e && /* @__PURE__ */ r(
498
+ e && /* @__PURE__ */ s(
487
499
  "span",
488
500
  {
489
501
  className: "radio-title body-1 min-w-0 flex-1 truncate pr-2 text-neutrals-1000",
@@ -492,19 +504,19 @@ const ft = 24, pt = 24, q = 1e3, Ge = 24, gt = ({
492
504
  }
493
505
  )
494
506
  ] }),
495
- l && /* @__PURE__ */ r(
507
+ a && /* @__PURE__ */ s(
496
508
  "span",
497
509
  {
498
510
  className: "radio-description body-2 ml-6 flex w-auto items-center text-neutrals-800",
499
- title: l,
500
- children: l
511
+ title: a,
512
+ children: a
501
513
  }
502
514
  ),
503
- /* @__PURE__ */ r(
515
+ /* @__PURE__ */ s(
504
516
  "input",
505
517
  {
506
518
  type: "radio",
507
- onChange: d,
519
+ onChange: c,
508
520
  id: t,
509
521
  checked: n,
510
522
  className: "hidden"
@@ -514,175 +526,216 @@ const ft = 24, pt = 24, q = 1e3, Ge = 24, gt = ({
514
526
  }
515
527
  );
516
528
  };
517
- var A = /* @__PURE__ */ ((e) => (e.Closed = "Closed", e.Opened = "Opened", e))(A || {}), z = /* @__PURE__ */ ((e) => (e.LG = "Large", e.SM = "Small", e))(z || {});
518
- const $e = ({
529
+ var T = /* @__PURE__ */ ((e) => (e.Closed = "Closed", e.Opened = "Opened", e))(T || {}), G = /* @__PURE__ */ ((e) => (e.LG = "Large", e.SM = "Small", e))(G || {});
530
+ const Ve = ({
519
531
  portalId: e,
520
- state: t = A.Opened,
532
+ state: t = T.Opened,
521
533
  heading: n,
522
- size: s,
523
- onClose: l,
524
- children: a,
525
- overlayClassName: d,
526
- containerClassName: u,
527
- dividers: h = !0,
528
- closeButtonTitle: m
534
+ size: r,
535
+ onClose: a,
536
+ children: l,
537
+ overlayClassName: c,
538
+ containerClassName: i,
539
+ dividers: m = !0,
540
+ closeButtonTitle: h
529
541
  }) => {
530
- const { refs: p, context: g } = X({
531
- open: t !== A.Closed && !!t,
532
- onOpenChange: l
533
- }), C = xe(g, { role: "dialog" }), b = Z(g, { outsidePress: !0 }), { getFloatingProps: N } = J([C, b]), x = P(
534
- (c) => {
535
- c?.preventDefault(), c?.stopPropagation(), l();
542
+ const { refs: f, context: g } = J({
543
+ open: t !== T.Closed && !!t,
544
+ onOpenChange: a
545
+ }), C = Ne(g, { role: "dialog" }), N = ee(g, { outsidePress: !0 }), { getFloatingProps: v } = te([C, N]), b = P(
546
+ (d) => {
547
+ d?.preventDefault(), d?.stopPropagation(), a();
536
548
  },
537
- [l]
549
+ [a]
538
550
  );
539
- return /* @__PURE__ */ r(be, { id: e, children: t !== A.Closed && /* @__PURE__ */ r(
540
- Ne,
551
+ return /* @__PURE__ */ s(we, { id: e, children: t !== T.Closed && /* @__PURE__ */ s(
552
+ ve,
541
553
  {
542
- className: f(
554
+ className: p(
543
555
  "z-modal flex items-center justify-center bg-blackout p-4",
544
- d
556
+ c
545
557
  ),
546
- children: /* @__PURE__ */ r(Ce, { context: g, children: /* @__PURE__ */ o(
558
+ children: /* @__PURE__ */ s(Ce, { context: g, children: /* @__PURE__ */ u(
547
559
  "div",
548
560
  {
549
- className: f(
561
+ className: p(
550
562
  "relative max-h-full modal rounded bg-white flex flex-col shadow w-full",
551
- s === z.LG && "max-w-[65%]",
552
- s === z.SM && "max-w-[30%]",
553
- h && "divide-neutrals-400 divide-y",
554
- u,
563
+ r === G.LG && "max-w-[65%]",
564
+ r === G.SM && "max-w-[30%]",
565
+ m && "divide-neutrals-400 divide-y",
566
+ i,
555
567
  "sm:w-full sm:max-w-full sm:px-4 sm:py-6"
556
568
  ),
557
- ref: p.setFloating,
558
- ...N({
559
- onClick(c) {
560
- c.stopPropagation();
569
+ ref: f.setFloating,
570
+ ...v({
571
+ onClick(d) {
572
+ d.stopPropagation();
561
573
  }
562
574
  }),
563
575
  children: [
564
- /* @__PURE__ */ o("div", { className: "modal-heading mb-2 flex flex-row items-center justify-between px-6 py-3 sm:p-0 sm:pb-2", children: [
565
- n && (typeof n == "string" ? /* @__PURE__ */ r("h2", { className: "modal-heading-title sm:h3 mr-3 min-w-0 flex-1", children: n }) : n),
566
- /* @__PURE__ */ r(
567
- te,
576
+ /* @__PURE__ */ u("div", { className: "modal-heading mb-2 flex flex-row items-center justify-between px-6 py-3 sm:p-0 sm:pb-2", children: [
577
+ n && (typeof n == "string" ? /* @__PURE__ */ s("h2", { className: "modal-heading-title sm:h3 mr-3 min-w-0 flex-1", children: n }) : n),
578
+ /* @__PURE__ */ s(
579
+ ne,
568
580
  {
569
- title: m,
570
- onClick: x,
581
+ title: h,
582
+ onClick: b,
571
583
  btnClassNames: "sm:h-[24px] sm:w-[24px] sm:top-4"
572
584
  }
573
585
  )
574
586
  ] }),
575
- a.map((c) => c)
587
+ l.map((d) => d)
576
588
  ]
577
589
  }
578
590
  ) })
579
591
  }
580
592
  ) });
581
- }, Et = (e) => e.state === A.Closed ? null : /* @__PURE__ */ r($e, { ...e }), St = ({
593
+ }, Ot = (e) => e.state === T.Closed ? null : /* @__PURE__ */ s(Ve, { ...e }), H = "statgpt-dropdown-open", L = 8, qe = {
594
+ name: "keepDropdownWithinViewport",
595
+ fn({ y: e, rects: t }) {
596
+ if (typeof window > "u")
597
+ return {};
598
+ const n = document.documentElement.clientHeight || window.innerHeight, r = Math.min(
599
+ t.floating.height,
600
+ Math.max(0, n - L * 2)
601
+ ), a = L, l = n - r - L;
602
+ return {
603
+ y: Math.min(Math.max(e, a), Math.max(a, l))
604
+ };
605
+ }
606
+ }, Ft = ({
582
607
  triggerButton: e,
583
608
  options: t,
584
609
  content: n,
585
- selectedOption: s,
586
- disabled: l,
587
- containerClassName: a,
588
- openedClassName: d,
589
- onOptionSelect: u
610
+ selectedOption: r,
611
+ disabled: a,
612
+ containerClassName: l,
613
+ openedClassName: c,
614
+ onOptionSelect: i
590
615
  }) => {
591
- const [h, m] = j(!1), { refs: p, floatingStyles: g, context: C } = X({
616
+ const m = ue(), [h, f] = j(!1), { refs: g, floatingStyles: C, context: N } = J({
592
617
  open: h,
593
- onOpenChange: l ? void 0 : m,
618
+ onOpenChange: a ? void 0 : f,
594
619
  placement: "bottom-end",
595
- middleware: [ye(8), we(), Ee()],
596
- whileElementsMounted: ve
597
- }), b = Se(C), N = Z(C, { outsidePress: !0 }), { getReferenceProps: x, getFloatingProps: c } = J([
598
- b,
599
- N
620
+ strategy: "fixed",
621
+ middleware: [
622
+ Ee(L),
623
+ Ie({ padding: L }),
624
+ Se({
625
+ padding: L,
626
+ apply({ availableHeight: x, elements: w }) {
627
+ w.floating.style.maxHeight = `${Math.max(
628
+ 0,
629
+ x
630
+ )}px`;
631
+ }
632
+ }),
633
+ ke({ padding: L }),
634
+ qe
635
+ ],
636
+ whileElementsMounted: ye
637
+ }), v = De(N), b = ee(N, { outsidePress: !0 }), { getReferenceProps: d, getFloatingProps: o } = te([
638
+ v,
639
+ b
600
640
  ]);
601
- return /* @__PURE__ */ o(H, { children: [
602
- /* @__PURE__ */ r(
641
+ return O(() => {
642
+ h && window.dispatchEvent(
643
+ new CustomEvent(H, { detail: m })
644
+ );
645
+ }, [m, h]), O(() => {
646
+ const x = (w) => {
647
+ w instanceof CustomEvent && w.detail !== m && f(!1);
648
+ };
649
+ return window.addEventListener(H, x), () => {
650
+ window.removeEventListener(H, x);
651
+ };
652
+ }, [m]), O(() => {
653
+ a && f(!1);
654
+ }, [a]), /* @__PURE__ */ u(q, { children: [
655
+ /* @__PURE__ */ s(
603
656
  "div",
604
657
  {
605
- ref: p.setReference,
606
- ...x({
607
- onClick(i) {
608
- i.stopPropagation();
658
+ ref: g.setReference,
659
+ ...d({
660
+ onClick(x) {
661
+ x.stopPropagation();
609
662
  }
610
663
  }),
611
- className: f(a, h && d),
664
+ className: p(l, h && c),
612
665
  children: e
613
666
  }
614
667
  ),
615
- h && /* @__PURE__ */ o(
668
+ h && /* @__PURE__ */ u(
616
669
  "div",
617
670
  {
618
- ref: p.setFloating,
619
- style: g,
671
+ ref: g.setFloating,
672
+ style: { ...C, overflowY: "auto" },
620
673
  className: "dropdown-menu-shadow dropdown-container z-10 flex flex-col rounded bg-white",
621
- ...c(),
674
+ ...o(),
622
675
  children: [
623
676
  n && n,
624
- t && t.map((i) => /* @__PURE__ */ r(
677
+ t && t.map((x) => /* @__PURE__ */ s(
625
678
  "div",
626
679
  {
627
- onClick: (v) => {
628
- v.stopPropagation(), u?.(i.key), m(!1);
680
+ onClick: (w) => {
681
+ w.stopPropagation(), i?.(x.key), f(!1);
629
682
  },
630
- className: f(
683
+ className: p(
631
684
  "text-neutrals-900 body-3 cursor-pointer dropdown-item min-w-[200px]",
632
- s === i.key && "bg-hues-100"
685
+ r === x.key && "bg-hues-100"
633
686
  ),
634
- children: /* @__PURE__ */ o(
687
+ children: /* @__PURE__ */ u(
635
688
  "div",
636
689
  {
637
690
  className: "dropdown-item-text flex h-full items-center gap-x-2 p-2 hover:bg-hues-100",
638
- title: i.title,
691
+ title: x.title,
639
692
  children: [
640
- i.icon ? i.icon : null,
641
- /* @__PURE__ */ r("p", { children: i?.title })
693
+ x.icon ? x.icon : null,
694
+ /* @__PURE__ */ s("p", { children: x?.title })
642
695
  ]
643
696
  }
644
697
  )
645
698
  },
646
- i.key
699
+ x.key
647
700
  ))
648
701
  ]
649
702
  }
650
703
  )
651
704
  ] });
652
- }, It = ({ limitMessages: e, query: t }) => /* @__PURE__ */ o("div", { className: "flex flex-wrap items-center justify-between bg-hues-100 px-2 py-1", children: [
653
- /* @__PURE__ */ r("div", { className: "flex gap-x-[4px]", children: /* @__PURE__ */ r("div", { className: "flex flex-col", children: /* @__PURE__ */ o("div", { className: "flex gap-x-[4px]", children: [
654
- /* @__PURE__ */ o("span", { className: "h5 text-primary", children: [
705
+ }, Rt = ({ limitMessages: e, query: t }) => /* @__PURE__ */ u("div", { className: "flex flex-wrap items-center justify-between bg-hues-100 px-2 py-1", children: [
706
+ /* @__PURE__ */ s("div", { className: "flex gap-x-[4px]", children: /* @__PURE__ */ s("div", { className: "flex flex-col", children: /* @__PURE__ */ u("div", { className: "flex gap-x-[4px]", children: [
707
+ /* @__PURE__ */ u("span", { className: "h5 text-primary", children: [
655
708
  e?.excelFormatTitle,
656
709
  " "
657
710
  ] }),
658
- /* @__PURE__ */ r("span", { className: "body-3 text-neutrals-800", children: e?.excelFormatText })
711
+ /* @__PURE__ */ s("span", { className: "body-3 text-neutrals-800", children: e?.excelFormatText })
659
712
  ] }) }) }),
660
- /* @__PURE__ */ r("a", { href: t, target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ o("span", { className: "body-3 flex cursor-pointer items-center gap-x-[4px]", children: [
713
+ /* @__PURE__ */ s("a", { href: t, target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ u("span", { className: "body-3 flex cursor-pointer items-center gap-x-[4px]", children: [
661
714
  e?.dataExplorerIcon,
662
715
  e?.dataExplorer
663
716
  ] }) })
664
- ] }), kt = ({
717
+ ] }), _t = ({
665
718
  limitMessages: e,
666
719
  isDownload: t,
667
720
  showAdvancedViewButton: n,
668
- onAdvancedViewClick: s,
669
- query: l
670
- }) => /* @__PURE__ */ o(
721
+ onAdvancedViewClick: r,
722
+ query: a
723
+ }) => /* @__PURE__ */ u(
671
724
  "div",
672
725
  {
673
- className: f(
726
+ className: p(
674
727
  "bg-semantic-warning-light px-2 py-1 flex justify-between flex-wrap items-center",
675
728
  e?.containerClassName
676
729
  ),
677
730
  children: [
678
- /* @__PURE__ */ o("div", { className: "flex items-center gap-x-2", children: [
679
- /* @__PURE__ */ r("span", { children: e?.warningIcon }),
680
- /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
681
- /* @__PURE__ */ o("div", { className: "flex gap-x-[4px]", children: [
682
- /* @__PURE__ */ o(
731
+ /* @__PURE__ */ u("div", { className: "flex items-center gap-x-2", children: [
732
+ /* @__PURE__ */ s("span", { children: e?.warningIcon }),
733
+ /* @__PURE__ */ u("div", { className: "flex flex-col gap-1", children: [
734
+ /* @__PURE__ */ u("div", { className: "flex gap-x-[4px]", children: [
735
+ /* @__PURE__ */ u(
683
736
  "span",
684
737
  {
685
- className: f(
738
+ className: p(
686
739
  "text-primary h5",
687
740
  e?.largeQueryClassName
688
741
  ),
@@ -693,21 +746,21 @@ const $e = ({
693
746
  ]
694
747
  }
695
748
  ),
696
- /* @__PURE__ */ r(
749
+ /* @__PURE__ */ s(
697
750
  "span",
698
751
  {
699
- className: f(
752
+ className: p(
700
753
  "text-neutrals-800 body-3",
701
754
  e?.limitMessageClassName
702
755
  ),
703
- children: t ? e?.downloadMessage?.(q) : e?.showingLimit?.(q)
756
+ children: t ? e?.downloadMessage?.(V) : e?.showingLimit?.(V)
704
757
  }
705
758
  )
706
759
  ] }),
707
- t && /* @__PURE__ */ r(
760
+ t && /* @__PURE__ */ s(
708
761
  "span",
709
762
  {
710
- className: f(
763
+ className: p(
711
764
  "text-neutrals-800 body-3",
712
765
  e?.limitMessageClassName
713
766
  ),
@@ -716,10 +769,10 @@ const $e = ({
716
769
  )
717
770
  ] })
718
771
  ] }),
719
- n && /* @__PURE__ */ o(
772
+ n && /* @__PURE__ */ u(
720
773
  "span",
721
774
  {
722
- onClick: () => s?.(),
775
+ onClick: () => r?.(),
723
776
  className: "h4 flex cursor-pointer items-center gap-x-[4px] text-primary",
724
777
  children: [
725
778
  e?.editIcon,
@@ -727,118 +780,118 @@ const $e = ({
727
780
  ]
728
781
  }
729
782
  ),
730
- t && /* @__PURE__ */ r("a", { href: l || "", target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ o("span", { className: "body-3 flex cursor-pointer items-center gap-x-[4px]", children: [
783
+ t && /* @__PURE__ */ s("a", { href: a || "", target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ u("span", { className: "body-3 flex cursor-pointer items-center gap-x-[4px]", children: [
731
784
  e?.dataExplorerIcon,
732
785
  e?.dataExplorer
733
786
  ] }) })
734
787
  ]
735
788
  }
736
- ), re = U(null);
737
- function Dt({
789
+ ), se = Q(null);
790
+ function At({
738
791
  value: e,
739
792
  children: t
740
793
  }) {
741
- const n = W(() => e ?? {}, [e]);
742
- return /* @__PURE__ */ r(re.Provider, { value: n, children: t });
794
+ const n = U(() => e ?? {}, [e]);
795
+ return /* @__PURE__ */ s(se.Provider, { value: n, children: t });
743
796
  }
744
- function Be() {
745
- return V(re);
797
+ function Qe() {
798
+ return K(se);
746
799
  }
747
- var _ = /* @__PURE__ */ ((e) => (e.Info = "info", e.Error = "error", e.Warning = "warning", e.Note = "note", e))(_ || {});
748
- const We = {
749
- [_.Info]: "border-neutrals-800 bg-neutrals-300 text-neutrals-1000",
750
- [_.Error]: "border-semantic-error bg-semantic-error-light text-neutrals-1000",
751
- [_.Warning]: "border-semantic-warning bg-semantic-warning-light text-neutrals-1000",
752
- [_.Note]: "border-hues-900 bg-neutrals-200 text-neutrals-1000"
753
- }, qe = "shrink-0", He = "min-w-0 body-2", Ue = "flex items-start gap-2 min-w-0 border-l-2 rounded py-2 px-4 items-center";
754
- function Rt({
800
+ var M = /* @__PURE__ */ ((e) => (e.Info = "info", e.Error = "error", e.Warning = "warning", e.Note = "note", e))(M || {});
801
+ const Ke = {
802
+ [M.Info]: "border-neutrals-800 bg-neutrals-300 text-neutrals-1000",
803
+ [M.Error]: "border-semantic-error bg-semantic-error-light text-neutrals-1000",
804
+ [M.Warning]: "border-semantic-warning bg-semantic-warning-light text-neutrals-1000",
805
+ [M.Note]: "border-hues-900 bg-neutrals-200 text-neutrals-1000"
806
+ }, Xe = "shrink-0", Ze = "min-w-0 body-2", Je = "flex items-start gap-2 min-w-0 border-l-2 rounded py-2 px-4 items-center";
807
+ function Mt({
755
808
  type: e,
756
809
  icon: t,
757
810
  children: n,
758
- className: s,
759
- contentClassName: l
811
+ className: r,
812
+ contentClassName: a
760
813
  }) {
761
- const a = Be(), d = t ?? a?.icons?.[e], u = a?.classes?.container ?? Ue, h = a?.classes?.types?.[e] ?? We[e], m = R(u, h, s), p = R(qe, a?.classes?.icon), g = R(
762
- He,
763
- a?.classes?.content,
764
- l
814
+ const l = Qe(), c = t ?? l?.icons?.[e], i = l?.classes?.container ?? Je, m = l?.classes?.types?.[e] ?? Ke[e], h = F(i, m, r), f = F(Xe, l?.classes?.icon), g = F(
815
+ Ze,
816
+ l?.classes?.content,
817
+ a
765
818
  );
766
- return /* @__PURE__ */ o("div", { "data-type": e, className: m, children: [
767
- d ? /* @__PURE__ */ r("span", { className: p, children: d }) : null,
768
- n ? /* @__PURE__ */ r("div", { className: g, children: n }) : null
819
+ return /* @__PURE__ */ u("div", { "data-type": e, className: h, children: [
820
+ c ? /* @__PURE__ */ s("span", { className: f, children: c }) : null,
821
+ n ? /* @__PURE__ */ s("div", { className: g, children: n }) : null
769
822
  ] });
770
823
  }
771
- const Lt = ({
824
+ const Tt = ({
772
825
  title: e,
773
826
  copiedTitle: t,
774
827
  tooltip: n,
775
- icon: s,
776
- copiedIcon: l,
777
- className: a,
778
- buttonTextClassName: d,
779
- onClick: u
828
+ icon: r,
829
+ copiedIcon: a,
830
+ className: l,
831
+ buttonTextClassName: c,
832
+ onClick: i
780
833
  }) => {
781
- const [h, m] = j(!1), p = B(null), g = () => {
782
- u(), m(!0), p.current && clearTimeout(p.current), p.current = setTimeout(() => {
783
- m(!1);
834
+ const [m, h] = j(!1), f = W(null), g = () => {
835
+ i(), h(!0), f.current && clearTimeout(f.current), f.current = setTimeout(() => {
836
+ h(!1);
784
837
  }, 1e3);
785
838
  };
786
- return M(() => () => {
787
- p.current && clearTimeout(p.current);
788
- }, []), /* @__PURE__ */ o("div", { className: "relative w-fit", children: [
789
- /* @__PURE__ */ r(
790
- je,
839
+ return O(() => () => {
840
+ f.current && clearTimeout(f.current);
841
+ }, []), /* @__PURE__ */ u("div", { className: "relative w-fit", children: [
842
+ /* @__PURE__ */ s(
843
+ Ge,
791
844
  {
792
- title: h ? t : e,
845
+ title: m ? t : e,
793
846
  isSmallButton: !0,
794
- disabled: h,
795
- buttonClassName: R([
847
+ disabled: m,
848
+ buttonClassName: F([
796
849
  "text-button-tertiary small-icon-button !h-6 !p-0",
797
- a
850
+ l
798
851
  ]),
799
- textClassName: R(["ml-1", d]),
852
+ textClassName: F(["ml-1", c]),
800
853
  onClick: g,
801
- iconBefore: h ? l : s
854
+ iconBefore: m ? a : r
802
855
  }
803
856
  ),
804
- n && h && /* @__PURE__ */ r("div", { className: "h4 absolute left-1/2 top-full z-50 mt-1 -translate-x-1/2 whitespace-nowrap rounded border border-neutrals-400 bg-white px-3 py-4 text-neutrals-900 shadow", children: n })
857
+ n && m && /* @__PURE__ */ s("div", { className: "h4 absolute left-1/2 top-full z-50 mt-1 -translate-x-1/2 whitespace-nowrap rounded border border-neutrals-400 bg-white px-3 py-4 text-neutrals-900 shadow", children: n })
805
858
  ] });
806
859
  };
807
- function Ve({
860
+ function et({
808
861
  id: e,
809
862
  label: t,
810
863
  hasChildren: n,
811
- showDragHandle: s,
812
- showCheckbox: l,
813
- isChecked: a,
814
- isExpanded: d
864
+ showDragHandle: r,
865
+ showCheckbox: a,
866
+ isChecked: l,
867
+ isExpanded: c
815
868
  }) {
816
- return /* @__PURE__ */ o("div", { className: "relative cursor-grabbing rounded bg-neutrals-200 shadow", children: [
817
- /* @__PURE__ */ r("div", { className: "absolute -left-[0.5px] top-0.5 h-5 w-0.5 rounded-full bg-gradients-light" }),
818
- /* @__PURE__ */ o("div", { className: "flex items-stretch overflow-hidden rounded", children: [
819
- s ? /* @__PURE__ */ r("div", { className: "flex w-6 items-center justify-center", children: /* @__PURE__ */ r("span", { "aria-hidden": !0, className: "rounded p-1", children: /* @__PURE__ */ r(Q, { size: 16 }) }) }) : null,
820
- /* @__PURE__ */ o("div", { className: "flex min-w-0 flex-1 items-center gap-2 p-1", children: [
821
- l ? /* @__PURE__ */ r(ne, { id: e, checked: !!a, className: "p-0" }) : null,
822
- /* @__PURE__ */ r("span", { className: "body-3 truncate", children: t })
869
+ return /* @__PURE__ */ u("div", { className: "relative cursor-grabbing rounded bg-neutrals-200 shadow", children: [
870
+ /* @__PURE__ */ s("div", { className: "absolute -left-[0.5px] top-0.5 h-5 w-0.5 rounded-full bg-gradients-light" }),
871
+ /* @__PURE__ */ u("div", { className: "flex items-stretch overflow-hidden rounded", children: [
872
+ r ? /* @__PURE__ */ s("div", { className: "flex w-6 items-center justify-center", children: /* @__PURE__ */ s("span", { "aria-hidden": !0, className: "rounded p-1", children: /* @__PURE__ */ s(X, { size: 16 }) }) }) : null,
873
+ /* @__PURE__ */ u("div", { className: "flex min-w-0 flex-1 items-center gap-2 p-1", children: [
874
+ a ? /* @__PURE__ */ s(re, { id: e, checked: !!l, className: "p-0" }) : null,
875
+ /* @__PURE__ */ s("span", { className: "body-3 truncate", children: t })
823
876
  ] }),
824
- n ? /* @__PURE__ */ r("div", { className: "flex w-8 items-center justify-center", children: /* @__PURE__ */ r(
877
+ n ? /* @__PURE__ */ s("div", { className: "flex w-8 items-center justify-center", children: /* @__PURE__ */ s(
825
878
  "span",
826
879
  {
827
880
  "aria-hidden": !0,
828
- className: f(
881
+ className: p(
829
882
  "transition-transform",
830
- d ? "rotate-90" : "rotate-0"
883
+ c ? "rotate-90" : "rotate-0"
831
884
  ),
832
- children: /* @__PURE__ */ r(K, { size: 16 })
885
+ children: /* @__PURE__ */ s(Z, { size: 16 })
833
886
  }
834
887
  ) }) : null
835
888
  ] })
836
889
  ] });
837
890
  }
838
- function se(e, t) {
891
+ function ae(e, t) {
839
892
  return `i:${[...e, t].join("/")}`;
840
893
  }
841
- function G(e) {
894
+ function $(e) {
842
895
  if (!e.startsWith("i:")) return null;
843
896
  const n = e.slice(2).split("/").filter(Boolean);
844
897
  return n.length ? {
@@ -846,85 +899,85 @@ function G(e) {
846
899
  itemId: n[n.length - 1]
847
900
  } : null;
848
901
  }
849
- function Qe(e, t, n) {
850
- const s = ae(e, t);
851
- return s ? s.find((l) => l.id === n) ?? null : null;
902
+ function tt(e, t, n) {
903
+ const r = ie(e, t);
904
+ return r ? r.find((a) => a.id === n) ?? null : null;
852
905
  }
853
906
  function le(e, t) {
854
907
  if (t.length === 0) return e;
855
- const [n, ...s] = t, l = e.find((a) => a.id === n);
856
- return l?.items ? le(l.items, s) : null;
908
+ const [n, ...r] = t, a = e.find((l) => l.id === n);
909
+ return a?.items ? le(a.items, r) : null;
857
910
  }
858
- function ae(e, t) {
911
+ function ie(e, t) {
859
912
  const n = le(e, t);
860
913
  return n ? n.filter(
861
- (s) => s.type === "item"
914
+ (r) => r.type === "item"
862
915
  ) : null;
863
916
  }
864
- function ie(e, t, n) {
917
+ function oe(e, t, n) {
865
918
  if (t.length === 0)
866
919
  return n(e);
867
- const [s, ...l] = t;
868
- return e.map((a) => a.id !== s || !a.items ? a : {
869
- ...a,
870
- items: ie(a.items, l, n)
920
+ const [r, ...a] = t;
921
+ return e.map((l) => l.id !== r || !l.items ? l : {
922
+ ...l,
923
+ items: oe(l.items, a, n)
871
924
  });
872
925
  }
873
- function Ke({
926
+ function nt({
874
927
  parentPath: e,
875
928
  item: t,
876
929
  showDragHandle: n,
877
- showCheckbox: s,
878
- renderLabel: l,
879
- onItemClick: a,
880
- onToggleExpanded: d,
881
- onToggleChecked: u
930
+ showCheckbox: r,
931
+ renderLabel: a,
932
+ onItemClick: l,
933
+ onToggleExpanded: c,
934
+ onToggleChecked: i
882
935
  }) {
883
- const h = !!t.items?.length, m = !!t.isExpanded, p = t.isDisabled ? !1 : t.draggable ?? !0, g = t.isDisabled ? !1 : t.checkable ?? !0, C = se(e, t.id), {
884
- attributes: b,
885
- listeners: N,
886
- setNodeRef: x,
887
- setActivatorNodeRef: c,
888
- transform: i,
889
- transition: v,
890
- isDragging: k
891
- } = Oe({ id: C, disabled: !p }), S = {
892
- transform: Te.Transform.toString(i),
893
- transition: v,
894
- opacity: k ? 0.6 : void 0
895
- }, y = !!t.isDisabled, w = y || !g, D = [...e, t.id];
896
- return /* @__PURE__ */ o(
936
+ const m = !!t.items?.length, h = !!t.isExpanded, f = t.isDisabled ? !1 : t.draggable ?? !0, g = t.isDisabled ? !1 : t.checkable ?? !0, C = ae(e, t.id), {
937
+ attributes: N,
938
+ listeners: v,
939
+ setNodeRef: b,
940
+ setActivatorNodeRef: d,
941
+ transform: o,
942
+ transition: x,
943
+ isDragging: w
944
+ } = Me({ id: C, disabled: !f }), S = {
945
+ transform: je.Transform.toString(o),
946
+ transition: x,
947
+ opacity: w ? 0.6 : void 0
948
+ }, y = !!t.isDisabled, E = y || !g, D = [...e, t.id];
949
+ return /* @__PURE__ */ u(
897
950
  "div",
898
951
  {
899
- ref: x,
952
+ ref: b,
900
953
  style: S,
901
- className: f([
954
+ className: p([
902
955
  "group flex items-stretch overflow-hidden rounded bg-white",
903
956
  "select-none",
904
957
  y ? "opacity-50" : ""
905
958
  ]),
906
959
  children: [
907
- n ? /* @__PURE__ */ r(
960
+ n ? /* @__PURE__ */ s(
908
961
  "div",
909
962
  {
910
- className: f([
963
+ className: p([
911
964
  "group/drag-handle flex w-6 items-center justify-center rounded",
912
965
  y ? "" : "hover:bg-neutrals-100 cursor-grab"
913
966
  ]),
914
- children: /* @__PURE__ */ r(
967
+ children: /* @__PURE__ */ s(
915
968
  "span",
916
969
  {
917
- ref: c,
970
+ ref: d,
918
971
  "aria-hidden": !0,
919
- className: f([
972
+ className: p([
920
973
  "rounded p-1",
921
- p ? "cursor-grab" : "cursor-default",
974
+ f ? "cursor-grab" : "cursor-default",
922
975
  "transition-opacity"
923
976
  ]),
924
- ...p ? N : {},
925
- ...p ? b : {},
926
- children: /* @__PURE__ */ r(
927
- Q,
977
+ ...f ? v : {},
978
+ ...f ? N : {},
979
+ children: /* @__PURE__ */ s(
980
+ X,
928
981
  {
929
982
  size: 16,
930
983
  className: "text-neutrals-800 group-hover/drag-handle:text-primary"
@@ -934,72 +987,72 @@ function Ke({
934
987
  )
935
988
  }
936
989
  ) : null,
937
- /* @__PURE__ */ o(
990
+ /* @__PURE__ */ u(
938
991
  "button",
939
992
  {
940
993
  type: "button",
941
994
  disabled: y,
942
- "aria-disabled": w,
943
- onClick: (I) => {
944
- w || a?.({
995
+ "aria-disabled": E,
996
+ onClick: (k) => {
997
+ E || l?.({
945
998
  itemId: t.id,
946
999
  path: D,
947
- nativeEvent: I
1000
+ nativeEvent: k
948
1001
  });
949
1002
  },
950
- className: f([
1003
+ className: p([
951
1004
  "flex min-w-0 flex-1 items-center gap-2 p-1 text-left rounded",
952
1005
  y ? "" : "hover:bg-neutrals-100",
953
1006
  y ? "" : "hover:text-blue-700",
954
1007
  "focus:outline-none"
955
1008
  ]),
956
1009
  children: [
957
- s ? /* @__PURE__ */ r(
958
- ne,
1010
+ r ? /* @__PURE__ */ s(
1011
+ re,
959
1012
  {
960
1013
  id: `draggable-list-${D.join("-")}`,
961
1014
  checked: !!t.isChecked,
962
1015
  disabled: !g,
963
1016
  className: "p-0",
964
1017
  stopPropagation: !0,
965
- onChange: (I, E) => u?.({
1018
+ onChange: (k, I) => i?.({
966
1019
  itemId: t.id,
967
1020
  path: D,
968
- nextChecked: !!E
1021
+ nextChecked: !!I
969
1022
  })
970
1023
  }
971
1024
  ) : null,
972
- /* @__PURE__ */ r("span", { className: "body-3 truncate text-neutrals-800", children: l ? l(t) : t.label })
1025
+ /* @__PURE__ */ s("span", { className: "body-3 truncate text-neutrals-800", children: a ? a(t) : t.label })
973
1026
  ]
974
1027
  }
975
1028
  ),
976
- h ? /* @__PURE__ */ r(
1029
+ m ? /* @__PURE__ */ s(
977
1030
  "button",
978
1031
  {
979
1032
  type: "button",
980
1033
  disabled: y,
981
- onClick: (I) => {
982
- I.stopPropagation(), d?.({
1034
+ onClick: (k) => {
1035
+ k.stopPropagation(), c?.({
983
1036
  itemId: t.id,
984
1037
  path: D,
985
- nextExpanded: !m
1038
+ nextExpanded: !h
986
1039
  });
987
1040
  },
988
- "aria-label": m ? "Collapse" : "Expand",
989
- className: f([
1041
+ "aria-label": h ? "Collapse" : "Expand",
1042
+ className: p([
990
1043
  "flex w-8 items-center justify-center rounded",
991
1044
  y ? "" : "hover:bg-neutrals-100",
992
1045
  "focus:outline-none"
993
1046
  ]),
994
- children: /* @__PURE__ */ r(
1047
+ children: /* @__PURE__ */ s(
995
1048
  "span",
996
1049
  {
997
1050
  "aria-hidden": !0,
998
- className: f(
1051
+ className: p(
999
1052
  "transition-transform duration-150 ease-out",
1000
- m ? "rotate-90" : "rotate-0"
1053
+ h ? "rotate-90" : "rotate-0"
1001
1054
  ),
1002
- children: /* @__PURE__ */ r(K, { size: 16 })
1055
+ children: /* @__PURE__ */ s(Z, { size: 16 })
1003
1056
  }
1004
1057
  )
1005
1058
  }
@@ -1008,188 +1061,188 @@ function Ke({
1008
1061
  }
1009
1062
  );
1010
1063
  }
1011
- function Ft({
1064
+ function Pt({
1012
1065
  items: e,
1013
1066
  showDragHandle: t = !0,
1014
1067
  showCheckbox: n = !0,
1015
- onItemsChange: s,
1016
- onToggleExpanded: l,
1017
- onToggleChecked: a,
1018
- onItemClick: d,
1019
- renderLabel: u
1068
+ onItemsChange: r,
1069
+ onToggleExpanded: a,
1070
+ onToggleChecked: l,
1071
+ onItemClick: c,
1072
+ renderLabel: i
1020
1073
  }) {
1021
- const h = Ie(
1022
- ke(De, { activationConstraint: { distance: 6 } })
1023
- ), [m, p] = oe.useState(null), g = (N) => {
1024
- const x = String(N.active.id), c = G(x);
1025
- if (!c) return;
1026
- const i = Qe(e, c.parentPath, c.itemId);
1027
- !i || i.type !== "item" || p({
1028
- id: x,
1029
- label: i.label,
1030
- hasChildren: !!i.items?.length,
1031
- isChecked: i.isChecked,
1032
- isExpanded: i.isExpanded
1074
+ const m = Le(
1075
+ Oe(Fe, { activationConstraint: { distance: 6 } })
1076
+ ), [h, f] = de.useState(null), g = (v) => {
1077
+ const b = String(v.active.id), d = $(b);
1078
+ if (!d) return;
1079
+ const o = tt(e, d.parentPath, d.itemId);
1080
+ !o || o.type !== "item" || f({
1081
+ id: b,
1082
+ label: o.label,
1083
+ hasChildren: !!o.items?.length,
1084
+ isChecked: o.isChecked,
1085
+ isExpanded: o.isExpanded
1033
1086
  });
1034
- }, C = (N) => {
1035
- p(null);
1036
- const x = N.over;
1087
+ }, C = (v) => {
1088
+ f(null);
1089
+ const b = v.over;
1090
+ if (!b) return;
1091
+ const d = $(String(v.active.id)), o = $(String(b.id));
1092
+ if (!d || !o || d.parentPath.join("/") !== o.parentPath.join("/")) return;
1093
+ const x = ie(e, d.parentPath);
1037
1094
  if (!x) return;
1038
- const c = G(String(N.active.id)), i = G(String(x.id));
1039
- if (!c || !i || c.parentPath.join("/") !== i.parentPath.join("/")) return;
1040
- const v = ae(e, c.parentPath);
1041
- if (!v) return;
1042
- const k = v.findIndex((w) => w.id === c.itemId), S = v.findIndex((w) => w.id === i.itemId);
1043
- if (k === -1 || S === -1 || k === S) return;
1044
- const y = ie(e, c.parentPath, (w) => {
1045
- const D = w.filter(
1046
- (L) => L.type === "item"
1047
- ), I = Pe(D, k, S);
1048
- let E = 0;
1049
- return w.map((L) => {
1050
- if (L.type !== "item") return L;
1051
- const Y = I[E];
1052
- return E += 1, Y;
1095
+ const w = x.findIndex((E) => E.id === d.itemId), S = x.findIndex((E) => E.id === o.itemId);
1096
+ if (w === -1 || S === -1 || w === S) return;
1097
+ const y = oe(e, d.parentPath, (E) => {
1098
+ const D = E.filter(
1099
+ (R) => R.type === "item"
1100
+ ), k = Ye(D, w, S);
1101
+ let I = 0;
1102
+ return E.map((R) => {
1103
+ if (R.type !== "item") return R;
1104
+ const z = k[I];
1105
+ return I += 1, z;
1053
1106
  });
1054
1107
  });
1055
- s(y);
1056
- }, b = (N, x = []) => {
1057
- const c = N.filter((i) => i.type === "item").map((i) => se(x, i.id));
1058
- return /* @__PURE__ */ r(
1059
- _e,
1108
+ r(y);
1109
+ }, N = (v, b = []) => {
1110
+ const d = v.filter((o) => o.type === "item").map((o) => ae(b, o.id));
1111
+ return /* @__PURE__ */ s(
1112
+ Te,
1060
1113
  {
1061
- items: c,
1062
- strategy: Ae,
1063
- children: /* @__PURE__ */ r("ul", { className: "m-0 flex list-none flex-col gap-2 p-0", children: N.map((i) => i.type === "group" ? /* @__PURE__ */ o(
1114
+ items: d,
1115
+ strategy: Pe,
1116
+ children: /* @__PURE__ */ s("ul", { className: "m-0 flex list-none flex-col gap-2 p-0", children: v.map((o) => o.type === "group" ? /* @__PURE__ */ u(
1064
1117
  "li",
1065
1118
  {
1066
1119
  className: "m-0 mt-2 flex flex-col gap-2 p-0 first:mt-0",
1067
1120
  children: [
1068
- /* @__PURE__ */ o("div", { className: "h5 flex items-center gap-2 py-1 text-neutrals-1000", children: [
1069
- /* @__PURE__ */ r(fe, { size: 12, className: "shrink-0" }),
1070
- i.label
1121
+ /* @__PURE__ */ u("div", { className: "h5 flex items-center gap-2 py-1 text-neutrals-1000", children: [
1122
+ /* @__PURE__ */ s(ge, { size: 12, className: "shrink-0" }),
1123
+ o.label
1071
1124
  ] }),
1072
- /* @__PURE__ */ r("div", { className: "border-l border-neutrals-600 pl-2", children: b(i.items, [...x, i.id]) })
1125
+ /* @__PURE__ */ s("div", { className: "border-l border-neutrals-600 pl-2", children: N(o.items, [...b, o.id]) })
1073
1126
  ]
1074
1127
  },
1075
- i.id
1076
- ) : /* @__PURE__ */ o("li", { className: "m-0 flex flex-col gap-2 p-0", children: [
1077
- /* @__PURE__ */ r(
1078
- Ke,
1128
+ o.id
1129
+ ) : /* @__PURE__ */ u("li", { className: "m-0 flex flex-col gap-2 p-0", children: [
1130
+ /* @__PURE__ */ s(
1131
+ nt,
1079
1132
  {
1080
- parentPath: x,
1081
- item: i,
1133
+ parentPath: b,
1134
+ item: o,
1082
1135
  showDragHandle: t,
1083
1136
  showCheckbox: n,
1084
- renderLabel: u,
1085
- onItemClick: d,
1086
- onToggleExpanded: l,
1087
- onToggleChecked: a
1137
+ renderLabel: i,
1138
+ onItemClick: c,
1139
+ onToggleExpanded: a,
1140
+ onToggleChecked: l
1088
1141
  }
1089
1142
  ),
1090
- i.items?.length && i.isExpanded ? /* @__PURE__ */ r("div", { className: "pl-7", children: b(i.items, [...x, i.id]) }) : null
1091
- ] }, i.id)) })
1143
+ o.items?.length && o.isExpanded ? /* @__PURE__ */ s("div", { className: "pl-7", children: N(o.items, [...b, o.id]) }) : null
1144
+ ] }, o.id)) })
1092
1145
  }
1093
1146
  );
1094
1147
  };
1095
- return /* @__PURE__ */ o(
1148
+ return /* @__PURE__ */ u(
1096
1149
  Re,
1097
1150
  {
1098
- sensors: h,
1099
- collisionDetection: Le,
1151
+ sensors: m,
1152
+ collisionDetection: _e,
1100
1153
  onDragStart: g,
1101
1154
  onDragEnd: C,
1102
1155
  children: [
1103
- /* @__PURE__ */ r("div", { className: "flex flex-col", children: b(e) }),
1104
- /* @__PURE__ */ r(Fe, { children: m ? /* @__PURE__ */ r(
1105
- Ve,
1156
+ /* @__PURE__ */ s("div", { className: "flex flex-col", children: N(e) }),
1157
+ /* @__PURE__ */ s(Ae, { children: h ? /* @__PURE__ */ s(
1158
+ et,
1106
1159
  {
1107
- id: m.id,
1108
- label: m.label,
1109
- hasChildren: m.hasChildren,
1160
+ id: h.id,
1161
+ label: h.label,
1162
+ hasChildren: h.hasChildren,
1110
1163
  showDragHandle: t,
1111
1164
  showCheckbox: n,
1112
- isChecked: m.isChecked,
1113
- isExpanded: m.isExpanded
1165
+ isChecked: h.isChecked,
1166
+ isExpanded: h.isExpanded
1114
1167
  }
1115
1168
  ) : null })
1116
1169
  ]
1117
1170
  }
1118
1171
  );
1119
1172
  }
1120
- const Xe = (e, t) => e.label.toLowerCase().includes(t);
1121
- function Ot(e, t, n = {}) {
1122
- const s = Je(t);
1123
- if (!s)
1173
+ const rt = (e, t) => e.label.toLowerCase().includes(t);
1174
+ function Yt(e, t, n = {}) {
1175
+ const r = at(t);
1176
+ if (!r)
1124
1177
  return e;
1125
1178
  const {
1126
- expandMatchedBranches: l = !0,
1127
- includeGroupDescendantsOnMatch: a = !0,
1128
- includeItemDescendantsOnMatch: d = !1,
1129
- match: u = Xe
1179
+ expandMatchedBranches: a = !0,
1180
+ includeGroupDescendantsOnMatch: l = !0,
1181
+ includeItemDescendantsOnMatch: c = !1,
1182
+ match: i = rt
1130
1183
  } = n;
1131
- return $(e, s, {
1132
- expandMatchedBranches: l,
1133
- includeGroupDescendantsOnMatch: a,
1134
- includeItemDescendantsOnMatch: d,
1135
- match: u
1184
+ return B(e, r, {
1185
+ expandMatchedBranches: a,
1186
+ includeGroupDescendantsOnMatch: l,
1187
+ includeItemDescendantsOnMatch: c,
1188
+ match: i
1136
1189
  }) ?? [];
1137
1190
  }
1138
- function $(e, t, n) {
1139
- const s = [];
1140
- for (const l of e) {
1141
- const a = Ze(l, t, n);
1142
- a && s.push(a);
1191
+ function B(e, t, n) {
1192
+ const r = [];
1193
+ for (const a of e) {
1194
+ const l = st(a, t, n);
1195
+ l && r.push(l);
1143
1196
  }
1144
- return s.length ? s : null;
1197
+ return r.length ? r : null;
1145
1198
  }
1146
- function Ze(e, t, n) {
1147
- const s = n.match(e, t);
1199
+ function st(e, t, n) {
1200
+ const r = n.match(e, t);
1148
1201
  if (e.type === "group") {
1149
- if (s && n.includeGroupDescendantsOnMatch)
1150
- return T(e, n.expandMatchedBranches);
1151
- const d = e.items?.length ? $(e.items, t, n) : null;
1152
- return !s && !d ? null : {
1202
+ if (r && n.includeGroupDescendantsOnMatch)
1203
+ return Y(e, n.expandMatchedBranches);
1204
+ const c = e.items?.length ? B(e.items, t, n) : null;
1205
+ return !r && !c ? null : {
1153
1206
  ...e,
1154
- items: d ?? []
1207
+ items: c ?? []
1155
1208
  };
1156
1209
  }
1157
- const l = e.items?.length ? $(e.items, t, n) : null;
1158
- if (s && n.includeItemDescendantsOnMatch)
1159
- return T(e, n.expandMatchedBranches);
1160
- if (!s && !l)
1210
+ const a = e.items?.length ? B(e.items, t, n) : null;
1211
+ if (r && n.includeItemDescendantsOnMatch)
1212
+ return Y(e, n.expandMatchedBranches);
1213
+ if (!r && !a)
1161
1214
  return null;
1162
- const a = {
1215
+ const l = {
1163
1216
  ...e
1164
1217
  };
1165
- return l ? (a.items = l, n.expandMatchedBranches && (a.isExpanded = !0)) : delete a.items, a;
1218
+ return a ? (l.items = a, n.expandMatchedBranches && (l.isExpanded = !0)) : delete l.items, l;
1166
1219
  }
1167
- function T(e, t) {
1220
+ function Y(e, t) {
1168
1221
  return e.type === "group" ? {
1169
1222
  ...e,
1170
1223
  items: e.items.map(
1171
- (n) => T(n, t)
1224
+ (n) => Y(n, t)
1172
1225
  )
1173
1226
  } : {
1174
1227
  ...e,
1175
1228
  isExpanded: t && e.items?.length ? !0 : e.isExpanded,
1176
- items: e.items?.map((n) => T(n, t))
1229
+ items: e.items?.map((n) => Y(n, t))
1177
1230
  };
1178
1231
  }
1179
- function Je(e) {
1232
+ function at(e) {
1180
1233
  return e.trim().toLowerCase();
1181
1234
  }
1182
- var et = /* @__PURE__ */ ((e) => (e.Enter = "Enter", e))(et || {});
1183
- const ce = U(null);
1184
- function _t({
1235
+ var lt = /* @__PURE__ */ ((e) => (e.Enter = "Enter", e))(lt || {});
1236
+ const ce = Q(null);
1237
+ function jt({
1185
1238
  children: e,
1186
1239
  isAgentAvailable: t
1187
1240
  }) {
1188
- const n = W(() => ({ isAgentAvailable: t }), [t]);
1189
- return /* @__PURE__ */ r(ce.Provider, { value: n, children: e });
1241
+ const n = U(() => ({ isAgentAvailable: t }), [t]);
1242
+ return /* @__PURE__ */ s(ce.Provider, { value: n, children: e });
1190
1243
  }
1191
- function At() {
1192
- const e = V(ce);
1244
+ function zt() {
1245
+ const e = K(ce);
1193
1246
  if (!e)
1194
1247
  throw new Error(
1195
1248
  "useAgentAvailability must be used within AgentAvailabilityProvider"
@@ -1197,40 +1250,40 @@ function At() {
1197
1250
  return e;
1198
1251
  }
1199
1252
  export {
1200
- _t as AgentAvailabilityProvider,
1201
- mt as Alert,
1202
- F as AlertType,
1203
- je as Button,
1204
- Ge as CALENDAR_MOBILE_PADDING,
1205
- gt as Calendar,
1206
- ne as Checkbox,
1207
- te as CloseButton,
1208
- xt as CollapsibleBlock,
1209
- Lt as CopyButton,
1210
- It as DownloadFormatMessage,
1211
- Ft as DraggableList,
1212
- St as Dropdown,
1213
- bt as HighlightText,
1214
- Nt as IconButton,
1215
- Rt as InlineAlert,
1216
- Dt as InlineAlertProvider,
1217
- _ as InlineAlertType,
1218
- ze as Input,
1219
- Ct as InputWithIcon,
1220
- et as KeyboardKey,
1221
- vt as Link,
1222
- ee as Loader,
1223
- z as PopUpSize,
1224
- A as PopUpState,
1225
- Et as Popup,
1226
- wt as Radio,
1227
- kt as RequestLimitMessage,
1228
- q as SERIES_LIMIT,
1229
- ft as TREE_NODE_ARROW_SIZE,
1230
- pt as TREE_NODE_PADDING,
1231
- yt as Tag,
1232
- Ot as filterDraggableListNodes,
1233
- At as useAgentAvailability,
1234
- ht as useDebounce,
1235
- Ye as useIsMobile
1253
+ jt as AgentAvailabilityProvider,
1254
+ bt as Alert,
1255
+ _ as AlertType,
1256
+ Ge as Button,
1257
+ We as CALENDAR_MOBILE_PADDING,
1258
+ Ct as Calendar,
1259
+ re as Checkbox,
1260
+ ne as CloseButton,
1261
+ yt as CollapsibleBlock,
1262
+ Tt as CopyButton,
1263
+ Rt as DownloadFormatMessage,
1264
+ Pt as DraggableList,
1265
+ Ft as Dropdown,
1266
+ Et as HighlightText,
1267
+ It as IconButton,
1268
+ Mt as InlineAlert,
1269
+ At as InlineAlertProvider,
1270
+ M as InlineAlertType,
1271
+ Ue as Input,
1272
+ St as InputWithIcon,
1273
+ lt as KeyboardKey,
1274
+ kt as Link,
1275
+ He as Loader,
1276
+ G as PopUpSize,
1277
+ T as PopUpState,
1278
+ Ot as Popup,
1279
+ Lt as Radio,
1280
+ _t as RequestLimitMessage,
1281
+ V as SERIES_LIMIT,
1282
+ wt as TREE_NODE_ARROW_SIZE,
1283
+ vt as TREE_NODE_PADDING,
1284
+ Dt as Tag,
1285
+ Yt as filterDraggableListNodes,
1286
+ zt as useAgentAvailability,
1287
+ Nt as useDebounce,
1288
+ Be as useIsMobile
1236
1289
  };