dhx-react-suite 1.1.4 → 1.1.6

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.
@@ -1,5 +1,5 @@
1
- import { jsxs as x, jsx as t, Fragment as Ne } from "react/jsx-runtime";
2
- import { useEffect as F, useRef as U, useCallback as Z, useState as L, useMemo as ue, createContext as Pe, useContext as je } from "react";
1
+ import { jsxs as g, jsx as t, Fragment as Ne } from "react/jsx-runtime";
2
+ import { useEffect as K, useRef as U, useCallback as Z, useState as T, useMemo as ue, createContext as Pe, useContext as je } from "react";
3
3
  import { Tooltip as Oe, Legend as Ye, CartesianGrid as Fe, XAxis as Se, YAxis as we, BarChart as Ke, Bar as Ve, LineChart as _e, Line as Xe, AreaChart as qe, Area as Ge, PieChart as Je, Pie as Ue, Cell as Qe, RadarChart as Ze, PolarGrid as et, PolarAngleAxis as tt, PolarRadiusAxis as nt, Radar as rt, ScatterChart as ot, Scatter as it, ResponsiveContainer as lt, Treemap as st } from "recharts";
4
4
  const e = {
5
5
  primary: "#0288d1",
@@ -21,7 +21,7 @@ const e = {
21
21
  rMd: "8px",
22
22
  font: "'Segoe UI', system-ui, -apple-system, sans-serif"
23
23
  }, ze = "dhx-react-styles";
24
- function V() {
24
+ function _() {
25
25
  if (typeof document > "u" || document.getElementById(ze)) return;
26
26
  const n = document.createElement("style");
27
27
  n.id = ze, n.textContent = `
@@ -81,7 +81,7 @@ function Mt({
81
81
  style: h,
82
82
  className: d = ""
83
83
  }) {
84
- return F(V, []), /* @__PURE__ */ x(
84
+ return K(_, []), /* @__PURE__ */ g(
85
85
  "button",
86
86
  {
87
87
  className: `dhx dhx-btn dhx-btn-${i} ${d}`,
@@ -96,7 +96,7 @@ function Mt({
96
96
  );
97
97
  }
98
98
  function he(n, i) {
99
- F(() => {
99
+ K(() => {
100
100
  const p = (s) => {
101
101
  n.current && !n.current.contains(s.target) && i(s);
102
102
  };
@@ -121,13 +121,13 @@ function dt(n) {
121
121
  );
122
122
  }
123
123
  function fe({ items: n, onSelect: i, style: p }) {
124
- const [s, f] = L(null);
124
+ const [s, f] = T(null);
125
125
  return /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", top: "calc(100% + 4px)", left: 0, minWidth: 180, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, boxShadow: e.shadowLg, zIndex: 200, padding: "4px 0", ...p }, children: n.map((a, h) => {
126
126
  var y, w;
127
127
  if (a.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "4px 0" } }, h);
128
128
  const d = s === h;
129
- return /* @__PURE__ */ x("div", { style: { position: "relative" }, onMouseEnter: () => f(h), onMouseLeave: () => f(null), children: [
130
- /* @__PURE__ */ x(
129
+ return /* @__PURE__ */ g("div", { style: { position: "relative" }, onMouseEnter: () => f(h), onMouseLeave: () => f(null), children: [
130
+ /* @__PURE__ */ g(
131
131
  "div",
132
132
  {
133
133
  onClick: () => {
@@ -148,9 +148,9 @@ function fe({ items: n, onSelect: i, style: p }) {
148
148
  }) });
149
149
  }
150
150
  function $t({ items: n = [], label: i = "Menu", onSelect: p, style: s }) {
151
- const [f, a] = L(!1), h = U(null);
152
- return F(V, []), he(h, Z(() => a(!1), [])), /* @__PURE__ */ x("div", { ref: h, className: "dhx", style: { position: "relative", display: "inline-block", ...s }, children: [
153
- /* @__PURE__ */ x("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => a((d) => !d), children: [
151
+ const [f, a] = T(!1), h = U(null);
152
+ return K(_, []), he(h, Z(() => a(!1), [])), /* @__PURE__ */ g("div", { ref: h, className: "dhx", style: { position: "relative", display: "inline-block", ...s }, children: [
153
+ /* @__PURE__ */ g("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => a((d) => !d), children: [
154
154
  i,
155
155
  " ",
156
156
  /* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: f ? "▲" : "▼" })
@@ -161,8 +161,8 @@ function $t({ items: n = [], label: i = "Menu", onSelect: p, style: s }) {
161
161
  ] });
162
162
  }
163
163
  function Dt({ items: n = [], onSelect: i, children: p }) {
164
- const [s, f] = L(null), a = U(null);
165
- return F(V, []), he(a, Z(() => f(null), [])), /* @__PURE__ */ x("div", { ref: a, onContextMenu: (d) => {
164
+ const [s, f] = T(null), a = U(null);
165
+ return K(_, []), he(a, Z(() => f(null), [])), /* @__PURE__ */ g("div", { ref: a, onContextMenu: (d) => {
166
166
  d.preventDefault(), f({ x: d.clientX, y: d.clientY });
167
167
  }, style: { position: "relative", display: "contents" }, children: [
168
168
  p,
@@ -192,35 +192,35 @@ function Me({ count: n }) {
192
192
  }, children: n });
193
193
  }
194
194
  function Ct({ items: n = [], onAction: i, style: p }) {
195
- const [s, f] = L(null), [a, h] = L(() => {
195
+ const [s, f] = T(null), [a, h] = T(() => {
196
196
  const r = {};
197
197
  return n.forEach((l) => {
198
198
  l.id && (l.twoState || l.group) && l.active && (r[l.id] = !0);
199
199
  }), r;
200
200
  }), d = U(null);
201
- F(V, []), he(d, Z(() => f(null), []));
201
+ K(_, []), he(d, Z(() => f(null), []));
202
202
  const y = (r, l) => {
203
203
  var c, b;
204
204
  if (!r.disabled) {
205
- if (r.twoState && r.id && h((o) => ({ ...o, [r.id]: !o[r.id] })), r.group && r.id && h((o) => {
206
- const g = { ...o };
207
- return n.forEach((m) => {
208
- m.group === r.group && m.id && (g[m.id] = !1);
209
- }), g[r.id] = !0, g;
205
+ if (r.twoState && r.id && h((S) => ({ ...S, [r.id]: !S[r.id] })), r.group && r.id && h((S) => {
206
+ const o = { ...S };
207
+ return n.forEach((x) => {
208
+ x.group === r.group && x.id && (o[x.id] = !1);
209
+ }), o[r.id] = !0, o;
210
210
  }), (c = r.items) != null && c.length) {
211
- f((o) => o === l ? null : l);
211
+ f((S) => S === l ? null : l);
212
212
  return;
213
213
  }
214
214
  (b = r.onClick) == null || b.call(r, r.id || ""), i == null || i(r.id || "");
215
215
  }
216
216
  }, w = (r, l) => {
217
- var g, m;
217
+ var o, x;
218
218
  if (r.hidden) return null;
219
219
  if (r.type === "separator") return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "6px 4px", alignSelf: "stretch" } }, l);
220
220
  if (r.type === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, l);
221
- if (r.type === "input") return /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
221
+ if (r.type === "input") return /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
222
222
  r.label && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontWeight: 500 }, children: r.label }),
223
- /* @__PURE__ */ x("div", { style: { position: "relative", display: "flex", alignItems: "center" }, children: [
223
+ /* @__PURE__ */ g("div", { style: { position: "relative", display: "flex", alignItems: "center" }, children: [
224
224
  r.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 8, color: e.textMut, fontSize: 15, pointerEvents: "none", zIndex: 1 }, children: r.icon }),
225
225
  /* @__PURE__ */ t(
226
226
  "input",
@@ -229,15 +229,15 @@ function Ct({ items: n = [], onAction: i, style: p }) {
229
229
  style: { width: r.width || 140, height: 28, paddingLeft: r.icon ? 30 : void 0 },
230
230
  placeholder: r.placeholder,
231
231
  defaultValue: r.value,
232
- onChange: ($) => {
233
- var C;
234
- return (C = r.onChange) == null ? void 0 : C.call(r, $.target.value);
232
+ onChange: (k) => {
233
+ var $;
234
+ return ($ = r.onChange) == null ? void 0 : $.call(r, k.target.value);
235
235
  }
236
236
  }
237
237
  )
238
238
  ] })
239
239
  ] }, l);
240
- if (r.type === "select") return /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
240
+ if (r.type === "select") return /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
241
241
  r.label && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontWeight: 500 }, children: r.label }),
242
242
  /* @__PURE__ */ t(
243
243
  "select",
@@ -245,15 +245,15 @@ function Ct({ items: n = [], onAction: i, style: p }) {
245
245
  className: "dhx dhx-input",
246
246
  style: { width: r.width || 100, height: 28, cursor: "pointer" },
247
247
  defaultValue: r.value,
248
- onChange: ($) => {
249
- var C;
250
- return (C = r.onChange) == null ? void 0 : C.call(r, $.target.value);
248
+ onChange: (k) => {
249
+ var $;
250
+ return ($ = r.onChange) == null ? void 0 : $.call(r, k.target.value);
251
251
  },
252
- children: (g = r.options) == null ? void 0 : g.map(($) => /* @__PURE__ */ t("option", { value: $.value, children: $.label }, $.value))
252
+ children: (o = r.options) == null ? void 0 : o.map((k) => /* @__PURE__ */ t("option", { value: k.value, children: k.label }, k.value))
253
253
  }
254
254
  )
255
255
  ] }, l);
256
- if (r.type === "imageButton") return /* @__PURE__ */ x(
256
+ if (r.type === "imageButton") return /* @__PURE__ */ g(
257
257
  "button",
258
258
  {
259
259
  title: r.tooltip,
@@ -278,9 +278,9 @@ function Ct({ items: n = [], onAction: i, style: p }) {
278
278
  },
279
279
  l
280
280
  );
281
- const c = !!(r.id && a[r.id]), b = r.value ?? r.text, o = !!((m = r.items) != null && m.length);
282
- return /* @__PURE__ */ x("div", { style: { position: "relative" }, children: [
283
- /* @__PURE__ */ x(
281
+ const c = !!(r.id && a[r.id]), b = r.value ?? r.text, S = !!((x = r.items) != null && x.length);
282
+ return /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
283
+ /* @__PURE__ */ g(
284
284
  "button",
285
285
  {
286
286
  className: "dhx dhx-btn dhx-btn-ghost",
@@ -299,12 +299,12 @@ function Ct({ items: n = [], onAction: i, style: p }) {
299
299
  children: [
300
300
  r.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: r.icon }),
301
301
  b && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: b }),
302
- o && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
302
+ S && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
303
303
  r.count !== void 0 && /* @__PURE__ */ t(Me, { count: r.count })
304
304
  ]
305
305
  }
306
306
  ),
307
- o && s === l && /* @__PURE__ */ t(
307
+ S && s === l && /* @__PURE__ */ t(
308
308
  fe,
309
309
  {
310
310
  items: r.items,
@@ -335,45 +335,45 @@ function Ct({ items: n = [], onAction: i, style: p }) {
335
335
  );
336
336
  }
337
337
  function It({ items: n = [], width: i = 240, collapsed: p, onSelect: s, header: f, footer: a, style: h }) {
338
- const [d, y] = L(p ?? !1), [w, r] = L(null), [l, c] = L({});
339
- F(V, []);
340
- const b = d ? 56 : i, o = (m) => {
341
- r(m.id), s == null || s(m);
342
- }, g = (m, $ = 0) => {
338
+ const [d, y] = T(p ?? !1), [w, r] = T(null), [l, c] = T({});
339
+ K(_, []);
340
+ const b = d ? 56 : i, S = (x) => {
341
+ r(x.id), s == null || s(x);
342
+ }, o = (x, k = 0) => {
343
343
  var M;
344
- if (m.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "6px 8px" } }, m.id);
345
- if (m.type === "customHTML") return /* @__PURE__ */ t("div", { style: { padding: "8px 12px" }, dangerouslySetInnerHTML: { __html: m.html || "" } }, m.id);
346
- const C = (((M = m.items) == null ? void 0 : M.length) ?? 0) > 0, N = l[m.id], k = w === m.id;
347
- return /* @__PURE__ */ x("div", { children: [
348
- /* @__PURE__ */ x(
344
+ if (x.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "6px 8px" } }, x.id);
345
+ if (x.type === "customHTML") return /* @__PURE__ */ t("div", { style: { padding: "8px 12px" }, dangerouslySetInnerHTML: { __html: x.html || "" } }, x.id);
346
+ const $ = (((M = x.items) == null ? void 0 : M.length) ?? 0) > 0, L = l[x.id], m = w === x.id;
347
+ return /* @__PURE__ */ g("div", { children: [
348
+ /* @__PURE__ */ g(
349
349
  "div",
350
350
  {
351
351
  onClick: () => {
352
- C && c((W) => ({ ...W, [m.id]: !W[m.id] })), o(m);
352
+ $ && c((A) => ({ ...A, [x.id]: !A[x.id] })), S(x);
353
353
  },
354
- style: { display: "flex", alignItems: "center", gap: 10, padding: `8px ${d ? "0px" : `${12 + $ * 16}px`}`, cursor: "pointer", borderRadius: e.r, margin: "1px 6px", justifyContent: d ? "center" : "flex-start", transition: "all .15s", background: k ? e.primaryLt : "transparent", color: k ? e.primary : e.text, userSelect: "none" },
355
- onMouseEnter: (W) => !k && (W.currentTarget.style.background = e.bg),
356
- onMouseLeave: (W) => !k && (W.currentTarget.style.background = "transparent"),
354
+ style: { display: "flex", alignItems: "center", gap: 10, padding: `8px ${d ? "0px" : `${12 + k * 16}px`}`, cursor: "pointer", borderRadius: e.r, margin: "1px 6px", justifyContent: d ? "center" : "flex-start", transition: "all .15s", background: m ? e.primaryLt : "transparent", color: m ? e.primary : e.text, userSelect: "none" },
355
+ onMouseEnter: (A) => !m && (A.currentTarget.style.background = e.bg),
356
+ onMouseLeave: (A) => !m && (A.currentTarget.style.background = "transparent"),
357
357
  children: [
358
- m.icon && /* @__PURE__ */ t("span", { style: { fontSize: 18, minWidth: 22, textAlign: "center" }, children: m.icon }),
359
- !d && /* @__PURE__ */ t("span", { style: { flex: 1, fontSize: 13, fontWeight: k ? 600 : 400 }, children: m.value }),
360
- !d && m.count !== void 0 && /* @__PURE__ */ t("span", { style: { background: e.primary, color: "#fff", borderRadius: 10, padding: "1px 6px", fontSize: 11, fontWeight: 700 }, children: m.count }),
361
- !d && C && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textMut, transition: "transform .15s", transform: N ? "rotate(90deg)" : "rotate(0deg)" }, children: "▶" })
358
+ x.icon && /* @__PURE__ */ t("span", { style: { fontSize: 18, minWidth: 22, textAlign: "center" }, children: x.icon }),
359
+ !d && /* @__PURE__ */ t("span", { style: { flex: 1, fontSize: 13, fontWeight: m ? 600 : 400 }, children: x.value }),
360
+ !d && x.count !== void 0 && /* @__PURE__ */ t("span", { style: { background: e.primary, color: "#fff", borderRadius: 10, padding: "1px 6px", fontSize: 11, fontWeight: 700 }, children: x.count }),
361
+ !d && $ && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textMut, transition: "transform .15s", transform: L ? "rotate(90deg)" : "rotate(0deg)" }, children: "▶" })
362
362
  ]
363
363
  }
364
364
  ),
365
- C && N && !d && m.items.map((W) => g(W, $ + 1))
366
- ] }, m.id);
365
+ $ && L && !d && x.items.map((A) => o(A, k + 1))
366
+ ] }, x.id);
367
367
  };
368
- return /* @__PURE__ */ x("div", { className: "dhx", style: { width: b, minWidth: b, background: e.surface, borderRight: `1px solid ${e.border}`, display: "flex", flexDirection: "column", transition: "width .2s ease", overflow: "hidden", ...h }, children: [
368
+ return /* @__PURE__ */ g("div", { className: "dhx", style: { width: b, minWidth: b, background: e.surface, borderRight: `1px solid ${e.border}`, display: "flex", flexDirection: "column", transition: "width .2s ease", overflow: "hidden", ...h }, children: [
369
369
  f && !d && /* @__PURE__ */ t("div", { style: { padding: "12px 14px", borderBottom: `1px solid ${e.border}`, fontWeight: 700, fontSize: 15 }, children: f }),
370
- /* @__PURE__ */ t("button", { onClick: () => y((m) => !m), style: { margin: "8px 6px", background: "transparent", border: "none", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: d ? "center" : "flex-end", padding: "4px 6px", borderRadius: e.r, color: e.textSec }, children: /* @__PURE__ */ t("span", { style: { fontSize: 18 }, children: d ? "☰" : "✕" }) }),
371
- /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", overflowX: "hidden" }, children: n.map((m) => g(m)) }),
370
+ /* @__PURE__ */ t("button", { onClick: () => y((x) => !x), style: { margin: "8px 6px", background: "transparent", border: "none", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: d ? "center" : "flex-end", padding: "4px 6px", borderRadius: e.r, color: e.textSec }, children: /* @__PURE__ */ t("span", { style: { fontSize: 18 }, children: d ? "☰" : "✕" }) }),
371
+ /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", overflowX: "hidden" }, children: n.map((x) => o(x)) }),
372
372
  a && !d && /* @__PURE__ */ t("div", { style: { padding: "10px 14px", borderTop: `1px solid ${e.border}` }, children: a })
373
373
  ] });
374
374
  }
375
375
  function ct({ config: n }) {
376
- const [i, p] = L(!1), s = {
376
+ const [i, p] = T(!1), s = {
377
377
  position: "relative",
378
378
  background: e.surface,
379
379
  border: `1px solid ${e.border}`,
@@ -383,57 +383,57 @@ function ct({ config: n }) {
383
383
  ...n.height ? { height: n.height, minHeight: n.height } : { minHeight: 40 },
384
384
  ...i ? { flex: "0 0 auto" } : {}
385
385
  };
386
- return /* @__PURE__ */ x("div", { style: s, children: [
387
- n.header && /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", padding: "6px 12px", background: e.bg, borderBottom: `1px solid ${e.border}`, fontSize: 12, fontWeight: 600, color: e.textSec, userSelect: "none" }, children: [
386
+ return /* @__PURE__ */ g("div", { style: s, children: [
387
+ n.header && /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", padding: "6px 12px", background: e.bg, borderBottom: `1px solid ${e.border}`, fontSize: 12, fontWeight: 600, color: e.textSec, userSelect: "none" }, children: [
388
388
  /* @__PURE__ */ t("span", { children: n.header }),
389
389
  n.collapsable && /* @__PURE__ */ t("button", { onClick: () => p((f) => !f), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 16, lineHeight: 1 }, children: i ? "▼" : "▲" })
390
390
  ] }),
391
- !i && /* @__PURE__ */ x("div", { style: { padding: n.padding || 0, height: n.header ? "calc(100% - 33px)" : "100%", overflow: "auto" }, children: [
391
+ !i && /* @__PURE__ */ g("div", { style: { padding: n.padding || 0, height: n.header ? "calc(100% - 33px)" : "100%", overflow: "auto" }, children: [
392
392
  n.html ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: n.html } }) : n.content,
393
393
  (n.rows || n.cols) && /* @__PURE__ */ t(pt, { rows: n.rows, cols: n.cols, style: { height: "100%" } })
394
394
  ] })
395
395
  ] });
396
396
  }
397
397
  function pt({ rows: n, cols: i, type: p = "line", style: s, children: f }) {
398
- F(V, []);
398
+ K(_, []);
399
399
  const a = p === "space" ? 12 : p === "wide" ? 8 : 1, h = n || i, d = !!n;
400
400
  return h ? /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", flexDirection: d ? "column" : "row", gap: a, width: "100%", height: "100%", ...s }, children: h.map((y, w) => /* @__PURE__ */ t(ct, { config: y }, y.id || w)) }) : /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: "100%", ...s }, children: f });
401
401
  }
402
402
  function Lt({ views: n = [], mode: i = "top", tabAlign: p = "left", closable: s = [], disabled: f = [], defaultActive: a, onBeforeChange: h, onChange: d, style: y }) {
403
- var k;
404
- const [w, r] = L(a || ((k = n[0]) == null ? void 0 : k.id)), [l, c] = L(n.map((M) => M.id));
405
- F(V, []);
406
- const b = (M, W) => {
407
- M.stopPropagation(), c((u) => u.filter((I) => I !== W)), w === W && r(l.find((u) => u !== W) ?? "");
408
- }, o = (M) => {
403
+ var m;
404
+ const [w, r] = T(a || ((m = n[0]) == null ? void 0 : m.id)), [l, c] = T(n.map((M) => M.id));
405
+ K(_, []);
406
+ const b = (M, A) => {
407
+ M.stopPropagation(), c((u) => u.filter((I) => I !== A)), w === A && r(l.find((u) => u !== A) ?? "");
408
+ }, S = (M) => {
409
409
  f.includes(M) || h && h(M) === !1 || (r(M), d == null || d(M));
410
- }, g = i === "left" || i === "right", m = n.filter((M) => l.includes(M.id)), $ = /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: g ? "column" : "row", justifyContent: p === "center" ? "center" : p === "right" ? "flex-end" : "flex-start", background: e.surface, borderBottom: !g && i !== "bottom" ? `2px solid ${e.border}` : "none", borderTop: i === "bottom" ? `2px solid ${e.border}` : "none", borderRight: i === "left" ? `2px solid ${e.border}` : "none", borderLeft: i === "right" ? `2px solid ${e.border}` : "none", overflowX: "auto", flexShrink: 0 }, children: m.map((M) => {
411
- const W = w === M.id, u = f.includes(M.id), I = i === "bottom" ? { borderTop: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 } : g ? { color: e.primary, fontWeight: 600, background: e.primaryLt, [i === "left" ? "borderRight" : "borderLeft"]: `2px solid ${e.primary}` } : { borderBottom: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 };
412
- return /* @__PURE__ */ x(
410
+ }, o = i === "left" || i === "right", x = n.filter((M) => l.includes(M.id)), k = /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: o ? "column" : "row", justifyContent: p === "center" ? "center" : p === "right" ? "flex-end" : "flex-start", background: e.surface, borderBottom: !o && i !== "bottom" ? `2px solid ${e.border}` : "none", borderTop: i === "bottom" ? `2px solid ${e.border}` : "none", borderRight: i === "left" ? `2px solid ${e.border}` : "none", borderLeft: i === "right" ? `2px solid ${e.border}` : "none", overflowX: "auto", flexShrink: 0 }, children: x.map((M) => {
411
+ const A = w === M.id, u = f.includes(M.id), I = i === "bottom" ? { borderTop: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 } : o ? { color: e.primary, fontWeight: 600, background: e.primaryLt, [i === "left" ? "borderRight" : "borderLeft"]: `2px solid ${e.primary}` } : { borderBottom: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 };
412
+ return /* @__PURE__ */ g(
413
413
  "div",
414
414
  {
415
- onClick: () => o(M.id),
416
- style: { display: "flex", alignItems: "center", gap: 6, padding: "10px 16px", cursor: u ? "not-allowed" : "pointer", whiteSpace: "nowrap", fontSize: 13, transition: "color .15s", userSelect: "none", minWidth: g ? 120 : "auto", ...W ? I : { color: u ? e.textMut : e.textSec } },
415
+ onClick: () => S(M.id),
416
+ style: { display: "flex", alignItems: "center", gap: 6, padding: "10px 16px", cursor: u ? "not-allowed" : "pointer", whiteSpace: "nowrap", fontSize: 13, transition: "color .15s", userSelect: "none", minWidth: o ? 120 : "auto", ...A ? I : { color: u ? e.textMut : e.textSec } },
417
417
  children: [
418
418
  M.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: M.icon }),
419
419
  /* @__PURE__ */ t("span", { children: M.tab }),
420
- s.includes(M.id) && /* @__PURE__ */ t("span", { onClick: (v) => b(v, M.id), style: { marginLeft: 4, opacity: 0.6, fontSize: 12, cursor: "pointer" }, children: "✕" })
420
+ s.includes(M.id) && /* @__PURE__ */ t("span", { onClick: (R) => b(R, M.id), style: { marginLeft: 4, opacity: 0.6, fontSize: 12, cursor: "pointer" }, children: "✕" })
421
421
  ]
422
422
  },
423
423
  M.id
424
424
  );
425
- }) }), C = m.find((M) => M.id === w), N = /* @__PURE__ */ x("div", { className: "dhx-scroll", style: { flex: 1, overflow: "auto" }, children: [
426
- C == null ? void 0 : C.content,
427
- (C == null ? void 0 : C.html) && /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: C.html }, style: { padding: 16 } })
425
+ }) }), $ = x.find((M) => M.id === w), L = /* @__PURE__ */ g("div", { className: "dhx-scroll", style: { flex: 1, overflow: "auto" }, children: [
426
+ $ == null ? void 0 : $.content,
427
+ ($ == null ? void 0 : $.html) && /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: $.html }, style: { padding: 16 } })
428
428
  ] });
429
- return /* @__PURE__ */ x("div", { className: "dhx", style: { display: "flex", flexDirection: i === "top" ? "column" : i === "bottom" ? "column-reverse" : i === "left" ? "row" : "row-reverse", width: "100%", height: "100%", background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden", ...y }, children: [
430
- $,
431
- N
429
+ return /* @__PURE__ */ g("div", { className: "dhx", style: { display: "flex", flexDirection: i === "top" ? "column" : i === "bottom" ? "column-reverse" : i === "left" ? "row" : "row-reverse", width: "100%", height: "100%", background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden", ...y }, children: [
430
+ k,
431
+ L
432
432
  ] });
433
433
  }
434
434
  const se = `1px solid ${e.border}`;
435
435
  function ut({ active: n, dir: i }) {
436
- return /* @__PURE__ */ x("span", { style: { display: "inline-flex", flexDirection: "column", gap: 1, flexShrink: 0, marginLeft: 4 }, children: [
436
+ return /* @__PURE__ */ g("span", { style: { display: "inline-flex", flexDirection: "column", gap: 1, flexShrink: 0, marginLeft: 4 }, children: [
437
437
  /* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 0L7 4H0z", fill: n && i === "asc" ? e.primary : e.borderDk }) }),
438
438
  /* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 4L0 0H7z", fill: n && i === "desc" ? e.primary : e.borderDk }) })
439
439
  ] });
@@ -453,101 +453,101 @@ function Tt({
453
453
  multiselect: l,
454
454
  onSelect: c,
455
455
  onChange: b,
456
- style: o
456
+ style: S
457
457
  }) {
458
- const [g, m] = L(null), [$, C] = L("asc"), [N, k] = L({}), [M, W] = L(/* @__PURE__ */ new Set()), [u, I] = L(-1), [v, H] = L(() => n.map((S) => S.width ?? S.minWidth ?? 150)), [_, G] = L(null), [Q, re] = L(""), [ee, T] = L({}), z = U(null), [A, P] = L(0);
459
- F(V, []), F(() => {
458
+ const [o, x] = T(null), [k, $] = T("asc"), [L, m] = T({}), [M, A] = T(/* @__PURE__ */ new Set()), [u, I] = T(-1), [R, C] = T(() => n.map((v) => v.width ?? v.minWidth ?? 150)), [P, q] = T(null), [Q, ee] = T(""), [te, N] = T({}), z = U(null), [B, j] = T(0);
459
+ K(_, []), K(() => {
460
460
  if (!y || !z.current) return;
461
- const S = new ResizeObserver(() => {
461
+ const v = new ResizeObserver(() => {
462
462
  var D;
463
- return P(((D = z.current) == null ? void 0 : D.offsetWidth) ?? 0);
463
+ return j(((D = z.current) == null ? void 0 : D.offsetWidth) ?? 0);
464
464
  });
465
- return S.observe(z.current), () => S.disconnect();
465
+ return v.observe(z.current), () => v.disconnect();
466
466
  }, [y]);
467
- const O = ue(() => {
468
- if (!y || A === 0) return v;
469
- const S = v.reduce((E, R) => E + R, 0);
470
- if (A <= S) return v;
471
- const D = (A - S) / n.length;
472
- return v.map((E) => E + D);
473
- }, [y, A, v, n.length]), j = ue(() => {
474
- let S = i.map((D, E) => {
475
- const R = String(D.id ?? E);
476
- return ee[R] ? { ...D, ...ee[R] } : D;
467
+ const Y = ue(() => {
468
+ if (!y || B === 0) return R;
469
+ const v = R.reduce((W, E) => W + E, 0);
470
+ if (B <= v) return R;
471
+ const D = (B - v) / n.length;
472
+ return R.map((W) => W + D);
473
+ }, [y, B, R, n.length]), O = ue(() => {
474
+ let v = i.map((D, W) => {
475
+ const E = String(D.id ?? W);
476
+ return te[E] ? { ...D, ...te[E] } : D;
477
477
  }).filter(
478
- (D) => Object.entries(N).every(([E, R]) => !R || String(D[E] ?? "").toLowerCase().includes(R.toLowerCase()))
478
+ (D) => Object.entries(L).every(([W, E]) => !E || String(D[W] ?? "").toLowerCase().includes(E.toLowerCase()))
479
479
  );
480
- return g && (S = [...S].sort((D, E) => {
481
- const R = D[g], K = E[g];
482
- if (R == null) return 1;
483
- if (K == null) return -1;
484
- const Y = R < K ? -1 : R > K ? 1 : 0;
485
- return $ === "asc" ? Y : -Y;
486
- })), S;
487
- }, [i, g, $, N, ee]), J = ue(() => {
488
- const S = {};
480
+ return o && (v = [...v].sort((D, W) => {
481
+ const E = D[o], V = W[o];
482
+ if (E == null) return 1;
483
+ if (V == null) return -1;
484
+ const F = E < V ? -1 : E > V ? 1 : 0;
485
+ return k === "asc" ? F : -F;
486
+ })), v;
487
+ }, [i, o, k, L, te]), J = ue(() => {
488
+ const v = {};
489
489
  return n.forEach((D) => {
490
- var E;
491
- if ((E = D.footer) != null && E.some((R) => R.summary)) {
492
- const R = j.map((Y) => Number(Y[D.id])).filter((Y) => !isNaN(Y)), K = R.reduce((Y, de) => Y + de, 0);
493
- S[D.id] = { sum: K, avg: R.length ? K / R.length : 0, count: j.length, min: R.length ? Math.min(...R) : 0, max: R.length ? Math.max(...R) : 0 };
490
+ var W;
491
+ if ((W = D.footer) != null && W.some((E) => E.summary)) {
492
+ const E = O.map((F) => Number(F[D.id])).filter((F) => !isNaN(F)), V = E.reduce((F, de) => F + de, 0);
493
+ v[D.id] = { sum: V, avg: E.length ? V / E.length : 0, count: O.length, min: E.length ? Math.min(...E) : 0, max: E.length ? Math.max(...E) : 0 };
494
494
  }
495
- }), S;
496
- }, [j, n]), X = ue(() => {
497
- const S = {};
495
+ }), v;
496
+ }, [O, n]), X = ue(() => {
497
+ const v = {};
498
498
  return n.filter((D) => D.filterType === "select").forEach((D) => {
499
- S[D.id] = [...new Set(i.map((E) => String(E[D.id] ?? "")))].sort();
500
- }), S;
501
- }, [i, n]), oe = n.some((S) => S.filterable), te = n.some((S) => {
499
+ v[D.id] = [...new Set(i.map((W) => String(W[D.id] ?? "")))].sort();
500
+ }), v;
501
+ }, [i, n]), oe = n.some((v) => v.filterable), ne = n.some((v) => {
502
502
  var D;
503
- return (D = S.footer) == null ? void 0 : D.length;
504
- }), ie = O.reduce((S, D) => S + D, 0), le = (S, D) => S.id ?? D, ae = (S) => {
505
- !f || S.sortable === !1 || (C((D) => g === S.id && D === "asc" ? "desc" : "asc"), m(S.id));
506
- }, B = (S, D) => {
503
+ return (D = v.footer) == null ? void 0 : D.length;
504
+ }), ie = Y.reduce((v, D) => v + D, 0), le = (v, D) => v.id ?? D, ae = (v) => {
505
+ !f || v.sortable === !1 || ($((D) => o === v.id && D === "asc" ? "desc" : "asc"), x(v.id));
506
+ }, H = (v, D) => {
507
507
  if (!r) return;
508
- const E = le(S, D);
509
- I(D), W((R) => {
510
- const K = l ? new Set(R) : /* @__PURE__ */ new Set();
511
- return K.has(E) ? K.delete(E) : K.add(E), K;
512
- }), c == null || c(S);
513
- }, ne = () => {
514
- if (!_) return;
515
- const { key: S, colId: D } = _;
516
- T((R) => ({ ...R, [String(S)]: { ...R[String(S)] || {}, [D]: Q } }));
517
- const E = j.find((R, K) => le(R, K) === S);
518
- E && (b == null || b(E, D, Q)), G(null);
519
- }, Ae = (S) => {
520
- if (_ && S.key === "Escape") {
521
- G(null);
508
+ const W = le(v, D);
509
+ I(D), A((E) => {
510
+ const V = l ? new Set(E) : /* @__PURE__ */ new Set();
511
+ return V.has(W) ? V.delete(W) : V.add(W), V;
512
+ }), c == null || c(v);
513
+ }, re = () => {
514
+ if (!P) return;
515
+ const { key: v, colId: D } = P;
516
+ N((E) => ({ ...E, [String(v)]: { ...E[String(v)] || {}, [D]: Q } }));
517
+ const W = O.find((E, V) => le(E, V) === v);
518
+ W && (b == null || b(W, D, Q)), q(null);
519
+ }, Ae = (v) => {
520
+ if (P && v.key === "Escape") {
521
+ q(null);
522
522
  return;
523
523
  }
524
524
  if (!(!w || !r)) {
525
- if (S.key === "ArrowDown") {
526
- S.preventDefault();
527
- const D = Math.min(u + 1, j.length - 1);
528
- D >= 0 && B(j[D], D);
529
- } else if (S.key === "ArrowUp") {
530
- S.preventDefault();
525
+ if (v.key === "ArrowDown") {
526
+ v.preventDefault();
527
+ const D = Math.min(u + 1, O.length - 1);
528
+ D >= 0 && H(O[D], D);
529
+ } else if (v.key === "ArrowUp") {
530
+ v.preventDefault();
531
531
  const D = Math.max(u - 1, 0);
532
- D >= 0 && B(j[D], D);
532
+ D >= 0 && H(O[D], D);
533
533
  }
534
534
  }
535
- }, Be = (S, D) => {
536
- S.preventDefault(), S.stopPropagation();
537
- const E = S.clientX, R = v[D], K = (de) => H((ge) => {
535
+ }, Be = (v, D) => {
536
+ v.preventDefault(), v.stopPropagation();
537
+ const W = v.clientX, E = R[D], V = (de) => C((ge) => {
538
538
  const ce = [...ge];
539
- return ce[D] = Math.max(n[D].minWidth || 50, R + de.clientX - E), ce;
540
- }), Y = () => {
541
- document.removeEventListener("mousemove", K), document.removeEventListener("mouseup", Y);
539
+ return ce[D] = Math.max(n[D].minWidth || 50, E + de.clientX - W), ce;
540
+ }), F = () => {
541
+ document.removeEventListener("mousemove", V), document.removeEventListener("mouseup", F);
542
542
  };
543
- document.addEventListener("mousemove", K), document.addEventListener("mouseup", Y);
544
- }, xe = (S, D, E, R) => ({
545
- width: S,
546
- minWidth: S,
543
+ document.addEventListener("mousemove", V), document.addEventListener("mouseup", F);
544
+ }, xe = (v, D, W, E) => ({
545
+ width: v,
546
+ minWidth: v,
547
547
  flexShrink: 0,
548
548
  boxSizing: "border-box",
549
549
  padding: "0 12px",
550
- height: R,
550
+ height: E,
551
551
  display: "flex",
552
552
  alignItems: "center",
553
553
  overflow: "hidden",
@@ -556,7 +556,7 @@ function Tt({
556
556
  fontSize: 13,
557
557
  textAlign: D.align,
558
558
  justifyContent: D.align === "center" ? "center" : D.align === "right" ? "flex-end" : "flex-start",
559
- borderLeft: E ? "none" : se
559
+ borderLeft: W ? "none" : se
560
560
  });
561
561
  return /* @__PURE__ */ t(
562
562
  "div",
@@ -565,115 +565,115 @@ function Tt({
565
565
  className: "dhx",
566
566
  tabIndex: w ? 0 : void 0,
567
567
  onKeyDown: Ae,
568
- style: { width: "100%", height: p, display: "flex", flexDirection: "column", border: se, borderRadius: e.r, overflow: "hidden", outline: "none", ...o },
569
- children: /* @__PURE__ */ t("div", { style: { overflowX: "auto", flex: 1, display: "flex", flexDirection: "column", minHeight: 0 }, children: /* @__PURE__ */ x("div", { style: { minWidth: ie, display: "flex", flexDirection: "column", height: "100%" }, children: [
570
- /* @__PURE__ */ t("div", { style: { display: "flex", background: e.bg, borderBottom: se, flexShrink: 0, position: "sticky", top: 0, zIndex: 2 }, children: n.map((S, D) => {
571
- var E;
572
- return /* @__PURE__ */ x(
568
+ style: { width: "100%", height: p, display: "flex", flexDirection: "column", border: se, borderRadius: e.r, overflow: "hidden", outline: "none", ...S },
569
+ children: /* @__PURE__ */ t("div", { style: { overflowX: "auto", flex: 1, display: "flex", flexDirection: "column", minHeight: 0 }, children: /* @__PURE__ */ g("div", { style: { minWidth: ie, display: "flex", flexDirection: "column", height: "100%" }, children: [
570
+ /* @__PURE__ */ t("div", { style: { display: "flex", background: e.bg, borderBottom: se, flexShrink: 0, position: "sticky", top: 0, zIndex: 2 }, children: n.map((v, D) => {
571
+ var W;
572
+ return /* @__PURE__ */ g(
573
573
  "div",
574
574
  {
575
- onClick: () => ae(S),
575
+ onClick: () => ae(v),
576
576
  style: {
577
- ...xe(O[D], S, D === 0, 40),
577
+ ...xe(Y[D], v, D === 0, 40),
578
578
  position: "relative",
579
579
  fontWeight: 500,
580
580
  color: e.text,
581
- cursor: f && S.sortable !== !1 ? "pointer" : "default",
581
+ cursor: f && v.sortable !== !1 ? "pointer" : "default",
582
582
  userSelect: "none"
583
583
  },
584
584
  children: [
585
- /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: Array.isArray(S.header) ? (E = S.header[0]) == null ? void 0 : E.text : S.header || S.id }),
586
- f && S.sortable !== !1 && /* @__PURE__ */ t(ut, { active: g === S.id, dir: $ }),
587
- a && S.resizable !== !1 && D < n.length - 1 && /* @__PURE__ */ t(
585
+ /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: Array.isArray(v.header) ? (W = v.header[0]) == null ? void 0 : W.text : v.header || v.id }),
586
+ f && v.sortable !== !1 && /* @__PURE__ */ t(ut, { active: o === v.id, dir: k }),
587
+ a && v.resizable !== !1 && D < n.length - 1 && /* @__PURE__ */ t(
588
588
  "div",
589
589
  {
590
- onMouseDown: (R) => Be(R, D),
591
- onClick: (R) => R.stopPropagation(),
590
+ onMouseDown: (E) => Be(E, D),
591
+ onClick: (E) => E.stopPropagation(),
592
592
  style: { position: "absolute", right: 0, top: 0, bottom: 0, width: 4, cursor: "col-resize", zIndex: 1 },
593
- onMouseEnter: (R) => R.currentTarget.style.background = e.primary + "55",
594
- onMouseLeave: (R) => R.currentTarget.style.background = "transparent"
593
+ onMouseEnter: (E) => E.currentTarget.style.background = e.primary + "55",
594
+ onMouseLeave: (E) => E.currentTarget.style.background = "transparent"
595
595
  }
596
596
  )
597
597
  ]
598
598
  },
599
- S.id
599
+ v.id
600
600
  );
601
601
  }) }),
602
- oe && /* @__PURE__ */ t("div", { style: { display: "flex", borderBottom: se, background: e.surface, flexShrink: 0 }, children: n.map((S, D) => /* @__PURE__ */ t("div", { style: { width: O[D], minWidth: O[D], flexShrink: 0, padding: "4px 6px", boxSizing: "border-box", borderLeft: D === 0 ? "none" : se }, children: S.filterable && S.filterType === "select" ? /* @__PURE__ */ x(
602
+ oe && /* @__PURE__ */ t("div", { style: { display: "flex", borderBottom: se, background: e.surface, flexShrink: 0 }, children: n.map((v, D) => /* @__PURE__ */ t("div", { style: { width: Y[D], minWidth: Y[D], flexShrink: 0, padding: "4px 6px", boxSizing: "border-box", borderLeft: D === 0 ? "none" : se }, children: v.filterable && v.filterType === "select" ? /* @__PURE__ */ g(
603
603
  "select",
604
604
  {
605
605
  className: "dhx dhx-input",
606
606
  style: { height: 26, fontSize: 12, padding: "0 4px" },
607
- value: N[S.id] || "",
608
- onChange: (E) => k((R) => ({ ...R, [S.id]: E.target.value })),
607
+ value: L[v.id] || "",
608
+ onChange: (W) => m((E) => ({ ...E, [v.id]: W.target.value })),
609
609
  children: [
610
610
  /* @__PURE__ */ t("option", { value: "", children: "All" }),
611
- (X[S.id] || []).map((E) => /* @__PURE__ */ t("option", { value: E, children: E }, E))
611
+ (X[v.id] || []).map((W) => /* @__PURE__ */ t("option", { value: W, children: W }, W))
612
612
  ]
613
613
  }
614
- ) : S.filterable ? /* @__PURE__ */ t(
614
+ ) : v.filterable ? /* @__PURE__ */ t(
615
615
  "input",
616
616
  {
617
617
  className: "dhx dhx-input",
618
618
  style: { height: 26, fontSize: 12 },
619
619
  placeholder: "Filter...",
620
- value: N[S.id] || "",
621
- onChange: (E) => k((R) => ({ ...R, [S.id]: E.target.value }))
620
+ value: L[v.id] || "",
621
+ onChange: (W) => m((E) => ({ ...E, [v.id]: W.target.value }))
622
622
  }
623
- ) : null }, S.id)) }),
624
- /* @__PURE__ */ x("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: [
625
- j.map((S, D) => {
626
- const E = le(S, D), R = M.has(E), K = R ? e.primaryLt : d && D % 2 !== 0 ? e.bg : e.surface;
623
+ ) : null }, v.id)) }),
624
+ /* @__PURE__ */ g("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: [
625
+ O.map((v, D) => {
626
+ const W = le(v, D), E = M.has(W), V = E ? e.primaryLt : d && D % 2 !== 0 ? e.bg : e.surface;
627
627
  return /* @__PURE__ */ t(
628
628
  "div",
629
629
  {
630
- style: { display: "flex", height: s, borderBottom: se, flexShrink: 0, background: K, transition: "background .1s", cursor: r ? "pointer" : "default" },
631
- onMouseEnter: (Y) => !R && (Y.currentTarget.style.background = e.primaryLt + "80"),
632
- onMouseLeave: (Y) => !R && (Y.currentTarget.style.background = K),
633
- children: n.map((Y, de) => {
634
- const ge = (_ == null ? void 0 : _.key) === E && (_ == null ? void 0 : _.colId) === Y.id, ce = S[Y.id], He = Y.template ? Y.template(ce, S) : String(ce ?? "");
630
+ style: { display: "flex", height: s, borderBottom: se, flexShrink: 0, background: V, transition: "background .1s", cursor: r ? "pointer" : "default" },
631
+ onMouseEnter: (F) => !E && (F.currentTarget.style.background = e.primaryLt + "80"),
632
+ onMouseLeave: (F) => !E && (F.currentTarget.style.background = V),
633
+ children: n.map((F, de) => {
634
+ const ge = (P == null ? void 0 : P.key) === W && (P == null ? void 0 : P.colId) === F.id, ce = v[F.id], He = F.template ? F.template(ce, v) : String(ce ?? "");
635
635
  return /* @__PURE__ */ t(
636
636
  "div",
637
637
  {
638
638
  onClick: () => {
639
- B(S, D), h && Y.editable !== !1 && (G({ key: E, colId: Y.id }), re(String(ce ?? "")));
639
+ H(v, D), h && F.editable !== !1 && (q({ key: W, colId: F.id }), ee(String(ce ?? "")));
640
640
  },
641
- style: xe(O[de], Y, de === 0, s),
641
+ style: xe(Y[de], F, de === 0, s),
642
642
  children: ge ? /* @__PURE__ */ t(
643
643
  "input",
644
644
  {
645
645
  autoFocus: !0,
646
646
  value: Q,
647
- onChange: (pe) => re(pe.target.value),
648
- onBlur: ne,
647
+ onChange: (pe) => ee(pe.target.value),
648
+ onBlur: re,
649
649
  onKeyDown: (pe) => {
650
- pe.key === "Enter" && ne(), pe.key === "Escape" && G(null);
650
+ pe.key === "Enter" && re(), pe.key === "Escape" && q(null);
651
651
  },
652
652
  onClick: (pe) => pe.stopPropagation(),
653
653
  style: { width: "100%", border: "none", outline: `2px solid ${e.primary}`, borderRadius: 2, fontSize: 13, padding: "2px 4px", background: e.surface, color: e.text }
654
654
  }
655
655
  ) : He
656
656
  },
657
- Y.id
657
+ F.id
658
658
  );
659
659
  })
660
660
  },
661
- String(E)
661
+ String(W)
662
662
  );
663
663
  }),
664
- j.length === 0 && /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: 40, color: e.textMut, fontSize: 13 }, children: "No data" })
664
+ O.length === 0 && /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: 40, color: e.textMut, fontSize: 13 }, children: "No data" })
665
665
  ] }),
666
- te && /* @__PURE__ */ t("div", { style: { display: "flex", borderTop: se, background: e.bg, flexShrink: 0 }, children: n.map((S, D) => {
667
- var Y;
668
- const E = (Y = S.footer) == null ? void 0 : Y[0], R = J[S.id] ?? { sum: 0, avg: 0, count: 0, min: 0, max: 0 };
669
- let K = "";
670
- return E && (typeof E.text == "function" ? K = E.text(R) : E.text ? K = E.text : E.summary && (K = String(Math.round(R[E.summary] * 100) / 100))), /* @__PURE__ */ t("div", { style: { ...xe(O[D], S, D === 0, 40), fontWeight: 600, color: e.text }, children: K }, S.id);
666
+ ne && /* @__PURE__ */ t("div", { style: { display: "flex", borderTop: se, background: e.bg, flexShrink: 0 }, children: n.map((v, D) => {
667
+ var F;
668
+ const W = (F = v.footer) == null ? void 0 : F[0], E = J[v.id] ?? { sum: 0, avg: 0, count: 0, min: 0, max: 0 };
669
+ let V = "";
670
+ return W && (typeof W.text == "function" ? V = W.text(E) : W.text ? V = W.text : W.summary && (V = String(Math.round(E[W.summary] * 100) / 100))), /* @__PURE__ */ t("div", { style: { ...xe(Y[D], v, D === 0, 40), fontWeight: 600, color: e.text }, children: V }, v.id);
671
671
  }) })
672
672
  ] }) })
673
673
  }
674
674
  );
675
675
  }
676
- const q = ["#0288d1", "#43a047", "#f57c00", "#e53935", "#8e24aa", "#00838f", "#ef6c00", "#2e7d32"];
676
+ const G = ["#0288d1", "#43a047", "#f57c00", "#e53935", "#8e24aa", "#00838f", "#ef6c00", "#2e7d32"];
677
677
  function ht(n, i, p) {
678
678
  const s = n.filter((a) => !a.parent), f = n.filter((a) => !!a.parent);
679
679
  return s.map((a) => ({
@@ -690,9 +690,9 @@ function Nt({
690
690
  height: a = 280,
691
691
  style: h
692
692
  }) {
693
- var m, $, C, N, k, M, W, u, I, v, H, _, G, Q, re, ee;
694
- F(V, []);
695
- const d = ((m = s.bottom) == null ? void 0 : m.text) || i[0] && Object.keys(i[0])[0] || "x", y = /* @__PURE__ */ t(
693
+ var x, k, $, L, m, M, A, u, I, R, C, P, q, Q, ee, te;
694
+ K(_, []);
695
+ const d = ((x = s.bottom) == null ? void 0 : x.text) || i[0] && Object.keys(i[0])[0] || "x", y = /* @__PURE__ */ t(
696
696
  Oe,
697
697
  {
698
698
  contentStyle: { fontSize: 12, borderRadius: e.r, border: `1px solid ${e.border}` }
@@ -712,7 +712,7 @@ function Nt({
712
712
  tick: { fontSize: 11, fill: e.textSec },
713
713
  axisLine: { stroke: e.border },
714
714
  tickLine: !1,
715
- label: ($ = s.bottom) != null && $.title ? { value: s.bottom.title, position: "insideBottom", offset: -4, fontSize: 11 } : void 0
715
+ label: (k = s.bottom) != null && k.title ? { value: s.bottom.title, position: "insideBottom", offset: -4, fontSize: 11 } : void 0
716
716
  }
717
717
  ), c = /* @__PURE__ */ t(
718
718
  we,
@@ -720,84 +720,84 @@ function Nt({
720
720
  tick: { fontSize: 11, fill: e.textSec },
721
721
  axisLine: !1,
722
722
  tickLine: !1,
723
- domain: [((C = s.left) == null ? void 0 : C.min) ?? "auto", ((N = s.left) == null ? void 0 : N.max) ?? "auto"],
724
- tickCount: (k = s.left) == null ? void 0 : k.maxTicks,
723
+ domain: [(($ = s.left) == null ? void 0 : $.min) ?? "auto", ((L = s.left) == null ? void 0 : L.max) ?? "auto"],
724
+ tickCount: (m = s.left) == null ? void 0 : m.maxTicks,
725
725
  label: (M = s.left) != null && M.title ? { value: s.left.title, angle: -90, position: "insideLeft", fontSize: 11 } : void 0
726
726
  }
727
727
  ), b = {
728
728
  top: 10,
729
729
  right: 20,
730
730
  left: 0,
731
- bottom: (W = s.bottom) != null && W.title ? 20 : 0
732
- }, o = { data: i, margin: b };
733
- let g;
731
+ bottom: (A = s.bottom) != null && A.title ? 20 : 0
732
+ }, S = { data: i, margin: b };
733
+ let o;
734
734
  if (n === "bar")
735
- g = /* @__PURE__ */ x(Ke, { ...o, children: [
735
+ o = /* @__PURE__ */ g(Ke, { ...S, children: [
736
736
  r,
737
737
  l,
738
738
  c,
739
739
  y,
740
740
  w,
741
- p.map((T, z) => /* @__PURE__ */ t(
741
+ p.map((N, z) => /* @__PURE__ */ t(
742
742
  Ve,
743
743
  {
744
- dataKey: T.value || T.id || "",
745
- name: T.label || T.id,
746
- fill: T.fill || T.color || q[z % q.length],
744
+ dataKey: N.value || N.id || "",
745
+ name: N.label || N.id,
746
+ fill: N.fill || N.color || G[z % G.length],
747
747
  radius: [3, 3, 0, 0]
748
748
  },
749
- T.id ?? z
749
+ N.id ?? z
750
750
  ))
751
751
  ] });
752
752
  else if (n === "line")
753
- g = /* @__PURE__ */ x(_e, { ...o, children: [
753
+ o = /* @__PURE__ */ g(_e, { ...S, children: [
754
754
  r,
755
755
  l,
756
756
  c,
757
757
  y,
758
758
  w,
759
- p.map((T, z) => {
760
- const A = T.color || q[z % q.length];
759
+ p.map((N, z) => {
760
+ const B = N.color || G[z % G.length];
761
761
  return /* @__PURE__ */ t(
762
762
  Xe,
763
763
  {
764
764
  type: "monotone",
765
- dataKey: T.value || T.id || "",
766
- name: T.label || T.id,
767
- stroke: A,
768
- strokeWidth: T.strokeWidth ?? 2,
769
- dot: { r: 3, fill: A }
765
+ dataKey: N.value || N.id || "",
766
+ name: N.label || N.id,
767
+ stroke: B,
768
+ strokeWidth: N.strokeWidth ?? 2,
769
+ dot: { r: 3, fill: B }
770
770
  },
771
- T.id ?? z
771
+ N.id ?? z
772
772
  );
773
773
  })
774
774
  ] });
775
775
  else if (n === "area")
776
- g = /* @__PURE__ */ x(qe, { ...o, children: [
776
+ o = /* @__PURE__ */ g(qe, { ...S, children: [
777
777
  r,
778
778
  l,
779
779
  c,
780
780
  y,
781
781
  w,
782
- p.map((T, z) => {
783
- const A = T.color || q[z % q.length];
782
+ p.map((N, z) => {
783
+ const B = N.color || G[z % G.length];
784
784
  return /* @__PURE__ */ t(
785
785
  Ge,
786
786
  {
787
787
  type: "monotone",
788
- dataKey: T.value || T.id || "",
789
- name: T.label || T.id,
790
- stroke: A,
791
- fill: (T.fill || A) + "33",
792
- strokeWidth: T.strokeWidth ?? 2
788
+ dataKey: N.value || N.id || "",
789
+ name: N.label || N.id,
790
+ stroke: B,
791
+ fill: (N.fill || B) + "33",
792
+ strokeWidth: N.strokeWidth ?? 2
793
793
  },
794
- T.id ?? z
794
+ N.id ?? z
795
795
  );
796
796
  })
797
797
  ] });
798
798
  else if (n === "pie" || n === "donut") {
799
- const T = p[0] || {}, z = T.value || "value", A = T.text || "name", P = T.color && i[0] && T.color in i[0] ? T.color : null;
800
- g = /* @__PURE__ */ x(Je, { children: [
799
+ const N = p[0] || {}, z = N.value || "value", B = N.text || "name", j = N.color && i[0] && N.color in i[0] ? N.color : null;
800
+ o = /* @__PURE__ */ g(Je, { children: [
801
801
  /* @__PURE__ */ t(
802
802
  Ue,
803
803
  {
@@ -807,18 +807,18 @@ function Nt({
807
807
  outerRadius: n === "donut" ? "70%" : "80%",
808
808
  innerRadius: n === "donut" ? "40%" : 0,
809
809
  dataKey: z,
810
- nameKey: A,
811
- stroke: T.stroke || "none",
812
- strokeWidth: T.strokeWidth ?? 0,
813
- label: ({ name: O, percent: j }) => `${O ?? ""} ${((j ?? 0) * 100).toFixed(0)}%`,
810
+ nameKey: B,
811
+ stroke: N.stroke || "none",
812
+ strokeWidth: N.strokeWidth ?? 0,
813
+ label: ({ name: Y, percent: O }) => `${Y ?? ""} ${((O ?? 0) * 100).toFixed(0)}%`,
814
814
  labelLine: !0,
815
815
  paddingAngle: 2,
816
- children: i.map((O, j) => /* @__PURE__ */ t(
816
+ children: i.map((Y, O) => /* @__PURE__ */ t(
817
817
  Qe,
818
818
  {
819
- fill: P ? O[P] : q[j % q.length]
819
+ fill: j ? Y[j] : G[O % G.length]
820
820
  },
821
- j
821
+ O
822
822
  ))
823
823
  }
824
824
  ),
@@ -826,29 +826,29 @@ function Nt({
826
826
  w
827
827
  ] });
828
828
  } else if (n === "radar") {
829
- const T = ((u = s.radial) == null ? void 0 : u.value) || d;
830
- g = /* @__PURE__ */ x(Ze, { ...o, cx: "50%", cy: "50%", children: [
829
+ const N = ((u = s.radial) == null ? void 0 : u.value) || d;
830
+ o = /* @__PURE__ */ g(Ze, { ...S, cx: "50%", cy: "50%", children: [
831
831
  /* @__PURE__ */ t(et, {}),
832
- /* @__PURE__ */ t(tt, { dataKey: T, tick: { fontSize: 11 } }),
832
+ /* @__PURE__ */ t(tt, { dataKey: N, tick: { fontSize: 11 } }),
833
833
  /* @__PURE__ */ t(nt, { tick: { fontSize: 9, fill: e.textMut }, axisLine: !1 }),
834
- p.map((z, A) => {
835
- const P = z.color || z.pointColor || q[A % q.length];
834
+ p.map((z, B) => {
835
+ const j = z.color || z.pointColor || G[B % G.length];
836
836
  return /* @__PURE__ */ t(
837
837
  rt,
838
838
  {
839
839
  dataKey: z.value || z.id || "",
840
840
  name: z.label || z.id,
841
- stroke: P,
842
- fill: P + "44"
841
+ stroke: j,
842
+ fill: j + "44"
843
843
  },
844
- z.id ?? A
844
+ z.id ?? B
845
845
  );
846
846
  }),
847
847
  y,
848
848
  w
849
849
  ] });
850
850
  } else if (n === "scatter")
851
- g = /* @__PURE__ */ x(ot, { margin: b, children: [
851
+ o = /* @__PURE__ */ g(ot, { margin: b, children: [
852
852
  r,
853
853
  /* @__PURE__ */ t(
854
854
  Se,
@@ -858,8 +858,8 @@ function Nt({
858
858
  name: ((I = s.bottom) == null ? void 0 : I.title) || "x",
859
859
  tick: { fontSize: 11, fill: e.textSec },
860
860
  tickLine: !1,
861
- domain: [((v = s.bottom) == null ? void 0 : v.min) ?? "auto", ((H = s.bottom) == null ? void 0 : H.max) ?? "auto"],
862
- label: (_ = s.bottom) != null && _.title ? { value: s.bottom.title, position: "insideBottom", offset: -4, fontSize: 11 } : void 0
861
+ domain: [((R = s.bottom) == null ? void 0 : R.min) ?? "auto", ((C = s.bottom) == null ? void 0 : C.max) ?? "auto"],
862
+ label: (P = s.bottom) != null && P.title ? { value: s.bottom.title, position: "insideBottom", offset: -4, fontSize: 11 } : void 0
863
863
  }
864
864
  ),
865
865
  /* @__PURE__ */ t(
@@ -867,70 +867,70 @@ function Nt({
867
867
  {
868
868
  type: "number",
869
869
  dataKey: "y",
870
- name: ((G = s.left) == null ? void 0 : G.title) || "y",
870
+ name: ((q = s.left) == null ? void 0 : q.title) || "y",
871
871
  tick: { fontSize: 11, fill: e.textSec },
872
872
  tickLine: !1,
873
873
  axisLine: !1,
874
- domain: [((Q = s.left) == null ? void 0 : Q.min) ?? "auto", ((re = s.left) == null ? void 0 : re.max) ?? "auto"],
875
- label: (ee = s.left) != null && ee.title ? { value: s.left.title, angle: -90, position: "insideLeft", fontSize: 11 } : void 0
874
+ domain: [((Q = s.left) == null ? void 0 : Q.min) ?? "auto", ((ee = s.left) == null ? void 0 : ee.max) ?? "auto"],
875
+ label: (te = s.left) != null && te.title ? { value: s.left.title, angle: -90, position: "insideLeft", fontSize: 11 } : void 0
876
876
  }
877
877
  ),
878
878
  y,
879
879
  w,
880
- p.map((T, z) => {
881
- const A = T.value || "x", P = T.valueY || "y", O = (T.data || i).map((j) => ({
882
- x: j[A],
883
- y: j[P]
880
+ p.map((N, z) => {
881
+ const B = N.value || "x", j = N.valueY || "y", Y = (N.data || i).map((O) => ({
882
+ x: O[B],
883
+ y: O[j]
884
884
  }));
885
885
  return /* @__PURE__ */ t(
886
886
  it,
887
887
  {
888
- data: O,
889
- name: T.label || T.id,
890
- fill: T.color || q[z % q.length]
888
+ data: Y,
889
+ name: N.label || N.id,
890
+ fill: N.color || G[z % G.length]
891
891
  },
892
- T.id ?? z
892
+ N.id ?? z
893
893
  );
894
894
  })
895
895
  ] });
896
896
  else if (n === "treeMap") {
897
- const T = p[0] || {}, z = T.value || "value", A = T.text || "name", P = ht(i, z, A), O = T.stroke || e.surface, j = T.strokeWidth ?? 2;
898
- g = /* @__PURE__ */ t(
897
+ const N = p[0] || {}, z = N.value || "value", B = N.text || "name", j = ht(i, z, B), Y = N.stroke || e.surface, O = N.strokeWidth ?? 2;
898
+ o = /* @__PURE__ */ t(
899
899
  st,
900
900
  {
901
- data: P,
901
+ data: j,
902
902
  dataKey: "value",
903
903
  aspectRatio: 4 / 3,
904
- stroke: O,
904
+ stroke: Y,
905
905
  content: (J) => {
906
- const { x: X, y: oe, width: te, height: ie, depth: le, index: ae, name: B } = J;
906
+ const { x: X, y: oe, width: ne, height: ie, depth: le, index: ae, name: H } = J;
907
907
  if (le === 0) return null;
908
- const ne = q[ae % q.length];
909
- return /* @__PURE__ */ x("g", { children: [
908
+ const re = G[ae % G.length];
909
+ return /* @__PURE__ */ g("g", { children: [
910
910
  /* @__PURE__ */ t(
911
911
  "rect",
912
912
  {
913
913
  x: X,
914
914
  y: oe,
915
- width: te,
915
+ width: ne,
916
916
  height: ie,
917
- fill: ne,
918
- stroke: O,
919
- strokeWidth: j,
917
+ fill: re,
918
+ stroke: Y,
919
+ strokeWidth: O,
920
920
  style: { borderRadius: 3 }
921
921
  }
922
922
  ),
923
- te > 40 && ie > 20 && /* @__PURE__ */ t(
923
+ ne > 40 && ie > 20 && /* @__PURE__ */ t(
924
924
  "text",
925
925
  {
926
- x: X + te / 2,
926
+ x: X + ne / 2,
927
927
  y: oe + ie / 2,
928
928
  textAnchor: "middle",
929
929
  dominantBaseline: "middle",
930
930
  fill: "#fff",
931
931
  fontSize: 11,
932
932
  pointerEvents: "none",
933
- children: B
933
+ children: H
934
934
  }
935
935
  )
936
936
  ] });
@@ -943,186 +943,189 @@ function Nt({
943
943
  {
944
944
  className: "dhx",
945
945
  style: { width: "100%", height: a, padding: 12, background: e.surface, borderRadius: e.rMd, ...h },
946
- children: /* @__PURE__ */ t(lt, { width: "100%", height: "100%", children: g })
946
+ children: /* @__PURE__ */ t(lt, { width: "100%", height: "100%", children: o })
947
947
  }
948
948
  );
949
949
  }
950
950
  const ft = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], xt = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
951
951
  function Rt({ value: n, range: i = !1, timepicker: p = !1, onChange: s, style: f }) {
952
- const a = /* @__PURE__ */ new Date(), h = n ? new Date(Array.isArray(n) ? n[0] : n) : a, [d, y] = L(h), [w, r] = L(n ?? (i ? [null, null] : null)), [l, c] = L(null), [b, o] = L({ h: 0, m: 0 });
953
- F(V, []);
954
- const g = d.getFullYear(), m = d.getMonth(), $ = new Date(g, m, 1).getDay(), C = new Date(g, m + 1, 0).getDate(), N = [];
955
- for (let u = 0; u < $; u++) N.push(null);
956
- for (let u = 1; u <= C; u++) N.push(new Date(g, m, u));
957
- const k = (u) => u.toDateString() === a.toDateString(), M = (u) => {
952
+ const a = /* @__PURE__ */ new Date(), h = n ? new Date(Array.isArray(n) ? n[0] : n) : a, [d, y] = T(h), [w, r] = T(n ?? (i ? [null, null] : null)), [l, c] = T(null), [b, S] = T({ h: 0, m: 0 });
953
+ K(_, []);
954
+ const o = d.getFullYear(), x = d.getMonth(), k = new Date(o, x, 1).getDay(), $ = new Date(o, x + 1, 0).getDate(), L = [];
955
+ for (let u = 0; u < k; u++) L.push(null);
956
+ for (let u = 1; u <= $; u++) L.push(new Date(o, x, u));
957
+ const m = (u) => u.toDateString() === a.toDateString(), M = (u) => {
958
958
  if (!w) return !1;
959
959
  if (i && Array.isArray(w)) {
960
- const [I, v] = w;
960
+ const [I, R] = w;
961
961
  if (!I) return !1;
962
- const H = u.getTime();
963
- return v ? H >= I.getTime() && H <= v.getTime() : u.toDateString() === I.toDateString();
962
+ const C = u.getTime();
963
+ return R ? C >= I.getTime() && C <= R.getTime() : u.toDateString() === I.toDateString();
964
964
  }
965
965
  return u.toDateString() === w.toDateString();
966
- }, W = (u) => {
966
+ }, A = (u) => {
967
967
  if (i) {
968
- const [I, v] = Array.isArray(w) ? w : [null, null];
969
- if (!I || v)
968
+ const [I, R] = Array.isArray(w) ? w : [null, null];
969
+ if (!I || R)
970
970
  r([u, null]);
971
971
  else {
972
- const H = u < I ? [u, I] : [I, u];
973
- r(H), s == null || s(H);
972
+ const C = u < I ? [u, I] : [I, u];
973
+ r(C), s == null || s(C);
974
974
  }
975
975
  } else
976
976
  r(u), s == null || s(u);
977
977
  };
978
- return /* @__PURE__ */ x("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...f }, children: [
979
- /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 12 }, children: [
978
+ return /* @__PURE__ */ g("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...f }, children: [
979
+ /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 12 }, children: [
980
980
  /* @__PURE__ */ t("button", { onClick: () => y((u) => new Date(u.getFullYear(), u.getMonth() - 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "‹" }),
981
- /* @__PURE__ */ x("div", { style: { fontWeight: 700, fontSize: 14 }, children: [
982
- ft[m],
981
+ /* @__PURE__ */ g("div", { style: { fontWeight: 700, fontSize: 14 }, children: [
982
+ ft[x],
983
983
  " ",
984
- g
984
+ o
985
985
  ] }),
986
986
  /* @__PURE__ */ t("button", { onClick: () => y((u) => new Date(u.getFullYear(), u.getMonth() + 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "›" })
987
987
  ] }),
988
- /* @__PURE__ */ x("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, 32px)", gap: 2 }, children: [
988
+ /* @__PURE__ */ g("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, 32px)", gap: 2 }, children: [
989
989
  xt.map((u) => /* @__PURE__ */ t("div", { style: { textAlign: "center", fontSize: 11, fontWeight: 600, color: e.textMut, paddingBottom: 4 }, children: u }, u)),
990
- N.map((u, I) => {
991
- const v = u ? M(u) : !1, H = u && l && u.toDateString() === l.toDateString();
990
+ L.map((u, I) => {
991
+ const R = u ? M(u) : !1, C = u && l && u.toDateString() === l.toDateString();
992
992
  return /* @__PURE__ */ t(
993
993
  "div",
994
994
  {
995
- onClick: () => u && W(u),
995
+ onClick: () => u && A(u),
996
996
  onMouseEnter: () => u && c(u),
997
997
  onMouseLeave: () => c(null),
998
- style: { width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: e.r, cursor: u ? "pointer" : "default", fontSize: 12, fontWeight: u && k(u) ? 700 : 400, background: v ? e.primary : H ? e.bg : "transparent", color: v ? "#fff" : u && k(u) ? e.primary : u ? e.text : "transparent", border: u && k(u) && !v ? `1px solid ${e.primary}` : "1px solid transparent", transition: "all .1s" },
998
+ style: { width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: e.r, cursor: u ? "pointer" : "default", fontSize: 12, fontWeight: u && m(u) ? 700 : 400, background: R ? e.primary : C ? e.bg : "transparent", color: R ? "#fff" : u && m(u) ? e.primary : u ? e.text : "transparent", border: u && m(u) && !R ? `1px solid ${e.primary}` : "1px solid transparent", transition: "all .1s" },
999
999
  children: u == null ? void 0 : u.getDate()
1000
1000
  },
1001
1001
  I
1002
1002
  );
1003
1003
  })
1004
1004
  ] }),
1005
- p && /* @__PURE__ */ x("div", { style: { borderTop: `1px solid ${e.border}`, marginTop: 12, paddingTop: 12, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
1006
- /* @__PURE__ */ t("input", { type: "number", min: 0, max: 23, value: b.h, onChange: (u) => o((I) => ({ ...I, h: +u.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } }),
1005
+ p && /* @__PURE__ */ g("div", { style: { borderTop: `1px solid ${e.border}`, marginTop: 12, paddingTop: 12, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
1006
+ /* @__PURE__ */ t("input", { type: "number", min: 0, max: 23, value: b.h, onChange: (u) => S((I) => ({ ...I, h: +u.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } }),
1007
1007
  /* @__PURE__ */ t("span", { style: { fontWeight: 700, color: e.textSec }, children: ":" }),
1008
- /* @__PURE__ */ t("input", { type: "number", min: 0, max: 59, value: b.m, onChange: (u) => o((I) => ({ ...I, m: +u.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } })
1008
+ /* @__PURE__ */ t("input", { type: "number", min: 0, max: 59, value: b.m, onChange: (u) => S((I) => ({ ...I, m: +u.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } })
1009
1009
  ] })
1010
1010
  ] });
1011
1011
  }
1012
1012
  function gt({ value: n, onChange: i, timeFormat: p = 12, controls: s = !1, minuteStep: f = 5, style: a }) {
1013
- const [h, d] = L((n == null ? void 0 : n.h) ?? (p === 24 ? 0 : 12)), [y, w] = L((n == null ? void 0 : n.m) ?? 0), [r, l] = L((n == null ? void 0 : n.ampm) ?? "AM"), [c, b] = L(null);
1014
- F(V, []);
1015
- const o = p === 24 ? Array.from({ length: 24 }, (k, M) => M) : Array.from({ length: 12 }, (k, M) => M + 1), g = Array.from({ length: Math.ceil(60 / f) }, (k, M) => M * f), m = (k, M, W) => {
1016
- const u = p === 24 ? { h: k, m: M } : { h: k, m: M, ampm: W };
1013
+ const [h, d] = T((n == null ? void 0 : n.h) ?? (p === 24 ? 0 : 12)), [y, w] = T((n == null ? void 0 : n.m) ?? 0), [r, l] = T((n == null ? void 0 : n.ampm) ?? "AM"), [c, b] = T(null);
1014
+ K(_, []);
1015
+ const S = p === 24 ? Array.from({ length: 24 }, (m, M) => M) : Array.from({ length: 12 }, (m, M) => M + 1), o = Array.from({ length: Math.ceil(60 / f) }, (m, M) => M * f), x = (m, M, A) => {
1016
+ const u = p === 24 ? { h: m, m: M } : { h: m, m: M, ampm: A };
1017
1017
  s ? b(u) : i == null || i(u);
1018
- }, $ = () => {
1018
+ }, k = () => {
1019
1019
  b(null), d((n == null ? void 0 : n.h) ?? (p === 24 ? 0 : 12)), w((n == null ? void 0 : n.m) ?? 0), l((n == null ? void 0 : n.ampm) ?? "AM");
1020
- }, C = { display: "flex", flexDirection: "column", alignItems: "center", gap: 4 }, N = (k) => ({
1020
+ }, $ = { display: "flex", flexDirection: "column", alignItems: "center", gap: 4 }, L = (m) => ({
1021
1021
  height: 32,
1022
1022
  display: "flex",
1023
1023
  alignItems: "center",
1024
1024
  justifyContent: "center",
1025
1025
  cursor: "pointer",
1026
1026
  fontSize: 13,
1027
- fontWeight: k ? 700 : 400,
1028
- background: k ? e.primaryLt : "transparent",
1029
- color: k ? e.primary : e.text
1027
+ fontWeight: m ? 700 : 400,
1028
+ background: m ? e.primaryLt : "transparent",
1029
+ color: m ? e.primary : e.text
1030
1030
  });
1031
- return /* @__PURE__ */ x("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...a }, children: [
1032
- /* @__PURE__ */ x("div", { style: { display: "flex", gap: 8, alignItems: "stretch" }, children: [
1033
- /* @__PURE__ */ x("div", { style: C, children: [
1031
+ return /* @__PURE__ */ g("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...a }, children: [
1032
+ /* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, alignItems: "stretch" }, children: [
1033
+ /* @__PURE__ */ g("div", { style: $, children: [
1034
1034
  /* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "Hours" }),
1035
- /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: o.map((k) => /* @__PURE__ */ t(
1035
+ /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: S.map((m) => /* @__PURE__ */ t(
1036
1036
  "div",
1037
1037
  {
1038
1038
  onClick: () => {
1039
- d(k), m(k, y, r);
1039
+ d(m), x(m, y, r);
1040
1040
  },
1041
- style: N(h === k),
1042
- onMouseEnter: (M) => h !== k && (M.currentTarget.style.background = e.bg),
1043
- onMouseLeave: (M) => h !== k && (M.currentTarget.style.background = "transparent"),
1044
- children: String(k).padStart(2, "0")
1041
+ style: L(h === m),
1042
+ onMouseEnter: (M) => h !== m && (M.currentTarget.style.background = e.bg),
1043
+ onMouseLeave: (M) => h !== m && (M.currentTarget.style.background = "transparent"),
1044
+ children: String(m).padStart(2, "0")
1045
1045
  },
1046
- k
1046
+ m
1047
1047
  )) })
1048
1048
  ] }),
1049
- /* @__PURE__ */ x("div", { style: C, children: [
1049
+ /* @__PURE__ */ g("div", { style: $, children: [
1050
1050
  /* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "Minutes" }),
1051
- /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: g.map((k) => /* @__PURE__ */ t(
1051
+ /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: o.map((m) => /* @__PURE__ */ t(
1052
1052
  "div",
1053
1053
  {
1054
1054
  onClick: () => {
1055
- w(k), m(h, k, r);
1055
+ w(m), x(h, m, r);
1056
1056
  },
1057
- style: N(y === k),
1058
- onMouseEnter: (M) => y !== k && (M.currentTarget.style.background = e.bg),
1059
- onMouseLeave: (M) => y !== k && (M.currentTarget.style.background = "transparent"),
1060
- children: String(k).padStart(2, "0")
1057
+ style: L(y === m),
1058
+ onMouseEnter: (M) => y !== m && (M.currentTarget.style.background = e.bg),
1059
+ onMouseLeave: (M) => y !== m && (M.currentTarget.style.background = "transparent"),
1060
+ children: String(m).padStart(2, "0")
1061
1061
  },
1062
- k
1062
+ m
1063
1063
  )) })
1064
1064
  ] }),
1065
- p === 12 && /* @__PURE__ */ x("div", { style: C, children: [
1065
+ p === 12 && /* @__PURE__ */ g("div", { style: $, children: [
1066
1066
  /* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "AM/PM" }),
1067
- /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden" }, children: ["AM", "PM"].map((k) => /* @__PURE__ */ t(
1067
+ /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden" }, children: ["AM", "PM"].map((m) => /* @__PURE__ */ t(
1068
1068
  "div",
1069
1069
  {
1070
1070
  onClick: () => {
1071
- l(k), m(h, y, k);
1071
+ l(m), x(h, y, m);
1072
1072
  },
1073
- style: { height: 40, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", padding: "0 12px", fontSize: 13, fontWeight: r === k ? 700 : 400, background: r === k ? e.primary : e.surface, color: r === k ? "#fff" : e.text },
1074
- children: k
1073
+ style: { height: 40, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", padding: "0 12px", fontSize: 13, fontWeight: r === m ? 700 : 400, background: r === m ? e.primary : e.surface, color: r === m ? "#fff" : e.text },
1074
+ children: m
1075
1075
  },
1076
- k
1076
+ m
1077
1077
  )) })
1078
1078
  ] })
1079
1079
  ] }),
1080
- /* @__PURE__ */ x("div", { style: { textAlign: "center", marginTop: 12, fontSize: 22, fontWeight: 700, color: e.primary, letterSpacing: 2 }, children: [
1080
+ /* @__PURE__ */ g("div", { style: { textAlign: "center", marginTop: 12, fontSize: 22, fontWeight: 700, color: e.primary, letterSpacing: 2 }, children: [
1081
1081
  String(h).padStart(2, "0"),
1082
1082
  ":",
1083
1083
  String(y).padStart(2, "0"),
1084
1084
  p === 12 ? ` ${r}` : ""
1085
1085
  ] }),
1086
- s && /* @__PURE__ */ x("div", { style: { display: "flex", gap: 8, justifyContent: "flex-end", marginTop: 12 }, children: [
1087
- /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: $, children: "Cancel" }),
1088
- /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => c && (i == null ? void 0 : i(c)), children: "Apply" })
1086
+ s && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, justifyContent: "flex-end", marginTop: 12 }, children: [
1087
+ /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: k, children: "Cancel" }),
1088
+ /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => {
1089
+ const m = c ?? (p === 24 ? { h, m: y } : { h, m: y, ampm: r });
1090
+ i == null || i(m);
1091
+ }, children: "Apply" })
1089
1092
  ] })
1090
1093
  ] });
1091
1094
  }
1092
1095
  const yt = ({ open: n }) => /* @__PURE__ */ t("svg", { width: "12", height: "12", viewBox: "0 0 12 12", style: { flexShrink: 0, transition: "transform .15s", transform: n ? "rotate(180deg)" : "rotate(0deg)" }, children: /* @__PURE__ */ t("path", { d: "M2 4l4 4 4-4", stroke: e.textMut, strokeWidth: "1.5", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }) });
1093
1096
  function $e({ data: n = [], value: i, placeholder: p = "Select or type...", multiselection: s = !1, label: f, onChange: a, style: h }) {
1094
- var W;
1095
- const [d, y] = L(!1), [w, r] = L(""), [l, c] = L(
1097
+ var A;
1098
+ const [d, y] = T(!1), [w, r] = T(""), [l, c] = T(
1096
1099
  s ? i ? [].concat(i) : [] : i || null
1097
- ), b = U(null), o = U(null);
1098
- F(V, []), he(b, Z(() => {
1100
+ ), b = U(null), S = U(null);
1101
+ K(_, []), he(b, Z(() => {
1099
1102
  y(!1), r("");
1100
1103
  }, []));
1101
- const g = ue(
1104
+ const o = ue(
1102
1105
  () => n.filter((u) => !w || u.value.toLowerCase().includes(w.toLowerCase())),
1103
1106
  [n, w]
1104
- ), m = (u) => s ? (l || []).includes(u) : l === u, $ = (u) => {
1107
+ ), x = (u) => s ? (l || []).includes(u) : l === u, k = (u) => {
1105
1108
  const I = u.id || u.value;
1106
1109
  if (s) {
1107
- const v = m(I) ? l.filter((H) => H !== I) : [...l || [], I];
1108
- c(v), a == null || a(v);
1110
+ const R = x(I) ? l.filter((C) => C !== I) : [...l || [], I];
1111
+ c(R), a == null || a(R);
1109
1112
  } else
1110
1113
  c(I), r(""), y(!1), a == null || a(I);
1111
- }, C = (u) => {
1112
- const I = l.filter((v) => v !== u);
1114
+ }, $ = (u) => {
1115
+ const I = l.filter((R) => R !== u);
1113
1116
  c(I), a == null || a(I);
1114
- }, N = () => {
1117
+ }, L = () => {
1115
1118
  y(!0), setTimeout(() => {
1116
1119
  var u;
1117
- return (u = o.current) == null ? void 0 : u.focus();
1120
+ return (u = S.current) == null ? void 0 : u.focus();
1118
1121
  }, 0);
1119
- }, k = ((W = n.find((u) => (u.id || u.value) === l)) == null ? void 0 : W.value) || "", M = s ? l || [] : [];
1120
- return /* @__PURE__ */ x("div", { ref: b, className: "dhx", style: { position: "relative", ...h }, children: [
1122
+ }, m = ((A = n.find((u) => (u.id || u.value) === l)) == null ? void 0 : A.value) || "", M = s ? l || [] : [];
1123
+ return /* @__PURE__ */ g("div", { ref: b, className: "dhx", style: { position: "relative", ...h }, children: [
1121
1124
  f && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: f }),
1122
- /* @__PURE__ */ x(
1125
+ /* @__PURE__ */ g(
1123
1126
  "div",
1124
1127
  {
1125
- onClick: N,
1128
+ onClick: L,
1126
1129
  style: {
1127
1130
  display: "flex",
1128
1131
  alignItems: "center",
@@ -1138,10 +1141,10 @@ function $e({ data: n = [], value: i, placeholder: p = "Select or type...", mult
1138
1141
  boxShadow: d ? `0 0 0 3px ${e.primary}22` : "none"
1139
1142
  },
1140
1143
  children: [
1141
- s && /* @__PURE__ */ x(Ne, { children: [
1144
+ s && /* @__PURE__ */ g(Ne, { children: [
1142
1145
  M.map((u) => {
1143
1146
  var I;
1144
- return /* @__PURE__ */ x("span", { style: {
1147
+ return /* @__PURE__ */ g("span", { style: {
1145
1148
  display: "inline-flex",
1146
1149
  alignItems: "center",
1147
1150
  gap: 4,
@@ -1153,12 +1156,12 @@ function $e({ data: n = [], value: i, placeholder: p = "Select or type...", mult
1153
1156
  lineHeight: 1.5,
1154
1157
  whiteSpace: "nowrap"
1155
1158
  }, children: [
1156
- ((I = n.find((v) => (v.id || v.value) === u)) == null ? void 0 : I.value) || u,
1159
+ ((I = n.find((R) => (R.id || R.value) === u)) == null ? void 0 : I.value) || u,
1157
1160
  /* @__PURE__ */ t(
1158
1161
  "span",
1159
1162
  {
1160
- onClick: (v) => {
1161
- v.stopPropagation(), C(u);
1163
+ onClick: (R) => {
1164
+ R.stopPropagation(), $(u);
1162
1165
  },
1163
1166
  style: { cursor: "pointer", fontSize: 15, lineHeight: 1, opacity: 0.75, marginLeft: 2 },
1164
1167
  children: "×"
@@ -1169,7 +1172,7 @@ function $e({ data: n = [], value: i, placeholder: p = "Select or type...", mult
1169
1172
  /* @__PURE__ */ t(
1170
1173
  "input",
1171
1174
  {
1172
- ref: o,
1175
+ ref: S,
1173
1176
  value: w,
1174
1177
  onChange: (u) => {
1175
1178
  r(u.target.value), y(!0);
@@ -1184,8 +1187,8 @@ function $e({ data: n = [], value: i, placeholder: p = "Select or type...", mult
1184
1187
  !s && /* @__PURE__ */ t(
1185
1188
  "input",
1186
1189
  {
1187
- ref: o,
1188
- value: d ? w : k,
1190
+ ref: S,
1191
+ value: d ? w : m,
1189
1192
  onChange: (u) => {
1190
1193
  r(u.target.value), y(!0);
1191
1194
  },
@@ -1211,13 +1214,13 @@ function $e({ data: n = [], value: i, placeholder: p = "Select or type...", mult
1211
1214
  borderRadius: e.r,
1212
1215
  boxShadow: e.shadowLg,
1213
1216
  zIndex: 100
1214
- }, children: /* @__PURE__ */ x("div", { className: "dhx-scroll", style: { maxHeight: 220, overflowY: "auto" }, children: [
1215
- g.map((u) => {
1216
- const I = u.id || u.value, v = m(I);
1217
- return /* @__PURE__ */ x(
1217
+ }, children: /* @__PURE__ */ g("div", { className: "dhx-scroll", style: { maxHeight: 220, overflowY: "auto" }, children: [
1218
+ o.map((u) => {
1219
+ const I = u.id || u.value, R = x(I);
1220
+ return /* @__PURE__ */ g(
1218
1221
  "div",
1219
1222
  {
1220
- onClick: () => $(u),
1223
+ onClick: () => k(u),
1221
1224
  style: {
1222
1225
  padding: "8px 12px",
1223
1226
  cursor: "pointer",
@@ -1225,26 +1228,26 @@ function $e({ data: n = [], value: i, placeholder: p = "Select or type...", mult
1225
1228
  alignItems: "center",
1226
1229
  gap: 8,
1227
1230
  fontSize: 13,
1228
- background: v ? e.primaryLt : "transparent",
1229
- color: v ? e.primary : e.text
1231
+ background: R ? e.primaryLt : "transparent",
1232
+ color: R ? e.primary : e.text
1230
1233
  },
1231
- onMouseEnter: (H) => !v && (H.currentTarget.style.background = e.bg),
1232
- onMouseLeave: (H) => !v && (H.currentTarget.style.background = "transparent"),
1234
+ onMouseEnter: (C) => !R && (C.currentTarget.style.background = e.bg),
1235
+ onMouseLeave: (C) => !R && (C.currentTarget.style.background = "transparent"),
1233
1236
  children: [
1234
1237
  s && /* @__PURE__ */ t("span", { style: {
1235
1238
  width: 14,
1236
1239
  height: 14,
1237
1240
  flexShrink: 0,
1238
- border: `2px solid ${v ? e.primary : e.borderDk}`,
1241
+ border: `2px solid ${R ? e.primary : e.borderDk}`,
1239
1242
  borderRadius: 3,
1240
1243
  display: "flex",
1241
1244
  alignItems: "center",
1242
1245
  justifyContent: "center",
1243
- background: v ? e.primary : "transparent"
1244
- }, children: v && /* @__PURE__ */ t("span", { style: { color: "#fff", fontSize: 9, lineHeight: 1 }, children: "✓" }) }),
1246
+ background: R ? e.primary : "transparent"
1247
+ }, children: R && /* @__PURE__ */ t("span", { style: { color: "#fff", fontSize: 9, lineHeight: 1 }, children: "✓" }) }),
1245
1248
  /* @__PURE__ */ t("span", { style: { flex: 1 }, children: u.value }),
1246
- !s && v && /* @__PURE__ */ t("span", { style: { color: e.primary, fontSize: 12, fontWeight: 700 }, children: "✓" }),
1247
- u.count !== void 0 && /* @__PURE__ */ x("span", { style: { fontSize: 11, color: e.textMut }, children: [
1249
+ !s && R && /* @__PURE__ */ t("span", { style: { color: e.primary, fontSize: 12, fontWeight: 700 }, children: "✓" }),
1250
+ u.count !== void 0 && /* @__PURE__ */ g("span", { style: { fontSize: 11, color: e.textMut }, children: [
1248
1251
  "(",
1249
1252
  u.count,
1250
1253
  ")"
@@ -1254,45 +1257,45 @@ function $e({ data: n = [], value: i, placeholder: p = "Select or type...", mult
1254
1257
  I
1255
1258
  );
1256
1259
  }),
1257
- g.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 16, textAlign: "center", color: e.textMut, fontSize: 13 }, children: "No matches" })
1260
+ o.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 16, textAlign: "center", color: e.textMut, fontSize: 13 }, children: "No matches" })
1258
1261
  ] }) })
1259
1262
  ] });
1260
1263
  }
1261
1264
  function De({ min: n = 0, max: i = 100, step: p = 1, value: s, range: f = !1, label: a, tick: h, disabled: d = !1, onChange: y, style: w }) {
1262
- const [r, l] = L(s ?? (f ? [n, i] : n));
1263
- F(V, []);
1264
- const c = ($, C) => {
1265
+ const [r, l] = T(s ?? (f ? [n, i] : n));
1266
+ K(_, []);
1267
+ const c = (k, $) => {
1265
1268
  if (!d)
1266
1269
  if (f) {
1267
- const N = [...r];
1268
- N[$] = C, l(N), y == null || y(N);
1270
+ const L = [...r];
1271
+ L[k] = $, l(L), y == null || y(L);
1269
1272
  } else
1270
- l(C), y == null || y(C);
1271
- }, b = ($) => ($ - n) / (i - n) * 100, o = f ? r : [r], g = f ? { left: `${b(o[0])}%`, width: `${b(o[1]) - b(o[0])}%` } : { left: 0, width: `${b(o[0])}%` }, m = d ? e.border : e.primary;
1272
- return /* @__PURE__ */ x("div", { className: "dhx", style: { width: "100%", opacity: d ? 0.5 : 1, ...w }, children: [
1273
+ l($), y == null || y($);
1274
+ }, b = (k) => (k - n) / (i - n) * 100, S = f ? r : [r], o = f ? { left: `${b(S[0])}%`, width: `${b(S[1]) - b(S[0])}%` } : { left: 0, width: `${b(S[0])}%` }, x = d ? e.border : e.primary;
1275
+ return /* @__PURE__ */ g("div", { className: "dhx", style: { width: "100%", opacity: d ? 0.5 : 1, ...w }, children: [
1273
1276
  a && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: a }),
1274
- /* @__PURE__ */ t("div", { style: { position: "relative", height: 36, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ x("div", { style: { position: "relative", flex: 1, height: 4, background: e.border, borderRadius: 2 }, children: [
1275
- /* @__PURE__ */ t("div", { style: { position: "absolute", ...g, height: "100%", background: m, borderRadius: 2 } }),
1276
- o.map(($, C) => /* @__PURE__ */ t(
1277
+ /* @__PURE__ */ t("div", { style: { position: "relative", height: 36, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ g("div", { style: { position: "relative", flex: 1, height: 4, background: e.border, borderRadius: 2 }, children: [
1278
+ /* @__PURE__ */ t("div", { style: { position: "absolute", ...o, height: "100%", background: x, borderRadius: 2 } }),
1279
+ S.map((k, $) => /* @__PURE__ */ t(
1277
1280
  "input",
1278
1281
  {
1279
1282
  type: "range",
1280
1283
  min: n,
1281
1284
  max: i,
1282
1285
  step: p,
1283
- value: $,
1286
+ value: k,
1284
1287
  disabled: d,
1285
- onChange: (N) => {
1286
- const k = +N.target.value;
1287
- f && C === 0 && k >= r[1] || f && C === 1 && k <= r[0] || c(C, k);
1288
+ onChange: (L) => {
1289
+ const m = +L.target.value;
1290
+ f && $ === 0 && m >= r[1] || f && $ === 1 && m <= r[0] || c($, m);
1288
1291
  },
1289
1292
  style: { position: "absolute", width: "100%", height: "100%", opacity: 0, cursor: d ? "not-allowed" : "pointer", top: 0, left: 0, margin: 0 }
1290
1293
  },
1291
- C
1294
+ $
1292
1295
  )),
1293
- o.map(($, C) => /* @__PURE__ */ t("div", { style: { position: "absolute", left: `${b($)}%`, top: "50%", transform: "translate(-50%, -50%)", width: 16, height: 16, borderRadius: "50%", background: e.surface, border: `2px solid ${m}`, boxShadow: "0 1px 4px rgba(0,0,0,.2)", pointerEvents: "none" }, children: /* @__PURE__ */ t("div", { style: { position: "absolute", bottom: "calc(100% + 6px)", left: "50%", transform: "translateX(-50%)", background: d ? e.textMut : e.primaryDk, color: "#fff", padding: "2px 6px", borderRadius: e.r, fontSize: 11, fontWeight: 700, whiteSpace: "nowrap" }, children: $ }) }, C))
1296
+ S.map((k, $) => /* @__PURE__ */ t("div", { style: { position: "absolute", left: `${b(k)}%`, top: "50%", transform: "translate(-50%, -50%)", width: 16, height: 16, borderRadius: "50%", background: e.surface, border: `2px solid ${x}`, boxShadow: "0 1px 4px rgba(0,0,0,.2)", pointerEvents: "none" }, children: /* @__PURE__ */ t("div", { style: { position: "absolute", bottom: "calc(100% + 6px)", left: "50%", transform: "translateX(-50%)", background: d ? e.textMut : e.primaryDk, color: "#fff", padding: "2px 6px", borderRadius: e.r, fontSize: 11, fontWeight: 700, whiteSpace: "nowrap" }, children: k }) }, $))
1294
1297
  ] }) }),
1295
- h && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", marginTop: 2 }, children: [n, Math.round((i + n) / 2), i].map(($) => /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: $ }, $)) })
1298
+ h && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", marginTop: 2 }, children: [n, Math.round((i + n) / 2), i].map((k) => /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: k }, k)) })
1296
1299
  ] });
1297
1300
  }
1298
1301
  const bt = ["#f44336", "#e91e63", "#9c27b0", "#673ab7", "#3f51b5", "#2196f3", "#03a9f4", "#00bcd4", "#009688", "#4caf50", "#8bc34a", "#cddc39", "#ffeb3b", "#ffc107", "#ff9800", "#ff5722", "#795548", "#607d8b", "#9e9e9e", "#000000", "#ffffff", "#0288d1", "#01579b", "#43a047", "#e53935", "#f57c00"];
@@ -1315,15 +1318,15 @@ function Ce(n, i, p) {
1315
1318
  return "#" + f(0) + f(8) + f(4);
1316
1319
  }
1317
1320
  function Et({ value: n = "#0288d1", onChange: i, style: p }) {
1318
- const [s, f] = L(() => ye(n)), a = Ce(...s);
1319
- F(V, []);
1321
+ const [s, f] = T(() => ye(n)), a = Ce(...s);
1322
+ K(_, []);
1320
1323
  const h = (d) => {
1321
1324
  f(d), i == null || i(Ce(...d));
1322
1325
  };
1323
- return /* @__PURE__ */ x("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...p }, children: [
1326
+ return /* @__PURE__ */ g("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...p }, children: [
1324
1327
  /* @__PURE__ */ t("div", { style: { width: 200, height: 120, borderRadius: e.r, marginBottom: 12, background: `linear-gradient(to bottom, transparent, black), linear-gradient(to right, white, hsl(${s[0]},100%,50%))`, cursor: "crosshair" } }),
1325
- [["Hue", 0, 360, s[0]], ["Saturation", 0, 100, s[1]], ["Lightness", 0, 100, s[2]]].map(([d, y, w, r], l) => /* @__PURE__ */ x("div", { style: { marginBottom: l < 2 ? 8 : 12 }, children: [
1326
- /* @__PURE__ */ x("div", { className: "dhx dhx-label", children: [
1328
+ [["Hue", 0, 360, s[0]], ["Saturation", 0, 100, s[1]], ["Lightness", 0, 100, s[2]]].map(([d, y, w, r], l) => /* @__PURE__ */ g("div", { style: { marginBottom: l < 2 ? 8 : 12 }, children: [
1329
+ /* @__PURE__ */ g("div", { className: "dhx dhx-label", children: [
1327
1330
  d,
1328
1331
  l > 0 ? ` (${r}%)` : ""
1329
1332
  ] }),
@@ -1332,7 +1335,7 @@ function Et({ value: n = "#0288d1", onChange: i, style: p }) {
1332
1335
  b[l] = +c.target.value, h(b);
1333
1336
  }, style: { width: "100%", accentColor: e.primary } })
1334
1337
  ] }, d)),
1335
- /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
1338
+ /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
1336
1339
  /* @__PURE__ */ t("div", { style: { width: 36, height: 36, borderRadius: e.r, background: a, border: `1px solid ${e.border}`, flexShrink: 0 } }),
1337
1340
  /* @__PURE__ */ t(
1338
1341
  "input",
@@ -1364,8 +1367,8 @@ function Et({ value: n = "#0288d1", onChange: i, style: p }) {
1364
1367
  ] });
1365
1368
  }
1366
1369
  function Wt({ trigger: n, children: i, placement: p = "bottom-start", style: s }) {
1367
- const [f, a] = L(!1), [h, d] = L({ top: "100%", left: 0 }), y = U(null), w = U(null);
1368
- return F(V, []), he(y, Z(() => a(!1), [])), /* @__PURE__ */ x("div", { ref: y, className: "dhx", style: { position: "relative", display: "inline-block" }, children: [
1370
+ const [f, a] = T(!1), [h, d] = T({ top: "100%", left: 0 }), y = U(null), w = U(null);
1371
+ return K(_, []), he(y, Z(() => a(!1), [])), /* @__PURE__ */ g("div", { ref: y, className: "dhx", style: { position: "relative", display: "inline-block" }, children: [
1369
1372
  /* @__PURE__ */ t("div", { ref: w, onClick: () => {
1370
1373
  a((l) => {
1371
1374
  if (!l && w.current) {
@@ -1383,23 +1386,23 @@ function Wt({ trigger: n, children: i, placement: p = "bottom-start", style: s }
1383
1386
  ] });
1384
1387
  }
1385
1388
  function At({ title: n, children: i, width: p = 480, height: s, closable: f = !0, movable: a = !0, modal: h = !1, defaultOpen: d = !0, footer: y, onClose: w, style: r }) {
1386
- const [l, c] = L(d), [b, o] = L({ x: 0, y: 0 });
1387
- F(V, []);
1388
- const g = dt(Z(($, C) => a && o({ x: $, y: C }), [a])), m = () => {
1389
+ const [l, c] = T(d), [b, S] = T({ x: 0, y: 0 });
1390
+ K(_, []);
1391
+ const o = dt(Z((k, $) => a && S({ x: k, y: $ }), [a])), x = () => {
1389
1392
  c(!1), w == null || w();
1390
1393
  };
1391
- return l ? /* @__PURE__ */ x(Ne, { children: [
1392
- h && /* @__PURE__ */ t("div", { style: { position: "fixed", inset: 0, background: "rgba(0,0,0,.45)", zIndex: 900 }, onClick: f ? m : void 0 }),
1393
- /* @__PURE__ */ x("div", { className: "dhx", style: { position: h ? "fixed" : "absolute", left: "50%", top: "50%", transform: `translate(calc(-50% + ${b.x}px), calc(-50% + ${b.y}px))`, width: p, ...s ? { height: s } : {}, background: e.surface, borderRadius: e.rMd, boxShadow: e.shadowLg, zIndex: 901, display: "flex", flexDirection: "column", overflow: "hidden", ...r }, children: [
1394
- /* @__PURE__ */ x("div", { onMouseDown: ($) => g($, b.x, b.y), style: { display: "flex", alignItems: "center", padding: "12px 16px", borderBottom: `1px solid ${e.border}`, cursor: a ? "grab" : "default", background: e.bg, gap: 8, userSelect: "none" }, children: [
1394
+ return l ? /* @__PURE__ */ g(Ne, { children: [
1395
+ h && /* @__PURE__ */ t("div", { style: { position: "fixed", inset: 0, background: "rgba(0,0,0,.45)", zIndex: 900 }, onClick: f ? x : void 0 }),
1396
+ /* @__PURE__ */ g("div", { className: "dhx", style: { position: h ? "fixed" : "absolute", left: "50%", top: "50%", transform: `translate(calc(-50% + ${b.x}px), calc(-50% + ${b.y}px))`, width: p, ...s ? { height: s } : {}, background: e.surface, borderRadius: e.rMd, boxShadow: e.shadowLg, zIndex: 901, display: "flex", flexDirection: "column", overflow: "hidden", ...r }, children: [
1397
+ /* @__PURE__ */ g("div", { onMouseDown: (k) => o(k, b.x, b.y), style: { display: "flex", alignItems: "center", padding: "12px 16px", borderBottom: `1px solid ${e.border}`, cursor: a ? "grab" : "default", background: e.bg, gap: 8, userSelect: "none" }, children: [
1395
1398
  /* @__PURE__ */ t("span", { style: { flex: 1, fontWeight: 700, fontSize: 15 }, children: n }),
1396
1399
  f && /* @__PURE__ */ t(
1397
1400
  "button",
1398
1401
  {
1399
- onClick: m,
1402
+ onClick: x,
1400
1403
  style: { background: "none", border: "none", cursor: "pointer", width: 28, height: 28, borderRadius: e.r, display: "flex", alignItems: "center", justifyContent: "center", fontSize: 18, color: e.textSec },
1401
- onMouseEnter: ($) => $.currentTarget.style.background = e.border,
1402
- onMouseLeave: ($) => $.currentTarget.style.background = "none",
1404
+ onMouseEnter: (k) => k.currentTarget.style.background = e.border,
1405
+ onMouseLeave: (k) => k.currentTarget.style.background = "none",
1403
1406
  children: "×"
1404
1407
  }
1405
1408
  )
@@ -1411,8 +1414,8 @@ function At({ title: n, children: i, width: p = 480, height: s, closable: f = !0
1411
1414
  }
1412
1415
  const Re = Pe(null), mt = { success: "✓", error: "✕", warning: "⚠", info: "ℹ" }, Ie = { success: e.success, error: e.danger, warning: e.warning, info: e.primary };
1413
1416
  function Bt({ children: n }) {
1414
- const [i, p] = L([]);
1415
- F(V, []);
1417
+ const [i, p] = T([]);
1418
+ K(_, []);
1416
1419
  const s = Z((h) => p((d) => d.filter((y) => y.id !== h)), []), f = Z((h) => {
1417
1420
  const d = Date.now();
1418
1421
  return p((y) => [...y, { id: d, ...h }]), h.duration !== 0 && setTimeout(() => s(d), h.duration || 4e3), d;
@@ -1421,16 +1424,16 @@ function Bt({ children: n }) {
1421
1424
  alert: (h, d) => f({ type: "info", title: h, ...d }),
1422
1425
  confirm: (h, d, y) => f({ type: "warning", title: h, confirm: d, ...y })
1423
1426
  };
1424
- return /* @__PURE__ */ x(Re.Provider, { value: a, children: [
1427
+ return /* @__PURE__ */ g(Re.Provider, { value: a, children: [
1425
1428
  n,
1426
1429
  /* @__PURE__ */ t("div", { style: { position: "fixed", top: 20, right: 20, zIndex: 9999, display: "flex", flexDirection: "column", gap: 8, pointerEvents: "none" }, children: i.map((h) => {
1427
1430
  const d = h.type || "info";
1428
- return /* @__PURE__ */ x("div", { style: { background: e.surface, border: `1px solid ${e.border}`, borderLeft: `4px solid ${Ie[d]}`, borderRadius: e.r, boxShadow: e.shadowLg, padding: "12px 16px", minWidth: 280, maxWidth: 380, pointerEvents: "all", display: "flex", gap: 10, alignItems: "flex-start", animation: "dhx-toast .3s ease" }, children: [
1431
+ return /* @__PURE__ */ g("div", { style: { background: e.surface, border: `1px solid ${e.border}`, borderLeft: `4px solid ${Ie[d]}`, borderRadius: e.r, boxShadow: e.shadowLg, padding: "12px 16px", minWidth: 280, maxWidth: 380, pointerEvents: "all", display: "flex", gap: 10, alignItems: "flex-start", animation: "dhx-toast .3s ease" }, children: [
1429
1432
  /* @__PURE__ */ t("span", { style: { fontSize: 18, color: Ie[d], lineHeight: 1 }, children: mt[d] }),
1430
- /* @__PURE__ */ x("div", { style: { flex: 1 }, children: [
1433
+ /* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
1431
1434
  h.title && /* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 13, marginBottom: h.text ? 3 : 0 }, children: h.title }),
1432
1435
  h.text && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec, lineHeight: 1.5 }, children: h.text }),
1433
- h.confirm && /* @__PURE__ */ x("div", { style: { display: "flex", gap: 6, marginTop: 8 }, children: [
1436
+ h.confirm && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 6, marginTop: 8 }, children: [
1434
1437
  /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", style: { height: 26, fontSize: 12 }, onClick: () => {
1435
1438
  h.confirm(!0), s(h.id);
1436
1439
  }, children: "Confirm" }),
@@ -1450,50 +1453,50 @@ function Ht() {
1450
1453
  return n;
1451
1454
  }
1452
1455
  function Pt({ data: n = [], template: i, keyNavigation: p = !0, multiselection: s = !1, editable: f = !1, height: a = 400, onSelect: h, onEdit: d, style: y }) {
1453
- const [w, r] = L(/* @__PURE__ */ new Set()), [l, c] = L(null), [b, o] = L(""), [g, m] = L(null);
1454
- F(V, []);
1455
- const $ = (N, k) => {
1456
- const M = N.id ?? k;
1457
- r((W) => {
1458
- const u = s ? new Set(W) : /* @__PURE__ */ new Set();
1456
+ const [w, r] = T(/* @__PURE__ */ new Set()), [l, c] = T(null), [b, S] = T(""), [o, x] = T(null);
1457
+ K(_, []);
1458
+ const k = (L, m) => {
1459
+ const M = L.id ?? m;
1460
+ r((A) => {
1461
+ const u = s ? new Set(A) : /* @__PURE__ */ new Set();
1459
1462
  return u.has(M) ? u.delete(M) : u.add(M), u;
1460
- }), m(k), h == null || h(N);
1461
- }, C = (N, k) => {
1462
- d == null || d({ ...N, value: b }, k), c(null);
1463
+ }), x(m), h == null || h(L);
1464
+ }, $ = (L, m) => {
1465
+ d == null || d({ ...L, value: b }, m), c(null);
1463
1466
  };
1464
- return /* @__PURE__ */ x(
1467
+ return /* @__PURE__ */ g(
1465
1468
  "div",
1466
1469
  {
1467
1470
  className: "dhx dhx-scroll",
1468
1471
  style: { height: a, overflowY: "auto", border: `1px solid ${e.border}`, borderRadius: e.r, background: e.surface, ...y },
1469
1472
  tabIndex: 0,
1470
- onKeyDown: (N) => {
1471
- p && (N.key === "ArrowDown" && m((k) => Math.min((k ?? -1) + 1, n.length - 1)), N.key === "ArrowUp" && m((k) => Math.max((k ?? 1) - 1, 0)));
1473
+ onKeyDown: (L) => {
1474
+ p && (L.key === "ArrowDown" && x((m) => Math.min((m ?? -1) + 1, n.length - 1)), L.key === "ArrowUp" && x((m) => Math.max((m ?? 1) - 1, 0)));
1472
1475
  },
1473
1476
  children: [
1474
- n.map((N, k) => {
1475
- const M = N.id ?? k, W = w.has(M), u = g === k;
1477
+ n.map((L, m) => {
1478
+ const M = L.id ?? m, A = w.has(M), u = o === m;
1476
1479
  return /* @__PURE__ */ t(
1477
1480
  "div",
1478
1481
  {
1479
- onClick: () => $(N, k),
1480
- onDoubleClick: () => f && (c(k), o(String(N.value || ""))),
1481
- style: { display: "flex", alignItems: "center", padding: "0 12px", height: 40, cursor: "pointer", fontSize: 13, borderBottom: `1px solid ${e.border}`, background: W ? e.primaryLt : u ? e.bg : e.surface, color: W ? e.primary : e.text, outline: u ? `2px solid ${e.primary}44` : "none", transition: "background .1s" },
1482
- children: l === k ? /* @__PURE__ */ t(
1482
+ onClick: () => k(L, m),
1483
+ onDoubleClick: () => f && (c(m), S(String(L.value || ""))),
1484
+ style: { display: "flex", alignItems: "center", padding: "0 12px", height: 40, cursor: "pointer", fontSize: 13, borderBottom: `1px solid ${e.border}`, background: A ? e.primaryLt : u ? e.bg : e.surface, color: A ? e.primary : e.text, outline: u ? `2px solid ${e.primary}44` : "none", transition: "background .1s" },
1485
+ children: l === m ? /* @__PURE__ */ t(
1483
1486
  "input",
1484
1487
  {
1485
1488
  autoFocus: !0,
1486
1489
  className: "dhx dhx-input",
1487
1490
  style: { height: 28, flex: 1 },
1488
1491
  value: b,
1489
- onChange: (I) => o(I.target.value),
1490
- onBlur: () => C(N, k),
1492
+ onChange: (I) => S(I.target.value),
1493
+ onBlur: () => $(L, m),
1491
1494
  onKeyDown: (I) => {
1492
- I.key === "Enter" && C(N, k), I.key === "Escape" && c(null);
1495
+ I.key === "Enter" && $(L, m), I.key === "Escape" && c(null);
1493
1496
  },
1494
1497
  onClick: (I) => I.stopPropagation()
1495
1498
  }
1496
- ) : i ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: i(N) }, style: { flex: 1 } }) : /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: String(N.value ?? "") })
1499
+ ) : i ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: i(L) }, style: { flex: 1 } }) : /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: String(L.value ?? "") })
1497
1500
  },
1498
1501
  String(M)
1499
1502
  );
@@ -1504,8 +1507,8 @@ function Pt({ data: n = [], template: i, keyNavigation: p = !0, multiselection:
1504
1507
  );
1505
1508
  }
1506
1509
  function jt({ data: n = [], template: i, itemsInRow: p = 3, gap: s = 12, multiselection: f = !1, onSelect: a, style: h }) {
1507
- const [d, y] = L(/* @__PURE__ */ new Set());
1508
- F(V, []);
1510
+ const [d, y] = T(/* @__PURE__ */ new Set());
1511
+ K(_, []);
1509
1512
  const w = (r) => {
1510
1513
  const l = r.id ?? String(r.title);
1511
1514
  y((c) => {
@@ -1520,13 +1523,13 @@ function jt({ data: n = [], template: i, itemsInRow: p = 3, gap: s = 12, multise
1520
1523
  {
1521
1524
  onClick: () => w(r),
1522
1525
  style: { background: e.surface, border: `2px solid ${b ? e.primary : e.border}`, borderRadius: e.rMd, overflow: "hidden", cursor: "pointer", transition: "all .15s", boxShadow: b ? `0 0 0 3px ${e.primary}33` : e.shadow, transform: b ? "translateY(-2px)" : "none" },
1523
- onMouseEnter: (o) => {
1524
- o.currentTarget.style.boxShadow = e.shadowLg, o.currentTarget.style.transform = "translateY(-2px)";
1526
+ onMouseEnter: (S) => {
1527
+ S.currentTarget.style.boxShadow = e.shadowLg, S.currentTarget.style.transform = "translateY(-2px)";
1525
1528
  },
1526
- onMouseLeave: (o) => {
1527
- o.currentTarget.style.boxShadow = b ? `0 0 0 3px ${e.primary}33` : e.shadow, o.currentTarget.style.transform = b ? "translateY(-2px)" : "none";
1529
+ onMouseLeave: (S) => {
1530
+ S.currentTarget.style.boxShadow = b ? `0 0 0 3px ${e.primary}33` : e.shadow, S.currentTarget.style.transform = b ? "translateY(-2px)" : "none";
1528
1531
  },
1529
- children: i ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: i(r) } }) : /* @__PURE__ */ x("div", { style: { padding: 16 }, children: [
1532
+ children: i ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: i(r) } }) : /* @__PURE__ */ g("div", { style: { padding: 16 }, children: [
1530
1533
  r.img && /* @__PURE__ */ t("img", { src: r.img, alt: r.title || "", style: { width: "100%", borderRadius: e.r, marginBottom: 8, display: "block" } }),
1531
1534
  /* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 14, marginBottom: 4 }, children: r.title || r.value }),
1532
1535
  r.subtitle && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec }, children: r.subtitle })
@@ -1604,123 +1607,123 @@ function Ot({
1604
1607
  onChange: d,
1605
1608
  style: y
1606
1609
  }) {
1607
- const [w, r] = L(() => be(n)), [l, c] = L(() => me(n)), [b, o] = L(null), [g, m] = L({}), [$, C] = L(null), [N, k] = L(""), [M, W] = L(null), [u, I] = L(null);
1608
- F(V, []), F(() => {
1610
+ const [w, r] = T(() => be(n)), [l, c] = T(() => me(n)), [b, S] = T(null), [o, x] = T({}), [k, $] = T(null), [L, m] = T(""), [M, A] = T(null), [u, I] = T(null);
1611
+ K(_, []), K(() => {
1609
1612
  r(be(n)), c((z) => ({ ...me(n), ...z }));
1610
1613
  }, [n]);
1611
- const v = (z) => c((A) => ({ ...A, [z]: !A[z] })), H = (z, A) => {
1612
- m((P) => ({ ...P, [z]: A })), h == null || h(z, A);
1613
- }, _ = () => {
1614
- if (!$) return;
1615
- const z = $, A = N;
1616
- C(null), r((P) => {
1617
- const O = We(P, z, A);
1618
- return d == null || d(O), O;
1614
+ const R = (z) => c((B) => ({ ...B, [z]: !B[z] })), C = (z, B) => {
1615
+ x((j) => ({ ...j, [z]: B })), h == null || h(z, B);
1616
+ }, P = () => {
1617
+ if (!k) return;
1618
+ const z = k, B = L;
1619
+ $(null), r((j) => {
1620
+ const Y = We(j, z, B);
1621
+ return d == null || d(Y), Y;
1619
1622
  });
1620
- }, G = (z, A) => {
1621
- z.dataTransfer.effectAllowed = "move", W(A);
1622
- }, Q = (z, A) => {
1623
- if (!M || M === A || vt(w, M, A)) return;
1623
+ }, q = (z, B) => {
1624
+ z.dataTransfer.effectAllowed = "move", A(B);
1625
+ }, Q = (z, B) => {
1626
+ if (!M || M === B || vt(w, M, B)) return;
1624
1627
  z.preventDefault();
1625
- const P = z.currentTarget.getBoundingClientRect(), O = z.clientY - P.top, j = P.height, J = O < j * 0.25 ? "before" : O > j * 0.75 ? "after" : "inside";
1626
- I((X) => (X == null ? void 0 : X.id) === A && (X == null ? void 0 : X.pos) === J ? X : { id: A, pos: J });
1627
- }, re = (z, A) => {
1628
- if (z.preventDefault(), !M || !u || M === A) {
1629
- I(null), W(null);
1628
+ const j = z.currentTarget.getBoundingClientRect(), Y = z.clientY - j.top, O = j.height, J = Y < O * 0.25 ? "before" : Y > O * 0.75 ? "after" : "inside";
1629
+ I((X) => (X == null ? void 0 : X.id) === B && (X == null ? void 0 : X.pos) === J ? X : { id: B, pos: J });
1630
+ }, ee = (z, B) => {
1631
+ if (z.preventDefault(), !M || !u || M === B) {
1632
+ I(null), A(null);
1630
1633
  return;
1631
1634
  }
1632
- r((P) => {
1633
- const [O, j] = Ee(P, M);
1634
- if (!j) return P;
1635
- const J = ve(O, A, j, u.pos);
1635
+ r((j) => {
1636
+ const [Y, O] = Ee(j, M);
1637
+ if (!O) return j;
1638
+ const J = ve(Y, B, O, u.pos);
1636
1639
  return d == null || d(J), J;
1637
- }), u.pos === "inside" && c((P) => ({ ...P, [A]: !0 })), I(null), W(null);
1638
- }, ee = () => {
1639
- W(null), I(null);
1640
- }, T = (z, A = 0) => {
1640
+ }), u.pos === "inside" && c((j) => ({ ...j, [B]: !0 })), I(null), A(null);
1641
+ }, te = () => {
1642
+ A(null), I(null);
1643
+ }, N = (z, B = 0) => {
1641
1644
  var ae;
1642
- const P = (((ae = z.items) == null ? void 0 : ae.length) ?? 0) > 0, O = l[z.id], j = b === z.id, J = M === z.id, X = (u == null ? void 0 : u.id) === z.id;
1643
- let oe = !!g[z.id], te = !1;
1644
- if (i && P) {
1645
- const { total: B, checkedCount: ne } = kt(z, g);
1646
- ne > 0 && ne < B ? te = !0 : B > 0 && ne === B && (oe = !0);
1645
+ const j = (((ae = z.items) == null ? void 0 : ae.length) ?? 0) > 0, Y = l[z.id], O = b === z.id, J = M === z.id, X = (u == null ? void 0 : u.id) === z.id;
1646
+ let oe = !!o[z.id], ne = !1;
1647
+ if (i && j) {
1648
+ const { total: H, checkedCount: re } = kt(z, o);
1649
+ re > 0 && re < H ? ne = !0 : H > 0 && re === H && (oe = !0);
1647
1650
  }
1648
- const ie = X && u.pos !== "inside" ? { boxShadow: u.pos === "before" ? `inset 0 2px 0 0 ${e.primary}` : `inset 0 -2px 0 0 ${e.primary}` } : {}, le = X && u.pos === "inside" || j ? e.primaryLt : "transparent";
1649
- return /* @__PURE__ */ x("div", { style: { opacity: J ? 0.4 : 1 }, children: [
1650
- /* @__PURE__ */ x(
1651
+ const ie = X && u.pos !== "inside" ? { boxShadow: u.pos === "before" ? `inset 0 2px 0 0 ${e.primary}` : `inset 0 -2px 0 0 ${e.primary}` } : {}, le = X && u.pos === "inside" || O ? e.primaryLt : "transparent";
1652
+ return /* @__PURE__ */ g("div", { style: { opacity: J ? 0.4 : 1 }, children: [
1653
+ /* @__PURE__ */ g(
1651
1654
  "div",
1652
1655
  {
1653
1656
  draggable: !!s,
1654
- onDragStart: s ? (B) => G(B, z.id) : void 0,
1655
- onDragOver: s ? (B) => Q(B, z.id) : void 0,
1656
- onDrop: s ? (B) => re(B, z.id) : void 0,
1657
- onDragEnd: s ? ee : void 0,
1657
+ onDragStart: s ? (H) => q(H, z.id) : void 0,
1658
+ onDragOver: s ? (H) => Q(H, z.id) : void 0,
1659
+ onDrop: s ? (H) => ee(H, z.id) : void 0,
1660
+ onDragEnd: s ? te : void 0,
1658
1661
  title: f == null ? void 0 : f(z),
1659
1662
  onClick: () => {
1660
- o(z.id), a == null || a(z), P && v(z.id);
1663
+ S(z.id), a == null || a(z), j && R(z.id);
1661
1664
  },
1662
1665
  onDoubleClick: () => {
1663
- p && (C(z.id), k(z.value || ""));
1666
+ p && ($(z.id), m(z.value || ""));
1664
1667
  },
1665
1668
  style: {
1666
1669
  display: "flex",
1667
1670
  alignItems: "center",
1668
1671
  gap: 4,
1669
- padding: `5px 8px 5px ${12 + A * 18}px`,
1672
+ padding: `5px 8px 5px ${12 + B * 18}px`,
1670
1673
  cursor: s ? "grab" : "pointer",
1671
1674
  borderRadius: e.r,
1672
1675
  margin: "1px 4px",
1673
1676
  background: le,
1674
- color: j ? e.primary : e.text,
1677
+ color: O ? e.primary : e.text,
1675
1678
  userSelect: "none",
1676
1679
  fontSize: 13,
1677
1680
  ...ie
1678
1681
  },
1679
- onMouseEnter: (B) => !j && !X && (B.currentTarget.style.background = e.bg),
1680
- onMouseLeave: (B) => !j && !X && (B.currentTarget.style.background = "transparent"),
1682
+ onMouseEnter: (H) => !O && !X && (H.currentTarget.style.background = e.bg),
1683
+ onMouseLeave: (H) => !O && !X && (H.currentTarget.style.background = "transparent"),
1681
1684
  children: [
1682
1685
  /* @__PURE__ */ t(
1683
1686
  "span",
1684
1687
  {
1685
1688
  style: { width: 16, textAlign: "center", fontSize: 11, color: e.textMut, flexShrink: 0 },
1686
- onClick: (B) => {
1687
- B.stopPropagation(), P && v(z.id);
1689
+ onClick: (H) => {
1690
+ H.stopPropagation(), j && R(z.id);
1688
1691
  },
1689
- children: P ? O ? "▾" : "▸" : ""
1692
+ children: j ? Y ? "▾" : "▸" : ""
1690
1693
  }
1691
1694
  ),
1692
- /* @__PURE__ */ t("span", { style: { fontSize: 15, flexShrink: 0 }, children: P ? O ? "📂" : "📁" : "📄" }),
1695
+ /* @__PURE__ */ t("span", { style: { fontSize: 15, flexShrink: 0 }, children: j ? Y ? "📂" : "📁" : "📄" }),
1693
1696
  i && /* @__PURE__ */ t(
1694
1697
  "input",
1695
1698
  {
1696
- ref: (B) => {
1697
- B && (B.indeterminate = te);
1699
+ ref: (H) => {
1700
+ H && (H.indeterminate = ne);
1698
1701
  },
1699
1702
  type: "checkbox",
1700
1703
  checked: oe,
1701
- onChange: (B) => {
1702
- B.stopPropagation(), H(z.id, B.target.checked);
1704
+ onChange: (H) => {
1705
+ H.stopPropagation(), C(z.id, H.target.checked);
1703
1706
  },
1704
1707
  style: { cursor: "pointer", accentColor: e.primary, flexShrink: 0 },
1705
- onClick: (B) => B.stopPropagation()
1708
+ onClick: (H) => H.stopPropagation()
1706
1709
  }
1707
1710
  ),
1708
- $ === z.id ? /* @__PURE__ */ t(
1711
+ k === z.id ? /* @__PURE__ */ t(
1709
1712
  "input",
1710
1713
  {
1711
1714
  autoFocus: !0,
1712
1715
  className: "dhx dhx-input",
1713
1716
  style: { height: 24, fontSize: 12, flex: 1 },
1714
- value: N,
1715
- onChange: (B) => k(B.target.value),
1716
- onBlur: _,
1717
- onKeyDown: (B) => {
1718
- B.key === "Enter" && _(), B.key === "Escape" && C(null);
1717
+ value: L,
1718
+ onChange: (H) => m(H.target.value),
1719
+ onBlur: P,
1720
+ onKeyDown: (H) => {
1721
+ H.key === "Enter" && P(), H.key === "Escape" && $(null);
1719
1722
  },
1720
- onClick: (B) => B.stopPropagation()
1723
+ onClick: (H) => H.stopPropagation()
1721
1724
  }
1722
1725
  ) : /* @__PURE__ */ t("span", { style: { flex: 1 }, children: z.value }),
1723
- z.count !== void 0 && /* @__PURE__ */ x("span", { style: { fontSize: 11, color: e.textMut }, children: [
1726
+ z.count !== void 0 && /* @__PURE__ */ g("span", { style: { fontSize: 11, color: e.textMut }, children: [
1724
1727
  "(",
1725
1728
  z.count,
1726
1729
  ")"
@@ -1728,7 +1731,7 @@ function Ot({
1728
1731
  ]
1729
1732
  }
1730
1733
  ),
1731
- P && O && /* @__PURE__ */ t("div", { children: z.items.map((B) => T(B, A + 1)) })
1734
+ j && Y && /* @__PURE__ */ t("div", { children: z.items.map((H) => N(H, B + 1)) })
1732
1735
  ] }, z.id);
1733
1736
  };
1734
1737
  return /* @__PURE__ */ t(
@@ -1738,15 +1741,15 @@ function Ot({
1738
1741
  style: { overflowY: "auto", ...y },
1739
1742
  onDragOver: s ? (z) => z.preventDefault() : void 0,
1740
1743
  onDrop: s ? (z) => {
1741
- z.preventDefault(), I(null), W(null);
1744
+ z.preventDefault(), I(null), A(null);
1742
1745
  } : void 0,
1743
- children: w.map((z) => T(z))
1746
+ children: w.map((z) => N(z))
1744
1747
  }
1745
1748
  );
1746
1749
  }
1747
1750
  function Yt({ total: n, pageSize: i = 10, page: p, onChange: s, style: f }) {
1748
- const [a, h] = L(p || 1), d = Math.ceil(n / i);
1749
- F(V, []);
1751
+ const [a, h] = T(p || 1), d = Math.ceil(n / i);
1752
+ K(_, []);
1750
1753
  const y = (r) => {
1751
1754
  const l = Math.min(Math.max(1, r), d);
1752
1755
  h(l), s == null || s(l);
@@ -1755,8 +1758,8 @@ function Yt({ total: n, pageSize: i = 10, page: p, onChange: s, style: f }) {
1755
1758
  for (let c = Math.max(1, a - 2); c <= Math.min(d, a + 2); c++) r.push(c);
1756
1759
  return r[0] > 1 && (r[0] > 2 && r.unshift("..."), r.unshift(1)), r[r.length - 1] < d && (r[r.length - 1] < d - 1 && r.push("..."), r.push(d)), r;
1757
1760
  }, [a, d]);
1758
- return /* @__PURE__ */ x("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 4, padding: "8px 12px", ...f }, children: [
1759
- /* @__PURE__ */ x("span", { style: { fontSize: 12, color: e.textSec, marginRight: 8 }, children: [
1761
+ return /* @__PURE__ */ g("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 4, padding: "8px 12px", ...f }, children: [
1762
+ /* @__PURE__ */ g("span", { style: { fontSize: 12, color: e.textSec, marginRight: 8 }, children: [
1760
1763
  (a - 1) * i + 1,
1761
1764
  "–",
1762
1765
  Math.min(a * i, n),
@@ -1769,165 +1772,170 @@ function Yt({ total: n, pageSize: i = 10, page: p, onChange: s, style: f }) {
1769
1772
  ] });
1770
1773
  }
1771
1774
  function Ft({ config: n = {}, defaultValues: i = {}, onSubmit: p, style: s }) {
1772
- const [f, a] = L(i), [h, d] = L({}), [y, w] = L(null);
1773
- F(V, []);
1774
- const r = (o, g) => {
1775
- a((m) => ({ ...m, [o]: g })), d((m) => ({ ...m, [o]: null }));
1776
- }, l = () => {
1775
+ const [f, a] = T(i), [h, d] = T({}), [y, w] = T(null);
1776
+ K(_, []);
1777
+ const r = (o, x) => {
1778
+ a((k) => ({ ...k, [o]: x })), d((k) => ({ ...k, [o]: null }));
1779
+ }, l = (o) => {
1780
+ const x = [];
1781
+ return o.flat().forEach((k) => {
1782
+ !k || typeof k != "object" || !("name" in k) || (x.push(k), k.type === "fieldset" && k.rows && x.push(...l(k.rows)));
1783
+ }), x;
1784
+ }, c = () => {
1777
1785
  const o = {};
1778
- return (n.rows || []).flat().forEach((g) => {
1779
- g && typeof g == "object" && "name" in g && g.required && !f[g.name] && (o[g.name] = `${g.label || g.name} is required`);
1786
+ return l(n.rows || []).forEach((x) => {
1787
+ x.required && !f[x.name] && (o[x.name] = `${x.label || x.name} is required`);
1780
1788
  }), d(o), Object.keys(o).length === 0;
1781
- }, c = (o) => {
1782
- const g = f[o.name] ?? o.value ?? "", m = h[o.name], $ = o.labelWidth ?? n.labelWidth, C = $ !== void 0 || o.labelPosition === "left";
1783
- if (o.type === "fieldset") return /* @__PURE__ */ x("fieldset", { style: { border: `1px solid ${e.border}`, borderRadius: e.r, padding: "12px 16px", marginBottom: 14 }, children: [
1789
+ }, b = (o) => {
1790
+ const x = f[o.name] ?? o.value ?? "", k = h[o.name], $ = o.labelWidth ?? n.labelWidth, L = $ !== void 0 || o.labelPosition === "left";
1791
+ if (o.type === "fieldset") return /* @__PURE__ */ g("fieldset", { style: { border: `1px solid ${e.border}`, borderRadius: e.r, padding: "12px 16px", marginBottom: 14 }, children: [
1784
1792
  /* @__PURE__ */ t("legend", { style: { fontSize: 12, fontWeight: 700, color: e.textSec, padding: "0 6px" }, children: o.label }),
1785
- (o.rows || []).map((v) => c(v))
1793
+ (o.rows || []).map((C) => b(C))
1786
1794
  ] }, o.name);
1787
1795
  if (o.type === "spacer") return /* @__PURE__ */ t("div", { style: { height: o.height || 16 } }, o.name);
1788
- const N = $ ? { minWidth: $, width: $, flexShrink: 0, paddingTop: 8, boxSizing: "border-box" } : {}, k = o.label ? /* @__PURE__ */ x("label", { className: "dhx dhx-label", style: { display: "flex", gap: 4, ...N }, children: [
1796
+ const m = $ ? { minWidth: $, width: $, flexShrink: 0, paddingTop: 8, boxSizing: "border-box" } : {}, M = o.label ? /* @__PURE__ */ g("label", { className: "dhx dhx-label", style: { display: "flex", gap: 4, ...m }, children: [
1789
1797
  o.label,
1790
1798
  o.required && /* @__PURE__ */ t("span", { style: { color: e.danger }, children: "*" })
1791
- ] }, "lbl") : null, M = m ? /* @__PURE__ */ t("div", { style: { fontSize: 11, color: e.danger, marginTop: 3 }, children: m }) : null, W = o.helpMessage ? /* @__PURE__ */ x("div", { style: { fontSize: 11, color: e.textMut, marginTop: 3 }, children: [
1799
+ ] }, "lbl") : null, A = k ? /* @__PURE__ */ t("div", { style: { fontSize: 11, color: e.danger, marginTop: 3 }, children: k }) : null, u = o.helpMessage ? /* @__PURE__ */ g("div", { style: { fontSize: 11, color: e.textMut, marginTop: 3 }, children: [
1792
1800
  "ⓘ ",
1793
1801
  o.helpMessage
1794
- ] }) : null, u = { key: o.name, className: "dhx-form-group" }, I = (v) => C ? /* @__PURE__ */ x("div", { ...u, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1795
- k,
1796
- /* @__PURE__ */ x("div", { style: { flex: 1, minWidth: 0 }, children: [
1797
- v,
1798
- M,
1799
- W
1802
+ ] }) : null, I = { key: o.name, className: "dhx-form-group" }, R = (C) => L ? /* @__PURE__ */ g("div", { ...I, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1803
+ M,
1804
+ /* @__PURE__ */ g("div", { style: { flex: 1, minWidth: 0 }, children: [
1805
+ C,
1806
+ A,
1807
+ u
1800
1808
  ] })
1801
- ] }) : /* @__PURE__ */ x("div", { ...u, children: [
1802
- k,
1803
- v,
1809
+ ] }) : /* @__PURE__ */ g("div", { ...I, children: [
1804
1810
  M,
1805
- W
1811
+ C,
1812
+ A,
1813
+ u
1806
1814
  ] });
1807
- if (!o.type || o.type === "input") return I(
1808
- /* @__PURE__ */ x("div", { className: "dhx-input-wrap", children: [
1815
+ if (!o.type || o.type === "input") return R(
1816
+ /* @__PURE__ */ g("div", { className: "dhx-input-wrap", children: [
1809
1817
  o.icon && /* @__PURE__ */ t("span", { className: "dhx-input-icon", children: o.icon }),
1810
1818
  /* @__PURE__ */ t(
1811
1819
  "input",
1812
1820
  {
1813
1821
  className: `dhx dhx-input${o.icon ? " dhx-input--with-icon" : ""}`,
1814
- style: { borderColor: m ? e.danger : void 0 },
1822
+ style: { borderColor: k ? e.danger : void 0 },
1815
1823
  type: o.inputType || "text",
1816
1824
  placeholder: o.placeholder,
1817
- value: g,
1818
- onChange: (v) => r(o.name, v.target.value),
1825
+ value: x,
1826
+ onChange: (C) => r(o.name, C.target.value),
1819
1827
  disabled: o.disabled
1820
1828
  }
1821
1829
  )
1822
1830
  ] })
1823
1831
  );
1824
- if (o.type === "textarea") return I(
1832
+ if (o.type === "textarea") return R(
1825
1833
  /* @__PURE__ */ t(
1826
1834
  "textarea",
1827
1835
  {
1828
1836
  className: "dhx dhx-input",
1829
1837
  style: { height: 80, resize: "vertical", padding: "8px 10px" },
1830
1838
  placeholder: o.placeholder,
1831
- value: g,
1832
- onChange: (v) => r(o.name, v.target.value)
1839
+ value: x,
1840
+ onChange: (C) => r(o.name, C.target.value)
1833
1841
  }
1834
1842
  )
1835
1843
  );
1836
- if (o.type === "select") return I(
1837
- /* @__PURE__ */ x("select", { className: "dhx dhx-input", value: g, onChange: (v) => r(o.name, v.target.value), style: { cursor: "pointer" }, children: [
1844
+ if (o.type === "select") return R(
1845
+ /* @__PURE__ */ g("select", { className: "dhx dhx-input", value: x, onChange: (C) => r(o.name, C.target.value), style: { cursor: "pointer" }, children: [
1838
1846
  /* @__PURE__ */ t("option", { value: "", children: "— Select —" }),
1839
- (o.options || []).map((v) => /* @__PURE__ */ t("option", { value: v.value, children: v.label || v.value }, v.value))
1847
+ (o.options || []).map((C) => /* @__PURE__ */ t("option", { value: C.value, children: C.label || C.value }, C.value))
1840
1848
  ] })
1841
1849
  );
1842
- if (o.type === "datepicker") return I(
1843
- /* @__PURE__ */ t("input", { type: "date", className: "dhx dhx-input", value: g, onChange: (v) => r(o.name, v.target.value) })
1850
+ if (o.type === "datepicker") return R(
1851
+ /* @__PURE__ */ t("input", { type: "date", className: "dhx dhx-input", value: x, onChange: (C) => r(o.name, C.target.value) })
1844
1852
  );
1845
1853
  if (o.type === "timepicker") {
1846
- const v = f[o.name] ?? { h: 12, m: 0, ampm: "AM" }, H = !!f[o.name], _ = H ? `${String(v.h).padStart(2, "0")}:${String(v.m).padStart(2, "0")}${v.ampm ? " " + v.ampm : ""}` : o.placeholder || "Click to select", G = /* @__PURE__ */ x("div", { style: { position: "relative" }, children: [
1847
- /* @__PURE__ */ x(
1854
+ const C = f[o.name] ?? { h: 12, m: 0, ampm: "AM" }, P = !!f[o.name], q = P ? `${String(C.h).padStart(2, "0")}:${String(C.m).padStart(2, "0")}${C.ampm ? " " + C.ampm : ""}` : o.placeholder || "Click to select", Q = /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
1855
+ /* @__PURE__ */ g(
1848
1856
  "div",
1849
1857
  {
1850
1858
  className: "dhx dhx-input",
1851
1859
  style: { cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "space-between" },
1852
1860
  onClick: () => w(y === o.name ? null : o.name),
1853
1861
  children: [
1854
- /* @__PURE__ */ t("span", { style: { color: H ? e.text : e.textMut }, children: _ }),
1862
+ /* @__PURE__ */ t("span", { style: { color: P ? e.text : e.textMut }, children: q }),
1855
1863
  /* @__PURE__ */ t("span", { style: { fontSize: 13, color: e.textSec }, children: "🕐" })
1856
1864
  ]
1857
1865
  }
1858
1866
  ),
1859
- y === o.name && /* @__PURE__ */ t("div", { style: { position: "absolute", zIndex: 100, top: "calc(100% + 4px)", left: 0 }, children: /* @__PURE__ */ t(gt, { value: v, controls: !0, onChange: (Q) => {
1860
- r(o.name, Q), w(null);
1867
+ y === o.name && /* @__PURE__ */ t("div", { style: { position: "absolute", zIndex: 100, top: "calc(100% + 4px)", left: 0 }, children: /* @__PURE__ */ t(gt, { value: C, controls: !0, onChange: (ee) => {
1868
+ r(o.name, ee), w(null);
1861
1869
  } }) })
1862
1870
  ] });
1863
- return I(G);
1871
+ return R(Q);
1864
1872
  }
1865
- if (o.type === "colorpicker") return I(
1866
- /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1873
+ if (o.type === "colorpicker") return R(
1874
+ /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1867
1875
  /* @__PURE__ */ t(
1868
1876
  "input",
1869
1877
  {
1870
1878
  type: "color",
1871
- value: g || "#000000",
1872
- onChange: (v) => r(o.name, v.target.value),
1879
+ value: x || "#000000",
1880
+ onChange: (C) => r(o.name, C.target.value),
1873
1881
  style: { width: 36, height: 36, padding: 2, border: `1px solid ${e.border}`, borderRadius: e.r, cursor: "pointer", background: "none" }
1874
1882
  }
1875
1883
  ),
1876
- /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontFamily: "monospace" }, children: g || "#000000" })
1884
+ /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontFamily: "monospace" }, children: x || "#000000" })
1877
1885
  ] })
1878
1886
  );
1879
- if (o.type === "text") return I(
1887
+ if (o.type === "text") return R(
1880
1888
  /* @__PURE__ */ t("p", { style: { margin: "6px 0", fontSize: 13, color: e.text }, children: o.value })
1881
1889
  );
1882
- if (o.type === "checkbox") return /* @__PURE__ */ x("div", { ...u, children: [
1883
- C ? /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1890
+ if (o.type === "checkbox") return /* @__PURE__ */ g("div", { ...I, children: [
1891
+ L ? /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1884
1892
  $ && /* @__PURE__ */ t("div", { style: { width: $, flexShrink: 0 } }),
1885
- /* @__PURE__ */ x("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
1886
- /* @__PURE__ */ t("input", { type: "checkbox", checked: !!g, onChange: (v) => r(o.name, v.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
1893
+ /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
1894
+ /* @__PURE__ */ t("input", { type: "checkbox", checked: !!x, onChange: (C) => r(o.name, C.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
1887
1895
  /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: o.label })
1888
1896
  ] })
1889
- ] }) : /* @__PURE__ */ x("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
1890
- /* @__PURE__ */ t("input", { type: "checkbox", checked: !!g, onChange: (v) => r(o.name, v.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
1897
+ ] }) : /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
1898
+ /* @__PURE__ */ t("input", { type: "checkbox", checked: !!x, onChange: (C) => r(o.name, C.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
1891
1899
  /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: o.label })
1892
1900
  ] }),
1893
- W
1901
+ u
1894
1902
  ] });
1895
1903
  if (o.type === "radio") {
1896
- const v = (o.options || []).map((H) => /* @__PURE__ */ x("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer", fontSize: 13 }, children: [
1904
+ const C = (o.options || []).map((P) => /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer", fontSize: 13 }, children: [
1897
1905
  /* @__PURE__ */ t(
1898
1906
  "input",
1899
1907
  {
1900
1908
  type: "radio",
1901
1909
  name: o.name,
1902
- value: H.value,
1903
- checked: g === H.value,
1904
- onChange: () => r(o.name, H.value),
1910
+ value: P.value,
1911
+ checked: x === P.value,
1912
+ onChange: () => r(o.name, P.value),
1905
1913
  style: { accentColor: e.primary, cursor: "pointer" }
1906
1914
  }
1907
1915
  ),
1908
- H.label || H.value
1909
- ] }, H.value));
1910
- return I(
1911
- /* @__PURE__ */ t("div", { style: { display: "flex", gap: 16, flexWrap: "wrap", paddingTop: 8 }, children: v })
1916
+ P.label || P.value
1917
+ ] }, P.value));
1918
+ return R(
1919
+ /* @__PURE__ */ t("div", { style: { display: "flex", gap: 16, flexWrap: "wrap", paddingTop: 8 }, children: C })
1912
1920
  );
1913
1921
  }
1914
- if (o.type === "slider") return C ? /* @__PURE__ */ x("div", { ...u, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1915
- k,
1916
- /* @__PURE__ */ x("div", { style: { flex: 1 }, children: [
1922
+ if (o.type === "slider") return L ? /* @__PURE__ */ g("div", { ...I, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1923
+ M,
1924
+ /* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
1917
1925
  /* @__PURE__ */ t(
1918
1926
  De,
1919
1927
  {
1920
1928
  min: o.min,
1921
1929
  max: o.max,
1922
1930
  step: o.step,
1923
- value: g || o.min,
1931
+ value: x || o.min,
1924
1932
  range: o.range,
1925
- onChange: (v) => r(o.name, v)
1933
+ onChange: (C) => r(o.name, C)
1926
1934
  }
1927
1935
  ),
1928
- W
1936
+ u
1929
1937
  ] })
1930
- ] }) : /* @__PURE__ */ x("div", { ...u, children: [
1938
+ ] }) : /* @__PURE__ */ g("div", { ...I, children: [
1931
1939
  /* @__PURE__ */ t(
1932
1940
  De,
1933
1941
  {
@@ -1935,30 +1943,30 @@ function Ft({ config: n = {}, defaultValues: i = {}, onSubmit: p, style: s }) {
1935
1943
  min: o.min,
1936
1944
  max: o.max,
1937
1945
  step: o.step,
1938
- value: g || o.min,
1946
+ value: x || o.min,
1939
1947
  range: o.range,
1940
- onChange: (v) => r(o.name, v)
1948
+ onChange: (C) => r(o.name, C)
1941
1949
  }
1942
1950
  ),
1943
- W
1951
+ u
1944
1952
  ] });
1945
- if (o.type === "combo") return C ? /* @__PURE__ */ x("div", { ...u, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1946
- k,
1947
- /* @__PURE__ */ x("div", { style: { flex: 1 }, children: [
1953
+ if (o.type === "combo") return L ? /* @__PURE__ */ g("div", { ...I, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1954
+ M,
1955
+ /* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
1948
1956
  /* @__PURE__ */ t(
1949
1957
  $e,
1950
1958
  {
1951
1959
  data: o.data || [],
1952
1960
  multiselection: o.multiselection,
1953
1961
  placeholder: o.placeholder || "Select...",
1954
- value: g || (o.multiselection ? [] : null),
1955
- onChange: (v) => r(o.name, v)
1962
+ value: x || (o.multiselection ? [] : null),
1963
+ onChange: (C) => r(o.name, C)
1956
1964
  }
1957
1965
  ),
1958
- M,
1959
- W
1966
+ A,
1967
+ u
1960
1968
  ] })
1961
- ] }) : /* @__PURE__ */ x("div", { ...u, children: [
1969
+ ] }) : /* @__PURE__ */ g("div", { ...I, children: [
1962
1970
  /* @__PURE__ */ t(
1963
1971
  $e,
1964
1972
  {
@@ -1966,40 +1974,40 @@ function Ft({ config: n = {}, defaultValues: i = {}, onSubmit: p, style: s }) {
1966
1974
  data: o.data || [],
1967
1975
  multiselection: o.multiselection,
1968
1976
  placeholder: o.placeholder || "Select...",
1969
- value: g || (o.multiselection ? [] : null),
1970
- onChange: (v) => r(o.name, v)
1977
+ value: x || (o.multiselection ? [] : null),
1978
+ onChange: (C) => r(o.name, C)
1971
1979
  }
1972
1980
  ),
1973
- M,
1974
- W
1981
+ A,
1982
+ u
1975
1983
  ] });
1976
1984
  if (o.type === "toggle") {
1977
- const v = !!g, H = v ? o.icon : o.offIcon || o.icon, _ = v ? o.text || o.label : o.offText || o.text || o.label;
1978
- return /* @__PURE__ */ x("div", { ...u, children: [
1979
- C && $ && /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1985
+ const C = !!x, P = C ? o.icon : o.offIcon || o.icon, q = C ? o.text || o.label : o.offText || o.text || o.label;
1986
+ return /* @__PURE__ */ g("div", { ...I, children: [
1987
+ L && $ && /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1980
1988
  /* @__PURE__ */ t("div", { style: { width: $, flexShrink: 0 } }),
1981
- /* @__PURE__ */ x("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
1982
- /* @__PURE__ */ t(Le, { on: v, onClick: () => r(o.name, !g) }),
1983
- H && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: H }),
1984
- _ && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: _ })
1989
+ /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
1990
+ /* @__PURE__ */ t(Le, { on: C, onClick: () => r(o.name, !x) }),
1991
+ P && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: P }),
1992
+ q && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: q })
1985
1993
  ] })
1986
1994
  ] }),
1987
- !C && /* @__PURE__ */ x("label", { style: { display: "flex", alignItems: "center", gap: 10, cursor: "pointer" }, children: [
1988
- /* @__PURE__ */ t(Le, { on: v, onClick: () => r(o.name, !g) }),
1989
- H && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: H }),
1990
- _ && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: _ })
1995
+ !L && /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 10, cursor: "pointer" }, children: [
1996
+ /* @__PURE__ */ t(Le, { on: C, onClick: () => r(o.name, !x) }),
1997
+ P && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: P }),
1998
+ q && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: q })
1991
1999
  ] }),
1992
- W
2000
+ u
1993
2001
  ] });
1994
2002
  }
1995
2003
  return null;
1996
- }, b = (o) => o.map(
1997
- (g, m) => Array.isArray(g) ? /* @__PURE__ */ t("div", { style: { display: "flex", gap: 12, alignItems: "flex-start" }, children: g.map(c) }, m) : c(g)
2004
+ }, S = (o) => o.map(
2005
+ (x, k) => Array.isArray(x) ? /* @__PURE__ */ t("div", { style: { display: "flex", gap: 12, alignItems: "flex-start" }, children: x.map(b) }, k) : b(x)
1998
2006
  );
1999
- return /* @__PURE__ */ x("div", { className: "dhx", style: { padding: n.padding || 0, width: n.width || "100%", ...s }, children: [
2000
- b(n.rows || []),
2001
- (n.buttons || p) && /* @__PURE__ */ x("div", { style: { display: "flex", gap: 8, justifyContent: n.buttonAlign || "flex-start", marginTop: 8 }, children: [
2002
- /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => l() && (p == null ? void 0 : p(f)), children: n.submitText || "Submit" }),
2007
+ return /* @__PURE__ */ g("div", { className: "dhx", style: { padding: n.padding || 0, width: n.width || "100%", ...s }, children: [
2008
+ S(n.rows || []),
2009
+ (n.buttons || p) && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, justifyContent: n.buttonAlign || "flex-start", marginTop: 8 }, children: [
2010
+ /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => c() && (p == null ? void 0 : p(f)), children: n.submitText || "Submit" }),
2003
2011
  n.resetButton !== !1 && /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => {
2004
2012
  a(i), d({});
2005
2013
  }, children: n.resetText || "Reset" })
@@ -2007,7 +2015,7 @@ function Ft({ config: n = {}, defaultValues: i = {}, onSubmit: p, style: s }) {
2007
2015
  ] });
2008
2016
  }
2009
2017
  function Le({ on: n, onClick: i }) {
2010
- return /* @__PURE__ */ x("div", { style: { position: "relative", width: 40, height: 22, flexShrink: 0 }, onClick: i, children: [
2018
+ return /* @__PURE__ */ g("div", { style: { position: "relative", width: 40, height: 22, flexShrink: 0 }, onClick: i, children: [
2011
2019
  /* @__PURE__ */ t("div", { style: { width: 40, height: 22, borderRadius: 11, background: n ? e.primary : e.border, transition: "background 0.2s" } }),
2012
2020
  /* @__PURE__ */ t("div", { style: { position: "absolute", top: 3, left: n ? 21 : 3, width: 16, height: 16, borderRadius: "50%", background: "#fff", transition: "left 0.2s", boxShadow: "0 1px 3px rgba(0,0,0,.3)" } })
2013
2021
  ] });
@@ -2019,8 +2027,8 @@ function ke(n) {
2019
2027
  return i;
2020
2028
  }
2021
2029
  function Kt({ items: n = [], onAction: i, style: p }) {
2022
- F(V, []);
2023
- const [s, f] = L(() => {
2030
+ K(_, []);
2031
+ const [s, f] = T(() => {
2024
2032
  const l = {};
2025
2033
  for (const c of ke(n))
2026
2034
  c.id && (l[c.id] = !!c.active);
@@ -2030,22 +2038,22 @@ function Kt({ items: n = [], onAction: i, style: p }) {
2030
2038
  if (!l.disabled) {
2031
2039
  if (l.id)
2032
2040
  if (l.group) {
2033
- const b = a.filter((o) => o.group === l.group && o.id);
2034
- f((o) => {
2035
- const g = { ...o };
2036
- for (const m of b) g[m.id] = !1;
2037
- return g[l.id] = !0, g;
2041
+ const b = a.filter((S) => S.group === l.group && S.id);
2042
+ f((S) => {
2043
+ const o = { ...S };
2044
+ for (const x of b) o[x.id] = !1;
2045
+ return o[l.id] = !0, o;
2038
2046
  });
2039
2047
  } else l.twoState && f((b) => ({ ...b, [l.id]: !b[l.id] }));
2040
2048
  (c = l.onClick) == null || c.call(l, l), l.id && (i == null || i(l.id, l));
2041
2049
  }
2042
2050
  }, d = (l, c) => {
2043
- var m;
2051
+ var x;
2044
2052
  if (l.hidden) return null;
2045
- const b = l.value ?? l.text, o = l.size === "auto", g = l.id !== void 0 ? s[l.id] ?? !!l.active : !!l.active;
2046
- return l.type === "separator" || l.type === "sep" ? /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "4px 2px", alignSelf: "stretch" } }, c) : l.type === "input" ? /* @__PURE__ */ x("div", { style: { display: "flex", flexDirection: "column", alignItems: "flex-start", justifyContent: "center", padding: "2px 4px", gap: 2 }, children: [
2053
+ const b = l.value ?? l.text, S = l.size === "auto", o = l.id !== void 0 ? s[l.id] ?? !!l.active : !!l.active;
2054
+ return l.type === "separator" || l.type === "sep" ? /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "4px 2px", alignSelf: "stretch" } }, c) : l.type === "input" ? /* @__PURE__ */ g("div", { style: { display: "flex", flexDirection: "column", alignItems: "flex-start", justifyContent: "center", padding: "2px 4px", gap: 2 }, children: [
2047
2055
  l.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: l.label }),
2048
- /* @__PURE__ */ x("div", { style: { position: "relative", display: "flex", alignItems: "center" }, children: [
2056
+ /* @__PURE__ */ g("div", { style: { position: "relative", display: "flex", alignItems: "center" }, children: [
2049
2057
  l.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 6, fontSize: 13, color: e.textMut, pointerEvents: "none", zIndex: 1 }, children: l.icon }),
2050
2058
  /* @__PURE__ */ t(
2051
2059
  "input",
@@ -2054,9 +2062,9 @@ function Kt({ items: n = [], onAction: i, style: p }) {
2054
2062
  style: { width: l.width || 110, height: 26, fontSize: 12, paddingLeft: l.icon ? 24 : void 0 },
2055
2063
  placeholder: l.placeholder,
2056
2064
  defaultValue: l.value,
2057
- onChange: ($) => {
2058
- var C;
2059
- return (C = l.onChange) == null ? void 0 : C.call(l, $.target.value);
2065
+ onChange: (k) => {
2066
+ var $;
2067
+ return ($ = l.onChange) == null ? void 0 : $.call(l, k.target.value);
2060
2068
  }
2061
2069
  }
2062
2070
  )
@@ -2067,41 +2075,41 @@ function Kt({ items: n = [], onAction: i, style: p }) {
2067
2075
  className: "dhx dhx-input",
2068
2076
  style: { height: 26, fontSize: 12, cursor: "pointer", margin: 2, width: l.width },
2069
2077
  defaultValue: l.value,
2070
- onChange: ($) => {
2071
- var C;
2072
- return (C = l.onChange) == null ? void 0 : C.call(l, $.target.value);
2078
+ onChange: (k) => {
2079
+ var $;
2080
+ return ($ = l.onChange) == null ? void 0 : $.call(l, k.target.value);
2073
2081
  },
2074
- children: (m = l.items) == null ? void 0 : m.map(($) => /* @__PURE__ */ t("option", { value: $.value, children: $.value }, $.value))
2082
+ children: (x = l.items) == null ? void 0 : x.map((k) => /* @__PURE__ */ t("option", { value: k.value, children: k.value }, k.value))
2075
2083
  },
2076
2084
  c
2077
- ) : /* @__PURE__ */ x(
2085
+ ) : /* @__PURE__ */ g(
2078
2086
  "button",
2079
2087
  {
2080
2088
  title: l.tooltip,
2081
2089
  disabled: l.disabled,
2082
2090
  className: "dhx dhx-btn dhx-btn-ghost",
2083
2091
  style: {
2084
- flexDirection: o ? "column" : "row",
2085
- alignSelf: o ? "stretch" : "center",
2092
+ flexDirection: S ? "column" : "row",
2093
+ alignSelf: S ? "stretch" : "center",
2086
2094
  justifyContent: "center",
2087
- minHeight: o ? 48 : 26,
2088
- padding: o ? "6px 10px" : "0 8px",
2089
- gap: o ? 4 : 5,
2095
+ minHeight: S ? 48 : 26,
2096
+ padding: S ? "6px 10px" : "0 8px",
2097
+ gap: S ? 4 : 5,
2090
2098
  position: "relative",
2091
- background: g ? e.primaryLt : "transparent",
2092
- color: g ? e.primary : l.disabled ? e.textMut : e.text,
2099
+ background: o ? e.primaryLt : "transparent",
2100
+ color: o ? e.primary : l.disabled ? e.textMut : e.text,
2093
2101
  opacity: l.disabled ? 0.55 : 1,
2094
2102
  cursor: l.disabled ? "not-allowed" : "pointer"
2095
2103
  },
2096
2104
  onClick: () => h(l),
2097
2105
  children: [
2098
- l.icon && /* @__PURE__ */ t("span", { style: { fontSize: o ? 22 : 15, lineHeight: 1, flexShrink: 0 }, children: l.icon }),
2106
+ l.icon && /* @__PURE__ */ t("span", { style: { fontSize: S ? 22 : 15, lineHeight: 1, flexShrink: 0 }, children: l.icon }),
2099
2107
  b && /* @__PURE__ */ t("span", { style: {
2100
2108
  fontSize: 10,
2101
- maxWidth: o ? 64 : void 0,
2102
- textAlign: o ? "center" : "left",
2109
+ maxWidth: S ? 64 : void 0,
2110
+ textAlign: S ? "center" : "left",
2103
2111
  lineHeight: 1.2,
2104
- whiteSpace: o ? "normal" : "nowrap"
2112
+ whiteSpace: S ? "normal" : "nowrap"
2105
2113
  }, children: b }),
2106
2114
  l.count !== void 0 && /* @__PURE__ */ t("span", { style: {
2107
2115
  position: "absolute",
@@ -2132,12 +2140,12 @@ function Kt({ items: n = [], onAction: i, style: p }) {
2132
2140
  alignItems: l.direction === "col" ? "flex-start" : "center",
2133
2141
  gap: 2
2134
2142
  }, children: (b = l.items) == null ? void 0 : b.map(
2135
- (o, g) => o.type === "block" ? y(o, `${c}-${g}`) : d(o, `${c}-${g}`)
2143
+ (S, o) => S.type === "block" ? y(S, `${c}-${o}`) : d(S, `${c}-${o}`)
2136
2144
  ) }, c);
2137
2145
  }, w = (l, c) => {
2138
- var o;
2146
+ var S;
2139
2147
  const b = l.title || l.label;
2140
- return /* @__PURE__ */ x("div", { style: {
2148
+ return /* @__PURE__ */ g("div", { style: {
2141
2149
  display: "flex",
2142
2150
  flexDirection: "column",
2143
2151
  alignItems: "stretch",
@@ -2151,8 +2159,8 @@ function Kt({ items: n = [], onAction: i, style: p }) {
2151
2159
  alignItems: l.direction === "col" ? "stretch" : "center",
2152
2160
  gap: 2,
2153
2161
  flex: 1
2154
- }, children: (o = l.items) == null ? void 0 : o.map(
2155
- (g, m) => g.type === "block" ? y(g, m) : d(g, m)
2162
+ }, children: (S = l.items) == null ? void 0 : S.map(
2163
+ (o, x) => o.type === "block" ? y(o, x) : d(o, x)
2156
2164
  ) }),
2157
2165
  b && /* @__PURE__ */ t("div", { style: {
2158
2166
  fontSize: 10,
@@ -2196,24 +2204,24 @@ function Te({ count: n }) {
2196
2204
  }, children: n });
2197
2205
  }
2198
2206
  function Vt({ logo: n, items: i = [], vertical: p = !1, onAction: s, style: f }) {
2199
- const [a, h] = L(null), [d, y] = L(() => {
2207
+ const [a, h] = T(null), [d, y] = T(() => {
2200
2208
  const c = {};
2201
2209
  return i.forEach((b) => {
2202
2210
  b.id && b.twoState && b.active && (c[b.id] = !0);
2203
2211
  }), c;
2204
2212
  }), w = U(null);
2205
- F(V, []), he(w, Z(() => h(null), []));
2213
+ K(_, []), he(w, Z(() => h(null), []));
2206
2214
  const r = (c, b) => {
2207
- var o, g;
2215
+ var S, o;
2208
2216
  if (!c.disabled) {
2209
- if (c.twoState && c.id && y((m) => ({ ...m, [c.id]: !m[c.id] })), (o = c.items) != null && o.length) {
2210
- h((m) => m === b ? null : b);
2217
+ if (c.twoState && c.id && y((x) => ({ ...x, [c.id]: !x[c.id] })), (S = c.items) != null && S.length) {
2218
+ h((x) => x === b ? null : b);
2211
2219
  return;
2212
2220
  }
2213
- (g = c.onClick) == null || g.call(c, c.id || ""), s == null || s(c.id || "");
2221
+ (o = c.onClick) == null || o.call(c, c.id || ""), s == null || s(c.id || "");
2214
2222
  }
2215
2223
  }, l = (c, b) => {
2216
- var $;
2224
+ var k;
2217
2225
  if (c.hidden) return null;
2218
2226
  if (c.type === "separator") return /* @__PURE__ */ t("div", { style: {
2219
2227
  [p ? "height" : "width"]: 1,
@@ -2222,7 +2230,7 @@ function Vt({ logo: n, items: i = [], vertical: p = !1, onAction: s, style: f })
2222
2230
  alignSelf: "stretch"
2223
2231
  } }, b);
2224
2232
  if (c.type === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, b);
2225
- if (c.type === "input") return /* @__PURE__ */ x("div", { style: { position: "relative", display: "flex", alignItems: "center", margin: "0 4px" }, children: [
2233
+ if (c.type === "input") return /* @__PURE__ */ g("div", { style: { position: "relative", display: "flex", alignItems: "center", margin: "0 4px" }, children: [
2226
2234
  c.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 8, color: e.textMut, fontSize: 15, pointerEvents: "none", zIndex: 1 }, children: c.icon }),
2227
2235
  /* @__PURE__ */ t(
2228
2236
  "input",
@@ -2230,14 +2238,14 @@ function Vt({ logo: n, items: i = [], vertical: p = !1, onAction: s, style: f })
2230
2238
  className: "dhx dhx-input",
2231
2239
  style: { width: c.width || 200, height: 28, paddingLeft: c.icon ? 30 : void 0 },
2232
2240
  placeholder: c.placeholder,
2233
- onChange: (C) => {
2234
- var N;
2235
- return (N = c.onChange) == null ? void 0 : N.call(c, C.target.value);
2241
+ onChange: ($) => {
2242
+ var L;
2243
+ return (L = c.onChange) == null ? void 0 : L.call(c, $.target.value);
2236
2244
  }
2237
2245
  }
2238
2246
  )
2239
2247
  ] }, b);
2240
- if (c.type === "imageButton") return /* @__PURE__ */ x(
2248
+ if (c.type === "imageButton") return /* @__PURE__ */ g(
2241
2249
  "button",
2242
2250
  {
2243
2251
  title: c.tooltip,
@@ -2262,12 +2270,12 @@ function Vt({ logo: n, items: i = [], vertical: p = !1, onAction: s, style: f })
2262
2270
  },
2263
2271
  b
2264
2272
  );
2265
- const o = !!(c.twoState && c.id && d[c.id]), g = !!(($ = c.items) != null && $.length), m = {
2273
+ const S = !!(c.twoState && c.id && d[c.id]), o = !!((k = c.items) != null && k.length), x = {
2266
2274
  position: "relative",
2267
2275
  height: p ? 40 : 36,
2268
2276
  gap: 6,
2269
- background: o ? e.primaryLt : "transparent",
2270
- color: o ? e.primary : c.disabled ? e.textMut : e.text,
2277
+ background: S ? e.primaryLt : "transparent",
2278
+ color: S ? e.primary : c.disabled ? e.textMut : e.text,
2271
2279
  opacity: c.disabled ? 0.55 : 1,
2272
2280
  cursor: c.disabled ? "not-allowed" : "pointer",
2273
2281
  ...p ? {
@@ -2277,34 +2285,37 @@ function Vt({ logo: n, items: i = [], vertical: p = !1, onAction: s, style: f })
2277
2285
  borderRadius: 0
2278
2286
  } : {}
2279
2287
  };
2280
- return /* @__PURE__ */ x("div", { style: { position: "relative" }, children: [
2281
- /* @__PURE__ */ x(
2288
+ return /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
2289
+ /* @__PURE__ */ g(
2282
2290
  "button",
2283
2291
  {
2284
2292
  className: "dhx dhx-btn dhx-btn-ghost",
2285
2293
  title: c.tooltip,
2286
2294
  disabled: c.disabled,
2287
- style: m,
2295
+ style: x,
2288
2296
  onClick: () => r(c, b),
2289
2297
  children: [
2290
2298
  c.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16, flexShrink: 0 }, children: c.icon }),
2291
2299
  c.value && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: c.value }),
2292
- g && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
2300
+ o && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
2293
2301
  c.count !== void 0 && /* @__PURE__ */ t(Te, { count: c.count })
2294
2302
  ]
2295
2303
  }
2296
2304
  ),
2297
- g && a === b && /* @__PURE__ */ t(
2305
+ o && a === b && /* @__PURE__ */ t(
2298
2306
  fe,
2299
2307
  {
2300
2308
  items: c.items,
2301
- onSelect: () => h(null),
2309
+ onSelect: ($) => {
2310
+ var L;
2311
+ h(null), $.id && ((L = c.onClick) == null || L.call(c, $.id), s == null || s($.id));
2312
+ },
2302
2313
  style: p ? { left: "100%", top: 0 } : { top: "100%" }
2303
2314
  }
2304
2315
  )
2305
2316
  ] }, b);
2306
2317
  };
2307
- return /* @__PURE__ */ x(
2318
+ return /* @__PURE__ */ g(
2308
2319
  "nav",
2309
2320
  {
2310
2321
  ref: w,