dhx-react-suite 1.1.6 → 1.1.8

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,6 +1,6 @@
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
- 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";
1
+ import { jsxs as g, jsx as t, Fragment as Ye } from "react/jsx-runtime";
2
+ import { useEffect as _, useRef as oe, useCallback as ae, useState as N, useMemo as ue, createContext as Qe, useContext as Ze } from "react";
3
+ import { Tooltip as et, Legend as tt, CartesianGrid as nt, XAxis as Ee, YAxis as Re, BarChart as rt, Bar as ot, LineChart as it, Line as lt, AreaChart as st, Area as at, PieChart as dt, Pie as ct, Cell as ut, RadarChart as pt, PolarGrid as ht, PolarAngleAxis as ft, PolarRadiusAxis as xt, Radar as gt, ScatterChart as yt, Scatter as bt, ResponsiveContainer as mt, Treemap as vt } from "recharts";
4
4
  const e = {
5
5
  primary: "#0288d1",
6
6
  primaryDk: "#01579b",
@@ -20,11 +20,11 @@ const e = {
20
20
  r: "4px",
21
21
  rMd: "8px",
22
22
  font: "'Segoe UI', system-ui, -apple-system, sans-serif"
23
- }, ze = "dhx-react-styles";
24
- function _() {
25
- if (typeof document > "u" || document.getElementById(ze)) return;
23
+ }, We = "dhx-react-styles";
24
+ function q() {
25
+ if (typeof document > "u" || document.getElementById(We)) return;
26
26
  const n = document.createElement("style");
27
- n.id = ze, n.textContent = `
27
+ n.id = We, n.textContent = `
28
28
  *,*::before,*::after{box-sizing:border-box}
29
29
  .dhx{font-family:${e.font};font-size:14px;color:${e.text}}
30
30
  .dhx *{box-sizing:border-box}
@@ -66,112 +66,112 @@ function _() {
66
66
  .dhx-tag-warning{background:#fff3e0;color:#e65100}
67
67
  `, document.head.appendChild(n);
68
68
  }
69
- const at = {
69
+ const kt = {
70
70
  sm: { height: 24, padding: "0 8px", fontSize: 12 },
71
71
  md: {},
72
72
  lg: { height: 38, padding: "0 18px", fontSize: 14 }
73
73
  };
74
- function Mt({
74
+ function _t({
75
75
  children: n,
76
- variant: i = "primary",
77
- size: p = "md",
78
- icon: s,
76
+ variant: o = "primary",
77
+ size: d = "md",
78
+ icon: l,
79
79
  disabled: f,
80
80
  onClick: a,
81
81
  style: h,
82
- className: d = ""
82
+ className: u = ""
83
83
  }) {
84
- return K(_, []), /* @__PURE__ */ g(
84
+ return _(q, []), /* @__PURE__ */ g(
85
85
  "button",
86
86
  {
87
- className: `dhx dhx-btn dhx-btn-${i} ${d}`,
88
- style: { ...at[p], ...h },
87
+ className: `dhx dhx-btn dhx-btn-${o} ${u}`,
88
+ style: { ...kt[d], ...h },
89
89
  disabled: f,
90
90
  onClick: a,
91
91
  children: [
92
- s && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: s }),
92
+ l && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: l }),
93
93
  n
94
94
  ]
95
95
  }
96
96
  );
97
97
  }
98
- function he(n, i) {
99
- K(() => {
100
- const p = (s) => {
101
- n.current && !n.current.contains(s.target) && i(s);
98
+ function ge(n, o) {
99
+ _(() => {
100
+ const d = (l) => {
101
+ n.current && !n.current.contains(l.target) && o(l);
102
102
  };
103
- return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
104
- }, [n, i]);
103
+ return document.addEventListener("mousedown", d), () => document.removeEventListener("mousedown", d);
104
+ }, [n, o]);
105
105
  }
106
- function dt(n) {
107
- const i = U(!1), p = U({ x: 0, y: 0, ox: 0, oy: 0 });
108
- return Z(
109
- (s, f = 0, a = 0) => {
110
- i.current = !0, p.current = { x: s.clientX, y: s.clientY, ox: f, oy: a };
111
- const h = (y) => {
112
- if (!i.current) return;
113
- const { x: w, y: r, ox: l, oy: c } = p.current;
114
- n(l + y.clientX - w, c + y.clientY - r);
115
- }, d = () => {
116
- i.current = !1, document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", d);
106
+ function St(n) {
107
+ const o = oe(!1), d = oe({ x: 0, y: 0, ox: 0, oy: 0 });
108
+ return ae(
109
+ (l, f = 0, a = 0) => {
110
+ o.current = !0, d.current = { x: l.clientX, y: l.clientY, ox: f, oy: a };
111
+ const h = (x) => {
112
+ if (!o.current) return;
113
+ const { x: w, y: r, ox: i, oy: c } = d.current;
114
+ n(i + x.clientX - w, c + x.clientY - r);
115
+ }, u = () => {
116
+ o.current = !1, document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", u);
117
117
  };
118
- document.addEventListener("mousemove", h), document.addEventListener("mouseup", d), s.preventDefault();
118
+ document.addEventListener("mousemove", h), document.addEventListener("mouseup", u), l.preventDefault();
119
119
  },
120
120
  [n]
121
121
  );
122
122
  }
123
- function fe({ items: n, onSelect: i, style: p }) {
124
- const [s, f] = T(null);
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
- var y, w;
123
+ function be({ items: n, onSelect: o, style: d }) {
124
+ const [l, f] = N(null);
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", ...d }, children: n.map((a, h) => {
126
+ var x, w;
127
127
  if (a.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "4px 0" } }, h);
128
- const d = s === h;
128
+ const u = l === h;
129
129
  return /* @__PURE__ */ g("div", { style: { position: "relative" }, onMouseEnter: () => f(h), onMouseLeave: () => f(null), children: [
130
130
  /* @__PURE__ */ g(
131
131
  "div",
132
132
  {
133
133
  onClick: () => {
134
134
  var r;
135
- return !a.disabled && !((r = a.items) != null && r.length) && i(a);
135
+ return !a.disabled && !((r = a.items) != null && r.length) && o(a);
136
136
  },
137
- style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 14px", cursor: a.disabled ? "not-allowed" : "pointer", fontSize: 13, color: a.disabled ? e.textMut : e.text, background: d && !a.disabled ? e.bg : "transparent", opacity: a.disabled ? 0.5 : 1 },
137
+ style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 14px", cursor: a.disabled ? "not-allowed" : "pointer", fontSize: 13, color: a.disabled ? e.textMut : e.text, background: u && !a.disabled ? e.bg : "transparent", opacity: a.disabled ? 0.5 : 1 },
138
138
  children: [
139
139
  a.icon && /* @__PURE__ */ t("span", { style: { fontSize: 15, width: 18, textAlign: "center" }, children: a.icon }),
140
140
  /* @__PURE__ */ t("span", { style: { flex: 1 }, children: a.value || a.id }),
141
141
  a.hotkey && /* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textMut }, children: a.hotkey }),
142
- (y = a.items) != null && y.length ? /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: "▶" }) : null
142
+ (x = a.items) != null && x.length ? /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: "▶" }) : null
143
143
  ]
144
144
  }
145
145
  ),
146
- d && ((w = a.items) != null && w.length) ? /* @__PURE__ */ t(fe, { items: a.items, onSelect: i, style: { position: "absolute", left: "100%", top: -4 } }) : null
146
+ u && ((w = a.items) != null && w.length) ? /* @__PURE__ */ t(be, { items: a.items, onSelect: o, style: { position: "absolute", left: "100%", top: -4 } }) : null
147
147
  ] }, a.id || h);
148
148
  }) });
149
149
  }
150
- function $t({ items: n = [], label: i = "Menu", onSelect: p, style: s }) {
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
- i,
150
+ function Vt({ items: n = [], label: o = "Menu", onSelect: d, style: l }) {
151
+ const [f, a] = N(!1), h = oe(null);
152
+ return _(q, []), ge(h, ae(() => a(!1), [])), /* @__PURE__ */ g("div", { ref: h, className: "dhx", style: { position: "relative", display: "inline-block", ...l }, children: [
153
+ /* @__PURE__ */ g("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => a((u) => !u), children: [
154
+ o,
155
155
  " ",
156
156
  /* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: f ? "▲" : "▼" })
157
157
  ] }),
158
- f && /* @__PURE__ */ t(fe, { items: n, onSelect: (d) => {
159
- p == null || p(d), a(!1);
158
+ f && /* @__PURE__ */ t(be, { items: n, onSelect: (u) => {
159
+ d == null || d(u), a(!1);
160
160
  } })
161
161
  ] });
162
162
  }
163
- function Dt({ items: n = [], onSelect: i, children: p }) {
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
- d.preventDefault(), f({ x: d.clientX, y: d.clientY });
163
+ function Xt({ items: n = [], onSelect: o, children: d }) {
164
+ const [l, f] = N(null), a = oe(null);
165
+ return _(q, []), ge(a, ae(() => f(null), [])), /* @__PURE__ */ g("div", { ref: a, onContextMenu: (u) => {
166
+ u.preventDefault(), f({ x: u.clientX, y: u.clientY });
167
167
  }, style: { position: "relative", display: "contents" }, children: [
168
- p,
169
- s && /* @__PURE__ */ t("div", { style: { position: "fixed", left: s.x, top: s.y, zIndex: 9999 }, children: /* @__PURE__ */ t(fe, { items: n, onSelect: (d) => {
170
- i == null || i(d), f(null);
168
+ d,
169
+ l && /* @__PURE__ */ t("div", { style: { position: "fixed", left: l.x, top: l.y, zIndex: 9999 }, children: /* @__PURE__ */ t(be, { items: n, onSelect: (u) => {
170
+ o == null || o(u), f(null);
171
171
  } }) })
172
172
  ] });
173
173
  }
174
- function Me({ count: n }) {
174
+ function Ae({ count: n }) {
175
175
  return /* @__PURE__ */ t("span", { style: {
176
176
  position: "absolute",
177
177
  top: 2,
@@ -191,33 +191,33 @@ function Me({ count: n }) {
191
191
  pointerEvents: "none"
192
192
  }, children: n });
193
193
  }
194
- function Ct({ items: n = [], onAction: i, style: p }) {
195
- const [s, f] = T(null), [a, h] = T(() => {
194
+ function qt({ items: n = [], onAction: o, style: d }) {
195
+ const [l, f] = N(null), [a, h] = N(() => {
196
196
  const r = {};
197
- return n.forEach((l) => {
198
- l.id && (l.twoState || l.group) && l.active && (r[l.id] = !0);
197
+ return n.forEach((i) => {
198
+ i.id && (i.twoState || i.group) && i.active && (r[i.id] = !0);
199
199
  }), r;
200
- }), d = U(null);
201
- K(_, []), he(d, Z(() => f(null), []));
202
- const y = (r, l) => {
203
- var c, b;
200
+ }), u = oe(null);
201
+ _(q, []), ge(u, ae(() => f(null), []));
202
+ const x = (r, i) => {
203
+ var c, m;
204
204
  if (!r.disabled) {
205
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;
206
+ const s = { ...S };
207
+ return n.forEach((b) => {
208
+ b.group === r.group && b.id && (s[b.id] = !1);
209
+ }), s[r.id] = !0, s;
210
210
  }), (c = r.items) != null && c.length) {
211
- f((S) => S === l ? null : l);
211
+ f((S) => S === i ? null : i);
212
212
  return;
213
213
  }
214
- (b = r.onClick) == null || b.call(r, r.id || ""), i == null || i(r.id || "");
214
+ (m = r.onClick) == null || m.call(r, r.id || ""), o == null || o(r.id || "");
215
215
  }
216
- }, w = (r, l) => {
217
- var o, x;
216
+ }, w = (r, i) => {
217
+ var s, b;
218
218
  if (r.hidden) return null;
219
- if (r.type === "separator") return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "6px 4px", alignSelf: "stretch" } }, l);
220
- if (r.type === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, l);
219
+ if (r.type === "separator") return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "6px 4px", alignSelf: "stretch" } }, i);
220
+ if (r.type === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, i);
221
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
223
  /* @__PURE__ */ g("div", { style: { position: "relative", display: "flex", alignItems: "center" }, children: [
@@ -229,14 +229,14 @@ 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: (k) => {
233
- var $;
234
- return ($ = r.onChange) == null ? void 0 : $.call(r, k.target.value);
232
+ onChange: (M) => {
233
+ var D;
234
+ return (D = r.onChange) == null ? void 0 : D.call(r, M.target.value);
235
235
  }
236
236
  }
237
237
  )
238
238
  ] })
239
- ] }, l);
239
+ ] }, i);
240
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(
@@ -245,14 +245,14 @@ 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: (k) => {
249
- var $;
250
- return ($ = r.onChange) == null ? void 0 : $.call(r, k.target.value);
248
+ onChange: (M) => {
249
+ var D;
250
+ return (D = r.onChange) == null ? void 0 : D.call(r, M.target.value);
251
251
  },
252
- children: (o = r.options) == null ? void 0 : o.map((k) => /* @__PURE__ */ t("option", { value: k.value, children: k.label }, k.value))
252
+ children: (s = r.options) == null ? void 0 : s.map((M) => /* @__PURE__ */ t("option", { value: M.value, children: M.label }, M.value))
253
253
  }
254
254
  )
255
- ] }, l);
255
+ ] }, i);
256
256
  if (r.type === "imageButton") return /* @__PURE__ */ g(
257
257
  "button",
258
258
  {
@@ -270,15 +270,15 @@ function Ct({ items: n = [], onAction: i, style: p }) {
270
270
  background: "transparent",
271
271
  flexShrink: 0
272
272
  },
273
- onClick: () => y(r, l),
273
+ onClick: () => x(r, i),
274
274
  children: [
275
275
  r.src && /* @__PURE__ */ t("img", { src: r.src, alt: r.value || "", style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "50%" } }),
276
- r.count !== void 0 && /* @__PURE__ */ t(Me, { count: r.count })
276
+ r.count !== void 0 && /* @__PURE__ */ t(Ae, { count: r.count })
277
277
  ]
278
278
  },
279
- l
279
+ i
280
280
  );
281
- const c = !!(r.id && a[r.id]), b = r.value ?? r.text, S = !!((x = r.items) != null && x.length);
281
+ const c = !!(r.id && a[r.id]), m = r.value ?? r.text, S = !!((b = r.items) != null && b.length);
282
282
  return /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
283
283
  /* @__PURE__ */ g(
284
284
  "button",
@@ -295,29 +295,29 @@ function Ct({ items: n = [], onAction: i, style: p }) {
295
295
  opacity: r.disabled ? 0.55 : 1,
296
296
  cursor: r.disabled ? "not-allowed" : "pointer"
297
297
  },
298
- onClick: () => y(r, l),
298
+ onClick: () => x(r, i),
299
299
  children: [
300
300
  r.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: r.icon }),
301
- b && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: b }),
301
+ m && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: m }),
302
302
  S && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
303
- r.count !== void 0 && /* @__PURE__ */ t(Me, { count: r.count })
303
+ r.count !== void 0 && /* @__PURE__ */ t(Ae, { count: r.count })
304
304
  ]
305
305
  }
306
306
  ),
307
- S && s === l && /* @__PURE__ */ t(
308
- fe,
307
+ S && l === i && /* @__PURE__ */ t(
308
+ be,
309
309
  {
310
310
  items: r.items,
311
311
  onSelect: () => f(null),
312
312
  style: { top: "100%", left: 0 }
313
313
  }
314
314
  )
315
- ] }, l);
315
+ ] }, i);
316
316
  };
317
317
  return /* @__PURE__ */ t(
318
318
  "div",
319
319
  {
320
- ref: d,
320
+ ref: u,
321
321
  className: "dhx",
322
322
  style: {
323
323
  display: "flex",
@@ -328,52 +328,264 @@ function Ct({ items: n = [], onAction: i, style: p }) {
328
328
  borderBottom: `1px solid ${e.border}`,
329
329
  minHeight: 44,
330
330
  flexWrap: "wrap",
331
- ...p
331
+ ...d
332
332
  },
333
333
  children: n.map(w)
334
334
  }
335
335
  );
336
336
  }
337
- function It({ items: n = [], width: i = 240, collapsed: p, onSelect: s, header: f, footer: a, style: h }) {
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
- var M;
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: [
337
+ function wt(n) {
338
+ return n === "primary" ? e.primary : n === "success" ? "#43a047" : n === "secondary" ? "#9e9e9e" : "#e53935";
339
+ }
340
+ function zt(n, o) {
341
+ const d = [], l = (f) => {
342
+ var a;
343
+ f.id && f.group === o && d.push(f.id), (a = f.items) == null || a.forEach(l);
344
+ };
345
+ return n.forEach(l), d;
346
+ }
347
+ function Mt(n) {
348
+ const o = {}, d = (l) => {
349
+ var f;
350
+ l.id && l.twoState && l.active && (o[l.id] = !0), (f = l.items) == null || f.forEach(d);
351
+ };
352
+ return n.forEach(d), o;
353
+ }
354
+ function Gt({
355
+ items: n = [],
356
+ width: o = 240,
357
+ minWidth: d = 64,
358
+ header: l,
359
+ footer: f,
360
+ collapsed: a,
361
+ defaultCollapsed: h,
362
+ selected: u,
363
+ defaultSelected: x,
364
+ onSelect: w,
365
+ onCollapse: r,
366
+ onExpand: i,
367
+ onBeforeCollapse: c,
368
+ onBeforeExpand: m,
369
+ onToggleItem: S,
370
+ style: s
371
+ }) {
372
+ const b = a !== void 0, M = u !== void 0, [D, R] = N(h ?? !1), [z, C] = N(x ?? null), [F, p] = N({}), [I, W] = N(() => Mt(n));
373
+ _(q, []);
374
+ const v = b ? a : D, X = M ? u ?? null : z, J = v ? d : o, se = () => {
375
+ if (v) {
376
+ if ((m == null ? void 0 : m()) === !1) return;
377
+ b || R(!1), i == null || i();
378
+ } else {
379
+ if ((c == null ? void 0 : c()) === !1) return;
380
+ b || R(!0), r == null || r();
381
+ }
382
+ }, U = (k) => {
383
+ M || C(k.id ?? null), w == null || w(k), k.id && k.onClick && k.onClick(k.id);
384
+ }, ie = (k) => {
385
+ if (!k.id) return;
386
+ const P = !I[k.id];
387
+ let O = { ...I, [k.id]: P };
388
+ k.group && P && zt(n, k.group).forEach((G) => {
389
+ G !== k.id && (O[G] = !1);
390
+ }), W(O), S == null || S(k.id, P);
391
+ }, E = (k, P) => {
392
+ if (k.count === void 0) return null;
393
+ const O = wt(k.countColor), G = k.count > 99 ? "99+" : String(k.count);
394
+ return P ? /* @__PURE__ */ t("span", { style: {
395
+ position: "absolute",
396
+ top: 1,
397
+ right: 1,
398
+ background: O,
399
+ color: "#fff",
400
+ borderRadius: 8,
401
+ fontSize: 9,
402
+ fontWeight: 700,
403
+ padding: "0 3px",
404
+ minWidth: 14,
405
+ textAlign: "center",
406
+ lineHeight: "14px",
407
+ pointerEvents: "none"
408
+ }, children: G }) : /* @__PURE__ */ t("span", { style: {
409
+ background: O,
410
+ color: "#fff",
411
+ borderRadius: 10,
412
+ padding: "1px 6px",
413
+ fontSize: 11,
414
+ fontWeight: 700,
415
+ flexShrink: 0
416
+ }, children: G });
417
+ }, $ = (k, P, O) => {
418
+ var ce;
419
+ if (k.hidden) return null;
420
+ const G = k.id ?? `${k.type ?? "navItem"}-${P}-${O}`, K = k.type ?? "navItem";
421
+ if (K === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "6px 8px", flexShrink: 0 } }, G);
422
+ if (K === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, G);
423
+ if (K === "title")
424
+ return v ? null : /* @__PURE__ */ t("div", { style: {
425
+ padding: "10px 14px 4px",
426
+ fontSize: 10,
427
+ fontWeight: 700,
428
+ textTransform: "uppercase",
429
+ letterSpacing: 1,
430
+ color: e.textMut,
431
+ flexShrink: 0
432
+ }, children: k.value }, G);
433
+ if (K === "customHTML") return /* @__PURE__ */ t(
434
+ "div",
435
+ {
436
+ dangerouslySetInnerHTML: { __html: k.html ?? "" },
437
+ style: { padding: "8px 12px", flexShrink: 0 }
438
+ },
439
+ G
440
+ );
441
+ const V = (((ce = k.items) == null ? void 0 : ce.length) ?? 0) > 0, Q = !!F[k.id ?? ""], Z = k.twoState ? !!I[k.id ?? ""] : !1, ne = !k.twoState && X === k.id || Z, H = !!k.disabled, de = v ? 0 : 12 + P * 16, me = () => {
442
+ H || (k.twoState ? (ie(k), U(k)) : (V && p((le) => ({ ...le, [k.id ?? ""]: !le[k.id ?? ""] })), U(k)));
443
+ };
444
+ return /* @__PURE__ */ g("div", { style: { flexShrink: 0 }, children: [
348
445
  /* @__PURE__ */ g(
349
446
  "div",
350
447
  {
351
- onClick: () => {
352
- $ && c((A) => ({ ...A, [x.id]: !A[x.id] })), S(x);
448
+ title: k.tooltip,
449
+ onClick: me,
450
+ style: {
451
+ display: "flex",
452
+ alignItems: "center",
453
+ gap: v ? 0 : 8,
454
+ justifyContent: v ? "center" : "flex-start",
455
+ paddingTop: 8,
456
+ paddingBottom: 8,
457
+ paddingLeft: v ? 0 : de,
458
+ paddingRight: v ? 0 : 10,
459
+ borderRadius: e.r,
460
+ margin: "1px 6px",
461
+ cursor: H ? "not-allowed" : "pointer",
462
+ userSelect: "none",
463
+ transition: "background .15s",
464
+ background: ne ? e.primaryLt : "transparent",
465
+ color: H ? e.textMut : ne ? e.primary : e.text,
466
+ opacity: H ? 0.55 : 1
467
+ },
468
+ onMouseEnter: (le) => {
469
+ !ne && !H && (le.currentTarget.style.background = e.bg);
470
+ },
471
+ onMouseLeave: (le) => {
472
+ !ne && !H && (le.currentTarget.style.background = "transparent");
353
473
  },
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
474
  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: "▶" })
475
+ /* @__PURE__ */ g("span", { style: {
476
+ position: "relative",
477
+ minWidth: 22,
478
+ textAlign: "center",
479
+ fontSize: 18,
480
+ flexShrink: 0,
481
+ lineHeight: 1
482
+ }, children: [
483
+ k.icon ?? (k.value && !k.icon, null),
484
+ v && E(k, !0)
485
+ ] }),
486
+ !v && /* @__PURE__ */ t("span", { style: {
487
+ flex: 1,
488
+ fontSize: 13,
489
+ fontWeight: ne ? 600 : 400,
490
+ overflow: "hidden",
491
+ textOverflow: "ellipsis",
492
+ whiteSpace: "nowrap"
493
+ }, children: k.value }),
494
+ !v && E(k, !1),
495
+ !v && k.twoState && /* @__PURE__ */ t("span", { style: {
496
+ width: 14,
497
+ height: 14,
498
+ borderRadius: 2,
499
+ border: `2px solid ${ne ? e.primary : e.borderDk}`,
500
+ background: ne ? e.primary : "transparent",
501
+ flexShrink: 0,
502
+ display: "flex",
503
+ alignItems: "center",
504
+ justifyContent: "center"
505
+ }, children: ne && /* @__PURE__ */ t("span", { style: { color: "#fff", fontSize: 8, fontWeight: 700, lineHeight: 1 }, children: "✓" }) }),
506
+ !v && V && !k.twoState && /* @__PURE__ */ t("span", { style: {
507
+ fontSize: 11,
508
+ color: e.textMut,
509
+ flexShrink: 0,
510
+ transition: "transform .2s",
511
+ transform: Q ? "rotate(90deg)" : "rotate(0deg)",
512
+ display: "inline-block"
513
+ }, children: "▶" })
362
514
  ]
363
515
  }
364
516
  ),
365
- $ && L && !d && x.items.map((A) => o(A, k + 1))
366
- ] }, x.id);
367
- };
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
- 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((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
- a && !d && /* @__PURE__ */ t("div", { style: { padding: "10px 14px", borderTop: `1px solid ${e.border}` }, children: a })
373
- ] });
517
+ V && Q && !v && /* @__PURE__ */ t("div", { children: k.items.map((le, ye) => $(le, P + 1, ye)) })
518
+ ] }, G);
519
+ }, j = /* @__PURE__ */ g(
520
+ "div",
521
+ {
522
+ onClick: se,
523
+ style: {
524
+ display: "flex",
525
+ alignItems: "center",
526
+ justifyContent: v ? "center" : "flex-start",
527
+ gap: 8,
528
+ padding: v ? "8px 0" : "8px 14px",
529
+ margin: "4px 6px",
530
+ borderRadius: e.r,
531
+ cursor: "pointer",
532
+ color: e.textMut,
533
+ fontSize: 13,
534
+ userSelect: "none",
535
+ transition: "background .15s",
536
+ flexShrink: 0
537
+ },
538
+ onMouseEnter: (k) => k.currentTarget.style.background = e.bg,
539
+ onMouseLeave: (k) => k.currentTarget.style.background = "transparent",
540
+ children: [
541
+ /* @__PURE__ */ t("span", { style: { fontSize: 16, fontWeight: 700, lineHeight: 1 }, children: v ? "›" : "‹" }),
542
+ !v && /* @__PURE__ */ t("span", { children: "Collapse" })
543
+ ]
544
+ }
545
+ );
546
+ return /* @__PURE__ */ g(
547
+ "div",
548
+ {
549
+ className: "dhx",
550
+ style: {
551
+ width: J,
552
+ minWidth: J,
553
+ background: e.surface,
554
+ borderRight: `1px solid ${e.border}`,
555
+ display: "flex",
556
+ flexDirection: "column",
557
+ transition: "width .2s ease, min-width .2s ease",
558
+ overflow: "hidden",
559
+ ...s
560
+ },
561
+ children: [
562
+ l && /* @__PURE__ */ t("div", { style: {
563
+ padding: v ? "12px 0" : "12px 14px",
564
+ borderBottom: `1px solid ${e.border}`,
565
+ fontWeight: 700,
566
+ fontSize: 15,
567
+ display: "flex",
568
+ alignItems: "center",
569
+ justifyContent: v ? "center" : "flex-start",
570
+ overflow: "hidden",
571
+ flexShrink: 0
572
+ }, children: l }),
573
+ /* @__PURE__ */ t(
574
+ "div",
575
+ {
576
+ className: "dhx-scroll",
577
+ style: { flex: 1, overflowY: "auto", overflowX: "hidden", display: "flex", flexDirection: "column" },
578
+ children: n.map((k, P) => $(k, 0, P))
579
+ }
580
+ ),
581
+ j,
582
+ f && !v && /* @__PURE__ */ t("div", { style: { padding: "10px 14px", borderTop: `1px solid ${e.border}`, flexShrink: 0 }, children: f })
583
+ ]
584
+ }
585
+ );
374
586
  }
375
- function ct({ config: n }) {
376
- const [i, p] = T(!1), s = {
587
+ function $t({ config: n }) {
588
+ const [o, d] = N(!1), l = {
377
589
  position: "relative",
378
590
  background: e.surface,
379
591
  border: `1px solid ${e.border}`,
@@ -381,550 +593,728 @@ function ct({ config: n }) {
381
593
  overflow: "hidden",
382
594
  ...n.width ? { width: n.width, minWidth: n.width } : { flex: 1 },
383
595
  ...n.height ? { height: n.height, minHeight: n.height } : { minHeight: 40 },
384
- ...i ? { flex: "0 0 auto" } : {}
596
+ ...o ? { flex: "0 0 auto" } : {}
385
597
  };
386
- return /* @__PURE__ */ g("div", { style: s, children: [
598
+ return /* @__PURE__ */ g("div", { style: l, children: [
387
599
  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
600
  /* @__PURE__ */ t("span", { children: n.header }),
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 ? "▼" : "▲" })
601
+ n.collapsable && /* @__PURE__ */ t("button", { onClick: () => d((f) => !f), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 16, lineHeight: 1 }, children: o ? "▼" : "▲" })
390
602
  ] }),
391
- !i && /* @__PURE__ */ g("div", { style: { padding: n.padding || 0, height: n.header ? "calc(100% - 33px)" : "100%", overflow: "auto" }, children: [
603
+ !o && /* @__PURE__ */ g("div", { style: { padding: n.padding || 0, height: n.header ? "calc(100% - 33px)" : "100%", overflow: "auto" }, children: [
392
604
  n.html ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: n.html } }) : n.content,
393
- (n.rows || n.cols) && /* @__PURE__ */ t(pt, { rows: n.rows, cols: n.cols, style: { height: "100%" } })
605
+ (n.rows || n.cols) && /* @__PURE__ */ t(Dt, { rows: n.rows, cols: n.cols, style: { height: "100%" } })
394
606
  ] })
395
607
  ] });
396
608
  }
397
- function pt({ rows: n, cols: i, type: p = "line", style: s, children: f }) {
398
- K(_, []);
399
- const a = p === "space" ? 12 : p === "wide" ? 8 : 1, h = n || i, d = !!n;
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 });
609
+ function Dt({ rows: n, cols: o, type: d = "line", style: l, children: f }) {
610
+ _(q, []);
611
+ const a = d === "space" ? 12 : d === "wide" ? 8 : 1, h = n || o, u = !!n;
612
+ return h ? /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", flexDirection: u ? "column" : "row", gap: a, width: "100%", height: "100%", ...l }, children: h.map((x, w) => /* @__PURE__ */ t($t, { config: x }, x.id || w)) }) : /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: "100%", ...l }, children: f });
401
613
  }
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 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
- f.includes(M) || h && h(M) === !1 || (r(M), d == null || d(M));
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 };
614
+ function Jt({ views: n = [], mode: o = "top", tabAlign: d = "left", closable: l = [], disabled: f = [], defaultActive: a, onBeforeChange: h, onChange: u, style: x }) {
615
+ var z;
616
+ const [w, r] = N(a || ((z = n[0]) == null ? void 0 : z.id)), [i, c] = N(n.map((C) => C.id));
617
+ _(q, []);
618
+ const m = (C, F) => {
619
+ C.stopPropagation(), c((p) => p.filter((I) => I !== F)), w === F && r(i.find((p) => p !== F) ?? "");
620
+ }, S = (C) => {
621
+ f.includes(C) || h && h(C) === !1 || (r(C), u == null || u(C));
622
+ }, s = o === "left" || o === "right", b = n.filter((C) => i.includes(C.id)), M = /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: s ? "column" : "row", justifyContent: d === "center" ? "center" : d === "right" ? "flex-end" : "flex-start", background: e.surface, borderBottom: !s && o !== "bottom" ? `2px solid ${e.border}` : "none", borderTop: o === "bottom" ? `2px solid ${e.border}` : "none", borderRight: o === "left" ? `2px solid ${e.border}` : "none", borderLeft: o === "right" ? `2px solid ${e.border}` : "none", overflowX: "auto", flexShrink: 0 }, children: b.map((C) => {
623
+ const F = w === C.id, p = f.includes(C.id), I = o === "bottom" ? { borderTop: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 } : s ? { color: e.primary, fontWeight: 600, background: e.primaryLt, [o === "left" ? "borderRight" : "borderLeft"]: `2px solid ${e.primary}` } : { borderBottom: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 };
412
624
  return /* @__PURE__ */ g(
413
625
  "div",
414
626
  {
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 } },
627
+ onClick: () => S(C.id),
628
+ style: { display: "flex", alignItems: "center", gap: 6, padding: "10px 16px", cursor: p ? "not-allowed" : "pointer", whiteSpace: "nowrap", fontSize: 13, transition: "color .15s", userSelect: "none", minWidth: s ? 120 : "auto", ...F ? I : { color: p ? e.textMut : e.textSec } },
417
629
  children: [
418
- M.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: M.icon }),
419
- /* @__PURE__ */ t("span", { children: M.tab }),
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: "✕" })
630
+ C.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: C.icon }),
631
+ /* @__PURE__ */ t("span", { children: C.tab }),
632
+ l.includes(C.id) && /* @__PURE__ */ t("span", { onClick: (W) => m(W, C.id), style: { marginLeft: 4, opacity: 0.6, fontSize: 12, cursor: "pointer" }, children: "✕" })
421
633
  ]
422
634
  },
423
- M.id
635
+ C.id
424
636
  );
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 } })
637
+ }) }), D = b.find((C) => C.id === w), R = /* @__PURE__ */ g("div", { className: "dhx-scroll", style: { flex: 1, overflow: "auto" }, children: [
638
+ D == null ? void 0 : D.content,
639
+ (D == null ? void 0 : D.html) && /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: D.html }, style: { padding: 16 } })
428
640
  ] });
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
641
+ return /* @__PURE__ */ g("div", { className: "dhx", style: { display: "flex", flexDirection: o === "top" ? "column" : o === "bottom" ? "column-reverse" : o === "left" ? "row" : "row-reverse", width: "100%", height: "100%", background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden", ...x }, children: [
642
+ M,
643
+ R
432
644
  ] });
433
645
  }
434
- const se = `1px solid ${e.border}`;
435
- function ut({ active: n, dir: i }) {
646
+ const he = `1px solid ${e.border}`;
647
+ function Ct({ active: n, dir: o }) {
436
648
  return /* @__PURE__ */ g("span", { style: { display: "inline-flex", flexDirection: "column", gap: 1, flexShrink: 0, marginLeft: 4 }, children: [
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
- /* @__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 }) })
649
+ /* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 0L7 4H0z", fill: n && o === "asc" ? e.primary : e.borderDk }) }),
650
+ /* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 4L0 0H7z", fill: n && o === "desc" ? e.primary : e.borderDk }) })
651
+ ] });
652
+ }
653
+ function Lt({ options: n, value: o, onChange: d, onCommit: l, onCancel: f }) {
654
+ const [a, h] = N(o), [u, x] = N(!0), w = oe(null);
655
+ _(() => {
656
+ const i = (c) => {
657
+ w.current && !w.current.contains(c.target) && l();
658
+ };
659
+ return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
660
+ }, [l]);
661
+ const r = n.filter((i) => !a || i.toLowerCase().includes(a.toLowerCase()));
662
+ return /* @__PURE__ */ g("div", { ref: w, style: { width: "100%", position: "relative" }, children: [
663
+ /* @__PURE__ */ t(
664
+ "input",
665
+ {
666
+ autoFocus: !0,
667
+ value: a,
668
+ onChange: (i) => {
669
+ h(i.target.value), d(i.target.value), x(!0);
670
+ },
671
+ onKeyDown: (i) => {
672
+ i.key === "Enter" && l(), i.key === "Escape" && f();
673
+ },
674
+ onClick: (i) => i.stopPropagation(),
675
+ style: { width: "100%", border: "none", outline: `2px solid ${e.primary}`, borderRadius: 2, fontSize: 13, padding: "2px 4px", background: e.surface, color: e.text }
676
+ }
677
+ ),
678
+ u && r.length > 0 && /* @__PURE__ */ t("div", { style: { position: "absolute", top: "100%", left: 0, right: 0, zIndex: 50, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, boxShadow: e.shadowLg, maxHeight: 160, overflowY: "auto" }, children: r.map((i) => /* @__PURE__ */ t(
679
+ "div",
680
+ {
681
+ onMouseDown: (c) => {
682
+ c.preventDefault(), d(i), h(i), x(!1), l();
683
+ },
684
+ style: { padding: "6px 10px", cursor: "pointer", fontSize: 13, color: e.text },
685
+ onMouseEnter: (c) => c.currentTarget.style.background = e.bg,
686
+ onMouseLeave: (c) => c.currentTarget.style.background = e.surface,
687
+ children: i
688
+ },
689
+ i
690
+ )) })
439
691
  ] });
440
692
  }
441
- function Tt({
693
+ function It(n, o) {
694
+ if (n == null) return "";
695
+ if (o === "number") return typeof n == "number" ? n.toLocaleString() : String(n);
696
+ if (o === "date") {
697
+ const d = n instanceof Date ? n : new Date(String(n));
698
+ return isNaN(d.getTime()) ? String(n) : d.toLocaleDateString();
699
+ }
700
+ return String(n);
701
+ }
702
+ function Tt(n, o, d) {
703
+ return n == null ? 1 : o == null ? -1 : d === "date" ? new Date(String(n)).getTime() - new Date(String(o)).getTime() : d === "number" ? Number(n) - Number(o) : String(n) < String(o) ? -1 : String(n) > String(o) ? 1 : 0;
704
+ }
705
+ function Se(n) {
706
+ var o;
707
+ return Array.isArray(n.header) && ((o = n.header[1]) == null ? void 0 : o.content) != null ? n.header[1].content : n.filterable ? n.filterType === "select" ? "selectFilter" : "inputFilter" : null;
708
+ }
709
+ function Nt(n, o, d, l, f) {
710
+ const a = {
711
+ width: "100%",
712
+ border: "none",
713
+ outline: `2px solid ${e.primary}`,
714
+ borderRadius: 2,
715
+ fontSize: 13,
716
+ padding: "2px 4px",
717
+ background: e.surface,
718
+ color: e.text
719
+ }, h = n.editorType ?? "input";
720
+ if (h === "select") return /* @__PURE__ */ t(
721
+ "select",
722
+ {
723
+ autoFocus: !0,
724
+ value: o,
725
+ onChange: (x) => d(x.target.value),
726
+ onBlur: l,
727
+ onKeyDown: (x) => {
728
+ x.key === "Enter" && l(), x.key === "Escape" && f();
729
+ },
730
+ onClick: (x) => x.stopPropagation(),
731
+ style: { ...a, cursor: "pointer" },
732
+ children: (n.options ?? []).map((x) => /* @__PURE__ */ t("option", { value: x, children: x }, x))
733
+ }
734
+ );
735
+ if (h === "combobox") return /* @__PURE__ */ t(
736
+ Lt,
737
+ {
738
+ options: n.options ?? [],
739
+ value: o,
740
+ onChange: d,
741
+ onCommit: l,
742
+ onCancel: f
743
+ }
744
+ );
745
+ const u = n.type === "number" ? "number" : n.type === "date" ? "date" : "text";
746
+ return /* @__PURE__ */ t(
747
+ "input",
748
+ {
749
+ autoFocus: !0,
750
+ type: u,
751
+ value: o,
752
+ onChange: (x) => d(x.target.value),
753
+ onBlur: l,
754
+ onKeyDown: (x) => {
755
+ x.key === "Enter" && l(), x.key === "Escape" && f();
756
+ },
757
+ onClick: (x) => x.stopPropagation(),
758
+ style: a
759
+ }
760
+ );
761
+ }
762
+ function Ut({
442
763
  columns: n,
443
- data: i = [],
444
- height: p = 400,
445
- rowHeight: s = 40,
446
- sortable: f = !0,
447
- resizable: a = !0,
448
- editable: h = !1,
449
- stripe: d = !1,
450
- autoWidth: y = !1,
451
- keyNavigation: w = !1,
452
- selection: r,
453
- multiselect: l,
454
- onSelect: c,
764
+ data: o = [],
765
+ height: d = 400,
766
+ rowHeight: l = 40,
767
+ headerRowHeight: f = 40,
768
+ footerRowHeight: a = 40,
769
+ sortable: h = !0,
770
+ resizable: u = !0,
771
+ editable: x = !1,
772
+ stripe: w = !1,
773
+ autoWidth: r = !1,
774
+ keyNavigation: i = !1,
775
+ selection: c,
776
+ multiselect: m,
777
+ leftSplit: S = 0,
778
+ onSelect: s,
455
779
  onChange: b,
456
- style: S
780
+ style: M
457
781
  }) {
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
- if (!y || !z.current) return;
461
- const v = new ResizeObserver(() => {
462
- var D;
463
- return j(((D = z.current) == null ? void 0 : D.offsetWidth) ?? 0);
782
+ var Ce;
783
+ const [D, R] = N(null), [z, C] = N("asc"), [F, p] = N({}), [I, W] = N(/* @__PURE__ */ new Set()), [v, X] = N(-1), [J, se] = N(
784
+ () => Object.fromEntries(n.map((y) => [y.id, y.width ?? y.minWidth ?? 150]))
785
+ ), [U, ie] = N(null), [E, $] = N(""), [j, k] = N({}), P = oe(null), [O, G] = N(0);
786
+ _(q, []), _(() => {
787
+ if (!r || !P.current) return;
788
+ const y = new ResizeObserver(() => {
789
+ var L;
790
+ return G(((L = P.current) == null ? void 0 : L.offsetWidth) ?? 0);
464
791
  });
465
- return v.observe(z.current), () => v.disconnect();
466
- }, [y]);
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;
792
+ return y.observe(P.current), () => y.disconnect();
793
+ }, [r]);
794
+ const K = ue(
795
+ () => n.map(
796
+ (y) => y.summary && (!y.footer || y.footer.length === 0) ? { ...y, footer: [{ summary: y.summary }] } : y
797
+ ),
798
+ [n]
799
+ ), V = ue(
800
+ () => K.filter((y) => !y.hidden),
801
+ [K]
802
+ ), Q = ue(() => {
803
+ if (!r || O === 0) return J;
804
+ const y = V.reduce((T, A) => T + (J[A.id] ?? 150), 0);
805
+ if (O <= y) return J;
806
+ const L = (O - y) / V.length;
807
+ return Object.fromEntries(V.map((T) => [T.id, (J[T.id] ?? 150) + L]));
808
+ }, [r, O, J, V]), Z = ue(() => {
809
+ let y = o.map((L, T) => {
810
+ const A = String(L.id ?? T);
811
+ return j[A] ? { ...L, ...j[A] } : L;
477
812
  }).filter(
478
- (D) => Object.entries(L).every(([W, E]) => !E || String(D[W] ?? "").toLowerCase().includes(E.toLowerCase()))
813
+ (L) => Object.entries(F).every(
814
+ ([T, A]) => !A || String(L[T] ?? "").toLowerCase().includes(A.toLowerCase())
815
+ )
479
816
  );
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
- return n.forEach((D) => {
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 };
817
+ if (D) {
818
+ const L = K.find((T) => T.id === D);
819
+ y = [...y].sort((T, A) => {
820
+ const Y = Tt(T[D], A[D], L == null ? void 0 : L.type);
821
+ return z === "asc" ? Y : -Y;
822
+ });
823
+ }
824
+ return y;
825
+ }, [o, D, z, F, j, K]), fe = ue(() => {
826
+ const y = {};
827
+ return K.forEach((L) => {
828
+ var T;
829
+ if ((T = L.footer) != null && T.some((A) => A.summary)) {
830
+ const A = Z.map((B) => Number(B[L.id])).filter((B) => !isNaN(B)), Y = A.reduce((B, ee) => B + ee, 0);
831
+ y[L.id] = { sum: Y, avg: A.length ? Y / A.length : 0, count: Z.length, min: A.length ? Math.min(...A) : 0, max: A.length ? Math.max(...A) : 0 };
494
832
  }
495
- }), v;
496
- }, [O, n]), X = ue(() => {
497
- const v = {};
498
- return n.filter((D) => D.filterType === "select").forEach((D) => {
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
- var 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
- if (!r) return;
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);
833
+ }), y;
834
+ }, [Z, K]), ne = ue(() => {
835
+ const y = {};
836
+ return V.filter((L) => {
837
+ const T = Se(L);
838
+ return T === "selectFilter" || T === "comboFilter";
839
+ }).forEach((L) => {
840
+ y[L.id] = [...new Set(o.map((T) => String(T[L.id] ?? "")))].sort();
841
+ }), y;
842
+ }, [o, V]), H = V.some((y) => Se(y) !== null), de = K.some((y) => {
843
+ var L;
844
+ return (L = y.footer) == null ? void 0 : L.length;
845
+ }), me = V.reduce((y, L) => y + (Q[L.id] ?? 150), 0), ce = ue(() => {
846
+ if (!S) return {};
847
+ let y = 0;
848
+ const L = {};
849
+ return V.forEach((T, A) => {
850
+ A < S && (L[T.id] = y, y += Q[T.id] ?? 150);
851
+ }), L;
852
+ }, [S, V, Q]), le = S > 0 ? (Ce = V[S - 1]) == null ? void 0 : Ce.id : null, ye = (y, L) => y.id ?? L, Xe = (y) => {
853
+ !h || y.sortable === !1 || (C((L) => D === y.id && L === "asc" ? "desc" : "asc"), R(y.id));
854
+ }, ve = (y, L) => {
855
+ if (!c) return;
856
+ const T = ye(y, L);
857
+ X(L), W((A) => {
858
+ const Y = m ? new Set(A) : /* @__PURE__ */ new Set();
859
+ return Y.has(T) ? Y.delete(T) : Y.add(T), Y;
860
+ }), s == null || s(y);
861
+ }, qe = () => {
862
+ if (!U) return;
863
+ const { key: y, colId: L } = U;
864
+ k((A) => ({ ...A, [String(y)]: { ...A[String(y)] || {}, [L]: E } }));
865
+ const T = Z.find((A, Y) => ye(A, Y) === y);
866
+ T && (b == null || b(T, L, E)), ie(null);
867
+ }, Ge = (y) => {
868
+ if (U && y.key === "Escape") {
869
+ ie(null);
522
870
  return;
523
871
  }
524
- if (!(!w || !r)) {
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
- const D = Math.max(u - 1, 0);
532
- D >= 0 && H(O[D], D);
872
+ if (!(!i || !c)) {
873
+ if (y.key === "ArrowDown") {
874
+ y.preventDefault();
875
+ const L = Math.min(v + 1, Z.length - 1);
876
+ L >= 0 && ve(Z[L], L);
877
+ } else if (y.key === "ArrowUp") {
878
+ y.preventDefault();
879
+ const L = Math.max(v - 1, 0);
880
+ L >= 0 && ve(Z[L], L);
533
881
  }
534
882
  }
535
- }, Be = (v, D) => {
536
- v.preventDefault(), v.stopPropagation();
537
- const W = v.clientX, E = R[D], V = (de) => C((ge) => {
538
- const ce = [...ge];
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);
883
+ }, Je = (y, L) => {
884
+ y.preventDefault(), y.stopPropagation();
885
+ const T = y.clientX, A = J[L] ?? 150, Y = n.find((te) => te.id === L), B = (te) => se((pe) => ({
886
+ ...pe,
887
+ [L]: Math.max((Y == null ? void 0 : Y.minWidth) || 50, A + te.clientX - T)
888
+ })), ee = () => {
889
+ document.removeEventListener("mousemove", B), document.removeEventListener("mouseup", ee);
542
890
  };
543
- document.addEventListener("mousemove", V), document.addEventListener("mouseup", F);
544
- }, xe = (v, D, W, E) => ({
545
- width: v,
546
- minWidth: v,
547
- flexShrink: 0,
548
- boxSizing: "border-box",
549
- padding: "0 12px",
550
- height: E,
551
- display: "flex",
552
- alignItems: "center",
553
- overflow: "hidden",
554
- textOverflow: "ellipsis",
555
- whiteSpace: "nowrap",
556
- fontSize: 13,
557
- textAlign: D.align,
558
- justifyContent: D.align === "center" ? "center" : D.align === "right" ? "flex-end" : "flex-start",
559
- borderLeft: W ? "none" : se
560
- });
891
+ document.addEventListener("mousemove", B), document.addEventListener("mouseup", ee);
892
+ }, ke = (y, L, T, A, Y, B = "hidden") => {
893
+ const ee = y in ce;
894
+ return {
895
+ width: L,
896
+ minWidth: L,
897
+ flexShrink: 0,
898
+ boxSizing: "border-box",
899
+ padding: "0 12px",
900
+ height: Y,
901
+ display: "flex",
902
+ alignItems: "center",
903
+ overflow: B,
904
+ textOverflow: "ellipsis",
905
+ whiteSpace: "nowrap",
906
+ fontSize: 13,
907
+ textAlign: T,
908
+ justifyContent: T === "center" ? "center" : T === "right" ? "flex-end" : "flex-start",
909
+ borderLeft: A ? "none" : he,
910
+ position: ee ? "sticky" : "relative",
911
+ ...ee ? {
912
+ left: ce[y],
913
+ zIndex: 1,
914
+ boxShadow: y === le ? "2px 0 6px rgba(0,0,0,0.1)" : void 0
915
+ } : {}
916
+ };
917
+ };
561
918
  return /* @__PURE__ */ t(
562
919
  "div",
563
920
  {
564
- ref: z,
921
+ ref: P,
565
922
  className: "dhx",
566
- tabIndex: w ? 0 : void 0,
567
- onKeyDown: Ae,
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;
923
+ tabIndex: i ? 0 : void 0,
924
+ onKeyDown: Ge,
925
+ style: { width: "100%", height: d, display: "flex", flexDirection: "column", border: he, borderRadius: e.r, overflow: "hidden", outline: "none", ...M },
926
+ children: /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { overflow: "auto", flex: 1 }, children: /* @__PURE__ */ g("div", { style: { minWidth: me, display: "flex", flexDirection: "column", minHeight: "100%" }, children: [
927
+ /* @__PURE__ */ t("div", { style: { display: "flex", background: e.bg, borderBottom: he, flexShrink: 0, position: "sticky", top: 0, zIndex: 3 }, children: V.map((y, L) => {
928
+ const T = Array.isArray(y.header) ? y.header[0] : null, A = (T == null ? void 0 : T.text) ?? (typeof y.header == "string" ? y.header : y.id), Y = (T == null ? void 0 : T.align) ?? y.align, B = Q[y.id] ?? 150, ee = y.id in ce;
572
929
  return /* @__PURE__ */ g(
573
930
  "div",
574
931
  {
575
- onClick: () => ae(v),
932
+ onClick: () => Xe(y),
576
933
  style: {
577
- ...xe(Y[D], v, D === 0, 40),
578
- position: "relative",
934
+ ...ke(y.id, B, Y, L === 0, f),
579
935
  fontWeight: 500,
580
936
  color: e.text,
581
- cursor: f && v.sortable !== !1 ? "pointer" : "default",
582
- userSelect: "none"
937
+ background: e.bg,
938
+ cursor: h && y.sortable !== !1 ? "pointer" : "default",
939
+ userSelect: "none",
940
+ ...ee ? { zIndex: 4 } : {}
583
941
  },
584
942
  children: [
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(
943
+ T != null && T.htmlEnable ? /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden" }, dangerouslySetInnerHTML: { __html: A } }) : /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: A }),
944
+ h && y.sortable !== !1 && /* @__PURE__ */ t(Ct, { active: D === y.id, dir: z }),
945
+ u && y.resizable !== !1 && L < V.length - 1 && /* @__PURE__ */ t(
588
946
  "div",
589
947
  {
590
- onMouseDown: (E) => Be(E, D),
591
- onClick: (E) => E.stopPropagation(),
948
+ onMouseDown: (te) => Je(te, y.id),
949
+ onClick: (te) => te.stopPropagation(),
592
950
  style: { position: "absolute", right: 0, top: 0, bottom: 0, width: 4, cursor: "col-resize", zIndex: 1 },
593
- onMouseEnter: (E) => E.currentTarget.style.background = e.primary + "55",
594
- onMouseLeave: (E) => E.currentTarget.style.background = "transparent"
951
+ onMouseEnter: (te) => te.currentTarget.style.background = e.primary + "55",
952
+ onMouseLeave: (te) => te.currentTarget.style.background = "transparent"
595
953
  }
596
954
  )
597
955
  ]
598
956
  },
599
- v.id
957
+ y.id
600
958
  );
601
959
  }) }),
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
- "select",
604
- {
605
- className: "dhx dhx-input",
606
- style: { height: 26, fontSize: 12, padding: "0 4px" },
607
- value: L[v.id] || "",
608
- onChange: (W) => m((E) => ({ ...E, [v.id]: W.target.value })),
609
- children: [
610
- /* @__PURE__ */ t("option", { value: "", children: "All" }),
611
- (X[v.id] || []).map((W) => /* @__PURE__ */ t("option", { value: W, children: W }, W))
612
- ]
613
- }
614
- ) : v.filterable ? /* @__PURE__ */ t(
615
- "input",
616
- {
617
- className: "dhx dhx-input",
618
- style: { height: 26, fontSize: 12 },
619
- placeholder: "Filter...",
620
- value: L[v.id] || "",
621
- onChange: (W) => m((E) => ({ ...E, [v.id]: W.target.value }))
622
- }
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;
960
+ H && /* @__PURE__ */ t("div", { style: {
961
+ display: "flex",
962
+ borderBottom: he,
963
+ background: e.surface,
964
+ flexShrink: 0,
965
+ ...S ? { position: "sticky", top: f, zIndex: 3 } : {}
966
+ }, children: V.map((y, L) => {
967
+ const T = Se(y), A = Q[y.id] ?? 150, Y = y.id in ce;
968
+ return /* @__PURE__ */ t("div", { style: {
969
+ width: A,
970
+ minWidth: A,
971
+ flexShrink: 0,
972
+ padding: "4px 6px",
973
+ boxSizing: "border-box",
974
+ borderLeft: L === 0 ? "none" : he,
975
+ background: e.surface,
976
+ ...Y ? {
977
+ position: "sticky",
978
+ left: ce[y.id],
979
+ zIndex: 4,
980
+ boxShadow: y.id === le ? "2px 0 6px rgba(0,0,0,0.1)" : void 0
981
+ } : {}
982
+ }, children: T === "selectFilter" || T === "comboFilter" ? /* @__PURE__ */ g(
983
+ "select",
984
+ {
985
+ className: "dhx dhx-input",
986
+ style: { height: 26, fontSize: 12, padding: "0 4px" },
987
+ value: F[y.id] || "",
988
+ onChange: (B) => p((ee) => ({ ...ee, [y.id]: B.target.value })),
989
+ children: [
990
+ /* @__PURE__ */ t("option", { value: "", children: "All" }),
991
+ (ne[y.id] || []).map((B) => /* @__PURE__ */ t("option", { value: B, children: B }, B))
992
+ ]
993
+ }
994
+ ) : T === "inputFilter" ? /* @__PURE__ */ t(
995
+ "input",
996
+ {
997
+ className: "dhx dhx-input",
998
+ style: { height: 26, fontSize: 12 },
999
+ placeholder: "Filter...",
1000
+ value: F[y.id] || "",
1001
+ onChange: (B) => p((ee) => ({ ...ee, [y.id]: B.target.value }))
1002
+ }
1003
+ ) : null }, y.id);
1004
+ }) }),
1005
+ /* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
1006
+ Z.map((y, L) => {
1007
+ const T = ye(y, L), A = I.has(T), Y = A ? e.primaryLt : w && L % 2 !== 0 ? e.bg : e.surface;
627
1008
  return /* @__PURE__ */ t(
628
1009
  "div",
629
1010
  {
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
- return /* @__PURE__ */ t(
1011
+ style: { display: "flex", height: l, borderBottom: he, flexShrink: 0, background: Y, transition: "background .1s", cursor: c ? "pointer" : "default" },
1012
+ onMouseEnter: (B) => !A && (B.currentTarget.style.background = e.primaryLt + "80"),
1013
+ onMouseLeave: (B) => !A && (B.currentTarget.style.background = Y),
1014
+ children: V.map((B, ee) => {
1015
+ const te = (U == null ? void 0 : U.key) === T && (U == null ? void 0 : U.colId) === B.id, pe = y[B.id], Ue = Q[B.id] ?? 150, Le = (x || B.editable) && B.editable !== !1;
1016
+ let xe;
1017
+ return te ? xe = Nt(B, E, $, qe, () => ie(null)) : B.template ? xe = B.template(pe, y) : B.htmlEnable ? xe = /* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: String(pe ?? "") } }) : B.type === "boolean" ? xe = /* @__PURE__ */ t(
1018
+ "input",
1019
+ {
1020
+ type: "checkbox",
1021
+ readOnly: !0,
1022
+ checked: !!pe,
1023
+ style: { width: 16, height: 16, accentColor: e.primary, cursor: Le ? "pointer" : "default" }
1024
+ }
1025
+ ) : xe = It(pe, B.type), /* @__PURE__ */ t(
636
1026
  "div",
637
1027
  {
638
1028
  onClick: () => {
639
- H(v, D), h && F.editable !== !1 && (q({ key: W, colId: F.id }), ee(String(ce ?? "")));
1029
+ if (ve(y, L), !!Le)
1030
+ if (B.type === "boolean") {
1031
+ const Ie = !pe, Te = String(T);
1032
+ k((Ne) => ({ ...Ne, [Te]: { ...Ne[Te] || {}, [B.id]: Ie } })), b == null || b(y, B.id, Ie);
1033
+ } else
1034
+ ie({ key: T, colId: B.id }), $(String(pe ?? ""));
640
1035
  },
641
- style: xe(Y[de], F, de === 0, s),
642
- children: ge ? /* @__PURE__ */ t(
643
- "input",
644
- {
645
- autoFocus: !0,
646
- value: Q,
647
- onChange: (pe) => ee(pe.target.value),
648
- onBlur: re,
649
- onKeyDown: (pe) => {
650
- pe.key === "Enter" && re(), pe.key === "Escape" && q(null);
651
- },
652
- onClick: (pe) => pe.stopPropagation(),
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
- }
655
- ) : He
1036
+ style: { ...ke(B.id, Ue, B.align, ee === 0, l, te ? "visible" : "hidden"), background: Y },
1037
+ children: xe
656
1038
  },
657
- F.id
1039
+ B.id
658
1040
  );
659
1041
  })
660
1042
  },
661
- String(W)
1043
+ String(T)
662
1044
  );
663
1045
  }),
664
- O.length === 0 && /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: 40, color: e.textMut, fontSize: 13 }, children: "No data" })
1046
+ Z.length === 0 && /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: 40, color: e.textMut, fontSize: 13 }, children: "No data" })
665
1047
  ] }),
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);
1048
+ de && /* @__PURE__ */ t("div", { style: { display: "flex", borderTop: he, background: e.bg, flexShrink: 0, position: "sticky", bottom: 0, zIndex: 2 }, children: V.map((y, L) => {
1049
+ var te;
1050
+ const T = (te = y.footer) == null ? void 0 : te[0], A = fe[y.id] ?? { sum: 0, avg: 0, count: 0, min: 0, max: 0 };
1051
+ let Y = "";
1052
+ T && (typeof T.text == "function" ? Y = T.text(A) : T.text ? Y = T.text : T.summary && (Y = String(Math.round(A[T.summary] * 100) / 100)));
1053
+ const B = Q[y.id] ?? 150, ee = y.id in ce;
1054
+ return /* @__PURE__ */ t("div", { style: {
1055
+ ...ke(y.id, B, y.align, L === 0, a),
1056
+ fontWeight: 600,
1057
+ color: e.text,
1058
+ background: e.bg,
1059
+ ...ee ? { zIndex: 3 } : {}
1060
+ }, children: Y }, y.id);
671
1061
  }) })
672
1062
  ] }) })
673
1063
  }
674
1064
  );
675
1065
  }
676
- const G = ["#0288d1", "#43a047", "#f57c00", "#e53935", "#8e24aa", "#00838f", "#ef6c00", "#2e7d32"];
677
- function ht(n, i, p) {
678
- const s = n.filter((a) => !a.parent), f = n.filter((a) => !!a.parent);
679
- return s.map((a) => ({
680
- name: a[p],
681
- children: f.filter((h) => h.parent === a.id).map((h) => ({ name: h[p], value: Number(h[i] ?? 0) }))
1066
+ const re = ["#0288d1", "#43a047", "#f57c00", "#e53935", "#8e24aa", "#00838f", "#ef6c00", "#2e7d32"];
1067
+ function Et(n, o, d) {
1068
+ const l = n.filter((a) => !a.parent), f = n.filter((a) => !!a.parent);
1069
+ return l.map((a) => ({
1070
+ name: a[d],
1071
+ children: f.filter((h) => h.parent === a.id).map((h) => ({ name: h[d], value: Number(h[o] ?? 0) }))
682
1072
  }));
683
1073
  }
684
- function Nt({
1074
+ function Qt({
685
1075
  type: n = "bar",
686
- data: i = [],
687
- series: p = [],
688
- scales: s = {},
1076
+ data: o = [],
1077
+ series: d = [],
1078
+ scales: l = {},
689
1079
  legend: f,
690
1080
  height: a = 280,
691
1081
  style: h
692
1082
  }) {
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
- Oe,
1083
+ var b, M, D, R, z, C, F, p, I, W, v, X, J, se, U, ie;
1084
+ _(q, []);
1085
+ const u = ((b = l.bottom) == null ? void 0 : b.text) || o[0] && Object.keys(o[0])[0] || "x", x = /* @__PURE__ */ t(
1086
+ et,
697
1087
  {
698
1088
  contentStyle: { fontSize: 12, borderRadius: e.r, border: `1px solid ${e.border}` }
699
1089
  }
700
1090
  ), w = f ? /* @__PURE__ */ t(
701
- Ye,
1091
+ tt,
702
1092
  {
703
1093
  iconSize: 10,
704
1094
  wrapperStyle: { fontSize: 12 },
705
1095
  verticalAlign: f.valign === "bottom" ? "bottom" : f.valign === "middle" ? "middle" : "top",
706
1096
  align: f.halign ?? "center"
707
1097
  }
708
- ) : null, r = /* @__PURE__ */ t(Fe, { strokeDasharray: "3 3", stroke: e.border }), l = /* @__PURE__ */ t(
709
- Se,
1098
+ ) : null, r = /* @__PURE__ */ t(nt, { strokeDasharray: "3 3", stroke: e.border }), i = /* @__PURE__ */ t(
1099
+ Ee,
710
1100
  {
711
- dataKey: d,
1101
+ dataKey: u,
712
1102
  tick: { fontSize: 11, fill: e.textSec },
713
1103
  axisLine: { stroke: e.border },
714
1104
  tickLine: !1,
715
- label: (k = s.bottom) != null && k.title ? { value: s.bottom.title, position: "insideBottom", offset: -4, fontSize: 11 } : void 0
1105
+ label: (M = l.bottom) != null && M.title ? { value: l.bottom.title, position: "insideBottom", offset: -4, fontSize: 11 } : void 0
716
1106
  }
717
1107
  ), c = /* @__PURE__ */ t(
718
- we,
1108
+ Re,
719
1109
  {
720
1110
  tick: { fontSize: 11, fill: e.textSec },
721
1111
  axisLine: !1,
722
1112
  tickLine: !1,
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
- label: (M = s.left) != null && M.title ? { value: s.left.title, angle: -90, position: "insideLeft", fontSize: 11 } : void 0
1113
+ domain: [((D = l.left) == null ? void 0 : D.min) ?? "auto", ((R = l.left) == null ? void 0 : R.max) ?? "auto"],
1114
+ tickCount: (z = l.left) == null ? void 0 : z.maxTicks,
1115
+ label: (C = l.left) != null && C.title ? { value: l.left.title, angle: -90, position: "insideLeft", fontSize: 11 } : void 0
726
1116
  }
727
- ), b = {
1117
+ ), m = {
728
1118
  top: 10,
729
1119
  right: 20,
730
1120
  left: 0,
731
- bottom: (A = s.bottom) != null && A.title ? 20 : 0
732
- }, S = { data: i, margin: b };
733
- let o;
1121
+ bottom: (F = l.bottom) != null && F.title ? 20 : 0
1122
+ }, S = { data: o, margin: m };
1123
+ let s;
734
1124
  if (n === "bar")
735
- o = /* @__PURE__ */ g(Ke, { ...S, children: [
1125
+ s = /* @__PURE__ */ g(rt, { ...S, children: [
736
1126
  r,
737
- l,
1127
+ i,
738
1128
  c,
739
- y,
1129
+ x,
740
1130
  w,
741
- p.map((N, z) => /* @__PURE__ */ t(
742
- Ve,
1131
+ d.map((E, $) => /* @__PURE__ */ t(
1132
+ ot,
743
1133
  {
744
- dataKey: N.value || N.id || "",
745
- name: N.label || N.id,
746
- fill: N.fill || N.color || G[z % G.length],
1134
+ dataKey: E.value || E.id || "",
1135
+ name: E.label || E.id,
1136
+ fill: E.fill || E.color || re[$ % re.length],
747
1137
  radius: [3, 3, 0, 0]
748
1138
  },
749
- N.id ?? z
1139
+ E.id ?? $
750
1140
  ))
751
1141
  ] });
752
1142
  else if (n === "line")
753
- o = /* @__PURE__ */ g(_e, { ...S, children: [
1143
+ s = /* @__PURE__ */ g(it, { ...S, children: [
754
1144
  r,
755
- l,
1145
+ i,
756
1146
  c,
757
- y,
1147
+ x,
758
1148
  w,
759
- p.map((N, z) => {
760
- const B = N.color || G[z % G.length];
1149
+ d.map((E, $) => {
1150
+ const j = E.color || re[$ % re.length];
761
1151
  return /* @__PURE__ */ t(
762
- Xe,
1152
+ lt,
763
1153
  {
764
1154
  type: "monotone",
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 }
1155
+ dataKey: E.value || E.id || "",
1156
+ name: E.label || E.id,
1157
+ stroke: j,
1158
+ strokeWidth: E.strokeWidth ?? 2,
1159
+ dot: { r: 3, fill: j }
770
1160
  },
771
- N.id ?? z
1161
+ E.id ?? $
772
1162
  );
773
1163
  })
774
1164
  ] });
775
1165
  else if (n === "area")
776
- o = /* @__PURE__ */ g(qe, { ...S, children: [
1166
+ s = /* @__PURE__ */ g(st, { ...S, children: [
777
1167
  r,
778
- l,
1168
+ i,
779
1169
  c,
780
- y,
1170
+ x,
781
1171
  w,
782
- p.map((N, z) => {
783
- const B = N.color || G[z % G.length];
1172
+ d.map((E, $) => {
1173
+ const j = E.color || re[$ % re.length];
784
1174
  return /* @__PURE__ */ t(
785
- Ge,
1175
+ at,
786
1176
  {
787
1177
  type: "monotone",
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
1178
+ dataKey: E.value || E.id || "",
1179
+ name: E.label || E.id,
1180
+ stroke: j,
1181
+ fill: (E.fill || j) + "33",
1182
+ strokeWidth: E.strokeWidth ?? 2
793
1183
  },
794
- N.id ?? z
1184
+ E.id ?? $
795
1185
  );
796
1186
  })
797
1187
  ] });
798
1188
  else if (n === "pie" || n === "donut") {
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: [
1189
+ const E = d[0] || {}, $ = E.value || "value", j = E.text || "name", k = E.color && o[0] && E.color in o[0] ? E.color : null;
1190
+ s = /* @__PURE__ */ g(dt, { children: [
801
1191
  /* @__PURE__ */ t(
802
- Ue,
1192
+ ct,
803
1193
  {
804
- data: i,
1194
+ data: o,
805
1195
  cx: "50%",
806
1196
  cy: "50%",
807
1197
  outerRadius: n === "donut" ? "70%" : "80%",
808
1198
  innerRadius: n === "donut" ? "40%" : 0,
809
- dataKey: z,
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)}%`,
1199
+ dataKey: $,
1200
+ nameKey: j,
1201
+ stroke: E.stroke || "none",
1202
+ strokeWidth: E.strokeWidth ?? 0,
1203
+ label: ({ name: P, percent: O }) => `${P ?? ""} ${((O ?? 0) * 100).toFixed(0)}%`,
814
1204
  labelLine: !0,
815
1205
  paddingAngle: 2,
816
- children: i.map((Y, O) => /* @__PURE__ */ t(
817
- Qe,
1206
+ children: o.map((P, O) => /* @__PURE__ */ t(
1207
+ ut,
818
1208
  {
819
- fill: j ? Y[j] : G[O % G.length]
1209
+ fill: k ? P[k] : re[O % re.length]
820
1210
  },
821
1211
  O
822
1212
  ))
823
1213
  }
824
1214
  ),
825
- y,
1215
+ x,
826
1216
  w
827
1217
  ] });
828
1218
  } else if (n === "radar") {
829
- const N = ((u = s.radial) == null ? void 0 : u.value) || d;
830
- o = /* @__PURE__ */ g(Ze, { ...S, cx: "50%", cy: "50%", children: [
831
- /* @__PURE__ */ t(et, {}),
832
- /* @__PURE__ */ t(tt, { dataKey: N, tick: { fontSize: 11 } }),
833
- /* @__PURE__ */ t(nt, { tick: { fontSize: 9, fill: e.textMut }, axisLine: !1 }),
834
- p.map((z, B) => {
835
- const j = z.color || z.pointColor || G[B % G.length];
1219
+ const E = ((p = l.radial) == null ? void 0 : p.value) || u;
1220
+ s = /* @__PURE__ */ g(pt, { ...S, cx: "50%", cy: "50%", children: [
1221
+ /* @__PURE__ */ t(ht, {}),
1222
+ /* @__PURE__ */ t(ft, { dataKey: E, tick: { fontSize: 11 } }),
1223
+ /* @__PURE__ */ t(xt, { tick: { fontSize: 9, fill: e.textMut }, axisLine: !1 }),
1224
+ d.map(($, j) => {
1225
+ const k = $.color || $.pointColor || re[j % re.length];
836
1226
  return /* @__PURE__ */ t(
837
- rt,
1227
+ gt,
838
1228
  {
839
- dataKey: z.value || z.id || "",
840
- name: z.label || z.id,
841
- stroke: j,
842
- fill: j + "44"
1229
+ dataKey: $.value || $.id || "",
1230
+ name: $.label || $.id,
1231
+ stroke: k,
1232
+ fill: k + "44"
843
1233
  },
844
- z.id ?? B
1234
+ $.id ?? j
845
1235
  );
846
1236
  }),
847
- y,
1237
+ x,
848
1238
  w
849
1239
  ] });
850
1240
  } else if (n === "scatter")
851
- o = /* @__PURE__ */ g(ot, { margin: b, children: [
1241
+ s = /* @__PURE__ */ g(yt, { margin: m, children: [
852
1242
  r,
853
1243
  /* @__PURE__ */ t(
854
- Se,
1244
+ Ee,
855
1245
  {
856
1246
  type: "number",
857
1247
  dataKey: "x",
858
- name: ((I = s.bottom) == null ? void 0 : I.title) || "x",
1248
+ name: ((I = l.bottom) == null ? void 0 : I.title) || "x",
859
1249
  tick: { fontSize: 11, fill: e.textSec },
860
1250
  tickLine: !1,
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
1251
+ domain: [((W = l.bottom) == null ? void 0 : W.min) ?? "auto", ((v = l.bottom) == null ? void 0 : v.max) ?? "auto"],
1252
+ label: (X = l.bottom) != null && X.title ? { value: l.bottom.title, position: "insideBottom", offset: -4, fontSize: 11 } : void 0
863
1253
  }
864
1254
  ),
865
1255
  /* @__PURE__ */ t(
866
- we,
1256
+ Re,
867
1257
  {
868
1258
  type: "number",
869
1259
  dataKey: "y",
870
- name: ((q = s.left) == null ? void 0 : q.title) || "y",
1260
+ name: ((J = l.left) == null ? void 0 : J.title) || "y",
871
1261
  tick: { fontSize: 11, fill: e.textSec },
872
1262
  tickLine: !1,
873
1263
  axisLine: !1,
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
1264
+ domain: [((se = l.left) == null ? void 0 : se.min) ?? "auto", ((U = l.left) == null ? void 0 : U.max) ?? "auto"],
1265
+ label: (ie = l.left) != null && ie.title ? { value: l.left.title, angle: -90, position: "insideLeft", fontSize: 11 } : void 0
876
1266
  }
877
1267
  ),
878
- y,
1268
+ x,
879
1269
  w,
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]
1270
+ d.map((E, $) => {
1271
+ const j = E.value || "x", k = E.valueY || "y", P = (E.data || o).map((O) => ({
1272
+ x: O[j],
1273
+ y: O[k]
884
1274
  }));
885
1275
  return /* @__PURE__ */ t(
886
- it,
1276
+ bt,
887
1277
  {
888
- data: Y,
889
- name: N.label || N.id,
890
- fill: N.color || G[z % G.length]
1278
+ data: P,
1279
+ name: E.label || E.id,
1280
+ fill: E.color || re[$ % re.length]
891
1281
  },
892
- N.id ?? z
1282
+ E.id ?? $
893
1283
  );
894
1284
  })
895
1285
  ] });
896
1286
  else if (n === "treeMap") {
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
- st,
1287
+ const E = d[0] || {}, $ = E.value || "value", j = E.text || "name", k = Et(o, $, j), P = E.stroke || e.surface, O = E.strokeWidth ?? 2;
1288
+ s = /* @__PURE__ */ t(
1289
+ vt,
900
1290
  {
901
- data: j,
1291
+ data: k,
902
1292
  dataKey: "value",
903
1293
  aspectRatio: 4 / 3,
904
- stroke: Y,
905
- content: (J) => {
906
- const { x: X, y: oe, width: ne, height: ie, depth: le, index: ae, name: H } = J;
907
- if (le === 0) return null;
908
- const re = G[ae % G.length];
1294
+ stroke: P,
1295
+ content: (G) => {
1296
+ const { x: K, y: V, width: Q, height: Z, depth: fe, index: ne, name: H } = G;
1297
+ if (fe === 0) return null;
1298
+ const de = re[ne % re.length];
909
1299
  return /* @__PURE__ */ g("g", { children: [
910
1300
  /* @__PURE__ */ t(
911
1301
  "rect",
912
1302
  {
913
- x: X,
914
- y: oe,
915
- width: ne,
916
- height: ie,
917
- fill: re,
918
- stroke: Y,
1303
+ x: K,
1304
+ y: V,
1305
+ width: Q,
1306
+ height: Z,
1307
+ fill: de,
1308
+ stroke: P,
919
1309
  strokeWidth: O,
920
1310
  style: { borderRadius: 3 }
921
1311
  }
922
1312
  ),
923
- ne > 40 && ie > 20 && /* @__PURE__ */ t(
1313
+ Q > 40 && Z > 20 && /* @__PURE__ */ t(
924
1314
  "text",
925
1315
  {
926
- x: X + ne / 2,
927
- y: oe + ie / 2,
1316
+ x: K + Q / 2,
1317
+ y: V + Z / 2,
928
1318
  textAnchor: "middle",
929
1319
  dominantBaseline: "middle",
930
1320
  fill: "#fff",
@@ -943,194 +1333,194 @@ function Nt({
943
1333
  {
944
1334
  className: "dhx",
945
1335
  style: { width: "100%", height: a, padding: 12, background: e.surface, borderRadius: e.rMd, ...h },
946
- children: /* @__PURE__ */ t(lt, { width: "100%", height: "100%", children: o })
1336
+ children: /* @__PURE__ */ t(mt, { width: "100%", height: "100%", children: s })
947
1337
  }
948
1338
  );
949
1339
  }
950
- const ft = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], xt = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
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] = 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) => {
1340
+ const Rt = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], Wt = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
1341
+ function Zt({ value: n, range: o = !1, timepicker: d = !1, onChange: l, style: f }) {
1342
+ const a = /* @__PURE__ */ new Date(), h = n ? new Date(Array.isArray(n) ? n[0] : n) : a, [u, x] = N(h), [w, r] = N(n ?? (o ? [null, null] : null)), [i, c] = N(null), [m, S] = N({ h: 0, m: 0 });
1343
+ _(q, []);
1344
+ const s = u.getFullYear(), b = u.getMonth(), M = new Date(s, b, 1).getDay(), D = new Date(s, b + 1, 0).getDate(), R = [];
1345
+ for (let p = 0; p < M; p++) R.push(null);
1346
+ for (let p = 1; p <= D; p++) R.push(new Date(s, b, p));
1347
+ const z = (p) => p.toDateString() === a.toDateString(), C = (p) => {
958
1348
  if (!w) return !1;
959
- if (i && Array.isArray(w)) {
960
- const [I, R] = w;
1349
+ if (o && Array.isArray(w)) {
1350
+ const [I, W] = w;
961
1351
  if (!I) return !1;
962
- const C = u.getTime();
963
- return R ? C >= I.getTime() && C <= R.getTime() : u.toDateString() === I.toDateString();
1352
+ const v = p.getTime();
1353
+ return W ? v >= I.getTime() && v <= W.getTime() : p.toDateString() === I.toDateString();
964
1354
  }
965
- return u.toDateString() === w.toDateString();
966
- }, A = (u) => {
967
- if (i) {
968
- const [I, R] = Array.isArray(w) ? w : [null, null];
969
- if (!I || R)
970
- r([u, null]);
1355
+ return p.toDateString() === w.toDateString();
1356
+ }, F = (p) => {
1357
+ if (o) {
1358
+ const [I, W] = Array.isArray(w) ? w : [null, null];
1359
+ if (!I || W)
1360
+ r([p, null]);
971
1361
  else {
972
- const C = u < I ? [u, I] : [I, u];
973
- r(C), s == null || s(C);
1362
+ const v = p < I ? [p, I] : [I, p];
1363
+ r(v), l == null || l(v);
974
1364
  }
975
1365
  } else
976
- r(u), s == null || s(u);
1366
+ r(p), l == null || l(p);
977
1367
  };
978
1368
  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
1369
  /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 12 }, children: [
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: "‹" }),
1370
+ /* @__PURE__ */ t("button", { onClick: () => x((p) => new Date(p.getFullYear(), p.getMonth() - 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "‹" }),
981
1371
  /* @__PURE__ */ g("div", { style: { fontWeight: 700, fontSize: 14 }, children: [
982
- ft[x],
1372
+ Rt[b],
983
1373
  " ",
984
- o
1374
+ s
985
1375
  ] }),
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: "›" })
1376
+ /* @__PURE__ */ t("button", { onClick: () => x((p) => new Date(p.getFullYear(), p.getMonth() + 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "›" })
987
1377
  ] }),
988
1378
  /* @__PURE__ */ g("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, 32px)", gap: 2 }, children: [
989
- xt.map((u) => /* @__PURE__ */ t("div", { style: { textAlign: "center", fontSize: 11, fontWeight: 600, color: e.textMut, paddingBottom: 4 }, children: u }, u)),
990
- L.map((u, I) => {
991
- const R = u ? M(u) : !1, C = u && l && u.toDateString() === l.toDateString();
1379
+ Wt.map((p) => /* @__PURE__ */ t("div", { style: { textAlign: "center", fontSize: 11, fontWeight: 600, color: e.textMut, paddingBottom: 4 }, children: p }, p)),
1380
+ R.map((p, I) => {
1381
+ const W = p ? C(p) : !1, v = p && i && p.toDateString() === i.toDateString();
992
1382
  return /* @__PURE__ */ t(
993
1383
  "div",
994
1384
  {
995
- onClick: () => u && A(u),
996
- onMouseEnter: () => u && c(u),
1385
+ onClick: () => p && F(p),
1386
+ onMouseEnter: () => p && c(p),
997
1387
  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 && 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
- children: u == null ? void 0 : u.getDate()
1388
+ style: { width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: e.r, cursor: p ? "pointer" : "default", fontSize: 12, fontWeight: p && z(p) ? 700 : 400, background: W ? e.primary : v ? e.bg : "transparent", color: W ? "#fff" : p && z(p) ? e.primary : p ? e.text : "transparent", border: p && z(p) && !W ? `1px solid ${e.primary}` : "1px solid transparent", transition: "all .1s" },
1389
+ children: p == null ? void 0 : p.getDate()
1000
1390
  },
1001
1391
  I
1002
1392
  );
1003
1393
  })
1004
1394
  ] }),
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" } }),
1395
+ d && /* @__PURE__ */ g("div", { style: { borderTop: `1px solid ${e.border}`, marginTop: 12, paddingTop: 12, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
1396
+ /* @__PURE__ */ t("input", { type: "number", min: 0, max: 23, value: m.h, onChange: (p) => S((I) => ({ ...I, h: +p.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } }),
1007
1397
  /* @__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) => S((I) => ({ ...I, m: +u.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } })
1398
+ /* @__PURE__ */ t("input", { type: "number", min: 0, max: 59, value: m.m, onChange: (p) => S((I) => ({ ...I, m: +p.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } })
1009
1399
  ] })
1010
1400
  ] });
1011
1401
  }
1012
- function gt({ value: n, onChange: i, timeFormat: p = 12, controls: s = !1, minuteStep: f = 5, style: a }) {
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
- s ? b(u) : i == null || i(u);
1018
- }, k = () => {
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
- }, $ = { display: "flex", flexDirection: "column", alignItems: "center", gap: 4 }, L = (m) => ({
1402
+ function At({ value: n, onChange: o, timeFormat: d = 12, controls: l = !1, minuteStep: f = 5, style: a }) {
1403
+ const [h, u] = N((n == null ? void 0 : n.h) ?? (d === 24 ? 0 : 12)), [x, w] = N((n == null ? void 0 : n.m) ?? 0), [r, i] = N((n == null ? void 0 : n.ampm) ?? "AM"), [c, m] = N(null);
1404
+ _(q, []);
1405
+ const S = d === 24 ? Array.from({ length: 24 }, (z, C) => C) : Array.from({ length: 12 }, (z, C) => C + 1), s = Array.from({ length: Math.ceil(60 / f) }, (z, C) => C * f), b = (z, C, F) => {
1406
+ const p = d === 24 ? { h: z, m: C } : { h: z, m: C, ampm: F };
1407
+ l ? m(p) : o == null || o(p);
1408
+ }, M = () => {
1409
+ m(null), u((n == null ? void 0 : n.h) ?? (d === 24 ? 0 : 12)), w((n == null ? void 0 : n.m) ?? 0), i((n == null ? void 0 : n.ampm) ?? "AM");
1410
+ }, D = { display: "flex", flexDirection: "column", alignItems: "center", gap: 4 }, R = (z) => ({
1021
1411
  height: 32,
1022
1412
  display: "flex",
1023
1413
  alignItems: "center",
1024
1414
  justifyContent: "center",
1025
1415
  cursor: "pointer",
1026
1416
  fontSize: 13,
1027
- fontWeight: m ? 700 : 400,
1028
- background: m ? e.primaryLt : "transparent",
1029
- color: m ? e.primary : e.text
1417
+ fontWeight: z ? 700 : 400,
1418
+ background: z ? e.primaryLt : "transparent",
1419
+ color: z ? e.primary : e.text
1030
1420
  });
1031
1421
  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
1422
  /* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, alignItems: "stretch" }, children: [
1033
- /* @__PURE__ */ g("div", { style: $, children: [
1423
+ /* @__PURE__ */ g("div", { style: D, children: [
1034
1424
  /* @__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: S.map((m) => /* @__PURE__ */ t(
1425
+ /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: S.map((z) => /* @__PURE__ */ t(
1036
1426
  "div",
1037
1427
  {
1038
1428
  onClick: () => {
1039
- d(m), x(m, y, r);
1429
+ u(z), b(z, x, r);
1040
1430
  },
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")
1431
+ style: R(h === z),
1432
+ onMouseEnter: (C) => h !== z && (C.currentTarget.style.background = e.bg),
1433
+ onMouseLeave: (C) => h !== z && (C.currentTarget.style.background = "transparent"),
1434
+ children: String(z).padStart(2, "0")
1045
1435
  },
1046
- m
1436
+ z
1047
1437
  )) })
1048
1438
  ] }),
1049
- /* @__PURE__ */ g("div", { style: $, children: [
1439
+ /* @__PURE__ */ g("div", { style: D, children: [
1050
1440
  /* @__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: o.map((m) => /* @__PURE__ */ t(
1441
+ /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: s.map((z) => /* @__PURE__ */ t(
1052
1442
  "div",
1053
1443
  {
1054
1444
  onClick: () => {
1055
- w(m), x(h, m, r);
1445
+ w(z), b(h, z, r);
1056
1446
  },
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")
1447
+ style: R(x === z),
1448
+ onMouseEnter: (C) => x !== z && (C.currentTarget.style.background = e.bg),
1449
+ onMouseLeave: (C) => x !== z && (C.currentTarget.style.background = "transparent"),
1450
+ children: String(z).padStart(2, "0")
1061
1451
  },
1062
- m
1452
+ z
1063
1453
  )) })
1064
1454
  ] }),
1065
- p === 12 && /* @__PURE__ */ g("div", { style: $, children: [
1455
+ d === 12 && /* @__PURE__ */ g("div", { style: D, children: [
1066
1456
  /* @__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((m) => /* @__PURE__ */ t(
1457
+ /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden" }, children: ["AM", "PM"].map((z) => /* @__PURE__ */ t(
1068
1458
  "div",
1069
1459
  {
1070
1460
  onClick: () => {
1071
- l(m), x(h, y, m);
1461
+ i(z), b(h, x, z);
1072
1462
  },
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
1463
+ style: { height: 40, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", padding: "0 12px", fontSize: 13, fontWeight: r === z ? 700 : 400, background: r === z ? e.primary : e.surface, color: r === z ? "#fff" : e.text },
1464
+ children: z
1075
1465
  },
1076
- m
1466
+ z
1077
1467
  )) })
1078
1468
  ] })
1079
1469
  ] }),
1080
1470
  /* @__PURE__ */ g("div", { style: { textAlign: "center", marginTop: 12, fontSize: 22, fontWeight: 700, color: e.primary, letterSpacing: 2 }, children: [
1081
1471
  String(h).padStart(2, "0"),
1082
1472
  ":",
1083
- String(y).padStart(2, "0"),
1084
- p === 12 ? ` ${r}` : ""
1473
+ String(x).padStart(2, "0"),
1474
+ d === 12 ? ` ${r}` : ""
1085
1475
  ] }),
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" }),
1476
+ l && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, justifyContent: "flex-end", marginTop: 12 }, children: [
1477
+ /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: M, children: "Cancel" }),
1088
1478
  /* @__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);
1479
+ const z = c ?? (d === 24 ? { h, m: x } : { h, m: x, ampm: r });
1480
+ o == null || o(z);
1091
1481
  }, children: "Apply" })
1092
1482
  ] })
1093
1483
  ] });
1094
1484
  }
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" }) });
1096
- function $e({ data: n = [], value: i, placeholder: p = "Select or type...", multiselection: s = !1, label: f, onChange: a, style: h }) {
1097
- var A;
1098
- const [d, y] = T(!1), [w, r] = T(""), [l, c] = T(
1099
- s ? i ? [].concat(i) : [] : i || null
1100
- ), b = U(null), S = U(null);
1101
- K(_, []), he(b, Z(() => {
1102
- y(!1), r("");
1485
+ const Bt = ({ 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" }) });
1486
+ function Be({ data: n = [], value: o, placeholder: d = "Select or type...", multiselection: l = !1, label: f, onChange: a, style: h }) {
1487
+ var F;
1488
+ const [u, x] = N(!1), [w, r] = N(""), [i, c] = N(
1489
+ l ? o ? [].concat(o) : [] : o || null
1490
+ ), m = oe(null), S = oe(null);
1491
+ _(q, []), ge(m, ae(() => {
1492
+ x(!1), r("");
1103
1493
  }, []));
1104
- const o = ue(
1105
- () => n.filter((u) => !w || u.value.toLowerCase().includes(w.toLowerCase())),
1494
+ const s = ue(
1495
+ () => n.filter((p) => !w || p.value.toLowerCase().includes(w.toLowerCase())),
1106
1496
  [n, w]
1107
- ), x = (u) => s ? (l || []).includes(u) : l === u, k = (u) => {
1108
- const I = u.id || u.value;
1109
- if (s) {
1110
- const R = x(I) ? l.filter((C) => C !== I) : [...l || [], I];
1111
- c(R), a == null || a(R);
1497
+ ), b = (p) => l ? (i || []).includes(p) : i === p, M = (p) => {
1498
+ const I = p.id || p.value;
1499
+ if (l) {
1500
+ const W = b(I) ? i.filter((v) => v !== I) : [...i || [], I];
1501
+ c(W), a == null || a(W);
1112
1502
  } else
1113
- c(I), r(""), y(!1), a == null || a(I);
1114
- }, $ = (u) => {
1115
- const I = l.filter((R) => R !== u);
1503
+ c(I), r(""), x(!1), a == null || a(I);
1504
+ }, D = (p) => {
1505
+ const I = i.filter((W) => W !== p);
1116
1506
  c(I), a == null || a(I);
1117
- }, L = () => {
1118
- y(!0), setTimeout(() => {
1119
- var u;
1120
- return (u = S.current) == null ? void 0 : u.focus();
1507
+ }, R = () => {
1508
+ x(!0), setTimeout(() => {
1509
+ var p;
1510
+ return (p = S.current) == null ? void 0 : p.focus();
1121
1511
  }, 0);
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: [
1512
+ }, z = ((F = n.find((p) => (p.id || p.value) === i)) == null ? void 0 : F.value) || "", C = l ? i || [] : [];
1513
+ return /* @__PURE__ */ g("div", { ref: m, className: "dhx", style: { position: "relative", ...h }, children: [
1124
1514
  f && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: f }),
1125
1515
  /* @__PURE__ */ g(
1126
1516
  "div",
1127
1517
  {
1128
- onClick: L,
1518
+ onClick: R,
1129
1519
  style: {
1130
1520
  display: "flex",
1131
1521
  alignItems: "center",
1132
- flexWrap: s ? "wrap" : "nowrap",
1133
- border: `1px solid ${d ? e.primary : e.border}`,
1522
+ flexWrap: l ? "wrap" : "nowrap",
1523
+ border: `1px solid ${u ? e.primary : e.border}`,
1134
1524
  borderRadius: e.r,
1135
1525
  minHeight: 34,
1136
1526
  padding: "4px 8px",
@@ -1138,11 +1528,11 @@ function $e({ data: n = [], value: i, placeholder: p = "Select or type...", mult
1138
1528
  background: e.surface,
1139
1529
  gap: 4,
1140
1530
  transition: "border-color .15s",
1141
- boxShadow: d ? `0 0 0 3px ${e.primary}22` : "none"
1531
+ boxShadow: u ? `0 0 0 3px ${e.primary}22` : "none"
1142
1532
  },
1143
1533
  children: [
1144
- s && /* @__PURE__ */ g(Ne, { children: [
1145
- M.map((u) => {
1534
+ l && /* @__PURE__ */ g(Ye, { children: [
1535
+ C.map((p) => {
1146
1536
  var I;
1147
1537
  return /* @__PURE__ */ g("span", { style: {
1148
1538
  display: "inline-flex",
@@ -1156,55 +1546,55 @@ function $e({ data: n = [], value: i, placeholder: p = "Select or type...", mult
1156
1546
  lineHeight: 1.5,
1157
1547
  whiteSpace: "nowrap"
1158
1548
  }, children: [
1159
- ((I = n.find((R) => (R.id || R.value) === u)) == null ? void 0 : I.value) || u,
1549
+ ((I = n.find((W) => (W.id || W.value) === p)) == null ? void 0 : I.value) || p,
1160
1550
  /* @__PURE__ */ t(
1161
1551
  "span",
1162
1552
  {
1163
- onClick: (R) => {
1164
- R.stopPropagation(), $(u);
1553
+ onClick: (W) => {
1554
+ W.stopPropagation(), D(p);
1165
1555
  },
1166
1556
  style: { cursor: "pointer", fontSize: 15, lineHeight: 1, opacity: 0.75, marginLeft: 2 },
1167
1557
  children: "×"
1168
1558
  }
1169
1559
  )
1170
- ] }, u);
1560
+ ] }, p);
1171
1561
  }),
1172
1562
  /* @__PURE__ */ t(
1173
1563
  "input",
1174
1564
  {
1175
1565
  ref: S,
1176
1566
  value: w,
1177
- onChange: (u) => {
1178
- r(u.target.value), y(!0);
1567
+ onChange: (p) => {
1568
+ r(p.target.value), x(!0);
1179
1569
  },
1180
- onFocus: () => y(!0),
1181
- onClick: (u) => u.stopPropagation(),
1182
- placeholder: M.length ? "" : p,
1570
+ onFocus: () => x(!0),
1571
+ onClick: (p) => p.stopPropagation(),
1572
+ placeholder: C.length ? "" : d,
1183
1573
  style: { flex: 1, minWidth: 60, border: "none", outline: "none", fontSize: 13, background: "transparent", color: e.text, padding: 0 }
1184
1574
  }
1185
1575
  )
1186
1576
  ] }),
1187
- !s && /* @__PURE__ */ t(
1577
+ !l && /* @__PURE__ */ t(
1188
1578
  "input",
1189
1579
  {
1190
1580
  ref: S,
1191
- value: d ? w : m,
1192
- onChange: (u) => {
1193
- r(u.target.value), y(!0);
1581
+ value: u ? w : z,
1582
+ onChange: (p) => {
1583
+ r(p.target.value), x(!0);
1194
1584
  },
1195
1585
  onFocus: () => {
1196
- y(!0), r("");
1586
+ x(!0), r("");
1197
1587
  },
1198
- onClick: (u) => u.stopPropagation(),
1199
- placeholder: p,
1588
+ onClick: (p) => p.stopPropagation(),
1589
+ placeholder: d,
1200
1590
  style: { flex: 1, border: "none", outline: "none", fontSize: 13, background: "transparent", color: e.text, padding: 0 }
1201
1591
  }
1202
1592
  ),
1203
- /* @__PURE__ */ t(yt, { open: d })
1593
+ /* @__PURE__ */ t(Bt, { open: u })
1204
1594
  ]
1205
1595
  }
1206
1596
  ),
1207
- d && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: {
1597
+ u && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: {
1208
1598
  position: "absolute",
1209
1599
  top: "calc(100% + 4px)",
1210
1600
  left: 0,
@@ -1215,12 +1605,12 @@ function $e({ data: n = [], value: i, placeholder: p = "Select or type...", mult
1215
1605
  boxShadow: e.shadowLg,
1216
1606
  zIndex: 100
1217
1607
  }, 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);
1608
+ s.map((p) => {
1609
+ const I = p.id || p.value, W = b(I);
1220
1610
  return /* @__PURE__ */ g(
1221
1611
  "div",
1222
1612
  {
1223
- onClick: () => k(u),
1613
+ onClick: () => M(p),
1224
1614
  style: {
1225
1615
  padding: "8px 12px",
1226
1616
  cursor: "pointer",
@@ -1228,28 +1618,28 @@ function $e({ data: n = [], value: i, placeholder: p = "Select or type...", mult
1228
1618
  alignItems: "center",
1229
1619
  gap: 8,
1230
1620
  fontSize: 13,
1231
- background: R ? e.primaryLt : "transparent",
1232
- color: R ? e.primary : e.text
1621
+ background: W ? e.primaryLt : "transparent",
1622
+ color: W ? e.primary : e.text
1233
1623
  },
1234
- onMouseEnter: (C) => !R && (C.currentTarget.style.background = e.bg),
1235
- onMouseLeave: (C) => !R && (C.currentTarget.style.background = "transparent"),
1624
+ onMouseEnter: (v) => !W && (v.currentTarget.style.background = e.bg),
1625
+ onMouseLeave: (v) => !W && (v.currentTarget.style.background = "transparent"),
1236
1626
  children: [
1237
- s && /* @__PURE__ */ t("span", { style: {
1627
+ l && /* @__PURE__ */ t("span", { style: {
1238
1628
  width: 14,
1239
1629
  height: 14,
1240
1630
  flexShrink: 0,
1241
- border: `2px solid ${R ? e.primary : e.borderDk}`,
1631
+ border: `2px solid ${W ? e.primary : e.borderDk}`,
1242
1632
  borderRadius: 3,
1243
1633
  display: "flex",
1244
1634
  alignItems: "center",
1245
1635
  justifyContent: "center",
1246
- background: R ? e.primary : "transparent"
1247
- }, children: R && /* @__PURE__ */ t("span", { style: { color: "#fff", fontSize: 9, lineHeight: 1 }, children: "✓" }) }),
1248
- /* @__PURE__ */ t("span", { style: { flex: 1 }, children: u.value }),
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: [
1636
+ background: W ? e.primary : "transparent"
1637
+ }, children: W && /* @__PURE__ */ t("span", { style: { color: "#fff", fontSize: 9, lineHeight: 1 }, children: "✓" }) }),
1638
+ /* @__PURE__ */ t("span", { style: { flex: 1 }, children: p.value }),
1639
+ !l && W && /* @__PURE__ */ t("span", { style: { color: e.primary, fontSize: 12, fontWeight: 700 }, children: "✓" }),
1640
+ p.count !== void 0 && /* @__PURE__ */ g("span", { style: { fontSize: 11, color: e.textMut }, children: [
1251
1641
  "(",
1252
- u.count,
1642
+ p.count,
1253
1643
  ")"
1254
1644
  ] })
1255
1645
  ]
@@ -1257,84 +1647,84 @@ function $e({ data: n = [], value: i, placeholder: p = "Select or type...", mult
1257
1647
  I
1258
1648
  );
1259
1649
  }),
1260
- o.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 16, textAlign: "center", color: e.textMut, fontSize: 13 }, children: "No matches" })
1650
+ s.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 16, textAlign: "center", color: e.textMut, fontSize: 13 }, children: "No matches" })
1261
1651
  ] }) })
1262
1652
  ] });
1263
1653
  }
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 }) {
1265
- const [r, l] = T(s ?? (f ? [n, i] : n));
1266
- K(_, []);
1267
- const c = (k, $) => {
1268
- if (!d)
1654
+ function He({ min: n = 0, max: o = 100, step: d = 1, value: l, range: f = !1, label: a, tick: h, disabled: u = !1, onChange: x, style: w }) {
1655
+ const [r, i] = N(l ?? (f ? [n, o] : n));
1656
+ _(q, []);
1657
+ const c = (M, D) => {
1658
+ if (!u)
1269
1659
  if (f) {
1270
- const L = [...r];
1271
- L[k] = $, l(L), y == null || y(L);
1660
+ const R = [...r];
1661
+ R[M] = D, i(R), x == null || x(R);
1272
1662
  } else
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: [
1663
+ i(D), x == null || x(D);
1664
+ }, m = (M) => (M - n) / (o - n) * 100, S = f ? r : [r], s = f ? { left: `${m(S[0])}%`, width: `${m(S[1]) - m(S[0])}%` } : { left: 0, width: `${m(S[0])}%` }, b = u ? e.border : e.primary;
1665
+ return /* @__PURE__ */ g("div", { className: "dhx", style: { width: "100%", opacity: u ? 0.5 : 1, ...w }, children: [
1276
1666
  a && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: a }),
1277
1667
  /* @__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(
1668
+ /* @__PURE__ */ t("div", { style: { position: "absolute", ...s, height: "100%", background: b, borderRadius: 2 } }),
1669
+ S.map((M, D) => /* @__PURE__ */ t(
1280
1670
  "input",
1281
1671
  {
1282
1672
  type: "range",
1283
1673
  min: n,
1284
- max: i,
1285
- step: p,
1286
- value: k,
1287
- disabled: d,
1288
- onChange: (L) => {
1289
- const m = +L.target.value;
1290
- f && $ === 0 && m >= r[1] || f && $ === 1 && m <= r[0] || c($, m);
1674
+ max: o,
1675
+ step: d,
1676
+ value: M,
1677
+ disabled: u,
1678
+ onChange: (R) => {
1679
+ const z = +R.target.value;
1680
+ f && D === 0 && z >= r[1] || f && D === 1 && z <= r[0] || c(D, z);
1291
1681
  },
1292
- style: { position: "absolute", width: "100%", height: "100%", opacity: 0, cursor: d ? "not-allowed" : "pointer", top: 0, left: 0, margin: 0 }
1682
+ style: { position: "absolute", width: "100%", height: "100%", opacity: 0, cursor: u ? "not-allowed" : "pointer", top: 0, left: 0, margin: 0 }
1293
1683
  },
1294
- $
1684
+ D
1295
1685
  )),
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 }) }, $))
1686
+ S.map((M, D) => /* @__PURE__ */ t("div", { style: { position: "absolute", left: `${m(M)}%`, top: "50%", transform: "translate(-50%, -50%)", width: 16, height: 16, borderRadius: "50%", background: e.surface, border: `2px solid ${b}`, 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: u ? e.textMut : e.primaryDk, color: "#fff", padding: "2px 6px", borderRadius: e.r, fontSize: 11, fontWeight: 700, whiteSpace: "nowrap" }, children: M }) }, D))
1297
1687
  ] }) }),
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)) })
1688
+ h && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", marginTop: 2 }, children: [n, Math.round((o + n) / 2), o].map((M) => /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: M }, M)) })
1299
1689
  ] });
1300
1690
  }
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"];
1302
- function ye(n) {
1303
- const i = parseInt(n.slice(1, 3), 16) / 255, p = parseInt(n.slice(3, 5), 16) / 255, s = parseInt(n.slice(5, 7), 16) / 255, f = Math.max(i, p, s), a = Math.min(i, p, s);
1304
- let h = 0, d = 0;
1305
- const y = (f + a) / 2;
1691
+ const Ht = ["#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"];
1692
+ function we(n) {
1693
+ const o = parseInt(n.slice(1, 3), 16) / 255, d = parseInt(n.slice(3, 5), 16) / 255, l = parseInt(n.slice(5, 7), 16) / 255, f = Math.max(o, d, l), a = Math.min(o, d, l);
1694
+ let h = 0, u = 0;
1695
+ const x = (f + a) / 2;
1306
1696
  if (f !== a) {
1307
1697
  const w = f - a;
1308
- d = y > 0.5 ? w / (2 - f - a) : w / (f + a), h = f === i ? ((p - s) / w + (p < s ? 6 : 0)) / 6 : f === p ? ((s - i) / w + 2) / 6 : ((i - p) / w + 4) / 6;
1698
+ u = x > 0.5 ? w / (2 - f - a) : w / (f + a), h = f === o ? ((d - l) / w + (d < l ? 6 : 0)) / 6 : f === d ? ((l - o) / w + 2) / 6 : ((o - d) / w + 4) / 6;
1309
1699
  }
1310
- return [Math.round(h * 360), Math.round(d * 100), Math.round(y * 100)];
1700
+ return [Math.round(h * 360), Math.round(u * 100), Math.round(x * 100)];
1311
1701
  }
1312
- function Ce(n, i, p) {
1313
- i /= 100, p /= 100;
1314
- const s = i * Math.min(p, 1 - p), f = (a) => {
1315
- const h = (a + n / 30) % 12, d = p - s * Math.max(Math.min(h - 3, 9 - h, 1), -1);
1316
- return Math.round(255 * d).toString(16).padStart(2, "0");
1702
+ function je(n, o, d) {
1703
+ o /= 100, d /= 100;
1704
+ const l = o * Math.min(d, 1 - d), f = (a) => {
1705
+ const h = (a + n / 30) % 12, u = d - l * Math.max(Math.min(h - 3, 9 - h, 1), -1);
1706
+ return Math.round(255 * u).toString(16).padStart(2, "0");
1317
1707
  };
1318
1708
  return "#" + f(0) + f(8) + f(4);
1319
1709
  }
1320
- function Et({ value: n = "#0288d1", onChange: i, style: p }) {
1321
- const [s, f] = T(() => ye(n)), a = Ce(...s);
1322
- K(_, []);
1323
- const h = (d) => {
1324
- f(d), i == null || i(Ce(...d));
1710
+ function en({ value: n = "#0288d1", onChange: o, style: d }) {
1711
+ const [l, f] = N(() => we(n)), a = je(...l);
1712
+ _(q, []);
1713
+ const h = (u) => {
1714
+ f(u), o == null || o(je(...u));
1325
1715
  };
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: [
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" } }),
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: [
1716
+ 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, ...d }, children: [
1717
+ /* @__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(${l[0]},100%,50%))`, cursor: "crosshair" } }),
1718
+ [["Hue", 0, 360, l[0]], ["Saturation", 0, 100, l[1]], ["Lightness", 0, 100, l[2]]].map(([u, x, w, r], i) => /* @__PURE__ */ g("div", { style: { marginBottom: i < 2 ? 8 : 12 }, children: [
1329
1719
  /* @__PURE__ */ g("div", { className: "dhx dhx-label", children: [
1330
- d,
1331
- l > 0 ? ` (${r}%)` : ""
1720
+ u,
1721
+ i > 0 ? ` (${r}%)` : ""
1332
1722
  ] }),
1333
- /* @__PURE__ */ t("input", { type: "range", min: y, max: w, value: r, onChange: (c) => {
1334
- const b = [...s];
1335
- b[l] = +c.target.value, h(b);
1723
+ /* @__PURE__ */ t("input", { type: "range", min: x, max: w, value: r, onChange: (c) => {
1724
+ const m = [...l];
1725
+ m[i] = +c.target.value, h(m);
1336
1726
  }, style: { width: "100%", accentColor: e.primary } })
1337
- ] }, d)),
1727
+ ] }, u)),
1338
1728
  /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
1339
1729
  /* @__PURE__ */ t("div", { style: { width: 36, height: 36, borderRadius: e.r, background: a, border: `1px solid ${e.border}`, flexShrink: 0 } }),
1340
1730
  /* @__PURE__ */ t(
@@ -1343,162 +1733,162 @@ function Et({ value: n = "#0288d1", onChange: i, style: p }) {
1343
1733
  className: "dhx dhx-input",
1344
1734
  style: { flex: 1, fontFamily: "monospace", fontSize: 12 },
1345
1735
  value: a,
1346
- onChange: (d) => {
1736
+ onChange: (u) => {
1347
1737
  try {
1348
- h(ye(d.target.value)), i == null || i(d.target.value);
1738
+ h(we(u.target.value)), o == null || o(u.target.value);
1349
1739
  } catch {
1350
1740
  }
1351
1741
  }
1352
1742
  }
1353
1743
  )
1354
1744
  ] }),
1355
- /* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "repeat(13, 1fr)", gap: 3 }, children: bt.map((d) => /* @__PURE__ */ t(
1745
+ /* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "repeat(13, 1fr)", gap: 3 }, children: Ht.map((u) => /* @__PURE__ */ t(
1356
1746
  "div",
1357
1747
  {
1358
1748
  onClick: () => {
1359
- f(ye(d)), i == null || i(d);
1749
+ f(we(u)), o == null || o(u);
1360
1750
  },
1361
- style: { width: 14, height: 14, borderRadius: 2, background: d, cursor: "pointer", border: a === d ? `2px solid ${e.text}` : "1px solid rgba(0,0,0,.15)", transition: "transform .1s" },
1362
- onMouseEnter: (y) => y.currentTarget.style.transform = "scale(1.3)",
1363
- onMouseLeave: (y) => y.currentTarget.style.transform = "scale(1)"
1751
+ style: { width: 14, height: 14, borderRadius: 2, background: u, cursor: "pointer", border: a === u ? `2px solid ${e.text}` : "1px solid rgba(0,0,0,.15)", transition: "transform .1s" },
1752
+ onMouseEnter: (x) => x.currentTarget.style.transform = "scale(1.3)",
1753
+ onMouseLeave: (x) => x.currentTarget.style.transform = "scale(1)"
1364
1754
  },
1365
- d
1755
+ u
1366
1756
  )) })
1367
1757
  ] });
1368
1758
  }
1369
- function Wt({ trigger: n, children: i, placement: p = "bottom-start", style: s }) {
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: [
1759
+ function tn({ trigger: n, children: o, placement: d = "bottom-start", style: l }) {
1760
+ const [f, a] = N(!1), [h, u] = N({ top: "100%", left: 0 }), x = oe(null), w = oe(null);
1761
+ return _(q, []), ge(x, ae(() => a(!1), [])), /* @__PURE__ */ g("div", { ref: x, className: "dhx", style: { position: "relative", display: "inline-block" }, children: [
1372
1762
  /* @__PURE__ */ t("div", { ref: w, onClick: () => {
1373
- a((l) => {
1374
- if (!l && w.current) {
1375
- const c = w.current.getBoundingClientRect(), b = {
1763
+ a((i) => {
1764
+ if (!i && w.current) {
1765
+ const c = w.current.getBoundingClientRect(), m = {
1376
1766
  "bottom-start": { top: c.height + 4, left: 0 },
1377
1767
  "bottom-end": { top: c.height + 4, right: 0, left: "auto" },
1378
1768
  "top-start": { bottom: c.height + 4, top: "auto", left: 0 }
1379
1769
  };
1380
- d(b[p] || b["bottom-start"]);
1770
+ u(m[d] || m["bottom-start"]);
1381
1771
  }
1382
- return !l;
1772
+ return !i;
1383
1773
  });
1384
1774
  }, children: n }),
1385
- f && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", ...h, zIndex: 200, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, boxShadow: e.shadowLg, ...s }, children: i })
1775
+ f && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", ...h, zIndex: 200, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, boxShadow: e.shadowLg, ...l }, children: o })
1386
1776
  ] });
1387
1777
  }
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 }) {
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 = () => {
1778
+ function nn({ title: n, children: o, width: d = 480, height: l, closable: f = !0, movable: a = !0, modal: h = !1, defaultOpen: u = !0, footer: x, onClose: w, style: r }) {
1779
+ const [i, c] = N(u), [m, S] = N({ x: 0, y: 0 });
1780
+ _(q, []);
1781
+ const s = St(ae((M, D) => a && S({ x: M, y: D }), [a])), b = () => {
1392
1782
  c(!1), w == null || w();
1393
1783
  };
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: [
1784
+ return i ? /* @__PURE__ */ g(Ye, { children: [
1785
+ h && /* @__PURE__ */ t("div", { style: { position: "fixed", inset: 0, background: "rgba(0,0,0,.45)", zIndex: 900 }, onClick: f ? b : void 0 }),
1786
+ /* @__PURE__ */ g("div", { className: "dhx", style: { position: h ? "fixed" : "absolute", left: "50%", top: "50%", transform: `translate(calc(-50% + ${m.x}px), calc(-50% + ${m.y}px))`, width: d, ...l ? { height: l } : {}, background: e.surface, borderRadius: e.rMd, boxShadow: e.shadowLg, zIndex: 901, display: "flex", flexDirection: "column", overflow: "hidden", ...r }, children: [
1787
+ /* @__PURE__ */ g("div", { onMouseDown: (M) => s(M, m.x, m.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: [
1398
1788
  /* @__PURE__ */ t("span", { style: { flex: 1, fontWeight: 700, fontSize: 15 }, children: n }),
1399
1789
  f && /* @__PURE__ */ t(
1400
1790
  "button",
1401
1791
  {
1402
- onClick: x,
1792
+ onClick: b,
1403
1793
  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 },
1404
- onMouseEnter: (k) => k.currentTarget.style.background = e.border,
1405
- onMouseLeave: (k) => k.currentTarget.style.background = "none",
1794
+ onMouseEnter: (M) => M.currentTarget.style.background = e.border,
1795
+ onMouseLeave: (M) => M.currentTarget.style.background = "none",
1406
1796
  children: "×"
1407
1797
  }
1408
1798
  )
1409
1799
  ] }),
1410
- /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, minHeight: 0, padding: 20, overflowY: "auto" }, children: i }),
1411
- y && /* @__PURE__ */ t("div", { style: { padding: "12px 16px", borderTop: `1px solid ${e.border}`, display: "flex", justifyContent: "flex-end", gap: 8, background: e.bg }, children: y })
1800
+ /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, minHeight: 0, padding: 20, overflowY: "auto" }, children: o }),
1801
+ x && /* @__PURE__ */ t("div", { style: { padding: "12px 16px", borderTop: `1px solid ${e.border}`, display: "flex", justifyContent: "flex-end", gap: 8, background: e.bg }, children: x })
1412
1802
  ] })
1413
1803
  ] }) : null;
1414
1804
  }
1415
- const Re = Pe(null), mt = { success: "✓", error: "✕", warning: "⚠", info: "ℹ" }, Ie = { success: e.success, error: e.danger, warning: e.warning, info: e.primary };
1416
- function Bt({ children: n }) {
1417
- const [i, p] = T([]);
1418
- K(_, []);
1419
- const s = Z((h) => p((d) => d.filter((y) => y.id !== h)), []), f = Z((h) => {
1420
- const d = Date.now();
1421
- return p((y) => [...y, { id: d, ...h }]), h.duration !== 0 && setTimeout(() => s(d), h.duration || 4e3), d;
1422
- }, [s]), a = {
1805
+ const Ke = Qe(null), jt = { success: "✓", error: "✕", warning: "⚠", info: "ℹ" }, Fe = { success: e.success, error: e.danger, warning: e.warning, info: e.primary };
1806
+ function rn({ children: n }) {
1807
+ const [o, d] = N([]);
1808
+ _(q, []);
1809
+ const l = ae((h) => d((u) => u.filter((x) => x.id !== h)), []), f = ae((h) => {
1810
+ const u = Date.now();
1811
+ return d((x) => [...x, { id: u, ...h }]), h.duration !== 0 && setTimeout(() => l(u), h.duration || 4e3), u;
1812
+ }, [l]), a = {
1423
1813
  message: f,
1424
- alert: (h, d) => f({ type: "info", title: h, ...d }),
1425
- confirm: (h, d, y) => f({ type: "warning", title: h, confirm: d, ...y })
1814
+ alert: (h, u) => f({ type: "info", title: h, ...u }),
1815
+ confirm: (h, u, x) => f({ type: "warning", title: h, confirm: u, ...x })
1426
1816
  };
1427
- return /* @__PURE__ */ g(Re.Provider, { value: a, children: [
1817
+ return /* @__PURE__ */ g(Ke.Provider, { value: a, children: [
1428
1818
  n,
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) => {
1430
- const d = h.type || "info";
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: [
1432
- /* @__PURE__ */ t("span", { style: { fontSize: 18, color: Ie[d], lineHeight: 1 }, children: mt[d] }),
1819
+ /* @__PURE__ */ t("div", { style: { position: "fixed", top: 20, right: 20, zIndex: 9999, display: "flex", flexDirection: "column", gap: 8, pointerEvents: "none" }, children: o.map((h) => {
1820
+ const u = h.type || "info";
1821
+ return /* @__PURE__ */ g("div", { style: { background: e.surface, border: `1px solid ${e.border}`, borderLeft: `4px solid ${Fe[u]}`, 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: [
1822
+ /* @__PURE__ */ t("span", { style: { fontSize: 18, color: Fe[u], lineHeight: 1 }, children: jt[u] }),
1433
1823
  /* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
1434
1824
  h.title && /* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 13, marginBottom: h.text ? 3 : 0 }, children: h.title }),
1435
1825
  h.text && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec, lineHeight: 1.5 }, children: h.text }),
1436
1826
  h.confirm && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 6, marginTop: 8 }, children: [
1437
1827
  /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", style: { height: 26, fontSize: 12 }, onClick: () => {
1438
- h.confirm(!0), s(h.id);
1828
+ h.confirm(!0), l(h.id);
1439
1829
  }, children: "Confirm" }),
1440
1830
  /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", style: { height: 26, fontSize: 12 }, onClick: () => {
1441
- h.confirm(!1), s(h.id);
1831
+ h.confirm(!1), l(h.id);
1442
1832
  }, children: "Cancel" })
1443
1833
  ] })
1444
1834
  ] }),
1445
- /* @__PURE__ */ t("button", { onClick: () => s(h.id), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 14, lineHeight: 1, padding: 0 }, children: "×" })
1835
+ /* @__PURE__ */ t("button", { onClick: () => l(h.id), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 14, lineHeight: 1, padding: 0 }, children: "×" })
1446
1836
  ] }, h.id);
1447
1837
  }) })
1448
1838
  ] });
1449
1839
  }
1450
- function Ht() {
1451
- const n = je(Re);
1840
+ function on() {
1841
+ const n = Ze(Ke);
1452
1842
  if (!n) throw new Error("useMessage must be used inside <MessageProvider>");
1453
1843
  return n;
1454
1844
  }
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 }) {
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();
1462
- return u.has(M) ? u.delete(M) : u.add(M), u;
1463
- }), x(m), h == null || h(L);
1464
- }, $ = (L, m) => {
1465
- d == null || d({ ...L, value: b }, m), c(null);
1845
+ function ln({ data: n = [], template: o, keyNavigation: d = !0, multiselection: l = !1, editable: f = !1, height: a = 400, onSelect: h, onEdit: u, style: x }) {
1846
+ const [w, r] = N(/* @__PURE__ */ new Set()), [i, c] = N(null), [m, S] = N(""), [s, b] = N(null);
1847
+ _(q, []);
1848
+ const M = (R, z) => {
1849
+ const C = R.id ?? z;
1850
+ r((F) => {
1851
+ const p = l ? new Set(F) : /* @__PURE__ */ new Set();
1852
+ return p.has(C) ? p.delete(C) : p.add(C), p;
1853
+ }), b(z), h == null || h(R);
1854
+ }, D = (R, z) => {
1855
+ u == null || u({ ...R, value: m }, z), c(null);
1466
1856
  };
1467
1857
  return /* @__PURE__ */ g(
1468
1858
  "div",
1469
1859
  {
1470
1860
  className: "dhx dhx-scroll",
1471
- style: { height: a, overflowY: "auto", border: `1px solid ${e.border}`, borderRadius: e.r, background: e.surface, ...y },
1861
+ style: { height: a, overflowY: "auto", border: `1px solid ${e.border}`, borderRadius: e.r, background: e.surface, ...x },
1472
1862
  tabIndex: 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)));
1863
+ onKeyDown: (R) => {
1864
+ d && (R.key === "ArrowDown" && b((z) => Math.min((z ?? -1) + 1, n.length - 1)), R.key === "ArrowUp" && b((z) => Math.max((z ?? 1) - 1, 0)));
1475
1865
  },
1476
1866
  children: [
1477
- n.map((L, m) => {
1478
- const M = L.id ?? m, A = w.has(M), u = o === m;
1867
+ n.map((R, z) => {
1868
+ const C = R.id ?? z, F = w.has(C), p = s === z;
1479
1869
  return /* @__PURE__ */ t(
1480
1870
  "div",
1481
1871
  {
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(
1872
+ onClick: () => M(R, z),
1873
+ onDoubleClick: () => f && (c(z), S(String(R.value || ""))),
1874
+ style: { display: "flex", alignItems: "center", padding: "0 12px", height: 40, cursor: "pointer", fontSize: 13, borderBottom: `1px solid ${e.border}`, background: F ? e.primaryLt : p ? e.bg : e.surface, color: F ? e.primary : e.text, outline: p ? `2px solid ${e.primary}44` : "none", transition: "background .1s" },
1875
+ children: i === z ? /* @__PURE__ */ t(
1486
1876
  "input",
1487
1877
  {
1488
1878
  autoFocus: !0,
1489
1879
  className: "dhx dhx-input",
1490
1880
  style: { height: 28, flex: 1 },
1491
- value: b,
1881
+ value: m,
1492
1882
  onChange: (I) => S(I.target.value),
1493
- onBlur: () => $(L, m),
1883
+ onBlur: () => D(R, z),
1494
1884
  onKeyDown: (I) => {
1495
- I.key === "Enter" && $(L, m), I.key === "Escape" && c(null);
1885
+ I.key === "Enter" && D(R, z), I.key === "Escape" && c(null);
1496
1886
  },
1497
1887
  onClick: (I) => I.stopPropagation()
1498
1888
  }
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 ?? "") })
1889
+ ) : o ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: o(R) }, style: { flex: 1 } }) : /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: String(R.value ?? "") })
1500
1890
  },
1501
- String(M)
1891
+ String(C)
1502
1892
  );
1503
1893
  }),
1504
1894
  n.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 24, textAlign: "center", color: e.textMut }, children: "No items" })
@@ -1506,30 +1896,30 @@ function Pt({ data: n = [], template: i, keyNavigation: p = !0, multiselection:
1506
1896
  }
1507
1897
  );
1508
1898
  }
