dhx-react-suite 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import { jsxs as g, jsx as t, Fragment as Le } from "react/jsx-runtime";
2
- import { useEffect as H, useState as D, useRef as q, useMemo as oe, useCallback as J, createContext as He, useContext as je } from "react";
3
- import { Tooltip as Pe, Legend as Oe, CartesianGrid as Ye, XAxis as ke, YAxis as Se, BarChart as Ke, Bar as Fe, LineChart as Ve, Line as _e, AreaChart as Xe, Area as qe, PieChart as Ge, Pie as Je, Cell as Ue, RadarChart as Qe, PolarGrid as Ze, PolarAngleAxis as et, Radar as tt, ScatterChart as rt, Scatter as nt, ResponsiveContainer as ot } from "recharts";
1
+ import { jsxs as x, jsx as t, Fragment as Te } from "react/jsx-runtime";
2
+ import { useEffect as H, useRef as q, useCallback as G, useState as I, useMemo as oe, createContext as je, useContext as Pe } from "react";
3
+ import { Tooltip as Oe, Legend as Ye, CartesianGrid as Ke, XAxis as ke, YAxis as Se, BarChart as Fe, 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, Radar as nt, ScatterChart as rt, Scatter as ot, ResponsiveContainer as it } from "recharts";
4
4
  const e = {
5
5
  primary: "#0288d1",
6
6
  primaryDk: "#01579b",
@@ -23,8 +23,8 @@ const e = {
23
23
  }, we = "dhx-react-styles";
24
24
  function O() {
25
25
  if (typeof document > "u" || document.getElementById(we)) return;
26
- const r = document.createElement("style");
27
- r.id = we, r.textContent = `
26
+ const n = document.createElement("style");
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}
@@ -64,312 +64,490 @@ function O() {
64
64
  .dhx-tag-success{background:#e8f5e9;color:#1b5e20}
65
65
  .dhx-tag-danger{background:#ffebee;color:#b71c1c}
66
66
  .dhx-tag-warning{background:#fff3e0;color:#e65100}
67
- `, document.head.appendChild(r);
67
+ `, document.head.appendChild(n);
68
68
  }
69
- const it = {
69
+ const lt = {
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 kt({
75
- children: r,
74
+ function St({
75
+ children: n,
76
76
  variant: l = "primary",
77
77
  size: d = "md",
78
- icon: i,
78
+ icon: c,
79
79
  disabled: f,
80
80
  onClick: s,
81
- style: u,
82
- className: n = ""
81
+ style: h,
82
+ className: i = ""
83
83
  }) {
84
- return H(O, []), /* @__PURE__ */ g(
84
+ return H(O, []), /* @__PURE__ */ x(
85
85
  "button",
86
86
  {
87
- className: `dhx dhx-btn dhx-btn-${l} ${n}`,
88
- style: { ...it[d], ...u },
87
+ className: `dhx dhx-btn dhx-btn-${l} ${i}`,
88
+ style: { ...lt[d], ...h },
89
89
  disabled: f,
90
90
  onClick: s,
91
91
  children: [
92
- i && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: i }),
93
- r
92
+ c && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: c }),
93
+ n
94
94
  ]
95
95
  }
96
96
  );
97
97
  }
98
- function St({ items: r = [], style: l }) {
99
- H(O, []);
100
- const d = (i, f) => {
101
- var u;
102
- if (i.type === "separator")
103
- return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "6px 4px", alignSelf: "stretch" } }, f);
104
- if (i.type === "spacer")
105
- return /* @__PURE__ */ t("div", { style: { flex: 1 } }, f);
106
- if (i.type === "input")
107
- return /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
108
- i.label && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontWeight: 500 }, children: i.label }),
98
+ function ie(n, l) {
99
+ H(() => {
100
+ const d = (c) => {
101
+ n.current && !n.current.contains(c.target) && l(c);
102
+ };
103
+ return document.addEventListener("mousedown", d), () => document.removeEventListener("mousedown", d);
104
+ }, [n, l]);
105
+ }
106
+ function st(n) {
107
+ const l = q(!1), d = q({ x: 0, y: 0, ox: 0, oy: 0 });
108
+ return G(
109
+ (c, f = 0, s = 0) => {
110
+ l.current = !0, d.current = { x: c.clientX, y: c.clientY, ox: f, oy: s };
111
+ const h = (g) => {
112
+ if (!l.current) return;
113
+ const { x: b, y: r, ox: v, oy: u } = d.current;
114
+ n(v + g.clientX - b, u + g.clientY - r);
115
+ }, i = () => {
116
+ l.current = !1, document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", i);
117
+ };
118
+ document.addEventListener("mousemove", h), document.addEventListener("mouseup", i), c.preventDefault();
119
+ },
120
+ [n]
121
+ );
122
+ }
123
+ function ae({ items: n, onSelect: l, style: d }) {
124
+ const [c, f] = I(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((s, h) => {
126
+ var g, b;
127
+ if (s.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "4px 0" } }, h);
128
+ const i = c === h;
129
+ return /* @__PURE__ */ x("div", { style: { position: "relative" }, onMouseEnter: () => f(h), onMouseLeave: () => f(null), children: [
130
+ /* @__PURE__ */ x(
131
+ "div",
132
+ {
133
+ onClick: () => {
134
+ var r;
135
+ return !s.disabled && !((r = s.items) != null && r.length) && l(s);
136
+ },
137
+ style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 14px", cursor: s.disabled ? "not-allowed" : "pointer", fontSize: 13, color: s.disabled ? e.textMut : e.text, background: i && !s.disabled ? e.bg : "transparent", opacity: s.disabled ? 0.5 : 1 },
138
+ children: [
139
+ s.icon && /* @__PURE__ */ t("span", { style: { fontSize: 15, width: 18, textAlign: "center" }, children: s.icon }),
140
+ /* @__PURE__ */ t("span", { style: { flex: 1 }, children: s.value || s.id }),
141
+ s.hotkey && /* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textMut }, children: s.hotkey }),
142
+ (g = s.items) != null && g.length ? /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: "▶" }) : null
143
+ ]
144
+ }
145
+ ),
146
+ i && ((b = s.items) != null && b.length) ? /* @__PURE__ */ t(ae, { items: s.items, onSelect: l, style: { position: "absolute", left: "100%", top: -4 } }) : null
147
+ ] }, s.id || h);
148
+ }) });
149
+ }
150
+ function wt({ items: n = [], label: l = "Menu", onSelect: d, style: c }) {
151
+ const [f, s] = I(!1), h = q(null);
152
+ return H(O, []), ie(h, G(() => s(!1), [])), /* @__PURE__ */ x("div", { ref: h, className: "dhx", style: { position: "relative", display: "inline-block", ...c }, children: [
153
+ /* @__PURE__ */ x("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => s((i) => !i), children: [
154
+ l,
155
+ " ",
156
+ /* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: f ? "▲" : "▼" })
157
+ ] }),
158
+ f && /* @__PURE__ */ t(ae, { items: n, onSelect: (i) => {
159
+ d == null || d(i), s(!1);
160
+ } })
161
+ ] });
162
+ }
163
+ function zt({ items: n = [], onSelect: l, children: d }) {
164
+ const [c, f] = I(null), s = q(null);
165
+ return H(O, []), ie(s, G(() => f(null), [])), /* @__PURE__ */ x("div", { ref: s, onContextMenu: (i) => {
166
+ i.preventDefault(), f({ x: i.clientX, y: i.clientY });
167
+ }, style: { position: "relative", display: "contents" }, children: [
168
+ d,
169
+ c && /* @__PURE__ */ t("div", { style: { position: "fixed", left: c.x, top: c.y, zIndex: 9999 }, children: /* @__PURE__ */ t(ae, { items: n, onSelect: (i) => {
170
+ l == null || l(i), f(null);
171
+ } }) })
172
+ ] });
173
+ }
174
+ function ze({ count: n }) {
175
+ return /* @__PURE__ */ t("span", { style: {
176
+ position: "absolute",
177
+ top: 2,
178
+ right: 2,
179
+ minWidth: 16,
180
+ height: 16,
181
+ background: e.danger,
182
+ color: "#fff",
183
+ borderRadius: 8,
184
+ fontSize: 10,
185
+ fontWeight: 700,
186
+ display: "flex",
187
+ alignItems: "center",
188
+ justifyContent: "center",
189
+ padding: "0 3px",
190
+ lineHeight: 1,
191
+ pointerEvents: "none"
192
+ }, children: n });
193
+ }
194
+ function Mt({ items: n = [], onAction: l, style: d }) {
195
+ const [c, f] = I(null), [s, h] = I(() => {
196
+ const r = {};
197
+ return n.forEach((v) => {
198
+ v.id && (v.twoState || v.group) && v.active && (r[v.id] = !0);
199
+ }), r;
200
+ }), i = q(null);
201
+ H(O, []), ie(i, G(() => f(null), []));
202
+ const g = (r, v) => {
203
+ var u, y;
204
+ if (!r.disabled) {
205
+ if (r.twoState && r.id && h((o) => ({ ...o, [r.id]: !o[r.id] })), r.group && r.id && h((o) => {
206
+ const m = { ...o };
207
+ return n.forEach((z) => {
208
+ z.group === r.group && z.id && (m[z.id] = !1);
209
+ }), m[r.id] = !0, m;
210
+ }), (u = r.items) != null && u.length) {
211
+ f((o) => o === v ? null : v);
212
+ return;
213
+ }
214
+ (y = r.onClick) == null || y.call(r, r.id || ""), l == null || l(r.id || "");
215
+ }
216
+ }, b = (r, v) => {
217
+ var m, z;
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" } }, v);
220
+ if (r.type === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, v);
221
+ if (r.type === "input") return /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
222
+ r.label && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontWeight: 500 }, children: r.label }),
223
+ /* @__PURE__ */ x("div", { style: { position: "relative", display: "flex", alignItems: "center" }, children: [
224
+ r.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 8, color: e.textMut, fontSize: 15, pointerEvents: "none", zIndex: 1 }, children: r.icon }),
109
225
  /* @__PURE__ */ t(
110
226
  "input",
111
227
  {
112
228
  className: "dhx dhx-input",
113
- style: { width: i.width || 140, height: 28 },
114
- placeholder: i.placeholder,
115
- defaultValue: i.value,
116
- onChange: (n) => {
117
- var x;
118
- return (x = i.onChange) == null ? void 0 : x.call(i, n.target.value);
229
+ style: { width: r.width || 140, height: 28, paddingLeft: r.icon ? 30 : void 0 },
230
+ placeholder: r.placeholder,
231
+ defaultValue: r.value,
232
+ onChange: ($) => {
233
+ var C;
234
+ return (C = r.onChange) == null ? void 0 : C.call(r, $.target.value);
119
235
  }
120
236
  }
121
237
  )
122
- ] }, f);
123
- if (i.type === "select")
124
- return /* @__PURE__ */ t(
238
+ ] })
239
+ ] }, v);
240
+ if (r.type === "select") return /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
241
+ r.label && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontWeight: 500 }, children: r.label }),
242
+ /* @__PURE__ */ t(
125
243
  "select",
126
244
  {
127
245
  className: "dhx dhx-input",
128
- style: { width: i.width || 100, height: 28, cursor: "pointer" },
129
- defaultValue: i.value,
130
- onChange: (n) => {
131
- var x;
132
- return (x = i.onChange) == null ? void 0 : x.call(i, n.target.value);
246
+ style: { width: r.width || 100, height: 28, cursor: "pointer" },
247
+ defaultValue: r.value,
248
+ onChange: ($) => {
249
+ var C;
250
+ return (C = r.onChange) == null ? void 0 : C.call(r, $.target.value);
133
251
  },
134
- children: (u = i.options) == null ? void 0 : u.map((n) => /* @__PURE__ */ t("option", { value: n.value, children: n.label }, n.value))
135
- },
136
- f
137
- );
138
- const s = i.active;
139
- return /* @__PURE__ */ g(
252
+ children: (m = r.options) == null ? void 0 : m.map(($) => /* @__PURE__ */ t("option", { value: $.value, children: $.label }, $.value))
253
+ }
254
+ )
255
+ ] }, v);
256
+ if (r.type === "imageButton") return /* @__PURE__ */ x(
140
257
  "button",
141
258
  {
142
- className: `dhx dhx-btn ${s ? "dhx-btn-primary" : "dhx-btn-ghost"}`,
143
- style: { height: 32, gap: 4, ...i.twoState && s ? { background: e.primaryLt, color: e.primary, borderColor: `${e.primary}66` } : {} },
144
- disabled: i.disabled,
145
- onClick: () => {
146
- var n;
147
- return (n = i.onClick) == null ? void 0 : n.call(i, i);
259
+ title: r.tooltip,
260
+ disabled: r.disabled,
261
+ style: {
262
+ position: "relative",
263
+ width: 32,
264
+ height: 32,
265
+ padding: 2,
266
+ border: "none",
267
+ borderRadius: "50%",
268
+ overflow: "hidden",
269
+ cursor: r.disabled ? "not-allowed" : "pointer",
270
+ background: "transparent",
271
+ flexShrink: 0
148
272
  },
273
+ onClick: () => g(r, v),
149
274
  children: [
150
- i.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: i.icon }),
151
- i.text && /* @__PURE__ */ t("span", { children: i.text })
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(ze, { count: r.count })
152
277
  ]
153
278
  },
154
- f
279
+ v
155
280
  );
281
+ const u = !!(r.id && s[r.id]), y = r.value ?? r.text, o = !!((z = r.items) != null && z.length);
282
+ return /* @__PURE__ */ x("div", { style: { position: "relative" }, children: [
283
+ /* @__PURE__ */ x(
284
+ "button",
285
+ {
286
+ className: "dhx dhx-btn dhx-btn-ghost",
287
+ title: r.tooltip,
288
+ disabled: r.disabled,
289
+ style: {
290
+ height: 32,
291
+ gap: 4,
292
+ position: "relative",
293
+ background: u ? e.primaryLt : "transparent",
294
+ color: u ? e.primary : r.disabled ? e.textMut : e.text,
295
+ opacity: r.disabled ? 0.55 : 1,
296
+ cursor: r.disabled ? "not-allowed" : "pointer"
297
+ },
298
+ onClick: () => g(r, v),
299
+ children: [
300
+ r.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: r.icon }),
301
+ y && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: y }),
302
+ o && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
303
+ r.count !== void 0 && /* @__PURE__ */ t(ze, { count: r.count })
304
+ ]
305
+ }
306
+ ),
307
+ o && c === v && /* @__PURE__ */ t(
308
+ ae,
309
+ {
310
+ items: r.items,
311
+ onSelect: () => f(null),
312
+ style: { top: "100%", left: 0 }
313
+ }
314
+ )
315
+ ] }, v);
156
316
  };
157
- return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 2, padding: "4px 8px", background: e.surface, borderBottom: `1px solid ${e.border}`, minHeight: 44, flexWrap: "wrap", ...l }, children: r.map(d) });
317
+ return /* @__PURE__ */ t(
318
+ "div",
319
+ {
320
+ ref: i,
321
+ className: "dhx",
322
+ style: {
323
+ display: "flex",
324
+ alignItems: "center",
325
+ gap: 2,
326
+ padding: "4px 8px",
327
+ background: e.surface,
328
+ borderBottom: `1px solid ${e.border}`,
329
+ minHeight: 44,
330
+ flexWrap: "wrap",
331
+ ...d
332
+ },
333
+ children: n.map(b)
334
+ }
335
+ );
158
336
  }
159
- function wt({ items: r = [], width: l = 240, collapsed: d, onSelect: i, header: f, footer: s, style: u }) {
160
- const [n, x] = D(d ?? !1), [b, p] = D(null), [z, h] = D({});
337
+ function $t({ items: n = [], width: l = 240, collapsed: d, onSelect: c, header: f, footer: s, style: h }) {
338
+ const [i, g] = I(d ?? !1), [b, r] = I(null), [v, u] = I({});
161
339
  H(O, []);
162
- const y = n ? 56 : l, o = (w) => {
163
- p(w.id), i == null || i(w);
164
- }, k = (w, C = 0) => {
165
- var m;
166
- if (w.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "6px 8px" } }, w.id);
167
- if (w.type === "customHTML") return /* @__PURE__ */ t("div", { style: { padding: "8px 12px" }, dangerouslySetInnerHTML: { __html: w.html || "" } }, w.id);
168
- const N = (((m = w.items) == null ? void 0 : m.length) ?? 0) > 0, L = z[w.id], c = b === w.id;
169
- return /* @__PURE__ */ g("div", { children: [
170
- /* @__PURE__ */ g(
340
+ const y = i ? 56 : l, o = (z) => {
341
+ r(z.id), c == null || c(z);
342
+ }, m = (z, $ = 0) => {
343
+ var k;
344
+ if (z.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "6px 8px" } }, z.id);
345
+ if (z.type === "customHTML") return /* @__PURE__ */ t("div", { style: { padding: "8px 12px" }, dangerouslySetInnerHTML: { __html: z.html || "" } }, z.id);
346
+ const C = (((k = z.items) == null ? void 0 : k.length) ?? 0) > 0, N = v[z.id], p = b === z.id;
347
+ return /* @__PURE__ */ x("div", { children: [
348
+ /* @__PURE__ */ x(
171
349
  "div",
172
350
  {
173
351
  onClick: () => {
174
- N && h((E) => ({ ...E, [w.id]: !E[w.id] })), o(w);
352
+ C && u((E) => ({ ...E, [z.id]: !E[z.id] })), o(z);
175
353
  },
176
- style: { display: "flex", alignItems: "center", gap: 10, padding: `8px ${n ? "0px" : `${12 + C * 16}px`}`, cursor: "pointer", borderRadius: e.r, margin: "1px 6px", justifyContent: n ? "center" : "flex-start", transition: "all .15s", background: c ? e.primaryLt : "transparent", color: c ? e.primary : e.text, userSelect: "none" },
177
- onMouseEnter: (E) => !c && (E.currentTarget.style.background = e.bg),
178
- onMouseLeave: (E) => !c && (E.currentTarget.style.background = "transparent"),
354
+ style: { display: "flex", alignItems: "center", gap: 10, padding: `8px ${i ? "0px" : `${12 + $ * 16}px`}`, cursor: "pointer", borderRadius: e.r, margin: "1px 6px", justifyContent: i ? "center" : "flex-start", transition: "all .15s", background: p ? e.primaryLt : "transparent", color: p ? e.primary : e.text, userSelect: "none" },
355
+ onMouseEnter: (E) => !p && (E.currentTarget.style.background = e.bg),
356
+ onMouseLeave: (E) => !p && (E.currentTarget.style.background = "transparent"),
179
357
  children: [
180
- w.icon && /* @__PURE__ */ t("span", { style: { fontSize: 18, minWidth: 22, textAlign: "center" }, children: w.icon }),
181
- !n && /* @__PURE__ */ t("span", { style: { flex: 1, fontSize: 13, fontWeight: c ? 600 : 400 }, children: w.value }),
182
- !n && w.count !== void 0 && /* @__PURE__ */ t("span", { style: { background: e.primary, color: "#fff", borderRadius: 10, padding: "1px 6px", fontSize: 11, fontWeight: 700 }, children: w.count }),
183
- !n && N && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textMut, transition: "transform .15s", transform: L ? "rotate(90deg)" : "rotate(0deg)" }, children: "▶" })
358
+ z.icon && /* @__PURE__ */ t("span", { style: { fontSize: 18, minWidth: 22, textAlign: "center" }, children: z.icon }),
359
+ !i && /* @__PURE__ */ t("span", { style: { flex: 1, fontSize: 13, fontWeight: p ? 600 : 400 }, children: z.value }),
360
+ !i && z.count !== void 0 && /* @__PURE__ */ t("span", { style: { background: e.primary, color: "#fff", borderRadius: 10, padding: "1px 6px", fontSize: 11, fontWeight: 700 }, children: z.count }),
361
+ !i && C && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textMut, transition: "transform .15s", transform: N ? "rotate(90deg)" : "rotate(0deg)" }, children: "▶" })
184
362
  ]
185
363
  }
186
364
  ),
187
- N && L && !n && w.items.map((E) => k(E, C + 1))
188
- ] }, w.id);
365
+ C && N && !i && z.items.map((E) => m(E, $ + 1))
366
+ ] }, z.id);
189
367
  };
190
- return /* @__PURE__ */ g("div", { className: "dhx", style: { width: y, minWidth: y, background: e.surface, borderRight: `1px solid ${e.border}`, display: "flex", flexDirection: "column", transition: "width .2s ease", overflow: "hidden", ...u }, children: [
191
- f && !n && /* @__PURE__ */ t("div", { style: { padding: "12px 14px", borderBottom: `1px solid ${e.border}`, fontWeight: 700, fontSize: 15 }, children: f }),
192
- /* @__PURE__ */ t("button", { onClick: () => x((w) => !w), style: { margin: "8px 6px", background: "transparent", border: "none", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: n ? "center" : "flex-end", padding: "4px 6px", borderRadius: e.r, color: e.textSec }, children: /* @__PURE__ */ t("span", { style: { fontSize: 18 }, children: n ? "☰" : "✕" }) }),
193
- /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", overflowX: "hidden" }, children: r.map((w) => k(w)) }),
194
- s && !n && /* @__PURE__ */ t("div", { style: { padding: "10px 14px", borderTop: `1px solid ${e.border}` }, children: s })
368
+ return /* @__PURE__ */ x("div", { className: "dhx", style: { width: y, minWidth: y, background: e.surface, borderRight: `1px solid ${e.border}`, display: "flex", flexDirection: "column", transition: "width .2s ease", overflow: "hidden", ...h }, children: [
369
+ f && !i && /* @__PURE__ */ t("div", { style: { padding: "12px 14px", borderBottom: `1px solid ${e.border}`, fontWeight: 700, fontSize: 15 }, children: f }),
370
+ /* @__PURE__ */ t("button", { onClick: () => g((z) => !z), style: { margin: "8px 6px", background: "transparent", border: "none", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: i ? "center" : "flex-end", padding: "4px 6px", borderRadius: e.r, color: e.textSec }, children: /* @__PURE__ */ t("span", { style: { fontSize: 18 }, children: i ? "☰" : "✕" }) }),
371
+ /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", overflowX: "hidden" }, children: n.map((z) => m(z)) }),
372
+ s && !i && /* @__PURE__ */ t("div", { style: { padding: "10px 14px", borderTop: `1px solid ${e.border}` }, children: s })
195
373
  ] });
196
374
  }
197
- function lt({ config: r }) {
198
- const [l, d] = D(!1), i = {
375
+ function at({ config: n }) {
376
+ const [l, d] = I(!1), c = {
199
377
  position: "relative",
200
378
  background: e.surface,
201
379
  border: `1px solid ${e.border}`,
202
380
  borderRadius: e.r,
203
381
  overflow: "hidden",
204
- ...r.width ? { width: r.width, minWidth: r.width } : { flex: 1 },
205
- ...r.height ? { height: r.height, minHeight: r.height } : { minHeight: 40 },
382
+ ...n.width ? { width: n.width, minWidth: n.width } : { flex: 1 },
383
+ ...n.height ? { height: n.height, minHeight: n.height } : { minHeight: 40 },
206
384
  ...l ? { flex: "0 0 auto" } : {}
207
385
  };
208
- return /* @__PURE__ */ g("div", { style: i, children: [
209
- r.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: [
210
- /* @__PURE__ */ t("span", { children: r.header }),
211
- r.collapsable && /* @__PURE__ */ t("button", { onClick: () => d((f) => !f), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 16, lineHeight: 1 }, children: l ? "▼" : "▲" })
386
+ return /* @__PURE__ */ x("div", { style: c, children: [
387
+ n.header && /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", padding: "6px 12px", background: e.bg, borderBottom: `1px solid ${e.border}`, fontSize: 12, fontWeight: 600, color: e.textSec, userSelect: "none" }, children: [
388
+ /* @__PURE__ */ t("span", { children: n.header }),
389
+ n.collapsable && /* @__PURE__ */ t("button", { onClick: () => d((f) => !f), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 16, lineHeight: 1 }, children: l ? "▼" : "▲" })
212
390
  ] }),
213
- !l && /* @__PURE__ */ g("div", { style: { padding: r.padding || 0, height: r.header ? "calc(100% - 33px)" : "100%", overflow: "auto" }, children: [
214
- r.html ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: r.html } }) : r.content,
215
- (r.rows || r.cols) && /* @__PURE__ */ t(st, { rows: r.rows, cols: r.cols, style: { height: "100%" } })
391
+ !l && /* @__PURE__ */ x("div", { style: { padding: n.padding || 0, height: n.header ? "calc(100% - 33px)" : "100%", overflow: "auto" }, children: [
392
+ n.html ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: n.html } }) : n.content,
393
+ (n.rows || n.cols) && /* @__PURE__ */ t(dt, { rows: n.rows, cols: n.cols, style: { height: "100%" } })
216
394
  ] })
217
395
  ] });
218
396
  }
219
- function st({ rows: r, cols: l, type: d = "line", style: i, children: f }) {
397
+ function dt({ rows: n, cols: l, type: d = "line", style: c, children: f }) {
220
398
  H(O, []);
221
- const s = d === "space" ? 12 : d === "wide" ? 8 : 1, u = r || l, n = !!r;
222
- return u ? /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", flexDirection: n ? "column" : "row", gap: s, width: "100%", height: "100%", ...i }, children: u.map((x, b) => /* @__PURE__ */ t(lt, { config: x }, x.id || b)) }) : /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: "100%", ...i }, children: f });
399
+ const s = d === "space" ? 12 : d === "wide" ? 8 : 1, h = n || l, i = !!n;
400
+ return h ? /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", flexDirection: i ? "column" : "row", gap: s, width: "100%", height: "100%", ...c }, children: h.map((g, b) => /* @__PURE__ */ t(at, { config: g }, g.id || b)) }) : /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: "100%", ...c }, children: f });
223
401
  }
224
- function zt({ views: r = [], mode: l = "top", tabAlign: d = "left", closable: i = [], disabled: f = [], defaultActive: s, onBeforeChange: u, onChange: n, style: x }) {
225
- var c;
226
- const [b, p] = D(s || ((c = r[0]) == null ? void 0 : c.id)), [z, h] = D(r.map((m) => m.id));
402
+ function Dt({ views: n = [], mode: l = "top", tabAlign: d = "left", closable: c = [], disabled: f = [], defaultActive: s, onBeforeChange: h, onChange: i, style: g }) {
403
+ var p;
404
+ const [b, r] = I(s || ((p = n[0]) == null ? void 0 : p.id)), [v, u] = I(n.map((k) => k.id));
227
405
  H(O, []);
228
- const y = (m, E) => {
229
- m.stopPropagation(), h((a) => a.filter(($) => $ !== E)), b === E && p(z.find((a) => a !== E) ?? "");
230
- }, o = (m) => {
231
- f.includes(m) || u && u(m) === !1 || (p(m), n == null || n(m));
232
- }, k = l === "left" || l === "right", w = r.filter((m) => z.includes(m.id)), C = /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: k ? "column" : "row", justifyContent: d === "center" ? "center" : d === "right" ? "flex-end" : "flex-start", background: e.surface, borderBottom: !k && l !== "bottom" ? `2px solid ${e.border}` : "none", borderTop: l === "bottom" ? `2px solid ${e.border}` : "none", borderRight: l === "left" ? `2px solid ${e.border}` : "none", borderLeft: l === "right" ? `2px solid ${e.border}` : "none", overflowX: "auto", flexShrink: 0 }, children: w.map((m) => {
233
- const E = b === m.id, a = f.includes(m.id), $ = l === "bottom" ? { borderTop: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 } : k ? { color: e.primary, fontWeight: 600, background: e.primaryLt, [l === "left" ? "borderRight" : "borderLeft"]: `2px solid ${e.primary}` } : { borderBottom: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 };
234
- return /* @__PURE__ */ g(
406
+ const y = (k, E) => {
407
+ k.stopPropagation(), u((a) => a.filter((D) => D !== E)), b === E && r(v.find((a) => a !== E) ?? "");
408
+ }, o = (k) => {
409
+ f.includes(k) || h && h(k) === !1 || (r(k), i == null || i(k));
410
+ }, m = l === "left" || l === "right", z = n.filter((k) => v.includes(k.id)), $ = /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: m ? "column" : "row", justifyContent: d === "center" ? "center" : d === "right" ? "flex-end" : "flex-start", background: e.surface, borderBottom: !m && l !== "bottom" ? `2px solid ${e.border}` : "none", borderTop: l === "bottom" ? `2px solid ${e.border}` : "none", borderRight: l === "left" ? `2px solid ${e.border}` : "none", borderLeft: l === "right" ? `2px solid ${e.border}` : "none", overflowX: "auto", flexShrink: 0 }, children: z.map((k) => {
411
+ const E = b === k.id, a = f.includes(k.id), D = l === "bottom" ? { borderTop: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 } : m ? { color: e.primary, fontWeight: 600, background: e.primaryLt, [l === "left" ? "borderRight" : "borderLeft"]: `2px solid ${e.primary}` } : { borderBottom: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 };
412
+ return /* @__PURE__ */ x(
235
413
  "div",
236
414
  {
237
- onClick: () => o(m.id),
238
- style: { display: "flex", alignItems: "center", gap: 6, padding: "10px 16px", cursor: a ? "not-allowed" : "pointer", whiteSpace: "nowrap", fontSize: 13, transition: "color .15s", userSelect: "none", minWidth: k ? 120 : "auto", ...E ? $ : { color: a ? e.textMut : e.textSec } },
415
+ onClick: () => o(k.id),
416
+ style: { display: "flex", alignItems: "center", gap: 6, padding: "10px 16px", cursor: a ? "not-allowed" : "pointer", whiteSpace: "nowrap", fontSize: 13, transition: "color .15s", userSelect: "none", minWidth: m ? 120 : "auto", ...E ? D : { color: a ? e.textMut : e.textSec } },
239
417
  children: [
240
- m.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: m.icon }),
241
- /* @__PURE__ */ t("span", { children: m.tab }),
242
- i.includes(m.id) && /* @__PURE__ */ t("span", { onClick: (v) => y(v, m.id), style: { marginLeft: 4, opacity: 0.6, fontSize: 12, cursor: "pointer" }, children: "✕" })
418
+ k.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: k.icon }),
419
+ /* @__PURE__ */ t("span", { children: k.tab }),
420
+ c.includes(k.id) && /* @__PURE__ */ t("span", { onClick: (S) => y(S, k.id), style: { marginLeft: 4, opacity: 0.6, fontSize: 12, cursor: "pointer" }, children: "✕" })
243
421
  ]
244
422
  },
245
- m.id
423
+ k.id
246
424
  );
247
- }) }), N = w.find((m) => m.id === b), L = /* @__PURE__ */ g("div", { className: "dhx-scroll", style: { flex: 1, overflow: "auto" }, children: [
248
- N == null ? void 0 : N.content,
249
- (N == null ? void 0 : N.html) && /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: N.html }, style: { padding: 16 } })
425
+ }) }), C = z.find((k) => k.id === b), N = /* @__PURE__ */ x("div", { className: "dhx-scroll", style: { flex: 1, overflow: "auto" }, children: [
426
+ C == null ? void 0 : C.content,
427
+ (C == null ? void 0 : C.html) && /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: C.html }, style: { padding: 16 } })
250
428
  ] });
251
- return /* @__PURE__ */ g("div", { className: "dhx", style: { display: "flex", flexDirection: l === "top" ? "column" : l === "bottom" ? "column-reverse" : l === "left" ? "row" : "row-reverse", width: "100%", height: "100%", background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden", ...x }, children: [
252
- C,
253
- L
429
+ return /* @__PURE__ */ x("div", { className: "dhx", style: { display: "flex", flexDirection: l === "top" ? "column" : l === "bottom" ? "column-reverse" : l === "left" ? "row" : "row-reverse", width: "100%", height: "100%", background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden", ...g }, children: [
430
+ $,
431
+ N
254
432
  ] });
255
433
  }
256
434
  const Z = `1px solid ${e.border}`;
257
- function at({ active: r, dir: l }) {
258
- return /* @__PURE__ */ g("span", { style: { display: "inline-flex", flexDirection: "column", gap: 1, flexShrink: 0, marginLeft: 4 }, children: [
259
- /* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 0L7 4H0z", fill: r && l === "asc" ? e.primary : e.borderDk }) }),
260
- /* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 4L0 0H7z", fill: r && l === "desc" ? e.primary : e.borderDk }) })
435
+ function ct({ active: n, dir: l }) {
436
+ return /* @__PURE__ */ x("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 && l === "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 && l === "desc" ? e.primary : e.borderDk }) })
261
439
  ] });
262
440
  }
263
- function Mt({
264
- columns: r,
441
+ function Ct({
442
+ columns: n,
265
443
  data: l = [],
266
444
  height: d = 400,
267
- rowHeight: i = 40,
445
+ rowHeight: c = 40,
268
446
  sortable: f = !0,
269
447
  resizable: s = !0,
270
- editable: u = !1,
271
- stripe: n = !1,
272
- autoWidth: x = !1,
448
+ editable: h = !1,
449
+ stripe: i = !1,
450
+ autoWidth: g = !1,
273
451
  keyNavigation: b = !1,
274
- selection: p,
275
- multiselect: z,
276
- onSelect: h,
452
+ selection: r,
453
+ multiselect: v,
454
+ onSelect: u,
277
455
  onChange: y,
278
456
  style: o
279
457
  }) {
280
- const [k, w] = D(null), [C, N] = D("asc"), [L, c] = D({}), [m, E] = D(/* @__PURE__ */ new Set()), [a, $] = D(-1), [v, A] = D(() => r.map((S) => S.width ?? S.minWidth ?? 150)), [F, U] = D(null), [Q, ae] = D(""), [ie, de] = D({}), T = q(null), [j, Y] = D(0);
458
+ const [m, z] = I(null), [$, C] = I("asc"), [N, p] = I({}), [k, E] = I(/* @__PURE__ */ new Set()), [a, D] = I(-1), [S, A] = I(() => n.map((w) => w.width ?? w.minWidth ?? 150)), [F, U] = I(null), [Q, de] = I(""), [le, ce] = I({}), L = q(null), [j, Y] = I(0);
281
459
  H(O, []), H(() => {
282
- if (!x || !T.current) return;
283
- const S = new ResizeObserver(() => {
460
+ if (!g || !L.current) return;
461
+ const w = new ResizeObserver(() => {
284
462
  var M;
285
- return Y(((M = T.current) == null ? void 0 : M.offsetWidth) ?? 0);
463
+ return Y(((M = L.current) == null ? void 0 : M.offsetWidth) ?? 0);
286
464
  });
287
- return S.observe(T.current), () => S.disconnect();
288
- }, [x]);
465
+ return w.observe(L.current), () => w.disconnect();
466
+ }, [g]);
289
467
  const V = oe(() => {
290
- if (!x || j === 0) return v;
291
- const S = v.reduce((R, I) => R + I, 0);
292
- if (j <= S) return v;
293
- const M = (j - S) / r.length;
294
- return v.map((R) => R + M);
295
- }, [x, j, v, r.length]), K = oe(() => {
296
- let S = l.map((M, R) => {
297
- const I = String(M.id ?? R);
298
- return ie[I] ? { ...M, ...ie[I] } : M;
468
+ if (!g || j === 0) return S;
469
+ const w = S.reduce((R, T) => R + T, 0);
470
+ if (j <= w) return S;
471
+ const M = (j - w) / n.length;
472
+ return S.map((R) => R + M);
473
+ }, [g, j, S, n.length]), K = oe(() => {
474
+ let w = l.map((M, R) => {
475
+ const T = String(M.id ?? R);
476
+ return le[T] ? { ...M, ...le[T] } : M;
299
477
  }).filter(
300
- (M) => Object.entries(L).every(([R, I]) => !I || String(M[R] ?? "").toLowerCase().includes(I.toLowerCase()))
478
+ (M) => Object.entries(N).every(([R, T]) => !T || String(M[R] ?? "").toLowerCase().includes(T.toLowerCase()))
301
479
  );
302
- return k && (S = [...S].sort((M, R) => {
303
- const I = M[k], P = R[k];
304
- if (I == null) return 1;
480
+ return m && (w = [...w].sort((M, R) => {
481
+ const T = M[m], P = R[m];
482
+ if (T == null) return 1;
305
483
  if (P == null) return -1;
306
- const B = I < P ? -1 : I > P ? 1 : 0;
307
- return C === "asc" ? B : -B;
308
- })), S;
309
- }, [l, k, C, L, ie]), G = oe(() => {
310
- const S = {};
311
- return r.forEach((M) => {
484
+ const B = T < P ? -1 : T > P ? 1 : 0;
485
+ return $ === "asc" ? B : -B;
486
+ })), w;
487
+ }, [l, m, $, N, le]), J = oe(() => {
488
+ const w = {};
489
+ return n.forEach((M) => {
312
490
  var R;
313
- if ((R = M.footer) != null && R.some((I) => I.summary)) {
314
- const I = K.map((B) => Number(B[M.id])).filter((B) => !isNaN(B)), P = I.reduce((B, te) => B + te, 0);
315
- S[M.id] = { sum: P, avg: I.length ? P / I.length : 0, count: K.length, min: I.length ? Math.min(...I) : 0, max: I.length ? Math.max(...I) : 0 };
491
+ if ((R = M.footer) != null && R.some((T) => T.summary)) {
492
+ const T = K.map((B) => Number(B[M.id])).filter((B) => !isNaN(B)), P = T.reduce((B, te) => B + te, 0);
493
+ w[M.id] = { sum: P, avg: T.length ? P / T.length : 0, count: K.length, min: T.length ? Math.min(...T) : 0, max: T.length ? Math.max(...T) : 0 };
316
494
  }
317
- }), S;
318
- }, [K, r]), X = oe(() => {
319
- const S = {};
320
- return r.filter((M) => M.filterType === "select").forEach((M) => {
321
- S[M.id] = [...new Set(l.map((R) => String(R[M.id] ?? "")))].sort();
322
- }), S;
323
- }, [l, r]), ce = r.some((S) => S.filterable), pe = r.some((S) => {
495
+ }), w;
496
+ }, [K, n]), X = oe(() => {
497
+ const w = {};
498
+ return n.filter((M) => M.filterType === "select").forEach((M) => {
499
+ w[M.id] = [...new Set(l.map((R) => String(R[M.id] ?? "")))].sort();
500
+ }), w;
501
+ }, [l, n]), pe = n.some((w) => w.filterable), ue = n.some((w) => {
324
502
  var M;
325
- return (M = S.footer) == null ? void 0 : M.length;
326
- }), fe = V.reduce((S, M) => S + M, 0), le = (S, M) => S.id ?? M, ue = (S) => {
327
- !f || S.sortable === !1 || (N((M) => k === S.id && M === "asc" ? "desc" : "asc"), w(S.id));
328
- }, W = (S, M) => {
329
- if (!p) return;
330
- const R = le(S, M);
331
- $(M), E((I) => {
332
- const P = z ? new Set(I) : /* @__PURE__ */ new Set();
503
+ return (M = w.footer) == null ? void 0 : M.length;
504
+ }), fe = V.reduce((w, M) => w + M, 0), se = (w, M) => w.id ?? M, he = (w) => {
505
+ !f || w.sortable === !1 || (C((M) => m === w.id && M === "asc" ? "desc" : "asc"), z(w.id));
506
+ }, W = (w, M) => {
507
+ if (!r) return;
508
+ const R = se(w, M);
509
+ D(M), E((T) => {
510
+ const P = v ? new Set(T) : /* @__PURE__ */ new Set();
333
511
  return P.has(R) ? P.delete(R) : P.add(R), P;
334
- }), h == null || h(S);
512
+ }), u == null || u(w);
335
513
  }, ee = () => {
336
514
  if (!F) return;
337
- const { key: S, colId: M } = F;
338
- de((I) => ({ ...I, [String(S)]: { ...I[String(S)] || {}, [M]: Q } }));
339
- const R = K.find((I, P) => le(I, P) === S);
515
+ const { key: w, colId: M } = F;
516
+ ce((T) => ({ ...T, [String(w)]: { ...T[String(w)] || {}, [M]: Q } }));
517
+ const R = K.find((T, P) => se(T, P) === w);
340
518
  R && (y == null || y(R, M, Q)), U(null);
341
- }, We = (S) => {
342
- if (F && S.key === "Escape") {
519
+ }, Ae = (w) => {
520
+ if (F && w.key === "Escape") {
343
521
  U(null);
344
522
  return;
345
523
  }
346
- if (!(!b || !p)) {
347
- if (S.key === "ArrowDown") {
348
- S.preventDefault();
524
+ if (!(!b || !r)) {
525
+ if (w.key === "ArrowDown") {
526
+ w.preventDefault();
349
527
  const M = Math.min(a + 1, K.length - 1);
350
528
  M >= 0 && W(K[M], M);
351
- } else if (S.key === "ArrowUp") {
352
- S.preventDefault();
529
+ } else if (w.key === "ArrowUp") {
530
+ w.preventDefault();
353
531
  const M = Math.max(a - 1, 0);
354
532
  M >= 0 && W(K[M], M);
355
533
  }
356
534
  }
357
- }, Ae = (S, M) => {
358
- S.preventDefault(), S.stopPropagation();
359
- const R = S.clientX, I = v[M], P = (te) => A((ge) => {
360
- const re = [...ge];
361
- return re[M] = Math.max(r[M].minWidth || 50, I + te.clientX - R), re;
535
+ }, Be = (w, M) => {
536
+ w.preventDefault(), w.stopPropagation();
537
+ const R = w.clientX, T = S[M], P = (te) => A((ge) => {
538
+ const ne = [...ge];
539
+ return ne[M] = Math.max(n[M].minWidth || 50, T + te.clientX - R), ne;
362
540
  }), B = () => {
363
541
  document.removeEventListener("mousemove", P), document.removeEventListener("mouseup", B);
364
542
  };
365
543
  document.addEventListener("mousemove", P), document.addEventListener("mouseup", B);
366
- }, xe = (S, M, R, I) => ({
367
- width: S,
368
- minWidth: S,
544
+ }, xe = (w, M, R, T) => ({
545
+ width: w,
546
+ minWidth: w,
369
547
  flexShrink: 0,
370
548
  boxSizing: "border-box",
371
549
  padding: "0 12px",
372
- height: I,
550
+ height: T,
373
551
  display: "flex",
374
552
  alignItems: "center",
375
553
  overflow: "hidden",
@@ -383,98 +561,98 @@ function Mt({
383
561
  return /* @__PURE__ */ t(
384
562
  "div",
385
563
  {
386
- ref: T,
564
+ ref: L,
387
565
  className: "dhx",
388
566
  tabIndex: b ? 0 : void 0,
389
- onKeyDown: We,
567
+ onKeyDown: Ae,
390
568
  style: { width: "100%", height: d, display: "flex", flexDirection: "column", border: Z, borderRadius: e.r, overflow: "hidden", outline: "none", ...o },
391
- children: /* @__PURE__ */ t("div", { style: { overflowX: "auto", flex: 1, display: "flex", flexDirection: "column", minHeight: 0 }, children: /* @__PURE__ */ g("div", { style: { minWidth: fe, display: "flex", flexDirection: "column", height: "100%" }, children: [
392
- /* @__PURE__ */ t("div", { style: { display: "flex", background: e.bg, borderBottom: Z, flexShrink: 0, position: "sticky", top: 0, zIndex: 2 }, children: r.map((S, M) => {
569
+ children: /* @__PURE__ */ t("div", { style: { overflowX: "auto", flex: 1, display: "flex", flexDirection: "column", minHeight: 0 }, children: /* @__PURE__ */ x("div", { style: { minWidth: fe, display: "flex", flexDirection: "column", height: "100%" }, children: [
570
+ /* @__PURE__ */ t("div", { style: { display: "flex", background: e.bg, borderBottom: Z, flexShrink: 0, position: "sticky", top: 0, zIndex: 2 }, children: n.map((w, M) => {
393
571
  var R;
394
- return /* @__PURE__ */ g(
572
+ return /* @__PURE__ */ x(
395
573
  "div",
396
574
  {
397
- onClick: () => ue(S),
575
+ onClick: () => he(w),
398
576
  style: {
399
- ...xe(V[M], S, M === 0, 40),
577
+ ...xe(V[M], w, M === 0, 40),
400
578
  position: "relative",
401
579
  fontWeight: 500,
402
580
  color: e.text,
403
- cursor: f && S.sortable !== !1 ? "pointer" : "default",
581
+ cursor: f && w.sortable !== !1 ? "pointer" : "default",
404
582
  userSelect: "none"
405
583
  },
406
584
  children: [
407
- /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: Array.isArray(S.header) ? (R = S.header[0]) == null ? void 0 : R.text : S.header || S.id }),
408
- f && S.sortable !== !1 && /* @__PURE__ */ t(at, { active: k === S.id, dir: C }),
409
- s && S.resizable !== !1 && M < r.length - 1 && /* @__PURE__ */ t(
585
+ /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: Array.isArray(w.header) ? (R = w.header[0]) == null ? void 0 : R.text : w.header || w.id }),
586
+ f && w.sortable !== !1 && /* @__PURE__ */ t(ct, { active: m === w.id, dir: $ }),
587
+ s && w.resizable !== !1 && M < n.length - 1 && /* @__PURE__ */ t(
410
588
  "div",
411
589
  {
412
- onMouseDown: (I) => Ae(I, M),
413
- onClick: (I) => I.stopPropagation(),
590
+ onMouseDown: (T) => Be(T, M),
591
+ onClick: (T) => T.stopPropagation(),
414
592
  style: { position: "absolute", right: 0, top: 0, bottom: 0, width: 4, cursor: "col-resize", zIndex: 1 },
415
- onMouseEnter: (I) => I.currentTarget.style.background = e.primary + "55",
416
- onMouseLeave: (I) => I.currentTarget.style.background = "transparent"
593
+ onMouseEnter: (T) => T.currentTarget.style.background = e.primary + "55",
594
+ onMouseLeave: (T) => T.currentTarget.style.background = "transparent"
417
595
  }
418
596
  )
419
597
  ]
420
598
  },
421
- S.id
599
+ w.id
422
600
  );
423
601
  }) }),
424
- ce && /* @__PURE__ */ t("div", { style: { display: "flex", borderBottom: Z, background: e.surface, flexShrink: 0 }, children: r.map((S, M) => /* @__PURE__ */ t("div", { style: { width: V[M], minWidth: V[M], flexShrink: 0, padding: "4px 6px", boxSizing: "border-box", borderLeft: M === 0 ? "none" : Z }, children: S.filterable && S.filterType === "select" ? /* @__PURE__ */ g(
602
+ pe && /* @__PURE__ */ t("div", { style: { display: "flex", borderBottom: Z, background: e.surface, flexShrink: 0 }, children: n.map((w, M) => /* @__PURE__ */ t("div", { style: { width: V[M], minWidth: V[M], flexShrink: 0, padding: "4px 6px", boxSizing: "border-box", borderLeft: M === 0 ? "none" : Z }, children: w.filterable && w.filterType === "select" ? /* @__PURE__ */ x(
425
603
  "select",
426
604
  {
427
605
  className: "dhx dhx-input",
428
606
  style: { height: 26, fontSize: 12, padding: "0 4px" },
429
- value: L[S.id] || "",
430
- onChange: (R) => c((I) => ({ ...I, [S.id]: R.target.value })),
607
+ value: N[w.id] || "",
608
+ onChange: (R) => p((T) => ({ ...T, [w.id]: R.target.value })),
431
609
  children: [
432
610
  /* @__PURE__ */ t("option", { value: "", children: "All" }),
433
- (X[S.id] || []).map((R) => /* @__PURE__ */ t("option", { value: R, children: R }, R))
611
+ (X[w.id] || []).map((R) => /* @__PURE__ */ t("option", { value: R, children: R }, R))
434
612
  ]
435
613
  }
436
- ) : S.filterable ? /* @__PURE__ */ t(
614
+ ) : w.filterable ? /* @__PURE__ */ t(
437
615
  "input",
438
616
  {
439
617
  className: "dhx dhx-input",
440
618
  style: { height: 26, fontSize: 12 },
441
619
  placeholder: "Filter...",
442
- value: L[S.id] || "",
443
- onChange: (R) => c((I) => ({ ...I, [S.id]: R.target.value }))
620
+ value: N[w.id] || "",
621
+ onChange: (R) => p((T) => ({ ...T, [w.id]: R.target.value }))
444
622
  }
445
- ) : null }, S.id)) }),
446
- /* @__PURE__ */ g("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: [
447
- K.map((S, M) => {
448
- const R = le(S, M), I = m.has(R), P = I ? e.primaryLt : n && M % 2 !== 0 ? e.bg : e.surface;
623
+ ) : null }, w.id)) }),
624
+ /* @__PURE__ */ x("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: [
625
+ K.map((w, M) => {
626
+ const R = se(w, M), T = k.has(R), P = T ? e.primaryLt : i && M % 2 !== 0 ? e.bg : e.surface;
449
627
  return /* @__PURE__ */ t(
450
628
  "div",
451
629
  {
452
- style: { display: "flex", height: i, borderBottom: Z, flexShrink: 0, background: P, transition: "background .1s", cursor: p ? "pointer" : "default" },
453
- onMouseEnter: (B) => !I && (B.currentTarget.style.background = e.primaryLt + "80"),
454
- onMouseLeave: (B) => !I && (B.currentTarget.style.background = P),
455
- children: r.map((B, te) => {
456
- const ge = (F == null ? void 0 : F.key) === R && (F == null ? void 0 : F.colId) === B.id, re = S[B.id], Be = B.template ? B.template(re, S) : String(re ?? "");
630
+ style: { display: "flex", height: c, borderBottom: Z, flexShrink: 0, background: P, transition: "background .1s", cursor: r ? "pointer" : "default" },
631
+ onMouseEnter: (B) => !T && (B.currentTarget.style.background = e.primaryLt + "80"),
632
+ onMouseLeave: (B) => !T && (B.currentTarget.style.background = P),
633
+ children: n.map((B, te) => {
634
+ const ge = (F == null ? void 0 : F.key) === R && (F == null ? void 0 : F.colId) === B.id, ne = w[B.id], He = B.template ? B.template(ne, w) : String(ne ?? "");
457
635
  return /* @__PURE__ */ t(
458
636
  "div",
459
637
  {
460
638
  onClick: () => {
461
- W(S, M), u && B.editable !== !1 && (U({ key: R, colId: B.id }), ae(String(re ?? "")));
639
+ W(w, M), h && B.editable !== !1 && (U({ key: R, colId: B.id }), de(String(ne ?? "")));
462
640
  },
463
- style: xe(V[te], B, te === 0, i),
641
+ style: xe(V[te], B, te === 0, c),
464
642
  children: ge ? /* @__PURE__ */ t(
465
643
  "input",
466
644
  {
467
645
  autoFocus: !0,
468
646
  value: Q,
469
- onChange: (ne) => ae(ne.target.value),
647
+ onChange: (re) => de(re.target.value),
470
648
  onBlur: ee,
471
- onKeyDown: (ne) => {
472
- ne.key === "Enter" && ee(), ne.key === "Escape" && U(null);
649
+ onKeyDown: (re) => {
650
+ re.key === "Enter" && ee(), re.key === "Escape" && U(null);
473
651
  },
474
- onClick: (ne) => ne.stopPropagation(),
652
+ onClick: (re) => re.stopPropagation(),
475
653
  style: { width: "100%", border: "none", outline: `2px solid ${e.primary}`, borderRadius: 2, fontSize: 13, padding: "2px 4px", background: e.surface, color: e.text }
476
654
  }
477
- ) : Be
655
+ ) : He
478
656
  },
479
657
  B.id
480
658
  );
@@ -485,292 +663,267 @@ function Mt({
485
663
  }),
486
664
  K.length === 0 && /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: 40, color: e.textMut, fontSize: 13 }, children: "No data" })
487
665
  ] }),
488
- pe && /* @__PURE__ */ t("div", { style: { display: "flex", borderTop: Z, background: e.bg, flexShrink: 0 }, children: r.map((S, M) => {
666
+ ue && /* @__PURE__ */ t("div", { style: { display: "flex", borderTop: Z, background: e.bg, flexShrink: 0 }, children: n.map((w, M) => {
489
667
  var B;
490
- const R = (B = S.footer) == null ? void 0 : B[0], I = G[S.id] ?? { sum: 0, avg: 0, count: 0, min: 0, max: 0 };
668
+ const R = (B = w.footer) == null ? void 0 : B[0], T = J[w.id] ?? { sum: 0, avg: 0, count: 0, min: 0, max: 0 };
491
669
  let P = "";
492
- return R && (typeof R.text == "function" ? P = R.text(I) : R.text ? P = R.text : R.summary && (P = String(Math.round(I[R.summary] * 100) / 100))), /* @__PURE__ */ t("div", { style: { ...xe(V[M], S, M === 0, 40), fontWeight: 600, color: e.text }, children: P }, S.id);
670
+ return R && (typeof R.text == "function" ? P = R.text(T) : R.text ? P = R.text : R.summary && (P = String(Math.round(T[R.summary] * 100) / 100))), /* @__PURE__ */ t("div", { style: { ...xe(V[M], w, M === 0, 40), fontWeight: 600, color: e.text }, children: P }, w.id);
493
671
  }) })
494
672
  ] }) })
495
673
  }
496
674
  );
497
675
  }
498
676
  const _ = ["#0288d1", "#43a047", "#f57c00", "#e53935", "#8e24aa", "#00838f", "#ef6c00", "#2e7d32"];
499
- function $t({ type: r = "bar", data: l = [], series: d = [], scales: i = {}, legend: f, height: s = 280, style: u }) {
500
- var k, w, C, N, L;
677
+ function It({ type: n = "bar", data: l = [], series: d = [], scales: c = {}, legend: f, height: s = 280, style: h }) {
678
+ var m, z, $, C, N;
501
679
  H(O, []);
502
- const n = ((k = i.bottom) == null ? void 0 : k.text) || l[0] && Object.keys(l[0])[0] || "x", x = /* @__PURE__ */ t(Pe, { contentStyle: { fontSize: 12, borderRadius: e.r, border: `1px solid ${e.border}` } }), b = f ? /* @__PURE__ */ t(Oe, { iconSize: 10, wrapperStyle: { fontSize: 12 }, verticalAlign: f.valign, align: f.halign }) : null, p = /* @__PURE__ */ t(Ye, { strokeDasharray: "3 3", stroke: e.border }), z = /* @__PURE__ */ t(ke, { dataKey: n, tick: { fontSize: 11, fill: e.textSec }, axisLine: { stroke: e.border }, tickLine: !1 }), h = /* @__PURE__ */ t(Se, { tick: { fontSize: 11, fill: e.textSec }, axisLine: !1, tickLine: !1, domain: [((w = i.left) == null ? void 0 : w.min) ?? "auto", ((C = i.left) == null ? void 0 : C.max) ?? "auto"] }), y = { data: l, margin: { top: 10, right: 20, left: 0, bottom: 0 } };
680
+ const i = ((m = c.bottom) == null ? void 0 : m.text) || l[0] && Object.keys(l[0])[0] || "x", g = /* @__PURE__ */ t(Oe, { contentStyle: { fontSize: 12, borderRadius: e.r, border: `1px solid ${e.border}` } }), b = f ? /* @__PURE__ */ t(Ye, { iconSize: 10, wrapperStyle: { fontSize: 12 }, verticalAlign: f.valign, align: f.halign }) : null, r = /* @__PURE__ */ t(Ke, { strokeDasharray: "3 3", stroke: e.border }), v = /* @__PURE__ */ t(ke, { dataKey: i, tick: { fontSize: 11, fill: e.textSec }, axisLine: { stroke: e.border }, tickLine: !1 }), u = /* @__PURE__ */ t(Se, { tick: { fontSize: 11, fill: e.textSec }, axisLine: !1, tickLine: !1, domain: [((z = c.left) == null ? void 0 : z.min) ?? "auto", (($ = c.left) == null ? void 0 : $.max) ?? "auto"] }), y = { data: l, margin: { top: 10, right: 20, left: 0, bottom: 0 } };
503
681
  let o;
504
- if (r === "bar")
505
- o = /* @__PURE__ */ g(Ke, { ...y, children: [
506
- p,
507
- z,
508
- h,
509
- x,
682
+ if (n === "bar")
683
+ o = /* @__PURE__ */ x(Fe, { ...y, children: [
684
+ r,
685
+ v,
686
+ u,
687
+ g,
510
688
  b,
511
- d.map((c, m) => /* @__PURE__ */ t(Fe, { dataKey: c.value || c.id, name: c.label || c.id, fill: c.fill || _[m % _.length], radius: [3, 3, 0, 0] }, c.id))
689
+ d.map((p, k) => /* @__PURE__ */ t(Ve, { dataKey: p.value || p.id, name: p.label || p.id, fill: p.fill || _[k % _.length], radius: [3, 3, 0, 0] }, p.id))
512
690
  ] });
513
- else if (r === "line")
514
- o = /* @__PURE__ */ g(Ve, { ...y, children: [
515
- p,
516
- z,
517
- h,
518
- x,
691
+ else if (n === "line")
692
+ o = /* @__PURE__ */ x(_e, { ...y, children: [
693
+ r,
694
+ v,
695
+ u,
696
+ g,
519
697
  b,
520
- d.map((c, m) => /* @__PURE__ */ t(_e, { type: "monotone", dataKey: c.value || c.id, name: c.label || c.id, stroke: c.color || _[m % _.length], strokeWidth: 2, dot: { r: 3, fill: c.color || _[m % _.length] } }, c.id))
698
+ d.map((p, k) => /* @__PURE__ */ t(Xe, { type: "monotone", dataKey: p.value || p.id, name: p.label || p.id, stroke: p.color || _[k % _.length], strokeWidth: 2, dot: { r: 3, fill: p.color || _[k % _.length] } }, p.id))
521
699
  ] });
522
- else if (r === "area")
523
- o = /* @__PURE__ */ g(Xe, { ...y, children: [
524
- p,
525
- z,
526
- h,
527
- x,
700
+ else if (n === "area")
701
+ o = /* @__PURE__ */ x(qe, { ...y, children: [
702
+ r,
703
+ v,
704
+ u,
705
+ g,
528
706
  b,
529
- d.map((c, m) => /* @__PURE__ */ t(qe, { type: "monotone", dataKey: c.value || c.id, name: c.label || c.id, stroke: c.color || _[m % _.length], fill: (c.fill || _[m % _.length]) + "33", strokeWidth: 2 }, c.id))
707
+ d.map((p, k) => /* @__PURE__ */ t(Ge, { type: "monotone", dataKey: p.value || p.id, name: p.label || p.id, stroke: p.color || _[k % _.length], fill: (p.fill || _[k % _.length]) + "33", strokeWidth: 2 }, p.id))
530
708
  ] });
531
- else if (r === "pie" || r === "donut") {
532
- const c = l[0] || {}, m = Object.keys(c).find((a) => typeof c[a] == "number") || "value", E = Object.keys(c).find((a) => typeof c[a] == "string") || "x";
533
- o = /* @__PURE__ */ g(Ge, { children: [
709
+ else if (n === "pie" || n === "donut") {
710
+ const p = l[0] || {}, k = Object.keys(p).find((a) => typeof p[a] == "number") || "value", E = Object.keys(p).find((a) => typeof p[a] == "string") || "x";
711
+ o = /* @__PURE__ */ x(Je, { children: [
534
712
  /* @__PURE__ */ t(
535
- Je,
713
+ Ue,
536
714
  {
537
715
  data: l,
538
716
  cx: "50%",
539
717
  cy: "50%",
540
- outerRadius: r === "donut" ? "70%" : "80%",
541
- innerRadius: r === "donut" ? "40%" : 0,
542
- dataKey: m,
718
+ outerRadius: n === "donut" ? "70%" : "80%",
719
+ innerRadius: n === "donut" ? "40%" : 0,
720
+ dataKey: k,
543
721
  nameKey: E,
544
- label: ({ name: a, percent: $ }) => `${a ?? ""} ${(($ ?? 0) * 100).toFixed(0)}%`,
722
+ label: ({ name: a, percent: D }) => `${a ?? ""} ${((D ?? 0) * 100).toFixed(0)}%`,
545
723
  labelLine: !0,
546
724
  paddingAngle: 2,
547
- children: l.map((a, $) => /* @__PURE__ */ t(Ue, { fill: _[$ % _.length] }, $))
725
+ children: l.map((a, D) => /* @__PURE__ */ t(Qe, { fill: _[D % _.length] }, D))
548
726
  }
549
727
  ),
550
- x,
728
+ g,
551
729
  b
552
730
  ] });
553
- } else r === "radar" ? o = /* @__PURE__ */ g(Qe, { ...y, cx: "50%", cy: "50%", children: [
554
- /* @__PURE__ */ t(Ze, {}),
555
- /* @__PURE__ */ t(et, { dataKey: n, tick: { fontSize: 11 } }),
556
- d.map((c, m) => /* @__PURE__ */ t(tt, { dataKey: c.value || c.id, name: c.label || c.id, stroke: c.color || _[m], fill: (c.fill || _[m]) + "44" }, c.id)),
557
- x,
731
+ } else n === "radar" ? o = /* @__PURE__ */ x(Ze, { ...y, cx: "50%", cy: "50%", children: [
732
+ /* @__PURE__ */ t(et, {}),
733
+ /* @__PURE__ */ t(tt, { dataKey: i, tick: { fontSize: 11 } }),
734
+ d.map((p, k) => /* @__PURE__ */ t(nt, { dataKey: p.value || p.id, name: p.label || p.id, stroke: p.color || _[k], fill: (p.fill || _[k]) + "44" }, p.id)),
735
+ g,
558
736
  b
559
- ] }) : r === "scatter" && (o = /* @__PURE__ */ g(rt, { ...y, children: [
560
- p,
561
- /* @__PURE__ */ t(ke, { dataKey: ((N = d[0]) == null ? void 0 : N.xValue) || "x", type: "number", tick: { fontSize: 11, fill: e.textSec } }),
562
- /* @__PURE__ */ t(Se, { dataKey: ((L = d[0]) == null ? void 0 : L.yValue) || "y", tick: { fontSize: 11, fill: e.textSec } }),
563
- x,
564
- d.map((c, m) => /* @__PURE__ */ t(nt, { data: c.data || l, name: c.label || c.id, fill: c.color || _[m] }, c.id))
737
+ ] }) : n === "scatter" && (o = /* @__PURE__ */ x(rt, { ...y, children: [
738
+ r,
739
+ /* @__PURE__ */ t(ke, { dataKey: ((C = d[0]) == null ? void 0 : C.xValue) || "x", type: "number", tick: { fontSize: 11, fill: e.textSec } }),
740
+ /* @__PURE__ */ t(Se, { dataKey: ((N = d[0]) == null ? void 0 : N.yValue) || "y", tick: { fontSize: 11, fill: e.textSec } }),
741
+ g,
742
+ d.map((p, k) => /* @__PURE__ */ t(ot, { data: p.data || l, name: p.label || p.id, fill: p.color || _[k] }, p.id))
565
743
  ] }));
566
- return /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: s, padding: 12, background: e.surface, borderRadius: e.rMd, ...u }, children: /* @__PURE__ */ t(ot, { width: "100%", height: "100%", children: o }) });
744
+ return /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: s, padding: 12, background: e.surface, borderRadius: e.rMd, ...h }, children: /* @__PURE__ */ t(it, { width: "100%", height: "100%", children: o }) });
567
745
  }
568
- const dt = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], ct = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
569
- function Dt({ value: r, range: l = !1, timepicker: d = !1, onChange: i, style: f }) {
570
- const s = /* @__PURE__ */ new Date(), u = r ? new Date(Array.isArray(r) ? r[0] : r) : s, [n, x] = D(u), [b, p] = D(r ?? (l ? [null, null] : null)), [z, h] = D(null), [y, o] = D({ h: 0, m: 0 });
746
+ const pt = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], ut = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
747
+ function Lt({ value: n, range: l = !1, timepicker: d = !1, onChange: c, style: f }) {
748
+ const s = /* @__PURE__ */ new Date(), h = n ? new Date(Array.isArray(n) ? n[0] : n) : s, [i, g] = I(h), [b, r] = I(n ?? (l ? [null, null] : null)), [v, u] = I(null), [y, o] = I({ h: 0, m: 0 });
571
749
  H(O, []);
572
- const k = n.getFullYear(), w = n.getMonth(), C = new Date(k, w, 1).getDay(), N = new Date(k, w + 1, 0).getDate(), L = [];
573
- for (let a = 0; a < C; a++) L.push(null);
574
- for (let a = 1; a <= N; a++) L.push(new Date(k, w, a));
575
- const c = (a) => a.toDateString() === s.toDateString(), m = (a) => {
750
+ const m = i.getFullYear(), z = i.getMonth(), $ = new Date(m, z, 1).getDay(), C = new Date(m, z + 1, 0).getDate(), N = [];
751
+ for (let a = 0; a < $; a++) N.push(null);
752
+ for (let a = 1; a <= C; a++) N.push(new Date(m, z, a));
753
+ const p = (a) => a.toDateString() === s.toDateString(), k = (a) => {
576
754
  if (!b) return !1;
577
755
  if (l && Array.isArray(b)) {
578
- const [$, v] = b;
579
- if (!$) return !1;
756
+ const [D, S] = b;
757
+ if (!D) return !1;
580
758
  const A = a.getTime();
581
- return v ? A >= $.getTime() && A <= v.getTime() : a.toDateString() === $.toDateString();
759
+ return S ? A >= D.getTime() && A <= S.getTime() : a.toDateString() === D.toDateString();
582
760
  }
583
761
  return a.toDateString() === b.toDateString();
584
762
  }, E = (a) => {
585
763
  if (l) {
586
- const [$, v] = Array.isArray(b) ? b : [null, null];
587
- if (!$ || v)
588
- p([a, null]);
764
+ const [D, S] = Array.isArray(b) ? b : [null, null];
765
+ if (!D || S)
766
+ r([a, null]);
589
767
  else {
590
- const A = a < $ ? [a, $] : [$, a];
591
- p(A), i == null || i(A);
768
+ const A = a < D ? [a, D] : [D, a];
769
+ r(A), c == null || c(A);
592
770
  }
593
771
  } else
594
- p(a), i == null || i(a);
772
+ r(a), c == null || c(a);
595
773
  };
596
- 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: [
597
- /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 12 }, children: [
598
- /* @__PURE__ */ t("button", { onClick: () => x((a) => new Date(a.getFullYear(), a.getMonth() - 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "‹" }),
599
- /* @__PURE__ */ g("div", { style: { fontWeight: 700, fontSize: 14 }, children: [
600
- dt[w],
774
+ return /* @__PURE__ */ x("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...f }, children: [
775
+ /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 12 }, children: [
776
+ /* @__PURE__ */ t("button", { onClick: () => g((a) => new Date(a.getFullYear(), a.getMonth() - 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "‹" }),
777
+ /* @__PURE__ */ x("div", { style: { fontWeight: 700, fontSize: 14 }, children: [
778
+ pt[z],
601
779
  " ",
602
- k
780
+ m
603
781
  ] }),
604
- /* @__PURE__ */ t("button", { onClick: () => x((a) => new Date(a.getFullYear(), a.getMonth() + 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "›" })
782
+ /* @__PURE__ */ t("button", { onClick: () => g((a) => new Date(a.getFullYear(), a.getMonth() + 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "›" })
605
783
  ] }),
606
- /* @__PURE__ */ g("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, 32px)", gap: 2 }, children: [
607
- ct.map((a) => /* @__PURE__ */ t("div", { style: { textAlign: "center", fontSize: 11, fontWeight: 600, color: e.textMut, paddingBottom: 4 }, children: a }, a)),
608
- L.map((a, $) => {
609
- const v = a ? m(a) : !1, A = a && z && a.toDateString() === z.toDateString();
784
+ /* @__PURE__ */ x("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, 32px)", gap: 2 }, children: [
785
+ ut.map((a) => /* @__PURE__ */ t("div", { style: { textAlign: "center", fontSize: 11, fontWeight: 600, color: e.textMut, paddingBottom: 4 }, children: a }, a)),
786
+ N.map((a, D) => {
787
+ const S = a ? k(a) : !1, A = a && v && a.toDateString() === v.toDateString();
610
788
  return /* @__PURE__ */ t(
611
789
  "div",
612
790
  {
613
791
  onClick: () => a && E(a),
614
- onMouseEnter: () => a && h(a),
615
- onMouseLeave: () => h(null),
616
- style: { width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: e.r, cursor: a ? "pointer" : "default", fontSize: 12, fontWeight: a && c(a) ? 700 : 400, background: v ? e.primary : A ? e.bg : "transparent", color: v ? "#fff" : a && c(a) ? e.primary : a ? e.text : "transparent", border: a && c(a) && !v ? `1px solid ${e.primary}` : "1px solid transparent", transition: "all .1s" },
792
+ onMouseEnter: () => a && u(a),
793
+ onMouseLeave: () => u(null),
794
+ style: { width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: e.r, cursor: a ? "pointer" : "default", fontSize: 12, fontWeight: a && p(a) ? 700 : 400, background: S ? e.primary : A ? e.bg : "transparent", color: S ? "#fff" : a && p(a) ? e.primary : a ? e.text : "transparent", border: a && p(a) && !S ? `1px solid ${e.primary}` : "1px solid transparent", transition: "all .1s" },
617
795
  children: a == null ? void 0 : a.getDate()
618
796
  },
619
- $
797
+ D
620
798
  );
621
799
  })
622
800
  ] }),
623
- d && /* @__PURE__ */ g("div", { style: { borderTop: `1px solid ${e.border}`, marginTop: 12, paddingTop: 12, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
624
- /* @__PURE__ */ t("input", { type: "number", min: 0, max: 23, value: y.h, onChange: (a) => o(($) => ({ ...$, h: +a.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } }),
801
+ d && /* @__PURE__ */ x("div", { style: { borderTop: `1px solid ${e.border}`, marginTop: 12, paddingTop: 12, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
802
+ /* @__PURE__ */ t("input", { type: "number", min: 0, max: 23, value: y.h, onChange: (a) => o((D) => ({ ...D, h: +a.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } }),
625
803
  /* @__PURE__ */ t("span", { style: { fontWeight: 700, color: e.textSec }, children: ":" }),
626
- /* @__PURE__ */ t("input", { type: "number", min: 0, max: 59, value: y.m, onChange: (a) => o(($) => ({ ...$, m: +a.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } })
804
+ /* @__PURE__ */ t("input", { type: "number", min: 0, max: 59, value: y.m, onChange: (a) => o((D) => ({ ...D, m: +a.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } })
627
805
  ] })
628
806
  ] });
629
807
  }
630
- function pt({ value: r, onChange: l, timeFormat: d = 12, controls: i = !1, minuteStep: f = 5, style: s }) {
631
- const [u, n] = D((r == null ? void 0 : r.h) ?? (d === 24 ? 0 : 12)), [x, b] = D((r == null ? void 0 : r.m) ?? 0), [p, z] = D((r == null ? void 0 : r.ampm) ?? "AM"), [h, y] = D(null);
808
+ function ht({ value: n, onChange: l, timeFormat: d = 12, controls: c = !1, minuteStep: f = 5, style: s }) {
809
+ const [h, i] = I((n == null ? void 0 : n.h) ?? (d === 24 ? 0 : 12)), [g, b] = I((n == null ? void 0 : n.m) ?? 0), [r, v] = I((n == null ? void 0 : n.ampm) ?? "AM"), [u, y] = I(null);
632
810
  H(O, []);
633
- const o = d === 24 ? Array.from({ length: 24 }, (c, m) => m) : Array.from({ length: 12 }, (c, m) => m + 1), k = Array.from({ length: Math.ceil(60 / f) }, (c, m) => m * f), w = (c, m, E) => {
634
- const a = d === 24 ? { h: c, m } : { h: c, m, ampm: E };
635
- i ? y(a) : l == null || l(a);
636
- }, C = () => {
637
- y(null), n((r == null ? void 0 : r.h) ?? (d === 24 ? 0 : 12)), b((r == null ? void 0 : r.m) ?? 0), z((r == null ? void 0 : r.ampm) ?? "AM");
638
- }, N = { display: "flex", flexDirection: "column", alignItems: "center", gap: 4 }, L = (c) => ({
811
+ const o = d === 24 ? Array.from({ length: 24 }, (p, k) => k) : Array.from({ length: 12 }, (p, k) => k + 1), m = Array.from({ length: Math.ceil(60 / f) }, (p, k) => k * f), z = (p, k, E) => {
812
+ const a = d === 24 ? { h: p, m: k } : { h: p, m: k, ampm: E };
813
+ c ? y(a) : l == null || l(a);
814
+ }, $ = () => {
815
+ y(null), i((n == null ? void 0 : n.h) ?? (d === 24 ? 0 : 12)), b((n == null ? void 0 : n.m) ?? 0), v((n == null ? void 0 : n.ampm) ?? "AM");
816
+ }, C = { display: "flex", flexDirection: "column", alignItems: "center", gap: 4 }, N = (p) => ({
639
817
  height: 32,
640
818
  display: "flex",
641
819
  alignItems: "center",
642
820
  justifyContent: "center",
643
821
  cursor: "pointer",
644
822
  fontSize: 13,
645
- fontWeight: c ? 700 : 400,
646
- background: c ? e.primaryLt : "transparent",
647
- color: c ? e.primary : e.text
823
+ fontWeight: p ? 700 : 400,
824
+ background: p ? e.primaryLt : "transparent",
825
+ color: p ? e.primary : e.text
648
826
  });
649
- 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, ...s }, children: [
650
- /* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, alignItems: "stretch" }, children: [
651
- /* @__PURE__ */ g("div", { style: N, children: [
827
+ return /* @__PURE__ */ x("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...s }, children: [
828
+ /* @__PURE__ */ x("div", { style: { display: "flex", gap: 8, alignItems: "stretch" }, children: [
829
+ /* @__PURE__ */ x("div", { style: C, children: [
652
830
  /* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "Hours" }),
653
- /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: o.map((c) => /* @__PURE__ */ t(
831
+ /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: o.map((p) => /* @__PURE__ */ t(
654
832
  "div",
655
833
  {
656
834
  onClick: () => {
657
- n(c), w(c, x, p);
835
+ i(p), z(p, g, r);
658
836
  },
659
- style: L(u === c),
660
- onMouseEnter: (m) => u !== c && (m.currentTarget.style.background = e.bg),
661
- onMouseLeave: (m) => u !== c && (m.currentTarget.style.background = "transparent"),
662
- children: String(c).padStart(2, "0")
837
+ style: N(h === p),
838
+ onMouseEnter: (k) => h !== p && (k.currentTarget.style.background = e.bg),
839
+ onMouseLeave: (k) => h !== p && (k.currentTarget.style.background = "transparent"),
840
+ children: String(p).padStart(2, "0")
663
841
  },
664
- c
842
+ p
665
843
  )) })
666
844
  ] }),
667
- /* @__PURE__ */ g("div", { style: N, children: [
845
+ /* @__PURE__ */ x("div", { style: C, children: [
668
846
  /* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "Minutes" }),
669
- /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: k.map((c) => /* @__PURE__ */ t(
847
+ /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: m.map((p) => /* @__PURE__ */ t(
670
848
  "div",
671
849
  {
672
850
  onClick: () => {
673
- b(c), w(u, c, p);
851
+ b(p), z(h, p, r);
674
852
  },
675
- style: L(x === c),
676
- onMouseEnter: (m) => x !== c && (m.currentTarget.style.background = e.bg),
677
- onMouseLeave: (m) => x !== c && (m.currentTarget.style.background = "transparent"),
678
- children: String(c).padStart(2, "0")
853
+ style: N(g === p),
854
+ onMouseEnter: (k) => g !== p && (k.currentTarget.style.background = e.bg),
855
+ onMouseLeave: (k) => g !== p && (k.currentTarget.style.background = "transparent"),
856
+ children: String(p).padStart(2, "0")
679
857
  },
680
- c
858
+ p
681
859
  )) })
682
860
  ] }),
683
- d === 12 && /* @__PURE__ */ g("div", { style: N, children: [
861
+ d === 12 && /* @__PURE__ */ x("div", { style: C, children: [
684
862
  /* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "AM/PM" }),
685
- /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden" }, children: ["AM", "PM"].map((c) => /* @__PURE__ */ t(
863
+ /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden" }, children: ["AM", "PM"].map((p) => /* @__PURE__ */ t(
686
864
  "div",
687
865
  {
688
866
  onClick: () => {
689
- z(c), w(u, x, c);
867
+ v(p), z(h, g, p);
690
868
  },
691
- style: { height: 40, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", padding: "0 12px", fontSize: 13, fontWeight: p === c ? 700 : 400, background: p === c ? e.primary : e.surface, color: p === c ? "#fff" : e.text },
692
- children: c
869
+ style: { height: 40, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", padding: "0 12px", fontSize: 13, fontWeight: r === p ? 700 : 400, background: r === p ? e.primary : e.surface, color: r === p ? "#fff" : e.text },
870
+ children: p
693
871
  },
694
- c
872
+ p
695
873
  )) })
696
874
  ] })
697
875
  ] }),
698
- /* @__PURE__ */ g("div", { style: { textAlign: "center", marginTop: 12, fontSize: 22, fontWeight: 700, color: e.primary, letterSpacing: 2 }, children: [
699
- String(u).padStart(2, "0"),
876
+ /* @__PURE__ */ x("div", { style: { textAlign: "center", marginTop: 12, fontSize: 22, fontWeight: 700, color: e.primary, letterSpacing: 2 }, children: [
877
+ String(h).padStart(2, "0"),
700
878
  ":",
701
- String(x).padStart(2, "0"),
702
- d === 12 ? ` ${p}` : ""
879
+ String(g).padStart(2, "0"),
880
+ d === 12 ? ` ${r}` : ""
703
881
  ] }),
704
- i && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, justifyContent: "flex-end", marginTop: 12 }, children: [
705
- /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: C, children: "Cancel" }),
706
- /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => h && (l == null ? void 0 : l(h)), children: "Apply" })
882
+ c && /* @__PURE__ */ x("div", { style: { display: "flex", gap: 8, justifyContent: "flex-end", marginTop: 12 }, children: [
883
+ /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: $, children: "Cancel" }),
884
+ /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => u && (l == null ? void 0 : l(u)), children: "Apply" })
707
885
  ] })
708
886
  ] });
709
887
  }
710
- function se(r, l) {
711
- H(() => {
712
- const d = (i) => {
713
- r.current && !r.current.contains(i.target) && l(i);
714
- };
715
- return document.addEventListener("mousedown", d), () => document.removeEventListener("mousedown", d);
716
- }, [r, l]);
717
- }
718
- function ut(r) {
719
- const l = q(!1), d = q({ x: 0, y: 0, ox: 0, oy: 0 });
720
- return J(
721
- (i, f = 0, s = 0) => {
722
- l.current = !0, d.current = { x: i.clientX, y: i.clientY, ox: f, oy: s };
723
- const u = (x) => {
724
- if (!l.current) return;
725
- const { x: b, y: p, ox: z, oy: h } = d.current;
726
- r(z + x.clientX - b, h + x.clientY - p);
727
- }, n = () => {
728
- l.current = !1, document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", n);
729
- };
730
- document.addEventListener("mousemove", u), document.addEventListener("mouseup", n), i.preventDefault();
731
- },
732
- [r]
733
- );
734
- }
735
- const ht = ({ open: r }) => /* @__PURE__ */ t("svg", { width: "12", height: "12", viewBox: "0 0 12 12", style: { flexShrink: 0, transition: "transform .15s", transform: r ? "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" }) });
736
- function ze({ data: r = [], value: l, placeholder: d = "Select or type...", multiselection: i = !1, label: f, onChange: s, style: u }) {
888
+ const ft = ({ 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" }) });
889
+ function Me({ data: n = [], value: l, placeholder: d = "Select or type...", multiselection: c = !1, label: f, onChange: s, style: h }) {
737
890
  var E;
738
- const [n, x] = D(!1), [b, p] = D(""), [z, h] = D(
739
- i ? l ? [].concat(l) : [] : l || null
891
+ const [i, g] = I(!1), [b, r] = I(""), [v, u] = I(
892
+ c ? l ? [].concat(l) : [] : l || null
740
893
  ), y = q(null), o = q(null);
741
- H(O, []), se(y, J(() => {
742
- x(!1), p("");
894
+ H(O, []), ie(y, G(() => {
895
+ g(!1), r("");
743
896
  }, []));
744
- const k = oe(
745
- () => r.filter((a) => !b || a.value.toLowerCase().includes(b.toLowerCase())),
746
- [r, b]
747
- ), w = (a) => i ? (z || []).includes(a) : z === a, C = (a) => {
748
- const $ = a.id || a.value;
749
- if (i) {
750
- const v = w($) ? z.filter((A) => A !== $) : [...z || [], $];
751
- h(v), s == null || s(v);
897
+ const m = oe(
898
+ () => n.filter((a) => !b || a.value.toLowerCase().includes(b.toLowerCase())),
899
+ [n, b]
900
+ ), z = (a) => c ? (v || []).includes(a) : v === a, $ = (a) => {
901
+ const D = a.id || a.value;
902
+ if (c) {
903
+ const S = z(D) ? v.filter((A) => A !== D) : [...v || [], D];
904
+ u(S), s == null || s(S);
752
905
  } else
753
- h($), p(""), x(!1), s == null || s($);
754
- }, N = (a) => {
755
- const $ = z.filter((v) => v !== a);
756
- h($), s == null || s($);
757
- }, L = () => {
758
- x(!0), setTimeout(() => {
906
+ u(D), r(""), g(!1), s == null || s(D);
907
+ }, C = (a) => {
908
+ const D = v.filter((S) => S !== a);
909
+ u(D), s == null || s(D);
910
+ }, N = () => {
911
+ g(!0), setTimeout(() => {
759
912
  var a;
760
913
  return (a = o.current) == null ? void 0 : a.focus();
761
914
  }, 0);
762
- }, c = ((E = r.find((a) => (a.id || a.value) === z)) == null ? void 0 : E.value) || "", m = i ? z || [] : [];
763
- return /* @__PURE__ */ g("div", { ref: y, className: "dhx", style: { position: "relative", ...u }, children: [
915
+ }, p = ((E = n.find((a) => (a.id || a.value) === v)) == null ? void 0 : E.value) || "", k = c ? v || [] : [];
916
+ return /* @__PURE__ */ x("div", { ref: y, className: "dhx", style: { position: "relative", ...h }, children: [
764
917
  f && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: f }),
765
- /* @__PURE__ */ g(
918
+ /* @__PURE__ */ x(
766
919
  "div",
767
920
  {
768
- onClick: L,
921
+ onClick: N,
769
922
  style: {
770
923
  display: "flex",
771
924
  alignItems: "center",
772
- flexWrap: i ? "wrap" : "nowrap",
773
- border: `1px solid ${n ? e.primary : e.border}`,
925
+ flexWrap: c ? "wrap" : "nowrap",
926
+ border: `1px solid ${i ? e.primary : e.border}`,
774
927
  borderRadius: e.r,
775
928
  minHeight: 34,
776
929
  padding: "4px 8px",
@@ -778,13 +931,13 @@ function ze({ data: r = [], value: l, placeholder: d = "Select or type...", mult
778
931
  background: e.surface,
779
932
  gap: 4,
780
933
  transition: "border-color .15s",
781
- boxShadow: n ? `0 0 0 3px ${e.primary}22` : "none"
934
+ boxShadow: i ? `0 0 0 3px ${e.primary}22` : "none"
782
935
  },
783
936
  children: [
784
- i && /* @__PURE__ */ g(Le, { children: [
785
- m.map((a) => {
786
- var $;
787
- return /* @__PURE__ */ g("span", { style: {
937
+ c && /* @__PURE__ */ x(Te, { children: [
938
+ k.map((a) => {
939
+ var D;
940
+ return /* @__PURE__ */ x("span", { style: {
788
941
  display: "inline-flex",
789
942
  alignItems: "center",
790
943
  gap: 4,
@@ -796,12 +949,12 @@ function ze({ data: r = [], value: l, placeholder: d = "Select or type...", mult
796
949
  lineHeight: 1.5,
797
950
  whiteSpace: "nowrap"
798
951
  }, children: [
799
- (($ = r.find((v) => (v.id || v.value) === a)) == null ? void 0 : $.value) || a,
952
+ ((D = n.find((S) => (S.id || S.value) === a)) == null ? void 0 : D.value) || a,
800
953
  /* @__PURE__ */ t(
801
954
  "span",
802
955
  {
803
- onClick: (v) => {
804
- v.stopPropagation(), N(a);
956
+ onClick: (S) => {
957
+ S.stopPropagation(), C(a);
805
958
  },
806
959
  style: { cursor: "pointer", fontSize: 15, lineHeight: 1, opacity: 0.75, marginLeft: 2 },
807
960
  children: "×"
@@ -815,36 +968,36 @@ function ze({ data: r = [], value: l, placeholder: d = "Select or type...", mult
815
968
  ref: o,
816
969
  value: b,
817
970
  onChange: (a) => {
818
- p(a.target.value), x(!0);
971
+ r(a.target.value), g(!0);
819
972
  },
820
- onFocus: () => x(!0),
973
+ onFocus: () => g(!0),
821
974
  onClick: (a) => a.stopPropagation(),
822
- placeholder: m.length ? "" : d,
975
+ placeholder: k.length ? "" : d,
823
976
  style: { flex: 1, minWidth: 60, border: "none", outline: "none", fontSize: 13, background: "transparent", color: e.text, padding: 0 }
824
977
  }
825
978
  )
826
979
  ] }),
827
- !i && /* @__PURE__ */ t(
980
+ !c && /* @__PURE__ */ t(
828
981
  "input",
829
982
  {
830
983
  ref: o,
831
- value: n ? b : c,
984
+ value: i ? b : p,
832
985
  onChange: (a) => {
833
- p(a.target.value), x(!0);
986
+ r(a.target.value), g(!0);
834
987
  },
835
988
  onFocus: () => {
836
- x(!0), p("");
989
+ g(!0), r("");
837
990
  },
838
991
  onClick: (a) => a.stopPropagation(),
839
992
  placeholder: d,
840
993
  style: { flex: 1, border: "none", outline: "none", fontSize: 13, background: "transparent", color: e.text, padding: 0 }
841
994
  }
842
995
  ),
843
- /* @__PURE__ */ t(ht, { open: n })
996
+ /* @__PURE__ */ t(ft, { open: i })
844
997
  ]
845
998
  }
846
999
  ),
847
- n && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: {
1000
+ i && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: {
848
1001
  position: "absolute",
849
1002
  top: "calc(100% + 4px)",
850
1003
  left: 0,
@@ -854,13 +1007,13 @@ function ze({ data: r = [], value: l, placeholder: d = "Select or type...", mult
854
1007
  borderRadius: e.r,
855
1008
  boxShadow: e.shadowLg,
856
1009
  zIndex: 100
857
- }, children: /* @__PURE__ */ g("div", { className: "dhx-scroll", style: { maxHeight: 220, overflowY: "auto" }, children: [
858
- k.map((a) => {
859
- const $ = a.id || a.value, v = w($);
860
- return /* @__PURE__ */ g(
1010
+ }, children: /* @__PURE__ */ x("div", { className: "dhx-scroll", style: { maxHeight: 220, overflowY: "auto" }, children: [
1011
+ m.map((a) => {
1012
+ const D = a.id || a.value, S = z(D);
1013
+ return /* @__PURE__ */ x(
861
1014
  "div",
862
1015
  {
863
- onClick: () => C(a),
1016
+ onClick: () => $(a),
864
1017
  style: {
865
1018
  padding: "8px 12px",
866
1019
  cursor: "pointer",
@@ -868,114 +1021,114 @@ function ze({ data: r = [], value: l, placeholder: d = "Select or type...", mult
868
1021
  alignItems: "center",
869
1022
  gap: 8,
870
1023
  fontSize: 13,
871
- background: v ? e.primaryLt : "transparent",
872
- color: v ? e.primary : e.text
1024
+ background: S ? e.primaryLt : "transparent",
1025
+ color: S ? e.primary : e.text
873
1026
  },
874
- onMouseEnter: (A) => !v && (A.currentTarget.style.background = e.bg),
875
- onMouseLeave: (A) => !v && (A.currentTarget.style.background = "transparent"),
1027
+ onMouseEnter: (A) => !S && (A.currentTarget.style.background = e.bg),
1028
+ onMouseLeave: (A) => !S && (A.currentTarget.style.background = "transparent"),
876
1029
  children: [
877
- i && /* @__PURE__ */ t("span", { style: {
1030
+ c && /* @__PURE__ */ t("span", { style: {
878
1031
  width: 14,
879
1032
  height: 14,
880
1033
  flexShrink: 0,
881
- border: `2px solid ${v ? e.primary : e.borderDk}`,
1034
+ border: `2px solid ${S ? e.primary : e.borderDk}`,
882
1035
  borderRadius: 3,
883
1036
  display: "flex",
884
1037
  alignItems: "center",
885
1038
  justifyContent: "center",
886
- background: v ? e.primary : "transparent"
887
- }, children: v && /* @__PURE__ */ t("span", { style: { color: "#fff", fontSize: 9, lineHeight: 1 }, children: "✓" }) }),
1039
+ background: S ? e.primary : "transparent"
1040
+ }, children: S && /* @__PURE__ */ t("span", { style: { color: "#fff", fontSize: 9, lineHeight: 1 }, children: "✓" }) }),
888
1041
  /* @__PURE__ */ t("span", { style: { flex: 1 }, children: a.value }),
889
- !i && v && /* @__PURE__ */ t("span", { style: { color: e.primary, fontSize: 12, fontWeight: 700 }, children: "✓" }),
890
- a.count !== void 0 && /* @__PURE__ */ g("span", { style: { fontSize: 11, color: e.textMut }, children: [
1042
+ !c && S && /* @__PURE__ */ t("span", { style: { color: e.primary, fontSize: 12, fontWeight: 700 }, children: "✓" }),
1043
+ a.count !== void 0 && /* @__PURE__ */ x("span", { style: { fontSize: 11, color: e.textMut }, children: [
891
1044
  "(",
892
1045
  a.count,
893
1046
  ")"
894
1047
  ] })
895
1048
  ]
896
1049
  },
897
- $
1050
+ D
898
1051
  );
899
1052
  }),
900
- k.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 16, textAlign: "center", color: e.textMut, fontSize: 13 }, children: "No matches" })
1053
+ m.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 16, textAlign: "center", color: e.textMut, fontSize: 13 }, children: "No matches" })
901
1054
  ] }) })
902
1055
  ] });
903
1056
  }
904
- function Me({ min: r = 0, max: l = 100, step: d = 1, value: i, range: f = !1, label: s, tick: u, disabled: n = !1, onChange: x, style: b }) {
905
- const [p, z] = D(i ?? (f ? [r, l] : r));
1057
+ function $e({ min: n = 0, max: l = 100, step: d = 1, value: c, range: f = !1, label: s, tick: h, disabled: i = !1, onChange: g, style: b }) {
1058
+ const [r, v] = I(c ?? (f ? [n, l] : n));
906
1059
  H(O, []);
907
- const h = (C, N) => {
908
- if (!n)
1060
+ const u = ($, C) => {
1061
+ if (!i)
909
1062
  if (f) {
910
- const L = [...p];
911
- L[C] = N, z(L), x == null || x(L);
1063
+ const N = [...r];
1064
+ N[$] = C, v(N), g == null || g(N);
912
1065
  } else
913
- z(N), x == null || x(N);
914
- }, y = (C) => (C - r) / (l - r) * 100, o = f ? p : [p], k = f ? { left: `${y(o[0])}%`, width: `${y(o[1]) - y(o[0])}%` } : { left: 0, width: `${y(o[0])}%` }, w = n ? e.border : e.primary;
915
- return /* @__PURE__ */ g("div", { className: "dhx", style: { width: "100%", opacity: n ? 0.5 : 1, ...b }, children: [
1066
+ v(C), g == null || g(C);
1067
+ }, y = ($) => ($ - n) / (l - n) * 100, o = f ? r : [r], m = f ? { left: `${y(o[0])}%`, width: `${y(o[1]) - y(o[0])}%` } : { left: 0, width: `${y(o[0])}%` }, z = i ? e.border : e.primary;
1068
+ return /* @__PURE__ */ x("div", { className: "dhx", style: { width: "100%", opacity: i ? 0.5 : 1, ...b }, children: [
916
1069
  s && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: s }),
917
- /* @__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: [
918
- /* @__PURE__ */ t("div", { style: { position: "absolute", ...k, height: "100%", background: w, borderRadius: 2 } }),
919
- o.map((C, N) => /* @__PURE__ */ t(
1070
+ /* @__PURE__ */ t("div", { style: { position: "relative", height: 36, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ x("div", { style: { position: "relative", flex: 1, height: 4, background: e.border, borderRadius: 2 }, children: [
1071
+ /* @__PURE__ */ t("div", { style: { position: "absolute", ...m, height: "100%", background: z, borderRadius: 2 } }),
1072
+ o.map(($, C) => /* @__PURE__ */ t(
920
1073
  "input",
921
1074
  {
922
1075
  type: "range",
923
- min: r,
1076
+ min: n,
924
1077
  max: l,
925
1078
  step: d,
926
- value: C,
927
- disabled: n,
928
- onChange: (L) => {
929
- const c = +L.target.value;
930
- f && N === 0 && c >= p[1] || f && N === 1 && c <= p[0] || h(N, c);
1079
+ value: $,
1080
+ disabled: i,
1081
+ onChange: (N) => {
1082
+ const p = +N.target.value;
1083
+ f && C === 0 && p >= r[1] || f && C === 1 && p <= r[0] || u(C, p);
931
1084
  },
932
- style: { position: "absolute", width: "100%", height: "100%", opacity: 0, cursor: n ? "not-allowed" : "pointer", top: 0, left: 0, margin: 0 }
1085
+ style: { position: "absolute", width: "100%", height: "100%", opacity: 0, cursor: i ? "not-allowed" : "pointer", top: 0, left: 0, margin: 0 }
933
1086
  },
934
- N
1087
+ C
935
1088
  )),
936
- o.map((C, N) => /* @__PURE__ */ t("div", { style: { position: "absolute", left: `${y(C)}%`, top: "50%", transform: "translate(-50%, -50%)", width: 16, height: 16, borderRadius: "50%", background: e.surface, border: `2px solid ${w}`, 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: n ? e.textMut : e.primaryDk, color: "#fff", padding: "2px 6px", borderRadius: e.r, fontSize: 11, fontWeight: 700, whiteSpace: "nowrap" }, children: C }) }, N))
1089
+ o.map(($, C) => /* @__PURE__ */ t("div", { style: { position: "absolute", left: `${y($)}%`, top: "50%", transform: "translate(-50%, -50%)", width: 16, height: 16, borderRadius: "50%", background: e.surface, border: `2px solid ${z}`, 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: i ? e.textMut : e.primaryDk, color: "#fff", padding: "2px 6px", borderRadius: e.r, fontSize: 11, fontWeight: 700, whiteSpace: "nowrap" }, children: $ }) }, C))
937
1090
  ] }) }),
938
- u && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", marginTop: 2 }, children: [r, Math.round((l + r) / 2), l].map((C) => /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: C }, C)) })
1091
+ h && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", marginTop: 2 }, children: [n, Math.round((l + n) / 2), l].map(($) => /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: $ }, $)) })
939
1092
  ] });
940
1093
  }
941
- const ft = ["#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"];
942
- function ye(r) {
943
- const l = parseInt(r.slice(1, 3), 16) / 255, d = parseInt(r.slice(3, 5), 16) / 255, i = parseInt(r.slice(5, 7), 16) / 255, f = Math.max(l, d, i), s = Math.min(l, d, i);
944
- let u = 0, n = 0;
945
- const x = (f + s) / 2;
1094
+ const xt = ["#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"];
1095
+ function ye(n) {
1096
+ const l = parseInt(n.slice(1, 3), 16) / 255, d = parseInt(n.slice(3, 5), 16) / 255, c = parseInt(n.slice(5, 7), 16) / 255, f = Math.max(l, d, c), s = Math.min(l, d, c);
1097
+ let h = 0, i = 0;
1098
+ const g = (f + s) / 2;
946
1099
  if (f !== s) {
947
1100
  const b = f - s;
948
- n = x > 0.5 ? b / (2 - f - s) : b / (f + s), u = f === l ? ((d - i) / b + (d < i ? 6 : 0)) / 6 : f === d ? ((i - l) / b + 2) / 6 : ((l - d) / b + 4) / 6;
1101
+ i = g > 0.5 ? b / (2 - f - s) : b / (f + s), h = f === l ? ((d - c) / b + (d < c ? 6 : 0)) / 6 : f === d ? ((c - l) / b + 2) / 6 : ((l - d) / b + 4) / 6;
949
1102
  }
950
- return [Math.round(u * 360), Math.round(n * 100), Math.round(x * 100)];
1103
+ return [Math.round(h * 360), Math.round(i * 100), Math.round(g * 100)];
951
1104
  }
952
- function $e(r, l, d) {
1105
+ function De(n, l, d) {
953
1106
  l /= 100, d /= 100;
954
- const i = l * Math.min(d, 1 - d), f = (s) => {
955
- const u = (s + r / 30) % 12, n = d - i * Math.max(Math.min(u - 3, 9 - u, 1), -1);
956
- return Math.round(255 * n).toString(16).padStart(2, "0");
1107
+ const c = l * Math.min(d, 1 - d), f = (s) => {
1108
+ const h = (s + n / 30) % 12, i = d - c * Math.max(Math.min(h - 3, 9 - h, 1), -1);
1109
+ return Math.round(255 * i).toString(16).padStart(2, "0");
957
1110
  };
958
1111
  return "#" + f(0) + f(8) + f(4);
959
1112
  }
960
- function Ct({ value: r = "#0288d1", onChange: l, style: d }) {
961
- const [i, f] = D(() => ye(r)), s = $e(...i);
1113
+ function Nt({ value: n = "#0288d1", onChange: l, style: d }) {
1114
+ const [c, f] = I(() => ye(n)), s = De(...c);
962
1115
  H(O, []);
963
- const u = (n) => {
964
- f(n), l == null || l($e(...n));
1116
+ const h = (i) => {
1117
+ f(i), l == null || l(De(...i));
965
1118
  };
966
- 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: [
967
- /* @__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(${i[0]},100%,50%))`, cursor: "crosshair" } }),
968
- [["Hue", 0, 360, i[0]], ["Saturation", 0, 100, i[1]], ["Lightness", 0, 100, i[2]]].map(([n, x, b, p], z) => /* @__PURE__ */ g("div", { style: { marginBottom: z < 2 ? 8 : 12 }, children: [
969
- /* @__PURE__ */ g("div", { className: "dhx dhx-label", children: [
970
- n,
971
- z > 0 ? ` (${p}%)` : ""
1119
+ return /* @__PURE__ */ x("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...d }, children: [
1120
+ /* @__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(${c[0]},100%,50%))`, cursor: "crosshair" } }),
1121
+ [["Hue", 0, 360, c[0]], ["Saturation", 0, 100, c[1]], ["Lightness", 0, 100, c[2]]].map(([i, g, b, r], v) => /* @__PURE__ */ x("div", { style: { marginBottom: v < 2 ? 8 : 12 }, children: [
1122
+ /* @__PURE__ */ x("div", { className: "dhx dhx-label", children: [
1123
+ i,
1124
+ v > 0 ? ` (${r}%)` : ""
972
1125
  ] }),
973
- /* @__PURE__ */ t("input", { type: "range", min: x, max: b, value: p, onChange: (h) => {
974
- const y = [...i];
975
- y[z] = +h.target.value, u(y);
1126
+ /* @__PURE__ */ t("input", { type: "range", min: g, max: b, value: r, onChange: (u) => {
1127
+ const y = [...c];
1128
+ y[v] = +u.target.value, h(y);
976
1129
  }, style: { width: "100%", accentColor: e.primary } })
977
- ] }, n)),
978
- /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
1130
+ ] }, i)),
1131
+ /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
979
1132
  /* @__PURE__ */ t("div", { style: { width: 36, height: 36, borderRadius: e.r, background: s, border: `1px solid ${e.border}`, flexShrink: 0 } }),
980
1133
  /* @__PURE__ */ t(
981
1134
  "input",
@@ -983,236 +1136,185 @@ function Ct({ value: r = "#0288d1", onChange: l, style: d }) {
983
1136
  className: "dhx dhx-input",
984
1137
  style: { flex: 1, fontFamily: "monospace", fontSize: 12 },
985
1138
  value: s,
986
- onChange: (n) => {
1139
+ onChange: (i) => {
987
1140
  try {
988
- u(ye(n.target.value)), l == null || l(n.target.value);
1141
+ h(ye(i.target.value)), l == null || l(i.target.value);
989
1142
  } catch {
990
1143
  }
991
1144
  }
992
1145
  }
993
1146
  )
994
1147
  ] }),
995
- /* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "repeat(13, 1fr)", gap: 3 }, children: ft.map((n) => /* @__PURE__ */ t(
1148
+ /* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "repeat(13, 1fr)", gap: 3 }, children: xt.map((i) => /* @__PURE__ */ t(
996
1149
  "div",
997
1150
  {
998
1151
  onClick: () => {
999
- f(ye(n)), l == null || l(n);
1152
+ f(ye(i)), l == null || l(i);
1000
1153
  },
1001
- style: { width: 14, height: 14, borderRadius: 2, background: n, cursor: "pointer", border: s === n ? `2px solid ${e.text}` : "1px solid rgba(0,0,0,.15)", transition: "transform .1s" },
1002
- onMouseEnter: (x) => x.currentTarget.style.transform = "scale(1.3)",
1003
- onMouseLeave: (x) => x.currentTarget.style.transform = "scale(1)"
1154
+ style: { width: 14, height: 14, borderRadius: 2, background: i, cursor: "pointer", border: s === i ? `2px solid ${e.text}` : "1px solid rgba(0,0,0,.15)", transition: "transform .1s" },
1155
+ onMouseEnter: (g) => g.currentTarget.style.transform = "scale(1.3)",
1156
+ onMouseLeave: (g) => g.currentTarget.style.transform = "scale(1)"
1004
1157
  },
1005
- n
1158
+ i
1006
1159
  )) })
1007
1160
  ] });
