@editora/ui-react 0.1.0

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.
@@ -0,0 +1,4051 @@
1
+ import * as Z from "react";
2
+ import F, { useRef as X, useEffect as S, useImperativeHandle as z, createContext as be, useMemo as Le, useContext as me, useCallback as ie, useState as ae } from "react";
3
+ import { createDialogManager as Se, showToast as oe, computePosition as Fe, applyTheme as xe, registerThemeHost as Be, defaultTokens as de, createAlertDialogManager as Te } from "@editora/ui-core";
4
+ function Mt(N) {
5
+ const { children: f, onClick: t, variant: s, size: i, icon: u, loading: b, block: n, headless: r, disabled: d, animation: m, theme: l, ...E } = N, p = X(null), L = typeof window < "u" ? F.useLayoutEffect : F.useEffect;
6
+ S(() => {
7
+ const a = p.current;
8
+ if (!a)
9
+ return;
10
+ const A = (e) => t && t(e);
11
+ return t && a.addEventListener("click", A), () => {
12
+ t && a.removeEventListener("click", A);
13
+ };
14
+ }, [t]), L(() => {
15
+ const a = p.current;
16
+ a && (s ? a.setAttribute("variant", s) : a.removeAttribute("variant"), i ? a.setAttribute("size", i) : a.removeAttribute("size"), u ? a.setAttribute("icon", u) : a.removeAttribute("icon"), b ? a.setAttribute("loading", "") : a.removeAttribute("loading"), n ? a.setAttribute("block", "") : a.removeAttribute("block"), r ? a.setAttribute("headless", "") : a.removeAttribute("headless"), d ? a.setAttribute("disabled", "") : a.removeAttribute("disabled"), m ? a.setAttribute("animation", m) : a.removeAttribute("animation"), l && l !== "default" ? a.setAttribute("theme", l) : a.removeAttribute("theme"));
17
+ }, [s, i, u, b, n, r, d, m, l]);
18
+ const v = {
19
+ ref: p,
20
+ ...E,
21
+ variant: s,
22
+ size: i,
23
+ icon: u,
24
+ animation: m,
25
+ theme: l && l !== "default" ? l : void 0,
26
+ loading: b ? "" : void 0,
27
+ block: n ? "" : void 0,
28
+ headless: r ? "" : void 0,
29
+ disabled: d ? "" : void 0
30
+ };
31
+ return F.createElement("ui-button", v, f);
32
+ }
33
+ const De = F.forwardRef(function({
34
+ children: f,
35
+ text: t,
36
+ placement: s,
37
+ open: i,
38
+ disabled: u,
39
+ headless: b,
40
+ variant: n,
41
+ size: r,
42
+ tone: d,
43
+ delay: m,
44
+ closeDelay: l,
45
+ trigger: E,
46
+ offset: p,
47
+ interactive: L,
48
+ arrow: v,
49
+ onOpen: a,
50
+ onClose: A,
51
+ onOpenChange: e,
52
+ ...o
53
+ }, g) {
54
+ const y = X(null);
55
+ return z(g, () => y.current), S(() => {
56
+ const w = y.current;
57
+ if (!w)
58
+ return;
59
+ const c = () => {
60
+ a == null || a();
61
+ }, R = () => {
62
+ A == null || A();
63
+ }, h = (k) => {
64
+ const x = k.detail;
65
+ x && typeof x.open == "boolean" && (e == null || e(x.open));
66
+ };
67
+ return w.addEventListener("open", c), w.addEventListener("close", R), w.addEventListener("change", h), () => {
68
+ w.removeEventListener("open", c), w.removeEventListener("close", R), w.removeEventListener("change", h);
69
+ };
70
+ }, [a, A, e]), S(() => {
71
+ const w = y.current;
72
+ if (!w)
73
+ return;
74
+ const c = (h, k) => {
75
+ const x = w.getAttribute(h);
76
+ if (k == null) {
77
+ x != null && w.removeAttribute(h);
78
+ return;
79
+ }
80
+ x !== k && w.setAttribute(h, k);
81
+ }, R = (h, k) => {
82
+ k ? c(h, "") : c(h, null);
83
+ };
84
+ c("text", t || null), c("placement", s || null), R("open", i), R("disabled", u), R("headless", b), c("variant", n && n !== "default" ? n : null), c("size", r && r !== "md" ? r : null), c("tone", d && d !== "default" ? d : null), c("delay", typeof m == "number" && Number.isFinite(m) ? String(m) : null), c("close-delay", typeof l == "number" && Number.isFinite(l) ? String(l) : null), c("trigger", E || null), c("offset", typeof p == "number" && Number.isFinite(p) ? String(p) : null), R("interactive", L), typeof v == "boolean" ? c("arrow", v ? "true" : "false") : c("arrow", null);
85
+ }, [t, s, i, u, b, n, r, d, m, l, E, p, L, v]), F.createElement("ui-tooltip", { ref: y, ...o }, f);
86
+ });
87
+ De.displayName = "Tooltip";
88
+ function zt(N) {
89
+ const {
90
+ title: f,
91
+ description: t,
92
+ tone: s,
93
+ variant: i,
94
+ layout: u,
95
+ dismissible: b,
96
+ open: n,
97
+ headless: r,
98
+ onClose: d,
99
+ children: m,
100
+ ...l
101
+ } = N, E = X(null);
102
+ return S(() => {
103
+ const p = E.current;
104
+ if (!p)
105
+ return;
106
+ const L = () => d == null ? void 0 : d();
107
+ return p.addEventListener("close", L), () => p.removeEventListener("close", L);
108
+ }, [d]), S(() => {
109
+ const p = E.current;
110
+ p && (f ? p.setAttribute("title", f) : p.removeAttribute("title"), t ? p.setAttribute("description", t) : p.removeAttribute("description"), s ? p.setAttribute("tone", s) : p.removeAttribute("tone"), i ? p.setAttribute("variant", i) : p.removeAttribute("variant"), u ? p.setAttribute("layout", u) : p.removeAttribute("layout"), b ? p.setAttribute("dismissible", "") : p.removeAttribute("dismissible"), r ? p.setAttribute("headless", "") : p.removeAttribute("headless"), typeof n == "boolean" && (n ? p.removeAttribute("hidden") : p.setAttribute("hidden", "")));
111
+ }, [f, t, s, i, u, b, n, r]), F.createElement("ui-alert", { ref: E, ...l }, m);
112
+ }
113
+ const qe = F.forwardRef(function({
114
+ children: f,
115
+ open: t,
116
+ placement: s,
117
+ variant: i,
118
+ density: u,
119
+ shape: b,
120
+ elevation: n,
121
+ tone: r,
122
+ closeOnSelect: d,
123
+ typeahead: m,
124
+ onOpen: l,
125
+ onClose: E,
126
+ onChange: p,
127
+ onSelect: L,
128
+ ...v
129
+ }, a) {
130
+ const A = X(null);
131
+ return F.useImperativeHandle(a, () => A.current), S(() => {
132
+ const e = A.current;
133
+ if (!e)
134
+ return;
135
+ const o = () => l == null ? void 0 : l(), g = () => E == null ? void 0 : E(), y = (c) => {
136
+ var h;
137
+ const R = (h = c.detail) == null ? void 0 : h.open;
138
+ typeof R == "boolean" && (p == null || p(R));
139
+ }, w = (c) => {
140
+ L == null || L(c.detail || {});
141
+ };
142
+ return e.addEventListener("open", o), e.addEventListener("close", g), e.addEventListener("change", y), e.addEventListener("select", w), () => {
143
+ e.removeEventListener("open", o), e.removeEventListener("close", g), e.removeEventListener("change", y), e.removeEventListener("select", w);
144
+ };
145
+ }, [l, E, p, L]), S(() => {
146
+ const e = A.current;
147
+ !e || t == null || (t ? e.setAttribute("open", "") : e.removeAttribute("open"));
148
+ }, [t]), S(() => {
149
+ const e = A.current;
150
+ e && (s ? e.setAttribute("placement", s) : e.removeAttribute("placement"));
151
+ }, [s]), S(() => {
152
+ const e = A.current;
153
+ e && (i && i !== "default" ? e.setAttribute("variant", i) : e.removeAttribute("variant"));
154
+ }, [i]), S(() => {
155
+ const e = A.current;
156
+ e && (u && u !== "default" ? e.setAttribute("density", u) : e.removeAttribute("density"));
157
+ }, [u]), S(() => {
158
+ const e = A.current;
159
+ e && (b && b !== "default" ? e.setAttribute("shape", b) : e.removeAttribute("shape"));
160
+ }, [b]), S(() => {
161
+ const e = A.current;
162
+ e && (n && n !== "default" ? e.setAttribute("elevation", n) : e.removeAttribute("elevation"));
163
+ }, [n]), S(() => {
164
+ const e = A.current;
165
+ e && (r && r !== "default" && r !== "brand" ? e.setAttribute("tone", r) : e.removeAttribute("tone"));
166
+ }, [r]), S(() => {
167
+ const e = A.current;
168
+ if (e) {
169
+ if (d == null) {
170
+ e.removeAttribute("close-on-select");
171
+ return;
172
+ }
173
+ e.setAttribute("close-on-select", d ? "true" : "false");
174
+ }
175
+ }, [d]), S(() => {
176
+ const e = A.current;
177
+ if (e) {
178
+ if (m == null) {
179
+ e.removeAttribute("typeahead");
180
+ return;
181
+ }
182
+ e.setAttribute("typeahead", m ? "true" : "false");
183
+ }
184
+ }, [m]), F.createElement("ui-dropdown", { ref: A, ...v }, f);
185
+ });
186
+ qe.displayName = "Dropdown";
187
+ const $e = F.forwardRef(function(f, t) {
188
+ const {
189
+ value: s,
190
+ onChange: i,
191
+ onInput: u,
192
+ onDebouncedInput: b,
193
+ onClear: n,
194
+ clearable: r,
195
+ debounce: d,
196
+ validation: m,
197
+ size: l,
198
+ minlength: E,
199
+ maxlength: p,
200
+ readOnly: L,
201
+ autofocus: v,
202
+ disabled: a,
203
+ counter: A,
204
+ floatingLabel: e,
205
+ type: o,
206
+ name: g,
207
+ required: y,
208
+ pattern: w,
209
+ inputMode: c,
210
+ autoComplete: R,
211
+ min: h,
212
+ max: k,
213
+ step: x,
214
+ spellCheck: q,
215
+ placeholder: B,
216
+ headless: H,
217
+ variant: Y,
218
+ tone: P,
219
+ density: T,
220
+ shape: D,
221
+ color: $,
222
+ radius: J,
223
+ label: G,
224
+ description: Q,
225
+ children: _,
226
+ ...U
227
+ } = f, K = X(null);
228
+ return z(t, () => K.current), S(() => {
229
+ const j = K.current;
230
+ if (!j)
231
+ return;
232
+ const O = (te) => {
233
+ const V = te.detail;
234
+ typeof (V == null ? void 0 : V.value) == "string" && (u == null || u(V.value));
235
+ }, I = (te) => {
236
+ const V = te.detail;
237
+ typeof (V == null ? void 0 : V.value) == "string" && (i == null || i(V.value));
238
+ }, le = (te) => {
239
+ const V = te.detail;
240
+ typeof (V == null ? void 0 : V.value) == "string" && (b == null || b(V.value));
241
+ }, se = () => {
242
+ n == null || n();
243
+ };
244
+ return j.addEventListener("input", O), j.addEventListener("change", I), j.addEventListener("debounced-input", le), j.addEventListener("clear", se), () => {
245
+ j.removeEventListener("input", O), j.removeEventListener("change", I), j.removeEventListener("debounced-input", le), j.removeEventListener("clear", se);
246
+ };
247
+ }, [i, u, b, n]), S(() => {
248
+ const j = K.current;
249
+ j && (r ? j.setAttribute("clearable", "") : j.removeAttribute("clearable"), typeof d == "number" && Number.isFinite(d) ? j.setAttribute("debounce", String(d)) : j.removeAttribute("debounce"), m && m !== "none" ? j.setAttribute("validation", m) : j.removeAttribute("validation"), l && l !== "md" && l !== "2" ? j.setAttribute("size", String(l)) : j.removeAttribute("size"), typeof E == "number" ? j.setAttribute("minlength", String(E)) : j.removeAttribute("minlength"), typeof p == "number" ? j.setAttribute("maxlength", String(p)) : j.removeAttribute("maxlength"), L ? j.setAttribute("readonly", "") : j.removeAttribute("readonly"), v ? j.setAttribute("autofocus", "") : j.removeAttribute("autofocus"), a ? j.setAttribute("disabled", "") : j.removeAttribute("disabled"), A ? j.setAttribute("counter", "") : j.removeAttribute("counter"), e ? j.setAttribute("floating-label", "") : j.removeAttribute("floating-label"), o ? j.setAttribute("type", o) : j.removeAttribute("type"), g ? j.setAttribute("name", g) : j.removeAttribute("name"), y ? j.setAttribute("required", "") : j.removeAttribute("required"), w ? j.setAttribute("pattern", w) : j.removeAttribute("pattern"), c ? j.setAttribute("inputmode", c) : j.removeAttribute("inputmode"), R ? j.setAttribute("autocomplete", R) : j.removeAttribute("autocomplete"), h != null && h !== "" ? j.setAttribute("min", String(h)) : j.removeAttribute("min"), k != null && k !== "" ? j.setAttribute("max", String(k)) : j.removeAttribute("max"), x != null && x !== "" ? j.setAttribute("step", String(x)) : j.removeAttribute("step"), typeof q == "boolean" ? j.setAttribute("spellcheck", q ? "true" : "false") : j.removeAttribute("spellcheck"), B ? j.setAttribute("placeholder", B) : j.removeAttribute("placeholder"), H ? j.setAttribute("headless", "") : j.removeAttribute("headless"), Y && Y !== "classic" ? j.setAttribute("variant", Y) : j.removeAttribute("variant"), P && P !== "default" ? j.setAttribute("tone", P) : j.removeAttribute("tone"), T && T !== "default" ? j.setAttribute("density", T) : j.removeAttribute("density"), D && D !== "default" ? j.setAttribute("shape", D) : j.removeAttribute("shape"), $ ? j.setAttribute("color", $) : j.removeAttribute("color"), J ? j.setAttribute("radius", String(J)) : j.removeAttribute("radius"), G ? j.setAttribute("label", G) : j.removeAttribute("label"), Q ? j.setAttribute("description", Q) : j.removeAttribute("description"));
250
+ }, [
251
+ r,
252
+ d,
253
+ m,
254
+ l,
255
+ E,
256
+ p,
257
+ L,
258
+ v,
259
+ a,
260
+ A,
261
+ e,
262
+ o,
263
+ g,
264
+ y,
265
+ w,
266
+ c,
267
+ R,
268
+ h,
269
+ k,
270
+ x,
271
+ q,
272
+ B,
273
+ H,
274
+ Y,
275
+ P,
276
+ T,
277
+ D,
278
+ $,
279
+ J,
280
+ G,
281
+ Q
282
+ ]), F.createElement("ui-input", { ref: K, value: s ?? void 0, ...U }, _);
283
+ });
284
+ $e.displayName = "Input";
285
+ const Je = F.forwardRef(function({
286
+ value: f,
287
+ onChange: t,
288
+ onInput: s,
289
+ onDebouncedInput: i,
290
+ onClear: u,
291
+ clearable: b,
292
+ debounce: n,
293
+ validation: r,
294
+ size: d,
295
+ minlength: m,
296
+ maxlength: l,
297
+ rows: E,
298
+ readOnly: p,
299
+ autofocus: L,
300
+ disabled: v,
301
+ name: a,
302
+ required: A,
303
+ placeholder: e,
304
+ resize: o,
305
+ variant: g,
306
+ color: y,
307
+ radius: w,
308
+ label: c,
309
+ description: R,
310
+ autosize: h,
311
+ maxRows: k,
312
+ showCount: x,
313
+ density: q,
314
+ tone: B,
315
+ headless: H,
316
+ children: Y,
317
+ ...P
318
+ }, T) {
319
+ const D = X(null);
320
+ return z(T, () => D.current), S(() => {
321
+ const $ = D.current;
322
+ if (!$)
323
+ return;
324
+ const J = (U) => {
325
+ const K = U.detail;
326
+ K && (s == null || s(K.value));
327
+ }, G = (U) => {
328
+ const K = U.detail;
329
+ K && (t == null || t(K.value));
330
+ }, Q = (U) => {
331
+ const K = U.detail;
332
+ K && (i == null || i(K.value));
333
+ }, _ = () => u == null ? void 0 : u();
334
+ return $.addEventListener("input", J), $.addEventListener("change", G), $.addEventListener("debounced-input", Q), $.addEventListener("clear", _), () => {
335
+ $.removeEventListener("input", J), $.removeEventListener("change", G), $.removeEventListener("debounced-input", Q), $.removeEventListener("clear", _);
336
+ };
337
+ }, [t, s, i, u]), S(() => {
338
+ const $ = D.current;
339
+ if (!$)
340
+ return;
341
+ const J = (Q, _) => {
342
+ const U = $.getAttribute(Q);
343
+ if (_ == null) {
344
+ U != null && $.removeAttribute(Q);
345
+ return;
346
+ }
347
+ U !== _ && $.setAttribute(Q, _);
348
+ }, G = (Q, _) => {
349
+ _ ? J(Q, "") : J(Q, null);
350
+ };
351
+ J("value", f != null ? String(f) : null), G("clearable", b), G("readonly", p), G("autofocus", L), G("disabled", v), G("required", A), G("autosize", h), G("show-count", x), G("headless", H), J("debounce", typeof n == "number" && Number.isFinite(n) ? String(n) : null), J("validation", r && r !== "none" ? r : null), J("size", d && d !== "md" && d !== "2" ? String(d) : null), J("minlength", typeof m == "number" ? String(m) : null), J("maxlength", typeof l == "number" ? String(l) : null), J("rows", typeof E == "number" ? String(E) : null), J("name", a || null), J("placeholder", e || null), J("resize", o || null), J("variant", g && g !== "classic" ? g : null), J("color", y || null), J("radius", w ? String(w) : null), J("label", c || null), J("description", R || null), J("max-rows", typeof k == "number" ? String(k) : null), J("density", q && q !== "default" ? q : null), J("tone", B && B !== "brand" ? B : null);
352
+ }, [
353
+ f,
354
+ b,
355
+ n,
356
+ r,
357
+ d,
358
+ m,
359
+ l,
360
+ E,
361
+ p,
362
+ L,
363
+ v,
364
+ a,
365
+ A,
366
+ e,
367
+ o,
368
+ g,
369
+ y,
370
+ w,
371
+ c,
372
+ R,
373
+ h,
374
+ k,
375
+ x,
376
+ q,
377
+ B,
378
+ H
379
+ ]), F.createElement("ui-textarea", { ref: D, ...P }, Y);
380
+ });
381
+ Je.displayName = "Textarea";
382
+ function Wt(N) {
383
+ const {
384
+ children: f,
385
+ label: t,
386
+ description: s,
387
+ error: i,
388
+ htmlFor: u,
389
+ required: b,
390
+ invalid: n,
391
+ orientation: r,
392
+ variant: d,
393
+ tone: m,
394
+ density: l,
395
+ shape: E,
396
+ labelWidth: p,
397
+ headless: L,
398
+ ...v
399
+ } = N, a = X(null);
400
+ return S(() => {
401
+ const A = a.current;
402
+ A && (t != null && t !== "" ? A.setAttribute("label", t) : A.removeAttribute("label"), s != null && s !== "" ? A.setAttribute("description", s) : A.removeAttribute("description"), i != null && i !== "" ? A.setAttribute("error", i) : A.removeAttribute("error"), u ? A.setAttribute("for", u) : A.removeAttribute("for"), b ? A.setAttribute("required", "") : A.removeAttribute("required"), n ? A.setAttribute("invalid", "") : A.removeAttribute("invalid"), r && r !== "vertical" ? A.setAttribute("orientation", r) : A.removeAttribute("orientation"), d && d !== "default" ? A.setAttribute("variant", d) : A.removeAttribute("variant"), m && m !== "default" ? A.setAttribute("tone", m) : A.removeAttribute("tone"), l && l !== "default" ? A.setAttribute("density", l) : A.removeAttribute("density"), E && E !== "default" ? A.setAttribute("shape", E) : A.removeAttribute("shape"), p ? A.setAttribute("label-width", p) : A.removeAttribute("label-width"), L ? A.setAttribute("headless", "") : A.removeAttribute("headless"));
403
+ }, [
404
+ t,
405
+ s,
406
+ i,
407
+ u,
408
+ b,
409
+ n,
410
+ r,
411
+ d,
412
+ m,
413
+ l,
414
+ E,
415
+ p,
416
+ L
417
+ ]), F.createElement("ui-field", { ref: a, ...v }, f);
418
+ }
419
+ function It(N) {
420
+ const {
421
+ value: f,
422
+ onChange: t,
423
+ onInput: s,
424
+ onDebouncedInput: i,
425
+ onSelect: u,
426
+ onOpen: b,
427
+ onClose: n,
428
+ onClear: r,
429
+ clearable: d,
430
+ debounce: m,
431
+ validation: l,
432
+ size: E,
433
+ maxlength: p,
434
+ readOnly: L,
435
+ autofocus: v,
436
+ disabled: a,
437
+ name: A,
438
+ required: e,
439
+ placeholder: o,
440
+ variant: g,
441
+ radius: y,
442
+ label: w,
443
+ description: c,
444
+ emptyText: R,
445
+ noFilter: h,
446
+ allowCustom: k,
447
+ children: x,
448
+ ...q
449
+ } = N, B = X(null);
450
+ return S(() => {
451
+ const H = B.current;
452
+ if (!H)
453
+ return;
454
+ const Y = (Q) => {
455
+ var U;
456
+ const _ = (U = Q.detail) == null ? void 0 : U.query;
457
+ typeof _ == "string" && (s == null || s(_));
458
+ }, P = (Q) => {
459
+ var U;
460
+ const _ = (U = Q.detail) == null ? void 0 : U.value;
461
+ typeof _ == "string" && (t == null || t(_));
462
+ }, T = (Q) => {
463
+ var U;
464
+ const _ = (U = Q.detail) == null ? void 0 : U.query;
465
+ typeof _ == "string" && (i == null || i(_));
466
+ }, D = (Q) => {
467
+ const _ = Q.detail;
468
+ typeof (_ == null ? void 0 : _.value) == "string" && (u == null || u(_.value, _.label || _.value));
469
+ }, $ = () => b == null ? void 0 : b(), J = () => n == null ? void 0 : n(), G = () => r == null ? void 0 : r();
470
+ return H.addEventListener("input", Y), H.addEventListener("change", P), H.addEventListener("debounced-input", T), H.addEventListener("select", D), H.addEventListener("open", $), H.addEventListener("close", J), H.addEventListener("clear", G), () => {
471
+ H.removeEventListener("input", Y), H.removeEventListener("change", P), H.removeEventListener("debounced-input", T), H.removeEventListener("select", D), H.removeEventListener("open", $), H.removeEventListener("close", J), H.removeEventListener("clear", G);
472
+ };
473
+ }, [t, s, i, u, b, n, r]), S(() => {
474
+ const H = B.current;
475
+ H && (d ? H.setAttribute("clearable", "") : H.removeAttribute("clearable"), typeof m == "number" && Number.isFinite(m) ? H.setAttribute("debounce", String(m)) : H.removeAttribute("debounce"), l && l !== "none" ? H.setAttribute("validation", l) : H.removeAttribute("validation"), E && E !== "md" && E !== "2" ? H.setAttribute("size", String(E)) : H.removeAttribute("size"), typeof p == "number" ? H.setAttribute("maxlength", String(p)) : H.removeAttribute("maxlength"), L ? H.setAttribute("readonly", "") : H.removeAttribute("readonly"), v ? H.setAttribute("autofocus", "") : H.removeAttribute("autofocus"), a ? H.setAttribute("disabled", "") : H.removeAttribute("disabled"), A ? H.setAttribute("name", A) : H.removeAttribute("name"), e ? H.setAttribute("required", "") : H.removeAttribute("required"), o ? H.setAttribute("placeholder", o) : H.removeAttribute("placeholder"), g ? H.setAttribute("variant", g) : H.removeAttribute("variant"), y ? H.setAttribute("radius", String(y)) : H.removeAttribute("radius"), w ? H.setAttribute("label", w) : H.removeAttribute("label"), c ? H.setAttribute("description", c) : H.removeAttribute("description"), R ? H.setAttribute("empty-text", R) : H.removeAttribute("empty-text"), h ? H.setAttribute("no-filter", "") : H.removeAttribute("no-filter"), k ? H.setAttribute("allow-custom", "") : H.removeAttribute("allow-custom"));
476
+ }, [
477
+ d,
478
+ m,
479
+ l,
480
+ E,
481
+ p,
482
+ L,
483
+ v,
484
+ a,
485
+ A,
486
+ e,
487
+ o,
488
+ g,
489
+ y,
490
+ w,
491
+ c,
492
+ R,
493
+ h,
494
+ k
495
+ ]), F.createElement("ui-combobox", { ref: B, value: f, ...q }, x);
496
+ }
497
+ function Ot(N) {
498
+ const {
499
+ text: f,
500
+ tone: t,
501
+ variant: s,
502
+ size: i,
503
+ radius: u,
504
+ pill: b,
505
+ dot: n,
506
+ removable: r,
507
+ autoRemove: d,
508
+ iconOnly: m,
509
+ disabled: l,
510
+ onRemove: E,
511
+ children: p,
512
+ ...L
513
+ } = N, v = X(null);
514
+ return S(() => {
515
+ const a = v.current;
516
+ if (!a)
517
+ return;
518
+ const A = () => E == null ? void 0 : E();
519
+ return a.addEventListener("remove", A), () => a.removeEventListener("remove", A);
520
+ }, [E]), S(() => {
521
+ const a = v.current;
522
+ a && (f ? a.setAttribute("text", f) : a.removeAttribute("text"), t ? a.setAttribute("tone", t) : a.removeAttribute("tone"), s ? a.setAttribute("variant", s) : a.removeAttribute("variant"), i && i !== "md" && i !== "2" ? a.setAttribute("size", i) : a.removeAttribute("size"), u ? a.setAttribute("radius", String(u)) : a.removeAttribute("radius"), b ? a.setAttribute("pill", "") : a.removeAttribute("pill"), n ? a.setAttribute("dot", "") : a.removeAttribute("dot"), r ? a.setAttribute("removable", "") : a.removeAttribute("removable"), d ? a.setAttribute("auto-remove", "") : a.removeAttribute("auto-remove"), m ? a.setAttribute("icon-only", "") : a.removeAttribute("icon-only"), l ? a.setAttribute("disabled", "") : a.removeAttribute("disabled"));
523
+ }, [f, t, s, i, u, b, n, r, d, m, l]), F.createElement("ui-badge", { ref: v, ...L }, p);
524
+ }
525
+ function Vt(N) {
526
+ const {
527
+ title: f,
528
+ description: t,
529
+ actionLabel: s,
530
+ tone: i,
531
+ compact: u,
532
+ headless: b,
533
+ onAction: n,
534
+ children: r,
535
+ ...d
536
+ } = N, m = X(null);
537
+ return S(() => {
538
+ const l = m.current;
539
+ if (!l)
540
+ return;
541
+ const E = () => n == null ? void 0 : n();
542
+ return l.addEventListener("action", E), () => l.removeEventListener("action", E);
543
+ }, [n]), S(() => {
544
+ const l = m.current;
545
+ l && (f ? l.setAttribute("title", f) : l.removeAttribute("title"), t ? l.setAttribute("description", t) : l.removeAttribute("description"), s ? l.setAttribute("action-label", s) : l.removeAttribute("action-label"), i ? l.setAttribute("tone", i) : l.removeAttribute("tone"), u ? l.setAttribute("compact", "") : l.removeAttribute("compact"), b ? l.setAttribute("headless", "") : l.removeAttribute("headless"));
546
+ }, [f, t, s, i, u, b]), F.createElement("ui-empty-state", { ref: m, ...d }, r);
547
+ }
548
+ function Ct(N) {
549
+ const {
550
+ sortable: f,
551
+ selectable: t,
552
+ multiSelect: s,
553
+ striped: i,
554
+ hover: u,
555
+ compact: b,
556
+ bordered: n,
557
+ stickyHeader: r,
558
+ loading: d,
559
+ headless: m,
560
+ emptyText: l,
561
+ onSortChange: E,
562
+ onRowSelect: p,
563
+ children: L,
564
+ ...v
565
+ } = N, a = X(null);
566
+ return S(() => {
567
+ const A = a.current;
568
+ if (!A)
569
+ return;
570
+ const e = (g) => {
571
+ const y = g.detail;
572
+ y && (E == null || E(y));
573
+ }, o = (g) => {
574
+ const y = g.detail;
575
+ y && (p == null || p(y));
576
+ };
577
+ return A.addEventListener("sort-change", e), A.addEventListener("row-select", o), () => {
578
+ A.removeEventListener("sort-change", e), A.removeEventListener("row-select", o);
579
+ };
580
+ }, [E, p]), F.createElement(
581
+ "ui-table",
582
+ {
583
+ ref: a,
584
+ ...v,
585
+ ...f ? { sortable: "" } : {},
586
+ ...t ? { selectable: "" } : {},
587
+ ...s ? { "multi-select": "" } : {},
588
+ ...i ? { striped: "" } : {},
589
+ ...u ? { hover: "" } : {},
590
+ ...b ? { compact: "" } : {},
591
+ ...n ? { bordered: "" } : {},
592
+ ...r ? { "sticky-header": "" } : {},
593
+ ...d ? { loading: "" } : {},
594
+ ...m ? { headless: "" } : {},
595
+ ...l ? { "empty-text": l } : {}
596
+ },
597
+ L
598
+ );
599
+ }
600
+ function er(N) {
601
+ const {
602
+ sortable: f,
603
+ selectable: t,
604
+ multiSelect: s,
605
+ striped: i,
606
+ hover: u,
607
+ compact: b,
608
+ bordered: n,
609
+ stickyHeader: r,
610
+ loading: d,
611
+ headless: m,
612
+ hideSummary: l,
613
+ emptyText: E,
614
+ page: p,
615
+ pageSize: L,
616
+ paginationId: v,
617
+ filterQuery: a,
618
+ filterColumn: A,
619
+ filterRules: e,
620
+ columnOrder: o,
621
+ pinColumns: g,
622
+ draggableColumns: y,
623
+ resizableColumns: w,
624
+ bulkActionsLabel: c,
625
+ bulkClearLabel: R,
626
+ virtualize: h,
627
+ rowHeight: k,
628
+ overscan: x,
629
+ onSortChange: q,
630
+ onRowSelect: B,
631
+ onPageChange: H,
632
+ onFilterChange: Y,
633
+ onColumnResize: P,
634
+ onVirtualRangeChange: T,
635
+ onColumnOrderChange: D,
636
+ onBulkClear: $,
637
+ children: J,
638
+ ...G
639
+ } = N, Q = X(null);
640
+ S(() => {
641
+ const K = Q.current;
642
+ if (!K)
643
+ return;
644
+ const j = (C) => {
645
+ const W = C.detail;
646
+ W && (q == null || q(W));
647
+ }, O = (C) => {
648
+ const W = C.detail;
649
+ W && (B == null || B(W));
650
+ }, I = (C) => {
651
+ const W = C.detail;
652
+ W && (H == null || H(W));
653
+ }, le = (C) => {
654
+ const W = C.detail;
655
+ W && (Y == null || Y(W));
656
+ }, se = (C) => {
657
+ const W = C.detail;
658
+ W && (P == null || P(W));
659
+ }, te = (C) => {
660
+ const W = C.detail;
661
+ W && (T == null || T(W));
662
+ }, V = (C) => {
663
+ const W = C.detail;
664
+ W && (D == null || D(W));
665
+ }, ce = (C) => {
666
+ const W = C.detail;
667
+ W && ($ == null || $(W));
668
+ };
669
+ return K.addEventListener("sort-change", j), K.addEventListener("row-select", O), K.addEventListener("page-change", I), K.addEventListener("filter-change", le), K.addEventListener("column-resize", se), K.addEventListener("virtual-range-change", te), K.addEventListener("column-order-change", V), K.addEventListener("bulk-clear", ce), () => {
670
+ K.removeEventListener("sort-change", j), K.removeEventListener("row-select", O), K.removeEventListener("page-change", I), K.removeEventListener("filter-change", le), K.removeEventListener("column-resize", se), K.removeEventListener("virtual-range-change", te), K.removeEventListener("column-order-change", V), K.removeEventListener("bulk-clear", ce);
671
+ };
672
+ }, [
673
+ q,
674
+ B,
675
+ H,
676
+ Y,
677
+ P,
678
+ T,
679
+ D,
680
+ $
681
+ ]);
682
+ const _ = e && e.length ? (() => {
683
+ try {
684
+ return JSON.stringify(e);
685
+ } catch {
686
+ return;
687
+ }
688
+ })() : void 0, U = typeof g == "string" ? g.trim() || void 0 : g && typeof g == "object" ? (() => {
689
+ try {
690
+ return JSON.stringify(g);
691
+ } catch {
692
+ return;
693
+ }
694
+ })() : void 0;
695
+ return F.createElement(
696
+ "ui-data-table",
697
+ {
698
+ ref: Q,
699
+ ...G,
700
+ ...f ? { sortable: "" } : {},
701
+ ...t ? { selectable: "" } : {},
702
+ ...s ? { "multi-select": "" } : {},
703
+ ...i ? { striped: "" } : {},
704
+ ...u ? { hover: "" } : {},
705
+ ...b ? { compact: "" } : {},
706
+ ...n ? { bordered: "" } : {},
707
+ ...r ? { "sticky-header": "" } : {},
708
+ ...d ? { loading: "" } : {},
709
+ ...m ? { headless: "" } : {},
710
+ ...l ? { "hide-summary": "" } : {},
711
+ ...E ? { "empty-text": E } : {},
712
+ ...typeof p == "number" && Number.isFinite(p) ? { page: String(p) } : {},
713
+ ...typeof L == "number" && Number.isFinite(L) ? { "page-size": String(L) } : {},
714
+ ...v ? { "pagination-id": v } : {},
715
+ ...typeof a == "string" ? { "filter-query": a } : {},
716
+ ...typeof A == "number" && Number.isFinite(A) ? { "filter-column": String(A) } : typeof A == "string" && A.trim() ? { "filter-column": A } : {},
717
+ ..._ ? { filters: _ } : {},
718
+ ...o ? { "column-order": o } : {},
719
+ ...U ? { "pin-columns": U } : {},
720
+ ...y ? { "draggable-columns": "" } : {},
721
+ ...w ? { "resizable-columns": "" } : {},
722
+ ...c ? { "bulk-actions-label": c } : {},
723
+ ...R ? { "bulk-clear-label": R } : {},
724
+ ...h ? { virtualize: "" } : {},
725
+ ...typeof k == "number" && Number.isFinite(k) ? { "row-height": String(k) } : {},
726
+ ...typeof x == "number" && Number.isFinite(x) ? { overscan: String(x) } : {}
727
+ },
728
+ J
729
+ );
730
+ }
731
+ const je = F.forwardRef(function({ data: f, values: t, labels: s, type: i, variant: u, title: b, subtitle: n, headless: r, children: d, ...m }, l) {
732
+ const E = X(null);
733
+ return z(l, () => E.current), S(() => {
734
+ const p = E.current;
735
+ if (!p)
736
+ return;
737
+ const L = (a, A) => {
738
+ const e = p.getAttribute(a);
739
+ if (A == null) {
740
+ e != null && p.removeAttribute(a);
741
+ return;
742
+ }
743
+ e !== A && p.setAttribute(a, A);
744
+ }, v = (a, A) => {
745
+ A ? L(a, "") : L(a, null);
746
+ };
747
+ if (f && f.length)
748
+ try {
749
+ L("data", JSON.stringify(f));
750
+ } catch {
751
+ L("data", null);
752
+ }
753
+ else
754
+ L("data", null);
755
+ t && t.length ? L("values", t.join(",")) : L("values", null), s && s.length ? L("labels", s.join(",")) : L("labels", null), L("type", i && i !== "line" ? i : null), L("variant", u && u !== "default" ? u : null), L("title", b || null), L("subtitle", n || null), v("headless", r);
756
+ }, [f, t, s, i, u, b, n, r]), F.createElement("ui-chart", { ref: E, ...m }, d);
757
+ });
758
+ je.displayName = "Chart";
759
+ const Ge = F.forwardRef(function({ items: f, variant: t, headless: s, children: i, ...u }, b) {
760
+ const n = X(null);
761
+ return z(b, () => n.current), S(() => {
762
+ const r = n.current;
763
+ if (!r)
764
+ return;
765
+ const d = (l, E) => {
766
+ const p = r.getAttribute(l);
767
+ if (E == null) {
768
+ p != null && r.removeAttribute(l);
769
+ return;
770
+ }
771
+ p !== E && r.setAttribute(l, E);
772
+ }, m = (l, E) => {
773
+ E ? d(l, "") : d(l, null);
774
+ };
775
+ if (f && f.length)
776
+ try {
777
+ d("items", JSON.stringify(f));
778
+ } catch {
779
+ d("items", null);
780
+ }
781
+ else
782
+ d("items", null);
783
+ d("variant", t && t !== "default" ? t : null), m("headless", s);
784
+ }, [f, t, s]), F.createElement("ui-timeline", { ref: n, ...u }, i);
785
+ });
786
+ Ge.displayName = "Timeline";
787
+ const _e = F.forwardRef(function({
788
+ year: f,
789
+ month: t,
790
+ value: s,
791
+ events: i,
792
+ variant: u,
793
+ selection: b,
794
+ min: n,
795
+ max: r,
796
+ disabled: d,
797
+ readOnly: m,
798
+ locale: l,
799
+ weekStart: E,
800
+ outsideClick: p,
801
+ eventsMax: L,
802
+ eventsDisplay: v,
803
+ maxSelections: a,
804
+ size: A,
805
+ headless: e,
806
+ hideToday: o,
807
+ showToday: g,
808
+ onSelect: y,
809
+ onChange: w,
810
+ onCalendarChange: c,
811
+ onValueChange: R,
812
+ children: h,
813
+ ...k
814
+ }, x) {
815
+ const q = X(null);
816
+ return z(x, () => q.current), S(() => {
817
+ const B = q.current;
818
+ if (!B)
819
+ return;
820
+ const H = (P) => {
821
+ const T = P.detail;
822
+ T && (y == null || y(T), w == null || w(T), R == null || R(T.value));
823
+ }, Y = (P) => {
824
+ const T = P.detail;
825
+ T && (c == null || c(T));
826
+ };
827
+ return B.addEventListener("select", H), B.addEventListener("change", Y), () => {
828
+ B.removeEventListener("select", H), B.removeEventListener("change", Y);
829
+ };
830
+ }, [y, w, c, R]), S(() => {
831
+ const B = q.current;
832
+ if (!B)
833
+ return;
834
+ const H = (P, T) => {
835
+ const D = B.getAttribute(P);
836
+ if (T == null) {
837
+ D != null && B.removeAttribute(P);
838
+ return;
839
+ }
840
+ D !== T && B.setAttribute(P, T);
841
+ }, Y = (P, T) => {
842
+ T ? B.hasAttribute(P) || B.setAttribute(P, "") : B.hasAttribute(P) && B.removeAttribute(P);
843
+ };
844
+ if (typeof f == "number" && Number.isFinite(f) ? H("year", String(f)) : H("year", null), typeof t == "number" && Number.isFinite(t) ? H("month", String(t)) : H("month", null), H("value", s || null), H("selection", b && b !== "single" ? b : null), H("min", n || null), H("max", r || null), H("locale", l || null), H("week-start", typeof E == "number" ? String(E) : null), H("outside-click", p && p !== "navigate" ? p : null), H("events-max", typeof L == "number" && Number.isFinite(L) ? String(L) : null), H("events-display", v && v !== "dots" ? v : null), H(
845
+ "max-selections",
846
+ typeof a == "number" && Number.isFinite(a) ? String(a) : null
847
+ ), H("size", A && A !== "md" ? A : null), H("show-today", typeof g == "boolean" ? g ? "true" : "false" : null), Y("disabled", d), Y("readonly", m), Y("hide-today", o), Y("headless", e), i && i.length)
848
+ try {
849
+ H("events", JSON.stringify(i));
850
+ } catch {
851
+ H("events", null);
852
+ }
853
+ else
854
+ H("events", null);
855
+ H("variant", u && u !== "default" ? u : null);
856
+ }, [
857
+ f,
858
+ t,
859
+ s,
860
+ i,
861
+ u,
862
+ b,
863
+ n,
864
+ r,
865
+ d,
866
+ m,
867
+ l,
868
+ E,
869
+ p,
870
+ L,
871
+ v,
872
+ a,
873
+ A,
874
+ e,
875
+ o,
876
+ g
877
+ ]), F.createElement("ui-calendar", { ref: q, ...k }, h);
878
+ });
879
+ _e.displayName = "Calendar";
880
+ const Qe = F.forwardRef(function({
881
+ value: f,
882
+ format: t,
883
+ alpha: s,
884
+ disabled: i,
885
+ readOnly: u,
886
+ size: b,
887
+ variant: n,
888
+ mode: r,
889
+ open: d,
890
+ placeholder: m,
891
+ presets: l,
892
+ recent: E,
893
+ maxRecent: p,
894
+ persist: L,
895
+ onInput: v,
896
+ onChange: a,
897
+ onValueChange: A,
898
+ onOpen: e,
899
+ onClose: o,
900
+ onInvalid: g,
901
+ children: y,
902
+ ...w
903
+ }, c) {
904
+ const R = X(null);
905
+ z(c, () => R.current), S(() => {
906
+ const k = R.current;
907
+ if (!k)
908
+ return;
909
+ const x = (H) => {
910
+ const Y = H.detail;
911
+ Y && (v == null || v(Y));
912
+ }, q = (H) => {
913
+ const Y = H.detail;
914
+ Y && (a == null || a(Y), A == null || A(Y.value));
915
+ }, B = (H) => {
916
+ const Y = H.detail;
917
+ Y && (g == null || g(Y));
918
+ };
919
+ return k.addEventListener("input", x), k.addEventListener("change", q), k.addEventListener("open", e), k.addEventListener("close", o), k.addEventListener("invalid", B), () => {
920
+ k.removeEventListener("input", x), k.removeEventListener("change", q), k.removeEventListener("open", e), k.removeEventListener("close", o), k.removeEventListener("invalid", B);
921
+ };
922
+ }, [v, a, A, e, o, g]), S(() => {
923
+ const k = R.current;
924
+ if (!k)
925
+ return;
926
+ const x = (B, H) => {
927
+ const Y = k.getAttribute(B);
928
+ H == null ? Y != null && k.removeAttribute(B) : Y !== H && k.setAttribute(B, H);
929
+ }, q = (B, H) => {
930
+ H ? x(B, "") : x(B, null);
931
+ };
932
+ if (x("value", f ?? null), x("format", t && t !== "hex" ? t : null), q("alpha", s), q("disabled", i), q("readonly", u), x("size", b && b !== "md" ? b : null), x("variant", n && n !== "default" ? n : null), x("mode", r && r !== "inline" ? r : null), typeof d == "boolean" ? q("open", d) : x("open", null), x("placeholder", m ?? null), q("recent", E), x("max-recent", typeof p == "number" ? String(p) : null), q("persist", L), l && l.length > 0)
933
+ try {
934
+ x("presets", JSON.stringify(l));
935
+ } catch {
936
+ x("presets", null);
937
+ }
938
+ else
939
+ x("presets", null);
940
+ }, [f, t, s, i, u, b, n, r, d, m, l, E, p, L]);
941
+ const h = { ref: R, ...w };
942
+ if (r && r !== "inline" && (h.mode = r), typeof d == "boolean" && d && (h.open = ""), f != null && (h.value = f), t && t !== "hex" && (h.format = t), s && (h.alpha = ""), i && (h.disabled = ""), u && (h.readonly = ""), b && b !== "md" && (h.size = b), n && n !== "default" && (h.variant = n), m && (h.placeholder = m), E && (h.recent = ""), typeof p == "number" && (h["max-recent"] = String(p)), L && (h.persist = ""), l && l.length > 0)
943
+ try {
944
+ h.presets = JSON.stringify(l);
945
+ } catch {
946
+ }
947
+ return F.createElement("ui-color-picker", h, y);
948
+ });
949
+ Qe.displayName = "ColorPicker";
950
+ const Ke = F.forwardRef(function({
951
+ value: f,
952
+ defaultValue: t,
953
+ open: s,
954
+ defaultOpen: i,
955
+ min: u,
956
+ max: b,
957
+ locale: n,
958
+ weekStart: r,
959
+ size: d,
960
+ variant: m,
961
+ placeholder: l,
962
+ label: E,
963
+ hint: p,
964
+ error: L,
965
+ clearable: v,
966
+ allowInput: a,
967
+ closeOnSelect: A,
968
+ outsideClick: e,
969
+ disabled: o,
970
+ readOnly: g,
971
+ required: y,
972
+ name: w,
973
+ mode: c,
974
+ events: R,
975
+ eventsMax: h,
976
+ eventsDisplay: k,
977
+ format: x,
978
+ displayFormat: q,
979
+ onInput: B,
980
+ onChange: H,
981
+ onValueChange: Y,
982
+ onOpen: P,
983
+ onClose: T,
984
+ onInvalid: D,
985
+ children: $,
986
+ ...J
987
+ }, G) {
988
+ const Q = X(null);
989
+ return z(G, () => Q.current), S(() => {
990
+ const _ = Q.current;
991
+ if (!_)
992
+ return;
993
+ const U = (O) => {
994
+ const I = O.detail;
995
+ I && (B == null || B(I));
996
+ }, K = (O) => {
997
+ const I = O.detail;
998
+ I && (H == null || H(I), Y == null || Y(I.value));
999
+ }, j = (O) => {
1000
+ const I = O.detail;
1001
+ I && (D == null || D(I));
1002
+ };
1003
+ return _.addEventListener("input", U), _.addEventListener("change", K), _.addEventListener("open", P), _.addEventListener("close", T), _.addEventListener("invalid", j), () => {
1004
+ _.removeEventListener("input", U), _.removeEventListener("change", K), _.removeEventListener("open", P), _.removeEventListener("close", T), _.removeEventListener("invalid", j);
1005
+ };
1006
+ }, [B, H, Y, P, T, D]), S(() => {
1007
+ const _ = Q.current;
1008
+ if (!_)
1009
+ return;
1010
+ const U = (j, O) => {
1011
+ const I = _.getAttribute(j);
1012
+ O == null ? I != null && _.removeAttribute(j) : I !== O && _.setAttribute(j, O);
1013
+ }, K = (j, O) => {
1014
+ O ? U(j, "") : U(j, null);
1015
+ };
1016
+ if (U("value", f ?? null), U("default-value", t ?? null), typeof s == "boolean" ? K("open", s) : U("open", null), K("default-open", i), U("min", u ?? null), U("max", b ?? null), U("locale", n ?? null), U("week-start", typeof r == "number" ? String(r) : null), U("size", d && d !== "md" ? d : null), U("variant", m && m !== "default" ? m : null), U("placeholder", l ?? null), U("label", E ?? null), U("hint", p ?? null), U("error", L ?? null), K("clearable", v), K("allow-input", a), K("close-on-select", A), U("outside-click", e && e !== "navigate" ? e : null), K("disabled", o), K("readonly", g), K("required", y), U("name", w ?? null), U("mode", c && c !== "popover" ? c : null), U("events-max", typeof h == "number" ? String(h) : null), U("events-display", k && k !== "dots" ? k : null), U("format", x && x !== "locale" ? x : null), U("display-format", q ?? null), R != null && R.length)
1017
+ try {
1018
+ U("events", JSON.stringify(R));
1019
+ } catch {
1020
+ U("events", null);
1021
+ }
1022
+ else
1023
+ U("events", null);
1024
+ }, [
1025
+ f,
1026
+ t,
1027
+ s,
1028
+ i,
1029
+ u,
1030
+ b,
1031
+ n,
1032
+ r,
1033
+ d,
1034
+ m,
1035
+ l,
1036
+ E,
1037
+ p,
1038
+ L,
1039
+ v,
1040
+ a,
1041
+ A,
1042
+ e,
1043
+ o,
1044
+ g,
1045
+ y,
1046
+ w,
1047
+ c,
1048
+ R,
1049
+ h,
1050
+ k,
1051
+ x,
1052
+ q
1053
+ ]), F.createElement("ui-date-picker", { ref: Q, ...J }, $);
1054
+ });
1055
+ Ke.displayName = "DatePicker";
1056
+ const Ue = F.forwardRef(function({
1057
+ value: f,
1058
+ defaultValue: t,
1059
+ open: s,
1060
+ defaultOpen: i,
1061
+ min: u,
1062
+ max: b,
1063
+ locale: n,
1064
+ weekStart: r,
1065
+ size: d,
1066
+ variant: m,
1067
+ rangeVariant: l,
1068
+ label: E,
1069
+ hint: p,
1070
+ error: L,
1071
+ allowSameDay: v,
1072
+ allowPartial: a,
1073
+ closeOnSelect: A,
1074
+ clearable: e,
1075
+ disabled: o,
1076
+ readOnly: g,
1077
+ required: y,
1078
+ name: w,
1079
+ nameStart: c,
1080
+ nameEnd: R,
1081
+ mode: h,
1082
+ onInput: k,
1083
+ onChange: x,
1084
+ onValueChange: q,
1085
+ onOpen: B,
1086
+ onClose: H,
1087
+ onInvalid: Y,
1088
+ children: P,
1089
+ ...T
1090
+ }, D) {
1091
+ const $ = X(null);
1092
+ return z(D, () => $.current), S(() => {
1093
+ const J = $.current;
1094
+ if (!J)
1095
+ return;
1096
+ const G = (U) => {
1097
+ const K = U.detail;
1098
+ K && (k == null || k(K));
1099
+ }, Q = (U) => {
1100
+ const K = U.detail;
1101
+ K && (x == null || x(K), q == null || q(K.value ? JSON.stringify(K.value) : null));
1102
+ }, _ = (U) => {
1103
+ const K = U.detail;
1104
+ K && (Y == null || Y(K));
1105
+ };
1106
+ return J.addEventListener("input", G), J.addEventListener("change", Q), J.addEventListener("open", B), J.addEventListener("close", H), J.addEventListener("invalid", _), () => {
1107
+ J.removeEventListener("input", G), J.removeEventListener("change", Q), J.removeEventListener("open", B), J.removeEventListener("close", H), J.removeEventListener("invalid", _);
1108
+ };
1109
+ }, [k, x, q, B, H, Y]), S(() => {
1110
+ const J = $.current;
1111
+ if (!J)
1112
+ return;
1113
+ const G = (_, U) => {
1114
+ const K = J.getAttribute(_);
1115
+ U == null ? K != null && J.removeAttribute(_) : K !== U && J.setAttribute(_, U);
1116
+ }, Q = (_, U) => {
1117
+ U ? G(_, "") : G(_, null);
1118
+ };
1119
+ G("value", f ?? null), G("default-value", t ?? null), typeof s == "boolean" ? Q("open", s) : G("open", null), Q("default-open", i), G("min", u ?? null), G("max", b ?? null), G("locale", n ?? null), G("week-start", typeof r == "number" ? String(r) : null), G("size", d && d !== "md" ? d : null), G("variant", m && m !== "default" ? m : null), G("range-variant", l && l !== "two-fields" ? l : null), G("label", E ?? null), G("hint", p ?? null), G("error", L ?? null), Q("allow-same-day", v), Q("allow-partial", a), Q("close-on-select", A), Q("clearable", e), Q("disabled", o), Q("readonly", g), Q("required", y), G("name", w ?? null), G("name-start", c ?? null), G("name-end", R ?? null), G("mode", h && h !== "popover" ? h : null);
1120
+ }, [
1121
+ f,
1122
+ t,
1123
+ s,
1124
+ i,
1125
+ u,
1126
+ b,
1127
+ n,
1128
+ r,
1129
+ d,
1130
+ m,
1131
+ l,
1132
+ E,
1133
+ p,
1134
+ L,
1135
+ v,
1136
+ a,
1137
+ A,
1138
+ e,
1139
+ o,
1140
+ g,
1141
+ y,
1142
+ w,
1143
+ c,
1144
+ R,
1145
+ h
1146
+ ]), F.createElement("ui-date-range-picker", { ref: $, ...T }, P);
1147
+ });
1148
+ Ue.displayName = "DateRangePicker";
1149
+ const Xe = F.forwardRef(function({
1150
+ value: f,
1151
+ defaultValue: t,
1152
+ open: s,
1153
+ defaultOpen: i,
1154
+ format: u,
1155
+ step: b,
1156
+ seconds: n,
1157
+ stepSeconds: r,
1158
+ min: d,
1159
+ max: m,
1160
+ disabled: l,
1161
+ readOnly: E,
1162
+ required: p,
1163
+ name: L,
1164
+ clearable: v,
1165
+ allowInput: a,
1166
+ mode: A,
1167
+ label: e,
1168
+ hint: o,
1169
+ error: g,
1170
+ locale: y,
1171
+ variant: w,
1172
+ onInput: c,
1173
+ onChange: R,
1174
+ onValueChange: h,
1175
+ onOpen: k,
1176
+ onClose: x,
1177
+ onInvalid: q,
1178
+ children: B,
1179
+ ...H
1180
+ }, Y) {
1181
+ const P = X(null);
1182
+ return z(Y, () => P.current), S(() => {
1183
+ const T = P.current;
1184
+ if (!T)
1185
+ return;
1186
+ const D = (G) => {
1187
+ const Q = G.detail;
1188
+ Q && (c == null || c(Q));
1189
+ }, $ = (G) => {
1190
+ const Q = G.detail;
1191
+ Q && (R == null || R(Q), h == null || h(Q.value));
1192
+ }, J = (G) => {
1193
+ const Q = G.detail;
1194
+ Q && (q == null || q(Q));
1195
+ };
1196
+ return T.addEventListener("input", D), T.addEventListener("change", $), T.addEventListener("open", k), T.addEventListener("close", x), T.addEventListener("invalid", J), () => {
1197
+ T.removeEventListener("input", D), T.removeEventListener("change", $), T.removeEventListener("open", k), T.removeEventListener("close", x), T.removeEventListener("invalid", J);
1198
+ };
1199
+ }, [c, R, h, k, x, q]), S(() => {
1200
+ const T = P.current;
1201
+ if (!T)
1202
+ return;
1203
+ const D = (J, G) => {
1204
+ const Q = T.getAttribute(J);
1205
+ G == null ? Q != null && T.removeAttribute(J) : Q !== G && T.setAttribute(J, G);
1206
+ }, $ = (J, G) => {
1207
+ G ? D(J, "") : D(J, null);
1208
+ };
1209
+ D("value", f ?? null), D("default-value", t ?? null), typeof s == "boolean" ? $("open", s) : D("open", null), $("default-open", i), D("format", u && u !== "24h" ? u : null), D("step", typeof b == "number" ? String(b) : null), $("seconds", n), D("step-seconds", typeof r == "number" ? String(r) : null), D("min", d ?? null), D("max", m ?? null), $("disabled", l), $("readonly", E), $("required", p), D("name", L ?? null), $("clearable", v), $("allow-input", a), D("mode", A && A !== "popover" ? A : null), D("label", e ?? null), D("hint", o ?? null), D("error", g ?? null), D("locale", y ?? null), D("variant", w && w !== "default" ? w : null);
1210
+ }, [
1211
+ f,
1212
+ t,
1213
+ s,
1214
+ i,
1215
+ u,
1216
+ b,
1217
+ n,
1218
+ r,
1219
+ d,
1220
+ m,
1221
+ l,
1222
+ E,
1223
+ p,
1224
+ L,
1225
+ v,
1226
+ a,
1227
+ A,
1228
+ e,
1229
+ o,
1230
+ g,
1231
+ y,
1232
+ w
1233
+ ]), F.createElement("ui-time-picker", { ref: P, ...H }, B);
1234
+ });
1235
+ Xe.displayName = "TimePicker";
1236
+ const Ye = F.forwardRef(function({
1237
+ value: f,
1238
+ defaultValue: t,
1239
+ open: s,
1240
+ defaultOpen: i,
1241
+ min: u,
1242
+ max: b,
1243
+ locale: n,
1244
+ weekStart: r,
1245
+ size: d,
1246
+ variant: m,
1247
+ step: l,
1248
+ format: E,
1249
+ disabled: p,
1250
+ readOnly: L,
1251
+ required: v,
1252
+ name: a,
1253
+ closeOnSelect: A,
1254
+ clearable: e,
1255
+ allowInput: o,
1256
+ mode: g,
1257
+ label: y,
1258
+ hint: w,
1259
+ error: c,
1260
+ onInput: R,
1261
+ onChange: h,
1262
+ onValueChange: k,
1263
+ onOpen: x,
1264
+ onClose: q,
1265
+ onInvalid: B,
1266
+ children: H,
1267
+ ...Y
1268
+ }, P) {
1269
+ const T = X(null);
1270
+ return z(P, () => T.current), S(() => {
1271
+ const D = T.current;
1272
+ if (!D)
1273
+ return;
1274
+ const $ = (Q) => {
1275
+ const _ = Q.detail;
1276
+ _ && (R == null || R(_));
1277
+ }, J = (Q) => {
1278
+ const _ = Q.detail;
1279
+ _ && (h == null || h(_), k == null || k(_.value));
1280
+ }, G = (Q) => {
1281
+ const _ = Q.detail;
1282
+ _ && (B == null || B(_));
1283
+ };
1284
+ return D.addEventListener("input", $), D.addEventListener("change", J), D.addEventListener("open", x), D.addEventListener("close", q), D.addEventListener("invalid", G), () => {
1285
+ D.removeEventListener("input", $), D.removeEventListener("change", J), D.removeEventListener("open", x), D.removeEventListener("close", q), D.removeEventListener("invalid", G);
1286
+ };
1287
+ }, [R, h, k, x, q, B]), S(() => {
1288
+ const D = T.current;
1289
+ if (!D)
1290
+ return;
1291
+ const $ = (G, Q) => {
1292
+ const _ = D.getAttribute(G);
1293
+ Q == null ? _ != null && D.removeAttribute(G) : _ !== Q && D.setAttribute(G, Q);
1294
+ }, J = (G, Q) => {
1295
+ Q ? $(G, "") : $(G, null);
1296
+ };
1297
+ $("value", f ?? null), $("default-value", t ?? null), typeof s == "boolean" ? J("open", s) : $("open", null), J("default-open", i), $("min", u ?? null), $("max", b ?? null), $("locale", n ?? null), $("week-start", typeof r == "number" ? String(r) : null), $("size", d && d !== "md" ? d : null), $("variant", m && m !== "default" ? m : null), $("step", typeof l == "number" ? String(l) : null), $("format", E && E !== "24h" ? E : null), J("disabled", p), J("readonly", L), J("required", v), $("name", a ?? null), J("close-on-select", A), J("clearable", e), J("allow-input", o), $("mode", g && g !== "popover" ? g : null), $("label", y ?? null), $("hint", w ?? null), $("error", c ?? null);
1298
+ }, [
1299
+ f,
1300
+ t,
1301
+ s,
1302
+ i,
1303
+ u,
1304
+ b,
1305
+ n,
1306
+ r,
1307
+ d,
1308
+ m,
1309
+ l,
1310
+ E,
1311
+ p,
1312
+ L,
1313
+ v,
1314
+ a,
1315
+ A,
1316
+ e,
1317
+ o,
1318
+ g,
1319
+ y,
1320
+ w,
1321
+ c
1322
+ ]), F.createElement("ui-date-time-picker", { ref: T, ...Y }, H);
1323
+ });
1324
+ Ye.displayName = "DateTimePicker";
1325
+ const Ze = F.forwardRef(
1326
+ function({
1327
+ value: f,
1328
+ defaultValue: t,
1329
+ open: s,
1330
+ defaultOpen: i,
1331
+ min: u,
1332
+ max: b,
1333
+ locale: n,
1334
+ weekStart: r,
1335
+ size: d,
1336
+ variant: m,
1337
+ step: l,
1338
+ autoNormalize: E,
1339
+ allowPartial: p,
1340
+ disabled: L,
1341
+ readOnly: v,
1342
+ required: a,
1343
+ name: A,
1344
+ closeOnSelect: e,
1345
+ clearable: o,
1346
+ mode: g,
1347
+ label: y,
1348
+ hint: w,
1349
+ error: c,
1350
+ onInput: R,
1351
+ onChange: h,
1352
+ onValueChange: k,
1353
+ onOpen: x,
1354
+ onClose: q,
1355
+ onInvalid: B,
1356
+ children: H,
1357
+ ...Y
1358
+ }, P) {
1359
+ const T = X(null);
1360
+ return z(P, () => T.current), S(() => {
1361
+ const D = T.current;
1362
+ if (!D)
1363
+ return;
1364
+ const $ = (Q) => {
1365
+ const _ = Q.detail;
1366
+ _ && (R == null || R(_));
1367
+ }, J = (Q) => {
1368
+ const _ = Q.detail;
1369
+ _ && (h == null || h(_), k == null || k(_.value ? JSON.stringify(_.value) : null));
1370
+ }, G = (Q) => {
1371
+ const _ = Q.detail;
1372
+ _ && (B == null || B(_));
1373
+ };
1374
+ return D.addEventListener("input", $), D.addEventListener("change", J), D.addEventListener("open", x), D.addEventListener("close", q), D.addEventListener("invalid", G), () => {
1375
+ D.removeEventListener("input", $), D.removeEventListener("change", J), D.removeEventListener("open", x), D.removeEventListener("close", q), D.removeEventListener("invalid", G);
1376
+ };
1377
+ }, [R, h, k, x, q, B]), S(() => {
1378
+ const D = T.current;
1379
+ if (!D)
1380
+ return;
1381
+ const $ = (G, Q) => {
1382
+ const _ = D.getAttribute(G);
1383
+ Q == null ? _ != null && D.removeAttribute(G) : _ !== Q && D.setAttribute(G, Q);
1384
+ }, J = (G, Q) => {
1385
+ Q ? $(G, "") : $(G, null);
1386
+ };
1387
+ $("value", f ?? null), $("default-value", t ?? null), typeof s == "boolean" ? J("open", s) : $("open", null), J("default-open", i), $("min", u ?? null), $("max", b ?? null), $("locale", n ?? null), $("week-start", typeof r == "number" ? String(r) : null), $("size", d && d !== "md" ? d : null), $("variant", m && m !== "default" ? m : null), $("step", typeof l == "number" ? String(l) : null), J("auto-normalize", E), J("allow-partial", p), J("disabled", L), J("readonly", v), J("required", a), $("name", A ?? null), J("close-on-select", e), J("clearable", o), $("mode", g && g !== "popover" ? g : null), $("label", y ?? null), $("hint", w ?? null), $("error", c ?? null);
1388
+ }, [
1389
+ f,
1390
+ t,
1391
+ s,
1392
+ i,
1393
+ u,
1394
+ b,
1395
+ n,
1396
+ r,
1397
+ d,
1398
+ m,
1399
+ l,
1400
+ E,
1401
+ p,
1402
+ L,
1403
+ v,
1404
+ a,
1405
+ A,
1406
+ e,
1407
+ o,
1408
+ g,
1409
+ y,
1410
+ w,
1411
+ c
1412
+ ]), F.createElement("ui-date-range-time-picker", { ref: T, ...Y }, H);
1413
+ }
1414
+ );
1415
+ Ze.displayName = "DateRangeTimePicker";
1416
+ const Me = F.forwardRef(function({ tasks: f, variant: t, headless: s, children: i, ...u }, b) {
1417
+ const n = X(null);
1418
+ return z(b, () => n.current), S(() => {
1419
+ const r = n.current;
1420
+ if (!r)
1421
+ return;
1422
+ const d = (l, E) => {
1423
+ const p = r.getAttribute(l);
1424
+ if (E == null) {
1425
+ p != null && r.removeAttribute(l);
1426
+ return;
1427
+ }
1428
+ p !== E && r.setAttribute(l, E);
1429
+ }, m = (l, E) => {
1430
+ E ? d(l, "") : d(l, null);
1431
+ };
1432
+ if (f && f.length)
1433
+ try {
1434
+ d("tasks", JSON.stringify(f));
1435
+ } catch {
1436
+ d("tasks", null);
1437
+ }
1438
+ else
1439
+ d("tasks", null);
1440
+ d("variant", t && t !== "default" ? t : null), m("headless", s);
1441
+ }, [f, t, s]), F.createElement("ui-gantt", { ref: n, ...u }, i);
1442
+ });
1443
+ Me.displayName = "Gantt";
1444
+ const ze = F.forwardRef(function({
1445
+ steps: f,
1446
+ value: t,
1447
+ orientation: s,
1448
+ variant: i,
1449
+ size: u,
1450
+ clickable: b,
1451
+ linear: n,
1452
+ headless: r,
1453
+ onChange: d,
1454
+ onSelect: m,
1455
+ children: l,
1456
+ ...E
1457
+ }, p) {
1458
+ const L = X(null);
1459
+ return z(p, () => L.current), S(() => {
1460
+ const v = L.current;
1461
+ if (!v)
1462
+ return;
1463
+ const a = (e) => {
1464
+ const o = e.detail;
1465
+ o && (d == null || d(o));
1466
+ }, A = (e) => {
1467
+ const o = e.detail;
1468
+ o && (m == null || m(o));
1469
+ };
1470
+ return v.addEventListener("change", a), v.addEventListener("select", A), () => {
1471
+ v.removeEventListener("change", a), v.removeEventListener("select", A);
1472
+ };
1473
+ }, [d, m]), S(() => {
1474
+ const v = L.current;
1475
+ if (!v)
1476
+ return;
1477
+ const a = (e, o) => {
1478
+ const g = v.getAttribute(e);
1479
+ if (o == null) {
1480
+ g != null && v.removeAttribute(e);
1481
+ return;
1482
+ }
1483
+ g !== o && v.setAttribute(e, o);
1484
+ }, A = (e, o) => {
1485
+ o ? a(e, "") : a(e, null);
1486
+ };
1487
+ if (f && f.length)
1488
+ try {
1489
+ a("steps", JSON.stringify(f));
1490
+ } catch {
1491
+ a("steps", null);
1492
+ }
1493
+ else
1494
+ a("steps", null);
1495
+ a("value", t || null), a("orientation", s && s !== "horizontal" ? s : null), a("variant", i && i !== "default" ? i : null), a("size", u && u !== "md" ? u : null), A("clickable", b), A("linear", n), A("headless", r);
1496
+ }, [f, t, s, i, u, b, n, r]), F.createElement("ui-stepper", { ref: L, ...E }, l);
1497
+ });
1498
+ ze.displayName = "Stepper";
1499
+ const We = F.forwardRef(function({
1500
+ value: f,
1501
+ linear: t,
1502
+ showStepper: s,
1503
+ stepperPosition: i,
1504
+ hideControls: u,
1505
+ keepMounted: b,
1506
+ variant: n,
1507
+ headless: r,
1508
+ nextLabel: d,
1509
+ prevLabel: m,
1510
+ finishLabel: l,
1511
+ onBeforeChange: E,
1512
+ onChange: p,
1513
+ onStepChange: L,
1514
+ onComplete: v,
1515
+ children: a,
1516
+ ...A
1517
+ }, e) {
1518
+ const o = X(null);
1519
+ return z(e, () => o.current), S(() => {
1520
+ const g = o.current;
1521
+ if (!g)
1522
+ return;
1523
+ const y = (h) => {
1524
+ if (!E)
1525
+ return;
1526
+ const k = h.detail;
1527
+ E(k) === !1 && h.preventDefault();
1528
+ }, w = (h) => {
1529
+ const k = h.detail;
1530
+ k && (p == null || p(k));
1531
+ }, c = (h) => {
1532
+ const k = h.detail;
1533
+ k && (L == null || L(k));
1534
+ }, R = (h) => {
1535
+ const k = h.detail;
1536
+ k && (v == null || v(k));
1537
+ };
1538
+ return g.addEventListener("before-change", y), g.addEventListener("change", w), g.addEventListener("step-change", c), g.addEventListener("complete", R), () => {
1539
+ g.removeEventListener("before-change", y), g.removeEventListener("change", w), g.removeEventListener("step-change", c), g.removeEventListener("complete", R);
1540
+ };
1541
+ }, [E, p, L, v]), S(() => {
1542
+ const g = o.current;
1543
+ if (!g)
1544
+ return;
1545
+ const y = (c, R) => {
1546
+ const h = g.getAttribute(c);
1547
+ if (R == null) {
1548
+ h != null && g.removeAttribute(c);
1549
+ return;
1550
+ }
1551
+ h !== R && g.setAttribute(c, R);
1552
+ }, w = (c, R, h) => {
1553
+ if (typeof R == "boolean") {
1554
+ R ? y(c, "") : y(c, null);
1555
+ return;
1556
+ }
1557
+ h !== void 0 && (h ? y(c, "") : y(c, null));
1558
+ };
1559
+ y("value", f || null), w("linear", t), typeof s == "boolean" ? y("show-stepper", s ? "true" : "false") : y("show-stepper", null), y("stepper-position", i && i !== "top" ? i : null), w("hide-controls", u), w("keep-mounted", b), y("variant", n && n !== "default" ? n : null), w("headless", r), y("next-label", d || null), y("prev-label", m || null), y("finish-label", l || null);
1560
+ }, [f, t, s, i, u, b, n, r, d, m, l]), F.createElement("ui-wizard", { ref: o, ...A }, a);
1561
+ });
1562
+ We.displayName = "Wizard";
1563
+ const Ie = F.forwardRef(function({
1564
+ open: f,
1565
+ mode: t,
1566
+ orientation: s,
1567
+ variant: i,
1568
+ floating: u,
1569
+ placement: b,
1570
+ collapsible: n,
1571
+ label: r,
1572
+ headless: d,
1573
+ onSelect: m,
1574
+ onOpenChange: l,
1575
+ onToggle: E,
1576
+ children: p,
1577
+ ...L
1578
+ }, v) {
1579
+ const a = X(null);
1580
+ return z(v, () => a.current), S(() => {
1581
+ const A = a.current;
1582
+ if (!A)
1583
+ return;
1584
+ const e = (y) => {
1585
+ const w = y.detail;
1586
+ w && (m == null || m(w));
1587
+ }, o = (y) => {
1588
+ var c;
1589
+ const w = (c = y.detail) == null ? void 0 : c.open;
1590
+ typeof w == "boolean" && (l == null || l(w));
1591
+ }, g = (y) => {
1592
+ var c;
1593
+ const w = (c = y.detail) == null ? void 0 : c.open;
1594
+ typeof w == "boolean" && (E == null || E(w));
1595
+ };
1596
+ return A.addEventListener("select", e), A.addEventListener("change", o), A.addEventListener("toggle", g), () => {
1597
+ A.removeEventListener("select", e), A.removeEventListener("change", o), A.removeEventListener("toggle", g);
1598
+ };
1599
+ }, [m, l, E]), S(() => {
1600
+ const A = a.current;
1601
+ if (!A)
1602
+ return;
1603
+ const e = (g, y) => {
1604
+ const w = A.getAttribute(g);
1605
+ if (y == null) {
1606
+ w != null && A.removeAttribute(g);
1607
+ return;
1608
+ }
1609
+ w !== y && A.setAttribute(g, y);
1610
+ }, o = (g, y) => {
1611
+ y ? e(g, "") : e(g, null);
1612
+ };
1613
+ typeof f == "boolean" ? o("open", f) : e("open", null), e("mode", t && t !== "bar" ? t : null), e("orientation", s && s !== "horizontal" ? s : null), e("variant", i && i !== "default" ? i : null), o("floating", u), e("placement", b && b !== "bottom-right" ? b : null), o("collapsible", n), e("label", r || null), o("headless", d);
1614
+ }, [f, t, s, i, u, b, n, r, d]), F.createElement("ui-quick-actions", { ref: a, ...L }, p);
1615
+ });
1616
+ Ie.displayName = "QuickActions";
1617
+ function tr(N) {
1618
+ const {
1619
+ selected: f,
1620
+ orientation: t,
1621
+ activation: s,
1622
+ loop: i,
1623
+ collapsible: u,
1624
+ headless: b,
1625
+ onChange: n,
1626
+ onSelect: r,
1627
+ children: d,
1628
+ ...m
1629
+ } = N, l = X(null);
1630
+ return S(() => {
1631
+ const E = l.current;
1632
+ if (!E)
1633
+ return;
1634
+ const p = (L) => {
1635
+ const v = L.detail;
1636
+ v && (n == null || n(v), r == null || r(v.selected));
1637
+ };
1638
+ return E.addEventListener("change", p), () => E.removeEventListener("change", p);
1639
+ }, [n, r]), S(() => {
1640
+ const E = l.current;
1641
+ E && (typeof f == "number" ? E.setAttribute("selected", String(f)) : E.removeAttribute("selected"), t ? E.setAttribute("orientation", t) : E.removeAttribute("orientation"), s ? E.setAttribute("activation", s) : E.removeAttribute("activation"), typeof i == "boolean" ? E.setAttribute("loop", String(i)) : E.removeAttribute("loop"), u ? E.setAttribute("collapsible", "") : E.removeAttribute("collapsible"), b ? E.setAttribute("headless", "") : E.removeAttribute("headless"));
1642
+ }, [f, t, s, i, u, b]), F.createElement("ui-navigation-menu", { ref: l, ...m }, d);
1643
+ }
1644
+ function rr(N) {
1645
+ const {
1646
+ selected: f,
1647
+ open: t,
1648
+ loop: s,
1649
+ headless: i,
1650
+ orientation: u,
1651
+ placement: b,
1652
+ variant: n,
1653
+ density: r,
1654
+ shape: d,
1655
+ elevation: m,
1656
+ tone: l,
1657
+ closeOnSelect: E,
1658
+ typeahead: p,
1659
+ onChange: L,
1660
+ onOpen: v,
1661
+ onClose: a,
1662
+ onSelect: A,
1663
+ children: e,
1664
+ ...o
1665
+ } = N, g = X(null);
1666
+ return S(() => {
1667
+ const y = g.current;
1668
+ if (!y)
1669
+ return;
1670
+ const w = (k) => {
1671
+ const x = k.detail;
1672
+ x && (L == null || L(x));
1673
+ }, c = (k) => {
1674
+ const x = k.detail;
1675
+ typeof (x == null ? void 0 : x.selected) == "number" ? v == null || v(x.selected) : v == null || v(-1);
1676
+ }, R = () => a == null ? void 0 : a(), h = (k) => {
1677
+ const x = k.detail;
1678
+ x && (A == null || A(x));
1679
+ };
1680
+ return y.addEventListener("change", w), y.addEventListener("open", c), y.addEventListener("close", R), y.addEventListener("select", h), () => {
1681
+ y.removeEventListener("change", w), y.removeEventListener("open", c), y.removeEventListener("close", R), y.removeEventListener("select", h);
1682
+ };
1683
+ }, [L, v, a, A]), S(() => {
1684
+ const y = g.current;
1685
+ y && (typeof f == "number" ? y.setAttribute("selected", String(f)) : y.removeAttribute("selected"), typeof t == "boolean" && t ? y.setAttribute("open", "") : y.removeAttribute("open"), typeof s == "boolean" ? y.setAttribute("loop", String(s)) : y.removeAttribute("loop"), i ? y.setAttribute("headless", "") : y.removeAttribute("headless"), u && u !== "horizontal" ? y.setAttribute("orientation", u) : y.removeAttribute("orientation"), b ? y.setAttribute("placement", b) : y.removeAttribute("placement"), n && n !== "default" ? y.setAttribute("variant", n) : y.removeAttribute("variant"), r && r !== "default" ? y.setAttribute("density", r) : y.removeAttribute("density"), d && d !== "default" ? y.setAttribute("shape", d) : y.removeAttribute("shape"), m && m !== "default" ? y.setAttribute("elevation", m) : y.removeAttribute("elevation"), l && l !== "default" && l !== "brand" ? y.setAttribute("tone", l) : y.removeAttribute("tone"), E == null ? y.removeAttribute("close-on-select") : y.setAttribute("close-on-select", E ? "true" : "false"), p == null ? y.removeAttribute("typeahead") : y.setAttribute("typeahead", p ? "true" : "false"));
1686
+ }, [
1687
+ f,
1688
+ t,
1689
+ s,
1690
+ i,
1691
+ u,
1692
+ b,
1693
+ n,
1694
+ r,
1695
+ d,
1696
+ m,
1697
+ l,
1698
+ E,
1699
+ p
1700
+ ]), F.createElement("ui-menubar", { ref: g, ...o }, e);
1701
+ }
1702
+ const Oe = typeof window < "u" ? F.useLayoutEffect : F.useEffect, Ve = F.forwardRef(function(f, t) {
1703
+ const {
1704
+ open: s,
1705
+ title: i,
1706
+ description: u,
1707
+ closable: b,
1708
+ dismissible: n,
1709
+ closeOnOverlay: r,
1710
+ closeOnEsc: d,
1711
+ lockWhileLoading: m,
1712
+ roleType: l,
1713
+ size: E,
1714
+ state: p,
1715
+ initialFocus: L,
1716
+ submitText: v,
1717
+ cancelText: a,
1718
+ loadingText: A,
1719
+ dialogId: e,
1720
+ config: o,
1721
+ headless: g,
1722
+ onOpen: y,
1723
+ onClose: w,
1724
+ onRequestClose: c,
1725
+ onDialogOpen: R,
1726
+ onDialogSubmit: h,
1727
+ onDialogCancel: k,
1728
+ onDialogDismiss: x,
1729
+ onDialogClose: q,
1730
+ children: B,
1731
+ ...H
1732
+ } = f, Y = X(null);
1733
+ return F.useImperativeHandle(t, () => Y.current), S(() => {
1734
+ const P = Y.current;
1735
+ if (!P)
1736
+ return;
1737
+ const T = () => y == null ? void 0 : y(), D = () => w == null ? void 0 : w(), $ = (K) => {
1738
+ const j = K.detail;
1739
+ j && (c == null || c(j));
1740
+ }, J = (K) => R == null ? void 0 : R(K.detail), G = (K) => h == null ? void 0 : h(K.detail), Q = (K) => k == null ? void 0 : k(K.detail), _ = (K) => x == null ? void 0 : x(K.detail), U = (K) => q == null ? void 0 : q(K.detail);
1741
+ return P.addEventListener("open", T), P.addEventListener("close", D), P.addEventListener("request-close", $), P.addEventListener("ui-open", J), P.addEventListener("ui-submit", G), P.addEventListener("ui-cancel", Q), P.addEventListener("ui-dismiss", _), P.addEventListener("ui-close", U), () => {
1742
+ P.removeEventListener("open", T), P.removeEventListener("close", D), P.removeEventListener("request-close", $), P.removeEventListener("ui-open", J), P.removeEventListener("ui-submit", G), P.removeEventListener("ui-cancel", Q), P.removeEventListener("ui-dismiss", _), P.removeEventListener("ui-close", U);
1743
+ };
1744
+ }, [y, w, c, R, h, k, x, q]), Oe(() => {
1745
+ const P = Y.current;
1746
+ if (!P)
1747
+ return;
1748
+ typeof s == "boolean" && (s ? P.setAttribute("open", "") : P.removeAttribute("open")), i ? P.setAttribute("title", i) : P.removeAttribute("title"), u ? P.setAttribute("description", u) : P.removeAttribute("description");
1749
+ const T = typeof n == "boolean" ? n : b;
1750
+ typeof T == "boolean" ? (P.setAttribute("dismissible", String(T)), P.setAttribute("closable", String(T))) : (P.removeAttribute("dismissible"), P.removeAttribute("closable")), typeof r == "boolean" ? (P.setAttribute("close-on-overlay", String(r)), P.setAttribute("close-on-backdrop", String(r))) : (P.removeAttribute("close-on-overlay"), P.removeAttribute("close-on-backdrop")), typeof d == "boolean" ? P.setAttribute("close-on-esc", String(d)) : P.removeAttribute("close-on-esc"), typeof m == "boolean" ? P.setAttribute("lock-while-loading", String(m)) : P.removeAttribute("lock-while-loading"), l ? P.setAttribute("role", l) : P.removeAttribute("role"), E && E !== "md" && E !== "2" ? P.setAttribute("size", E) : P.removeAttribute("size"), p && p !== "idle" ? P.setAttribute("state", p) : P.removeAttribute("state"), L ? P.setAttribute("initial-focus", L) : P.removeAttribute("initial-focus"), v ? P.setAttribute("submit-text", v) : P.removeAttribute("submit-text"), a ? P.setAttribute("cancel-text", a) : P.removeAttribute("cancel-text"), A ? P.setAttribute("loading-text", A) : P.removeAttribute("loading-text"), e && (P.dialogId = e), o && (P.config = o), g ? P.setAttribute("headless", "") : P.removeAttribute("headless");
1751
+ }, [
1752
+ s,
1753
+ i,
1754
+ u,
1755
+ b,
1756
+ n,
1757
+ r,
1758
+ d,
1759
+ m,
1760
+ l,
1761
+ E,
1762
+ p,
1763
+ L,
1764
+ v,
1765
+ a,
1766
+ A,
1767
+ e,
1768
+ o,
1769
+ g
1770
+ ]), F.createElement("ui-dialog", { ref: Y, ...H }, B);
1771
+ });
1772
+ Ve.displayName = "Dialog";
1773
+ const ge = be(null);
1774
+ function ir({ children: N, hostId: f = "ui-dialog-react-host" }) {
1775
+ const t = X(null);
1776
+ t.current || (t.current = Se()), S(() => {
1777
+ var u;
1778
+ if (typeof document > "u")
1779
+ return;
1780
+ let i = document.getElementById(f);
1781
+ return i || (i = document.createElement("div"), i.id = f, i.setAttribute("data-ui-dialog-react-host", "true"), document.body.appendChild(i)), (u = t.current) == null || u.setContainer(i), () => {
1782
+ var b;
1783
+ (b = t.current) == null || b.destroy("unmount"), t.current = null, i && i.parentElement && i.parentElement.removeChild(i);
1784
+ };
1785
+ }, [f]);
1786
+ const s = Le(
1787
+ () => ({
1788
+ open: (i = {}) => {
1789
+ var u;
1790
+ return ((u = t.current) == null ? void 0 : u.open(i)) ?? Promise.resolve({ id: "", action: "dismiss" });
1791
+ },
1792
+ confirm: (i = {}) => {
1793
+ var u;
1794
+ return ((u = t.current) == null ? void 0 : u.confirm(i)) ?? Promise.resolve({ id: "", action: "dismiss" });
1795
+ }
1796
+ }),
1797
+ []
1798
+ );
1799
+ return /* @__PURE__ */ F.createElement(ge.Provider, { value: s }, N);
1800
+ }
1801
+ function nr() {
1802
+ const N = me(ge);
1803
+ if (!N)
1804
+ throw new Error("useDialog must be used within <DialogProvider>.");
1805
+ return N;
1806
+ }
1807
+ const Ce = F.forwardRef(function({ children: f, onOpen: t, onClose: s, ...i }, u) {
1808
+ const b = X(null);
1809
+ return F.useImperativeHandle(u, () => b.current), S(() => {
1810
+ const n = b.current;
1811
+ if (!n)
1812
+ return;
1813
+ const r = () => t == null ? void 0 : t(), d = () => s == null ? void 0 : s();
1814
+ return n.addEventListener("open", r), n.addEventListener("close", d), () => {
1815
+ n.removeEventListener("open", r), n.removeEventListener("close", d);
1816
+ };
1817
+ }, [t, s]), F.createElement("ui-popover", { ref: b, ...i }, f);
1818
+ });
1819
+ Ce.displayName = "Popover";
1820
+ const et = F.forwardRef(function({
1821
+ children: f,
1822
+ selected: t,
1823
+ value: s,
1824
+ orientation: i,
1825
+ activation: u,
1826
+ variant: b,
1827
+ size: n,
1828
+ tone: r,
1829
+ stretched: d,
1830
+ headless: m,
1831
+ onChange: l,
1832
+ onTabChange: E,
1833
+ ...p
1834
+ }, L) {
1835
+ const v = X(null);
1836
+ return z(L, () => v.current), S(() => {
1837
+ const a = v.current;
1838
+ if (!a)
1839
+ return;
1840
+ const A = (e) => {
1841
+ const o = e.detail;
1842
+ o && (l == null || l(o.index), E == null || E(o));
1843
+ };
1844
+ return a.addEventListener("change", A), () => {
1845
+ a.removeEventListener("change", A);
1846
+ };
1847
+ }, [l, E]), S(() => {
1848
+ const a = v.current;
1849
+ if (!a)
1850
+ return;
1851
+ const A = (o, g) => {
1852
+ const y = a.getAttribute(o);
1853
+ if (g == null) {
1854
+ y != null && a.removeAttribute(o);
1855
+ return;
1856
+ }
1857
+ y !== g && a.setAttribute(o, g);
1858
+ }, e = (o, g) => {
1859
+ g ? A(o, "") : A(o, null);
1860
+ };
1861
+ A("selected", t != null ? String(t) : null), A("value", s || null), A("orientation", i && i !== "horizontal" ? i : null), A("activation", u && u !== "auto" ? u : null), A("variant", b && b !== "default" ? b : null), A("size", n && n !== "md" ? n : null), A("tone", r && r !== "brand" ? r : null), e("stretched", d), e("headless", m);
1862
+ }, [t, s, i, u, b, n, r, d, m]), F.createElement("ui-tabs", { ref: v, ...p }, f);
1863
+ });
1864
+ et.displayName = "Tabs";
1865
+ const tt = F.forwardRef(function({
1866
+ children: f,
1867
+ open: t,
1868
+ placement: s,
1869
+ variant: i,
1870
+ density: u,
1871
+ shape: b,
1872
+ elevation: n,
1873
+ tone: r,
1874
+ closeOnSelect: d,
1875
+ typeahead: m,
1876
+ onOpen: l,
1877
+ onClose: E,
1878
+ onChange: p,
1879
+ onSelect: L,
1880
+ onSelectDetail: v,
1881
+ ...a
1882
+ }, A) {
1883
+ const e = X(null);
1884
+ return F.useImperativeHandle(A, () => e.current), S(() => {
1885
+ const o = e.current;
1886
+ if (!o)
1887
+ return;
1888
+ const g = () => l == null ? void 0 : l(), y = () => E == null ? void 0 : E(), w = (R) => {
1889
+ var k;
1890
+ const h = (k = R.detail) == null ? void 0 : k.open;
1891
+ typeof h == "boolean" && (p == null || p(h));
1892
+ }, c = (R) => {
1893
+ const h = R.detail || {};
1894
+ v == null || v(h), typeof h.index == "number" && (L == null || L(h.index));
1895
+ };
1896
+ return o.addEventListener("open", g), o.addEventListener("close", y), o.addEventListener("change", w), o.addEventListener("select", c), () => {
1897
+ o.removeEventListener("open", g), o.removeEventListener("close", y), o.removeEventListener("change", w), o.removeEventListener("select", c);
1898
+ };
1899
+ }, [l, E, p, L, v]), S(() => {
1900
+ const o = e.current;
1901
+ !o || t == null || (t ? o.setAttribute("open", "") : o.removeAttribute("open"));
1902
+ }, [t]), S(() => {
1903
+ const o = e.current;
1904
+ o && (s ? o.setAttribute("placement", s) : o.removeAttribute("placement"));
1905
+ }, [s]), S(() => {
1906
+ const o = e.current;
1907
+ o && (i && i !== "default" ? o.setAttribute("variant", i) : o.removeAttribute("variant"));
1908
+ }, [i]), S(() => {
1909
+ const o = e.current;
1910
+ o && (u && u !== "default" ? o.setAttribute("density", u) : o.removeAttribute("density"));
1911
+ }, [u]), S(() => {
1912
+ const o = e.current;
1913
+ o && (b && b !== "default" ? o.setAttribute("shape", b) : o.removeAttribute("shape"));
1914
+ }, [b]), S(() => {
1915
+ const o = e.current;
1916
+ o && (n && n !== "default" ? o.setAttribute("elevation", n) : o.removeAttribute("elevation"));
1917
+ }, [n]), S(() => {
1918
+ const o = e.current;
1919
+ o && (r && r !== "default" && r !== "brand" ? o.setAttribute("tone", r) : o.removeAttribute("tone"));
1920
+ }, [r]), S(() => {
1921
+ const o = e.current;
1922
+ if (o) {
1923
+ if (d == null) {
1924
+ o.removeAttribute("close-on-select");
1925
+ return;
1926
+ }
1927
+ o.setAttribute("close-on-select", d ? "true" : "false");
1928
+ }
1929
+ }, [d]), S(() => {
1930
+ const o = e.current;
1931
+ if (o) {
1932
+ if (m == null) {
1933
+ o.removeAttribute("typeahead");
1934
+ return;
1935
+ }
1936
+ o.setAttribute("typeahead", m ? "true" : "false");
1937
+ }
1938
+ }, [m]), F.createElement("ui-menu", { ref: e, ...a }, f);
1939
+ });
1940
+ tt.displayName = "Menu";
1941
+ const rt = F.forwardRef(function({
1942
+ children: f,
1943
+ name: t,
1944
+ iconVariant: s,
1945
+ size: i,
1946
+ color: u,
1947
+ secondaryColor: b,
1948
+ variant: n,
1949
+ tone: r,
1950
+ shape: d,
1951
+ spin: m,
1952
+ pulse: l,
1953
+ badge: E,
1954
+ label: p,
1955
+ decorative: L,
1956
+ strokeWidth: v,
1957
+ absoluteStrokeWidth: a,
1958
+ strokeLinecap: A,
1959
+ strokeLinejoin: e,
1960
+ rotate: o,
1961
+ flip: g,
1962
+ rtl: y,
1963
+ ...w
1964
+ }, c) {
1965
+ const R = X(null);
1966
+ return z(c, () => R.current), S(() => {
1967
+ const h = R.current;
1968
+ h && (t ? h.setAttribute("name", t) : h.removeAttribute("name"), s ? h.setAttribute("icon-variant", s) : h.removeAttribute("icon-variant"), i != null && i !== "" ? h.setAttribute("size", String(i)) : h.removeAttribute("size"), u ? h.setAttribute("color", u) : h.removeAttribute("color"), b ? h.setAttribute("secondary-color", b) : h.removeAttribute("secondary-color"), n && n !== "default" ? h.setAttribute("variant", n) : h.removeAttribute("variant"), r && r !== "default" ? h.setAttribute("tone", r) : h.removeAttribute("tone"), d && d !== "default" ? h.setAttribute("shape", d) : h.removeAttribute("shape"), m ? h.setAttribute("spin", "") : h.removeAttribute("spin"), l ? h.setAttribute("pulse", "") : h.removeAttribute("pulse"), E ? h.setAttribute("badge", "") : h.removeAttribute("badge"), p ? h.setAttribute("label", p) : h.removeAttribute("label"), L ? h.setAttribute("decorative", "") : h.removeAttribute("decorative"), v != null && v !== "" ? h.setAttribute("stroke-width", String(v)) : h.removeAttribute("stroke-width"), a ? h.setAttribute("absolute-stroke-width", "") : h.removeAttribute("absolute-stroke-width"), A ? h.setAttribute("stroke-linecap", A) : h.removeAttribute("stroke-linecap"), e ? h.setAttribute("stroke-linejoin", e) : h.removeAttribute("stroke-linejoin"), o != null && Number.isFinite(o) ? h.setAttribute("rotate", String(o)) : h.removeAttribute("rotate"), g ? h.setAttribute("flip", g) : h.removeAttribute("flip"), y ? h.setAttribute("rtl", "") : h.removeAttribute("rtl"));
1969
+ }, [
1970
+ t,
1971
+ s,
1972
+ i,
1973
+ u,
1974
+ b,
1975
+ n,
1976
+ r,
1977
+ d,
1978
+ m,
1979
+ l,
1980
+ E,
1981
+ p,
1982
+ L,
1983
+ v,
1984
+ a,
1985
+ A,
1986
+ e,
1987
+ o,
1988
+ g,
1989
+ y
1990
+ ]), F.createElement("ui-icon", { ref: R, ...w }, f);
1991
+ });
1992
+ rt.displayName = "Icon";
1993
+ const fe = {
1994
+ default: "",
1995
+ success: "Success: ",
1996
+ error: "Error: ",
1997
+ warning: "Warning: ",
1998
+ info: "Info: "
1999
+ };
2000
+ function lr(N, f = {}) {
2001
+ return oe(N, f);
2002
+ }
2003
+ const sr = {
2004
+ show(N, f = {}) {
2005
+ return oe(N, f);
2006
+ },
2007
+ success(N, f = {}) {
2008
+ return oe(`${fe.success}${N}`, f);
2009
+ },
2010
+ error(N, f = {}) {
2011
+ return oe(`${fe.error}${N}`, f);
2012
+ },
2013
+ warning(N, f = {}) {
2014
+ return oe(`${fe.warning}${N}`, f);
2015
+ },
2016
+ info(N, f = {}) {
2017
+ return oe(`${fe.info}${N}`, f);
2018
+ }
2019
+ };
2020
+ function ur() {
2021
+ return null;
2022
+ }
2023
+ const it = F.forwardRef(function({ children: f, headless: t, onShow: s, onHide: i, ...u }, b) {
2024
+ const n = X(null);
2025
+ return F.useImperativeHandle(b, () => n.current), S(() => {
2026
+ const r = n.current;
2027
+ if (!r)
2028
+ return;
2029
+ const d = (l) => {
2030
+ const E = l.detail;
2031
+ E && (s == null || s(E));
2032
+ }, m = (l) => {
2033
+ const E = l.detail;
2034
+ E && (i == null || i(E));
2035
+ };
2036
+ return r.addEventListener("show", d), r.addEventListener("hide", m), () => {
2037
+ r.removeEventListener("show", d), r.removeEventListener("hide", m);
2038
+ };
2039
+ }, [s, i]), S(() => {
2040
+ const r = n.current;
2041
+ r && (t ? r.setAttribute("headless", "") : r.removeAttribute("headless"));
2042
+ }, [t]), F.createElement("ui-toast", { ref: n, ...u }, f);
2043
+ });
2044
+ it.displayName = "Toast";
2045
+ function re(N, f) {
2046
+ if (typeof window > "u" || typeof customElements > "u" || customElements.get(N))
2047
+ return;
2048
+ const t = `__editora_warned_${N}`, s = window;
2049
+ s[t] || (s[t] = !0, console.warn(
2050
+ `[ui-react/${f}] ${N} is not registered. Import/register the matching web component before using this wrapper.`
2051
+ ));
2052
+ }
2053
+ function or(N) {
2054
+ const { children: f, anchorId: t, open: s, ...i } = N, u = X(null);
2055
+ return S(() => {
2056
+ re("ui-floating-toolbar", "FloatingToolbar");
2057
+ }, []), S(() => {
2058
+ var n, r;
2059
+ const b = u.current;
2060
+ b && (s && t ? (n = b.showForAnchorId) == null || n.call(b, t) : (r = b.hide) == null || r.call(b));
2061
+ }, [s, t]), F.createElement("ui-floating-toolbar", { ref: u, ...i }, f);
2062
+ }
2063
+ const nt = Z.forwardRef(function({ children: f, orientation: t, density: s, ariaLabel: i, ...u }, b) {
2064
+ const n = Z.useRef(null);
2065
+ return Z.useImperativeHandle(b, () => n.current), Z.useEffect(() => {
2066
+ re("ui-block-controls", "BlockControls");
2067
+ }, []), Z.useEffect(() => {
2068
+ const r = n.current;
2069
+ r && (t ? r.setAttribute("orientation", t) : r.removeAttribute("orientation"), s ? r.setAttribute("density", s) : r.removeAttribute("density"), i ? r.setAttribute("aria-label", i) : r.removeAttribute("aria-label"));
2070
+ }, [t, s, i]), Z.createElement("ui-block-controls", { ref: n, ...u }, f);
2071
+ });
2072
+ nt.displayName = "BlockControls";
2073
+ function cr(N) {
2074
+ const { children: f, open: t, onSelect: s, ...i } = N, u = X(null);
2075
+ return S(() => {
2076
+ re("ui-command-palette", "CommandPalette");
2077
+ }, []), S(() => {
2078
+ const b = u.current;
2079
+ if (!b)
2080
+ return;
2081
+ const n = (r) => {
2082
+ var m;
2083
+ const d = (m = r.detail) == null ? void 0 : m.index;
2084
+ typeof d == "number" && (s == null || s(d));
2085
+ };
2086
+ return b.addEventListener("select", n), t ? b.setAttribute("open", "") : b.removeAttribute("open"), () => b.removeEventListener("select", n);
2087
+ }, [t, s]), F.createElement("ui-command-palette", { ref: u, ...i }, f);
2088
+ }
2089
+ function fr(N) {
2090
+ const {
2091
+ items: f,
2092
+ anchorId: t,
2093
+ anchorPoint: s,
2094
+ open: i,
2095
+ variant: u,
2096
+ density: b,
2097
+ shape: n,
2098
+ elevation: r,
2099
+ tone: d,
2100
+ closeOnSelect: m,
2101
+ typeahead: l,
2102
+ children: E,
2103
+ onOpen: p,
2104
+ onClose: L,
2105
+ onChange: v,
2106
+ onSelect: a,
2107
+ ...A
2108
+ } = N, e = X(null);
2109
+ S(() => {
2110
+ const w = e.current;
2111
+ if (!w)
2112
+ return;
2113
+ const c = () => p == null ? void 0 : p(), R = () => L == null ? void 0 : L(), h = (x) => {
2114
+ var B;
2115
+ const q = (B = x.detail) == null ? void 0 : B.open;
2116
+ typeof q == "boolean" && (v == null || v(q));
2117
+ }, k = (x) => {
2118
+ a == null || a(x.detail);
2119
+ };
2120
+ return w.addEventListener("open", c), w.addEventListener("close", R), w.addEventListener("change", h), w.addEventListener("select", k), () => {
2121
+ w.removeEventListener("open", c), w.removeEventListener("close", R), w.removeEventListener("change", h), w.removeEventListener("select", k);
2122
+ };
2123
+ }, [p, L, v, a]), S(() => {
2124
+ const w = e.current;
2125
+ if (!(!w || i == null)) {
2126
+ if (!i) {
2127
+ w.close ? w.close() : w.open = !1;
2128
+ return;
2129
+ }
2130
+ if (s && w.openAt) {
2131
+ w.openAt(s);
2132
+ return;
2133
+ }
2134
+ if (t) {
2135
+ if (w.openForAnchorId) {
2136
+ w.openForAnchorId(t);
2137
+ return;
2138
+ }
2139
+ if (w.showForAnchorId) {
2140
+ w.showForAnchorId(t);
2141
+ return;
2142
+ }
2143
+ }
2144
+ w.open = !0;
2145
+ }
2146
+ }, [i, t, s]);
2147
+ const o = (w) => w ? w.map((c, R) => {
2148
+ if (c.separator)
2149
+ return /* @__PURE__ */ F.createElement("div", { key: R, className: "separator", role: "separator" });
2150
+ let h = null;
2151
+ c.icon && (h = typeof c.icon == "string" ? /* @__PURE__ */ F.createElement("span", { className: "icon" }, c.icon) : c.icon);
2152
+ let k = null;
2153
+ return c.submenu && (k = /* @__PURE__ */ F.createElement("div", { className: "submenu" }, o(c.submenu))), /* @__PURE__ */ F.createElement(
2154
+ "div",
2155
+ {
2156
+ key: R,
2157
+ className: "menuitem",
2158
+ role: "menuitem",
2159
+ tabIndex: c.disabled ? -1 : 0,
2160
+ "aria-disabled": c.disabled ? "true" : void 0,
2161
+ "data-value": c.value,
2162
+ onClick: c.disabled ? void 0 : c.onClick
2163
+ },
2164
+ h,
2165
+ /* @__PURE__ */ F.createElement("span", { className: "label" }, c.label),
2166
+ c.submenu && /* @__PURE__ */ F.createElement("span", { className: "submenu-arrow" }, "▶"),
2167
+ k
2168
+ );
2169
+ }) : null, g = F.Children.count(E) > 0, y = !!i && !s && !t;
2170
+ return /* @__PURE__ */ F.createElement(
2171
+ "ui-context-menu",
2172
+ {
2173
+ ref: e,
2174
+ ...A,
2175
+ ...y ? { open: "" } : {},
2176
+ ...u && u !== "default" ? { variant: u } : {},
2177
+ ...b && b !== "default" ? { density: b } : {},
2178
+ ...n && n !== "default" ? { shape: n } : {},
2179
+ ...r && r !== "default" ? { elevation: r } : {},
2180
+ ...d && d !== "default" && d !== "brand" ? { tone: d } : {},
2181
+ ...m == null ? {} : { "close-on-select": m ? "true" : "false" },
2182
+ ...l == null ? {} : { typeahead: l ? "true" : "false" }
2183
+ },
2184
+ g ? E : /* @__PURE__ */ F.createElement("div", { slot: "menu" }, o(f))
2185
+ );
2186
+ }
2187
+ function dr(N) {
2188
+ const {
2189
+ children: f,
2190
+ anchorId: t,
2191
+ open: s,
2192
+ placement: i,
2193
+ offset: u,
2194
+ strategy: b,
2195
+ arrow: n,
2196
+ variant: r,
2197
+ tone: d,
2198
+ radius: m,
2199
+ size: l,
2200
+ closeOnOutside: E,
2201
+ closeOnEscape: p,
2202
+ onOpen: L,
2203
+ onClose: v,
2204
+ onOpenChange: a,
2205
+ ...A
2206
+ } = N, e = X(null);
2207
+ return S(() => {
2208
+ re("ui-selection-popup", "SelectionPopup");
2209
+ }, []), S(() => {
2210
+ const o = e.current;
2211
+ if (!o)
2212
+ return;
2213
+ const g = () => {
2214
+ L == null || L(), a == null || a(!0);
2215
+ }, y = () => {
2216
+ v == null || v(), a == null || a(!1);
2217
+ };
2218
+ return o.addEventListener("open", g), o.addEventListener("close", y), () => {
2219
+ o.removeEventListener("open", g), o.removeEventListener("close", y);
2220
+ };
2221
+ }, [L, v, a]), S(() => {
2222
+ var w, c;
2223
+ const o = e.current;
2224
+ if (!o)
2225
+ return;
2226
+ const g = (R, h) => {
2227
+ const k = o.getAttribute(R);
2228
+ if (h == null) {
2229
+ k != null && o.removeAttribute(R);
2230
+ return;
2231
+ }
2232
+ k !== h && o.setAttribute(R, h);
2233
+ }, y = (R, h, k = void 0) => {
2234
+ if (h == null) {
2235
+ k !== void 0 && g(R, k ? null : "false");
2236
+ return;
2237
+ }
2238
+ h ? g(R, "") : g(R, "false");
2239
+ };
2240
+ g("anchor-id", t ?? null), g("placement", i && i !== "top" ? i : null), g("offset", typeof u == "number" && Number.isFinite(u) ? String(u) : null), g("strategy", b && b !== "fixed" ? b : null), g("variant", r && r !== "default" ? r : null), g("tone", d && d !== "brand" ? d : null), g("radius", m ? String(m) : null), g("size", l && l !== "md" ? l : null), y("arrow", n), y("close-on-outside", E, !0), y("close-on-escape", p, !0), s && t ? (w = o.openFor) == null || w.call(o, t) : s ? o.setAttribute("open", "") : s === !1 ? (c = o.close) == null || c.call(o) : o.removeAttribute("open");
2241
+ }, [
2242
+ s,
2243
+ t,
2244
+ i,
2245
+ u,
2246
+ b,
2247
+ n,
2248
+ r,
2249
+ d,
2250
+ m,
2251
+ l,
2252
+ E,
2253
+ p
2254
+ ]), F.createElement("ui-selection-popup", { ref: e, ...A }, f);
2255
+ }
2256
+ function ar(N) {
2257
+ const { children: f, open: t, position: s, ...i } = N, u = X(null);
2258
+ return S(() => {
2259
+ re("ui-plugin-panel", "PluginPanel");
2260
+ }, []), S(() => {
2261
+ const b = u.current;
2262
+ b && (t ? b.setAttribute("open", "") : b.removeAttribute("open"), s && b.setAttribute("position", s));
2263
+ }, [t, s]), F.createElement("ui-plugin-panel", { ref: u, ...i }, f);
2264
+ }
2265
+ const lt = F.forwardRef(function(f, t) {
2266
+ const {
2267
+ children: s,
2268
+ onSubmit: i,
2269
+ onInvalid: u,
2270
+ onValidate: b,
2271
+ onAutosave: n,
2272
+ onDirtyChange: r,
2273
+ novalidate: d,
2274
+ autosave: m,
2275
+ autosaveDelay: l,
2276
+ guardUnsaved: E,
2277
+ variant: p,
2278
+ tone: L,
2279
+ density: v,
2280
+ shape: a,
2281
+ elevation: A,
2282
+ gap: e,
2283
+ headless: o,
2284
+ loading: g,
2285
+ ...y
2286
+ } = f, w = X(null);
2287
+ return z(t, () => w.current), S(() => {
2288
+ const c = w.current;
2289
+ if (!c)
2290
+ return;
2291
+ const R = (B) => {
2292
+ const H = B.detail || {};
2293
+ i == null || i(H.values || {});
2294
+ }, h = (B) => {
2295
+ const H = B.detail || {};
2296
+ u == null || u(H.errors || {}, H.values || {});
2297
+ }, k = (B) => {
2298
+ const H = B.detail || {};
2299
+ b == null || b({ valid: !!H.valid, errors: H.errors || {} });
2300
+ }, x = (B) => {
2301
+ const H = B.detail || {};
2302
+ n == null || n(H.values || {});
2303
+ }, q = (B) => {
2304
+ const H = B.detail || {};
2305
+ r == null || r(!!H.dirty, H.values || {});
2306
+ };
2307
+ return c.addEventListener("submit", R), c.addEventListener("invalid", h), c.addEventListener("validate", k), c.addEventListener("autosave", x), c.addEventListener("dirty-change", q), () => {
2308
+ c.removeEventListener("submit", R), c.removeEventListener("invalid", h), c.removeEventListener("validate", k), c.removeEventListener("autosave", x), c.removeEventListener("dirty-change", q);
2309
+ };
2310
+ }, [i, u, b, n, r]), S(() => {
2311
+ const c = w.current;
2312
+ c && (d ? c.setAttribute("novalidate", "") : c.removeAttribute("novalidate"), m ? c.setAttribute("autosave", "") : c.removeAttribute("autosave"), typeof l == "number" && Number.isFinite(l) ? c.setAttribute("autosave-delay", String(l)) : c.removeAttribute("autosave-delay"), E ? c.setAttribute("guard-unsaved", "") : c.removeAttribute("guard-unsaved"), p && p !== "default" ? c.setAttribute("variant", p) : c.removeAttribute("variant"), L && L !== "default" ? c.setAttribute("tone", L) : c.removeAttribute("tone"), v && v !== "default" ? c.setAttribute("density", v) : c.removeAttribute("density"), a && a !== "default" ? c.setAttribute("shape", a) : c.removeAttribute("shape"), A && A !== "default" ? c.setAttribute("elevation", A) : c.removeAttribute("elevation"), e ? c.setAttribute("gap", e) : c.removeAttribute("gap"), o ? c.setAttribute("headless", "") : c.removeAttribute("headless"), g ? c.setAttribute("loading", "") : c.removeAttribute("loading"));
2313
+ }, [d, m, l, E, p, L, v, a, A, e, o, g]), F.createElement("ui-form", { ref: w, ...y }, s);
2314
+ });
2315
+ lt.displayName = "Form";
2316
+ function br() {
2317
+ const N = X(null), f = ie(async () => {
2318
+ const n = N.current;
2319
+ return n ? await n.submit() : !1;
2320
+ }, []), t = ie(async () => {
2321
+ const n = N.current;
2322
+ return n ? await n.validate() : { valid: !0, errors: {} };
2323
+ }, []), s = ie(() => {
2324
+ var r;
2325
+ const n = N.current;
2326
+ return n ? (r = n.getValues) == null ? void 0 : r.call(n) : {};
2327
+ }, []), i = ie((n) => {
2328
+ var d;
2329
+ const r = N.current;
2330
+ return (d = r == null ? void 0 : r.reset) == null ? void 0 : d.call(r, n);
2331
+ }, []), u = ie(() => {
2332
+ var r;
2333
+ const n = N.current;
2334
+ return n ? typeof n.isDirty == "function" ? !!n.isDirty() : ((r = n.hasAttribute) == null ? void 0 : r.call(n, "dirty")) || !1 : !1;
2335
+ }, []), b = ie((n) => {
2336
+ var d;
2337
+ const r = N.current;
2338
+ return (d = r == null ? void 0 : r.markClean) == null ? void 0 : d.call(r, n);
2339
+ }, []);
2340
+ return { ref: N, submit: f, validate: t, getValues: s, reset: i, isDirty: u, markClean: b };
2341
+ }
2342
+ function mr(N) {
2343
+ const { placement: f = "bottom", offset: t = 8, open: s, onOpen: i, onClose: u, role: b = "menu" } = N || {}, n = X(null), r = X(null), d = X(null), [m, l] = ae({ top: 0, left: 0, placement: f }), E = typeof s < "u", [p, L] = ae(!!s), v = E ? s : p, a = (P) => {
2344
+ E || L(P), P ? i && i() : u && u();
2345
+ }, A = () => a(!v), e = () => a(!0), o = () => a(!1), g = ie(() => {
2346
+ const P = n.current, T = r.current;
2347
+ if (!P || !T)
2348
+ return;
2349
+ const D = Fe(P, T, { placement: f, offset: t });
2350
+ l({ top: Math.round(D.top), left: Math.round(D.left), placement: D.placement, arrow: D.x || D.y ? { x: D.x, y: D.y } : void 0 });
2351
+ }, [f, t]);
2352
+ S(() => {
2353
+ if (!v)
2354
+ return;
2355
+ const P = n.current, T = r.current;
2356
+ if (!P || !T)
2357
+ return;
2358
+ g();
2359
+ const D = () => {
2360
+ d.current && cancelAnimationFrame(d.current), d.current = requestAnimationFrame(() => g());
2361
+ }, $ = () => {
2362
+ d.current && cancelAnimationFrame(d.current), d.current = requestAnimationFrame(() => g());
2363
+ };
2364
+ window.addEventListener("scroll", D, !0), window.addEventListener("resize", $);
2365
+ let J = null, G = null;
2366
+ try {
2367
+ typeof ResizeObserver < "u" && (J = new ResizeObserver($), G = new ResizeObserver($), J.observe(P), G.observe(T));
2368
+ } catch {
2369
+ J = G = null;
2370
+ }
2371
+ return () => {
2372
+ window.removeEventListener("scroll", D, !0), window.removeEventListener("resize", $), J && J.disconnect(), G && G.disconnect(), d.current && cancelAnimationFrame(d.current);
2373
+ };
2374
+ }, [v, g]);
2375
+ const y = ie((P) => {
2376
+ n.current = P;
2377
+ }, []), w = ie((P) => {
2378
+ r.current = P;
2379
+ }, []), c = X(`floating-${Math.random().toString(36).slice(2, 9)}`), R = () => r.current ? Array.from(r.current.querySelectorAll('[role="menuitem"], .item, [data-menu-item]')).filter(Boolean) : [], h = (P) => {
2380
+ const T = R();
2381
+ if (!T.length)
2382
+ return;
2383
+ const D = Math.max(0, Math.min(T.length - 1, P));
2384
+ try {
2385
+ T[D].focus();
2386
+ } catch {
2387
+ }
2388
+ }, k = () => h(0), x = () => {
2389
+ const P = R();
2390
+ P.length && h(P.length - 1);
2391
+ }, q = () => {
2392
+ const P = R(), T = P.findIndex((D) => D === document.activeElement);
2393
+ h(T < 0 ? 0 : (T + 1) % P.length);
2394
+ }, B = () => {
2395
+ const P = R(), T = P.findIndex((D) => D === document.activeElement);
2396
+ h(T <= 0 ? P.length - 1 : T - 1);
2397
+ };
2398
+ return {
2399
+ referenceRef: y,
2400
+ floatingRef: w,
2401
+ coords: m,
2402
+ update: g,
2403
+ open: v,
2404
+ setOpen: a,
2405
+ toggle: A,
2406
+ openPopup: e,
2407
+ closePopup: o,
2408
+ getReferenceProps: (P = {}) => ({
2409
+ ref: y,
2410
+ "aria-haspopup": b,
2411
+ "aria-controls": c.current,
2412
+ "aria-expanded": v ? "true" : "false",
2413
+ onClick: (T) => {
2414
+ P.onClick && P.onClick(T), A();
2415
+ },
2416
+ onKeyDown: (T) => {
2417
+ P.onKeyDown && P.onKeyDown(T), T.key === "ArrowDown" && (T.preventDefault(), e(), setTimeout(() => k(), 0));
2418
+ },
2419
+ ...P
2420
+ }),
2421
+ getFloatingProps: (P = {}) => ({
2422
+ id: c.current,
2423
+ ref: w,
2424
+ role: b,
2425
+ tabIndex: -1,
2426
+ style: { position: "absolute", top: `${m.top}px`, left: `${m.left}px` },
2427
+ hidden: !v,
2428
+ onKeyDown: (T) => {
2429
+ P.onKeyDown && P.onKeyDown(T), T.key === "Escape" ? (T.preventDefault(), o()) : T.key === "ArrowDown" ? (T.preventDefault(), q()) : T.key === "ArrowUp" ? (T.preventDefault(), B()) : T.key === "Home" ? (T.preventDefault(), k()) : T.key === "End" && (T.preventDefault(), x());
2430
+ },
2431
+ ...P
2432
+ }),
2433
+ focusFirstItem: k,
2434
+ focusLastItem: x,
2435
+ focusNext: q,
2436
+ focusPrev: B
2437
+ };
2438
+ }
2439
+ function M(N) {
2440
+ if (N != null) {
2441
+ if (typeof N == "object")
2442
+ try {
2443
+ return JSON.stringify(N);
2444
+ } catch {
2445
+ return;
2446
+ }
2447
+ return String(N);
2448
+ }
2449
+ }
2450
+ function vr(N) {
2451
+ const {
2452
+ children: f,
2453
+ className: t,
2454
+ variant: s,
2455
+ tone: i,
2456
+ elevation: u,
2457
+ radius: b,
2458
+ interactive: n,
2459
+ headless: r,
2460
+ p: d,
2461
+ px: m,
2462
+ py: l,
2463
+ pt: E,
2464
+ pr: p,
2465
+ pb: L,
2466
+ pl: v,
2467
+ m: a,
2468
+ mx: A,
2469
+ my: e,
2470
+ mt: o,
2471
+ mr: g,
2472
+ mb: y,
2473
+ ml: w,
2474
+ width: c,
2475
+ w: R,
2476
+ minWidth: h,
2477
+ minW: k,
2478
+ maxWidth: x,
2479
+ maxW: q,
2480
+ height: B,
2481
+ h: H,
2482
+ minHeight: Y,
2483
+ minH: P,
2484
+ maxHeight: T,
2485
+ maxH: D,
2486
+ display: $,
2487
+ position: J,
2488
+ inset: G,
2489
+ top: Q,
2490
+ right: _,
2491
+ bottom: U,
2492
+ left: K,
2493
+ flexBasis: j,
2494
+ flexGrow: O,
2495
+ flexShrink: I,
2496
+ gridArea: le,
2497
+ gridColumn: se,
2498
+ gridColumnStart: te,
2499
+ gridColumnEnd: V,
2500
+ gridRow: ce,
2501
+ gridRowStart: C,
2502
+ gridRowEnd: W,
2503
+ align: Ne,
2504
+ bg: He,
2505
+ color: Re,
2506
+ ...ke
2507
+ } = N, Pe = {
2508
+ className: t,
2509
+ ...ke,
2510
+ p: M(d),
2511
+ px: M(m),
2512
+ py: M(l),
2513
+ pt: M(E),
2514
+ pr: M(p),
2515
+ pb: M(L),
2516
+ pl: M(v),
2517
+ m: M(a),
2518
+ mx: M(A),
2519
+ my: M(e),
2520
+ mt: M(o),
2521
+ mr: M(g),
2522
+ mb: M(y),
2523
+ ml: M(w),
2524
+ width: M(c),
2525
+ w: M(R),
2526
+ minwidth: M(h ?? k),
2527
+ maxwidth: M(x ?? q),
2528
+ height: M(B),
2529
+ h: M(H),
2530
+ minheight: M(Y ?? P),
2531
+ maxheight: M(T ?? D),
2532
+ display: M($),
2533
+ position: M(J),
2534
+ inset: M(G),
2535
+ top: M(Q),
2536
+ right: M(_),
2537
+ bottom: M(U),
2538
+ left: M(K),
2539
+ flexbasis: M(j),
2540
+ flexgrow: M(O),
2541
+ flexshrink: M(I),
2542
+ gridarea: M(le),
2543
+ gridcolumn: M(se),
2544
+ gridcolumnstart: M(te),
2545
+ gridcolumnend: M(V),
2546
+ gridrow: M(ce),
2547
+ gridrowstart: M(C),
2548
+ gridrowend: M(W),
2549
+ align: M(Ne),
2550
+ bg: M(He),
2551
+ color: M(Re),
2552
+ variant: s && s !== "default" ? s : void 0,
2553
+ tone: i && i !== "default" ? i : void 0,
2554
+ elevation: u && u !== "default" ? u : void 0,
2555
+ radius: b && b !== "default" ? b : void 0,
2556
+ interactive: n ? "" : void 0,
2557
+ headless: r ? "" : void 0
2558
+ };
2559
+ return F.createElement("ui-box", Pe, f);
2560
+ }
2561
+ function ne(N) {
2562
+ if (N != null) {
2563
+ if (typeof N == "object")
2564
+ try {
2565
+ return JSON.stringify(N);
2566
+ } catch {
2567
+ return;
2568
+ }
2569
+ return String(N);
2570
+ }
2571
+ }
2572
+ function Ar(N) {
2573
+ const {
2574
+ children: f,
2575
+ className: t,
2576
+ direction: s,
2577
+ align: i,
2578
+ justify: u,
2579
+ wrap: b,
2580
+ gap: n,
2581
+ rowGap: r,
2582
+ columnGap: d,
2583
+ display: m,
2584
+ headless: l,
2585
+ ...E
2586
+ } = N, p = {
2587
+ className: t,
2588
+ ...E,
2589
+ direction: ne(s),
2590
+ align: ne(i),
2591
+ justify: ne(u),
2592
+ wrap: ne(b),
2593
+ gap: ne(n),
2594
+ rowgap: ne(r),
2595
+ columngap: ne(d),
2596
+ display: ne(m),
2597
+ headless: l ? "" : void 0
2598
+ };
2599
+ return F.createElement("ui-flex", p, f);
2600
+ }
2601
+ function ee(N) {
2602
+ if (N != null) {
2603
+ if (typeof N == "object")
2604
+ try {
2605
+ return JSON.stringify(N);
2606
+ } catch {
2607
+ return;
2608
+ }
2609
+ return String(N);
2610
+ }
2611
+ }
2612
+ function pr(N) {
2613
+ const {
2614
+ children: f,
2615
+ className: t,
2616
+ columns: s,
2617
+ rows: i,
2618
+ gap: u,
2619
+ rowGap: b,
2620
+ columnGap: n,
2621
+ autoFlow: r,
2622
+ autoRows: d,
2623
+ autoColumns: m,
2624
+ align: l,
2625
+ justify: E,
2626
+ place: p,
2627
+ alignContent: L,
2628
+ justifyContent: v,
2629
+ placeContent: a,
2630
+ display: A,
2631
+ headless: e,
2632
+ ...o
2633
+ } = N, g = {
2634
+ className: t,
2635
+ ...o,
2636
+ columns: ee(s),
2637
+ rows: ee(i),
2638
+ gap: ee(u),
2639
+ rowgap: ee(b),
2640
+ columngap: ee(n),
2641
+ autoflow: ee(r),
2642
+ autorows: ee(d),
2643
+ autocolumns: ee(m),
2644
+ align: ee(l),
2645
+ justify: ee(E),
2646
+ place: ee(p),
2647
+ aligncontent: ee(L),
2648
+ justifycontent: ee(v),
2649
+ placecontent: ee(a),
2650
+ display: ee(A),
2651
+ headless: e ? "" : void 0
2652
+ };
2653
+ return F.createElement("ui-grid", g, f);
2654
+ }
2655
+ const st = F.forwardRef(function({
2656
+ size: f = "medium",
2657
+ variant: t = "default",
2658
+ tone: s = "neutral",
2659
+ radius: i = "md",
2660
+ density: u = "comfortable",
2661
+ inset: b,
2662
+ children: n,
2663
+ ...r
2664
+ }, d) {
2665
+ const m = X(null);
2666
+ return F.useImperativeHandle(d, () => m.current), S(() => {
2667
+ const l = m.current;
2668
+ if (!l)
2669
+ return;
2670
+ const E = (L, v) => {
2671
+ const a = l.getAttribute(L);
2672
+ if (v == null) {
2673
+ a != null && l.removeAttribute(L);
2674
+ return;
2675
+ }
2676
+ a !== v && l.setAttribute(L, v);
2677
+ }, p = (L, v) => {
2678
+ v ? l.hasAttribute(L) || l.setAttribute(L, "") : l.hasAttribute(L) && l.removeAttribute(L);
2679
+ };
2680
+ E("size", f !== "medium" ? f : null), E("variant", t !== "default" ? t : null), E("tone", s !== "neutral" ? s : null), E("radius", i !== "md" ? i : null), E("density", u !== "comfortable" ? u : null), p("inset", b);
2681
+ }, [f, t, s, i, u, b]), F.createElement("ui-section", { ref: m, ...r }, n);
2682
+ });
2683
+ st.displayName = "Section";
2684
+ function Er(N) {
2685
+ const { children: f, size: t = "md", ...s } = N;
2686
+ return F.createElement("ui-container", { size: t, ...s }, f);
2687
+ }
2688
+ const ut = F.forwardRef(function({
2689
+ children: f,
2690
+ collapsed: t,
2691
+ collapsible: s,
2692
+ rail: i,
2693
+ position: u,
2694
+ value: b,
2695
+ items: n,
2696
+ variant: r,
2697
+ size: d,
2698
+ density: m,
2699
+ tone: l,
2700
+ showIcons: E,
2701
+ showBadges: p,
2702
+ headless: L,
2703
+ onSelect: v,
2704
+ onChange: a,
2705
+ onToggle: A,
2706
+ onCollapseChange: e,
2707
+ ...o
2708
+ }, g) {
2709
+ const y = X(null);
2710
+ return z(g, () => y.current), S(() => {
2711
+ const w = y.current;
2712
+ if (!w)
2713
+ return;
2714
+ const c = (x) => {
2715
+ const q = x.detail;
2716
+ q && (v == null || v(q));
2717
+ }, R = (x) => {
2718
+ const q = x.detail;
2719
+ q && (a == null || a(q));
2720
+ }, h = (x) => {
2721
+ var B;
2722
+ const q = (B = x.detail) == null ? void 0 : B.collapsed;
2723
+ typeof q == "boolean" && (A == null || A(q));
2724
+ }, k = (x) => {
2725
+ var B;
2726
+ const q = (B = x.detail) == null ? void 0 : B.collapsed;
2727
+ typeof q == "boolean" && (e == null || e(q));
2728
+ };
2729
+ return w.addEventListener("select", c), w.addEventListener("change", R), w.addEventListener("toggle", h), w.addEventListener("collapse-change", k), () => {
2730
+ w.removeEventListener("select", c), w.removeEventListener("change", R), w.removeEventListener("toggle", h), w.removeEventListener("collapse-change", k);
2731
+ };
2732
+ }, [v, a, A, e]), S(() => {
2733
+ const w = y.current;
2734
+ if (!w)
2735
+ return;
2736
+ const c = (h, k) => {
2737
+ const x = w.getAttribute(h);
2738
+ if (k == null) {
2739
+ x != null && w.removeAttribute(h);
2740
+ return;
2741
+ }
2742
+ x !== k && w.setAttribute(h, k);
2743
+ }, R = (h, k, x) => {
2744
+ if (k == null) {
2745
+ x !== void 0 && x === !1 && c(h, null);
2746
+ return;
2747
+ }
2748
+ k ? c(h, "") : c(h, null);
2749
+ };
2750
+ if (R("collapsed", t), R("collapsible", s), R("rail", i), R("headless", L), c("position", u && u !== "left" ? u : null), c("value", b != null && b !== "" ? String(b) : null), n && n.length)
2751
+ try {
2752
+ c("items", JSON.stringify(n));
2753
+ } catch {
2754
+ c("items", null);
2755
+ }
2756
+ else
2757
+ c("items", null);
2758
+ c("variant", r && r !== "surface" ? r : null), c("size", d && d !== "md" ? d : null), c("density", m && m !== "default" ? m : null), c("tone", l && l !== "default" ? l : null), typeof E == "boolean" ? c("show-icons", E ? "true" : "false") : c("show-icons", null), typeof p == "boolean" ? c("show-badges", p ? "true" : "false") : c("show-badges", null);
2759
+ }, [t, s, i, L, u, b, n, r, d, m, l, E, p]), F.createElement("ui-sidebar", { ref: y, ...o }, f);
2760
+ });
2761
+ ut.displayName = "Sidebar";
2762
+ const ot = F.forwardRef(function({ children: f, separator: t, maxItems: s, onSelect: i, ...u }, b) {
2763
+ const n = X(null);
2764
+ return z(b, () => n.current), S(() => {
2765
+ const r = n.current;
2766
+ if (!r || !i)
2767
+ return;
2768
+ const d = (m) => {
2769
+ const l = m.detail;
2770
+ l && i(l);
2771
+ };
2772
+ return r.addEventListener("select", d), () => r.removeEventListener("select", d);
2773
+ }, [i]), S(() => {
2774
+ const r = n.current;
2775
+ r && (t != null && t !== "" ? r.setAttribute("separator", t) : r.removeAttribute("separator"));
2776
+ }, [t]), S(() => {
2777
+ const r = n.current;
2778
+ r && (typeof s == "number" && Number.isFinite(s) ? r.setAttribute("max-items", String(s)) : r.removeAttribute("max-items"));
2779
+ }, [s]), F.createElement("ui-breadcrumb", { ref: n, ...u }, f);
2780
+ });
2781
+ ot.displayName = "Breadcrumb";
2782
+ const ct = F.forwardRef(function({ children: f, sticky: t, bordered: s, dense: i, showMenuButton: u, onMenuTrigger: b, ...n }, r) {
2783
+ const d = X(null);
2784
+ return z(r, () => d.current), S(() => {
2785
+ const m = d.current;
2786
+ if (!m || !b)
2787
+ return;
2788
+ const l = () => b();
2789
+ return m.addEventListener("menu-trigger", l), () => m.removeEventListener("menu-trigger", l);
2790
+ }, [b]), S(() => {
2791
+ const m = d.current;
2792
+ m && (t ? m.setAttribute("sticky", "") : m.removeAttribute("sticky"));
2793
+ }, [t]), S(() => {
2794
+ const m = d.current;
2795
+ m && (s ? m.setAttribute("bordered", "") : m.removeAttribute("bordered"));
2796
+ }, [s]), S(() => {
2797
+ const m = d.current;
2798
+ m && (i ? m.setAttribute("dense", "") : m.removeAttribute("dense"));
2799
+ }, [i]), S(() => {
2800
+ const m = d.current;
2801
+ m && (u ? m.setAttribute("show-menu-button", "") : m.removeAttribute("show-menu-button"));
2802
+ }, [u]), F.createElement("ui-app-header", { ref: d, ...n }, f);
2803
+ });
2804
+ ct.displayName = "AppHeader";
2805
+ const ft = F.forwardRef(function({ children: f, open: t, side: s, variant: i, density: u, shape: b, elevation: n, tone: r, size: d, inset: m, dismissible: l, onOpen: E, onClose: p, onChange: L, ...v }, a) {
2806
+ const A = X(null);
2807
+ return z(a, () => A.current), S(() => {
2808
+ const e = A.current;
2809
+ if (!e)
2810
+ return;
2811
+ const o = () => E == null ? void 0 : E(), g = () => p == null ? void 0 : p(), y = (w) => {
2812
+ var R;
2813
+ const c = (R = w.detail) == null ? void 0 : R.open;
2814
+ typeof c == "boolean" && (L == null || L(c));
2815
+ };
2816
+ return e.addEventListener("open", o), e.addEventListener("close", g), e.addEventListener("change", y), () => {
2817
+ e.removeEventListener("open", o), e.removeEventListener("close", g), e.removeEventListener("change", y);
2818
+ };
2819
+ }, [E, p, L]), S(() => {
2820
+ const e = A.current;
2821
+ e && (t ? e.setAttribute("open", "") : e.removeAttribute("open"));
2822
+ }, [t]), S(() => {
2823
+ const e = A.current;
2824
+ e && (s ? e.setAttribute("side", s) : e.removeAttribute("side"));
2825
+ }, [s]), S(() => {
2826
+ const e = A.current;
2827
+ e && (l ? e.setAttribute("dismissible", "") : e.removeAttribute("dismissible"));
2828
+ }, [l]), S(() => {
2829
+ const e = A.current;
2830
+ e && (i && i !== "default" ? e.setAttribute("variant", i) : e.removeAttribute("variant"));
2831
+ }, [i]), S(() => {
2832
+ const e = A.current;
2833
+ e && (u && u !== "default" ? e.setAttribute("density", u) : e.removeAttribute("density"));
2834
+ }, [u]), S(() => {
2835
+ const e = A.current;
2836
+ e && (b && b !== "default" ? e.setAttribute("shape", b) : e.removeAttribute("shape"));
2837
+ }, [b]), S(() => {
2838
+ const e = A.current;
2839
+ e && (n && n !== "default" ? e.setAttribute("elevation", n) : e.removeAttribute("elevation"));
2840
+ }, [n]), S(() => {
2841
+ const e = A.current;
2842
+ e && (r && r !== "default" && r !== "brand" ? e.setAttribute("tone", r) : e.removeAttribute("tone"));
2843
+ }, [r]), S(() => {
2844
+ const e = A.current;
2845
+ e && (d && d !== "default" ? e.setAttribute("size", d) : e.removeAttribute("size"));
2846
+ }, [d]), S(() => {
2847
+ const e = A.current;
2848
+ e && (m ? e.setAttribute("inset", "") : e.removeAttribute("inset"));
2849
+ }, [m]), F.createElement("ui-drawer", { ref: A, ...v }, f);
2850
+ });
2851
+ ft.displayName = "Drawer";
2852
+ const dt = F.forwardRef(function({
2853
+ children: f,
2854
+ mode: t,
2855
+ variant: s,
2856
+ density: i,
2857
+ maxWidth: u,
2858
+ sidebarSide: b,
2859
+ collapsed: n,
2860
+ headless: r,
2861
+ sidebarWidth: d,
2862
+ asideWidth: m,
2863
+ onLayoutChange: l,
2864
+ ...E
2865
+ }, p) {
2866
+ const L = X(null);
2867
+ return F.useImperativeHandle(p, () => L.current), S(() => {
2868
+ const v = L.current;
2869
+ if (!v)
2870
+ return;
2871
+ const a = () => l == null ? void 0 : l();
2872
+ return v.addEventListener("layoutchange", a), () => v.removeEventListener("layoutchange", a);
2873
+ }, [l]), S(() => {
2874
+ const v = L.current;
2875
+ v && (t && t !== "dashboard" ? v.setAttribute("mode", t) : v.removeAttribute("mode"), s && s !== "default" ? v.setAttribute("variant", s) : v.removeAttribute("variant"), i && i !== "default" ? v.setAttribute("density", i) : v.removeAttribute("density"), u ? v.setAttribute("max-width", u) : v.removeAttribute("max-width"), b && b !== "start" ? v.setAttribute("sidebar-side", b) : v.removeAttribute("sidebar-side"), n ? v.setAttribute("collapsed", "") : v.removeAttribute("collapsed"), r ? v.setAttribute("headless", "") : v.removeAttribute("headless"), d ? v.setAttribute("sidebar-width", d) : v.removeAttribute("sidebar-width"), m ? v.setAttribute("aside-width", m) : v.removeAttribute("aside-width"));
2876
+ }, [t, s, i, u, b, n, r, d, m]), F.createElement("ui-layout", { ref: L, ...E }, f);
2877
+ });
2878
+ dt.displayName = "Layout";
2879
+ const he = be(null);
2880
+ function at() {
2881
+ try {
2882
+ const N = getComputedStyle(document.documentElement), f = N.getPropertyValue("--ui-color-primary").trim();
2883
+ return f ? {
2884
+ colors: {
2885
+ primary: f || void 0,
2886
+ text: N.getPropertyValue("--ui-color-text").trim() || void 0,
2887
+ background: N.getPropertyValue("--ui-color-background").trim() || void 0
2888
+ }
2889
+ } : {};
2890
+ } catch {
2891
+ return {};
2892
+ }
2893
+ }
2894
+ function yr({ tokens: N, children: f, storageKey: t = "editora.theme.tokens" }) {
2895
+ const s = () => {
2896
+ if (typeof window < "u" && t)
2897
+ try {
2898
+ const n = localStorage.getItem(t);
2899
+ if (n)
2900
+ return JSON.parse(n);
2901
+ } catch {
2902
+ }
2903
+ if (N && Object.keys(N).length)
2904
+ return { ...de, ...N };
2905
+ if (typeof window < "u") {
2906
+ const n = at();
2907
+ if (n.colors && n.colors.primary)
2908
+ return { ...de, ...n };
2909
+ }
2910
+ return { ...de, ...N || {} };
2911
+ }, [i, u] = ae(() => s());
2912
+ S(() => {
2913
+ N && Object.keys(N).length && u((n) => ({ ...n, ...N }));
2914
+ }, [N]), S(() => {
2915
+ xe(i);
2916
+ try {
2917
+ Be(document.documentElement);
2918
+ } catch {
2919
+ }
2920
+ if (typeof window < "u" && t) {
2921
+ const n = JSON.stringify(i);
2922
+ let r;
2923
+ const d = () => {
2924
+ try {
2925
+ localStorage.setItem(t, n);
2926
+ } catch {
2927
+ }
2928
+ };
2929
+ return window.requestIdleCallback ? r = window.requestIdleCallback(d, { timeout: 1e3 }) : r = window.setTimeout(d, 250), () => {
2930
+ try {
2931
+ window.cancelIdleCallback && r ? window.cancelIdleCallback(r) : r && clearTimeout(r);
2932
+ } catch {
2933
+ }
2934
+ };
2935
+ }
2936
+ }, [i, t]);
2937
+ const b = (n) => u(n);
2938
+ return /* @__PURE__ */ F.createElement(he.Provider, { value: { tokens: i, setTokens: b } }, f);
2939
+ }
2940
+ function Lr() {
2941
+ const N = me(he);
2942
+ if (!N)
2943
+ throw new Error("useTheme must be used within ThemeProvider");
2944
+ return N;
2945
+ }
2946
+ function ue(N, f, t) {
2947
+ if (t == null) {
2948
+ N.removeAttribute(f);
2949
+ return;
2950
+ }
2951
+ t ? N.setAttribute(f, "") : N.removeAttribute(f);
2952
+ }
2953
+ function ve(N, f, t, s) {
2954
+ const i = t && t !== s ? t : void 0;
2955
+ if (!i) {
2956
+ N.removeAttribute(f);
2957
+ return;
2958
+ }
2959
+ N.setAttribute(f, i);
2960
+ }
2961
+ const bt = Z.forwardRef(function({
2962
+ checked: f,
2963
+ disabled: t,
2964
+ indeterminate: s,
2965
+ loading: i,
2966
+ headless: u,
2967
+ invalid: b,
2968
+ density: n,
2969
+ preset: r,
2970
+ onCheckedChange: d,
2971
+ onChange: m,
2972
+ onInput: l,
2973
+ children: E,
2974
+ ...p
2975
+ }, L) {
2976
+ const v = Z.useRef(null);
2977
+ Z.useImperativeHandle(L, () => v.current);
2978
+ const a = typeof window < "u" ? Z.useLayoutEffect : Z.useEffect;
2979
+ Z.useEffect(() => {
2980
+ re("ui-checkbox", "Checkbox");
2981
+ }, []), a(() => {
2982
+ const e = v.current;
2983
+ e && (ue(e, "checked", f), ue(e, "disabled", t), ue(e, "indeterminate", s), ue(e, "loading", i), ue(e, "headless", u), ue(e, "invalid", b), ve(e, "density", n, "default"), ve(e, "preset", r, "default"));
2984
+ }, [f, t, s, i, u, b, n, r]), Z.useEffect(() => {
2985
+ const e = v.current;
2986
+ if (!e || !d && !m && !l)
2987
+ return;
2988
+ const o = (y) => {
2989
+ var c;
2990
+ const w = y;
2991
+ l == null || l(w), typeof ((c = w.detail) == null ? void 0 : c.checked) == "boolean" && (d == null || d(w.detail.checked, w.detail));
2992
+ }, g = (y) => {
2993
+ const w = y;
2994
+ m == null || m(w);
2995
+ };
2996
+ return e.addEventListener("input", o), e.addEventListener("change", g), () => {
2997
+ e.removeEventListener("input", o), e.removeEventListener("change", g);
2998
+ };
2999
+ }, [d, m, l]);
3000
+ const A = {
3001
+ ref: v,
3002
+ ...p,
3003
+ checked: f ? "" : void 0,
3004
+ disabled: t ? "" : void 0,
3005
+ indeterminate: s ? "" : void 0,
3006
+ loading: i ? "" : void 0,
3007
+ headless: u ? "" : void 0,
3008
+ invalid: b ? "" : void 0,
3009
+ density: n && n !== "default" ? n : void 0,
3010
+ preset: r && r !== "default" ? r : void 0
3011
+ };
3012
+ return Z.createElement("ui-checkbox", A, E);
3013
+ });
3014
+ bt.displayName = "Checkbox";
3015
+ const mt = F.forwardRef(function({
3016
+ value: f,
3017
+ disabled: t,
3018
+ required: s,
3019
+ name: i,
3020
+ orientation: u,
3021
+ variant: b,
3022
+ size: n,
3023
+ tone: r,
3024
+ options: d,
3025
+ onValueChange: m,
3026
+ children: l,
3027
+ ...E
3028
+ }, p) {
3029
+ const L = X(null);
3030
+ return F.useImperativeHandle(p, () => L.current), S(() => {
3031
+ const v = L.current;
3032
+ if (!v)
3033
+ return;
3034
+ const a = (A) => {
3035
+ const e = A.detail;
3036
+ e && (m == null || m(e));
3037
+ };
3038
+ return v.addEventListener("change", a), () => v.removeEventListener("change", a);
3039
+ }, [m]), S(() => {
3040
+ const v = L.current;
3041
+ if (!v)
3042
+ return;
3043
+ const a = (e, o) => {
3044
+ const g = v.getAttribute(e);
3045
+ if (o == null) {
3046
+ g != null && v.removeAttribute(e);
3047
+ return;
3048
+ }
3049
+ g !== o && v.setAttribute(e, o);
3050
+ }, A = (e, o) => {
3051
+ o ? v.hasAttribute(e) || v.setAttribute(e, "") : v.hasAttribute(e) && v.removeAttribute(e);
3052
+ };
3053
+ a("value", f ?? null), A("disabled", t), A("required", s), a("name", i || null), a("orientation", u && u !== "vertical" ? u : null), a("variant", b && b !== "default" ? b : null), a("size", n && n !== "md" ? n : null), a("tone", r && r !== "brand" ? r : null), d && d.length ? a("options", JSON.stringify(d)) : a("options", null);
3054
+ }, [f, t, s, i, u, b, n, r, d]), F.createElement("ui-radio-group", { ref: L, ...E }, l);
3055
+ });
3056
+ mt.displayName = "RadioGroup";
3057
+ const vt = F.forwardRef(function({
3058
+ children: f,
3059
+ checked: t,
3060
+ disabled: s,
3061
+ headless: i,
3062
+ loading: u,
3063
+ size: b,
3064
+ variant: n,
3065
+ tone: r,
3066
+ label: d,
3067
+ description: m,
3068
+ name: l,
3069
+ value: E,
3070
+ required: p,
3071
+ onInput: L,
3072
+ onChange: v,
3073
+ ...a
3074
+ }, A) {
3075
+ const e = X(null);
3076
+ return z(A, () => e.current), S(() => {
3077
+ const o = e.current;
3078
+ if (!o)
3079
+ return;
3080
+ const g = (w) => {
3081
+ const c = w.detail;
3082
+ c && (L == null || L(c));
3083
+ }, y = (w) => {
3084
+ const c = w.detail;
3085
+ c && (v == null || v(c));
3086
+ };
3087
+ return o.addEventListener("input", g), o.addEventListener("change", y), () => {
3088
+ o.removeEventListener("input", g), o.removeEventListener("change", y);
3089
+ };
3090
+ }, [L, v]), S(() => {
3091
+ const o = e.current;
3092
+ if (!o)
3093
+ return;
3094
+ const g = (w, c) => {
3095
+ const R = o.getAttribute(w);
3096
+ if (c == null) {
3097
+ R != null && o.removeAttribute(w);
3098
+ return;
3099
+ }
3100
+ R !== c && o.setAttribute(w, c);
3101
+ }, y = (w, c) => {
3102
+ c ? g(w, "") : g(w, null);
3103
+ };
3104
+ y("checked", t), y("disabled", s), y("headless", i), y("loading", u), y("required", p), g("size", b && b !== "md" ? b : null), g("variant", n && n !== "default" ? n : null), g("tone", r && r !== "brand" ? r : null), g("label", d || null), g("description", m || null), g("name", l || null), g("value", E || null);
3105
+ }, [t, s, i, u, p, b, n, r, d, m, l, E]), F.createElement("ui-switch", { ref: e, ...a }, f);
3106
+ });
3107
+ vt.displayName = "Switch";
3108
+ const At = F.forwardRef(function({
3109
+ children: f,
3110
+ pressed: t,
3111
+ disabled: s,
3112
+ loading: i,
3113
+ headless: u,
3114
+ size: b,
3115
+ variant: n,
3116
+ tone: r,
3117
+ name: d,
3118
+ value: m,
3119
+ required: l,
3120
+ iconOn: E,
3121
+ iconOff: p,
3122
+ onInput: L,
3123
+ onChange: v,
3124
+ ...a
3125
+ }, A) {
3126
+ const e = X(null);
3127
+ return z(A, () => e.current), S(() => {
3128
+ const o = e.current;
3129
+ if (!o)
3130
+ return;
3131
+ const g = (w) => {
3132
+ const c = w.detail;
3133
+ c && (L == null || L(c));
3134
+ }, y = (w) => {
3135
+ const c = w.detail;
3136
+ c && (v == null || v(c));
3137
+ };
3138
+ return o.addEventListener("input", g), o.addEventListener("change", y), () => {
3139
+ o.removeEventListener("input", g), o.removeEventListener("change", y);
3140
+ };
3141
+ }, [L, v]), S(() => {
3142
+ const o = e.current;
3143
+ if (!o)
3144
+ return;
3145
+ const g = (w, c) => {
3146
+ const R = o.getAttribute(w);
3147
+ if (c == null) {
3148
+ R != null && o.removeAttribute(w);
3149
+ return;
3150
+ }
3151
+ R !== c && o.setAttribute(w, c);
3152
+ }, y = (w, c) => {
3153
+ c ? g(w, "") : g(w, null);
3154
+ };
3155
+ y("pressed", t), y("disabled", s), y("loading", i), y("headless", u), y("required", l), g("size", b && b !== "md" ? b : null), g("variant", n && n !== "default" ? n : null), g("tone", r && r !== "brand" ? r : null), g("name", d || null), g("value", m || null), g("icon-on", E || null), g("icon-off", p || null);
3156
+ }, [t, s, i, u, l, b, n, r, d, m, E, p]), F.createElement("ui-toggle", { ref: e, ...a }, f);
3157
+ });
3158
+ At.displayName = "Toggle";
3159
+ const pt = F.forwardRef(function({
3160
+ children: f,
3161
+ value: t,
3162
+ multiple: s,
3163
+ disabled: i,
3164
+ headless: u,
3165
+ orientation: b,
3166
+ variant: n,
3167
+ size: r,
3168
+ density: d,
3169
+ allowEmpty: m,
3170
+ required: l,
3171
+ activation: E,
3172
+ onInput: p,
3173
+ onChange: L,
3174
+ onValueChange: v,
3175
+ ...a
3176
+ }, A) {
3177
+ const e = X(null);
3178
+ return z(A, () => e.current), S(() => {
3179
+ const o = e.current;
3180
+ if (!o)
3181
+ return;
3182
+ const g = (w) => {
3183
+ const c = w.detail;
3184
+ c && (p == null || p(c), v == null || v(c));
3185
+ }, y = (w) => {
3186
+ const c = w.detail;
3187
+ c && (L == null || L(c), v == null || v(c));
3188
+ };
3189
+ return o.addEventListener("input", g), o.addEventListener("change", y), () => {
3190
+ o.removeEventListener("input", g), o.removeEventListener("change", y);
3191
+ };
3192
+ }, [p, L, v]), S(() => {
3193
+ const o = e.current;
3194
+ if (!o)
3195
+ return;
3196
+ const g = (w, c) => {
3197
+ const R = o.getAttribute(w);
3198
+ if (c == null) {
3199
+ R != null && o.removeAttribute(w);
3200
+ return;
3201
+ }
3202
+ R !== c && o.setAttribute(w, c);
3203
+ }, y = (w, c) => {
3204
+ c ? g(w, "") : g(w, null);
3205
+ };
3206
+ y("multiple", s), y("disabled", i), y("headless", u), y("allow-empty", m), y("required", l), t == null ? g("value", null) : Array.isArray(t) ? g("value", JSON.stringify(t)) : g("value", String(t)), g("orientation", b && b !== "horizontal" ? b : null), g("variant", n && n !== "default" ? n : null), g("size", r && r !== "md" ? r : null), g("density", d && d !== "default" ? d : null), g("activation", E && E !== "auto" ? E : null);
3207
+ }, [t, s, i, u, m, l, b, n, r, d, E]), F.createElement("ui-toggle-group", { ref: e, ...a }, f);
3208
+ });
3209
+ pt.displayName = "ToggleGroup";
3210
+ function Et(N) {
3211
+ if (N != null) {
3212
+ if (typeof N == "string")
3213
+ return N;
3214
+ if (!(!Number.isFinite(N) || N <= 0))
3215
+ return Math.abs(N - 16 / 9) < 0.01 ? "16/9" : Math.abs(N - 4 / 3) < 0.01 ? "4/3" : Math.abs(N - 1) < 0.01 ? "1/1" : `${N}/1`;
3216
+ }
3217
+ }
3218
+ const yt = Z.forwardRef(function({ ratio: f, fit: t, children: s, ...i }, u) {
3219
+ const b = Z.useRef(null);
3220
+ return Z.useImperativeHandle(u, () => b.current), Z.useEffect(() => {
3221
+ re("ui-aspect-ratio", "AspectRatio");
3222
+ }, []), Z.useEffect(() => {
3223
+ const n = b.current;
3224
+ if (!n)
3225
+ return;
3226
+ const r = Et(f);
3227
+ r ? n.setAttribute("ratio", r) : n.removeAttribute("ratio"), t ? n.setAttribute("fit", t) : n.removeAttribute("fit");
3228
+ }, [f, t]), Z.createElement("ui-aspect-ratio", { ref: b, ...i }, s);
3229
+ });
3230
+ yt.displayName = "AspectRatio";
3231
+ function Ae(N) {
3232
+ const f = N.trim().split(/\s+/).filter(Boolean);
3233
+ return f.length === 0 ? "?" : f.length === 1 ? f[0].slice(0, 2).toUpperCase() : `${f[0][0] || ""}${f[1][0] || ""}`.toUpperCase();
3234
+ }
3235
+ function Lt(N) {
3236
+ if (N != null)
3237
+ return N === "lazy" || N === "eager" ? N : N ? "eager" : "lazy";
3238
+ }
3239
+ function gt(N, f, t) {
3240
+ return N && N.trim() ? N.trim().slice(0, 2).toUpperCase() : f && f.trim() ? Ae(f) : typeof t == "string" && t.trim() ? Ae(t) : "?";
3241
+ }
3242
+ const ht = Z.forwardRef(function({
3243
+ src: f,
3244
+ alt: t,
3245
+ initials: s,
3246
+ size: i,
3247
+ bg: u,
3248
+ color: b,
3249
+ radius: n,
3250
+ fontWeight: r,
3251
+ shape: d,
3252
+ status: m,
3253
+ ring: l,
3254
+ loading: E,
3255
+ children: p,
3256
+ ...L
3257
+ }, v) {
3258
+ const a = Z.useRef(null), A = Z.useMemo(() => gt(s, t, p), [s, t, p]);
3259
+ return Z.useImperativeHandle(v, () => a.current), Z.useEffect(() => {
3260
+ re("ui-avatar", "Avatar");
3261
+ }, []), Z.useEffect(() => {
3262
+ const e = a.current;
3263
+ if (!e)
3264
+ return;
3265
+ f ? e.setAttribute("src", f) : e.removeAttribute("src"), t ? e.setAttribute("alt", t) : e.removeAttribute("alt"), s ? e.setAttribute("initials", s) : e.removeAttribute("initials"), i != null ? e.setAttribute("size", String(i)) : e.removeAttribute("size"), u ? e.setAttribute("bg", u) : e.removeAttribute("bg"), b ? e.setAttribute("color", b) : e.removeAttribute("color"), n ? e.setAttribute("radius", n) : e.removeAttribute("radius"), r != null ? e.setAttribute("fontweight", String(r)) : e.removeAttribute("fontweight"), d ? e.setAttribute("shape", d) : e.removeAttribute("shape"), m ? e.setAttribute("status", m) : e.removeAttribute("status"), l == null ? e.removeAttribute("ring") : l ? e.setAttribute("ring", "") : e.removeAttribute("ring");
3266
+ const o = Lt(E);
3267
+ o ? e.setAttribute("loading", o) : e.removeAttribute("loading");
3268
+ }, [f, t, s, i, u, b, n, r, d, m, l, E]), Z.createElement("ui-avatar", { ref: a, ...L }, A);
3269
+ });
3270
+ ht.displayName = "Avatar";
3271
+ const wt = F.forwardRef(function({
3272
+ present: f,
3273
+ headless: t,
3274
+ mode: s,
3275
+ size: i,
3276
+ variant: u,
3277
+ keepMounted: b,
3278
+ lazy: n,
3279
+ enterDuration: r,
3280
+ exitDuration: d,
3281
+ delay: m,
3282
+ onBeforeEnter: l,
3283
+ onEnter: E,
3284
+ onAfterEnter: p,
3285
+ onBeforeExit: L,
3286
+ onExit: v,
3287
+ onAfterExit: a,
3288
+ children: A,
3289
+ ...e
3290
+ }, o) {
3291
+ const g = X(null);
3292
+ return F.useImperativeHandle(o, () => g.current), S(() => {
3293
+ const y = g.current;
3294
+ if (!y)
3295
+ return;
3296
+ const w = (B) => {
3297
+ const H = B.detail;
3298
+ return (H == null ? void 0 : H.state) || "hidden";
3299
+ }, c = (B) => l == null ? void 0 : l(w(B)), R = (B) => E == null ? void 0 : E(w(B)), h = (B) => p == null ? void 0 : p(w(B)), k = (B) => L == null ? void 0 : L(w(B)), x = (B) => v == null ? void 0 : v(w(B)), q = (B) => a == null ? void 0 : a(w(B));
3300
+ return y.addEventListener("before-enter", c), y.addEventListener("enter", R), y.addEventListener("after-enter", h), y.addEventListener("before-exit", k), y.addEventListener("exit", x), y.addEventListener("after-exit", q), () => {
3301
+ y.removeEventListener("before-enter", c), y.removeEventListener("enter", R), y.removeEventListener("after-enter", h), y.removeEventListener("before-exit", k), y.removeEventListener("exit", x), y.removeEventListener("after-exit", q);
3302
+ };
3303
+ }, [l, E, p, L, v, a]), S(() => {
3304
+ const y = g.current;
3305
+ y && (f ? y.setAttribute("present", "") : y.removeAttribute("present"), t ? y.setAttribute("headless", "") : y.removeAttribute("headless"), s && s !== "fade" ? y.setAttribute("mode", s) : y.removeAttribute("mode"), i && i !== "md" ? y.setAttribute("size", i) : y.removeAttribute("size"), u && u !== "default" ? y.setAttribute("variant", u) : y.removeAttribute("variant"), b ? y.setAttribute("keep-mounted", "") : y.removeAttribute("keep-mounted"), n ? y.setAttribute("lazy", "") : y.removeAttribute("lazy"), typeof r == "number" ? y.setAttribute("enter-duration", String(r)) : y.removeAttribute("enter-duration"), typeof d == "number" ? y.setAttribute("exit-duration", String(d)) : y.removeAttribute("exit-duration"), typeof m == "number" ? y.setAttribute("delay", String(m)) : y.removeAttribute("delay"));
3306
+ }, [f, t, s, i, u, b, n, r, d, m]), F.createElement("ui-presence", { ref: g, ...e }, A);
3307
+ });
3308
+ wt.displayName = "Presence";
3309
+ const Nt = F.forwardRef(function({
3310
+ value: f,
3311
+ buffer: t,
3312
+ max: s,
3313
+ min: i,
3314
+ indeterminate: u,
3315
+ striped: b,
3316
+ animated: n,
3317
+ showLabel: r,
3318
+ label: d,
3319
+ format: m,
3320
+ precision: l,
3321
+ size: E,
3322
+ variant: p,
3323
+ tone: L,
3324
+ shape: v,
3325
+ mode: a,
3326
+ onValueChange: A,
3327
+ onComplete: e,
3328
+ children: o,
3329
+ ...g
3330
+ }, y) {
3331
+ const w = X(null);
3332
+ return F.useImperativeHandle(y, () => w.current), S(() => {
3333
+ const c = w.current;
3334
+ if (!c)
3335
+ return;
3336
+ const R = (k) => {
3337
+ const x = k.detail;
3338
+ x && (A == null || A(x));
3339
+ }, h = (k) => {
3340
+ const x = k.detail;
3341
+ x && (e == null || e(x));
3342
+ };
3343
+ return c.addEventListener("change", R), c.addEventListener("complete", h), () => {
3344
+ c.removeEventListener("change", R), c.removeEventListener("complete", h);
3345
+ };
3346
+ }, [A, e]), S(() => {
3347
+ const c = w.current;
3348
+ if (!c)
3349
+ return;
3350
+ const R = (k, x) => {
3351
+ const q = c.getAttribute(k);
3352
+ if (x == null) {
3353
+ q != null && c.removeAttribute(k);
3354
+ return;
3355
+ }
3356
+ q !== x && c.setAttribute(k, x);
3357
+ }, h = (k, x) => {
3358
+ x ? c.hasAttribute(k) || c.setAttribute(k, "") : c.hasAttribute(k) && c.removeAttribute(k);
3359
+ };
3360
+ R("value", f != null ? String(f) : null), R("buffer", t != null ? String(t) : null), R("max", s != null ? String(s) : null), R("min", i != null ? String(i) : null), h("indeterminate", u), h("striped", b), h("animated", n), h("show-label", r), R("label", d != null && d !== "" ? d : null), R("format", m != null && m !== "percent" ? m : null), R("precision", l != null ? String(l) : null), R("size", E && E !== "md" ? E : null), R("variant", p && p !== "default" ? p : null), R("tone", L && L !== "brand" ? L : null), R("shape", v && v !== "pill" ? v : null), R("mode", a && a !== "line" ? a : null);
3361
+ }, [f, t, s, i, u, b, n, r, d, m, l, E, p, L, v, a]), F.createElement("ui-progress", { ref: w, ...g }, o);
3362
+ });
3363
+ Nt.displayName = "Progress";
3364
+ const Ht = F.forwardRef(function({ target: f, headless: t, disabled: s, strategy: i, onMount: u, onUnmount: b, onSync: n, onTargetMissing: r, children: d, ...m }, l) {
3365
+ const E = X(null);
3366
+ return F.useImperativeHandle(l, () => E.current), S(() => {
3367
+ const p = E.current;
3368
+ if (!p)
3369
+ return;
3370
+ const L = (e) => u == null ? void 0 : u(e.detail || { count: 0 }), v = (e) => b == null ? void 0 : b(e.detail || { count: 0 }), a = (e) => n == null ? void 0 : n(e.detail || { count: 0 }), A = (e) => {
3371
+ const o = e.detail;
3372
+ o && (r == null || r(o));
3373
+ };
3374
+ return p.addEventListener("mount", L), p.addEventListener("unmount", v), p.addEventListener("sync", a), p.addEventListener("target-missing", A), () => {
3375
+ p.removeEventListener("mount", L), p.removeEventListener("unmount", v), p.removeEventListener("sync", a), p.removeEventListener("target-missing", A);
3376
+ };
3377
+ }, [u, b, n, r]), S(() => {
3378
+ const p = E.current;
3379
+ p && (f ? p.setAttribute("target", f) : p.removeAttribute("target"), i && i !== "append" ? p.setAttribute("strategy", i) : p.removeAttribute("strategy"), t ? p.setAttribute("headless", "") : p.removeAttribute("headless"), s ? p.setAttribute("disabled", "") : p.removeAttribute("disabled"));
3380
+ }, [f, i, t, s]), F.createElement("ui-portal", { ref: E, ...m }, d);
3381
+ });
3382
+ Ht.displayName = "Portal";
3383
+ const Rt = F.forwardRef(function({
3384
+ orientation: f,
3385
+ size: t,
3386
+ variant: s,
3387
+ tone: i,
3388
+ autoHide: u,
3389
+ shadows: b,
3390
+ onScrollChange: n,
3391
+ onReachStart: r,
3392
+ onReachEnd: d,
3393
+ children: m,
3394
+ ...l
3395
+ }, E) {
3396
+ const p = X(null);
3397
+ return F.useImperativeHandle(E, () => p.current), S(() => {
3398
+ const L = p.current;
3399
+ if (!L)
3400
+ return;
3401
+ const v = (e) => {
3402
+ const o = e.detail;
3403
+ o && (n == null || n(o));
3404
+ }, a = () => r == null ? void 0 : r(), A = () => d == null ? void 0 : d();
3405
+ return L.addEventListener("scroll", v), L.addEventListener("reach-start", a), L.addEventListener("reach-end", A), () => {
3406
+ L.removeEventListener("scroll", v), L.removeEventListener("reach-start", a), L.removeEventListener("reach-end", A);
3407
+ };
3408
+ }, [n, r, d]), S(() => {
3409
+ const L = p.current;
3410
+ if (!L)
3411
+ return;
3412
+ const v = (A, e) => {
3413
+ const o = L.getAttribute(A);
3414
+ if (e == null) {
3415
+ o != null && L.removeAttribute(A);
3416
+ return;
3417
+ }
3418
+ o !== e && L.setAttribute(A, e);
3419
+ }, a = (A, e) => {
3420
+ const o = L.getAttribute(A);
3421
+ if (e == null) {
3422
+ o != null && L.removeAttribute(A);
3423
+ return;
3424
+ }
3425
+ const g = e ? "true" : "false";
3426
+ o !== g && L.setAttribute(A, g);
3427
+ };
3428
+ v("orientation", f && f !== "vertical" ? f : null), v("size", t && t !== "md" ? t : null), v("variant", s && s !== "default" ? s : null), v("tone", i && i !== "neutral" ? i : null), a("auto-hide", u), a("shadows", b);
3429
+ }, [f, t, s, i, u, b]), F.createElement("ui-scroll-area", { ref: p, ...l }, m);
3430
+ });
3431
+ Rt.displayName = "ScrollArea";
3432
+ const kt = Z.forwardRef((N, f) => /* @__PURE__ */ Z.createElement("ui-separator", { ref: f, ...N }));
3433
+ kt.displayName = "Separator";
3434
+ const Pt = F.forwardRef(function({
3435
+ children: f,
3436
+ name: t,
3437
+ fallback: s,
3438
+ required: i,
3439
+ inline: u,
3440
+ align: b,
3441
+ size: n,
3442
+ variant: r,
3443
+ tone: d,
3444
+ headless: m,
3445
+ onSlotChange: l,
3446
+ onMissing: E,
3447
+ onResolved: p,
3448
+ ...L
3449
+ }, v) {
3450
+ const a = X(null);
3451
+ return z(v, () => a.current), S(() => {
3452
+ const A = a.current;
3453
+ if (!A)
3454
+ return;
3455
+ const e = (y) => {
3456
+ const w = y.detail;
3457
+ w && (l == null || l(w));
3458
+ }, o = () => E == null ? void 0 : E(), g = () => p == null ? void 0 : p();
3459
+ return A.addEventListener("slotchange", e), A.addEventListener("missing", o), A.addEventListener("resolved", g), () => {
3460
+ A.removeEventListener("slotchange", e), A.removeEventListener("missing", o), A.removeEventListener("resolved", g);
3461
+ };
3462
+ }, [l, E, p]), S(() => {
3463
+ const A = a.current;
3464
+ if (!A)
3465
+ return;
3466
+ const e = (g, y) => {
3467
+ const w = A.getAttribute(g);
3468
+ if (y == null) {
3469
+ w != null && A.removeAttribute(g);
3470
+ return;
3471
+ }
3472
+ w !== y && A.setAttribute(g, y);
3473
+ }, o = (g, y) => {
3474
+ y ? e(g, "") : e(g, null);
3475
+ };
3476
+ e("name", t || null), e("fallback", s || null), o("required", i), typeof u == "boolean" ? e("inline", u ? "true" : "false") : e("inline", null), e("align", b && b !== "start" ? b : null), e("size", n && n !== "md" ? n : null), e("variant", r && r !== "plain" ? r : null), e("tone", d && d !== "brand" ? d : null), o("headless", m);
3477
+ }, [t, s, i, u, b, n, r, d, m]), F.createElement("ui-slot", { ref: a, ...L }, f);
3478
+ });
3479
+ Pt.displayName = "Slot";
3480
+ const St = F.forwardRef(function({
3481
+ children: f,
3482
+ orientation: t,
3483
+ variant: s,
3484
+ size: i,
3485
+ density: u,
3486
+ wrap: b,
3487
+ loop: n,
3488
+ headless: r,
3489
+ ...d
3490
+ }, m) {
3491
+ const l = X(null);
3492
+ return z(m, () => l.current), S(() => {
3493
+ const E = l.current;
3494
+ if (!E)
3495
+ return;
3496
+ const p = (v, a) => {
3497
+ const A = E.getAttribute(v);
3498
+ if (a == null) {
3499
+ A != null && E.removeAttribute(v);
3500
+ return;
3501
+ }
3502
+ A !== a && E.setAttribute(v, a);
3503
+ }, L = (v, a) => {
3504
+ a ? p(v, "") : p(v, null);
3505
+ };
3506
+ p("orientation", t && t !== "horizontal" ? t : null), p("variant", s && s !== "default" ? s : null), p("size", i && i !== "md" ? i : null), p("density", u && u !== "default" ? u : null), L("wrap", b), typeof n == "boolean" ? L("loop", n) : p("loop", null), L("headless", r);
3507
+ }, [t, s, i, u, b, n, r]), F.createElement("ui-toolbar", { ref: l, ...d }, f);
3508
+ });
3509
+ St.displayName = "Toolbar";
3510
+ const Ft = Z.forwardRef((N, f) => /* @__PURE__ */ Z.createElement("ui-visually-hidden", { ref: f, ...N }));
3511
+ Ft.displayName = "VisuallyHidden";
3512
+ function pe(N, f, t) {
3513
+ if (t == null) {
3514
+ N.removeAttribute(f);
3515
+ return;
3516
+ }
3517
+ t ? N.setAttribute(f, "") : N.removeAttribute(f);
3518
+ }
3519
+ function Ee(N) {
3520
+ var f;
3521
+ return (f = N.detail) == null ? void 0 : f.open;
3522
+ }
3523
+ const xt = Z.forwardRef(function({ header: f, open: t, headless: s, onToggle: i, onChangeOpen: u, children: b, ...n }, r) {
3524
+ const d = Z.useRef(null);
3525
+ Z.useImperativeHandle(r, () => d.current), Z.useEffect(() => {
3526
+ re("ui-collapsible", "Collapsible");
3527
+ }, []), Z.useEffect(() => {
3528
+ const l = d.current;
3529
+ l && (pe(l, "open", t), pe(l, "headless", s));
3530
+ }, [t, s]), Z.useEffect(() => {
3531
+ const l = d.current;
3532
+ if (!l || !i && !u)
3533
+ return;
3534
+ const E = (L) => {
3535
+ const v = Ee(L);
3536
+ typeof v == "boolean" && (i == null || i(v));
3537
+ }, p = (L) => {
3538
+ const v = Ee(L);
3539
+ typeof v == "boolean" && (u == null || u(v));
3540
+ };
3541
+ return l.addEventListener("toggle", E), l.addEventListener("change", p), () => {
3542
+ l.removeEventListener("toggle", E), l.removeEventListener("change", p);
3543
+ };
3544
+ }, [i, u]);
3545
+ let m = null;
3546
+ return f != null && (typeof f == "string" || typeof f == "number" ? m = /* @__PURE__ */ Z.createElement("span", { slot: "header" }, f) : Z.isValidElement(f) ? m = Z.cloneElement(f, { slot: "header" }) : m = /* @__PURE__ */ Z.createElement("span", { slot: "header" }, f)), /* @__PURE__ */ Z.createElement("ui-collapsible", { ref: d, ...n }, m, b);
3547
+ });
3548
+ xt.displayName = "Collapsible";
3549
+ const Bt = Z.forwardRef((N, f) => /* @__PURE__ */ Z.createElement("ui-pagination", { ref: f, ...N }));
3550
+ Bt.displayName = "Pagination";
3551
+ function Tt(N, f, t) {
3552
+ if (t == null) {
3553
+ N.removeAttribute(f);
3554
+ return;
3555
+ }
3556
+ t ? N.setAttribute(f, "") : N.removeAttribute(f);
3557
+ }
3558
+ function ye(N) {
3559
+ var f;
3560
+ return (f = N.detail) == null ? void 0 : f.open;
3561
+ }
3562
+ const Dt = Z.forwardRef(function({ multiple: f, collapsible: t, open: s, onToggle: i, onChangeOpen: u, children: b, ...n }, r) {
3563
+ const d = Z.useRef(null);
3564
+ return Z.useImperativeHandle(r, () => d.current), Z.useEffect(() => {
3565
+ re("ui-accordion", "Accordion");
3566
+ }, []), Z.useEffect(() => {
3567
+ const m = d.current;
3568
+ m && (Tt(m, "multiple", f), t == null ? m.removeAttribute("collapsible") : m.setAttribute("collapsible", String(!!t)), s == null ? m.removeAttribute("open") : m.setAttribute("open", Array.isArray(s) ? JSON.stringify(s) : String(s)));
3569
+ }, [f, t, s]), Z.useEffect(() => {
3570
+ const m = d.current;
3571
+ if (!m || !i && !u)
3572
+ return;
3573
+ const l = (p) => {
3574
+ const L = ye(p);
3575
+ L != null && (i == null || i(L));
3576
+ }, E = (p) => {
3577
+ const L = ye(p);
3578
+ L != null && (u == null || u(L));
3579
+ };
3580
+ return m.addEventListener("toggle", l), m.addEventListener("change", E), () => {
3581
+ m.removeEventListener("toggle", l), m.removeEventListener("change", E);
3582
+ };
3583
+ }, [i, u]), Z.createElement("ui-accordion", { ref: d, ...n }, b);
3584
+ });
3585
+ Dt.displayName = "Accordion";
3586
+ const qt = Z.forwardRef(function({ disabled: f, children: t, ...s }, i) {
3587
+ const u = {
3588
+ ref: i,
3589
+ "data-ui-accordion-item": "",
3590
+ ...s
3591
+ };
3592
+ return f && (u.disabled = !0), Z.createElement("div", u, t);
3593
+ });
3594
+ qt.displayName = "AccordionItem";
3595
+ const $t = Z.forwardRef(function({ type: f, children: t, ...s }, i) {
3596
+ return Z.createElement(
3597
+ "button",
3598
+ {
3599
+ ref: i,
3600
+ type: f || "button",
3601
+ "data-ui-accordion-trigger": "",
3602
+ ...s
3603
+ },
3604
+ t
3605
+ );
3606
+ });
3607
+ $t.displayName = "AccordionTrigger";
3608
+ const Jt = Z.forwardRef(function({ children: f, ...t }, s) {
3609
+ return Z.createElement(
3610
+ "div",
3611
+ {
3612
+ ref: s,
3613
+ "data-ui-accordion-panel": "",
3614
+ ...t
3615
+ },
3616
+ f
3617
+ );
3618
+ });
3619
+ Jt.displayName = "AccordionPanel";
3620
+ const jt = Z.forwardRef((N, f) => /* @__PURE__ */ Z.createElement("ui-direction-provider", { ref: f, ...N }));
3621
+ jt.displayName = "DirectionProvider";
3622
+ const Gt = F.forwardRef(function({
3623
+ children: f,
3624
+ open: t,
3625
+ delay: s,
3626
+ closeDelay: i,
3627
+ placement: u,
3628
+ offset: b,
3629
+ variant: n,
3630
+ tone: r,
3631
+ density: d,
3632
+ shape: m,
3633
+ elevation: l,
3634
+ headless: E,
3635
+ onOpen: p,
3636
+ onClose: L,
3637
+ onChange: v,
3638
+ ...a
3639
+ }, A) {
3640
+ const e = X(null);
3641
+ return z(A, () => e.current), S(() => {
3642
+ const o = e.current;
3643
+ if (!o)
3644
+ return;
3645
+ const g = () => p == null ? void 0 : p(), y = () => L == null ? void 0 : L(), w = (c) => {
3646
+ var h;
3647
+ const R = (h = c.detail) == null ? void 0 : h.open;
3648
+ typeof R == "boolean" && (v == null || v(R));
3649
+ };
3650
+ return o.addEventListener("open", g), o.addEventListener("close", y), o.addEventListener("change", w), () => {
3651
+ o.removeEventListener("open", g), o.removeEventListener("close", y), o.removeEventListener("change", w);
3652
+ };
3653
+ }, [p, L, v]), S(() => {
3654
+ const o = e.current;
3655
+ !o || t == null || (t ? o.setAttribute("open", "") : o.removeAttribute("open"));
3656
+ }, [t]), S(() => {
3657
+ const o = e.current;
3658
+ o && (typeof s == "number" ? o.setAttribute("delay", String(s)) : o.removeAttribute("delay"), typeof i == "number" ? o.setAttribute("close-delay", String(i)) : o.removeAttribute("close-delay"), u ? o.setAttribute("placement", u) : o.removeAttribute("placement"), typeof b == "number" ? o.setAttribute("offset", String(b)) : o.removeAttribute("offset"), n && n !== "default" ? o.setAttribute("variant", n) : o.removeAttribute("variant"), r && r !== "default" ? o.setAttribute("tone", r) : o.removeAttribute("tone"), d && d !== "default" ? o.setAttribute("density", d) : o.removeAttribute("density"), m && m !== "default" ? o.setAttribute("shape", m) : o.removeAttribute("shape"), l && l !== "default" ? o.setAttribute("elevation", l) : o.removeAttribute("elevation"), E ? o.setAttribute("headless", "") : o.removeAttribute("headless"));
3659
+ }, [s, i, u, b, n, r, d, m, l, E]), F.createElement("ui-hover-card", { ref: e, ...a }, f);
3660
+ });
3661
+ Gt.displayName = "HoverCard";
3662
+ const _t = F.forwardRef(function({
3663
+ children: f,
3664
+ htmlFor: t,
3665
+ for: s,
3666
+ required: i,
3667
+ description: u,
3668
+ variant: b,
3669
+ tone: n,
3670
+ size: r,
3671
+ density: d,
3672
+ shape: m,
3673
+ disabled: l,
3674
+ headless: E,
3675
+ ...p
3676
+ }, L) {
3677
+ const v = X(null);
3678
+ return z(L, () => v.current), S(() => {
3679
+ const a = v.current;
3680
+ if (!a)
3681
+ return;
3682
+ const A = t || s;
3683
+ A ? a.setAttribute("for", A) : a.removeAttribute("for"), i ? a.setAttribute("required", "") : a.removeAttribute("required"), u ? a.setAttribute("description", u) : a.removeAttribute("description"), b && b !== "default" ? a.setAttribute("variant", b) : a.removeAttribute("variant"), n && n !== "default" ? a.setAttribute("tone", n) : a.removeAttribute("tone"), r && r !== "md" && r !== "2" ? a.setAttribute("size", r) : a.removeAttribute("size"), d && d !== "default" ? a.setAttribute("density", d) : a.removeAttribute("density"), m && m !== "default" ? a.setAttribute("shape", m) : a.removeAttribute("shape"), l ? a.setAttribute("disabled", "") : a.removeAttribute("disabled"), E ? a.setAttribute("headless", "") : a.removeAttribute("headless");
3684
+ }, [t, s, i, u, b, n, r, d, m, l, E]), F.createElement("ui-label", { ref: v, ...p }, f);
3685
+ });
3686
+ _t.displayName = "Label";
3687
+ const Qt = typeof window < "u" ? F.useLayoutEffect : F.useEffect, Kt = F.forwardRef(function({
3688
+ children: f,
3689
+ open: t,
3690
+ headless: s,
3691
+ dismissible: i,
3692
+ closeOnEsc: u,
3693
+ closeOnBackdrop: b,
3694
+ lockWhileLoading: n,
3695
+ roleType: r,
3696
+ size: d,
3697
+ state: m,
3698
+ initialFocus: l,
3699
+ dialogId: E,
3700
+ config: p,
3701
+ onOpen: L,
3702
+ onConfirm: v,
3703
+ onCancel: a,
3704
+ onDismiss: A,
3705
+ onClose: e,
3706
+ onChange: o,
3707
+ ...g
3708
+ }, y) {
3709
+ const w = X(null);
3710
+ return F.useImperativeHandle(y, () => w.current), S(() => {
3711
+ const c = w.current;
3712
+ if (!c)
3713
+ return;
3714
+ const R = (H) => L == null ? void 0 : L(H.detail), h = (H) => v == null ? void 0 : v(H.detail), k = (H) => a == null ? void 0 : a(H.detail), x = (H) => A == null ? void 0 : A(H.detail), q = (H) => e == null ? void 0 : e(H.detail), B = (H) => o == null ? void 0 : o(H.detail);
3715
+ return c.addEventListener("ui-open", R), c.addEventListener("ui-confirm", h), c.addEventListener("ui-cancel", k), c.addEventListener("ui-dismiss", x), c.addEventListener("ui-close", q), c.addEventListener("ui-change", B), () => {
3716
+ c.removeEventListener("ui-open", R), c.removeEventListener("ui-confirm", h), c.removeEventListener("ui-cancel", k), c.removeEventListener("ui-dismiss", x), c.removeEventListener("ui-close", q), c.removeEventListener("ui-change", B);
3717
+ };
3718
+ }, [L, v, a, A, e, o]), Qt(() => {
3719
+ const c = w.current;
3720
+ c && (typeof t == "boolean" && (t ? c.setAttribute("open", "") : c.removeAttribute("open")), s ? c.setAttribute("headless", "") : c.removeAttribute("headless"), typeof i == "boolean" ? c.setAttribute("dismissible", String(i)) : c.removeAttribute("dismissible"), typeof u == "boolean" ? c.setAttribute("close-on-esc", String(u)) : c.removeAttribute("close-on-esc"), typeof b == "boolean" ? c.setAttribute("close-on-backdrop", String(b)) : c.removeAttribute("close-on-backdrop"), typeof n == "boolean" ? c.setAttribute("lock-while-loading", String(n)) : c.removeAttribute("lock-while-loading"), r ? c.setAttribute("role", r) : c.removeAttribute("role"), d && d !== "md" ? c.setAttribute("size", d) : c.removeAttribute("size"), m && m !== "idle" ? c.setAttribute("state", m) : c.removeAttribute("state"), l ? c.setAttribute("initial-focus", l) : c.removeAttribute("initial-focus"), E && (c.dialogId = E), p && (c.config = p));
3721
+ }, [
3722
+ t,
3723
+ s,
3724
+ i,
3725
+ u,
3726
+ b,
3727
+ n,
3728
+ r,
3729
+ d,
3730
+ m,
3731
+ l,
3732
+ E,
3733
+ p
3734
+ ]), F.createElement("ui-alert-dialog", { ref: w, ...g }, f);
3735
+ });
3736
+ Kt.displayName = "AlertDialog";
3737
+ const we = be(null);
3738
+ function gr({ children: N, hostId: f = "ui-alert-dialog-react-host" }) {
3739
+ const t = X(null);
3740
+ t.current || (t.current = Te()), S(() => {
3741
+ var u;
3742
+ if (typeof document > "u")
3743
+ return;
3744
+ let i = document.getElementById(f);
3745
+ return i || (i = document.createElement("div"), i.id = f, i.setAttribute("data-ui-alert-dialog-react-host", "true"), document.body.appendChild(i)), (u = t.current) == null || u.setContainer(i), () => {
3746
+ var b;
3747
+ (b = t.current) == null || b.destroy("unmount"), t.current = null, i && i.parentElement && i.parentElement.removeChild(i);
3748
+ };
3749
+ }, [f]);
3750
+ const s = Le(
3751
+ () => ({
3752
+ alert: (i = {}) => {
3753
+ var u;
3754
+ return ((u = t.current) == null ? void 0 : u.alert(i)) ?? Promise.resolve({ id: "", action: "dismiss" });
3755
+ },
3756
+ confirm: (i = {}) => {
3757
+ var u;
3758
+ return ((u = t.current) == null ? void 0 : u.confirm(i)) ?? Promise.resolve({ id: "", action: "dismiss" });
3759
+ },
3760
+ prompt: (i = {}) => {
3761
+ var u;
3762
+ return ((u = t.current) == null ? void 0 : u.prompt(i)) ?? Promise.resolve({ id: "", action: "dismiss", value: "" });
3763
+ }
3764
+ }),
3765
+ []
3766
+ );
3767
+ return /* @__PURE__ */ F.createElement(we.Provider, { value: s }, N);
3768
+ }
3769
+ function hr() {
3770
+ const N = me(we);
3771
+ if (!N)
3772
+ throw new Error("useAlertDialog must be used within <AlertDialogProvider>.");
3773
+ return N;
3774
+ }
3775
+ const Ut = F.forwardRef(function({
3776
+ children: f,
3777
+ value: t,
3778
+ disabled: s,
3779
+ required: i,
3780
+ invalid: u,
3781
+ headless: b,
3782
+ placeholder: n,
3783
+ name: r,
3784
+ label: d,
3785
+ description: m,
3786
+ error: l,
3787
+ size: E,
3788
+ variant: p,
3789
+ tone: L,
3790
+ density: v,
3791
+ radius: a,
3792
+ validation: A,
3793
+ onChange: e,
3794
+ onInput: o,
3795
+ onValueChange: g,
3796
+ ...y
3797
+ }, w) {
3798
+ const c = X(null);
3799
+ return z(w, () => c.current), S(() => {
3800
+ const R = c.current;
3801
+ if (!R)
3802
+ return;
3803
+ const h = (q) => {
3804
+ var B, H;
3805
+ return ((B = q.detail) == null ? void 0 : B.value) ?? ((H = q.target) == null ? void 0 : H.value) ?? "";
3806
+ }, k = (q) => {
3807
+ o == null || o(h(q));
3808
+ }, x = (q) => {
3809
+ const B = h(q);
3810
+ e == null || e(B), g == null || g(B);
3811
+ };
3812
+ return R.addEventListener("input", k), R.addEventListener("change", x), () => {
3813
+ R.removeEventListener("input", k), R.removeEventListener("change", x);
3814
+ };
3815
+ }, [e, o, g]), S(() => {
3816
+ const R = c.current;
3817
+ if (!R)
3818
+ return;
3819
+ const h = (x, q) => {
3820
+ const B = R.getAttribute(x);
3821
+ if (q == null) {
3822
+ B != null && R.removeAttribute(x);
3823
+ return;
3824
+ }
3825
+ B !== q && R.setAttribute(x, q);
3826
+ }, k = (x, q) => {
3827
+ q ? R.hasAttribute(x) || R.setAttribute(x, "") : R.hasAttribute(x) && R.removeAttribute(x);
3828
+ };
3829
+ h("value", t != null ? String(t) : null), k("disabled", s), k("required", i), k("headless", b), k("invalid", u), h("placeholder", n || null), h("name", r || null), h("label", d || null), h("description", m || null), h("error", l || null), h("size", E && E !== "md" && E !== "2" ? E : null), h("variant", p && p !== "classic" ? p : null), h("tone", L && L !== "default" ? L : null), h("density", v && v !== "default" ? v : null), h("radius", a ? String(a) : null), h("validation", A && A !== "none" ? A : null);
3830
+ }, [
3831
+ t,
3832
+ s,
3833
+ i,
3834
+ u,
3835
+ b,
3836
+ n,
3837
+ r,
3838
+ d,
3839
+ m,
3840
+ l,
3841
+ E,
3842
+ p,
3843
+ L,
3844
+ v,
3845
+ a,
3846
+ A
3847
+ ]), F.createElement("ui-select", { ref: c, ...y }, f);
3848
+ });
3849
+ Ut.displayName = "Select";
3850
+ const Xt = F.forwardRef(function({
3851
+ children: f,
3852
+ value: t,
3853
+ valueStart: s,
3854
+ valueEnd: i,
3855
+ min: u,
3856
+ max: b,
3857
+ step: n,
3858
+ range: r,
3859
+ disabled: d,
3860
+ headless: m,
3861
+ orientation: l,
3862
+ size: E,
3863
+ variant: p,
3864
+ tone: L,
3865
+ showValue: v,
3866
+ format: a,
3867
+ label: A,
3868
+ description: e,
3869
+ marks: o,
3870
+ name: g,
3871
+ nameStart: y,
3872
+ nameEnd: w,
3873
+ onInput: c,
3874
+ onChange: R,
3875
+ onValueChange: h,
3876
+ ...k
3877
+ }, x) {
3878
+ const q = X(null);
3879
+ return z(x, () => q.current), S(() => {
3880
+ const B = q.current;
3881
+ if (!B)
3882
+ return;
3883
+ const H = (P) => {
3884
+ const T = P.detail;
3885
+ T && (c == null || c(Number(T.value)), h == null || h(T));
3886
+ }, Y = (P) => {
3887
+ const T = P.detail;
3888
+ T && (R == null || R(Number(T.value)), h == null || h(T));
3889
+ };
3890
+ return B.addEventListener("input", H), B.addEventListener("change", Y), () => {
3891
+ B.removeEventListener("input", H), B.removeEventListener("change", Y);
3892
+ };
3893
+ }, [c, R, h]), S(() => {
3894
+ const B = q.current;
3895
+ if (!B)
3896
+ return;
3897
+ const H = (P, T) => {
3898
+ const D = B.getAttribute(P);
3899
+ if (T == null) {
3900
+ D != null && B.removeAttribute(P);
3901
+ return;
3902
+ }
3903
+ D !== T && B.setAttribute(P, T);
3904
+ }, Y = (P, T, D) => {
3905
+ if (T == null) {
3906
+ D !== void 0 && D === !1 && H(P, null);
3907
+ return;
3908
+ }
3909
+ T ? H(P, "") : H(P, null);
3910
+ };
3911
+ if (H("value", typeof t == "number" && Number.isFinite(t) ? String(t) : null), H("value-start", typeof s == "number" && Number.isFinite(s) ? String(s) : null), H("value-end", typeof i == "number" && Number.isFinite(i) ? String(i) : null), H("min", typeof u == "number" && Number.isFinite(u) ? String(u) : null), H("max", typeof b == "number" && Number.isFinite(b) ? String(b) : null), H("step", typeof n == "number" && Number.isFinite(n) ? String(n) : null), Y("range", r), Y("disabled", d), Y("headless", m), H("orientation", l && l !== "horizontal" ? l : null), H("size", E && E !== "md" ? E : null), H("variant", p && p !== "default" ? p : null), H("tone", L && L !== "brand" ? L : null), typeof v == "boolean" ? H("show-value", v ? "true" : "false") : H("show-value", null), H("format", a || null), H("label", A || null), H("description", e || null), H("name", g || null), H("name-start", y || null), H("name-end", w || null), o && o.length)
3912
+ try {
3913
+ H("marks", JSON.stringify(o));
3914
+ } catch {
3915
+ H("marks", null);
3916
+ }
3917
+ else
3918
+ H("marks", null);
3919
+ }, [
3920
+ t,
3921
+ s,
3922
+ i,
3923
+ u,
3924
+ b,
3925
+ n,
3926
+ r,
3927
+ d,
3928
+ m,
3929
+ l,
3930
+ E,
3931
+ p,
3932
+ L,
3933
+ v,
3934
+ a,
3935
+ A,
3936
+ e,
3937
+ o,
3938
+ g,
3939
+ y,
3940
+ w
3941
+ ]), F.createElement("ui-slider", { ref: q, ...k }, f);
3942
+ });
3943
+ Xt.displayName = "Slider";
3944
+ function wr(N) {
3945
+ const {
3946
+ count: f,
3947
+ width: t,
3948
+ height: s,
3949
+ radius: i,
3950
+ gap: u,
3951
+ variant: b,
3952
+ animated: n,
3953
+ headless: r,
3954
+ ...d
3955
+ } = N, m = X(null);
3956
+ return S(() => {
3957
+ const l = m.current;
3958
+ l && (typeof f == "number" && Number.isFinite(f) ? l.setAttribute("count", String(f)) : l.removeAttribute("count"), t ? l.setAttribute("width", t) : l.removeAttribute("width"), s ? l.setAttribute("height", s) : l.removeAttribute("height"), i ? l.setAttribute("radius", i) : l.removeAttribute("radius"), u ? l.setAttribute("gap", u) : l.removeAttribute("gap"), b ? l.setAttribute("variant", b) : l.removeAttribute("variant"), n ? l.setAttribute("animated", "") : l.removeAttribute("animated"), r ? l.setAttribute("headless", "") : l.removeAttribute("headless"));
3959
+ }, [f, t, s, i, u, b, n, r]), F.createElement("ui-skeleton", { ref: m, ...d });
3960
+ }
3961
+ export {
3962
+ Dt as Accordion,
3963
+ qt as AccordionItem,
3964
+ Jt as AccordionPanel,
3965
+ $t as AccordionTrigger,
3966
+ zt as Alert,
3967
+ Kt as AlertDialog,
3968
+ gr as AlertDialogProvider,
3969
+ ct as AppHeader,
3970
+ yt as AspectRatio,
3971
+ ht as Avatar,
3972
+ Ot as Badge,
3973
+ nt as BlockControls,
3974
+ vr as Box,
3975
+ ot as Breadcrumb,
3976
+ Mt as Button,
3977
+ _e as Calendar,
3978
+ je as Chart,
3979
+ bt as Checkbox,
3980
+ xt as Collapsible,
3981
+ Qe as ColorPicker,
3982
+ It as Combobox,
3983
+ cr as CommandPalette,
3984
+ Er as Container,
3985
+ fr as ContextMenu,
3986
+ er as DataTable,
3987
+ Ke as DatePicker,
3988
+ Ue as DateRangePicker,
3989
+ Ze as DateRangeTimePicker,
3990
+ Ye as DateTimePicker,
3991
+ Ve as Dialog,
3992
+ ir as DialogProvider,
3993
+ jt as DirectionProvider,
3994
+ ft as Drawer,
3995
+ qe as Dropdown,
3996
+ Vt as EmptyState,
3997
+ Wt as Field,
3998
+ Ar as Flex,
3999
+ or as FloatingToolbar,
4000
+ lt as Form,
4001
+ Me as Gantt,
4002
+ pr as Grid,
4003
+ Gt as HoverCard,
4004
+ rt as Icon,
4005
+ $e as Input,
4006
+ _t as Label,
4007
+ dt as Layout,
4008
+ tt as Menu,
4009
+ rr as Menubar,
4010
+ tr as NavigationMenu,
4011
+ Bt as Pagination,
4012
+ ar as PluginPanel,
4013
+ Ce as Popover,
4014
+ Ht as Portal,
4015
+ wt as Presence,
4016
+ Nt as Progress,
4017
+ Ie as QuickActions,
4018
+ mt as RadioGroup,
4019
+ Rt as ScrollArea,
4020
+ st as Section,
4021
+ Ut as Select,
4022
+ dr as SelectionPopup,
4023
+ kt as Separator,
4024
+ ut as Sidebar,
4025
+ wr as Skeleton,
4026
+ Xt as Slider,
4027
+ Pt as Slot,
4028
+ ze as Stepper,
4029
+ vt as Switch,
4030
+ Ct as Table,
4031
+ et as Tabs,
4032
+ Je as Textarea,
4033
+ yr as ThemeProvider,
4034
+ Xe as TimePicker,
4035
+ Ge as Timeline,
4036
+ it as Toast,
4037
+ ur as ToastAPI,
4038
+ At as Toggle,
4039
+ pt as ToggleGroup,
4040
+ St as Toolbar,
4041
+ De as Tooltip,
4042
+ Ft as VisuallyHidden,
4043
+ We as Wizard,
4044
+ lr as toast,
4045
+ sr as toastApi,
4046
+ hr as useAlertDialog,
4047
+ nr as useDialog,
4048
+ mr as useFloating,
4049
+ br as useForm,
4050
+ Lr as useTheme
4051
+ };