dhx-react-suite 1.0.9 → 1.1.1

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