dhx-react-suite 1.0.6 → 1.0.7

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