1509
- function jt({ data: n = [], template: i, itemsInRow: p = 3, gap: s = 12, multiselection: f = !1, onSelect: a, style: h }) {
1510
- const [d, y] = T(/* @__PURE__ */ new Set());
1511
- K(_, []);
1899
+ function sn({ data: n = [], template: o, itemsInRow: d = 3, gap: l = 12, multiselection: f = !1, onSelect: a, style: h }) {
1900
+ const [u, x] = N(/* @__PURE__ */ new Set());
1901
+ _(q, []);
1512
1902
  const w = (r) => {
1513
- const l = r.id ?? String(r.title);
1514
- y((c) => {
1515
- const b = f ? new Set(c) : /* @__PURE__ */ new Set();
1516
- return b.has(l) ? b.delete(l) : b.add(l), b;
1903
+ const i = r.id ?? String(r.title);
1904
+ x((c) => {
1905
+ const m = f ? new Set(c) : /* @__PURE__ */ new Set();
1906
+ return m.has(i) ? m.delete(i) : m.add(i), m;
1517
1907
  }), a == null || a(r);
1518
1908
  };
1519
- return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "grid", gridTemplateColumns: `repeat(${p}, 1fr)`, gap: s, padding: s, ...h }, children: n.map((r, l) => {
1520
- const c = r.id ?? l, b = d.has(c);
1909
+ return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "grid", gridTemplateColumns: `repeat(${d}, 1fr)`, gap: l, padding: l, ...h }, children: n.map((r, i) => {
1910
+ const c = r.id ?? i, m = u.has(c);
1521
1911
  return /* @__PURE__ */ t(
1522
1912
  "div",
1523
1913
  {
1524
1914
  onClick: () => w(r),
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" },
1915
+ style: { background: e.surface, border: `2px solid ${m ? e.primary : e.border}`, borderRadius: e.rMd, overflow: "hidden", cursor: "pointer", transition: "all .15s", boxShadow: m ? `0 0 0 3px ${e.primary}33` : e.shadow, transform: m ? "translateY(-2px)" : "none" },
1526
1916
  onMouseEnter: (S) => {
1527
1917
  S.currentTarget.style.boxShadow = e.shadowLg, S.currentTarget.style.transform = "translateY(-2px)";
1528
1918
  },
1529
1919
  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";
1920
+ S.currentTarget.style.boxShadow = m ? `0 0 0 3px ${e.primary}33` : e.shadow, S.currentTarget.style.transform = m ? "translateY(-2px)" : "none";
1531
1921
  },
1532
- children: i ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: i(r) } }) : /* @__PURE__ */ g("div", { style: { padding: 16 }, children: [
1922
+ children: o ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: o(r) } }) : /* @__PURE__ */ g("div", { style: { padding: 16 }, children: [
1533
1923
  r.img && /* @__PURE__ */ t("img", { src: r.img, alt: r.title || "", style: { width: "100%", borderRadius: e.r, marginBottom: 8, display: "block" } }),
1534
1924
  /* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 14, marginBottom: 4 }, children: r.title || r.value }),
1535
1925
  r.subtitle && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec }, children: r.subtitle })
@@ -1539,554 +1929,554 @@ function jt({ data: n = [], template: i, itemsInRow: p = 3, gap: s = 12, multise
1539
1929
  );
1540
1930
  }) });
1541
1931
  }
1542
- function be(n) {
1543
- return n.map((i) => ({ ...i, items: i.items ? be(i.items) : void 0 }));
1932
+ function ze(n) {
1933
+ return n.map((o) => ({ ...o, items: o.items ? ze(o.items) : void 0 }));
1544
1934
  }
1545
- function me(n, i = {}) {
1546
- return n.forEach((p) => {
1547
- p.opened && (i[p.id] = !0), p.items && me(p.items, i);
1548
- }), i;
1935
+ function Me(n, o = {}) {
1936
+ return n.forEach((d) => {
1937
+ d.opened && (o[d.id] = !0), d.items && Me(d.items, o);
1938
+ }), o;
1549
1939
  }
1550
- function Ee(n, i) {
1551
- let p = null;
1552
- return [n.filter((f) => f.id === i ? (p = f, !1) : !0).map((f) => {
1940
+ function _e(n, o) {
1941
+ let d = null;
1942
+ return [n.filter((f) => f.id === o ? (d = f, !1) : !0).map((f) => {
1553
1943
  if (f.items) {
1554
- const [a, h] = Ee(f.items, i);
1555
- return h && (p = h), { ...f, items: a };
1944
+ const [a, h] = _e(f.items, o);
1945
+ return h && (d = h), { ...f, items: a };
1556
1946
  }
1557
1947
  return f;
1558
- }), p];
1948
+ }), d];
1559
1949
  }
1560
- function ve(n, i, p, s) {
1561
- if (s === "inside")
1562
- return n.map((a) => a.id === i ? { ...a, items: [...a.items || [], p] } : a.items ? { ...a, items: ve(a.items, i, p, s) } : a);
1563
- if (n.some((a) => a.id === i)) {
1950
+ function $e(n, o, d, l) {
1951
+ if (l === "inside")
1952
+ return n.map((a) => a.id === o ? { ...a, items: [...a.items || [], d] } : a.items ? { ...a, items: $e(a.items, o, d, l) } : a);
1953
+ if (n.some((a) => a.id === o)) {
1564
1954
  const a = [];
1565
1955
  for (const h of n)
1566
- h.id === i ? s === "before" ? (a.push(p), a.push(h)) : (a.push(h), a.push(p)) : a.push(h);
1956
+ h.id === o ? l === "before" ? (a.push(d), a.push(h)) : (a.push(h), a.push(d)) : a.push(h);
1567
1957
  return a;
1568
1958
  }
1569
- return n.map((a) => a.items ? { ...a, items: ve(a.items, i, p, s) } : a);
1959
+ return n.map((a) => a.items ? { ...a, items: $e(a.items, o, d, l) } : a);
1570
1960
  }
1571
- function vt(n, i, p) {
1572
- function s(f) {
1961
+ function Ft(n, o, d) {
1962
+ function l(f) {
1573
1963
  var a, h;
1574
- if (f.id === i) {
1575
- const d = (y) => {
1964
+ if (f.id === o) {
1965
+ const u = (x) => {
1576
1966
  var w;
1577
- return y.id === p || (((w = y.items) == null ? void 0 : w.some(d)) ?? !1);
1967
+ return x.id === d || (((w = x.items) == null ? void 0 : w.some(u)) ?? !1);
1578
1968
  };
1579
- return ((a = f.items) == null ? void 0 : a.some(d)) ?? !1;
1969
+ return ((a = f.items) == null ? void 0 : a.some(u)) ?? !1;
1580
1970
  }
1581
- return ((h = f.items) == null ? void 0 : h.some(s)) ?? !1;
1971
+ return ((h = f.items) == null ? void 0 : h.some(l)) ?? !1;
1582
1972
  }
1583
- return n.some(s);
1973
+ return n.some(l);
1584
1974
  }
1585
- function We(n, i, p) {
1975
+ function Ve(n, o, d) {
1586
1976
  return n.map(
1587
- (s) => s.id === i ? { ...s, value: p } : { ...s, items: s.items ? We(s.items, i, p) : void 0 }
1977
+ (l) => l.id === o ? { ...l, value: d } : { ...l, items: l.items ? Ve(l.items, o, d) : void 0 }
1588
1978
  );
1589
1979
  }
1590
- function kt(n, i) {
1980
+ function Pt(n, o) {
1591
1981
  var a;
1592
- let p = 0, s = 0;
1982
+ let d = 0, l = 0;
1593
1983
  const f = (h) => {
1594
- var d;
1595
- p++, i[h.id] && s++, (d = h.items) == null || d.forEach(f);
1984
+ var u;
1985
+ d++, o[h.id] && l++, (u = h.items) == null || u.forEach(f);
1596
1986
  };
1597
- return (a = n.items) == null || a.forEach(f), { total: p, checkedCount: s };
1987
+ return (a = n.items) == null || a.forEach(f), { total: d, checkedCount: l };
1598
1988
  }
1599
- function Ot({
1989
+ function an({
1600
1990
  data: n = [],
1601
- checkbox: i = !1,
1602
- editable: p = !1,
1603
- dragMode: s,
1991
+ checkbox: o = !1,
1992
+ editable: d = !1,
1993
+ dragMode: l,
1604
1994
  tooltip: f,
1605
1995
  onSelect: a,
1606
1996
  onCheck: h,
1607
- onChange: d,
1608
- style: y
1997
+ onChange: u,
1998
+ style: x
1609
1999
  }) {
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(() => {
1612
- r(be(n)), c((z) => ({ ...me(n), ...z }));
2000
+ const [w, r] = N(() => ze(n)), [i, c] = N(() => Me(n)), [m, S] = N(null), [s, b] = N({}), [M, D] = N(null), [R, z] = N(""), [C, F] = N(null), [p, I] = N(null);
2001
+ _(q, []), _(() => {
2002
+ r(ze(n)), c(($) => ({ ...Me(n), ...$ }));
1613
2003
  }, [n]);
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;
2004
+ const W = ($) => c((j) => ({ ...j, [$]: !j[$] })), v = ($, j) => {
2005
+ b((k) => ({ ...k, [$]: j })), h == null || h($, j);
2006
+ }, X = () => {
2007
+ if (!M) return;
2008
+ const $ = M, j = R;
2009
+ D(null), r((k) => {
2010
+ const P = Ve(k, $, j);
2011
+ return u == null || u(P), P;
1622
2012
  });
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;
1627
- z.preventDefault();
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);
2013
+ }, J = ($, j) => {
2014
+ $.dataTransfer.effectAllowed = "move", F(j);
2015
+ }, se = ($, j) => {
2016
+ if (!C || C === j || Ft(w, C, j)) return;
2017
+ $.preventDefault();
2018
+ const k = $.currentTarget.getBoundingClientRect(), P = $.clientY - k.top, O = k.height, G = P < O * 0.25 ? "before" : P > O * 0.75 ? "after" : "inside";
2019
+ I((K) => (K == null ? void 0 : K.id) === j && (K == null ? void 0 : K.pos) === G ? K : { id: j, pos: G });
2020
+ }, U = ($, j) => {
2021
+ if ($.preventDefault(), !C || !p || C === j) {
2022
+ I(null), F(null);
1633
2023
  return;
1634
2024
  }
1635
- r((j) => {
1636
- const [Y, O] = Ee(j, M);
1637
- if (!O) return j;
1638
- const J = ve(Y, B, O, u.pos);
1639
- return d == null || d(J), J;
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) => {
1644
- var ae;
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);
2025
+ r((k) => {
2026
+ const [P, O] = _e(k, C);
2027
+ if (!O) return k;
2028
+ const G = $e(P, j, O, p.pos);
2029
+ return u == null || u(G), G;
2030
+ }), p.pos === "inside" && c((k) => ({ ...k, [j]: !0 })), I(null), F(null);
2031
+ }, ie = () => {
2032
+ F(null), I(null);
2033
+ }, E = ($, j = 0) => {
2034
+ var ne;
2035
+ const k = (((ne = $.items) == null ? void 0 : ne.length) ?? 0) > 0, P = i[$.id], O = m === $.id, G = C === $.id, K = (p == null ? void 0 : p.id) === $.id;
2036
+ let V = !!s[$.id], Q = !1;
2037
+ if (o && k) {
2038
+ const { total: H, checkedCount: de } = Pt($, s);
2039
+ de > 0 && de < H ? Q = !0 : H > 0 && de === H && (V = !0);
1650
2040
  }
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: [
2041
+ const Z = K && p.pos !== "inside" ? { boxShadow: p.pos === "before" ? `inset 0 2px 0 0 ${e.primary}` : `inset 0 -2px 0 0 ${e.primary}` } : {}, fe = K && p.pos === "inside" || O ? e.primaryLt : "transparent";
2042
+ return /* @__PURE__ */ g("div", { style: { opacity: G ? 0.4 : 1 }, children: [
1653
2043
  /* @__PURE__ */ g(
1654
2044
  "div",
1655
2045
  {
1656
- draggable: !!s,
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,
1661
- title: f == null ? void 0 : f(z),
2046
+ draggable: !!l,
2047
+ onDragStart: l ? (H) => J(H, $.id) : void 0,
2048
+ onDragOver: l ? (H) => se(H, $.id) : void 0,
2049
+ onDrop: l ? (H) => U(H, $.id) : void 0,
2050
+ onDragEnd: l ? ie : void 0,
2051
+ title: f == null ? void 0 : f($),
1662
2052
  onClick: () => {
1663
- S(z.id), a == null || a(z), j && R(z.id);
2053
+ S($.id), a == null || a($), k && W($.id);
1664
2054
  },
1665
2055
  onDoubleClick: () => {
1666
- p && ($(z.id), m(z.value || ""));
2056
+ d && (D($.id), z($.value || ""));
1667
2057
  },
1668
2058
  style: {
1669
2059
  display: "flex",
1670
2060
  alignItems: "center",
1671
2061
  gap: 4,
1672
- padding: `5px 8px 5px ${12 + B * 18}px`,
1673
- cursor: s ? "grab" : "pointer",
2062
+ padding: `5px 8px 5px ${12 + j * 18}px`,
2063
+ cursor: l ? "grab" : "pointer",
1674
2064
  borderRadius: e.r,
1675
2065
  margin: "1px 4px",
1676
- background: le,
2066
+ background: fe,
1677
2067
  color: O ? e.primary : e.text,
1678
2068
  userSelect: "none",
1679
2069
  fontSize: 13,
1680
- ...ie
2070
+ ...Z
1681
2071
  },
1682
- onMouseEnter: (H) => !O && !X && (H.currentTarget.style.background = e.bg),
1683
- onMouseLeave: (H) => !O && !X && (H.currentTarget.style.background = "transparent"),
2072
+ onMouseEnter: (H) => !O && !K && (H.currentTarget.style.background = e.bg),
2073
+ onMouseLeave: (H) => !O && !K && (H.currentTarget.style.background = "transparent"),
1684
2074
  children: [
1685
2075
  /* @__PURE__ */ t(
1686
2076
  "span",
1687
2077
  {
1688
2078
  style: { width: 16, textAlign: "center", fontSize: 11, color: e.textMut, flexShrink: 0 },
1689
2079
  onClick: (H) => {
1690
- H.stopPropagation(), j && R(z.id);
2080
+ H.stopPropagation(), k && W($.id);
1691
2081
  },
1692
- children: j ? Y ? "▾" : "▸" : ""
2082
+ children: k ? P ? "▾" : "▸" : ""
1693
2083
  }
1694
2084
  ),
1695
- /* @__PURE__ */ t("span", { style: { fontSize: 15, flexShrink: 0 }, children: j ? Y ? "📂" : "📁" : "📄" }),
1696
- i && /* @__PURE__ */ t(
2085
+ /* @__PURE__ */ t("span", { style: { fontSize: 15, flexShrink: 0 }, children: k ? P ? "📂" : "📁" : "📄" }),
2086
+ o && /* @__PURE__ */ t(
1697
2087
  "input",
1698
2088
  {
1699
2089
  ref: (H) => {
1700
- H && (H.indeterminate = ne);
2090
+ H && (H.indeterminate = Q);
1701
2091
  },
1702
2092
  type: "checkbox",
1703
- checked: oe,
2093
+ checked: V,
1704
2094
  onChange: (H) => {
1705
- H.stopPropagation(), C(z.id, H.target.checked);
2095
+ H.stopPropagation(), v($.id, H.target.checked);
1706
2096
  },
1707
2097
  style: { cursor: "pointer", accentColor: e.primary, flexShrink: 0 },
1708
2098
  onClick: (H) => H.stopPropagation()
1709
2099
  }
1710
2100
  ),
1711
- k === z.id ? /* @__PURE__ */ t(
2101
+ M === $.id ? /* @__PURE__ */ t(
1712
2102
  "input",
1713
2103
  {
1714
2104
  autoFocus: !0,
1715
2105
  className: "dhx dhx-input",
1716
2106
  style: { height: 24, fontSize: 12, flex: 1 },
1717
- value: L,
1718
- onChange: (H) => m(H.target.value),
1719
- onBlur: P,
2107
+ value: R,
2108
+ onChange: (H) => z(H.target.value),
2109
+ onBlur: X,
1720
2110
  onKeyDown: (H) => {
1721
- H.key === "Enter" && P(), H.key === "Escape" && $(null);
2111
+ H.key === "Enter" && X(), H.key === "Escape" && D(null);
1722
2112
  },
1723
2113
  onClick: (H) => H.stopPropagation()
1724
2114
  }
1725
- ) : /* @__PURE__ */ t("span", { style: { flex: 1 }, children: z.value }),
1726
- z.count !== void 0 && /* @__PURE__ */ g("span", { style: { fontSize: 11, color: e.textMut }, children: [
2115
+ ) : /* @__PURE__ */ t("span", { style: { flex: 1 }, children: $.value }),
2116
+ $.count !== void 0 && /* @__PURE__ */ g("span", { style: { fontSize: 11, color: e.textMut }, children: [
1727
2117
  "(",
1728
- z.count,
2118
+ $.count,
1729
2119
  ")"
1730
2120
  ] })
1731
2121
  ]
1732
2122
  }
1733
2123
  ),
1734
- j && Y && /* @__PURE__ */ t("div", { children: z.items.map((H) => N(H, B + 1)) })
1735
- ] }, z.id);
2124
+ k && P && /* @__PURE__ */ t("div", { children: $.items.map((H) => E(H, j + 1)) })
2125
+ ] }, $.id);
1736
2126
  };
1737
2127
  return /* @__PURE__ */ t(
1738
2128
  "div",
1739
2129
  {
1740
2130
  className: "dhx dhx-scroll",
1741
- style: { overflowY: "auto", ...y },
1742
- onDragOver: s ? (z) => z.preventDefault() : void 0,
1743
- onDrop: s ? (z) => {
1744
- z.preventDefault(), I(null), A(null);
2131
+ style: { overflowY: "auto", ...x },
2132
+ onDragOver: l ? ($) => $.preventDefault() : void 0,
2133
+ onDrop: l ? ($) => {
2134
+ $.preventDefault(), I(null), F(null);
1745
2135
  } : void 0,
1746
- children: w.map((z) => N(z))
2136
+ children: w.map(($) => E($))
1747
2137
  }
1748
2138
  );
1749
2139
  }
1750
- function Yt({ total: n, pageSize: i = 10, page: p, onChange: s, style: f }) {
1751
- const [a, h] = T(p || 1), d = Math.ceil(n / i);
1752
- K(_, []);
1753
- const y = (r) => {
1754
- const l = Math.min(Math.max(1, r), d);
1755
- h(l), s == null || s(l);
2140
+ function dn({ total: n, pageSize: o = 10, page: d, onChange: l, style: f }) {
2141
+ const [a, h] = N(d || 1), u = Math.ceil(n / o);
2142
+ _(q, []);
2143
+ const x = (r) => {
2144
+ const i = Math.min(Math.max(1, r), u);
2145
+ h(i), l == null || l(i);
1756
2146
  }, w = ue(() => {
1757
2147
  const r = [];
1758
- for (let c = Math.max(1, a - 2); c <= Math.min(d, a + 2); c++) r.push(c);
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;
1760
- }, [a, d]);
2148
+ for (let c = Math.max(1, a - 2); c <= Math.min(u, a + 2); c++) r.push(c);
2149
+ return r[0] > 1 && (r[0] > 2 && r.unshift("..."), r.unshift(1)), r[r.length - 1] < u && (r[r.length - 1] < u - 1 && r.push("..."), r.push(u)), r;
2150
+ }, [a, u]);
1761
2151
  return /* @__PURE__ */ g("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 4, padding: "8px 12px", ...f }, children: [
1762
2152
  /* @__PURE__ */ g("span", { style: { fontSize: 12, color: e.textSec, marginRight: 8 }, children: [
1763
- (a - 1) * i + 1,
2153
+ (a - 1) * o + 1,
1764
2154
  "–",
1765
- Math.min(a * i, n),
2155
+ Math.min(a * o, n),
1766
2156
  " of ",
1767
2157
  n
1768
2158
  ] }),
1769
- [["«", 1], ["‹", a - 1]].map(([r, l]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: a === 1, onClick: () => y(l), children: r }, r)),
1770
- w.map((r, l) => /* @__PURE__ */ t("button", { onClick: () => typeof r == "number" && y(r), className: `dhx dhx-btn ${r === a ? "dhx-btn-primary" : "dhx-btn-ghost"}`, style: { height: 30, minWidth: 30, padding: "0 8px", fontSize: 13 }, disabled: r === "...", children: r }, l)),
1771
- [["›", a + 1], ["»", d]].map(([r, l]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: a === d, onClick: () => y(l), children: r }, r))
2159
+ [["«", 1], ["‹", a - 1]].map(([r, i]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: a === 1, onClick: () => x(i), children: r }, r)),
2160
+ w.map((r, i) => /* @__PURE__ */ t("button", { onClick: () => typeof r == "number" && x(r), className: `dhx dhx-btn ${r === a ? "dhx-btn-primary" : "dhx-btn-ghost"}`, style: { height: 30, minWidth: 30, padding: "0 8px", fontSize: 13 }, disabled: r === "...", children: r }, i)),
2161
+ [["›", a + 1], ["»", u]].map(([r, i]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: a === u, onClick: () => x(i), children: r }, r))
1772
2162
  ] });
1773
2163
  }
1774
- function Ft({ config: n = {}, defaultValues: i = {}, onSubmit: p, style: s }) {
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;
2164
+ function cn({ config: n = {}, defaultValues: o = {}, onSubmit: d, style: l }) {
2165
+ const [f, a] = N(o), [h, u] = N({}), [x, w] = N(null);
2166
+ _(q, []);
2167
+ const r = (s, b) => {
2168
+ a((M) => ({ ...M, [s]: b })), u((M) => ({ ...M, [s]: null }));
2169
+ }, i = (s) => {
2170
+ const b = [];
2171
+ return s.flat().forEach((M) => {
2172
+ !M || typeof M != "object" || !("name" in M) || (b.push(M), M.type === "fieldset" && M.rows && b.push(...i(M.rows)));
2173
+ }), b;
1784
2174
  }, c = () => {
1785
- const o = {};
1786
- return l(n.rows || []).forEach((x) => {
1787
- x.required && !f[x.name] && (o[x.name] = `${x.label || x.name} is required`);
1788
- }), d(o), Object.keys(o).length === 0;
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: [
1792
- /* @__PURE__ */ t("legend", { style: { fontSize: 12, fontWeight: 700, color: e.textSec, padding: "0 6px" }, children: o.label }),
1793
- (o.rows || []).map((C) => b(C))
1794
- ] }, o.name);
1795
- if (o.type === "spacer") return /* @__PURE__ */ t("div", { style: { height: o.height || 16 } }, o.name);
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: [
1797
- o.label,
1798
- o.required && /* @__PURE__ */ t("span", { style: { color: e.danger }, 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: [
2175
+ const s = {};
2176
+ return i(n.rows || []).forEach((b) => {
2177
+ b.required && !f[b.name] && (s[b.name] = `${b.label || b.name} is required`);
2178
+ }), u(s), Object.keys(s).length === 0;
2179
+ }, m = (s) => {
2180
+ const b = f[s.name] ?? s.value ?? "", M = h[s.name], D = s.labelWidth ?? n.labelWidth, R = D !== void 0 || s.labelPosition === "left";
2181
+ if (s.type === "fieldset") return /* @__PURE__ */ g("fieldset", { style: { border: `1px solid ${e.border}`, borderRadius: e.r, padding: "12px 16px", marginBottom: 14 }, children: [
2182
+ /* @__PURE__ */ t("legend", { style: { fontSize: 12, fontWeight: 700, color: e.textSec, padding: "0 6px" }, children: s.label }),
2183
+ (s.rows || []).map((v) => m(v))
2184
+ ] }, s.name);
2185
+ if (s.type === "spacer") return /* @__PURE__ */ t("div", { style: { height: s.height || 16 } }, s.name);
2186
+ const z = D ? { minWidth: D, width: D, flexShrink: 0, paddingTop: 8, boxSizing: "border-box" } : {}, C = s.label ? /* @__PURE__ */ g("label", { className: "dhx dhx-label", style: { display: "flex", gap: 4, ...z }, children: [
2187
+ s.label,
2188
+ s.required && /* @__PURE__ */ t("span", { style: { color: e.danger }, children: "*" })
2189
+ ] }, "lbl") : null, F = M ? /* @__PURE__ */ t("div", { style: { fontSize: 11, color: e.danger, marginTop: 3 }, children: M }) : null, p = s.helpMessage ? /* @__PURE__ */ g("div", { style: { fontSize: 11, color: e.textMut, marginTop: 3 }, children: [
1800
2190
  "ⓘ ",
1801
- o.helpMessage
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,
2191
+ s.helpMessage
2192
+ ] }) : null, I = { key: s.name, className: "dhx-form-group" }, W = (v) => R ? /* @__PURE__ */ g("div", { ...I, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
2193
+ C,
1804
2194
  /* @__PURE__ */ g("div", { style: { flex: 1, minWidth: 0 }, children: [
1805
- C,
1806
- A,
1807
- u
2195
+ v,
2196
+ F,
2197
+ p
1808
2198
  ] })
1809
2199
  ] }) : /* @__PURE__ */ g("div", { ...I, children: [
1810
- M,
1811
2200
  C,
1812
- A,
1813
- u
2201
+ v,
2202
+ F,
2203
+ p
1814
2204
  ] });
1815
- if (!o.type || o.type === "input") return R(
2205
+ if (!s.type || s.type === "input") return W(
1816
2206
  /* @__PURE__ */ g("div", { className: "dhx-input-wrap", children: [
1817
- o.icon && /* @__PURE__ */ t("span", { className: "dhx-input-icon", children: o.icon }),
2207
+ s.icon && /* @__PURE__ */ t("span", { className: "dhx-input-icon", children: s.icon }),
1818
2208
  /* @__PURE__ */ t(
1819
2209
  "input",
1820
2210
  {
1821
- className: `dhx dhx-input${o.icon ? " dhx-input--with-icon" : ""}`,
1822
- style: { borderColor: k ? e.danger : void 0 },
1823
- type: o.inputType || "text",
1824
- placeholder: o.placeholder,
1825
- value: x,
1826
- onChange: (C) => r(o.name, C.target.value),
1827
- disabled: o.disabled
2211
+ className: `dhx dhx-input${s.icon ? " dhx-input--with-icon" : ""}`,
2212
+ style: { borderColor: M ? e.danger : void 0 },
2213
+ type: s.inputType || "text",
2214
+ placeholder: s.placeholder,
2215
+ value: b,
2216
+ onChange: (v) => r(s.name, v.target.value),
2217
+ disabled: s.disabled
1828
2218
  }
1829
2219
  )
1830
2220
  ] })
1831
2221
  );
1832
- if (o.type === "textarea") return R(
2222
+ if (s.type === "textarea") return W(
1833
2223
  /* @__PURE__ */ t(
1834
2224
  "textarea",
1835
2225
  {
1836
2226
  className: "dhx dhx-input",
1837
2227
  style: { height: 80, resize: "vertical", padding: "8px 10px" },
1838
- placeholder: o.placeholder,
1839
- value: x,
1840
- onChange: (C) => r(o.name, C.target.value)
2228
+ placeholder: s.placeholder,
2229
+ value: b,
2230
+ onChange: (v) => r(s.name, v.target.value)
1841
2231
  }
1842
2232
  )
1843
2233
  );
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: [
2234
+ if (s.type === "select") return W(
2235
+ /* @__PURE__ */ g("select", { className: "dhx dhx-input", value: b, onChange: (v) => r(s.name, v.target.value), style: { cursor: "pointer" }, children: [
1846
2236
  /* @__PURE__ */ t("option", { value: "", children: "— Select —" }),
1847
- (o.options || []).map((C) => /* @__PURE__ */ t("option", { value: C.value, children: C.label || C.value }, C.value))
2237
+ (s.options || []).map((v) => /* @__PURE__ */ t("option", { value: v.value, children: v.label || v.value }, v.value))
1848
2238
  ] })
1849
2239
  );
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) })
2240
+ if (s.type === "datepicker") return W(
2241
+ /* @__PURE__ */ t("input", { type: "date", className: "dhx dhx-input", value: b, onChange: (v) => r(s.name, v.target.value) })
1852
2242
  );
1853
- if (o.type === "timepicker") {
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: [
2243
+ if (s.type === "timepicker") {
2244
+ const v = f[s.name] ?? { h: 12, m: 0, ampm: "AM" }, X = !!f[s.name], J = X ? `${String(v.h).padStart(2, "0")}:${String(v.m).padStart(2, "0")}${v.ampm ? " " + v.ampm : ""}` : s.placeholder || "Click to select", se = /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
1855
2245
  /* @__PURE__ */ g(
1856
2246
  "div",
1857
2247
  {
1858
2248
  className: "dhx dhx-input",
1859
2249
  style: { cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "space-between" },
1860
- onClick: () => w(y === o.name ? null : o.name),
2250
+ onClick: () => w(x === s.name ? null : s.name),
1861
2251
  children: [
1862
- /* @__PURE__ */ t("span", { style: { color: P ? e.text : e.textMut }, children: q }),
2252
+ /* @__PURE__ */ t("span", { style: { color: X ? e.text : e.textMut }, children: J }),
1863
2253
  /* @__PURE__ */ t("span", { style: { fontSize: 13, color: e.textSec }, children: "🕐" })
1864
2254
  ]
1865
2255
  }
1866
2256
  ),
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);
2257
+ x === s.name && /* @__PURE__ */ t("div", { style: { position: "absolute", zIndex: 100, top: "calc(100% + 4px)", left: 0 }, children: /* @__PURE__ */ t(At, { value: v, controls: !0, onChange: (U) => {
2258
+ r(s.name, U), w(null);
1869
2259
  } }) })
1870
2260
  ] });
1871
- return R(Q);
2261
+ return W(se);
1872
2262
  }
1873
- if (o.type === "colorpicker") return R(
2263
+ if (s.type === "colorpicker") return W(
1874
2264
  /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1875
2265
  /* @__PURE__ */ t(
1876
2266
  "input",
1877
2267
  {
1878
2268
  type: "color",
1879
- value: x || "#000000",
1880
- onChange: (C) => r(o.name, C.target.value),
2269
+ value: b || "#000000",
2270
+ onChange: (v) => r(s.name, v.target.value),
1881
2271
  style: { width: 36, height: 36, padding: 2, border: `1px solid ${e.border}`, borderRadius: e.r, cursor: "pointer", background: "none" }
1882
2272
  }
1883
2273
  ),
1884
- /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontFamily: "monospace" }, children: x || "#000000" })
2274
+ /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontFamily: "monospace" }, children: b || "#000000" })
1885
2275
  ] })