1008
1161
  }
1009
- function he({ items: r, onSelect: l, style: d }) {
1010
- const [i, f] = D(null);
1011
- 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: r.map((s, u) => {
1012
- var x, b;
1013
- if (s.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "4px 0" } }, u);
1014
- const n = i === u;
1015
- return /* @__PURE__ */ g("div", { style: { position: "relative" }, onMouseEnter: () => f(u), onMouseLeave: () => f(null), children: [
1016
- /* @__PURE__ */ g(
1017
- "div",
1018
- {
1019
- onClick: () => {
1020
- var p;
1021
- return !s.disabled && !((p = s.items) != null && p.length) && l(s);
1022
- },
1023
- style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 14px", cursor: s.disabled ? "not-allowed" : "pointer", fontSize: 13, color: s.disabled ? e.textMut : e.text, background: n && !s.disabled ? e.bg : "transparent", opacity: s.disabled ? 0.5 : 1 },
1024
- children: [
1025
- s.icon && /* @__PURE__ */ t("span", { style: { fontSize: 15, width: 18, textAlign: "center" }, children: s.icon }),
1026
- /* @__PURE__ */ t("span", { style: { flex: 1 }, children: s.value || s.id }),
1027
- s.hotkey && /* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textMut }, children: s.hotkey }),
1028
- (x = s.items) != null && x.length ? /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: "▶" }) : null
1029
- ]
1030
- }
1031
- ),
1032
- n && ((b = s.items) != null && b.length) ? /* @__PURE__ */ t(he, { items: s.items, onSelect: l, style: { position: "absolute", left: "100%", top: -4 } }) : null
1033
- ] }, s.id || u);
1034
- }) });
1035
- }
1036
- function Nt({ items: r = [], label: l = "Menu", onSelect: d, style: i }) {
1037
- const [f, s] = D(!1), u = q(null);
1038
- return H(O, []), se(u, J(() => s(!1), [])), /* @__PURE__ */ g("div", { ref: u, className: "dhx", style: { position: "relative", display: "inline-block", ...i }, children: [
1039
- /* @__PURE__ */ g("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => s((n) => !n), children: [
1040
- l,
1041
- " ",
1042
- /* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: f ? "▲" : "▼" })
1043
- ] }),
1044
- f && /* @__PURE__ */ t(he, { items: r, onSelect: (n) => {
1045
- d == null || d(n), s(!1);
1046
- } })
1047
- ] });
1048
- }
1049
- function Tt({ items: r = [], onSelect: l, children: d }) {
1050
- const [i, f] = D(null), s = q(null);
1051
- return H(O, []), se(s, J(() => f(null), [])), /* @__PURE__ */ g("div", { ref: s, onContextMenu: (n) => {
1052
- n.preventDefault(), f({ x: n.clientX, y: n.clientY });
1053
- }, style: { position: "relative", display: "contents" }, children: [
1054
- d,
1055
- i && /* @__PURE__ */ t("div", { style: { position: "fixed", left: i.x, top: i.y, zIndex: 9999 }, children: /* @__PURE__ */ t(he, { items: r, onSelect: (n) => {
1056
- l == null || l(n), f(null);
1057
- } }) })
1058
- ] });
1059
- }
1060
- function Lt({ trigger: r, children: l, placement: d = "bottom-start", style: i }) {
1061
- const [f, s] = D(!1), [u, n] = D({ top: "100%", left: 0 }), x = q(null), b = q(null);
1062
- return H(O, []), se(x, J(() => s(!1), [])), /* @__PURE__ */ g("div", { ref: x, className: "dhx", style: { position: "relative", display: "inline-block" }, children: [
1162
+ function Tt({ trigger: n, children: l, placement: d = "bottom-start", style: c }) {
1163
+ const [f, s] = I(!1), [h, i] = I({ top: "100%", left: 0 }), g = q(null), b = q(null);
1164
+ return H(O, []), ie(g, G(() => s(!1), [])), /* @__PURE__ */ x("div", { ref: g, className: "dhx", style: { position: "relative", display: "inline-block" }, children: [
1063
1165
  /* @__PURE__ */ t("div", { ref: b, onClick: () => {
1064
- s((z) => {
1065
- if (!z && b.current) {
1066
- const h = b.current.getBoundingClientRect(), y = {
1067
- "bottom-start": { top: h.height + 4, left: 0 },
1068
- "bottom-end": { top: h.height + 4, right: 0, left: "auto" },
1069
- "top-start": { bottom: h.height + 4, top: "auto", left: 0 }
1166
+ s((v) => {
1167
+ if (!v && b.current) {
1168
+ const u = b.current.getBoundingClientRect(), y = {
1169
+ "bottom-start": { top: u.height + 4, left: 0 },
1170
+ "bottom-end": { top: u.height + 4, right: 0, left: "auto" },
1171
+ "top-start": { bottom: u.height + 4, top: "auto", left: 0 }
1070
1172
  };
1071
- n(y[d] || y["bottom-start"]);
1173
+ i(y[d] || y["bottom-start"]);
1072
1174
  }
1073
- return !z;
1175
+ return !v;
1074
1176
  });
1075
- }, children: r }),
1076
- f && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", ...u, zIndex: 200, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, boxShadow: e.shadowLg, ...i }, children: l })
1177
+ }, children: n }),
1178
+ 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, ...c }, children: l })
1077
1179
  ] });
1078
1180
  }
1079
- function It({ title: r, children: l, width: d = 480, height: i, closable: f = !0, movable: s = !0, modal: u = !1, defaultOpen: n = !0, footer: x, onClose: b, style: p }) {
1080
- const [z, h] = D(n), [y, o] = D({ x: 0, y: 0 });
1181
+ function Rt({ title: n, children: l, width: d = 480, height: c, closable: f = !0, movable: s = !0, modal: h = !1, defaultOpen: i = !0, footer: g, onClose: b, style: r }) {
1182
+ const [v, u] = I(i), [y, o] = I({ x: 0, y: 0 });
1081
1183
  H(O, []);
1082
- const k = ut(J((C, N) => s && o({ x: C, y: N }), [s])), w = () => {
1083
- h(!1), b == null || b();
1184
+ const m = st(G(($, C) => s && o({ x: $, y: C }), [s])), z = () => {
1185
+ u(!1), b == null || b();
1084
1186
  };
1085
- return z ? /* @__PURE__ */ g(Le, { children: [
1086
- u && /* @__PURE__ */ t("div", { style: { position: "fixed", inset: 0, background: "rgba(0,0,0,.45)", zIndex: 900 }, onClick: f ? w : void 0 }),
1087
- /* @__PURE__ */ g("div", { className: "dhx", style: { position: u ? "fixed" : "absolute", left: u ? "50%" : `calc(50% + ${y.x}px)`, top: u ? "50%" : `calc(50% + ${y.y}px)`, transform: `translate(calc(-50% + ${y.x}px), calc(-50% + ${y.y}px))`, width: d, ...i ? { height: i } : {}, background: e.surface, borderRadius: e.rMd, boxShadow: e.shadowLg, zIndex: 901, display: "flex", flexDirection: "column", overflow: "hidden", ...p }, children: [
1088
- /* @__PURE__ */ g("div", { onMouseDown: (C) => k(C, y.x, y.y), style: { display: "flex", alignItems: "center", padding: "12px 16px", borderBottom: `1px solid ${e.border}`, cursor: s ? "grab" : "default", background: e.bg, gap: 8, userSelect: "none" }, children: [
1089
- /* @__PURE__ */ t("span", { style: { flex: 1, fontWeight: 700, fontSize: 15 }, children: r }),
1187
+ return v ? /* @__PURE__ */ x(Te, { children: [
1188
+ h && /* @__PURE__ */ t("div", { style: { position: "fixed", inset: 0, background: "rgba(0,0,0,.45)", zIndex: 900 }, onClick: f ? z : void 0 }),
1189
+ /* @__PURE__ */ x("div", { className: "dhx", style: { position: h ? "fixed" : "absolute", left: h ? "50%" : `calc(50% + ${y.x}px)`, top: h ? "50%" : `calc(50% + ${y.y}px)`, transform: `translate(calc(-50% + ${y.x}px), calc(-50% + ${y.y}px))`, width: d, ...c ? { height: c } : {}, background: e.surface, borderRadius: e.rMd, boxShadow: e.shadowLg, zIndex: 901, display: "flex", flexDirection: "column", overflow: "hidden", ...r }, children: [
1190
+ /* @__PURE__ */ x("div", { onMouseDown: ($) => m($, y.x, y.y), style: { display: "flex", alignItems: "center", padding: "12px 16px", borderBottom: `1px solid ${e.border}`, cursor: s ? "grab" : "default", background: e.bg, gap: 8, userSelect: "none" }, children: [
1191
+ /* @__PURE__ */ t("span", { style: { flex: 1, fontWeight: 700, fontSize: 15 }, children: n }),
1090
1192
  f && /* @__PURE__ */ t(
1091
1193
  "button",
1092
1194
  {
1093
- onClick: w,
1195
+ onClick: z,
1094
1196
  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 },
1095
- onMouseEnter: (C) => C.currentTarget.style.background = e.border,
1096
- onMouseLeave: (C) => C.currentTarget.style.background = "none",
1197
+ onMouseEnter: ($) => $.currentTarget.style.background = e.border,
1198
+ onMouseLeave: ($) => $.currentTarget.style.background = "none",
1097
1199
  children: "×"
1098
1200
  }
1099
1201
  )
1100
1202
  ] }),
1101
1203
  /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, minHeight: 0, padding: 20, overflowY: "auto" }, children: l }),
1102
- 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 })
1204
+ g && /* @__PURE__ */ t("div", { style: { padding: "12px 16px", borderTop: `1px solid ${e.border}`, display: "flex", justifyContent: "flex-end", gap: 8, background: e.bg }, children: g })
1103
1205
  ] })
1104
1206
  ] }) : null;
1105
1207
  }
1106
- const Ie = He(null), xt = { success: "✓", error: "✕", warning: "⚠", info: "ℹ" }, De = { success: e.success, error: e.danger, warning: e.warning, info: e.primary };
1107
- function Rt({ children: r }) {
1108
- const [l, d] = D([]);
1208
+ const Re = je(null), gt = { success: "✓", error: "✕", warning: "⚠", info: "ℹ" }, Ce = { success: e.success, error: e.danger, warning: e.warning, info: e.primary };
1209
+ function Et({ children: n }) {
1210
+ const [l, d] = I([]);
1109
1211
  H(O, []);
1110
- const i = J((u) => d((n) => n.filter((x) => x.id !== u)), []), f = J((u) => {
1111
- const n = Date.now();
1112
- return d((x) => [...x, { id: n, ...u }]), u.duration !== 0 && setTimeout(() => i(n), u.duration || 4e3), n;
1113
- }, [i]), s = {
1212
+ const c = G((h) => d((i) => i.filter((g) => g.id !== h)), []), f = G((h) => {
1213
+ const i = Date.now();
1214
+ return d((g) => [...g, { id: i, ...h }]), h.duration !== 0 && setTimeout(() => c(i), h.duration || 4e3), i;
1215
+ }, [c]), s = {
1114
1216
  message: f,
1115
- alert: (u, n) => f({ type: "info", title: u, ...n }),
1116
- confirm: (u, n, x) => f({ type: "warning", title: u, confirm: n, ...x })
1217
+ alert: (h, i) => f({ type: "info", title: h, ...i }),
1218
+ confirm: (h, i, g) => f({ type: "warning", title: h, confirm: i, ...g })
1117
1219
  };
1118
- return /* @__PURE__ */ g(Ie.Provider, { value: s, children: [
1119
- r,
1120
- /* @__PURE__ */ t("div", { style: { position: "fixed", top: 20, right: 20, zIndex: 9999, display: "flex", flexDirection: "column", gap: 8, pointerEvents: "none" }, children: l.map((u) => {
1121
- const n = u.type || "info";
1122
- return /* @__PURE__ */ g("div", { style: { background: e.surface, border: `1px solid ${e.border}`, borderLeft: `4px solid ${De[n]}`, 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: [
1123
- /* @__PURE__ */ t("span", { style: { fontSize: 18, color: De[n], lineHeight: 1 }, children: xt[n] }),
1124
- /* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
1125
- u.title && /* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 13, marginBottom: u.text ? 3 : 0 }, children: u.title }),
1126
- u.text && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec, lineHeight: 1.5 }, children: u.text }),
1127
- u.confirm && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 6, marginTop: 8 }, children: [
1220
+ return /* @__PURE__ */ x(Re.Provider, { value: s, children: [
1221
+ n,
1222
+ /* @__PURE__ */ t("div", { style: { position: "fixed", top: 20, right: 20, zIndex: 9999, display: "flex", flexDirection: "column", gap: 8, pointerEvents: "none" }, children: l.map((h) => {
1223
+ const i = h.type || "info";
1224
+ return /* @__PURE__ */ x("div", { style: { background: e.surface, border: `1px solid ${e.border}`, borderLeft: `4px solid ${Ce[i]}`, 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: [
1225
+ /* @__PURE__ */ t("span", { style: { fontSize: 18, color: Ce[i], lineHeight: 1 }, children: gt[i] }),
1226
+ /* @__PURE__ */ x("div", { style: { flex: 1 }, children: [
1227
+ h.title && /* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 13, marginBottom: h.text ? 3 : 0 }, children: h.title }),
1228
+ h.text && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec, lineHeight: 1.5 }, children: h.text }),
1229
+ h.confirm && /* @__PURE__ */ x("div", { style: { display: "flex", gap: 6, marginTop: 8 }, children: [
1128
1230
  /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", style: { height: 26, fontSize: 12 }, onClick: () => {
1129
- u.confirm(!0), i(u.id);
1231
+ h.confirm(!0), c(h.id);
1130
1232
  }, children: "Confirm" }),
1131
1233
  /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", style: { height: 26, fontSize: 12 }, onClick: () => {
1132
- u.confirm(!1), i(u.id);
1234
+ h.confirm(!1), c(h.id);
1133
1235
  }, children: "Cancel" })
1134
1236
  ] })
1135
1237
  ] }),
1136
- /* @__PURE__ */ t("button", { onClick: () => i(u.id), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 14, lineHeight: 1, padding: 0 }, children: "×" })
1137
- ] }, u.id);
1238
+ /* @__PURE__ */ t("button", { onClick: () => c(h.id), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 14, lineHeight: 1, padding: 0 }, children: "×" })
1239
+ ] }, h.id);
1138
1240
  }) })
1139
1241
  ] });
1140
1242
  }
1141
- function Et() {
1142
- const r = je(Ie);
1143
- if (!r) throw new Error("useMessage must be used inside <MessageProvider>");
1144
- return r;
1243
+ function Wt() {
1244
+ const n = Pe(Re);
1245
+ if (!n) throw new Error("useMessage must be used inside <MessageProvider>");
1246
+ return n;
1145
1247
  }
1146
- function Wt({ data: r = [], template: l, keyNavigation: d = !0, multiselection: i = !1, editable: f = !1, height: s = 400, onSelect: u, onEdit: n, style: x }) {
1147
- const [b, p] = D(/* @__PURE__ */ new Set()), [z, h] = D(null), [y, o] = D(""), [k, w] = D(null);
1248
+ function At({ data: n = [], template: l, keyNavigation: d = !0, multiselection: c = !1, editable: f = !1, height: s = 400, onSelect: h, onEdit: i, style: g }) {
1249
+ const [b, r] = I(/* @__PURE__ */ new Set()), [v, u] = I(null), [y, o] = I(""), [m, z] = I(null);
1148
1250
  H(O, []);
1149
- const C = (L, c) => {
1150
- const m = L.id ?? c;
1151
- p((E) => {
1152
- const a = i ? new Set(E) : /* @__PURE__ */ new Set();
1153
- return a.has(m) ? a.delete(m) : a.add(m), a;
1154
- }), w(c), u == null || u(L);
1155
- }, N = (L, c) => {
1156
- n == null || n({ ...L, value: y }, c), h(null);
1251
+ const $ = (N, p) => {
1252
+ const k = N.id ?? p;
1253
+ r((E) => {
1254
+ const a = c ? new Set(E) : /* @__PURE__ */ new Set();
1255
+ return a.has(k) ? a.delete(k) : a.add(k), a;
1256
+ }), z(p), h == null || h(N);
1257
+ }, C = (N, p) => {
1258
+ i == null || i({ ...N, value: y }, p), u(null);
1157
1259
  };
1158
- return /* @__PURE__ */ g(
1260
+ return /* @__PURE__ */ x(
1159
1261
  "div",
1160
1262
  {
1161
1263
  className: "dhx dhx-scroll",
1162
- style: { height: s, overflowY: "auto", border: `1px solid ${e.border}`, borderRadius: e.r, background: e.surface, ...x },
1264
+ style: { height: s, overflowY: "auto", border: `1px solid ${e.border}`, borderRadius: e.r, background: e.surface, ...g },
1163
1265
  tabIndex: 0,
1164
- onKeyDown: (L) => {
1165
- d && (L.key === "ArrowDown" && w((c) => Math.min((c ?? -1) + 1, r.length - 1)), L.key === "ArrowUp" && w((c) => Math.max((c ?? 1) - 1, 0)));
1266
+ onKeyDown: (N) => {
1267
+ d && (N.key === "ArrowDown" && z((p) => Math.min((p ?? -1) + 1, n.length - 1)), N.key === "ArrowUp" && z((p) => Math.max((p ?? 1) - 1, 0)));
1166
1268
  },
1167
1269
  children: [
1168
- r.map((L, c) => {
1169
- const m = L.id ?? c, E = b.has(m), a = k === c;
1270
+ n.map((N, p) => {
1271
+ const k = N.id ?? p, E = b.has(k), a = m === p;
1170
1272
  return /* @__PURE__ */ t(
1171
1273
  "div",
1172
1274
  {
1173
- onClick: () => C(L, c),
1174
- onDoubleClick: () => f && (h(c), o(String(L.value || ""))),
1275
+ onClick: () => $(N, p),
1276
+ onDoubleClick: () => f && (u(p), o(String(N.value || ""))),
1175
1277
  style: { display: "flex", alignItems: "center", padding: "0 12px", height: 40, cursor: "pointer", fontSize: 13, borderBottom: `1px solid ${e.border}`, background: E ? e.primaryLt : a ? e.bg : e.surface, color: E ? e.primary : e.text, outline: a ? `2px solid ${e.primary}44` : "none", transition: "background .1s" },
1176
- children: z === c ? /* @__PURE__ */ t(
1278
+ children: v === p ? /* @__PURE__ */ t(
1177
1279
  "input",
1178
1280
  {
1179
1281
  autoFocus: !0,
1180
1282
  className: "dhx dhx-input",
1181
1283
  style: { height: 28, flex: 1 },
1182
1284
  value: y,
1183
- onChange: ($) => o($.target.value),
1184
- onBlur: () => N(L, c),
1185
- onKeyDown: ($) => {
1186
- $.key === "Enter" && N(L, c), $.key === "Escape" && h(null);
1285
+ onChange: (D) => o(D.target.value),
1286
+ onBlur: () => C(N, p),
1287
+ onKeyDown: (D) => {
1288
+ D.key === "Enter" && C(N, p), D.key === "Escape" && u(null);
1187
1289
  },
1188
- onClick: ($) => $.stopPropagation()
1290
+ onClick: (D) => D.stopPropagation()
1189
1291
  }
1190
- ) : l ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: l(L) }, style: { flex: 1 } }) : /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: String(L.value ?? "") })
1292
+ ) : l ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: l(N) }, style: { flex: 1 } }) : /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: String(N.value ?? "") })
1191
1293
  },
1192
- String(m)
1294
+ String(k)
1193
1295
  );
1194
1296
  }),
1195
- r.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 24, textAlign: "center", color: e.textMut }, children: "No items" })
1297
+ n.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 24, textAlign: "center", color: e.textMut }, children: "No items" })
1196
1298
  ]
1197
1299
  }
1198
1300
  );
1199
1301
  }
1200
- function At({ data: r = [], template: l, itemsInRow: d = 3, gap: i = 12, multiselection: f = !1, onSelect: s, style: u }) {
1201
- const [n, x] = D(/* @__PURE__ */ new Set());
1302
+ function Bt({ data: n = [], template: l, itemsInRow: d = 3, gap: c = 12, multiselection: f = !1, onSelect: s, style: h }) {
1303
+ const [i, g] = I(/* @__PURE__ */ new Set());
1202
1304
  H(O, []);
1203
- const b = (p) => {
1204
- const z = p.id ?? String(p.title);
1205
- x((h) => {
1206
- const y = f ? new Set(h) : /* @__PURE__ */ new Set();
1207
- return y.has(z) ? y.delete(z) : y.add(z), y;
1208
- }), s == null || s(p);
1305
+ const b = (r) => {
1306
+ const v = r.id ?? String(r.title);
1307
+ g((u) => {
1308
+ const y = f ? new Set(u) : /* @__PURE__ */ new Set();
1309
+ return y.has(v) ? y.delete(v) : y.add(v), y;
1310
+ }), s == null || s(r);
1209
1311
  };
1210
- return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "grid", gridTemplateColumns: `repeat(${d}, 1fr)`, gap: i, padding: i, ...u }, children: r.map((p, z) => {
1211
- const h = p.id ?? z, y = n.has(h);
1312
+ return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "grid", gridTemplateColumns: `repeat(${d}, 1fr)`, gap: c, padding: c, ...h }, children: n.map((r, v) => {
1313
+ const u = r.id ?? v, y = i.has(u);
1212
1314
  return /* @__PURE__ */ t(
1213
1315
  "div",
1214
1316
  {
1215
- onClick: () => b(p),
1317
+ onClick: () => b(r),
1216
1318
  style: { background: e.surface, border: `2px solid ${y ? e.primary : e.border}`, borderRadius: e.rMd, overflow: "hidden", cursor: "pointer", transition: "all .15s", boxShadow: y ? `0 0 0 3px ${e.primary}33` : e.shadow, transform: y ? "translateY(-2px)" : "none" },
1217
1319
  onMouseEnter: (o) => {
1218
1320
  o.currentTarget.style.boxShadow = e.shadowLg, o.currentTarget.style.transform = "translateY(-2px)";
@@ -1220,151 +1322,151 @@ function At({ data: r = [], template: l, itemsInRow: d = 3, gap: i = 12, multise
1220
1322
  onMouseLeave: (o) => {
1221
1323
  o.currentTarget.style.boxShadow = y ? `0 0 0 3px ${e.primary}33` : e.shadow, o.currentTarget.style.transform = y ? "translateY(-2px)" : "none";
1222
1324
  },
1223
- children: l ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: l(p) } }) : /* @__PURE__ */ g("div", { style: { padding: 16 }, children: [
1224
- p.img && /* @__PURE__ */ t("img", { src: p.img, alt: p.title || "", style: { width: "100%", borderRadius: e.r, marginBottom: 8, display: "block" } }),
1225
- /* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 14, marginBottom: 4 }, children: p.title || p.value }),
1226
- p.subtitle && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec }, children: p.subtitle })
1325
+ children: l ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: l(r) } }) : /* @__PURE__ */ x("div", { style: { padding: 16 }, children: [
1326
+ r.img && /* @__PURE__ */ t("img", { src: r.img, alt: r.title || "", style: { width: "100%", borderRadius: e.r, marginBottom: 8, display: "block" } }),
1327
+ /* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 14, marginBottom: 4 }, children: r.title || r.value }),
1328
+ r.subtitle && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec }, children: r.subtitle })
1227
1329
  ] })
1228
1330
  },
1229
- String(h)
1331
+ String(u)
1230
1332
  );
1231
1333
  }) });
1232
1334
  }
1233
- function be(r) {
1234
- return r.map((l) => ({ ...l, items: l.items ? be(l.items) : void 0 }));
1335
+ function be(n) {
1336
+ return n.map((l) => ({ ...l, items: l.items ? be(l.items) : void 0 }));
1235
1337
  }
1236
- function me(r, l = {}) {
1237
- return r.forEach((d) => {
1338
+ function me(n, l = {}) {
1339
+ return n.forEach((d) => {
1238
1340
  d.opened && (l[d.id] = !0), d.items && me(d.items, l);
1239
1341
  }), l;
1240
1342
  }
1241
- function Re(r, l) {
1343
+ function Ee(n, l) {
1242
1344
  let d = null;
1243
- return [r.filter((f) => f.id === l ? (d = f, !1) : !0).map((f) => {
1345
+ return [n.filter((f) => f.id === l ? (d = f, !1) : !0).map((f) => {
1244
1346
  if (f.items) {
1245
- const [s, u] = Re(f.items, l);
1246
- return u && (d = u), { ...f, items: s };
1347
+ const [s, h] = Ee(f.items, l);
1348
+ return h && (d = h), { ...f, items: s };
1247
1349
  }
1248
1350
  return f;
1249
1351
  }), d];
1250
1352
  }
1251
- function ve(r, l, d, i) {
1252
- if (i === "inside")
1253
- return r.map((s) => s.id === l ? { ...s, items: [...s.items || [], d] } : s.items ? { ...s, items: ve(s.items, l, d, i) } : s);
1254
- if (r.some((s) => s.id === l)) {
1353
+ function ve(n, l, d, c) {
1354
+ if (c === "inside")
1355
+ return n.map((s) => s.id === l ? { ...s, items: [...s.items || [], d] } : s.items ? { ...s, items: ve(s.items, l, d, c) } : s);
1356
+ if (n.some((s) => s.id === l)) {
1255
1357
  const s = [];
1256
- for (const u of r)
1257
- u.id === l ? i === "before" ? (s.push(d), s.push(u)) : (s.push(u), s.push(d)) : s.push(u);
1358
+ for (const h of n)
1359
+ h.id === l ? c === "before" ? (s.push(d), s.push(h)) : (s.push(h), s.push(d)) : s.push(h);
1258
1360
  return s;
1259
1361
  }
1260
- return r.map((s) => s.items ? { ...s, items: ve(s.items, l, d, i) } : s);
1362
+ return n.map((s) => s.items ? { ...s, items: ve(s.items, l, d, c) } : s);
1261
1363
  }
1262
- function gt(r, l, d) {
1263
- function i(f) {
1264
- var s, u;
1364
+ function yt(n, l, d) {
1365
+ function c(f) {
1366
+ var s, h;
1265
1367
  if (f.id === l) {
1266
- const n = (x) => {
1368
+ const i = (g) => {
1267
1369
  var b;
1268
- return x.id === d || (((b = x.items) == null ? void 0 : b.some(n)) ?? !1);
1370
+ return g.id === d || (((b = g.items) == null ? void 0 : b.some(i)) ?? !1);
1269
1371
  };
1270
- return ((s = f.items) == null ? void 0 : s.some(n)) ?? !1;
1372
+ return ((s = f.items) == null ? void 0 : s.some(i)) ?? !1;
1271
1373
  }
1272
- return ((u = f.items) == null ? void 0 : u.some(i)) ?? !1;
1374
+ return ((h = f.items) == null ? void 0 : h.some(c)) ?? !1;
1273
1375
  }
1274
- return r.some(i);
1376
+ return n.some(c);
1275
1377
  }
1276
- function Ee(r, l, d) {
1277
- return r.map(
1278
- (i) => i.id === l ? { ...i, value: d } : { ...i, items: i.items ? Ee(i.items, l, d) : void 0 }
1378
+ function We(n, l, d) {
1379
+ return n.map(
1380
+ (c) => c.id === l ? { ...c, value: d } : { ...c, items: c.items ? We(c.items, l, d) : void 0 }
1279
1381
  );
1280
1382
  }
1281
- function yt(r, l) {
1383
+ function bt(n, l) {
1282
1384
  var s;
1283
- let d = 0, i = 0;
1284
- const f = (u) => {
1285
- var n;
1286
- d++, l[u.id] && i++, (n = u.items) == null || n.forEach(f);
1385
+ let d = 0, c = 0;
1386
+ const f = (h) => {
1387
+ var i;
1388
+ d++, l[h.id] && c++, (i = h.items) == null || i.forEach(f);
1287
1389
  };
1288
- return (s = r.items) == null || s.forEach(f), { total: d, checkedCount: i };
1390
+ return (s = n.items) == null || s.forEach(f), { total: d, checkedCount: c };
1289
1391
  }
1290
- function Bt({
1291
- data: r = [],
1392
+ function Ht({
1393
+ data: n = [],
1292
1394
  checkbox: l = !1,
1293
1395
  editable: d = !1,
1294
- dragMode: i,
1396
+ dragMode: c,
1295
1397
  tooltip: f,
1296
1398
  onSelect: s,
1297
- onCheck: u,
1298
- onChange: n,
1299
- style: x
1399
+ onCheck: h,
1400
+ onChange: i,
1401
+ style: g
1300
1402
  }) {
1301
- const [b, p] = D(() => be(r)), [z, h] = D(() => me(r)), [y, o] = D(null), [k, w] = D({}), [C, N] = D(null), [L, c] = D(""), [m, E] = D(null), [a, $] = D(null);
1403
+ const [b, r] = I(() => be(n)), [v, u] = I(() => me(n)), [y, o] = I(null), [m, z] = I({}), [$, C] = I(null), [N, p] = I(""), [k, E] = I(null), [a, D] = I(null);
1302
1404
  H(O, []), H(() => {
1303
- p(be(r)), h((T) => ({ ...me(r), ...T }));
1304
- }, [r]);
1305
- const v = (T) => h((j) => ({ ...j, [T]: !j[T] })), A = (T, j) => {
1306
- w((Y) => ({ ...Y, [T]: j })), u == null || u(T, j);
1405
+ r(be(n)), u((L) => ({ ...me(n), ...L }));
1406
+ }, [n]);
1407
+ const S = (L) => u((j) => ({ ...j, [L]: !j[L] })), A = (L, j) => {
1408
+ z((Y) => ({ ...Y, [L]: j })), h == null || h(L, j);
1307
1409
  }, F = () => {
1308
- if (!C) return;
1309
- const T = C, j = L;
1310
- N(null), p((Y) => {
1311
- const V = Ee(Y, T, j);
1312
- return n == null || n(V), V;
1410
+ if (!$) return;
1411
+ const L = $, j = N;
1412
+ C(null), r((Y) => {
1413
+ const V = We(Y, L, j);
1414
+ return i == null || i(V), V;
1313
1415
  });
1314
- }, U = (T, j) => {
1315
- T.dataTransfer.effectAllowed = "move", E(j);
1316
- }, Q = (T, j) => {
1317
- if (!m || m === j || gt(b, m, j)) return;
1318
- T.preventDefault();
1319
- const Y = T.currentTarget.getBoundingClientRect(), V = T.clientY - Y.top, K = Y.height, G = V < K * 0.25 ? "before" : V > K * 0.75 ? "after" : "inside";
1320
- $((X) => (X == null ? void 0 : X.id) === j && (X == null ? void 0 : X.pos) === G ? X : { id: j, pos: G });
1321
- }, ae = (T, j) => {
1322
- if (T.preventDefault(), !m || !a || m === j) {
1323
- $(null), E(null);
1416
+ }, U = (L, j) => {
1417
+ L.dataTransfer.effectAllowed = "move", E(j);
1418
+ }, Q = (L, j) => {
1419
+ if (!k || k === j || yt(b, k, j)) return;
1420
+ L.preventDefault();
1421
+ const Y = L.currentTarget.getBoundingClientRect(), V = L.clientY - Y.top, K = Y.height, J = V < K * 0.25 ? "before" : V > K * 0.75 ? "after" : "inside";
1422
+ D((X) => (X == null ? void 0 : X.id) === j && (X == null ? void 0 : X.pos) === J ? X : { id: j, pos: J });
1423
+ }, de = (L, j) => {
1424
+ if (L.preventDefault(), !k || !a || k === j) {
1425
+ D(null), E(null);
1324
1426
  return;
1325
1427
  }
1326
- p((Y) => {
1327
- const [V, K] = Re(Y, m);
1428
+ r((Y) => {
1429
+ const [V, K] = Ee(Y, k);
1328
1430
  if (!K) return Y;
1329
- const G = ve(V, j, K, a.pos);
1330
- return n == null || n(G), G;
1331
- }), a.pos === "inside" && h((Y) => ({ ...Y, [j]: !0 })), $(null), E(null);
1332
- }, ie = () => {
1333
- E(null), $(null);
1334
- }, de = (T, j = 0) => {
1335
- var ue;
1336
- const Y = (((ue = T.items) == null ? void 0 : ue.length) ?? 0) > 0, V = z[T.id], K = y === T.id, G = m === T.id, X = (a == null ? void 0 : a.id) === T.id;
1337
- let ce = !!k[T.id], pe = !1;
1431
+ const J = ve(V, j, K, a.pos);
1432
+ return i == null || i(J), J;
1433
+ }), a.pos === "inside" && u((Y) => ({ ...Y, [j]: !0 })), D(null), E(null);
1434
+ }, le = () => {
1435
+ E(null), D(null);
1436
+ }, ce = (L, j = 0) => {
1437
+ var he;
1438
+ const Y = (((he = L.items) == null ? void 0 : he.length) ?? 0) > 0, V = v[L.id], K = y === L.id, J = k === L.id, X = (a == null ? void 0 : a.id) === L.id;
1439
+ let pe = !!m[L.id], ue = !1;
1338
1440
  if (l && Y) {
1339
- const { total: W, checkedCount: ee } = yt(T, k);
1340
- ee > 0 && ee < W ? pe = !0 : W > 0 && ee === W && (ce = !0);
1441
+ const { total: W, checkedCount: ee } = bt(L, m);
1442
+ ee > 0 && ee < W ? ue = !0 : W > 0 && ee === W && (pe = !0);
1341
1443
  }
1342
- const fe = X && a.pos !== "inside" ? { boxShadow: a.pos === "before" ? `inset 0 2px 0 0 ${e.primary}` : `inset 0 -2px 0 0 ${e.primary}` } : {}, le = X && a.pos === "inside" || K ? e.primaryLt : "transparent";
1343
- return /* @__PURE__ */ g("div", { style: { opacity: G ? 0.4 : 1 }, children: [
1344
- /* @__PURE__ */ g(
1444
+ const fe = X && a.pos !== "inside" ? { boxShadow: a.pos === "before" ? `inset 0 2px 0 0 ${e.primary}` : `inset 0 -2px 0 0 ${e.primary}` } : {}, se = X && a.pos === "inside" || K ? e.primaryLt : "transparent";
1445
+ return /* @__PURE__ */ x("div", { style: { opacity: J ? 0.4 : 1 }, children: [
1446
+ /* @__PURE__ */ x(
1345
1447
  "div",
1346
1448
  {
1347
- draggable: !!i,
1348
- onDragStart: i ? (W) => U(W, T.id) : void 0,
1349
- onDragOver: i ? (W) => Q(W, T.id) : void 0,
1350
- onDrop: i ? (W) => ae(W, T.id) : void 0,
1351
- onDragEnd: i ? ie : void 0,
1352
- title: f == null ? void 0 : f(T),
1449
+ draggable: !!c,
1450
+ onDragStart: c ? (W) => U(W, L.id) : void 0,
1451
+ onDragOver: c ? (W) => Q(W, L.id) : void 0,
1452
+ onDrop: c ? (W) => de(W, L.id) : void 0,
1453
+ onDragEnd: c ? le : void 0,
1454
+ title: f == null ? void 0 : f(L),
1353
1455
  onClick: () => {
1354
- o(T.id), s == null || s(T), Y && v(T.id);
1456
+ o(L.id), s == null || s(L), Y && S(L.id);
1355
1457
  },
1356
1458
  onDoubleClick: () => {
1357
- d && (N(T.id), c(T.value || ""));
1459
+ d && (C(L.id), p(L.value || ""));
1358
1460
  },
1359
1461
  style: {
1360
1462
  display: "flex",
1361
1463
  alignItems: "center",
1362
1464
  gap: 4,
1363
1465
  padding: `5px 8px 5px ${12 + j * 18}px`,
1364
- cursor: i ? "grab" : "pointer",
1466
+ cursor: c ? "grab" : "pointer",
1365
1467
  borderRadius: e.r,
1366
1468
  margin: "1px 4px",
1367
- background: le,
1469
+ background: se,
1368
1470
  color: K ? e.primary : e.text,
1369
1471
  userSelect: "none",
1370
1472
  fontSize: 13,
@@ -1378,7 +1480,7 @@ function Bt({
1378
1480
  {
1379
1481
  style: { width: 16, textAlign: "center", fontSize: 11, color: e.textMut, flexShrink: 0 },
1380
1482
  onClick: (W) => {
1381
- W.stopPropagation(), Y && v(T.id);
1483
+ W.stopPropagation(), Y && S(L.id);
1382
1484
  },
1383
1485
  children: Y ? V ? "▾" : "▸" : ""
1384
1486
  }
@@ -1388,298 +1490,298 @@ function Bt({
1388
1490
  "input",
1389
1491
  {
1390
1492
  ref: (W) => {
1391
- W && (W.indeterminate = pe);
1493
+ W && (W.indeterminate = ue);
1392
1494
  },
1393
1495
  type: "checkbox",
1394
- checked: ce,
1496
+ checked: pe,
1395
1497
  onChange: (W) => {
1396
- W.stopPropagation(), A(T.id, W.target.checked);
1498
+ W.stopPropagation(), A(L.id, W.target.checked);
1397
1499
  },
1398
1500
  style: { cursor: "pointer", accentColor: e.primary, flexShrink: 0 },
1399
1501
  onClick: (W) => W.stopPropagation()
1400
1502
  }
1401
1503
  ),
1402
- C === T.id ? /* @__PURE__ */ t(
1504
+ $ === L.id ? /* @__PURE__ */ t(
1403
1505
  "input",
1404
1506
  {
1405
1507
  autoFocus: !0,
1406
1508
  className: "dhx dhx-input",
1407
1509
  style: { height: 24, fontSize: 12, flex: 1 },
1408
- value: L,
1409
- onChange: (W) => c(W.target.value),
1510
+ value: N,
1511
+ onChange: (W) => p(W.target.value),
1410
1512
  onBlur: F,
1411
1513
  onKeyDown: (W) => {
1412
- W.key === "Enter" && F(), W.key === "Escape" && N(null);
1514
+ W.key === "Enter" && F(), W.key === "Escape" && C(null);
1413
1515
  },
1414
1516
  onClick: (W) => W.stopPropagation()
1415
1517
  }
1416
- ) : /* @__PURE__ */ t("span", { style: { flex: 1 }, children: T.value }),
1417
- T.count !== void 0 && /* @__PURE__ */ g("span", { style: { fontSize: 11, color: e.textMut }, children: [
1518
+ ) : /* @__PURE__ */ t("span", { style: { flex: 1 }, children: L.value }),
1519
+ L.count !== void 0 && /* @__PURE__ */ x("span", { style: { fontSize: 11, color: e.textMut }, children: [
1418
1520
  "(",
1419
- T.count,
1521
+ L.count,
1420
1522
  ")"
1421
1523
  ] })
1422
1524
  ]
1423
1525
  }
1424
1526
  ),
1425
- Y && V && /* @__PURE__ */ t("div", { children: T.items.map((W) => de(W, j + 1)) })
1426
- ] }, T.id);
1527
+ Y && V && /* @__PURE__ */ t("div", { children: L.items.map((W) => ce(W, j + 1)) })
1528
+ ] }, L.id);
1427
1529
  };
1428
1530
  return /* @__PURE__ */ t(
1429
1531
  "div",
1430
1532
  {
1431
1533
  className: "dhx dhx-scroll",
1432
- style: { overflowY: "auto", ...x },
1433
- onDragOver: i ? (T) => T.preventDefault() : void 0,
1434
- onDrop: i ? (T) => {
1435
- T.preventDefault(), $(null), E(null);
1534
+ style: { overflowY: "auto", ...g },
1535
+ onDragOver: c ? (L) => L.preventDefault() : void 0,
1536
+ onDrop: c ? (L) => {
1537
+ L.preventDefault(), D(null), E(null);
1436
1538
  } : void 0,
1437
- children: b.map((T) => de(T))
1539
+ children: b.map((L) => ce(L))
1438
1540
  }
1439
1541
  );
1440
1542
  }
1441
- function Ht({ total: r, pageSize: l = 10, page: d, onChange: i, style: f }) {
1442
- const [s, u] = D(d || 1), n = Math.ceil(r / l);
1543
+ function jt({ total: n, pageSize: l = 10, page: d, onChange: c, style: f }) {
1544
+ const [s, h] = I(d || 1), i = Math.ceil(n / l);
1443
1545
  H(O, []);
1444
- const x = (p) => {
1445
- const z = Math.min(Math.max(1, p), n);
1446
- u(z), i == null || i(z);
1546
+ const g = (r) => {
1547
+ const v = Math.min(Math.max(1, r), i);
1548
+ h(v), c == null || c(v);
1447
1549
  }, b = oe(() => {
1448
- const p = [];
1449
- for (let h = Math.max(1, s - 2); h <= Math.min(n, s + 2); h++) p.push(h);
1450
- return p[0] > 1 && (p[0] > 2 && p.unshift("..."), p.unshift(1)), p[p.length - 1] < n && (p[p.length - 1] < n - 1 && p.push("..."), p.push(n)), p;
1451
- }, [s, n]);
1452
- return /* @__PURE__ */ g("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 4, padding: "8px 12px", ...f }, children: [
1453
- /* @__PURE__ */ g("span", { style: { fontSize: 12, color: e.textSec, marginRight: 8 }, children: [
1550
+ const r = [];
1551
+ for (let u = Math.max(1, s - 2); u <= Math.min(i, s + 2); u++) r.push(u);
1552
+ return r[0] > 1 && (r[0] > 2 && r.unshift("..."), r.unshift(1)), r[r.length - 1] < i && (r[r.length - 1] < i - 1 && r.push("..."), r.push(i)), r;
1553
+ }, [s, i]);
1554
+ return /* @__PURE__ */ x("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 4, padding: "8px 12px", ...f }, children: [
1555
+ /* @__PURE__ */ x("span", { style: { fontSize: 12, color: e.textSec, marginRight: 8 }, children: [
1454
1556
  (s - 1) * l + 1,
1455
1557
  "–",
1456
- Math.min(s * l, r),
1558
+ Math.min(s * l, n),
1457
1559
  " of ",
1458
- r
1560
+ n
1459
1561
  ] }),
1460
- [["«", 1], ["‹", s - 1]].map(([p, z]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: s === 1, onClick: () => x(z), children: p }, p)),
1461
- b.map((p, z) => /* @__PURE__ */ t("button", { onClick: () => typeof p == "number" && x(p), className: `dhx dhx-btn ${p === s ? "dhx-btn-primary" : "dhx-btn-ghost"}`, style: { height: 30, minWidth: 30, padding: "0 8px", fontSize: 13 }, disabled: p === "...", children: p }, z)),
1462
- [["›", s + 1], ["»", n]].map(([p, z]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: s === n, onClick: () => x(z), children: p }, p))
1562
+ [["«", 1], ["‹", s - 1]].map(([r, v]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: s === 1, onClick: () => g(v), children: r }, r)),
1563
+ b.map((r, v) => /* @__PURE__ */ t("button", { onClick: () => typeof r == "number" && g(r), className: `dhx dhx-btn ${r === s ? "dhx-btn-primary" : "dhx-btn-ghost"}`, style: { height: 30, minWidth: 30, padding: "0 8px", fontSize: 13 }, disabled: r === "...", children: r }, v)),
1564
+ [["›", s + 1], ["»", i]].map(([r, v]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: s === i, onClick: () => g(v), children: r }, r))
1463
1565
  ] });
1464
1566
  }
1465
- function jt({ config: r = {}, defaultValues: l = {}, onSubmit: d, style: i }) {
1466
- const [f, s] = D(l), [u, n] = D({}), [x, b] = D(null);
1567
+ function Pt({ config: n = {}, defaultValues: l = {}, onSubmit: d, style: c }) {
1568
+ const [f, s] = I(l), [h, i] = I({}), [g, b] = I(null);
1467
1569
  H(O, []);
1468
- const p = (o, k) => {
1469
- s((w) => ({ ...w, [o]: k })), n((w) => ({ ...w, [o]: null }));
1470
- }, z = () => {
1570
+ const r = (o, m) => {
1571
+ s((z) => ({ ...z, [o]: m })), i((z) => ({ ...z, [o]: null }));
1572
+ }, v = () => {
1471
1573
  const o = {};
1472
- return (r.rows || []).flat().forEach((k) => {
1473
- k && typeof k == "object" && "name" in k && k.required && !f[k.name] && (o[k.name] = `${k.label || k.name} is required`);
1474
- }), n(o), Object.keys(o).length === 0;
1475
- }, h = (o) => {
1476
- const k = f[o.name] ?? o.value ?? "", w = u[o.name], C = o.labelWidth ?? r.labelWidth, N = C !== void 0 || o.labelPosition === "left";
1477
- if (o.type === "fieldset") return /* @__PURE__ */ g("fieldset", { style: { border: `1px solid ${e.border}`, borderRadius: e.r, padding: "12px 16px", marginBottom: 14 }, children: [
1574
+ return (n.rows || []).flat().forEach((m) => {
1575
+ m && typeof m == "object" && "name" in m && m.required && !f[m.name] && (o[m.name] = `${m.label || m.name} is required`);
1576
+ }), i(o), Object.keys(o).length === 0;
1577
+ }, u = (o) => {
1578
+ const m = f[o.name] ?? o.value ?? "", z = h[o.name], $ = o.labelWidth ?? n.labelWidth, C = $ !== void 0 || o.labelPosition === "left";
1579
+ if (o.type === "fieldset") return /* @__PURE__ */ x("fieldset", { style: { border: `1px solid ${e.border}`, borderRadius: e.r, padding: "12px 16px", marginBottom: 14 }, children: [
1478
1580
  /* @__PURE__ */ t("legend", { style: { fontSize: 12, fontWeight: 700, color: e.textSec, padding: "0 6px" }, children: o.label }),
1479
- (o.rows || []).map((v) => h(v))
1581
+ (o.rows || []).map((S) => u(S))
1480
1582
  ] }, o.name);
1481
1583
  if (o.type === "spacer") return /* @__PURE__ */ t("div", { style: { height: o.height || 16 } }, o.name);
1482
- const L = C ? { minWidth: C, width: C, flexShrink: 0, paddingTop: 8, boxSizing: "border-box" } : {}, c = o.label ? /* @__PURE__ */ g("label", { className: "dhx dhx-label", style: { display: "flex", gap: 4, ...L }, children: [
1584
+ const N = $ ? { minWidth: $, width: $, flexShrink: 0, paddingTop: 8, boxSizing: "border-box" } : {}, p = o.label ? /* @__PURE__ */ x("label", { className: "dhx dhx-label", style: { display: "flex", gap: 4, ...N }, children: [
1483
1585
  o.label,
1484
1586
  o.required && /* @__PURE__ */ t("span", { style: { color: e.danger }, children: "*" })
1485
- ] }, "lbl") : null, m = w ? /* @__PURE__ */ t("div", { style: { fontSize: 11, color: e.danger, marginTop: 3 }, children: w }) : null, E = o.helpMessage ? /* @__PURE__ */ g("div", { style: { fontSize: 11, color: e.textMut, marginTop: 3 }, children: [
1587
+ ] }, "lbl") : null, k = z ? /* @__PURE__ */ t("div", { style: { fontSize: 11, color: e.danger, marginTop: 3 }, children: z }) : null, E = o.helpMessage ? /* @__PURE__ */ x("div", { style: { fontSize: 11, color: e.textMut, marginTop: 3 }, children: [
1486
1588
  "ⓘ ",
1487
1589
  o.helpMessage
1488
- ] }) : null, a = { key: o.name, className: "dhx-form-group" }, $ = (v) => N ? /* @__PURE__ */ g("div", { ...a, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1489
- c,
1490
- /* @__PURE__ */ g("div", { style: { flex: 1, minWidth: 0 }, children: [
1491
- v,
1492
- m,
1590
+ ] }) : null, a = { key: o.name, className: "dhx-form-group" }, D = (S) => C ? /* @__PURE__ */ x("div", { ...a, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1591
+ p,
1592
+ /* @__PURE__ */ x("div", { style: { flex: 1, minWidth: 0 }, children: [
1593
+ S,
1594
+ k,
1493
1595
  E
1494
1596
  ] })
1495
- ] }) : /* @__PURE__ */ g("div", { ...a, children: [
1496
- c,
1497
- v,
1498
- m,
1597
+ ] }) : /* @__PURE__ */ x("div", { ...a, children: [
1598
+ p,
1599
+ S,
1600
+ k,
1499
1601
  E
1500
1602
  ] });
1501
- if (!o.type || o.type === "input") return $(
1502
- /* @__PURE__ */ g("div", { className: "dhx-input-wrap", children: [
1603
+ if (!o.type || o.type === "input") return D(
1604
+ /* @__PURE__ */ x("div", { className: "dhx-input-wrap", children: [
1503
1605
  o.icon && /* @__PURE__ */ t("span", { className: "dhx-input-icon", children: o.icon }),
1504
1606
  /* @__PURE__ */ t(
1505
1607
  "input",
1506
1608
  {
1507
1609
  className: `dhx dhx-input${o.icon ? " dhx-input--with-icon" : ""}`,
1508
- style: { borderColor: w ? e.danger : void 0 },
1610
+ style: { borderColor: z ? e.danger : void 0 },
1509
1611
  type: o.inputType || "text",
1510
1612
  placeholder: o.placeholder,
1511
- value: k,
1512
- onChange: (v) => p(o.name, v.target.value),
1613
+ value: m,
1614
+ onChange: (S) => r(o.name, S.target.value),
1513
1615
  disabled: o.disabled
1514
1616
  }
1515
1617
  )
1516
1618
  ] })
1517
1619
  );
1518
- if (o.type === "textarea") return $(
1620
+ if (o.type === "textarea") return D(
1519
1621
  /* @__PURE__ */ t(
1520
1622
  "textarea",
1521
1623
  {
1522
1624
  className: "dhx dhx-input",
1523
1625
  style: { height: 80, resize: "vertical", padding: "8px 10px" },
1524
1626
  placeholder: o.placeholder,
1525
- value: k,
1526
- onChange: (v) => p(o.name, v.target.value)
1627
+ value: m,
1628
+ onChange: (S) => r(o.name, S.target.value)
1527
1629
  }
1528
1630
  )
1529
1631
  );
1530
- if (o.type === "select") return $(
1531
- /* @__PURE__ */ g("select", { className: "dhx dhx-input", value: k, onChange: (v) => p(o.name, v.target.value), style: { cursor: "pointer" }, children: [
1632
+ if (o.type === "select") return D(
1633
+ /* @__PURE__ */ x("select", { className: "dhx dhx-input", value: m, onChange: (S) => r(o.name, S.target.value), style: { cursor: "pointer" }, children: [
1532
1634
  /* @__PURE__ */ t("option", { value: "", children: "— Select —" }),
1533
- (o.options || []).map((v) => /* @__PURE__ */ t("option", { value: v.value, children: v.label || v.value }, v.value))
1635
+ (o.options || []).map((S) => /* @__PURE__ */ t("option", { value: S.value, children: S.label || S.value }, S.value))
1534
1636
  ] })
1535
1637
  );
1536
- if (o.type === "datepicker") return $(
1537
- /* @__PURE__ */ t("input", { type: "date", className: "dhx dhx-input", value: k, onChange: (v) => p(o.name, v.target.value) })
1638
+ if (o.type === "datepicker") return D(
1639
+ /* @__PURE__ */ t("input", { type: "date", className: "dhx dhx-input", value: m, onChange: (S) => r(o.name, S.target.value) })
1538
1640
  );
1539
1641
  if (o.type === "timepicker") {
1540
- const v = f[o.name] ?? { h: 12, m: 0, ampm: "AM" }, A = !!f[o.name], F = A ? `${String(v.h).padStart(2, "0")}:${String(v.m).padStart(2, "0")}${v.ampm ? " " + v.ampm : ""}` : o.placeholder || "Click to select", U = /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
1541
- /* @__PURE__ */ g(
1642
+ const S = f[o.name] ?? { h: 12, m: 0, ampm: "AM" }, A = !!f[o.name], F = A ? `${String(S.h).padStart(2, "0")}:${String(S.m).padStart(2, "0")}${S.ampm ? " " + S.ampm : ""}` : o.placeholder || "Click to select", U = /* @__PURE__ */ x("div", { style: { position: "relative" }, children: [
1643
+ /* @__PURE__ */ x(
1542
1644
  "div",
1543
1645
  {
1544
1646
  className: "dhx dhx-input",
1545
1647
  style: { cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "space-between" },
1546
- onClick: () => b(x === o.name ? null : o.name),
1648
+ onClick: () => b(g === o.name ? null : o.name),
1547
1649
  children: [
1548
1650
  /* @__PURE__ */ t("span", { style: { color: A ? e.text : e.textMut }, children: F }),
1549
1651
  /* @__PURE__ */ t("span", { style: { fontSize: 13, color: e.textSec }, children: "🕐" })
1550
1652
  ]
1551
1653
  }
1552
1654
  ),
1553
- x === o.name && /* @__PURE__ */ t("div", { style: { position: "absolute", zIndex: 100, top: "calc(100% + 4px)", left: 0 }, children: /* @__PURE__ */ t(pt, { value: v, controls: !0, onChange: (Q) => {
1554
- p(o.name, Q), b(null);
1655
+ g === o.name && /* @__PURE__ */ t("div", { style: { position: "absolute", zIndex: 100, top: "calc(100% + 4px)", left: 0 }, children: /* @__PURE__ */ t(ht, { value: S, controls: !0, onChange: (Q) => {
1656
+ r(o.name, Q), b(null);
1555
1657
  } }) })
1556
1658
  ] });
1557
- return $(U);
1659
+ return D(U);
1558
1660
  }
1559
- if (o.type === "colorpicker") return $(
1560
- /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1661
+ if (o.type === "colorpicker") return D(
1662
+ /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1561
1663
  /* @__PURE__ */ t(
1562
1664
  "input",
1563
1665
  {
1564
1666
  type: "color",
1565
- value: k || "#000000",
1566
- onChange: (v) => p(o.name, v.target.value),
1667
+ value: m || "#000000",
1668
+ onChange: (S) => r(o.name, S.target.value),
1567
1669
  style: { width: 36, height: 36, padding: 2, border: `1px solid ${e.border}`, borderRadius: e.r, cursor: "pointer", background: "none" }
1568
1670
  }
1569
1671
  ),
1570
- /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontFamily: "monospace" }, children: k || "#000000" })
1672
+ /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontFamily: "monospace" }, children: m || "#000000" })
1571
1673
  ] })
1572
1674
  );
1573
- if (o.type === "text") return $(
1675
+ if (o.type === "text") return D(
1574
1676
  /* @__PURE__ */ t("p", { style: { margin: "6px 0", fontSize: 13, color: e.text }, children: o.value })
1575
1677
  );
1576
- if (o.type === "checkbox") return /* @__PURE__ */ g("div", { ...a, children: [
1577
- N ? /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1578
- C && /* @__PURE__ */ t("div", { style: { width: C, flexShrink: 0 } }),
1579
- /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
1580
- /* @__PURE__ */ t("input", { type: "checkbox", checked: !!k, onChange: (v) => p(o.name, v.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
1678
+ if (o.type === "checkbox") return /* @__PURE__ */ x("div", { ...a, children: [
1679
+ C ? /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1680
+ $ && /* @__PURE__ */ t("div", { style: { width: $, flexShrink: 0 } }),
1681
+ /* @__PURE__ */ x("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
1682
+ /* @__PURE__ */ t("input", { type: "checkbox", checked: !!m, onChange: (S) => r(o.name, S.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
1581
1683
  /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: o.label })
1582
1684
  ] })
1583
- ] }) : /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
1584
- /* @__PURE__ */ t("input", { type: "checkbox", checked: !!k, onChange: (v) => p(o.name, v.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
1685
+ ] }) : /* @__PURE__ */ x("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
1686
+ /* @__PURE__ */ t("input", { type: "checkbox", checked: !!m, onChange: (S) => r(o.name, S.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
1585
1687
  /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: o.label })
1586
1688
  ] }),
1587
1689
  E
1588
1690
  ] });
1589
1691
  if (o.type === "radio") {
1590
- const v = (o.options || []).map((A) => /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer", fontSize: 13 }, children: [
1692
+ const S = (o.options || []).map((A) => /* @__PURE__ */ x("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer", fontSize: 13 }, children: [
1591
1693
  /* @__PURE__ */ t(
1592
1694
  "input",
1593
1695
  {
1594
1696
  type: "radio",
1595
1697
  name: o.name,
1596
1698
  value: A.value,
1597
- checked: k === A.value,
1598
- onChange: () => p(o.name, A.value),
1699
+ checked: m === A.value,
1700
+ onChange: () => r(o.name, A.value),
1599
1701
  style: { accentColor: e.primary, cursor: "pointer" }
1600
1702
  }
1601
1703
  ),
1602
1704
  A.label || A.value
1603
1705
  ] }, A.value));
1604
- return $(
1605
- /* @__PURE__ */ t("div", { style: { display: "flex", gap: 16, flexWrap: "wrap", paddingTop: 8 }, children: v })
1706
+ return D(
1707
+ /* @__PURE__ */ t("div", { style: { display: "flex", gap: 16, flexWrap: "wrap", paddingTop: 8 }, children: S })
1606
1708
  );
1607
1709
  }
1608
- if (o.type === "slider") return N ? /* @__PURE__ */ g("div", { ...a, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1609
- c,
1610
- /* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
1710
+ if (o.type === "slider") return C ? /* @__PURE__ */ x("div", { ...a, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1711
+ p,
1712
+ /* @__PURE__ */ x("div", { style: { flex: 1 }, children: [
1611
1713
  /* @__PURE__ */ t(
1612
- Me,
1714
+ $e,
1613
1715
  {
1614
1716
  min: o.min,
1615
1717
  max: o.max,
1616
1718
  step: o.step,
1617
- value: k || o.min,
1719
+ value: m || o.min,
1618
1720
  range: o.range,
1619
- onChange: (v) => p(o.name, v)
1721
+ onChange: (S) => r(o.name, S)
1620
1722
  }
1621
1723
  ),
1622
1724
  E
1623
1725
  ] })
1624
- ] }) : /* @__PURE__ */ g("div", { ...a, children: [
1726
+ ] }) : /* @__PURE__ */ x("div", { ...a, children: [
1625
1727
  /* @__PURE__ */ t(
1626
- Me,
1728
+ $e,
1627
1729
  {
1628
1730
  label: o.label,
1629
1731
  min: o.min,
1630
1732
  max: o.max,
1631
1733
  step: o.step,
1632
- value: k || o.min,
1734
+ value: m || o.min,
1633
1735
  range: o.range,
1634
- onChange: (v) => p(o.name, v)
1736
+ onChange: (S) => r(o.name, S)
1635
1737
  }
1636
1738
  ),
1637
1739
  E
1638
1740
  ] });
1639
- if (o.type === "combo") return N ? /* @__PURE__ */ g("div", { ...a, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1640
- c,
1641
- /* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
1741
+ if (o.type === "combo") return C ? /* @__PURE__ */ x("div", { ...a, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1742
+ p,
1743
+ /* @__PURE__ */ x("div", { style: { flex: 1 }, children: [
1642
1744
  /* @__PURE__ */ t(
1643
- ze,
1745
+ Me,
1644
1746
  {
1645
1747
  data: o.data || [],
1646
1748
  multiselection: o.multiselection,
1647
1749
  placeholder: o.placeholder || "Select...",
1648
- value: k || (o.multiselection ? [] : null),
1649
- onChange: (v) => p(o.name, v)
1750
+ value: m || (o.multiselection ? [] : null),
1751
+ onChange: (S) => r(o.name, S)
1650
1752
  }
1651
1753
  ),
1652
- m,
1754
+ k,
1653
1755
  E
1654
1756
  ] })
1655
- ] }) : /* @__PURE__ */ g("div", { ...a, children: [
1757
+ ] }) : /* @__PURE__ */ x("div", { ...a, children: [
1656
1758
  /* @__PURE__ */ t(
1657
- ze,
1759
+ Me,
1658
1760
  {
1659
1761
  label: o.label,
1660
1762
  data: o.data || [],
1661
1763
  multiselection: o.multiselection,
1662
1764
  placeholder: o.placeholder || "Select...",
1663
- value: k || (o.multiselection ? [] : null),
1664
- onChange: (v) => p(o.name, v)
1765
+ value: m || (o.multiselection ? [] : null),
1766
+ onChange: (S) => r(o.name, S)
1665
1767
  }
1666
1768
  ),
1667
- m,
1769
+ k,
1668
1770
  E
1669
1771
  ] });
1670
1772
  if (o.type === "toggle") {
1671
- const v = !!k, A = v ? o.icon : o.offIcon || o.icon, F = v ? o.text || o.label : o.offText || o.text || o.label;
1672
- return /* @__PURE__ */ g("div", { ...a, children: [
1673
- N && C && /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1674
- /* @__PURE__ */ t("div", { style: { width: C, flexShrink: 0 } }),
1675
- /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
1676
- /* @__PURE__ */ t(Ce, { on: v, onClick: () => p(o.name, !k) }),
1773
+ const S = !!m, A = S ? o.icon : o.offIcon || o.icon, F = S ? o.text || o.label : o.offText || o.text || o.label;
1774
+ return /* @__PURE__ */ x("div", { ...a, children: [
1775
+ C && $ && /* @__PURE__ */ x("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1776
+ /* @__PURE__ */ t("div", { style: { width: $, flexShrink: 0 } }),
1777
+ /* @__PURE__ */ x("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
1778
+ /* @__PURE__ */ t(Ie, { on: S, onClick: () => r(o.name, !m) }),
1677
1779
  A && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: A }),
1678
1780
  F && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: F })
1679
1781
  ] })
1680
1782
  ] }),
1681
- !N && /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 10, cursor: "pointer" }, children: [
1682
- /* @__PURE__ */ t(Ce, { on: v, onClick: () => p(o.name, !k) }),
1783
+ !C && /* @__PURE__ */ x("label", { style: { display: "flex", alignItems: "center", gap: 10, cursor: "pointer" }, children: [
1784
+ /* @__PURE__ */ t(Ie, { on: S, onClick: () => r(o.name, !m) }),
1683
1785
  A && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: A }),
1684
1786
  F && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: F })
1685
1787
  ] }),
@@ -1688,83 +1790,83 @@ function jt({ config: r = {}, defaultValues: l = {}, onSubmit: d, style: i }) {
1688
1790
  }
1689
1791
  return null;
1690
1792
  }, y = (o) => o.map(
1691
- (k, w) => Array.isArray(k) ? /* @__PURE__ */ t("div", { style: { display: "flex", gap: 12, alignItems: "flex-start" }, children: k.map(h) }, w) : h(k)
1793
+ (m, z) => Array.isArray(m) ? /* @__PURE__ */ t("div", { style: { display: "flex", gap: 12, alignItems: "flex-start" }, children: m.map(u) }, z) : u(m)
1692
1794
  );
1693
- return /* @__PURE__ */ g("div", { className: "dhx", style: { padding: r.padding || 0, width: r.width || "100%", ...i }, children: [
1694
- y(r.rows || []),
1695
- (r.buttons || d) && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, justifyContent: r.buttonAlign || "flex-start", marginTop: 8 }, children: [
1696
- /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => z() && (d == null ? void 0 : d(f)), children: r.submitText || "Submit" }),
1697
- r.resetButton !== !1 && /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => {
1698
- s(l), n({});
1699
- }, children: r.resetText || "Reset" })
1795
+ return /* @__PURE__ */ x("div", { className: "dhx", style: { padding: n.padding || 0, width: n.width || "100%", ...c }, children: [
1796
+ y(n.rows || []),
1797
+ (n.buttons || d) && /* @__PURE__ */ x("div", { style: { display: "flex", gap: 8, justifyContent: n.buttonAlign || "flex-start", marginTop: 8 }, children: [
1798
+ /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => v() && (d == null ? void 0 : d(f)), children: n.submitText || "Submit" }),
1799
+ n.resetButton !== !1 && /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => {
1800
+ s(l), i({});
1801
+ }, children: n.resetText || "Reset" })
1700
1802
  ] })
1701
1803
  ] });
1702
1804
  }
1703
- function Ce({ on: r, onClick: l }) {
1704
- return /* @__PURE__ */ g("div", { style: { position: "relative", width: 40, height: 22, flexShrink: 0 }, onClick: l, children: [
1705
- /* @__PURE__ */ t("div", { style: { width: 40, height: 22, borderRadius: 11, background: r ? e.primary : e.border, transition: "background 0.2s" } }),
1706
- /* @__PURE__ */ t("div", { style: { position: "absolute", top: 3, left: r ? 21 : 3, width: 16, height: 16, borderRadius: "50%", background: "#fff", transition: "left 0.2s", boxShadow: "0 1px 3px rgba(0,0,0,.3)" } })
1805
+ function Ie({ on: n, onClick: l }) {
1806
+ return /* @__PURE__ */ x("div", { style: { position: "relative", width: 40, height: 22, flexShrink: 0 }, onClick: l, children: [
1807
+ /* @__PURE__ */ t("div", { style: { width: 40, height: 22, borderRadius: 11, background: n ? e.primary : e.border, transition: "background 0.2s" } }),
1808
+ /* @__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)" } })
1707
1809
  ] });
1708
1810
  }
1709
- function Ne(r) {
1811
+ function Le(n) {
1710
1812
  const l = [];
1711
- for (const d of r)
1813
+ for (const d of n)
1712
1814
  "type" in d && d.type === "block" ? l.push(...d.items || []) : l.push(d);
1713
1815
  return l;
1714
1816
  }
1715
- function Pt({ items: r = [], onAction: l, style: d }) {
1817
+ function Ot({ items: n = [], onAction: l, style: d }) {
1716
1818
  H(O, []);
1717
- const [i, f] = D(() => {
1718
- const n = {};
1719
- for (const x of Ne(r))
1720
- x.id && (n[x.id] = !!x.active);
1721
- return n;
1722
- }), s = (n) => {
1723
- var x;
1724
- if (n.id)
1725
- if (n.group) {
1726
- const b = Ne(r).filter((p) => p.group === n.group && p.id);
1727
- f((p) => {
1728
- const z = { ...p };
1729
- for (const h of b) z[h.id] = !1;
1730
- return z[n.id] = !0, z;
1819
+ const [c, f] = I(() => {
1820
+ const i = {};
1821
+ for (const g of Le(n))
1822
+ g.id && (i[g.id] = !!g.active);
1823
+ return i;
1824
+ }), s = (i) => {
1825
+ var g;
1826
+ if (i.id)
1827
+ if (i.group) {
1828
+ const b = Le(n).filter((r) => r.group === i.group && r.id);
1829
+ f((r) => {
1830
+ const v = { ...r };
1831
+ for (const u of b) v[u.id] = !1;
1832
+ return v[i.id] = !0, v;
1731
1833
  });
1732
- } else n.twoState && f((b) => ({ ...b, [n.id]: !b[n.id] }));
1733
- (x = n.onClick) == null || x.call(n, n), n.id && (l == null || l(n.id, n));
1734
- }, u = (n, x) => {
1735
- var z, h;
1736
- if ("type" in n && (n.type === "separator" || n.type === "sep"))
1737
- return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "8px 4px", alignSelf: "stretch" } }, x);
1738
- if ("type" in n && n.type === "input") {
1739
- const y = n;
1740
- return /* @__PURE__ */ g("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: "4px 6px", gap: 4 }, children: [
1834
+ } else i.twoState && f((b) => ({ ...b, [i.id]: !b[i.id] }));
1835
+ (g = i.onClick) == null || g.call(i, i), i.id && (l == null || l(i.id, i));
1836
+ }, h = (i, g) => {
1837
+ var v, u;
1838
+ if ("type" in i && (i.type === "separator" || i.type === "sep"))
1839
+ return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "8px 4px", alignSelf: "stretch" } }, g);
1840
+ if ("type" in i && i.type === "input") {
1841
+ const y = i;
1842
+ return /* @__PURE__ */ x("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: "4px 6px", gap: 4 }, children: [
1741
1843
  y.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: y.label }),
1742
1844
  /* @__PURE__ */ t("input", { className: "dhx dhx-input", style: { width: y.width || 110, height: 26, fontSize: 12 }, placeholder: y.placeholder, defaultValue: y.value, onChange: (o) => {
1743
- var k;
1744
- return (k = y.onChange) == null ? void 0 : k.call(y, o.target.value);
1845
+ var m;
1846
+ return (m = y.onChange) == null ? void 0 : m.call(y, o.target.value);
1745
1847
  } })
1746
- ] }, x);
1848
+ ] }, g);
1747
1849
  }
1748
- if ("type" in n && n.type === "block") {
1749
- const y = n;
1750
- return /* @__PURE__ */ g("div", { style: { display: "flex", flexDirection: y.direction === "col" ? "column" : "row", alignItems: "center", gap: 4, padding: "4px 8px", borderRight: `1px solid ${e.border}`, minHeight: 64 }, children: [
1751
- /* @__PURE__ */ t("div", { style: { display: "flex", gap: 2 }, children: (z = y.items) == null ? void 0 : z.map((o, k) => u(o, k)) }),
1850
+ if ("type" in i && i.type === "block") {
1851
+ const y = i;
1852
+ return /* @__PURE__ */ x("div", { style: { display: "flex", flexDirection: y.direction === "col" ? "column" : "row", alignItems: "center", gap: 4, padding: "4px 8px", borderRight: `1px solid ${e.border}`, minHeight: 64 }, children: [
1853
+ /* @__PURE__ */ t("div", { style: { display: "flex", gap: 2 }, children: (v = y.items) == null ? void 0 : v.map((o, m) => h(o, m)) }),
1752
1854
  y.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut, marginTop: 2 }, children: y.label })
1753
- ] }, x);
1855
+ ] }, g);
1754
1856
  }
1755
- if ("type" in n && n.type === "selectButton") {
1756
- const y = n;
1857
+ if ("type" in i && i.type === "selectButton") {
1858
+ const y = i;
1757
1859
  return /* @__PURE__ */ t("select", { className: "dhx dhx-input", style: { height: 28, fontSize: 12, cursor: "pointer", margin: 2 }, defaultValue: y.value, onChange: (o) => {
1758
- var k;
1759
- return (k = y.onChange) == null ? void 0 : k.call(y, o.target.value);
1760
- }, children: (h = y.items) == null ? void 0 : h.map((o) => /* @__PURE__ */ t("option", { value: o.value, children: o.value }, o.value)) }, x);
1860
+ var m;
1861
+ return (m = y.onChange) == null ? void 0 : m.call(y, o.target.value);
1862
+ }, children: (u = y.items) == null ? void 0 : u.map((o) => /* @__PURE__ */ t("option", { value: o.value, children: o.value }, o.value)) }, g);
1761
1863
  }
1762
- const b = n, p = b.id !== void 0 ? i[b.id] ?? !!b.active : !!b.active;
1763
- return /* @__PURE__ */ g(
1864
+ const b = i, r = b.id !== void 0 ? c[b.id] ?? !!b.active : !!b.active;
1865
+ return /* @__PURE__ */ x(
1764
1866
  "button",
1765
1867
  {
1766
1868
  title: b.tooltip,
1767
- className: `dhx dhx-btn ${p ? "dhx-btn-primary" : "dhx-btn-ghost"}`,
1869
+ className: `dhx dhx-btn ${r ? "dhx-btn-primary" : "dhx-btn-ghost"}`,
1768
1870
  style: { flexDirection: "column", minHeight: 48, padding: "4px 8px", gap: 4, fontSize: 12 },
1769
1871
  disabled: b.disabled,
1770
1872
  onClick: () => s(b),
@@ -1773,12 +1875,12 @@ function Pt({ items: r = [], onAction: l, style: d }) {
1773
1875
  b.text && /* @__PURE__ */ t("span", { style: { fontSize: 10, maxWidth: 60, textAlign: "center", lineHeight: 1.2, whiteSpace: "normal" }, children: b.text })
1774
1876
  ]
1775
1877
  },
1776
- x
1878
+ g
1777
1879
  );
1778
1880
  };
1779
- return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", alignItems: "stretch", background: e.bg, borderBottom: `1px solid ${e.border}`, padding: "4px 0", overflowX: "auto", gap: 0, ...d }, children: r.map(u) });
1881
+ return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", alignItems: "stretch", background: e.bg, borderBottom: `1px solid ${e.border}`, padding: "4px 0", overflowX: "auto", gap: 0, ...d }, children: n.map(h) });
1780
1882
  }
1781
- function Te({ count: r }) {
1883
+ function Ne({ count: n }) {
1782
1884
  return /* @__PURE__ */ t("span", { style: {
1783
1885
  position: "absolute",
1784
1886
  top: 3,
@@ -1796,55 +1898,55 @@ function Te({ count: r }) {
1796
1898
  padding: "0 3px",
1797
1899
  lineHeight: 1,
1798
1900
  pointerEvents: "none"
1799
- }, children: r });
1901
+ }, children: n });
1800
1902
  }
1801
- function Ot({ logo: r, items: l = [], vertical: d = !1, onAction: i, style: f }) {
1802
- const [s, u] = D(null), [n, x] = D(() => {
1803
- const h = {};
1903
+ function Yt({ logo: n, items: l = [], vertical: d = !1, onAction: c, style: f }) {
1904
+ const [s, h] = I(null), [i, g] = I(() => {
1905
+ const u = {};
1804
1906
  return l.forEach((y) => {
1805
- y.id && y.twoState && y.active && (h[y.id] = !0);
1806
- }), h;
1907
+ y.id && y.twoState && y.active && (u[y.id] = !0);
1908
+ }), u;
1807
1909
  }), b = q(null);
1808
- H(O, []), se(b, J(() => u(null), []));
1809
- const p = (h, y) => {
1810
- var o, k;
1811
- if (!h.disabled) {
1812
- if (h.twoState && h.id && x((w) => ({ ...w, [h.id]: !w[h.id] })), (o = h.items) != null && o.length) {
1813
- u((w) => w === y ? null : y);
1910
+ H(O, []), ie(b, G(() => h(null), []));
1911
+ const r = (u, y) => {
1912
+ var o, m;
1913
+ if (!u.disabled) {
1914
+ if (u.twoState && u.id && g((z) => ({ ...z, [u.id]: !z[u.id] })), (o = u.items) != null && o.length) {
1915
+ h((z) => z === y ? null : y);
1814
1916
  return;
1815
1917
  }
1816
- (k = h.onClick) == null || k.call(h, h.id || ""), i == null || i(h.id || "");
1918
+ (m = u.onClick) == null || m.call(u, u.id || ""), c == null || c(u.id || "");
1817
1919
  }
1818
- }, z = (h, y) => {
1819
- var C;
1820
- if (h.hidden) return null;
1821
- if (h.type === "separator") return /* @__PURE__ */ t("div", { style: {
1920
+ }, v = (u, y) => {
1921
+ var $;
1922
+ if (u.hidden) return null;
1923
+ if (u.type === "separator") return /* @__PURE__ */ t("div", { style: {
1822
1924
  [d ? "height" : "width"]: 1,
1823
1925
  background: e.border,
1824
1926
  margin: d ? "4px 8px" : "0 6px",
1825
1927
  alignSelf: "stretch"
1826
1928
  } }, y);
1827
- if (h.type === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, y);
1828
- if (h.type === "input") return /* @__PURE__ */ g("div", { style: { position: "relative", display: "flex", alignItems: "center", margin: "0 4px" }, children: [
1829
- h.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 8, color: e.textMut, fontSize: 15, pointerEvents: "none", zIndex: 1 }, children: h.icon }),
1929
+ if (u.type === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, y);
1930
+ if (u.type === "input") return /* @__PURE__ */ x("div", { style: { position: "relative", display: "flex", alignItems: "center", margin: "0 4px" }, children: [
1931
+ u.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 8, color: e.textMut, fontSize: 15, pointerEvents: "none", zIndex: 1 }, children: u.icon }),
1830
1932
  /* @__PURE__ */ t(
1831
1933
  "input",
1832
1934
  {
1833
1935
  className: "dhx dhx-input",
1834
- style: { width: h.width || 200, height: 28, paddingLeft: h.icon ? 30 : void 0 },
1835
- placeholder: h.placeholder,
1836
- onChange: (N) => {
1837
- var L;
1838
- return (L = h.onChange) == null ? void 0 : L.call(h, N.target.value);
1936
+ style: { width: u.width || 200, height: 28, paddingLeft: u.icon ? 30 : void 0 },
1937
+ placeholder: u.placeholder,
1938
+ onChange: (C) => {
1939
+ var N;
1940
+ return (N = u.onChange) == null ? void 0 : N.call(u, C.target.value);
1839
1941
  }
1840
1942
  }
1841
1943
  )
1842
1944
  ] }, y);
1843
- if (h.type === "imageButton") return /* @__PURE__ */ g(
1945
+ if (u.type === "imageButton") return /* @__PURE__ */ x(
1844
1946
  "button",
1845
1947
  {
1846
- title: h.tooltip,
1847
- disabled: h.disabled,
1948
+ title: u.tooltip,
1949
+ disabled: u.disabled,
1848
1950
  style: {
1849
1951
  position: "relative",
1850
1952
  width: 36,
@@ -1853,26 +1955,26 @@ function Ot({ logo: r, items: l = [], vertical: d = !1, onAction: i, style: f })
1853
1955
  border: "none",
1854
1956
  borderRadius: "50%",
1855
1957
  overflow: "hidden",
1856
- cursor: h.disabled ? "not-allowed" : "pointer",
1958
+ cursor: u.disabled ? "not-allowed" : "pointer",
1857
1959
  background: "transparent",
1858
1960
  flexShrink: 0
1859
1961
  },
1860
- onClick: () => p(h, y),
1962
+ onClick: () => r(u, y),
1861
1963
  children: [
1862
- h.src && /* @__PURE__ */ t("img", { src: h.src, alt: h.value || "", style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "50%" } }),
1863
- h.count !== void 0 && /* @__PURE__ */ t(Te, { count: h.count })
1964
+ u.src && /* @__PURE__ */ t("img", { src: u.src, alt: u.value || "", style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "50%" } }),
1965
+ u.count !== void 0 && /* @__PURE__ */ t(Ne, { count: u.count })
1864
1966
  ]
1865
1967
  },
1866
1968
  y
1867
1969
  );
1868
- const o = !!(h.twoState && h.id && n[h.id]), k = !!((C = h.items) != null && C.length), w = {
1970
+ const o = !!(u.twoState && u.id && i[u.id]), m = !!(($ = u.items) != null && $.length), z = {
1869
1971
  position: "relative",
1870
1972
  height: d ? 40 : 36,
1871
1973
  gap: 6,
1872
1974
  background: o ? e.primaryLt : "transparent",
1873
- color: o ? e.primary : h.disabled ? e.textMut : e.text,
1874
- opacity: h.disabled ? 0.55 : 1,
1875
- cursor: h.disabled ? "not-allowed" : "pointer",
1975
+ color: o ? e.primary : u.disabled ? e.textMut : e.text,
1976
+ opacity: u.disabled ? 0.55 : 1,
1977
+ cursor: u.disabled ? "not-allowed" : "pointer",
1876
1978
  ...d ? {
1877
1979
  width: "100%",
1878
1980
  justifyContent: "flex-start",
@@ -1880,34 +1982,34 @@ function Ot({ logo: r, items: l = [], vertical: d = !1, onAction: i, style: f })
1880
1982
  borderRadius: 0
1881
1983
  } : {}
1882
1984
  };
1883
- return /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
1884
- /* @__PURE__ */ g(
1985
+ return /* @__PURE__ */ x("div", { style: { position: "relative" }, children: [
1986
+ /* @__PURE__ */ x(
1885
1987
  "button",
1886
1988
  {
1887
1989
  className: "dhx dhx-btn dhx-btn-ghost",
1888
- title: h.tooltip,
1889
- disabled: h.disabled,
1890
- style: w,
1891
- onClick: () => p(h, y),
1990
+ title: u.tooltip,
1991
+ disabled: u.disabled,
1992
+ style: z,
1993
+ onClick: () => r(u, y),
1892
1994
  children: [
1893
- h.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16, flexShrink: 0 }, children: h.icon }),
1894
- h.value && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: h.value }),
1895
- k && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
1896
- h.count !== void 0 && /* @__PURE__ */ t(Te, { count: h.count })
1995
+ u.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16, flexShrink: 0 }, children: u.icon }),
1996
+ u.value && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: u.value }),
1997
+ m && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
1998
+ u.count !== void 0 && /* @__PURE__ */ t(Ne, { count: u.count })
1897
1999
  ]
1898
2000
  }
1899
2001
  ),
1900
- k && s === y && /* @__PURE__ */ t(
1901
- he,
2002
+ m && s === y && /* @__PURE__ */ t(
2003
+ ae,
1902
2004
  {
1903
- items: h.items,
1904
- onSelect: () => u(null),
2005
+ items: u.items,
2006
+ onSelect: () => h(null),
1905
2007
  style: d ? { left: "100%", top: 0 } : { top: "100%" }
1906
2008
  }
1907
2009
  )
1908
2010
  ] }, y);
1909
2011
  };
1910
- return /* @__PURE__ */ g(
2012
+ return /* @__PURE__ */ x(
1911
2013
  "nav",
1912
2014
  {
1913
2015
  ref: b,
@@ -1925,7 +2027,7 @@ function Ot({ logo: r, items: l = [], vertical: d = !1, onAction: i, style: f })
1925
2027
  ...f
1926
2028
  },
1927
2029
  children: [
1928
- r && /* @__PURE__ */ t("div", { style: {
2030
+ n && /* @__PURE__ */ t("div", { style: {
1929
2031
  color: e.text,
1930
2032
  fontWeight: 800,
1931
2033
  fontSize: 16,
@@ -1935,42 +2037,42 @@ function Ot({ logo: r, items: l = [], vertical: d = !1, onAction: i, style: f })
1935
2037
  marginRight: d ? 0 : 8,
1936
2038
  marginBottom: d ? 4 : 0,
1937
2039
  flexShrink: 0
1938
- }, children: r }),
1939
- l.map(z)
2040
+ }, children: n }),
2041
+ l.map(v)
1940
2042
  ]
1941
2043
  }
1942
2044
  );
1943
2045
  }
1944
2046
  export {
1945
- kt as Button,
1946
- Dt as Calendar,
1947
- $t as Chart,
1948
- Ct as Colorpicker,
1949
- ze as Combobox,
1950
- Tt as ContextMenu,
1951
- At as DataView,
1952
- jt as Form,
1953
- Mt as Grid,
1954
- st as Layout,
1955
- Wt as List,
1956
- Nt as Menu,
1957
- he as MenuDropdown,
1958
- Ie as MessageContext,
1959
- Rt as MessageProvider,
1960
- Ot as Navbar,
1961
- Ht as Pagination,
1962
- Lt as Popup,
1963
- Pt as Ribbon,
1964
- wt as Sidebar,
1965
- Me as Slider,
1966
- zt as Tabbar,
1967
- pt as Timepicker,
1968
- St as Toolbar,
1969
- Bt as Tree,
1970
- It as Window,
2047
+ St as Button,
2048
+ Lt as Calendar,
2049
+ It as Chart,
2050
+ Nt as Colorpicker,
2051
+ Me as Combobox,
2052
+ zt as ContextMenu,
2053
+ Bt as DataView,
2054
+ Pt as Form,
2055
+ Ct as Grid,
2056
+ dt as Layout,
2057
+ At as List,
2058
+ wt as Menu,
2059
+ ae as MenuDropdown,
2060
+ Re as MessageContext,
2061
+ Et as MessageProvider,
2062
+ Yt as Navbar,
2063
+ jt as Pagination,
2064
+ Tt as Popup,
2065
+ Ot as Ribbon,
2066
+ $t as Sidebar,
2067
+ $e as Slider,
2068
+ Dt as Tabbar,
2069
+ ht as Timepicker,
2070
+ Mt as Toolbar,
2071
+ Ht as Tree,
2072
+ Rt as Window,
1971
2073
  e as tokens,
1972
- se as useClickOutside,
1973
- ut as useDrag,
1974
- Et as useMessage
2074
+ ie as useClickOutside,
2075
+ st as useDrag,
2076
+ Wt as useMessage
1975
2077
  };
1976
2078
  //# sourceMappingURL=dhx-react-suite.js.map