1886
2276
  );
1887
- if (o.type === "text") return R(
1888
- /* @__PURE__ */ t("p", { style: { margin: "6px 0", fontSize: 13, color: e.text }, children: o.value })
2277
+ if (s.type === "text") return W(
2278
+ /* @__PURE__ */ t("p", { style: { margin: "6px 0", fontSize: 13, color: e.text }, children: s.value })
1889
2279
  );
1890
- if (o.type === "checkbox") return /* @__PURE__ */ g("div", { ...I, children: [
1891
- L ? /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1892
- $ && /* @__PURE__ */ t("div", { style: { width: $, flexShrink: 0 } }),
2280
+ if (s.type === "checkbox") return /* @__PURE__ */ g("div", { ...I, children: [
2281
+ R ? /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
2282
+ D && /* @__PURE__ */ t("div", { style: { width: D, flexShrink: 0 } }),
1893
2283
  /* @__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" } }),
1895
- /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: o.label })
2284
+ /* @__PURE__ */ t("input", { type: "checkbox", checked: !!b, onChange: (v) => r(s.name, v.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
2285
+ /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: s.label })
1896
2286
  ] })
1897
2287
  ] }) : /* @__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" } }),
1899
- /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: o.label })
2288
+ /* @__PURE__ */ t("input", { type: "checkbox", checked: !!b, onChange: (v) => r(s.name, v.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
2289
+ /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: s.label })
1900
2290
  ] }),
1901
- u
2291
+ p
1902
2292
  ] });
1903
- if (o.type === "radio") {
1904
- const C = (o.options || []).map((P) => /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer", fontSize: 13 }, children: [
2293
+ if (s.type === "radio") {
2294
+ const v = (s.options || []).map((X) => /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer", fontSize: 13 }, children: [
1905
2295
  /* @__PURE__ */ t(
1906
2296
  "input",
1907
2297
  {
1908
2298
  type: "radio",
1909
- name: o.name,
1910
- value: P.value,
1911
- checked: x === P.value,
1912
- onChange: () => r(o.name, P.value),
2299
+ name: s.name,
2300
+ value: X.value,
2301
+ checked: b === X.value,
2302
+ onChange: () => r(s.name, X.value),
1913
2303
  style: { accentColor: e.primary, cursor: "pointer" }
1914
2304
  }
1915
2305
  ),
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 })
2306
+ X.label || X.value
2307
+ ] }, X.value));
2308
+ return W(
2309
+ /* @__PURE__ */ t("div", { style: { display: "flex", gap: 16, flexWrap: "wrap", paddingTop: 8 }, children: v })
1920
2310
  );
1921
2311
  }
1922
- if (o.type === "slider") return L ? /* @__PURE__ */ g("div", { ...I, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1923
- M,
2312
+ if (s.type === "slider") return R ? /* @__PURE__ */ g("div", { ...I, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
2313
+ C,
1924
2314
  /* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
1925
2315
  /* @__PURE__ */ t(
1926
- De,
2316
+ He,
1927
2317
  {
1928
- min: o.min,
1929
- max: o.max,
1930
- step: o.step,
1931
- value: x || o.min,
1932
- range: o.range,
1933
- onChange: (C) => r(o.name, C)
2318
+ min: s.min,
2319
+ max: s.max,
2320
+ step: s.step,
2321
+ value: b || s.min,
2322
+ range: s.range,
2323
+ onChange: (v) => r(s.name, v)
1934
2324
  }
1935
2325
  ),
1936
- u
2326
+ p
1937
2327
  ] })
1938
2328
  ] }) : /* @__PURE__ */ g("div", { ...I, children: [
1939
2329
  /* @__PURE__ */ t(
1940
- De,
2330
+ He,
1941
2331
  {
1942
- label: o.label,
1943
- min: o.min,
1944
- max: o.max,
1945
- step: o.step,
1946
- value: x || o.min,
1947
- range: o.range,
1948
- onChange: (C) => r(o.name, C)
2332
+ label: s.label,
2333
+ min: s.min,
2334
+ max: s.max,
2335
+ step: s.step,
2336
+ value: b || s.min,
2337
+ range: s.range,
2338
+ onChange: (v) => r(s.name, v)
1949
2339
  }
1950
2340
  ),
1951
- u
2341
+ p
1952
2342
  ] });
1953
- if (o.type === "combo") return L ? /* @__PURE__ */ g("div", { ...I, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1954
- M,
2343
+ if (s.type === "combo") return R ? /* @__PURE__ */ g("div", { ...I, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
2344
+ C,
1955
2345
  /* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
1956
2346
  /* @__PURE__ */ t(
1957
- $e,
2347
+ Be,
1958
2348
  {
1959
- data: o.data || [],
1960
- multiselection: o.multiselection,
1961
- placeholder: o.placeholder || "Select...",
1962
- value: x || (o.multiselection ? [] : null),
1963
- onChange: (C) => r(o.name, C)
2349
+ data: s.data || [],
2350
+ multiselection: s.multiselection,
2351
+ placeholder: s.placeholder || "Select...",
2352
+ value: b || (s.multiselection ? [] : null),
2353
+ onChange: (v) => r(s.name, v)
1964
2354
  }
1965
2355
  ),
1966
- A,
1967
- u
2356
+ F,
2357
+ p
1968
2358
  ] })
1969
2359
  ] }) : /* @__PURE__ */ g("div", { ...I, children: [
1970
2360
  /* @__PURE__ */ t(
1971
- $e,
2361
+ Be,
1972
2362
  {
1973
- label: o.label,
1974
- data: o.data || [],
1975
- multiselection: o.multiselection,
1976
- placeholder: o.placeholder || "Select...",
1977
- value: x || (o.multiselection ? [] : null),
1978
- onChange: (C) => r(o.name, C)
2363
+ label: s.label,
2364
+ data: s.data || [],
2365
+ multiselection: s.multiselection,
2366
+ placeholder: s.placeholder || "Select...",
2367
+ value: b || (s.multiselection ? [] : null),
2368
+ onChange: (v) => r(s.name, v)
1979
2369
  }
1980
2370
  ),
1981
- A,
1982
- u
2371
+ F,
2372
+ p
1983
2373
  ] });
1984
- if (o.type === "toggle") {
1985
- const C = !!x, P = C ? o.icon : o.offIcon || o.icon, q = C ? o.text || o.label : o.offText || o.text || o.label;
2374
+ if (s.type === "toggle") {
2375
+ const v = !!b, X = v ? s.icon : s.offIcon || s.icon, J = v ? s.text || s.label : s.offText || s.text || s.label;
1986
2376
  return /* @__PURE__ */ g("div", { ...I, children: [
1987
- L && $ && /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1988
- /* @__PURE__ */ t("div", { style: { width: $, flexShrink: 0 } }),
2377
+ R && D && /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
2378
+ /* @__PURE__ */ t("div", { style: { width: D, flexShrink: 0 } }),
1989
2379
  /* @__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 })
2380
+ /* @__PURE__ */ t(Pe, { on: v, onClick: () => r(s.name, !b) }),
2381
+ X && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: X }),
2382
+ J && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: J })
1993
2383
  ] })
1994
2384
  ] }),
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 })
2385
+ !R && /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 10, cursor: "pointer" }, children: [
2386
+ /* @__PURE__ */ t(Pe, { on: v, onClick: () => r(s.name, !b) }),
2387
+ X && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: X }),
2388
+ J && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: J })
1999
2389
  ] }),
2000
- u
2390
+ p
2001
2391
  ] });
2002
2392
  }
2003
2393
  return null;
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)
2394
+ }, S = (s) => s.map(
2395
+ (b, M) => Array.isArray(b) ? /* @__PURE__ */ t("div", { style: { display: "flex", gap: 12, alignItems: "flex-start" }, children: b.map(m) }, M) : m(b)
2006
2396
  );
2007
- return /* @__PURE__ */ g("div", { className: "dhx", style: { padding: n.padding || 0, width: n.width || "100%", ...s }, children: [
2397
+ return /* @__PURE__ */ g("div", { className: "dhx", style: { padding: n.padding || 0, width: n.width || "100%", ...l }, children: [
2008
2398
  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" }),
2399
+ (n.buttons || d) && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, justifyContent: n.buttonAlign || "flex-start", marginTop: 8 }, children: [
2400
+ /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => c() && (d == null ? void 0 : d(f)), children: n.submitText || "Submit" }),
2011
2401
  n.resetButton !== !1 && /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => {
2012
- a(i), d({});
2402
+ a(o), u({});
2013
2403
  }, children: n.resetText || "Reset" })
2014
2404
  ] })
2015
2405
  ] });
2016
2406
  }
2017
- function Le({ on: n, onClick: i }) {
2018
- return /* @__PURE__ */ g("div", { style: { position: "relative", width: 40, height: 22, flexShrink: 0 }, onClick: i, children: [
2407
+ function Pe({ on: n, onClick: o }) {
2408
+ return /* @__PURE__ */ g("div", { style: { position: "relative", width: 40, height: 22, flexShrink: 0 }, onClick: o, children: [
2019
2409
  /* @__PURE__ */ t("div", { style: { width: 40, height: 22, borderRadius: 11, background: n ? e.primary : e.border, transition: "background 0.2s" } }),
2020
2410
  /* @__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)" } })
2021
2411
  ] });
2022
2412
  }
2023
- function ke(n) {
2024
- const i = [];
2025
- for (const p of n)
2026
- p.type === "block" ? i.push(...ke(p.items || [])) : i.push(p);
2027
- return i;
2413
+ function De(n) {
2414
+ const o = [];
2415
+ for (const d of n)
2416
+ d.type === "block" ? o.push(...De(d.items || [])) : o.push(d);
2417
+ return o;
2028
2418
  }
2029
- function Kt({ items: n = [], onAction: i, style: p }) {
2030
- K(_, []);
2031
- const [s, f] = T(() => {
2032
- const l = {};
2033
- for (const c of ke(n))
2034
- c.id && (l[c.id] = !!c.active);
2035
- return l;
2036
- }), a = ke(n), h = (l) => {
2419
+ function un({ items: n = [], onAction: o, style: d }) {
2420
+ _(q, []);
2421
+ const [l, f] = N(() => {
2422
+ const i = {};
2423
+ for (const c of De(n))
2424
+ c.id && (i[c.id] = !!c.active);
2425
+ return i;
2426
+ }), a = De(n), h = (i) => {
2037
2427
  var c;
2038
- if (!l.disabled) {
2039
- if (l.id)
2040
- if (l.group) {
2041
- const b = a.filter((S) => S.group === l.group && S.id);
2428
+ if (!i.disabled) {
2429
+ if (i.id)
2430
+ if (i.group) {
2431
+ const m = a.filter((S) => S.group === i.group && S.id);
2042
2432
  f((S) => {
2043
- const o = { ...S };
2044
- for (const x of b) o[x.id] = !1;
2045
- return o[l.id] = !0, o;
2433
+ const s = { ...S };
2434
+ for (const b of m) s[b.id] = !1;
2435
+ return s[i.id] = !0, s;
2046
2436
  });
2047
- } else l.twoState && f((b) => ({ ...b, [l.id]: !b[l.id] }));
2048
- (c = l.onClick) == null || c.call(l, l), l.id && (i == null || i(l.id, l));
2437
+ } else i.twoState && f((m) => ({ ...m, [i.id]: !m[i.id] }));
2438
+ (c = i.onClick) == null || c.call(i, i), i.id && (o == null || o(i.id, i));
2049
2439
  }
2050
- }, d = (l, c) => {
2051
- var x;
2052
- if (l.hidden) return null;
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: [
2055
- l.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: l.label }),
2440
+ }, u = (i, c) => {
2441
+ var b;
2442
+ if (i.hidden) return null;
2443
+ const m = i.value ?? i.text, S = i.size === "auto", s = i.id !== void 0 ? l[i.id] ?? !!i.active : !!i.active;
2444
+ return i.type === "separator" || i.type === "sep" ? /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "4px 2px", alignSelf: "stretch" } }, c) : i.type === "input" ? /* @__PURE__ */ g("div", { style: { display: "flex", flexDirection: "column", alignItems: "flex-start", justifyContent: "center", padding: "2px 4px", gap: 2 }, children: [
2445
+ i.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: i.label }),
2056
2446
  /* @__PURE__ */ g("div", { style: { position: "relative", display: "flex", alignItems: "center" }, children: [
2057
- l.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 6, fontSize: 13, color: e.textMut, pointerEvents: "none", zIndex: 1 }, children: l.icon }),
2447
+ i.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 6, fontSize: 13, color: e.textMut, pointerEvents: "none", zIndex: 1 }, children: i.icon }),
2058
2448
  /* @__PURE__ */ t(
2059
2449
  "input",
2060
2450
  {
2061
2451
  className: "dhx dhx-input",
2062
- style: { width: l.width || 110, height: 26, fontSize: 12, paddingLeft: l.icon ? 24 : void 0 },
2063
- placeholder: l.placeholder,
2064
- defaultValue: l.value,
2065
- onChange: (k) => {
2066
- var $;
2067
- return ($ = l.onChange) == null ? void 0 : $.call(l, k.target.value);
2452
+ style: { width: i.width || 110, height: 26, fontSize: 12, paddingLeft: i.icon ? 24 : void 0 },
2453
+ placeholder: i.placeholder,
2454
+ defaultValue: i.value,
2455
+ onChange: (M) => {
2456
+ var D;
2457
+ return (D = i.onChange) == null ? void 0 : D.call(i, M.target.value);
2068
2458
  }
2069
2459
  }
2070
2460
  )
2071
2461
  ] })
2072
- ] }, c) : l.type === "selectButton" ? /* @__PURE__ */ t(
2462
+ ] }, c) : i.type === "selectButton" ? /* @__PURE__ */ t(
2073
2463
  "select",
2074
2464
  {
2075
2465
  className: "dhx dhx-input",
2076
- style: { height: 26, fontSize: 12, cursor: "pointer", margin: 2, width: l.width },
2077
- defaultValue: l.value,
2078
- onChange: (k) => {
2079
- var $;
2080
- return ($ = l.onChange) == null ? void 0 : $.call(l, k.target.value);
2466
+ style: { height: 26, fontSize: 12, cursor: "pointer", margin: 2, width: i.width },
2467
+ defaultValue: i.value,
2468
+ onChange: (M) => {
2469
+ var D;
2470
+ return (D = i.onChange) == null ? void 0 : D.call(i, M.target.value);
2081
2471
  },
2082
- children: (x = l.items) == null ? void 0 : x.map((k) => /* @__PURE__ */ t("option", { value: k.value, children: k.value }, k.value))
2472
+ children: (b = i.items) == null ? void 0 : b.map((M) => /* @__PURE__ */ t("option", { value: M.value, children: M.value }, M.value))
2083
2473
  },
2084
2474
  c
2085
2475
  ) : /* @__PURE__ */ g(
2086
2476
  "button",
2087
2477
  {
2088
- title: l.tooltip,
2089
- disabled: l.disabled,
2478
+ title: i.tooltip,
2479
+ disabled: i.disabled,
2090
2480
  className: "dhx dhx-btn dhx-btn-ghost",
2091
2481
  style: {
2092
2482
  flexDirection: S ? "column" : "row",
@@ -2096,22 +2486,22 @@ function Kt({ items: n = [], onAction: i, style: p }) {
2096
2486
  padding: S ? "6px 10px" : "0 8px",
2097
2487
  gap: S ? 4 : 5,
2098
2488
  position: "relative",
2099
- background: o ? e.primaryLt : "transparent",
2100
- color: o ? e.primary : l.disabled ? e.textMut : e.text,
2101
- opacity: l.disabled ? 0.55 : 1,
2102
- cursor: l.disabled ? "not-allowed" : "pointer"
2489
+ background: s ? e.primaryLt : "transparent",
2490
+ color: s ? e.primary : i.disabled ? e.textMut : e.text,
2491
+ opacity: i.disabled ? 0.55 : 1,
2492
+ cursor: i.disabled ? "not-allowed" : "pointer"
2103
2493
  },
2104
- onClick: () => h(l),
2494
+ onClick: () => h(i),
2105
2495
  children: [
2106
- l.icon && /* @__PURE__ */ t("span", { style: { fontSize: S ? 22 : 15, lineHeight: 1, flexShrink: 0 }, children: l.icon }),
2107
- b && /* @__PURE__ */ t("span", { style: {
2496
+ i.icon && /* @__PURE__ */ t("span", { style: { fontSize: S ? 22 : 15, lineHeight: 1, flexShrink: 0 }, children: i.icon }),
2497
+ m && /* @__PURE__ */ t("span", { style: {
2108
2498
  fontSize: 10,
2109
2499
  maxWidth: S ? 64 : void 0,
2110
2500
  textAlign: S ? "center" : "left",
2111
2501
  lineHeight: 1.2,
2112
2502
  whiteSpace: S ? "normal" : "nowrap"
2113
- }, children: b }),
2114
- l.count !== void 0 && /* @__PURE__ */ t("span", { style: {
2503
+ }, children: m }),
2504
+ i.count !== void 0 && /* @__PURE__ */ t("span", { style: {
2115
2505
  position: "absolute",
2116
2506
  top: 2,
2117
2507
  right: 2,
@@ -2127,24 +2517,24 @@ function Kt({ items: n = [], onAction: i, style: p }) {
2127
2517
  justifyContent: "center",
2128
2518
  padding: "0 2px",
2129
2519
  pointerEvents: "none"
2130
- }, children: l.count })
2520
+ }, children: i.count })
2131
2521
  ]
2132
2522
  },
2133
2523
  c
2134
2524
  );
2135
- }, y = (l, c) => {
2136
- var b;
2525
+ }, x = (i, c) => {
2526
+ var m;
2137
2527
  return /* @__PURE__ */ t("div", { style: {
2138
2528
  display: "flex",
2139
- flexDirection: l.direction === "col" ? "column" : "row",
2140
- alignItems: l.direction === "col" ? "flex-start" : "center",
2529
+ flexDirection: i.direction === "col" ? "column" : "row",
2530
+ alignItems: i.direction === "col" ? "flex-start" : "center",
2141
2531
  gap: 2
2142
- }, children: (b = l.items) == null ? void 0 : b.map(
2143
- (S, o) => S.type === "block" ? y(S, `${c}-${o}`) : d(S, `${c}-${o}`)
2532
+ }, children: (m = i.items) == null ? void 0 : m.map(
2533
+ (S, s) => S.type === "block" ? x(S, `${c}-${s}`) : u(S, `${c}-${s}`)
2144
2534
  ) }, c);
2145
- }, w = (l, c) => {
2535
+ }, w = (i, c) => {
2146
2536
  var S;
2147
- const b = l.title || l.label;
2537
+ const m = i.title || i.label;
2148
2538
  return /* @__PURE__ */ g("div", { style: {
2149
2539
  display: "flex",
2150
2540
  flexDirection: "column",
@@ -2155,23 +2545,23 @@ function Kt({ items: n = [], onAction: i, style: p }) {
2155
2545
  }, children: [
2156
2546
  /* @__PURE__ */ t("div", { style: {
2157
2547
  display: "flex",
2158
- flexDirection: l.direction === "col" ? "column" : "row",
2159
- alignItems: l.direction === "col" ? "stretch" : "center",
2548
+ flexDirection: i.direction === "col" ? "column" : "row",
2549
+ alignItems: i.direction === "col" ? "stretch" : "center",
2160
2550
  gap: 2,
2161
2551
  flex: 1
2162
- }, children: (S = l.items) == null ? void 0 : S.map(
2163
- (o, x) => o.type === "block" ? y(o, x) : d(o, x)
2552
+ }, children: (S = i.items) == null ? void 0 : S.map(
2553
+ (s, b) => s.type === "block" ? x(s, b) : u(s, b)
2164
2554
  ) }),
2165
- b && /* @__PURE__ */ t("div", { style: {
2555
+ m && /* @__PURE__ */ t("div", { style: {
2166
2556
  fontSize: 10,
2167
2557
  color: e.textMut,
2168
2558
  textAlign: "center",
2169
2559
  padding: "3px 0 4px",
2170
2560
  marginTop: 2,
2171
2561
  borderTop: `1px solid ${e.border}`
2172
- }, children: b })
2562
+ }, children: m })
2173
2563
  ] }, c);
2174
- }, r = (l, c) => l.type === "block" ? w(l, c) : d(l, c);
2564
+ }, r = (i, c) => i.type === "block" ? w(i, c) : u(i, c);
2175
2565
  return /* @__PURE__ */ t("div", { className: "dhx", style: {
2176
2566
  display: "flex",
2177
2567
  alignItems: "stretch",
@@ -2180,10 +2570,10 @@ function Kt({ items: n = [], onAction: i, style: p }) {
2180
2570
  overflowX: "auto",
2181
2571
  gap: 0,
2182
2572
  minHeight: 72,
2183
- ...p
2573
+ ...d
2184
2574
  }, children: n.map(r) });
2185
2575
  }
2186
- function Te({ count: n }) {
2576
+ function Oe({ count: n }) {
2187
2577
  return /* @__PURE__ */ t("span", { style: {
2188
2578
  position: "absolute",
2189
2579
  top: 3,
@@ -2203,33 +2593,33 @@ function Te({ count: n }) {
2203
2593
  pointerEvents: "none"
2204
2594
  }, children: n });
2205
2595
  }
2206
- function Vt({ logo: n, items: i = [], vertical: p = !1, onAction: s, style: f }) {
2207
- const [a, h] = T(null), [d, y] = T(() => {
2596
+ function pn({ logo: n, items: o = [], vertical: d = !1, onAction: l, style: f }) {
2597
+ const [a, h] = N(null), [u, x] = N(() => {
2208
2598
  const c = {};
2209
- return i.forEach((b) => {
2210
- b.id && b.twoState && b.active && (c[b.id] = !0);
2599
+ return o.forEach((m) => {
2600
+ m.id && m.twoState && m.active && (c[m.id] = !0);
2211
2601
  }), c;
2212
- }), w = U(null);
2213
- K(_, []), he(w, Z(() => h(null), []));
2214
- const r = (c, b) => {
2215
- var S, o;
2602
+ }), w = oe(null);
2603
+ _(q, []), ge(w, ae(() => h(null), []));
2604
+ const r = (c, m) => {
2605
+ var S, s;
2216
2606
  if (!c.disabled) {
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);
2607
+ if (c.twoState && c.id && x((b) => ({ ...b, [c.id]: !b[c.id] })), (S = c.items) != null && S.length) {
2608
+ h((b) => b === m ? null : m);
2219
2609
  return;
2220
2610
  }
2221
- (o = c.onClick) == null || o.call(c, c.id || ""), s == null || s(c.id || "");
2611
+ (s = c.onClick) == null || s.call(c, c.id || ""), l == null || l(c.id || "");
2222
2612
  }
2223
- }, l = (c, b) => {
2224
- var k;
2613
+ }, i = (c, m) => {
2614
+ var M;
2225
2615
  if (c.hidden) return null;
2226
2616
  if (c.type === "separator") return /* @__PURE__ */ t("div", { style: {
2227
- [p ? "height" : "width"]: 1,
2617
+ [d ? "height" : "width"]: 1,
2228
2618
  background: e.border,
2229
- margin: p ? "4px 8px" : "0 6px",
2619
+ margin: d ? "4px 8px" : "0 6px",
2230
2620
  alignSelf: "stretch"
2231
- } }, b);
2232
- if (c.type === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, b);
2621
+ } }, m);
2622
+ if (c.type === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, m);
2233
2623
  if (c.type === "input") return /* @__PURE__ */ g("div", { style: { position: "relative", display: "flex", alignItems: "center", margin: "0 4px" }, children: [
2234
2624
  c.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 8, color: e.textMut, fontSize: 15, pointerEvents: "none", zIndex: 1 }, children: c.icon }),
2235
2625
  /* @__PURE__ */ t(
@@ -2238,13 +2628,13 @@ function Vt({ logo: n, items: i = [], vertical: p = !1, onAction: s, style: f })
2238
2628
  className: "dhx dhx-input",
2239
2629
  style: { width: c.width || 200, height: 28, paddingLeft: c.icon ? 30 : void 0 },
2240
2630
  placeholder: c.placeholder,
2241
- onChange: ($) => {
2242
- var L;
2243
- return (L = c.onChange) == null ? void 0 : L.call(c, $.target.value);
2631
+ onChange: (D) => {
2632
+ var R;
2633
+ return (R = c.onChange) == null ? void 0 : R.call(c, D.target.value);
2244
2634
  }
2245
2635
  }
2246
2636
  )
2247
- ] }, b);
2637
+ ] }, m);
2248
2638
  if (c.type === "imageButton") return /* @__PURE__ */ g(
2249
2639
  "button",
2250
2640
  {
@@ -2262,23 +2652,23 @@ function Vt({ logo: n, items: i = [], vertical: p = !1, onAction: s, style: f })
2262
2652
  background: "transparent",
2263
2653
  flexShrink: 0
2264
2654
  },
2265
- onClick: () => r(c, b),
2655
+ onClick: () => r(c, m),
2266
2656
  children: [
2267
2657
  c.src && /* @__PURE__ */ t("img", { src: c.src, alt: c.value || "", style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "50%" } }),
2268
- c.count !== void 0 && /* @__PURE__ */ t(Te, { count: c.count })
2658
+ c.count !== void 0 && /* @__PURE__ */ t(Oe, { count: c.count })
2269
2659
  ]
2270
2660
  },
2271
- b
2661
+ m
2272
2662
  );
2273
- const S = !!(c.twoState && c.id && d[c.id]), o = !!((k = c.items) != null && k.length), x = {
2663
+ const S = !!(c.twoState && c.id && u[c.id]), s = !!((M = c.items) != null && M.length), b = {
2274
2664
  position: "relative",
2275
- height: p ? 40 : 36,
2665
+ height: d ? 40 : 36,
2276
2666
  gap: 6,
2277
2667
  background: S ? e.primaryLt : "transparent",
2278
2668
  color: S ? e.primary : c.disabled ? e.textMut : e.text,
2279
2669
  opacity: c.disabled ? 0.55 : 1,
2280
2670
  cursor: c.disabled ? "not-allowed" : "pointer",
2281
- ...p ? {
2671
+ ...d ? {
2282
2672
  width: "100%",
2283
2673
  justifyContent: "flex-start",
2284
2674
  padding: "0 16px",
@@ -2292,28 +2682,28 @@ function Vt({ logo: n, items: i = [], vertical: p = !1, onAction: s, style: f })
2292
2682
  className: "dhx dhx-btn dhx-btn-ghost",
2293
2683
  title: c.tooltip,
2294
2684
  disabled: c.disabled,
2295
- style: x,
2296
- onClick: () => r(c, b),
2685
+ style: b,
2686
+ onClick: () => r(c, m),
2297
2687
  children: [
2298
2688
  c.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16, flexShrink: 0 }, children: c.icon }),
2299
2689
  c.value && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: c.value }),
2300
- o && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
2301
- c.count !== void 0 && /* @__PURE__ */ t(Te, { count: c.count })
2690
+ s && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
2691
+ c.count !== void 0 && /* @__PURE__ */ t(Oe, { count: c.count })
2302
2692
  ]
2303
2693
  }
2304
2694
  ),
2305
- o && a === b && /* @__PURE__ */ t(
2306
- fe,
2695
+ s && a === m && /* @__PURE__ */ t(
2696
+ be,
2307
2697
  {
2308
2698
  items: c.items,
2309
- onSelect: ($) => {
2310
- var L;
2311
- h(null), $.id && ((L = c.onClick) == null || L.call(c, $.id), s == null || s($.id));
2699
+ onSelect: (D) => {
2700
+ var R;
2701
+ h(null), D.id && ((R = c.onClick) == null || R.call(c, D.id), l == null || l(D.id));
2312
2702
  },
2313
- style: p ? { left: "100%", top: 0 } : { top: "100%" }
2703
+ style: d ? { left: "100%", top: 0 } : { top: "100%" }
2314
2704
  }
2315
2705
  )
2316
- ] }, b);
2706
+ ] }, m);
2317
2707
  };
2318
2708
  return /* @__PURE__ */ g(
2319
2709
  "nav",
@@ -2322,13 +2712,13 @@ function Vt({ logo: n, items: i = [], vertical: p = !1, onAction: s, style: f })
2322
2712
  className: "dhx",
2323
2713
  style: {
2324
2714
  display: "flex",
2325
- flexDirection: p ? "column" : "row",
2326
- alignItems: p ? "stretch" : "center",
2715
+ flexDirection: d ? "column" : "row",
2716
+ alignItems: d ? "stretch" : "center",
2327
2717
  background: e.surface,
2328
- borderBottom: p ? "none" : `1px solid ${e.border}`,
2329
- borderRight: p ? `1px solid ${e.border}` : "none",
2330
- padding: p ? "8px 0" : "0 12px",
2331
- minHeight: p ? void 0 : 48,
2718
+ borderBottom: d ? "none" : `1px solid ${e.border}`,
2719
+ borderRight: d ? `1px solid ${e.border}` : "none",
2720
+ padding: d ? "8px 0" : "0 12px",
2721
+ minHeight: d ? void 0 : 48,
2332
2722
  gap: 2,
2333
2723
  ...f
2334
2724
  },
@@ -2337,48 +2727,48 @@ function Vt({ logo: n, items: i = [], vertical: p = !1, onAction: s, style: f })
2337
2727
  color: e.text,
2338
2728
  fontWeight: 800,
2339
2729
  fontSize: 16,
2340
- padding: p ? "8px 16px 12px" : "0 12px 0 4px",
2341
- borderBottom: p ? `1px solid ${e.border}` : "none",
2342
- borderRight: p ? "none" : `1px solid ${e.border}`,
2343
- marginRight: p ? 0 : 8,
2344
- marginBottom: p ? 4 : 0,
2730
+ padding: d ? "8px 16px 12px" : "0 12px 0 4px",
2731
+ borderBottom: d ? `1px solid ${e.border}` : "none",
2732
+ borderRight: d ? "none" : `1px solid ${e.border}`,
2733
+ marginRight: d ? 0 : 8,
2734
+ marginBottom: d ? 4 : 0,
2345
2735
  flexShrink: 0
2346
2736
  }, children: n }),
2347
- i.map(l)
2737
+ o.map(i)
2348
2738
  ]
2349
2739
  }
2350
2740
  );
2351
2741
  }
2352
2742
  export {
2353
- Mt as Button,
2354
- Rt as Calendar,
2355
- Nt as Chart,
2356
- Et as Colorpicker,
2357
- $e as Combobox,
2358
- Dt as ContextMenu,
2359
- jt as DataView,
2360
- Ft as Form,
2361
- Tt as Grid,
2362
- pt as Layout,
2363
- Pt as List,
2364
- $t as Menu,
2365
- fe as MenuDropdown,
2366
- Re as MessageContext,
2367
- Bt as MessageProvider,
2368
- Vt as Navbar,
2369
- Yt as Pagination,
2370
- Wt as Popup,
2371
- Kt as Ribbon,
2372
- It as Sidebar,
2373
- De as Slider,
2374
- Lt as Tabbar,
2375
- gt as Timepicker,
2376
- Ct as Toolbar,
2377
- Ot as Tree,
2378
- At as Window,
2743
+ _t as Button,
2744
+ Zt as Calendar,
2745
+ Qt as Chart,
2746
+ en as Colorpicker,
2747
+ Be as Combobox,
2748
+ Xt as ContextMenu,
2749
+ sn as DataView,
2750
+ cn as Form,
2751
+ Ut as Grid,
2752
+ Dt as Layout,
2753
+ ln as List,
2754
+ Vt as Menu,
2755
+ be as MenuDropdown,
2756
+ Ke as MessageContext,
2757
+ rn as MessageProvider,
2758
+ pn as Navbar,
2759
+ dn as Pagination,
2760
+ tn as Popup,
2761
+ un as Ribbon,
2762
+ Gt as Sidebar,
2763
+ He as Slider,
2764
+ Jt as Tabbar,
2765
+ At as Timepicker,
2766
+ qt as Toolbar,
2767
+ an as Tree,
2768
+ nn as Window,
2379
2769
  e as tokens,
2380
- he as useClickOutside,
2381
- dt as useDrag,
2382
- Ht as useMessage
2770
+ ge as useClickOutside,
2771
+ St as useDrag,
2772
+ on as useMessage
2383
2773
  };
2384
2774
  //# sourceMappingURL=dhx-react-suite.js.map