@matthiaskrijgsman/mat-ui 0.0.38 → 0.0.40

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.
package/dist/index.js CHANGED
@@ -1,48 +1,48 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as d, Fragment as te } from "react/jsx-runtime";
2
+ import { jsx as e, jsxs as d, Fragment as ce } from "react/jsx-runtime";
3
3
  import * as C from "react";
4
- import { createContext as Qe, useContext as Ze, useEffect as _, useState as W, useRef as Ce, useCallback as Le, useLayoutEffect as Rt, useMemo as ie } from "react";
5
- import { AnimatePresence as De, motion as J, animate as Xt } from "motion/react";
6
- import { IconExclamationCircleFilled as et, IconEyeOff as Vt, IconEye as Kt, IconPaperclip as Gt, IconCircleCheckFilled as tt, IconX as ue, IconCloudUpload as Jt, IconCheck as St, IconChevronDown as ve, IconBold as Yt, IconItalic as qt, IconUnderline as Qt, IconList as Ye, IconListNumbers as Zt, IconLink as en, IconArrowBackUp as tn, IconArrowForwardUp as nn, IconDots as rn, IconSearch as Me, IconSearchOff as nt, IconInfoCircleFilled as ln, IconAlertTriangleFilled as on, IconChevronRight as sn, IconChevronUp as an, IconSettings as ft, IconPlus as ht, IconTrash as cn, IconMailFilled as dn } from "@tabler/icons-react";
7
- import { FloatingPortal as Fe, FloatingOverlay as rt, flip as lt, shift as ot, size as st, useFloating as at, autoUpdate as it, offset as un, useListNavigation as mn, useInteractions as fn } from "@floating-ui/react";
8
- import { mergeRefs as hn } from "react-merge-refs";
9
- import { useDropzone as Dt } from "react-dropzone";
10
- import { LexicalComposer as pn } from "@lexical/react/LexicalComposer";
11
- import { RichTextPlugin as gn } from "@lexical/react/LexicalRichTextPlugin";
12
- import { ContentEditable as bn } from "@lexical/react/LexicalContentEditable";
13
- import { HistoryPlugin as vn } from "@lexical/react/LexicalHistoryPlugin";
14
- import { ListPlugin as xn } from "@lexical/react/LexicalListPlugin";
15
- import { LinkPlugin as wn } from "@lexical/react/LexicalLinkPlugin";
16
- import { OnChangePlugin as Nn } from "@lexical/react/LexicalOnChangePlugin";
4
+ import { createContext as Qe, useContext as Ze, useEffect as _, useState as W, useRef as Ce, useCallback as Le, useLayoutEffect as It, useMemo as se } from "react";
5
+ import { AnimatePresence as De, motion as q, animate as Kt } from "motion/react";
6
+ import { IconExclamationCircleFilled as et, IconEyeOff as Gt, IconEye as qt, IconPaperclip as Jt, IconCircleCheckFilled as tt, IconX as de, IconCloudUpload as Yt, IconCheck as Rt, IconChevronDown as be, IconBold as Qt, IconItalic as Zt, IconUnderline as en, IconList as Je, IconListNumbers as tn, IconLink as nn, IconArrowBackUp as rn, IconArrowForwardUp as ln, IconDots as on, IconSearch as Fe, IconSearchOff as nt, IconInfoCircleFilled as sn, IconAlertTriangleFilled as an, IconChevronRight as cn, IconChevronUp as dn, IconSettings as mt, IconPlus as ft, IconTrash as un, IconMailFilled as mn } from "@tabler/icons-react";
7
+ import { FloatingPortal as Me, flip as rt, shift as lt, size as ot, useFloating as st, autoUpdate as at, useDismiss as St, useInteractions as Dt, offset as fn, useListNavigation as hn, FloatingOverlay as Ot } from "@floating-ui/react";
8
+ import { mergeRefs as pn } from "react-merge-refs";
9
+ import { useDropzone as zt } from "react-dropzone";
10
+ import { LexicalComposer as gn } from "@lexical/react/LexicalComposer";
11
+ import { RichTextPlugin as bn } from "@lexical/react/LexicalRichTextPlugin";
12
+ import { ContentEditable as vn } from "@lexical/react/LexicalContentEditable";
13
+ import { HistoryPlugin as xn } from "@lexical/react/LexicalHistoryPlugin";
14
+ import { ListPlugin as wn } from "@lexical/react/LexicalListPlugin";
15
+ import { LinkPlugin as Nn } from "@lexical/react/LexicalLinkPlugin";
16
+ import { OnChangePlugin as yn } from "@lexical/react/LexicalOnChangePlugin";
17
17
  import { AutoFocusPlugin as kn } from "@lexical/react/LexicalAutoFocusPlugin";
18
- import { LexicalErrorBoundary as yn } from "@lexical/react/LexicalErrorBoundary";
19
- import { HeadingNode as Cn, QuoteNode as In, $isHeadingNode as Rn, $createHeadingNode as Sn } from "@lexical/rich-text";
20
- import { ListNode as Ot, ListItemNode as Dn, $isListNode as On, REMOVE_LIST_COMMAND as pt, INSERT_UNORDERED_LIST_COMMAND as zn, INSERT_ORDERED_LIST_COMMAND as Tn } from "@lexical/list";
21
- import { LinkNode as Ln, $isLinkNode as gt, TOGGLE_LINK_COMMAND as bt } from "@lexical/link";
22
- import { useLexicalComposerContext as me } from "@lexical/react/LexicalComposerContext";
23
- import { CAN_UNDO_COMMAND as Pn, COMMAND_PRIORITY_LOW as Pe, CAN_REDO_COMMAND as En, $getSelection as zt, $isRangeSelection as Tt, $createParagraphNode as Mn, FORMAT_TEXT_COMMAND as je, UNDO_COMMAND as Fn, REDO_COMMAND as Bn, FOCUS_COMMAND as An, BLUR_COMMAND as Un } from "lexical";
24
- import { mergeRegister as Lt, $getNearestNodeOfType as Wn } from "@lexical/utils";
25
- import { $setBlocksType as vt } from "@lexical/selection";
26
- const f = (...t) => t.filter(Boolean).join(" "), Hn = [
18
+ import { LexicalErrorBoundary as Cn } from "@lexical/react/LexicalErrorBoundary";
19
+ import { HeadingNode as In, QuoteNode as Rn, $isHeadingNode as Sn, $createHeadingNode as Dn } from "@lexical/rich-text";
20
+ import { ListNode as Tt, ListItemNode as On, $isListNode as zn, REMOVE_LIST_COMMAND as ht, INSERT_UNORDERED_LIST_COMMAND as Tn, INSERT_ORDERED_LIST_COMMAND as Ln } from "@lexical/list";
21
+ import { LinkNode as Pn, $isLinkNode as pt, TOGGLE_LINK_COMMAND as gt } from "@lexical/link";
22
+ import { useLexicalComposerContext as ue } from "@lexical/react/LexicalComposerContext";
23
+ import { CAN_UNDO_COMMAND as En, COMMAND_PRIORITY_LOW as Pe, CAN_REDO_COMMAND as Fn, $getSelection as Lt, $isRangeSelection as Pt, $createParagraphNode as Mn, FORMAT_TEXT_COMMAND as je, UNDO_COMMAND as Bn, REDO_COMMAND as An, FOCUS_COMMAND as Un, BLUR_COMMAND as Wn } from "lexical";
24
+ import { mergeRegister as Et, $getNearestNodeOfType as Hn } from "@lexical/utils";
25
+ import { $setBlocksType as bt } from "@lexical/selection";
26
+ const m = (...n) => n.filter(Boolean).join(" "), $n = [
27
27
  "polygon(50% 50%,0 0,0 0,0 0,0 0,0 0)",
28
28
  "polygon(50% 50%,0 0,100% 0,100% 0,100% 0,100% 0)",
29
29
  "polygon(50% 50%,0 0,100% 0,100% 100%,100% 100%,100% 100%)",
30
30
  "polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 100%)",
31
31
  "polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 0)"
32
- ], Se = (t) => {
32
+ ], Se = (n) => {
33
33
  const {
34
- speed: n = 1,
35
- className: s
36
- } = t, o = 1 / n, r = 2 / n;
34
+ speed: t = 1,
35
+ className: o
36
+ } = n, s = 1 / t, r = 2 / t;
37
37
  return /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(
38
- J.div,
38
+ q.div,
39
39
  {
40
40
  role: "status",
41
- className: f("relative rounded-full", s),
41
+ className: m("relative rounded-full", o),
42
42
  animate: { rotate: 360 },
43
- transition: { repeat: 1 / 0, ease: "linear", duration: o },
43
+ transition: { repeat: 1 / 0, ease: "linear", duration: s },
44
44
  children: /* @__PURE__ */ e(
45
- J.div,
45
+ q.div,
46
46
  {
47
47
  className: "absolute inset-0 rounded-full",
48
48
  style: {
@@ -50,7 +50,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
50
50
  borderStyle: "solid",
51
51
  borderWidth: 2
52
52
  },
53
- animate: { clipPath: Hn },
53
+ animate: { clipPath: $n },
54
54
  transition: {
55
55
  repeat: 1 / 0,
56
56
  ease: "linear",
@@ -61,35 +61,35 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
61
61
  )
62
62
  }
63
63
  ) });
64
- }, ne = {
64
+ }, te = {
65
65
  sm: "h-[var(--control-size-sm-height)]",
66
66
  md: "h-[var(--control-size-md-height)]",
67
67
  lg: "h-[var(--control-size-lg-height)]"
68
- }, Pt = {
68
+ }, Ft = {
69
69
  sm: "min-h-[var(--control-size-sm-height)]",
70
70
  md: "min-h-[var(--control-size-md-height)]",
71
71
  lg: "min-h-[var(--control-size-lg-height)]"
72
- }, Y = {
72
+ }, J = {
73
73
  sm: "text-[length:var(--control-size-sm-font-size)]",
74
74
  md: "text-[length:var(--control-size-md-font-size)]",
75
75
  lg: "text-[length:var(--control-size-lg-font-size)]"
76
- }, $n = {
76
+ }, _n = {
77
77
  sm: "gap-[var(--control-size-sm-gap)]",
78
78
  md: "gap-[var(--control-size-md-gap)]",
79
79
  lg: "gap-[var(--control-size-lg-gap)]"
80
- }, _n = {
80
+ }, jn = {
81
81
  sm: "px-[var(--control-size-sm-px)]",
82
82
  md: "px-[var(--control-size-md-px)]",
83
83
  lg: "px-[var(--control-size-lg-px)]"
84
- }, fe = {
84
+ }, me = {
85
85
  sm: "pl-[var(--control-size-sm-px)]",
86
86
  md: "pl-[var(--control-size-md-px)]",
87
87
  lg: "pl-[var(--control-size-lg-px)]"
88
- }, ct = {
88
+ }, it = {
89
89
  sm: "pr-[var(--control-size-sm-px)]",
90
90
  md: "pr-[var(--control-size-md-px)]",
91
91
  lg: "pr-[var(--control-size-lg-px)]"
92
- }, he = {
92
+ }, fe = {
93
93
  sm: "pr-[calc(var(--control-size-sm-px)+2rem)]",
94
94
  md: "pr-[calc(var(--control-size-md-px)+2rem)]",
95
95
  lg: "pr-[calc(var(--control-size-lg-px)+2rem)]"
@@ -97,75 +97,75 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
97
97
  sm: "pr-[calc(var(--control-size-sm-px)+3.75rem)]",
98
98
  md: "pr-[calc(var(--control-size-md-px)+3.75rem)]",
99
99
  lg: "pr-[calc(var(--control-size-lg-px)+3.75rem)]"
100
- }, Et = {
100
+ }, Mt = {
101
101
  sm: "pl-[calc(var(--control-size-sm-icon-offset)+var(--control-size-sm-icon)+0.75rem)]",
102
102
  md: "pl-[calc(var(--control-size-md-icon-offset)+var(--control-size-md-icon)+0.75rem)]",
103
103
  lg: "pl-[calc(var(--control-size-lg-icon-offset)+var(--control-size-lg-icon)+0.75rem)]"
104
- }, Mt = {
104
+ }, Bt = {
105
105
  sm: "left-[var(--control-size-sm-icon-offset)]",
106
106
  md: "left-[var(--control-size-md-icon-offset)]",
107
107
  lg: "left-[var(--control-size-lg-icon-offset)]"
108
- }, jn = {
108
+ }, Xn = {
109
109
  sm: "right-[var(--control-size-sm-px)]",
110
110
  md: "right-[var(--control-size-md-px)]",
111
111
  lg: "right-[var(--control-size-lg-px)]"
112
- }, ce = {
112
+ }, ae = {
113
113
  sm: "h-[var(--control-size-sm-icon)] w-[var(--control-size-sm-icon)]",
114
114
  md: "h-[var(--control-size-md-icon)] w-[var(--control-size-md-icon)]",
115
115
  lg: "h-[var(--control-size-lg-icon)] w-[var(--control-size-lg-icon)]"
116
- }, Ft = {
116
+ }, At = {
117
117
  sm: "h-[var(--control-size-sm-height)] w-[var(--control-size-sm-height)]",
118
118
  md: "h-[var(--control-size-md-height)] w-[var(--control-size-md-height)]",
119
119
  lg: "h-[var(--control-size-lg-height)] w-[var(--control-size-lg-height)]"
120
- }, Xn = `
120
+ }, Vn = `
121
121
  inline-flex flex-row items-center justify-center
122
122
  button-ring font-semibold ring-0 disabled:hover:ring-0 hover:ring-4 active:ring-1
123
123
  rounded-[var(--border-radius-input)]
124
124
  cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-4
125
125
  disabled:cursor-default
126
- `, Vn = {
126
+ `, Kn = {
127
127
  primary: "border button-primary shadow-sm",
128
128
  secondary: "border button-secondary shadow-sm",
129
129
  tertiary: "border button-tertiary",
130
130
  white: "border button-white shadow-sm",
131
131
  black: "border button-black shadow-sm",
132
132
  transparent: "border button-transparent"
133
- }, Kn = C.forwardRef((t, n) => {
133
+ }, Gn = C.forwardRef((n, t) => {
134
134
  const {
135
- variant: s = "white",
136
- size: o = "md",
135
+ variant: o = "white",
136
+ size: s = "md",
137
137
  className: r,
138
138
  children: l,
139
139
  loading: a = !1,
140
140
  Icon: i,
141
141
  IconRight: c,
142
- ...g
143
- } = t;
142
+ ...b
143
+ } = n;
144
144
  return /* @__PURE__ */ d(
145
145
  "button",
146
146
  {
147
- ref: n,
148
- className: f(
149
- Xn,
150
- Vn[s],
151
- ne[o],
152
- _n[o],
153
- Y[o],
154
- $n[o],
147
+ ref: t,
148
+ className: m(
149
+ Vn,
150
+ Kn[o],
151
+ te[s],
152
+ jn[s],
153
+ J[s],
154
+ _n[s],
155
155
  r
156
156
  ),
157
- ...g,
157
+ ...b,
158
158
  children: [
159
- a && /* @__PURE__ */ e(Se, { className: f(ce[o]) }),
160
- !a && /* @__PURE__ */ d(te, { children: [
161
- i && /* @__PURE__ */ e(i, { className: f(ce[o], "-ml-1") }),
159
+ a && /* @__PURE__ */ e(Se, { className: m(ae[s]) }),
160
+ !a && /* @__PURE__ */ d(ce, { children: [
161
+ i && /* @__PURE__ */ e(i, { className: m(ae[s], "-ml-1") }),
162
162
  l,
163
- c && /* @__PURE__ */ e(c, { className: f(ce[o], "-mr-1") })
163
+ c && /* @__PURE__ */ e(c, { className: m(ae[s], "-mr-1") })
164
164
  ] })
165
165
  ]
166
166
  }
167
167
  );
168
- }), Gn = `
168
+ }), qn = `
169
169
  inline-flex flex-row items-center justify-center
170
170
  button-ring font-semibold ring-0 disabled:hover:ring-0 hover:ring-4 active:ring-1
171
171
  rounded-[var(--border-radius-input)]
@@ -178,221 +178,221 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
178
178
  white: "border button-white shadow-sm",
179
179
  black: "border button-black shadow-sm",
180
180
  transparent: "border button-transparent"
181
- }, qe = C.forwardRef((t, n) => {
181
+ }, Ye = C.forwardRef((n, t) => {
182
182
  const {
183
- variant: s = "white",
184
- size: o = "md",
183
+ variant: o = "white",
184
+ size: s = "md",
185
185
  className: r,
186
186
  Icon: l,
187
187
  ...a
188
- } = t;
188
+ } = n;
189
189
  return /* @__PURE__ */ e(
190
190
  "button",
191
191
  {
192
- ref: n,
193
- className: f(
194
- Gn,
195
- Jn[s],
196
- Ft[o],
192
+ ref: t,
193
+ className: m(
194
+ qn,
195
+ Jn[o],
196
+ At[s],
197
197
  r
198
198
  ),
199
199
  ...a,
200
- children: /* @__PURE__ */ e(l, { className: ce[o] })
200
+ children: /* @__PURE__ */ e(l, { className: ae[s] })
201
201
  }
202
202
  );
203
203
  }), Yn = `
204
204
  inline-flex flex-row items-center justify-center
205
205
  button-ring font-semibold ring-0 disabled:hover:ring-0 hover:ring-4 active:ring-1 rounded-full cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-4
206
206
  disabled:cursor-default
207
- `, qn = {
207
+ `, Qn = {
208
208
  primary: "border button-primary shadow-sm",
209
209
  secondary: "border button-secondary shadow-sm",
210
210
  tertiary: "border button-tertiary",
211
211
  white: "border button-white shadow-sm",
212
212
  black: "border button-black shadow-sm",
213
213
  transparent: "border button-transparent"
214
- }, Bt = C.forwardRef((t, n) => {
214
+ }, Ut = C.forwardRef((n, t) => {
215
215
  const {
216
- variant: s = "white",
217
- size: o = "md",
216
+ variant: o = "white",
217
+ size: s = "md",
218
218
  className: r,
219
219
  Icon: l,
220
220
  ...a
221
- } = t;
221
+ } = n;
222
222
  return /* @__PURE__ */ e(
223
223
  "button",
224
224
  {
225
- ref: n,
226
- className: f(
225
+ ref: t,
226
+ className: m(
227
227
  Yn,
228
- qn[s],
229
- Ft[o],
228
+ Qn[o],
229
+ At[s],
230
230
  r
231
231
  ),
232
232
  ...a,
233
- children: /* @__PURE__ */ e(l, { className: ce[o] })
233
+ children: /* @__PURE__ */ e(l, { className: ae[s] })
234
234
  }
235
235
  );
236
- }), q = (t) => {
236
+ }), Y = (n) => {
237
237
  const {
238
- children: n
239
- } = t;
240
- return n ? /* @__PURE__ */ e("label", { className: "input-label font-medium mb-1", children: n }) : null;
241
- }, re = () => /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(et, { className: "h-5 w-5 input-error-icon" }) }), Q = Qe("md"), Qn = () => Ze(Q), pe = C.forwardRef((t, n) => {
238
+ children: t
239
+ } = n;
240
+ return t ? /* @__PURE__ */ e("label", { className: "input-label font-medium mb-1", children: t }) : null;
241
+ }, ne = () => /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(et, { className: "h-5 w-5 input-error-icon" }) }), Q = Qe("md"), Zn = () => Ze(Q), he = C.forwardRef((n, t) => {
242
242
  const {
243
- children: s,
244
- className: o
245
- } = t, r = Qn();
243
+ children: o,
244
+ className: s
245
+ } = n, r = Zn();
246
246
  return /* @__PURE__ */ e(
247
247
  "div",
248
248
  {
249
- ref: n,
250
- className: f(
249
+ ref: t,
250
+ className: m(
251
251
  "absolute top-1/2 -translate-y-1/2 flex flex-row items-center gap-1 pointer-events-none",
252
- jn[r],
253
- o
252
+ Xn[r],
253
+ s
254
254
  ),
255
- children: s
255
+ children: o
256
256
  }
257
257
  );
258
- }), V = (t) => {
258
+ }), V = (n) => {
259
259
  const {
260
- children: n
261
- } = t;
262
- return n ? /* @__PURE__ */ e("div", { className: "input-description text-sm font-medium mt-2", children: n }) : null;
263
- }, K = (t) => {
260
+ children: t
261
+ } = n;
262
+ return t ? /* @__PURE__ */ e("div", { className: "input-description text-sm font-medium mt-2", children: t }) : null;
263
+ }, K = (n) => {
264
264
  const {
265
- children: n
266
- } = t;
267
- return n ? /* @__PURE__ */ e("div", { className: "input-error-text text-sm font-medium mt-2", children: n }) : null;
268
- }, At = (t) => {
265
+ children: t
266
+ } = n;
267
+ return t ? /* @__PURE__ */ e("div", { className: "input-error-text text-sm font-medium mt-2", children: t }) : null;
268
+ }, Wt = (n) => {
269
269
  const {
270
- className: n,
271
- label: s,
272
- description: o,
270
+ className: t,
271
+ label: o,
272
+ description: s,
273
273
  Icon: r,
274
274
  error: l,
275
275
  buttonTray: a,
276
276
  size: i = "md",
277
277
  ...c
278
- } = t, g = !!l || !!a;
278
+ } = n, b = !!l || !!a;
279
279
  return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d(
280
280
  "div",
281
281
  {
282
- className: f(
282
+ className: m(
283
283
  "flex flex-col",
284
- n
284
+ t
285
285
  ),
286
286
  children: [
287
- /* @__PURE__ */ e(q, { children: s }),
287
+ /* @__PURE__ */ e(Y, { children: o }),
288
288
  /* @__PURE__ */ d("div", { className: "flex flex-col relative", children: [
289
- r && /* @__PURE__ */ e(r, { className: f(
289
+ r && /* @__PURE__ */ e(r, { className: m(
290
290
  "input-icon absolute top-1/2 -translate-y-1/2",
291
- ce[i],
292
- Mt[i]
291
+ ae[i],
292
+ Bt[i]
293
293
  ) }),
294
294
  /* @__PURE__ */ e(
295
295
  "input",
296
296
  {
297
- className: f(
297
+ className: m(
298
298
  "border input-base transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
299
- ne[i],
300
- Y[i],
301
- r ? Et[i] : fe[i],
302
- g ? he[i] : ct[i],
299
+ te[i],
300
+ J[i],
301
+ r ? Mt[i] : me[i],
302
+ b ? fe[i] : it[i],
303
303
  l && "input-error"
304
304
  ),
305
305
  ...c
306
306
  }
307
307
  ),
308
- /* @__PURE__ */ d(pe, { children: [
309
- l && /* @__PURE__ */ e(re, {}),
308
+ /* @__PURE__ */ d(he, { children: [
309
+ l && /* @__PURE__ */ e(ne, {}),
310
310
  a
311
311
  ] })
312
312
  ] }),
313
- /* @__PURE__ */ e(V, { children: o }),
313
+ /* @__PURE__ */ e(V, { children: s }),
314
314
  /* @__PURE__ */ e(K, { children: l })
315
315
  ]
316
316
  }
317
317
  ) });
318
- }, Zn = (t) => {
319
- const n = t.match(/^#?([0-9a-fA-F]{6})$/);
320
- if (!n) return null;
321
- const s = parseInt(n[1], 16);
322
- return [(s >> 16 & 255) / 255, (s >> 8 & 255) / 255, (s & 255) / 255];
323
- }, er = (t, n, s) => {
324
- const o = (r) => Math.round(r * 255).toString(16).padStart(2, "0").toUpperCase();
325
- return "#" + o(t) + o(n) + o(s);
326
- }, tr = (t, n, s) => {
327
- const o = Math.max(t, n, s), r = Math.min(t, n, s), l = o - r;
318
+ }, er = (n) => {
319
+ const t = n.match(/^#?([0-9a-fA-F]{6})$/);
320
+ if (!t) return null;
321
+ const o = parseInt(t[1], 16);
322
+ return [(o >> 16 & 255) / 255, (o >> 8 & 255) / 255, (o & 255) / 255];
323
+ }, tr = (n, t, o) => {
324
+ const s = (r) => Math.round(r * 255).toString(16).padStart(2, "0").toUpperCase();
325
+ return "#" + s(n) + s(t) + s(o);
326
+ }, nr = (n, t, o) => {
327
+ const s = Math.max(n, t, o), r = Math.min(n, t, o), l = s - r;
328
328
  let a = 0;
329
- return l !== 0 && (o === t ? a = ((n - s) / l + 6) % 6 : o === n ? a = (s - t) / l + 2 : a = (t - n) / l + 4, a *= 60), [a, o === 0 ? 0 : l / o, o];
330
- }, nr = (t, n, s) => {
331
- const o = s * n, r = t / 60, l = o * (1 - Math.abs(r % 2 - 1));
329
+ return l !== 0 && (s === n ? a = ((t - o) / l + 6) % 6 : s === t ? a = (o - n) / l + 2 : a = (n - t) / l + 4, a *= 60), [a, s === 0 ? 0 : l / s, s];
330
+ }, rr = (n, t, o) => {
331
+ const s = o * t, r = n / 60, l = s * (1 - Math.abs(r % 2 - 1));
332
332
  let a = 0, i = 0, c = 0;
333
- r < 1 ? (a = o, i = l) : r < 2 ? (a = l, i = o) : r < 3 ? (i = o, c = l) : r < 4 ? (i = l, c = o) : r < 5 ? (a = l, c = o) : (a = o, c = l);
334
- const g = s - o;
335
- return [a + g, i + g, c + g];
336
- }, Re = (t, n, s) => {
337
- const [o, r, l] = nr(t, n, s);
338
- return er(o, r, l);
339
- }, xt = (t) => {
340
- const n = Zn(t);
341
- return n ? tr(n[0], n[1], n[2]) : null;
342
- }, rr = (t) => {
343
- const n = t.trim();
344
- if (!n) return null;
345
- const s = n.match(/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);
346
- if (s) {
347
- let a = s[1];
333
+ r < 1 ? (a = s, i = l) : r < 2 ? (a = l, i = s) : r < 3 ? (i = s, c = l) : r < 4 ? (i = l, c = s) : r < 5 ? (a = l, c = s) : (a = s, c = l);
334
+ const b = o - s;
335
+ return [a + b, i + b, c + b];
336
+ }, Re = (n, t, o) => {
337
+ const [s, r, l] = rr(n, t, o);
338
+ return tr(s, r, l);
339
+ }, vt = (n) => {
340
+ const t = er(n);
341
+ return t ? nr(t[0], t[1], t[2]) : null;
342
+ }, lr = (n) => {
343
+ const t = n.trim();
344
+ if (!t) return null;
345
+ const o = t.match(/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);
346
+ if (o) {
347
+ let a = o[1];
348
348
  return a.length === 3 && (a = a.split("").map((i) => i + i).join("")), "#" + a.toUpperCase();
349
349
  }
350
350
  if (typeof document > "u") return null;
351
- const o = document.createElement("div");
352
- if (o.style.color = n, !o.style.color) return null;
353
- document.body.appendChild(o);
354
- const r = getComputedStyle(o).color;
355
- document.body.removeChild(o);
351
+ const s = document.createElement("div");
352
+ if (s.style.color = t, !s.style.color) return null;
353
+ document.body.appendChild(s);
354
+ const r = getComputedStyle(s).color;
355
+ document.body.removeChild(s);
356
356
  const l = r.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
357
357
  return l ? "#" + [l[1], l[2], l[3]].map((a) => parseInt(a, 10).toString(16).padStart(2, "0")).join("").toUpperCase() : null;
358
- }, Xe = (t) => {
359
- const n = C.useRef(null), [s, o] = C.useState(!1), r = (l) => {
360
- n.current = null, o(!1), l.currentTarget.releasePointerCapture?.(l.pointerId);
358
+ }, Xe = (n) => {
359
+ const t = C.useRef(null), [o, s] = C.useState(!1), r = (l) => {
360
+ t.current = null, s(!1), l.currentTarget.releasePointerCapture?.(l.pointerId);
361
361
  };
362
362
  return {
363
- isDragging: s,
363
+ isDragging: o,
364
364
  bind: {
365
365
  onPointerDown: (l) => {
366
366
  const a = l.currentTarget;
367
- n.current = a.getBoundingClientRect(), a.setPointerCapture?.(l.pointerId), o(!0), t(l.clientX, l.clientY, n.current);
367
+ t.current = a.getBoundingClientRect(), a.setPointerCapture?.(l.pointerId), s(!0), n(l.clientX, l.clientY, t.current);
368
368
  },
369
369
  onPointerMove: (l) => {
370
- n.current && t(l.clientX, l.clientY, n.current);
370
+ t.current && n(l.clientX, l.clientY, t.current);
371
371
  },
372
372
  onPointerUp: r,
373
373
  onPointerCancel: r
374
374
  }
375
375
  };
376
- }, lr = "flex flex-col dropdown-panel border mt-1 rounded-xl shadow-lg overflow-y-auto relative space-y-1", or = {
376
+ }, or = "flex flex-col dropdown-panel border mt-1 rounded-xl shadow-lg overflow-y-auto relative space-y-1", sr = {
377
377
  sm: "p-2",
378
378
  md: "p-3",
379
379
  lg: "p-4"
380
- }, xe = (t) => {
380
+ }, ve = (n) => {
381
381
  const {
382
- className: n,
383
- children: s,
384
- padding: o = "md",
382
+ className: t,
383
+ children: o,
384
+ padding: s = "md",
385
385
  ...r
386
- } = t;
386
+ } = n;
387
387
  return /* @__PURE__ */ e(
388
388
  "div",
389
389
  {
390
- className: f(lr, or[o], n),
390
+ className: m(or, sr[s], t),
391
391
  ...r,
392
- children: s
392
+ children: o
393
393
  }
394
394
  );
395
- }, sr = {
395
+ }, ar = {
396
396
  top: "bottom center",
397
397
  "top-start": "bottom left",
398
398
  "top-end": "bottom right",
@@ -405,114 +405,117 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
405
405
  left: "right center",
406
406
  "left-start": "top right",
407
407
  "left-end": "bottom right"
408
- }, Ut = C.memo(
409
- ({ open: t, children: n, className: s, onOutsideClick: o, floatingStyles: r, setFloating: l, placement: a, floatingProps: i }) => /* @__PURE__ */ e(Fe, { children: /* @__PURE__ */ e(De, { children: t && /* @__PURE__ */ d(te, { children: [
410
- o && /* @__PURE__ */ e(rt, { onClick: o }),
411
- /* @__PURE__ */ e("div", { ref: l, style: r, className: "z-50", ...i, children: /* @__PURE__ */ e(
412
- J.div,
413
- {
414
- className: s,
415
- style: { transformOrigin: sr[a] },
416
- initial: { opacity: 0, scale: 0.95 },
417
- animate: { opacity: 1, scale: 1 },
418
- exit: { opacity: 0, scale: 0.95 },
419
- transition: { duration: 0.1, ease: "easeInOut" },
420
- children: n
421
- }
422
- ) })
423
- ] }) }) })
424
- ), dt = (t) => {
425
- const { placement: n = "bottom", onOutsideClick: s, fullWidth: o, minWidth: r, maxWidth: l } = t, a = C.useMemo(() => [
408
+ }, Ht = C.memo(
409
+ ({ open: n, children: t, className: o, floatingStyles: s, setFloating: r, placement: l, floatingProps: a }) => /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(De, { children: n && /* @__PURE__ */ e("div", { ref: r, style: s, className: "z-50", ...a, children: /* @__PURE__ */ e(
410
+ q.div,
411
+ {
412
+ className: o,
413
+ style: { transformOrigin: ar[l] },
414
+ initial: { opacity: 0, scale: 0.95 },
415
+ animate: { opacity: 1, scale: 1 },
416
+ exit: { opacity: 0, scale: 0.95 },
417
+ transition: { duration: 0.1, ease: "easeInOut" },
418
+ children: t
419
+ }
420
+ ) }) }) })
421
+ ), ct = (n) => {
422
+ const { placement: t = "bottom", open: o, onOpenChange: s, fullWidth: r, minWidth: l, maxWidth: a } = n, i = C.useMemo(() => [
423
+ rt({ padding: 8 }),
426
424
  lt({ padding: 8 }),
427
- ot({ padding: 8 }),
428
- st({
429
- apply({ rects: h, elements: b }) {
430
- o && (b.floating.style.width = `${h.reference.width}px`), r && (b.floating.style.minWidth = `${r}px`), l && (b.floating.style.maxWidth = `${l}px`);
425
+ ot({
426
+ apply({ rects: u, elements: I }) {
427
+ r && (I.floating.style.width = `${u.reference.width}px`), l && (I.floating.style.minWidth = `${l}px`), a && (I.floating.style.maxWidth = `${a}px`);
431
428
  }
432
429
  })
433
- ], [o, l, r]), { refs: i, floatingStyles: c, placement: g } = at({
434
- placement: n,
435
- middleware: a,
436
- whileElementsMounted: it
437
- }), x = C.useRef({
438
- onOutsideClick: s,
439
- floatingStyles: c,
440
- setFloating: i.setFloating,
441
- placement: n
430
+ ], [r, a, l]), { refs: c, floatingStyles: b, context: R, placement: N } = st({
431
+ placement: t,
432
+ open: o,
433
+ onOpenChange: s,
434
+ middleware: i,
435
+ whileElementsMounted: at
436
+ }), h = St(R, {
437
+ enabled: !!s,
438
+ outsidePress: !0,
439
+ escapeKey: !1
440
+ }), { getFloatingProps: v } = Dt([h]), f = C.useRef({
441
+ floatingStyles: b,
442
+ setFloating: c.setFloating,
443
+ placement: t,
444
+ getFloatingProps: v
442
445
  });
443
- x.current = {
444
- onOutsideClick: s,
445
- floatingStyles: c,
446
- setFloating: i.setFloating,
447
- placement: g
446
+ f.current = {
447
+ floatingStyles: b,
448
+ setFloating: c.setFloating,
449
+ placement: N,
450
+ getFloatingProps: v
448
451
  };
449
- const w = C.useMemo(() => {
450
- const h = (b) => {
451
- const { floatingStyles: p, setFloating: m, onOutsideClick: v, placement: u } = x.current, { className: I, open: R, children: y } = b;
452
+ const p = C.useMemo(() => {
453
+ const u = (I) => {
454
+ const { floatingStyles: x, setFloating: y, placement: k, getFloatingProps: S } = f.current, { className: O, open: P, children: T } = I;
452
455
  return /* @__PURE__ */ e(
453
- Ut,
456
+ Ht,
454
457
  {
455
- open: R,
456
- className: I,
457
- onOutsideClick: v,
458
- floatingStyles: p,
459
- setFloating: m,
460
- placement: u,
461
- children: y
458
+ open: P,
459
+ className: O,
460
+ floatingStyles: x,
461
+ setFloating: y,
462
+ placement: k,
463
+ floatingProps: S(),
464
+ children: T
462
465
  }
463
466
  );
464
467
  };
465
- return C.memo(h);
468
+ return C.memo(u);
466
469
  }, []);
467
470
  return {
468
- anchorRef: i.setReference,
469
- Popover: w
471
+ anchorRef: c.setReference,
472
+ Popover: p
470
473
  };
471
- }, we = (t, n) => {
474
+ }, xe = (n, t) => {
472
475
  _(() => {
473
- if (!t) return;
474
- const s = (o) => {
475
- o.key === "Escape" && n();
476
+ if (!n) return;
477
+ const o = (s) => {
478
+ s.key === "Escape" && t();
476
479
  };
477
- return document.addEventListener("keydown", s), () => {
478
- document.removeEventListener("keydown", s);
480
+ return document.addEventListener("keydown", o), () => {
481
+ document.removeEventListener("keydown", o);
479
482
  };
480
- }, [t, n]);
481
- }, ar = "linear-gradient(to right, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%)", ir = "linear-gradient(to right, #fff, rgba(255,255,255,0))", cr = "linear-gradient(to top, #000, rgba(0,0,0,0))", Ve = "0 0 0 1px rgba(0,0,0,0.15)", dr = 14, ur = 28, mr = 6, fr = 8, Ke = { type: "spring", stiffness: 500, damping: 18, mass: 0.6 }, ke = (t) => {
482
- const n = t ? ur : dr, s = n / 2;
483
+ }, [n, t]);
484
+ }, ir = "linear-gradient(to right, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%)", cr = "linear-gradient(to right, #fff, rgba(255,255,255,0))", dr = "linear-gradient(to top, #000, rgba(0,0,0,0))", Ve = "0 0 0 1px rgba(0,0,0,0.15)", ur = 14, mr = 28, fr = 6, hr = 8, Ke = { type: "spring", stiffness: 500, damping: 18, mass: 0.6 }, ye = (n) => {
485
+ const t = n ? mr : ur, o = t / 2;
483
486
  return {
484
- width: n,
485
- height: n,
486
- marginLeft: -s,
487
- marginTop: -s,
488
- borderRadius: t ? fr : mr
487
+ width: t,
488
+ height: t,
489
+ marginLeft: -o,
490
+ marginTop: -o,
491
+ borderRadius: n ? hr : fr
489
492
  };
490
- }, Te = (t) => Math.max(0, Math.min(1, t)), wt = (t, n) => {
491
- Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(t, n), t.dispatchEvent(new Event("input", { bubbles: !0 }));
492
- }, hr = ({ value: t, onChange: n }) => {
493
- const [s, o] = W(() => xt(t) ?? [0, 0, 1]), r = Ce(Re(s[0], s[1], s[2]));
493
+ }, Te = (n) => Math.max(0, Math.min(1, n)), xt = (n, t) => {
494
+ Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(n, t), n.dispatchEvent(new Event("input", { bubbles: !0 }));
495
+ }, pr = ({ value: n, onChange: t }) => {
496
+ const [o, s] = W(() => vt(n) ?? [0, 0, 1]), r = Ce(Re(o[0], o[1], o[2]));
494
497
  _(() => {
495
- if ((t || "").toUpperCase() === r.current) return;
496
- const m = xt(t);
497
- m && o(m);
498
- }, [t]);
499
- const l = (m) => {
500
- o(m);
501
- const v = Re(m[0], m[1], m[2]);
502
- r.current = v, n(v);
503
- }, [a, i, c] = s, g = Re(a, 1, 1), x = Re(a, i, 1), w = Re(a, i, c), h = Xe((m, v, u) => {
504
- l([a, Te((m - u.left) / u.width), 1 - Te((v - u.top) / u.height)]);
505
- }), b = Xe((m, v, u) => {
506
- l([Te((m - u.left) / u.width) * 360, i, c]);
507
- }), p = Xe((m, v, u) => {
508
- l([a, i, Te((m - u.left) / u.width)]);
498
+ if ((n || "").toUpperCase() === r.current) return;
499
+ const p = vt(n);
500
+ p && s(p);
501
+ }, [n]);
502
+ const l = (p) => {
503
+ s(p);
504
+ const u = Re(p[0], p[1], p[2]);
505
+ r.current = u, t(u);
506
+ }, [a, i, c] = o, b = Re(a, 1, 1), R = Re(a, i, 1), N = Re(a, i, c), h = Xe((p, u, I) => {
507
+ l([a, Te((p - I.left) / I.width), 1 - Te((u - I.top) / I.height)]);
508
+ }), v = Xe((p, u, I) => {
509
+ l([Te((p - I.left) / I.width) * 360, i, c]);
510
+ }), f = Xe((p, u, I) => {
511
+ l([a, i, Te((p - I.left) / I.width)]);
509
512
  });
510
513
  return /* @__PURE__ */ d(
511
514
  "div",
512
515
  {
513
516
  className: "flex flex-col gap-3",
514
517
  style: { width: 220, userSelect: "none" },
515
- onMouseDown: (m) => m.preventDefault(),
518
+ onMouseDown: (p) => p.preventDefault(),
516
519
  children: [
517
520
  /* @__PURE__ */ d(
518
521
  "div",
@@ -529,37 +532,37 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
529
532
  "div",
530
533
  {
531
534
  className: "absolute inset-0 rounded-md overflow-hidden border color-picker-surface",
532
- style: { backgroundColor: g },
535
+ style: { backgroundColor: b },
533
536
  children: [
534
537
  /* @__PURE__ */ e(
535
538
  "div",
536
539
  {
537
540
  className: "absolute inset-0 pointer-events-none",
538
- style: { background: ir }
541
+ style: { background: cr }
539
542
  }
540
543
  ),
541
544
  /* @__PURE__ */ e(
542
545
  "div",
543
546
  {
544
547
  className: "absolute inset-0 pointer-events-none",
545
- style: { background: cr }
548
+ style: { background: dr }
546
549
  }
547
550
  )
548
551
  ]
549
552
  }
550
553
  ),
551
554
  /* @__PURE__ */ e(
552
- J.div,
555
+ q.div,
553
556
  {
554
557
  className: "absolute pointer-events-none border-1 border-white",
555
558
  style: {
556
559
  left: `${i * 100}%`,
557
560
  top: `${(1 - c) * 100}%`,
558
561
  boxShadow: Ve,
559
- backgroundColor: w
562
+ backgroundColor: N
560
563
  },
561
- initial: ke(!1),
562
- animate: ke(h.isDragging),
564
+ initial: ye(!1),
565
+ animate: ye(h.isDragging),
563
566
  transition: Ke
564
567
  }
565
568
  )
@@ -572,23 +575,23 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
572
575
  className: "relative w-full rounded-md",
573
576
  style: {
574
577
  height: 12,
575
- background: ar,
578
+ background: ir,
576
579
  touchAction: "none",
577
580
  cursor: "ew-resize"
578
581
  },
579
- ...b.bind,
582
+ ...v.bind,
580
583
  children: /* @__PURE__ */ e(
581
- J.div,
584
+ q.div,
582
585
  {
583
586
  className: "absolute pointer-events-none border-1 border-white",
584
587
  style: {
585
588
  top: "50%",
586
589
  left: `${a / 360 * 100}%`,
587
- backgroundColor: g,
590
+ backgroundColor: b,
588
591
  boxShadow: Ve
589
592
  },
590
- initial: ke(!1),
591
- animate: ke(b.isDragging),
593
+ initial: ye(!1),
594
+ animate: ye(v.isDragging),
592
595
  transition: Ke
593
596
  }
594
597
  )
@@ -600,23 +603,23 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
600
603
  className: "relative w-full rounded-md",
601
604
  style: {
602
605
  height: 12,
603
- background: `linear-gradient(to right, #000, ${x})`,
606
+ background: `linear-gradient(to right, #000, ${R})`,
604
607
  touchAction: "none",
605
608
  cursor: "ew-resize"
606
609
  },
607
- ...p.bind,
610
+ ...f.bind,
608
611
  children: /* @__PURE__ */ e(
609
- J.div,
612
+ q.div,
610
613
  {
611
614
  className: "absolute pointer-events-none border-1 border-white",
612
615
  style: {
613
616
  top: "50%",
614
617
  left: `${c * 100}%`,
615
- backgroundColor: w,
618
+ backgroundColor: N,
616
619
  boxShadow: Ve
617
620
  },
618
- initial: ke(!1),
619
- animate: ke(p.isDragging),
621
+ initial: ye(!1),
622
+ animate: ye(f.isDragging),
620
623
  transition: Ke
621
624
  }
622
625
  )
@@ -625,202 +628,203 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
625
628
  ]
626
629
  }
627
630
  );
628
- }, vl = (t) => {
631
+ }, xl = (n) => {
629
632
  const {
630
- className: n,
631
- label: s,
632
- description: o,
633
+ className: t,
634
+ label: o,
635
+ description: s,
633
636
  error: r,
634
637
  buttonTray: l,
635
638
  size: a = "md",
636
639
  value: i,
637
640
  defaultValue: c,
638
- onChange: g,
639
- onBlur: x,
640
- onFocus: w,
641
+ onChange: b,
642
+ onBlur: R,
643
+ onFocus: N,
641
644
  ...h
642
- } = t, [b, p] = W(
645
+ } = n, [v, f] = W(
643
646
  i != null ? String(i) : c != null ? String(c) : ""
644
- ), [m, v] = W(!1), u = Ce(null), I = i != null ? String(i) : b, R = I || "white";
645
- we(m, () => v(!1));
646
- const { anchorRef: y, Popover: D } = dt({
647
+ ), [p, u] = W(!1), I = Ce(null), x = i != null ? String(i) : v, y = x || "white";
648
+ xe(p, () => u(!1));
649
+ const { anchorRef: k, Popover: S } = ct({
647
650
  placement: "bottom-start",
648
- onOutsideClick: () => v(!1)
649
- }), T = (k) => {
650
- p(k.target.value), g?.(k);
651
- }, B = (k) => {
652
- v(!0), w?.(k);
653
- }, P = (k) => {
654
- const A = k.target.value, O = rr(A);
655
- O && O !== A && u.current && wt(u.current, O), v(!1), x?.(k);
656
- }, z = (k) => {
657
- u.current && wt(u.current, k);
658
- }, N = !!r || !!l;
651
+ open: p,
652
+ onOpenChange: u
653
+ }), O = (g) => {
654
+ f(g.target.value), b?.(g);
655
+ }, P = (g) => {
656
+ u(!0), N?.(g);
657
+ }, T = (g) => {
658
+ const M = g.target.value, L = lr(M);
659
+ L && L !== M && I.current && xt(I.current, L), u(!1), R?.(g);
660
+ }, z = (g) => {
661
+ I.current && xt(I.current, g);
662
+ }, w = !!r || !!l;
659
663
  return /* @__PURE__ */ e(Q.Provider, { value: a, children: /* @__PURE__ */ d(
660
664
  "div",
661
665
  {
662
- className: f(
666
+ className: m(
663
667
  "flex flex-col",
664
- n
668
+ t
665
669
  ),
666
670
  children: [
667
- /* @__PURE__ */ e(q, { children: s }),
668
- /* @__PURE__ */ d("div", { className: "flex flex-col relative", ref: y, children: [
671
+ /* @__PURE__ */ e(Y, { children: o }),
672
+ /* @__PURE__ */ d("div", { className: "flex flex-col relative", ref: k, children: [
669
673
  /* @__PURE__ */ e(
670
674
  "div",
671
675
  {
672
- className: f(
676
+ className: m(
673
677
  "absolute top-1/2 -translate-y-1/2 rounded-md border color-swatch",
674
- ce[a],
675
- Mt[a]
678
+ ae[a],
679
+ Bt[a]
676
680
  ),
677
- style: { backgroundColor: R }
681
+ style: { backgroundColor: y }
678
682
  }
679
683
  ),
680
684
  /* @__PURE__ */ e(
681
685
  "input",
682
686
  {
683
- ref: u,
684
- className: f(
687
+ ref: I,
688
+ className: m(
685
689
  "border input-base transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
686
- ne[a],
687
- Y[a],
688
- Et[a],
689
- N ? he[a] : ct[a],
690
+ te[a],
691
+ J[a],
692
+ Mt[a],
693
+ w ? fe[a] : it[a],
690
694
  r && "input-error"
691
695
  ),
692
- value: i ?? b,
693
- onChange: T,
694
- onFocus: B,
695
- onBlur: P,
696
- onClick: () => v(!0),
696
+ value: i ?? v,
697
+ onChange: O,
698
+ onFocus: P,
699
+ onBlur: T,
700
+ onClick: () => u(!0),
697
701
  ...h
698
702
  }
699
703
  ),
700
- /* @__PURE__ */ d(pe, { children: [
701
- r && /* @__PURE__ */ e(re, {}),
704
+ /* @__PURE__ */ d(he, { children: [
705
+ r && /* @__PURE__ */ e(ne, {}),
702
706
  l
703
707
  ] }),
704
- /* @__PURE__ */ e(D, { open: m, children: /* @__PURE__ */ e(xe, { padding: "md", children: /* @__PURE__ */ e(hr, { value: I, onChange: z }) }) })
708
+ /* @__PURE__ */ e(S, { open: p, children: /* @__PURE__ */ e(ve, { padding: "md", children: /* @__PURE__ */ e(pr, { value: x, onChange: z }) }) })
705
709
  ] }),
706
- /* @__PURE__ */ e(V, { children: o }),
710
+ /* @__PURE__ */ e(V, { children: s }),
707
711
  /* @__PURE__ */ e(K, { children: r })
708
712
  ]
709
713
  }
710
714
  ) });
711
- }, Z = (t) => {
715
+ }, Z = (n) => {
712
716
  const {
713
- onClick: n,
714
- Icon: s
715
- } = t;
717
+ onClick: t,
718
+ Icon: o
719
+ } = n;
716
720
  return /* @__PURE__ */ e(
717
721
  "div",
718
722
  {
719
- onClick: n,
720
- className: f(
723
+ onClick: t,
724
+ className: m(
721
725
  "h-6 w-6 select-none rounded-full p-0.5",
722
- n && "ring-0 transition-all duration-150 input-icon-button-interactive active:ring-2 cursor-pointer hover:ring-4 group pointer-events-auto"
726
+ t && "ring-0 transition-all duration-150 input-icon-button-interactive active:ring-2 cursor-pointer hover:ring-4 group pointer-events-auto"
723
727
  ),
724
- children: /* @__PURE__ */ e(s, { className: f("h-5 w-5 input-icon-button-icon", n && "group-active:scale-[0.8] transition-transform origin-center") })
728
+ children: /* @__PURE__ */ e(o, { className: m("h-5 w-5 input-icon-button-icon", t && "group-active:scale-[0.8] transition-transform origin-center") })
725
729
  }
726
730
  );
727
- }, xl = (t) => {
731
+ }, wl = (n) => {
728
732
  const {
729
- type: n = "password",
730
- enableShowPasswordToggle: s = !0,
731
- ...o
732
- } = t, [r, l] = W(!1);
733
+ type: t = "password",
734
+ enableShowPasswordToggle: o = !0,
735
+ ...s
736
+ } = n, [r, l] = W(!1);
733
737
  return /* @__PURE__ */ e(
734
- At,
738
+ Wt,
735
739
  {
736
- type: r ? "text" : n,
737
- buttonTray: s ? /* @__PURE__ */ e(Z, { Icon: r ? Vt : Kt, onClick: () => {
740
+ type: r ? "text" : t,
741
+ buttonTray: o ? /* @__PURE__ */ e(Z, { Icon: r ? Gt : qt, onClick: () => {
738
742
  l(!r);
739
743
  } }) : void 0,
740
- ...o
744
+ ...s
741
745
  }
742
746
  );
743
- }, wl = (t) => {
747
+ }, Nl = (n) => {
744
748
  const {
745
- className: n,
746
- label: s,
747
- description: o,
749
+ className: t,
750
+ label: o,
751
+ description: s,
748
752
  error: r,
749
753
  size: l = "md",
750
754
  autogrow: a = !1,
751
755
  maxRows: i,
752
756
  ref: c,
753
- onChange: g,
754
- ...x
755
- } = t, w = C.useRef(null), h = C.useCallback(() => {
756
- const p = w.current;
757
- if (!p) return;
758
- p.style.height = "auto";
759
- let m = p.scrollHeight;
757
+ onChange: b,
758
+ ...R
759
+ } = n, N = C.useRef(null), h = C.useCallback(() => {
760
+ const f = N.current;
761
+ if (!f) return;
762
+ f.style.height = "auto";
763
+ let p = f.scrollHeight;
760
764
  if (i) {
761
- const v = window.getComputedStyle(p), u = parseFloat(v.lineHeight), I = parseFloat(v.paddingTop), R = parseFloat(v.paddingBottom), y = parseFloat(v.borderTopWidth), D = parseFloat(v.borderBottomWidth), T = u * i + I + R + y + D;
762
- m = Math.min(p.scrollHeight, T);
765
+ const u = window.getComputedStyle(f), I = parseFloat(u.lineHeight), x = parseFloat(u.paddingTop), y = parseFloat(u.paddingBottom), k = parseFloat(u.borderTopWidth), S = parseFloat(u.borderBottomWidth), O = I * i + x + y + k + S;
766
+ p = Math.min(f.scrollHeight, O);
763
767
  }
764
- p.style.height = `${m}px`;
768
+ f.style.height = `${p}px`;
765
769
  }, [i]);
766
770
  C.useLayoutEffect(() => {
767
771
  if (!a) {
768
- w.current && (w.current.style.height = "");
772
+ N.current && (N.current.style.height = "");
769
773
  return;
770
774
  }
771
775
  h();
772
- }, [a, h, t.value, t.defaultValue, l]);
773
- const b = (p) => {
774
- g?.(p), a && h();
776
+ }, [a, h, n.value, n.defaultValue, l]);
777
+ const v = (f) => {
778
+ b?.(f), a && h();
775
779
  };
776
780
  return /* @__PURE__ */ e(Q.Provider, { value: l, children: /* @__PURE__ */ d(
777
781
  "div",
778
782
  {
779
- className: f(
783
+ className: m(
780
784
  "flex flex-col",
781
- n
785
+ t
782
786
  ),
783
787
  children: [
784
- /* @__PURE__ */ e(q, { children: s }),
788
+ /* @__PURE__ */ e(Y, { children: o }),
785
789
  /* @__PURE__ */ d("div", { className: "flex flex-col relative", children: [
786
790
  /* @__PURE__ */ e(
787
791
  "textarea",
788
792
  {
789
- ref: c ? hn([c, w]) : w,
790
- onChange: b,
791
- className: f(
793
+ ref: c ? pn([c, N]) : N,
794
+ onChange: v,
795
+ className: m(
792
796
  "py-2.5 border input-base transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
793
- Pt[l],
794
- Y[l],
795
- fe[l],
796
- r ? he[l] : ct[l],
797
+ Ft[l],
798
+ J[l],
799
+ me[l],
800
+ r ? fe[l] : it[l],
797
801
  r && "input-error",
798
802
  a && (i ? "resize-none overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden" : "resize-none overflow-hidden")
799
803
  ),
800
- ...x
804
+ ...R
801
805
  }
802
806
  ),
803
- /* @__PURE__ */ e(pe, { className: "top-3.5 translate-y-0", children: r && /* @__PURE__ */ e(re, {}) })
807
+ /* @__PURE__ */ e(he, { className: "top-3.5 translate-y-0", children: r && /* @__PURE__ */ e(ne, {}) })
804
808
  ] }),
805
- /* @__PURE__ */ e(V, { children: o }),
809
+ /* @__PURE__ */ e(V, { children: s }),
806
810
  /* @__PURE__ */ e(K, { children: r })
807
811
  ]
808
812
  }
809
813
  ) });
810
- }, Nl = (t) => {
814
+ }, yl = (n) => {
811
815
  const {
812
- className: n,
813
- label: s,
814
- description: o,
816
+ className: t,
817
+ label: o,
818
+ description: s,
815
819
  error: r,
816
820
  ...l
817
- } = t;
821
+ } = n;
818
822
  return /* @__PURE__ */ d(
819
823
  "div",
820
824
  {
821
- className: f(
825
+ className: m(
822
826
  "flex flex-col",
823
- n
827
+ t
824
828
  ),
825
829
  children: [
826
830
  /* @__PURE__ */ d("div", { className: "flex flex-row gap-3", children: [
@@ -832,30 +836,30 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
832
836
  ...l
833
837
  }
834
838
  ),
835
- s && /* @__PURE__ */ e("label", { htmlFor: t.id, className: f(
839
+ o && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
836
840
  "input-label font-medium mb-1",
837
- t.id && "cursor-pointer"
838
- ), children: s })
841
+ n.id && "cursor-pointer"
842
+ ), children: o })
839
843
  ] }),
840
- /* @__PURE__ */ e(V, { children: o }),
844
+ /* @__PURE__ */ e(V, { children: s }),
841
845
  /* @__PURE__ */ e(K, { children: r })
842
846
  ]
843
847
  }
844
848
  );
845
- }, kl = (t) => {
849
+ }, kl = (n) => {
846
850
  const {
847
- className: n,
848
- label: s,
849
- description: o,
851
+ className: t,
852
+ label: o,
853
+ description: s,
850
854
  error: r,
851
855
  ...l
852
- } = t;
856
+ } = n;
853
857
  return /* @__PURE__ */ d(
854
858
  "div",
855
859
  {
856
- className: f(
860
+ className: m(
857
861
  "flex flex-col",
858
- n
862
+ t
859
863
  ),
860
864
  children: [
861
865
  /* @__PURE__ */ d("div", { className: "flex flex-row gap-3", children: [
@@ -868,38 +872,38 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
868
872
  ...l
869
873
  }
870
874
  ),
871
- /* @__PURE__ */ e("div", { className: f(
875
+ /* @__PURE__ */ e("div", { className: m(
872
876
  "rounded-full absolute border inset-0 pointer-events-none transition-colors duration-150 ",
873
- t.checked ? "toggle-track-on" : "toggle-track-off"
874
- ), children: /* @__PURE__ */ e("div", { className: f(
877
+ n.checked ? "toggle-track-on" : "toggle-track-off"
878
+ ), children: /* @__PURE__ */ e("div", { className: m(
875
879
  "absolute top-1/2 -translate-y-1/2 left-1 h-4 w-4 rounded-full toggle-thumb shadow-md transition-all duration-150",
876
- t.checked && "translate-x-3.5 "
880
+ n.checked && "translate-x-3.5 "
877
881
  ) }) })
878
882
  ] }),
879
- s && /* @__PURE__ */ e("label", { htmlFor: t.id, className: f(
883
+ o && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
880
884
  "input-label font-medium mb-1",
881
- t.id && "cursor-pointer"
882
- ), children: s })
885
+ n.id && "cursor-pointer"
886
+ ), children: o })
883
887
  ] }),
884
- /* @__PURE__ */ e(V, { children: o }),
888
+ /* @__PURE__ */ e(V, { children: s }),
885
889
  /* @__PURE__ */ e(K, { children: r })
886
890
  ]
887
891
  }
888
892
  );
889
- }, yl = (t) => {
893
+ }, Cl = (n) => {
890
894
  const {
891
- className: n,
892
- label: s,
893
- description: o,
895
+ className: t,
896
+ label: o,
897
+ description: s,
894
898
  error: r,
895
899
  ...l
896
- } = t;
900
+ } = n;
897
901
  return /* @__PURE__ */ d(
898
902
  "div",
899
903
  {
900
- className: f(
904
+ className: m(
901
905
  "flex flex-col",
902
- n
906
+ t
903
907
  ),
904
908
  children: [
905
909
  /* @__PURE__ */ d("div", { className: "flex flex-row gap-3", children: [
@@ -911,118 +915,118 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
911
915
  ...l
912
916
  }
913
917
  ),
914
- s && /* @__PURE__ */ e("label", { htmlFor: t.id, className: f(
918
+ o && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
915
919
  "input-label font-medium mb-1",
916
- t.id && "cursor-pointer"
917
- ), children: s })
920
+ n.id && "cursor-pointer"
921
+ ), children: o })
918
922
  ] }),
919
- /* @__PURE__ */ e(V, { children: o }),
923
+ /* @__PURE__ */ e(V, { children: s }),
920
924
  /* @__PURE__ */ e(K, { children: r })
921
925
  ]
922
926
  }
923
927
  );
924
- }, pr = {
928
+ }, gr = {
925
929
  sm: "h-7",
926
930
  md: "h-8",
927
931
  lg: "h-10"
928
- }, gr = {
932
+ }, br = {
929
933
  sm: "px-2.5",
930
934
  md: "px-3",
931
935
  lg: "px-4"
932
- }, br = {
936
+ }, vr = {
933
937
  sm: "text-xs",
934
938
  md: "text-sm",
935
939
  lg: "text-sm"
936
- }, Cl = (t) => {
940
+ }, Il = (n) => {
937
941
  const {
938
- label: n,
939
- description: s,
940
- error: o,
942
+ label: t,
943
+ description: o,
944
+ error: s,
941
945
  placeholder: r = "No file chosen",
942
946
  buttonText: l = "Choose",
943
- Icon: a = Gt,
947
+ Icon: a = Jt,
944
948
  size: i = "md",
945
949
  value: c,
946
- isUploaded: g = !1,
947
- isUploading: x = !1,
948
- onChange: w,
950
+ isUploaded: b = !1,
951
+ isUploading: R = !1,
952
+ onChange: N,
949
953
  onDropRejected: h,
950
- accept: b,
951
- maxSize: p,
952
- minSize: m,
953
- disabled: v = !1,
954
- className: u
955
- } = t, I = async (z) => {
956
- const [N] = z;
957
- N && await w?.(N);
954
+ accept: v,
955
+ maxSize: f,
956
+ minSize: p,
957
+ disabled: u = !1,
958
+ className: I
959
+ } = n, x = async (z) => {
960
+ const [w] = z;
961
+ w && await N?.(w);
958
962
  }, {
959
- getRootProps: R,
960
- getInputProps: y,
961
- open: D,
962
- isDragActive: T,
963
- isFocused: B
964
- } = Dt({
963
+ getRootProps: y,
964
+ getInputProps: k,
965
+ open: S,
966
+ isDragActive: O,
967
+ isFocused: P
968
+ } = zt({
965
969
  multiple: !1,
966
- accept: b,
967
- maxSize: p,
968
- minSize: m,
969
- disabled: v,
970
- onDrop: I,
970
+ accept: v,
971
+ maxSize: f,
972
+ minSize: p,
973
+ disabled: u,
974
+ onDrop: x,
971
975
  onDropRejected: h
972
- }), P = c?.name;
973
- return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: f("flex flex-col", u), children: [
974
- /* @__PURE__ */ e(q, { children: n }),
976
+ }), T = c?.name;
977
+ return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: m("flex flex-col", I), children: [
978
+ /* @__PURE__ */ e(Y, { children: t }),
975
979
  /* @__PURE__ */ d(
976
980
  "div",
977
981
  {
978
- ...R({
979
- className: f(
982
+ ...y({
983
+ className: m(
980
984
  "flex flex-row items-center",
981
985
  "border input-base rounded-xl shadow-sm transition-all duration-150",
982
986
  "ring-0 focus:outline-none",
983
- (B || T) && "ring-4",
984
- o && "input-error",
985
- v && "opacity-60 cursor-not-allowed",
986
- ne[i],
987
- fe[i],
987
+ (P || O) && "ring-4",
988
+ s && "input-error",
989
+ u && "opacity-60 cursor-not-allowed",
990
+ te[i],
991
+ me[i],
988
992
  "gap-3"
989
993
  )
990
994
  }),
991
995
  children: [
992
- /* @__PURE__ */ e("input", { ...y() }),
993
- /* @__PURE__ */ e(a, { className: f("input-icon shrink-0", ce[i]) }),
996
+ /* @__PURE__ */ e("input", { ...k() }),
997
+ /* @__PURE__ */ e(a, { className: m("input-icon shrink-0", ae[i]) }),
994
998
  /* @__PURE__ */ e(
995
999
  "span",
996
1000
  {
997
- className: f(
1001
+ className: m(
998
1002
  "flex-1 truncate",
999
- Y[i],
1000
- !P && "text-[var(--color-input-placeholder)]"
1003
+ J[i],
1004
+ !T && "text-[var(--color-input-placeholder)]"
1001
1005
  ),
1002
- children: P ?? r
1006
+ children: T ?? r
1003
1007
  }
1004
1008
  ),
1005
- o && /* @__PURE__ */ e(re, {}),
1006
- x && !o && /* @__PURE__ */ e("div", { className: "h-5 w-5 flex items-center justify-center", children: /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-icon)]" }) }),
1007
- g && !x && !o && /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(tt, { className: "h-5 w-5 text-[var(--color-status-success)]" }) }),
1009
+ s && /* @__PURE__ */ e(ne, {}),
1010
+ R && !s && /* @__PURE__ */ e("div", { className: "h-5 w-5 flex items-center justify-center", children: /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-icon)]" }) }),
1011
+ b && !R && !s && /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(tt, { className: "h-5 w-5 text-[var(--color-status-success)]" }) }),
1008
1012
  /* @__PURE__ */ e(
1009
1013
  "button",
1010
1014
  {
1011
1015
  type: "button",
1012
- disabled: v,
1016
+ disabled: u,
1013
1017
  onClick: (z) => {
1014
- z.stopPropagation(), D();
1018
+ z.stopPropagation(), S();
1015
1019
  },
1016
- className: f(
1020
+ className: m(
1017
1021
  "inline-flex flex-row items-center justify-center shrink-0",
1018
1022
  "border button-white shadow-sm rounded-[calc(var(--border-radius-input)-0.25rem)]",
1019
1023
  "font-semibold cursor-pointer select-none transition-all duration-150",
1020
1024
  "button-ring ring-0 hover:ring-4 active:ring-1 focus:outline-none focus:ring-4",
1021
1025
  "disabled:cursor-default",
1022
1026
  "mr-1.5",
1023
- pr[i],
1024
1027
  gr[i],
1025
- br[i]
1028
+ br[i],
1029
+ vr[i]
1026
1030
  ),
1027
1031
  children: l
1028
1032
  }
@@ -1030,22 +1034,22 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1030
1034
  ]
1031
1035
  }
1032
1036
  ),
1033
- /* @__PURE__ */ e(V, { children: s }),
1034
- /* @__PURE__ */ e(K, { children: o })
1037
+ /* @__PURE__ */ e(V, { children: o }),
1038
+ /* @__PURE__ */ e(K, { children: s })
1035
1039
  ] }) });
1036
- }, vr = (t) => t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : t < 1024 * 1024 * 1024 ? `${(t / (1024 * 1024)).toFixed(1)} MB` : `${(t / (1024 * 1024 * 1024)).toFixed(1)} GB`, xr = (t) => {
1040
+ }, xr = (n) => n < 1024 ? `${n} B` : n < 1024 * 1024 ? `${(n / 1024).toFixed(1)} KB` : n < 1024 * 1024 * 1024 ? `${(n / (1024 * 1024)).toFixed(1)} MB` : `${(n / (1024 * 1024 * 1024)).toFixed(1)} GB`, wr = (n) => {
1037
1041
  const {
1038
- file: n,
1039
- isUploaded: s = !1,
1040
- isUploading: o = !1,
1042
+ file: t,
1043
+ isUploaded: o = !1,
1044
+ isUploading: s = !1,
1041
1045
  error: r,
1042
1046
  onRemove: l,
1043
1047
  className: a
1044
- } = t, i = o || s || !!r;
1048
+ } = n, i = s || o || !!r;
1045
1049
  return /* @__PURE__ */ d(
1046
1050
  "div",
1047
1051
  {
1048
- className: f(
1052
+ className: m(
1049
1053
  "flex flex-row items-center gap-3",
1050
1054
  "border input-base rounded-xl shadow-sm",
1051
1055
  "pl-4 pr-1 py-1",
@@ -1053,15 +1057,15 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1053
1057
  a
1054
1058
  ),
1055
1059
  children: [
1056
- i && /* @__PURE__ */ e("div", { className: "shrink-0 h-5 w-5 flex items-center justify-center", children: r ? /* @__PURE__ */ e(et, { className: "h-5 w-5 input-error-icon" }) : o ? /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-icon)]" }) : /* @__PURE__ */ e(tt, { className: "h-5 w-5 text-[var(--color-status-success)]" }) }),
1057
- /* @__PURE__ */ e("div", { className: "flex-1 min-w-0 font-medium truncate", children: n.name }),
1058
- /* @__PURE__ */ e("div", { className: "shrink-0 text-sm text-[var(--color-input-description-text)]", children: vr(n.size) }),
1060
+ i && /* @__PURE__ */ e("div", { className: "shrink-0 h-5 w-5 flex items-center justify-center", children: r ? /* @__PURE__ */ e(et, { className: "h-5 w-5 input-error-icon" }) : s ? /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-icon)]" }) : /* @__PURE__ */ e(tt, { className: "h-5 w-5 text-[var(--color-status-success)]" }) }),
1061
+ /* @__PURE__ */ e("div", { className: "flex-1 min-w-0 font-medium truncate", children: t.name }),
1062
+ /* @__PURE__ */ e("div", { className: "shrink-0 text-sm text-[var(--color-input-description-text)]", children: xr(t.size) }),
1059
1063
  l && /* @__PURE__ */ e(
1060
- qe,
1064
+ Ye,
1061
1065
  {
1062
1066
  variant: "transparent",
1063
1067
  size: "sm",
1064
- Icon: ue,
1068
+ Icon: de,
1065
1069
  onClick: l,
1066
1070
  "aria-label": "Remove file",
1067
1071
  className: "shrink-0"
@@ -1070,103 +1074,103 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1070
1074
  ]
1071
1075
  }
1072
1076
  );
1073
- }, Il = (t) => {
1077
+ }, Rl = (n) => {
1074
1078
  const {
1075
- label: n,
1076
- description: s,
1077
- error: o,
1079
+ label: t,
1080
+ description: o,
1081
+ error: s,
1078
1082
  title: r = "Drop files here",
1079
1083
  hint: l,
1080
- Icon: a = Jt,
1084
+ Icon: a = Yt,
1081
1085
  onUpload: i,
1082
1086
  onFileRemoved: c,
1083
- onDropRejected: g,
1084
- renderFileTile: x,
1085
- accept: w,
1087
+ onDropRejected: b,
1088
+ renderFileTile: R,
1089
+ accept: N,
1086
1090
  maxSize: h,
1087
- minSize: b,
1088
- maxFiles: p,
1089
- disabled: m = !1,
1090
- className: v
1091
- } = t, [u, I] = W([]), R = Ce(0), y = (k, A) => {
1092
- I((O) => O.map(($) => $.id === k ? { ...$, ...A } : $));
1093
- }, D = (k) => {
1094
- if (k.length === 0) return;
1095
- const A = k.map((O) => ({
1096
- id: String(++R.current),
1097
- file: O,
1091
+ minSize: v,
1092
+ maxFiles: f,
1093
+ disabled: p = !1,
1094
+ className: u
1095
+ } = n, [I, x] = W([]), y = Ce(0), k = (g, M) => {
1096
+ x((L) => L.map(($) => $.id === g ? { ...$, ...M } : $));
1097
+ }, S = (g) => {
1098
+ if (g.length === 0) return;
1099
+ const M = g.map((L) => ({
1100
+ id: String(++y.current),
1101
+ file: L,
1098
1102
  status: i ? "uploading" : "idle"
1099
1103
  }));
1100
- if (I((O) => [...O, ...A]), !!i)
1101
- for (const O of A)
1102
- Promise.resolve().then(() => i(O.file)).then(() => y(O.id, { status: "uploaded" })).catch(($) => {
1103
- y(O.id, {
1104
+ if (x((L) => [...L, ...M]), !!i)
1105
+ for (const L of M)
1106
+ Promise.resolve().then(() => i(L.file)).then(() => k(L.id, { status: "uploaded" })).catch(($) => {
1107
+ k(L.id, {
1104
1108
  status: "error",
1105
1109
  error: $ instanceof Error ? $ : new Error(String($))
1106
1110
  });
1107
1111
  });
1108
- }, T = (k) => {
1109
- const A = u.find((O) => O.id === k);
1110
- I((O) => O.filter(($) => $.id !== k)), A && c?.(A.file);
1112
+ }, O = (g) => {
1113
+ const M = I.find((L) => L.id === g);
1114
+ x((L) => L.filter(($) => $.id !== g)), M && c?.(M.file);
1111
1115
  }, {
1112
- getRootProps: B,
1113
- getInputProps: P,
1116
+ getRootProps: P,
1117
+ getInputProps: T,
1114
1118
  isDragActive: z,
1115
- isFocused: N
1116
- } = Dt({
1119
+ isFocused: w
1120
+ } = zt({
1117
1121
  multiple: !0,
1118
- accept: w,
1122
+ accept: N,
1119
1123
  maxSize: h,
1120
- minSize: b,
1121
- maxFiles: p,
1122
- disabled: m,
1123
- onDrop: D,
1124
- onDropRejected: g
1124
+ minSize: v,
1125
+ maxFiles: f,
1126
+ disabled: p,
1127
+ onDrop: S,
1128
+ onDropRejected: b
1125
1129
  });
1126
- return /* @__PURE__ */ d("div", { className: f("flex flex-col", v), children: [
1127
- /* @__PURE__ */ e(q, { children: n }),
1130
+ return /* @__PURE__ */ d("div", { className: m("flex flex-col", u), children: [
1131
+ /* @__PURE__ */ e(Y, { children: t }),
1128
1132
  /* @__PURE__ */ d(
1129
1133
  "div",
1130
1134
  {
1131
- ...B({
1132
- className: f(
1135
+ ...P({
1136
+ className: m(
1133
1137
  "flex flex-col items-center justify-center gap-1",
1134
1138
  "border-2 border-dashed input-base rounded-xl bg-transparent!",
1135
1139
  "py-10 px-6 cursor-pointer transition-all duration-150",
1136
1140
  "ring-0 focus:outline-none",
1137
- (N || z) && "ring-4",
1138
- o && "input-error",
1139
- m && "opacity-60 cursor-not-allowed"
1141
+ (w || z) && "ring-4",
1142
+ s && "input-error",
1143
+ p && "opacity-60 cursor-not-allowed"
1140
1144
  )
1141
1145
  }),
1142
1146
  children: [
1143
- /* @__PURE__ */ e("input", { ...P() }),
1147
+ /* @__PURE__ */ e("input", { ...T() }),
1144
1148
  /* @__PURE__ */ e("div", { className: "h-14 w-14 rounded-xl flex items-center justify-center bg-[var(--color-input-file-icon-bg)] mb-2", children: /* @__PURE__ */ e(a, { className: "h-7 w-7 input-icon" }) }),
1145
1149
  /* @__PURE__ */ e("div", { className: "text-base font-semibold", children: r }),
1146
1150
  l && /* @__PURE__ */ e("div", { className: "text-sm text-[var(--color-input-description-text)] ", children: l })
1147
1151
  ]
1148
1152
  }
1149
1153
  ),
1150
- u.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-col gap-2 mt-3", children: u.map((k) => {
1151
- const A = {
1152
- file: k.file,
1153
- isUploading: k.status === "uploading",
1154
- isUploaded: k.status === "uploaded",
1155
- error: k.status === "error" ? k.error?.message : void 0,
1156
- onRemove: () => T(k.id)
1154
+ I.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-col gap-2 mt-3", children: I.map((g) => {
1155
+ const M = {
1156
+ file: g.file,
1157
+ isUploading: g.status === "uploading",
1158
+ isUploaded: g.status === "uploaded",
1159
+ error: g.status === "error" ? g.error?.message : void 0,
1160
+ onRemove: () => O(g.id)
1157
1161
  };
1158
- return /* @__PURE__ */ e(C.Fragment, { children: x ? x(k.file, A) : /* @__PURE__ */ e(xr, { ...A }) }, k.id);
1162
+ return /* @__PURE__ */ e(C.Fragment, { children: R ? R(g.file, M) : /* @__PURE__ */ e(wr, { ...M }) }, g.id);
1159
1163
  }) }),
1160
- /* @__PURE__ */ e(V, { children: s }),
1161
- /* @__PURE__ */ e(K, { children: o })
1164
+ /* @__PURE__ */ e(V, { children: o }),
1165
+ /* @__PURE__ */ e(K, { children: s })
1162
1166
  ] });
1163
- }, wr = [
1164
- Cn,
1167
+ }, Nr = [
1165
1168
  In,
1166
- Ot,
1167
- Dn,
1168
- Ln
1169
- ], Nt = {
1169
+ Rn,
1170
+ Tt,
1171
+ On,
1172
+ Pn
1173
+ ], wt = {
1170
1174
  paragraph: "lexical-paragraph",
1171
1175
  heading: {
1172
1176
  h1: "lexical-h1",
@@ -1189,7 +1193,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1189
1193
  italic: "lexical-italic",
1190
1194
  underline: "lexical-underline"
1191
1195
  }
1192
- }, Wt = {
1196
+ }, $t = {
1193
1197
  isBold: !1,
1194
1198
  isItalic: !1,
1195
1199
  isUnderline: !1,
@@ -1200,29 +1204,29 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1200
1204
  canUndo: !1,
1201
1205
  canRedo: !1
1202
1206
  }, Ae = Qe({
1203
- state: Wt,
1207
+ state: $t,
1204
1208
  tone: "light",
1205
1209
  orientation: "horizontal"
1206
- }), Ne = () => Ze(Ae), Ht = () => {
1207
- const [t] = me(), [n, s] = W(Wt);
1210
+ }), we = () => Ze(Ae), _t = () => {
1211
+ const [n] = ue(), [t, o] = W($t);
1208
1212
  return _(() => {
1209
- const o = () => {
1210
- t.getEditorState().read(() => {
1211
- const r = zt();
1212
- if (!Tt(r))
1213
+ const s = () => {
1214
+ n.getEditorState().read(() => {
1215
+ const r = Lt();
1216
+ if (!Pt(r))
1213
1217
  return;
1214
- const l = r.anchor.getNode(), a = Wn(l, Ot), i = a && On(a) ? a.getListType() : null;
1218
+ const l = r.anchor.getNode(), a = Hn(l, Tt), i = a && zn(a) ? a.getListType() : null;
1215
1219
  let c = "paragraph";
1216
1220
  if (!i) {
1217
- const b = l.getKey() === "root" ? l : l.getTopLevelElementOrThrow();
1218
- Rn(b) && (c = b.getTag());
1221
+ const v = l.getKey() === "root" ? l : l.getTopLevelElementOrThrow();
1222
+ Sn(v) && (c = v.getTag());
1219
1223
  }
1220
- const g = r.hasFormat("bold"), x = r.hasFormat("italic"), w = r.hasFormat("underline"), h = gt(l.getParent()) || gt(l);
1221
- s((b) => ({
1222
- ...b,
1223
- isBold: g,
1224
- isItalic: x,
1225
- isUnderline: w,
1224
+ const b = r.hasFormat("bold"), R = r.hasFormat("italic"), N = r.hasFormat("underline"), h = pt(l.getParent()) || pt(l);
1225
+ o((v) => ({
1226
+ ...v,
1227
+ isBold: b,
1228
+ isItalic: R,
1229
+ isUnderline: N,
1226
1230
  isLink: h,
1227
1231
  isUnorderedList: i === "bullet",
1228
1232
  isOrderedList: i === "number",
@@ -1230,57 +1234,58 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1230
1234
  }));
1231
1235
  });
1232
1236
  };
1233
- return Lt(
1234
- t.registerUpdateListener(() => o()),
1235
- t.registerCommand(
1236
- Pn,
1237
- (r) => (s((l) => ({ ...l, canUndo: r })), !1),
1237
+ return Et(
1238
+ n.registerUpdateListener(() => s()),
1239
+ n.registerCommand(
1240
+ En,
1241
+ (r) => (o((l) => ({ ...l, canUndo: r })), !1),
1238
1242
  Pe
1239
1243
  ),
1240
- t.registerCommand(
1241
- En,
1242
- (r) => (s((l) => ({ ...l, canRedo: r })), !1),
1244
+ n.registerCommand(
1245
+ Fn,
1246
+ (r) => (o((l) => ({ ...l, canRedo: r })), !1),
1243
1247
  Pe
1244
1248
  )
1245
1249
  );
1246
- }, [t]), n;
1247
- }, $t = Qe(void 0), Nr = () => ({
1248
- dismiss: Ze($t) || (() => {
1250
+ }, [n]), t;
1251
+ }, jt = Qe(void 0), yr = () => ({
1252
+ dismiss: Ze(jt) || (() => {
1249
1253
  })
1250
- }), Ue = (t) => {
1251
- const { trigger: n, children: s, placement: o = "bottom-end", minWidth: r = 200, className: l } = t, [a, i] = W(!1), { Popover: c, anchorRef: g } = dt({
1252
- placement: o,
1253
- onOutsideClick: () => i(!1),
1254
+ }), Ue = (n) => {
1255
+ const { trigger: t, children: o, placement: s = "bottom-end", minWidth: r = 200, className: l } = n, [a, i] = W(!1), { Popover: c, anchorRef: b } = ct({
1256
+ placement: s,
1257
+ open: a,
1258
+ onOpenChange: i,
1254
1259
  minWidth: r
1255
1260
  });
1256
- return /* @__PURE__ */ d(te, { children: [
1257
- /* @__PURE__ */ e("div", { ref: g, className: l, onClick: () => i(!a), children: n }),
1258
- /* @__PURE__ */ e(c, { open: a, children: /* @__PURE__ */ e(xe, { padding: "sm", children: /* @__PURE__ */ e($t.Provider, { value: () => i(!1), children: s }) }) })
1261
+ return /* @__PURE__ */ d(ce, { children: [
1262
+ /* @__PURE__ */ e("div", { ref: b, className: l, onClick: () => i(!a), children: t }),
1263
+ /* @__PURE__ */ e(c, { open: a, children: /* @__PURE__ */ e(ve, { padding: "sm", children: /* @__PURE__ */ e(jt.Provider, { value: () => i(!1), children: o }) }) })
1259
1264
  ] });
1260
- }, kr = "inline-flex flex-row items-center gap-3 h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent", X = C.forwardRef((t, n) => {
1265
+ }, kr = "inline-flex flex-row items-center gap-3 h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent", X = C.forwardRef((n, t) => {
1261
1266
  const {
1262
- className: s,
1263
- children: o,
1267
+ className: o,
1268
+ children: s,
1264
1269
  Icon: r,
1265
1270
  onClick: l,
1266
1271
  dismissOnClick: a = !0,
1267
1272
  ...i
1268
- } = t, { dismiss: c } = Nr(), g = (x) => {
1269
- l && l(x), a && c();
1273
+ } = n, { dismiss: c } = yr(), b = (R) => {
1274
+ l && l(R), a && c();
1270
1275
  };
1271
1276
  return /* @__PURE__ */ d(
1272
1277
  "button",
1273
1278
  {
1274
- ref: n,
1275
- className: f(
1279
+ ref: t,
1280
+ className: m(
1276
1281
  kr,
1277
- s
1282
+ o
1278
1283
  ),
1279
- onClick: g,
1284
+ onClick: b,
1280
1285
  ...i,
1281
1286
  children: [
1282
1287
  r && /* @__PURE__ */ e(r, { className: "h-5 w-5" }),
1283
- o
1288
+ s
1284
1289
  ]
1285
1290
  }
1286
1291
  );
@@ -1290,13 +1295,13 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1290
1295
  { value: "h2", label: "Heading 2" },
1291
1296
  { value: "h3", label: "Heading 3" },
1292
1297
  { value: "h4", label: "Heading 4" }
1293
- ], yr = () => {
1294
- const [t] = me(), { state: n, tone: s } = Ne(), o = (l) => {
1295
- t.update(() => {
1296
- const a = zt();
1297
- Tt(a) && (l === "paragraph" ? vt(a, () => Mn()) : vt(a, () => Sn(l)));
1298
+ ], Cr = () => {
1299
+ const [n] = ue(), { state: t, tone: o } = we(), s = (l) => {
1300
+ n.update(() => {
1301
+ const a = Lt();
1302
+ Pt(a) && (l === "paragraph" ? bt(a, () => Mn()) : bt(a, () => Dn(l)));
1298
1303
  });
1299
- }, r = Ge.find((l) => l.value === n.blockType) ?? Ge[0];
1304
+ }, r = Ge.find((l) => l.value === t.blockType) ?? Ge[0];
1300
1305
  return /* @__PURE__ */ e(
1301
1306
  Ue,
1302
1307
  {
@@ -1307,211 +1312,211 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1307
1312
  {
1308
1313
  type: "button",
1309
1314
  onMouseDown: (l) => l.preventDefault(),
1310
- className: f(
1315
+ className: m(
1311
1316
  "lexical-tb-btn h-8 px-2 gap-1 text-sm font-medium",
1312
- s === "dark" ? "lexical-tb-btn-dark" : "lexical-tb-btn-light"
1317
+ o === "dark" ? "lexical-tb-btn-dark" : "lexical-tb-btn-light"
1313
1318
  ),
1314
1319
  children: [
1315
1320
  r.label,
1316
- /* @__PURE__ */ e(ve, { className: "h-4 w-4" })
1321
+ /* @__PURE__ */ e(be, { className: "h-4 w-4" })
1317
1322
  ]
1318
1323
  }
1319
1324
  ),
1320
1325
  children: Ge.map((l) => /* @__PURE__ */ e(
1321
1326
  X,
1322
1327
  {
1323
- Icon: l.value === n.blockType ? St : void 0,
1324
- onClick: () => o(l.value),
1325
- className: l.value === n.blockType ? void 0 : "pl-11",
1328
+ Icon: l.value === t.blockType ? Rt : void 0,
1329
+ onClick: () => s(l.value),
1330
+ className: l.value === t.blockType ? void 0 : "pl-11",
1326
1331
  children: l.label
1327
1332
  },
1328
1333
  l.value
1329
1334
  ))
1330
1335
  }
1331
1336
  );
1332
- }, Cr = {
1337
+ }, Ir = {
1333
1338
  light: "lexical-tb-btn-light",
1334
1339
  dark: "lexical-tb-btn-dark"
1335
- }, de = C.forwardRef(
1336
- (t, n) => {
1337
- const { Icon: s, active: o = !1, tone: r = "light", className: l, onMouseDown: a, ...i } = t;
1340
+ }, ie = C.forwardRef(
1341
+ (n, t) => {
1342
+ const { Icon: o, active: s = !1, tone: r = "light", className: l, onMouseDown: a, ...i } = n;
1338
1343
  return /* @__PURE__ */ e(
1339
1344
  "button",
1340
1345
  {
1341
- ref: n,
1346
+ ref: t,
1342
1347
  type: "button",
1343
- onMouseDown: (g) => {
1344
- g.preventDefault(), a?.(g);
1348
+ onMouseDown: (b) => {
1349
+ b.preventDefault(), a?.(b);
1345
1350
  },
1346
- className: f(
1351
+ className: m(
1347
1352
  "lexical-tb-btn h-8 w-8",
1348
- Cr[r],
1349
- o && "lexical-tb-btn-active",
1353
+ Ir[r],
1354
+ s && "lexical-tb-btn-active",
1350
1355
  l
1351
1356
  ),
1352
1357
  ...i,
1353
- children: /* @__PURE__ */ e(s, { className: "h-[18px] w-[18px]" })
1358
+ children: /* @__PURE__ */ e(o, { className: "h-[18px] w-[18px]" })
1354
1359
  }
1355
1360
  );
1356
1361
  }
1357
- ), Ir = () => {
1358
- const [t] = me(), { state: n, tone: s } = Ne();
1359
- return /* @__PURE__ */ d(te, { children: [
1362
+ ), Rr = () => {
1363
+ const [n] = ue(), { state: t, tone: o } = we();
1364
+ return /* @__PURE__ */ d(ce, { children: [
1360
1365
  /* @__PURE__ */ e(
1361
- de,
1366
+ ie,
1362
1367
  {
1363
- Icon: Yt,
1364
- tone: s,
1365
- active: n.isBold,
1368
+ Icon: Qt,
1369
+ tone: o,
1370
+ active: t.isBold,
1366
1371
  "aria-label": "Bold",
1367
- onClick: () => t.dispatchCommand(je, "bold")
1372
+ onClick: () => n.dispatchCommand(je, "bold")
1368
1373
  }
1369
1374
  ),
1370
1375
  /* @__PURE__ */ e(
1371
- de,
1376
+ ie,
1372
1377
  {
1373
- Icon: qt,
1374
- tone: s,
1375
- active: n.isItalic,
1378
+ Icon: Zt,
1379
+ tone: o,
1380
+ active: t.isItalic,
1376
1381
  "aria-label": "Italic",
1377
- onClick: () => t.dispatchCommand(je, "italic")
1382
+ onClick: () => n.dispatchCommand(je, "italic")
1378
1383
  }
1379
1384
  ),
1380
1385
  /* @__PURE__ */ e(
1381
- de,
1386
+ ie,
1382
1387
  {
1383
- Icon: Qt,
1384
- tone: s,
1385
- active: n.isUnderline,
1388
+ Icon: en,
1389
+ tone: o,
1390
+ active: t.isUnderline,
1386
1391
  "aria-label": "Underline",
1387
- onClick: () => t.dispatchCommand(je, "underline")
1392
+ onClick: () => n.dispatchCommand(je, "underline")
1388
1393
  }
1389
1394
  )
1390
1395
  ] });
1391
- }, Rr = () => {
1392
- const [t] = me(), { state: n, tone: s } = Ne(), o = () => {
1393
- t.dispatchCommand(
1394
- n.isUnorderedList ? pt : zn,
1396
+ }, Sr = () => {
1397
+ const [n] = ue(), { state: t, tone: o } = we(), s = () => {
1398
+ n.dispatchCommand(
1399
+ t.isUnorderedList ? ht : Tn,
1395
1400
  void 0
1396
1401
  );
1397
1402
  }, r = () => {
1398
- t.dispatchCommand(
1399
- n.isOrderedList ? pt : Tn,
1403
+ n.dispatchCommand(
1404
+ t.isOrderedList ? ht : Ln,
1400
1405
  void 0
1401
1406
  );
1402
1407
  };
1403
- return /* @__PURE__ */ d(te, { children: [
1408
+ return /* @__PURE__ */ d(ce, { children: [
1404
1409
  /* @__PURE__ */ e(
1405
- de,
1410
+ ie,
1406
1411
  {
1407
- Icon: Ye,
1408
- tone: s,
1409
- active: n.isUnorderedList,
1412
+ Icon: Je,
1413
+ tone: o,
1414
+ active: t.isUnorderedList,
1410
1415
  "aria-label": "Bullet list",
1411
- onClick: o
1416
+ onClick: s
1412
1417
  }
1413
1418
  ),
1414
1419
  /* @__PURE__ */ e(
1415
- de,
1420
+ ie,
1416
1421
  {
1417
- Icon: Zt,
1418
- tone: s,
1419
- active: n.isOrderedList,
1422
+ Icon: tn,
1423
+ tone: o,
1424
+ active: t.isOrderedList,
1420
1425
  "aria-label": "Numbered list",
1421
1426
  onClick: r
1422
1427
  }
1423
1428
  )
1424
1429
  ] });
1425
- }, Sr = () => {
1426
- const [t] = me(), { state: n, tone: s } = Ne(), o = () => {
1427
- if (n.isLink) {
1428
- t.dispatchCommand(bt, null);
1430
+ }, Dr = () => {
1431
+ const [n] = ue(), { state: t, tone: o } = we(), s = () => {
1432
+ if (t.isLink) {
1433
+ n.dispatchCommand(gt, null);
1429
1434
  return;
1430
1435
  }
1431
1436
  const r = window.prompt("Enter URL");
1432
- r && t.dispatchCommand(bt, r);
1437
+ r && n.dispatchCommand(gt, r);
1433
1438
  };
1434
1439
  return /* @__PURE__ */ e(
1435
- de,
1440
+ ie,
1436
1441
  {
1437
- Icon: en,
1438
- tone: s,
1439
- active: n.isLink,
1442
+ Icon: nn,
1443
+ tone: o,
1444
+ active: t.isLink,
1440
1445
  "aria-label": "Link",
1441
- onClick: o
1446
+ onClick: s
1442
1447
  }
1443
1448
  );
1444
- }, Dr = () => {
1445
- const [t] = me(), { state: n, tone: s } = Ne();
1446
- return /* @__PURE__ */ d(te, { children: [
1449
+ }, Or = () => {
1450
+ const [n] = ue(), { state: t, tone: o } = we();
1451
+ return /* @__PURE__ */ d(ce, { children: [
1447
1452
  /* @__PURE__ */ e(
1448
- de,
1453
+ ie,
1449
1454
  {
1450
- Icon: tn,
1451
- tone: s,
1452
- disabled: !n.canUndo,
1455
+ Icon: rn,
1456
+ tone: o,
1457
+ disabled: !t.canUndo,
1453
1458
  "aria-label": "Undo",
1454
- onClick: () => t.dispatchCommand(Fn, void 0)
1459
+ onClick: () => n.dispatchCommand(Bn, void 0)
1455
1460
  }
1456
1461
  ),
1457
1462
  /* @__PURE__ */ e(
1458
- de,
1463
+ ie,
1459
1464
  {
1460
- Icon: nn,
1461
- tone: s,
1462
- disabled: !n.canRedo,
1465
+ Icon: ln,
1466
+ tone: o,
1467
+ disabled: !t.canRedo,
1463
1468
  "aria-label": "Redo",
1464
- onClick: () => t.dispatchCommand(Bn, void 0)
1469
+ onClick: () => n.dispatchCommand(An, void 0)
1465
1470
  }
1466
1471
  )
1467
1472
  ] });
1468
- }, Or = {
1473
+ }, zr = {
1469
1474
  light: "lexical-tb-divider-light",
1470
1475
  dark: "lexical-tb-divider-dark"
1471
- }, Je = (t) => {
1472
- const { tone: n, className: s } = t, { tone: o, orientation: r } = Ne();
1476
+ }, qe = (n) => {
1477
+ const { tone: t, className: o } = n, { tone: s, orientation: r } = we();
1473
1478
  return /* @__PURE__ */ e(
1474
1479
  "div",
1475
1480
  {
1476
- className: f(
1481
+ className: m(
1477
1482
  r === "vertical" ? "h-px w-full my-1" : "w-px h-5 my-auto mx-1",
1478
1483
  "shrink-0",
1479
- Or[n ?? o],
1480
- s
1484
+ zr[t ?? s],
1485
+ o
1481
1486
  )
1482
1487
  }
1483
1488
  );
1484
- }, kt = 4, zr = 36, _t = (t) => {
1485
- const n = [];
1486
- return C.Children.forEach(t, (s) => {
1487
- C.isValidElement(s) && s.type === C.Fragment ? n.push(..._t(s.props.children)) : n.push(s);
1488
- }), n;
1489
- }, jt = (t) => {
1490
- const { children: n } = t, { state: s, tone: o } = Ne(), r = _t(n), l = Ce(null), a = Ce(null), [i, c] = W(r.length), g = Le(() => {
1491
- const h = l.current, b = a.current;
1492
- if (!h || !b) return;
1493
- const p = h.clientWidth, m = Array.from(b.children).map((R) => R.offsetWidth);
1494
- if (m.reduce((R, y, D) => R + y + (D > 0 ? kt : 0), 0) <= p) {
1495
- c(m.length);
1489
+ }, Nt = 4, Tr = 36, Xt = (n) => {
1490
+ const t = [];
1491
+ return C.Children.forEach(n, (o) => {
1492
+ C.isValidElement(o) && o.type === C.Fragment ? t.push(...Xt(o.props.children)) : t.push(o);
1493
+ }), t;
1494
+ }, Vt = (n) => {
1495
+ const { children: t } = n, { state: o, tone: s } = we(), r = Xt(t), l = Ce(null), a = Ce(null), [i, c] = W(r.length), b = Le(() => {
1496
+ const h = l.current, v = a.current;
1497
+ if (!h || !v) return;
1498
+ const f = h.clientWidth, p = Array.from(v.children).map((y) => y.offsetWidth);
1499
+ if (p.reduce((y, k, S) => y + k + (S > 0 ? Nt : 0), 0) <= f) {
1500
+ c(p.length);
1496
1501
  return;
1497
1502
  }
1498
- let u = 0, I = 0;
1499
- for (let R = 0; R < m.length; R++) {
1500
- const y = m[R] + (R > 0 ? kt : 0);
1501
- if (u + y + zr > p) break;
1502
- u += y, I++;
1503
+ let I = 0, x = 0;
1504
+ for (let y = 0; y < p.length; y++) {
1505
+ const k = p[y] + (y > 0 ? Nt : 0);
1506
+ if (I + k + Tr > f) break;
1507
+ I += k, x++;
1503
1508
  }
1504
- c(I);
1509
+ c(x);
1505
1510
  }, []);
1506
- Rt(() => {
1507
- g();
1511
+ It(() => {
1512
+ b();
1508
1513
  }), _(() => {
1509
- const h = l.current, b = a.current;
1514
+ const h = l.current, v = a.current;
1510
1515
  if (!h) return;
1511
- const p = new ResizeObserver(() => g());
1512
- return p.observe(h), b && p.observe(b), () => p.disconnect();
1513
- }, [g]);
1514
- const x = r.slice(0, i), w = r.slice(i);
1516
+ const f = new ResizeObserver(() => b());
1517
+ return f.observe(h), v && f.observe(v), () => f.disconnect();
1518
+ }, [b]);
1519
+ const R = r.slice(0, i), N = r.slice(i);
1515
1520
  return /* @__PURE__ */ d(
1516
1521
  "div",
1517
1522
  {
@@ -1524,11 +1529,11 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1524
1529
  ref: a,
1525
1530
  "aria-hidden": !0,
1526
1531
  className: "pointer-events-none invisible absolute left-0 top-0 flex flex-row items-center gap-1 w-max",
1527
- children: r.map((h, b) => /* @__PURE__ */ e("div", { className: "flex flex-row items-center", children: h }, b))
1532
+ children: r.map((h, v) => /* @__PURE__ */ e("div", { className: "flex flex-row items-center", children: h }, v))
1528
1533
  }
1529
1534
  ),
1530
- x.map((h, b) => /* @__PURE__ */ e(C.Fragment, { children: h }, b)),
1531
- w.length > 0 && /* @__PURE__ */ e(
1535
+ R.map((h, v) => /* @__PURE__ */ e(C.Fragment, { children: h }, v)),
1536
+ N.length > 0 && /* @__PURE__ */ e(
1532
1537
  Ue,
1533
1538
  {
1534
1539
  placement: "bottom-end",
@@ -1539,19 +1544,19 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1539
1544
  type: "button",
1540
1545
  "aria-label": "More",
1541
1546
  onMouseDown: (h) => h.preventDefault(),
1542
- className: f(
1547
+ className: m(
1543
1548
  "lexical-tb-btn h-8 w-8 shrink-0",
1544
- o === "dark" ? "lexical-tb-btn-dark" : "lexical-tb-btn-light"
1549
+ s === "dark" ? "lexical-tb-btn-dark" : "lexical-tb-btn-light"
1545
1550
  ),
1546
- children: /* @__PURE__ */ e(rn, { className: "h-[18px] w-[18px]" })
1551
+ children: /* @__PURE__ */ e(on, { className: "h-[18px] w-[18px]" })
1547
1552
  }
1548
1553
  ),
1549
- children: /* @__PURE__ */ e(Ae.Provider, { value: { state: s, tone: "light", orientation: "vertical" }, children: /* @__PURE__ */ e(
1554
+ children: /* @__PURE__ */ e(Ae.Provider, { value: { state: o, tone: "light", orientation: "vertical" }, children: /* @__PURE__ */ e(
1550
1555
  "div",
1551
1556
  {
1552
1557
  className: "flex flex-col items-stretch gap-1",
1553
1558
  onMouseDown: (h) => h.preventDefault(),
1554
- children: w.map((h, b) => /* @__PURE__ */ e(C.Fragment, { children: h }, b))
1559
+ children: N.map((h, v) => /* @__PURE__ */ e(C.Fragment, { children: h }, v))
1555
1560
  }
1556
1561
  ) })
1557
1562
  }
@@ -1559,90 +1564,90 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1559
1564
  ]
1560
1565
  }
1561
1566
  );
1562
- }, ut = () => /* @__PURE__ */ d(te, { children: [
1563
- /* @__PURE__ */ e(yr, {}),
1564
- /* @__PURE__ */ e(Je, {}),
1565
- /* @__PURE__ */ e(Ir, {}),
1566
- /* @__PURE__ */ e(Je, {}),
1567
+ }, dt = () => /* @__PURE__ */ d(ce, { children: [
1568
+ /* @__PURE__ */ e(Cr, {}),
1569
+ /* @__PURE__ */ e(qe, {}),
1567
1570
  /* @__PURE__ */ e(Rr, {}),
1571
+ /* @__PURE__ */ e(qe, {}),
1568
1572
  /* @__PURE__ */ e(Sr, {}),
1569
- /* @__PURE__ */ e(Je, {}),
1570
- /* @__PURE__ */ e(Dr, {})
1571
- ] }), Rl = () => ut(), Tr = (t) => {
1572
- const { render: n, className: s } = t, [o] = me(), r = Ht();
1573
+ /* @__PURE__ */ e(Dr, {}),
1574
+ /* @__PURE__ */ e(qe, {}),
1575
+ /* @__PURE__ */ e(Or, {})
1576
+ ] }), Sl = () => dt(), Lr = (n) => {
1577
+ const { render: t, className: o } = n, [s] = ue(), r = _t();
1573
1578
  return /* @__PURE__ */ e(Ae.Provider, { value: { state: r, tone: "light" }, children: /* @__PURE__ */ e(
1574
1579
  "div",
1575
1580
  {
1576
- className: f(
1581
+ className: m(
1577
1582
  "lexical-toolbar flex flex-row items-center p-1.5",
1578
- s
1583
+ o
1579
1584
  ),
1580
- children: /* @__PURE__ */ e(jt, { children: n ? n({ editor: o, state: r, tone: "light" }) : ut() })
1585
+ children: /* @__PURE__ */ e(Vt, { children: t ? t({ editor: s, state: r, tone: "light" }) : dt() })
1581
1586
  }
1582
1587
  ) });
1583
- }, Lr = (t) => {
1584
- const { render: n } = t, [s] = me(), o = Ht(), [r, l] = W(!1), { refs: a, floatingStyles: i } = at({
1588
+ }, Pr = (n) => {
1589
+ const { render: t } = n, [o] = ue(), s = _t(), [r, l] = W(!1), { refs: a, floatingStyles: i } = st({
1585
1590
  placement: "top-start",
1586
1591
  strategy: "fixed",
1587
1592
  middleware: [
1588
- un(8),
1589
- lt(),
1590
- ot({ padding: 8 }),
1591
- st({
1592
- apply({ rects: c, elements: g }) {
1593
- g.floating.style.width = `${c.reference.width}px`;
1593
+ fn(8),
1594
+ rt(),
1595
+ lt({ padding: 8 }),
1596
+ ot({
1597
+ apply({ rects: c, elements: b }) {
1598
+ b.floating.style.width = `${c.reference.width}px`;
1594
1599
  }
1595
1600
  })
1596
1601
  ],
1597
- whileElementsMounted: it
1602
+ whileElementsMounted: at
1598
1603
  });
1599
- return _(() => s.registerRootListener((c) => a.setReference(c ?? null)), [s, a]), _(() => Lt(
1600
- s.registerCommand(
1601
- An,
1604
+ return _(() => o.registerRootListener((c) => a.setReference(c ?? null)), [o, a]), _(() => Et(
1605
+ o.registerCommand(
1606
+ Un,
1602
1607
  () => (l(!0), !1),
1603
1608
  Pe
1604
1609
  ),
1605
- s.registerCommand(
1606
- Un,
1610
+ o.registerCommand(
1611
+ Wn,
1607
1612
  () => (l(!1), !1),
1608
1613
  Pe
1609
1614
  )
1610
- ), [s]), /* @__PURE__ */ e(Ae.Provider, { value: { state: o, tone: "dark" }, children: /* @__PURE__ */ e(Fe, { children: /* @__PURE__ */ e(De, { children: r && /* @__PURE__ */ e("div", { ref: a.setFloating, style: i, className: "z-50", children: /* @__PURE__ */ e(
1611
- J.div,
1615
+ ), [o]), /* @__PURE__ */ e(Ae.Provider, { value: { state: s, tone: "dark" }, children: /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(De, { children: r && /* @__PURE__ */ e("div", { ref: a.setFloating, style: i, className: "z-50", children: /* @__PURE__ */ e(
1616
+ q.div,
1612
1617
  {
1613
1618
  className: "lexical-floating-toolbar flex w-full flex-row items-center p-1 rounded-xl",
1614
1619
  initial: { opacity: 0, y: 4 },
1615
1620
  animate: { opacity: 1, y: 0 },
1616
1621
  exit: { opacity: 0, y: 4 },
1617
1622
  transition: { duration: 0.1, ease: "easeInOut" },
1618
- children: /* @__PURE__ */ e(jt, { children: n ? n({ editor: s, state: o, tone: "dark" }) : ut() })
1623
+ children: /* @__PURE__ */ e(Vt, { children: t ? t({ editor: o, state: s, tone: "dark" }) : dt() })
1619
1624
  }
1620
1625
  ) }) }) }) });
1621
- }, Sl = (t) => {
1626
+ }, Dl = (n) => {
1622
1627
  const {
1623
- label: n,
1624
- description: s,
1625
- error: o,
1628
+ label: t,
1629
+ description: o,
1630
+ error: s,
1626
1631
  placeholder: r,
1627
1632
  value: l,
1628
1633
  onChange: a,
1629
1634
  size: i = "md",
1630
1635
  toolbar: c = "static",
1631
- renderToolbar: g,
1632
- minRows: x = 4,
1633
- maxRows: w,
1636
+ renderToolbar: b,
1637
+ minRows: R = 4,
1638
+ maxRows: N,
1634
1639
  autogrow: h = !1,
1635
- namespace: b = "InputLexical",
1636
- nodes: p,
1637
- theme: m,
1638
- autoFocus: v = !1,
1639
- children: u,
1640
- className: I
1641
- } = t, R = ie(
1640
+ namespace: v = "InputLexical",
1641
+ nodes: f,
1642
+ theme: p,
1643
+ autoFocus: u = !1,
1644
+ children: I,
1645
+ className: x
1646
+ } = n, y = se(
1642
1647
  () => ({
1643
- namespace: b,
1644
- theme: m ? { ...Nt, ...m } : Nt,
1645
- nodes: [...wr, ...p ?? []],
1648
+ namespace: v,
1649
+ theme: p ? { ...wt, ...p } : wt,
1650
+ nodes: [...Nr, ...f ?? []],
1646
1651
  editorState: l ?? null,
1647
1652
  onError: (z) => {
1648
1653
  throw z;
@@ -1651,132 +1656,132 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1651
1656
  // Lexical reads initialConfig once on mount; later prop changes are ignored by design.
1652
1657
  // eslint-disable-next-line react-hooks/exhaustive-deps
1653
1658
  []
1654
- ), y = Le(
1659
+ ), k = Le(
1655
1660
  (z) => {
1656
1661
  a?.(JSON.stringify(z.toJSON()));
1657
1662
  },
1658
1663
  [a]
1659
- ), D = Y[i], T = !!o, B = (z) => `calc(${z} * 1lh + 1.5rem)`, P = h ? { minHeight: B(x), maxHeight: w ? B(w) : void 0 } : { height: B(x) };
1660
- return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: f("flex flex-col", I), children: [
1661
- /* @__PURE__ */ e(q, { children: n }),
1662
- /* @__PURE__ */ e(pn, { initialConfig: R, children: /* @__PURE__ */ d(
1664
+ ), S = J[i], O = !!s, P = (z) => `calc(${z} * 1lh + 1.5rem)`, T = h ? { minHeight: P(R), maxHeight: N ? P(N) : void 0 } : { height: P(R) };
1665
+ return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: m("flex flex-col", x), children: [
1666
+ /* @__PURE__ */ e(Y, { children: t }),
1667
+ /* @__PURE__ */ e(gn, { initialConfig: y, children: /* @__PURE__ */ d(
1663
1668
  "div",
1664
1669
  {
1665
- className: f(
1670
+ className: m(
1666
1671
  "relative flex flex-col border input-base rounded-xl shadow-sm overflow-hidden transition-all duration-150 ring-0 focus-within:ring-4 focus-within:outline-none",
1667
- T && "input-error"
1672
+ O && "input-error"
1668
1673
  ),
1669
1674
  children: [
1670
- c === "static" && /* @__PURE__ */ e(Tr, { render: g }),
1675
+ c === "static" && /* @__PURE__ */ e(Lr, { render: b }),
1671
1676
  /* @__PURE__ */ e("div", { className: "relative flex-1 min-h-0", children: /* @__PURE__ */ e(
1672
- gn,
1677
+ bn,
1673
1678
  {
1674
1679
  contentEditable: /* @__PURE__ */ e(
1675
- bn,
1680
+ vn,
1676
1681
  {
1677
- className: f(
1682
+ className: m(
1678
1683
  "lexical-content w-full outline-none px-3 py-3 leading-[1.55] overflow-y-auto mat-ui-hide-scrollbars",
1679
- D
1684
+ S
1680
1685
  ),
1681
- style: P,
1686
+ style: T,
1682
1687
  "aria-placeholder": r ?? "",
1683
1688
  placeholder: /* @__PURE__ */ e(
1684
1689
  "div",
1685
1690
  {
1686
- className: f(
1691
+ className: m(
1687
1692
  "lexical-placeholder pointer-events-none absolute left-3 top-3",
1688
- D
1693
+ S
1689
1694
  ),
1690
1695
  children: r ?? ""
1691
1696
  }
1692
1697
  )
1693
1698
  }
1694
1699
  ),
1695
- ErrorBoundary: yn
1700
+ ErrorBoundary: Cn
1696
1701
  }
1697
1702
  ) }),
1698
- /* @__PURE__ */ e(vn, {}),
1699
1703
  /* @__PURE__ */ e(xn, {}),
1700
1704
  /* @__PURE__ */ e(wn, {}),
1701
- v && /* @__PURE__ */ e(kn, {}),
1702
- a && /* @__PURE__ */ e(Nn, { onChange: y }),
1703
- u,
1704
- c === "floating" && /* @__PURE__ */ e(Lr, { render: g })
1705
+ /* @__PURE__ */ e(Nn, {}),
1706
+ u && /* @__PURE__ */ e(kn, {}),
1707
+ a && /* @__PURE__ */ e(yn, { onChange: k }),
1708
+ I,
1709
+ c === "floating" && /* @__PURE__ */ e(Pr, { render: b })
1705
1710
  ]
1706
1711
  }
1707
1712
  ) }),
1708
- /* @__PURE__ */ e(V, { children: s }),
1709
- /* @__PURE__ */ e(K, { children: o })
1713
+ /* @__PURE__ */ e(V, { children: o }),
1714
+ /* @__PURE__ */ e(K, { children: s })
1710
1715
  ] }) });
1711
- }, Dl = (t) => {
1716
+ }, Ol = (n) => {
1712
1717
  const {
1713
- className: n,
1714
- label: s,
1715
- description: o,
1718
+ className: t,
1719
+ label: o,
1720
+ description: s,
1716
1721
  options: r,
1717
1722
  error: l,
1718
1723
  size: a = "md",
1719
1724
  ...i
1720
- } = t;
1725
+ } = n;
1721
1726
  return /* @__PURE__ */ e(Q.Provider, { value: a, children: /* @__PURE__ */ d(
1722
1727
  "div",
1723
1728
  {
1724
- className: f(
1729
+ className: m(
1725
1730
  "flex flex-col",
1726
- n
1731
+ t
1727
1732
  ),
1728
1733
  children: [
1729
- /* @__PURE__ */ e(q, { children: s }),
1734
+ /* @__PURE__ */ e(Y, { children: o }),
1730
1735
  /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", children: [
1731
1736
  /* @__PURE__ */ e(
1732
1737
  "select",
1733
1738
  {
1734
- className: f(
1739
+ className: m(
1735
1740
  "appearance-none border input-base bg-none transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
1736
- ne[a],
1737
- Y[a],
1738
- fe[a],
1739
- he[a]
1741
+ te[a],
1742
+ J[a],
1743
+ me[a],
1744
+ fe[a]
1740
1745
  ),
1741
1746
  ...i,
1742
- children: r && r.map((c, g) => /* @__PURE__ */ e(
1747
+ children: r && r.map((c, b) => /* @__PURE__ */ e(
1743
1748
  "option",
1744
1749
  {
1745
1750
  value: c.value,
1746
1751
  disabled: c.disabled,
1747
1752
  children: c.label
1748
1753
  },
1749
- g
1754
+ b
1750
1755
  ))
1751
1756
  }
1752
1757
  ),
1753
- /* @__PURE__ */ d(pe, { children: [
1754
- l && /* @__PURE__ */ e(re, {}),
1755
- /* @__PURE__ */ e(Z, { Icon: ve })
1758
+ /* @__PURE__ */ d(he, { children: [
1759
+ l && /* @__PURE__ */ e(ne, {}),
1760
+ /* @__PURE__ */ e(Z, { Icon: be })
1756
1761
  ] })
1757
1762
  ] }),
1758
- /* @__PURE__ */ e(V, { children: o }),
1763
+ /* @__PURE__ */ e(V, { children: s }),
1759
1764
  /* @__PURE__ */ e(K, { children: l })
1760
1765
  ]
1761
1766
  }
1762
1767
  ) });
1763
- }, We = C.forwardRef((t, n) => {
1768
+ }, We = C.forwardRef((n, t) => {
1764
1769
  const {
1765
- children: s,
1766
- onClick: o,
1770
+ children: o,
1771
+ onClick: s,
1767
1772
  selected: r,
1768
1773
  disabled: l = !1,
1769
1774
  active: a = !1,
1770
1775
  className: i,
1771
1776
  ...c
1772
- } = t;
1777
+ } = n;
1773
1778
  return /* @__PURE__ */ d(
1774
1779
  "div",
1775
1780
  {
1776
- ref: n,
1781
+ ref: t,
1777
1782
  ...c,
1778
- onClick: () => !l && o && o(),
1779
- className: f(
1783
+ onClick: () => !l && s && s(),
1784
+ className: m(
1780
1785
  "option-base px-4 py-2 rounded-xl cursor-pointer transition-all duration-150 select-none flex flex-row gap-3 items-center",
1781
1786
  r && !l && "option-selected",
1782
1787
  a && !l && "option-active",
@@ -1784,334 +1789,331 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1784
1789
  i
1785
1790
  ),
1786
1791
  children: [
1787
- /* @__PURE__ */ e("div", { className: "flex-1 min-w-0 break-all line-clamp-1", children: s }),
1788
- r && !l && /* @__PURE__ */ e("div", { className: "shrink-0", children: /* @__PURE__ */ e(St, { className: "h-5 w-5" }) })
1792
+ /* @__PURE__ */ e("div", { className: "flex-1 min-w-0 break-all line-clamp-1", children: o }),
1793
+ r && !l && /* @__PURE__ */ e("div", { className: "shrink-0", children: /* @__PURE__ */ e(Rt, { className: "h-5 w-5" }) })
1789
1794
  ]
1790
1795
  }
1791
1796
  );
1792
- }), He = C.forwardRef((t, n) => {
1793
- const { children: s, className: o, ...r } = t;
1797
+ }), He = C.forwardRef((n, t) => {
1798
+ const { children: o, className: s, ...r } = n;
1794
1799
  return /* @__PURE__ */ e(
1795
1800
  "div",
1796
1801
  {
1797
- ref: n,
1802
+ ref: t,
1798
1803
  ...r,
1799
- className: f(
1804
+ className: m(
1800
1805
  "option-group-header px-4 pt-3 pb-1 text-xs font-semibold uppercase tracking-wide select-none",
1801
- o
1806
+ s
1802
1807
  ),
1803
- children: s
1808
+ children: o
1804
1809
  }
1805
1810
  );
1806
- }), $e = C.forwardRef((t, n) => {
1807
- const { className: s, ...o } = t;
1811
+ }), $e = C.forwardRef((n, t) => {
1812
+ const { className: o, ...s } = n;
1808
1813
  return /* @__PURE__ */ e(
1809
1814
  "div",
1810
1815
  {
1811
- ref: n,
1812
- ...o,
1813
- className: f(
1816
+ ref: t,
1817
+ ...s,
1818
+ className: m(
1814
1819
  "option-divider my-1 h-px",
1815
- s
1820
+ o
1816
1821
  )
1817
1822
  }
1818
1823
  );
1819
- }), H = (t) => !("kind" in t), G = (t, n) => t === n ? !0 : t == null || n == null || typeof t != "object" || typeof n != "object" ? !1 : JSON.stringify(t) === JSON.stringify(n), _e = (t) => {
1824
+ }), H = (n) => !("kind" in n), G = (n, t) => n === t ? !0 : n == null || t == null || typeof n != "object" || typeof t != "object" ? !1 : JSON.stringify(n) === JSON.stringify(t), _e = (n) => {
1820
1825
  const {
1821
- placement: n = "bottom",
1822
- onOutsideClick: s,
1826
+ placement: t = "bottom",
1823
1827
  fullWidth: o,
1824
- minWidth: r,
1825
- maxWidth: l,
1826
- open: a,
1827
- onOpenChange: i,
1828
- listRef: c,
1829
- activeIndex: g,
1830
- onNavigate: x,
1831
- loop: w = !0,
1832
- disabledIndices: h
1833
- } = t, b = C.useMemo(() => [
1828
+ minWidth: s,
1829
+ maxWidth: r,
1830
+ open: l,
1831
+ onOpenChange: a,
1832
+ listRef: i,
1833
+ activeIndex: c,
1834
+ onNavigate: b,
1835
+ loop: R = !0,
1836
+ disabledIndices: N
1837
+ } = n, h = C.useMemo(() => [
1838
+ rt({ padding: 8 }),
1834
1839
  lt({ padding: 8 }),
1835
- ot({ padding: 8 }),
1836
- st({
1837
- apply({ rects: P, elements: z }) {
1838
- o && (z.floating.style.width = `${P.reference.width}px`), r && (z.floating.style.minWidth = `${r}px`), l && (z.floating.style.maxWidth = `${l}px`);
1840
+ ot({
1841
+ apply({ rects: T, elements: z }) {
1842
+ o && (z.floating.style.width = `${T.reference.width}px`), s && (z.floating.style.minWidth = `${s}px`), r && (z.floating.style.maxWidth = `${r}px`);
1839
1843
  }
1840
1844
  })
1841
- ], [o, l, r]), { refs: p, floatingStyles: m, context: v, placement: u } = at({
1842
- placement: n,
1843
- open: a,
1844
- onOpenChange: i,
1845
- middleware: b,
1846
- whileElementsMounted: it
1847
- }), I = mn(v, {
1848
- listRef: c,
1849
- activeIndex: g,
1850
- onNavigate: x,
1851
- loop: w,
1845
+ ], [o, r, s]), { refs: v, floatingStyles: f, context: p, placement: u } = st({
1846
+ placement: t,
1847
+ open: l,
1848
+ onOpenChange: a,
1849
+ middleware: h,
1850
+ whileElementsMounted: at
1851
+ }), I = hn(p, {
1852
+ listRef: i,
1853
+ activeIndex: c,
1854
+ onNavigate: b,
1855
+ loop: R,
1852
1856
  virtual: !0,
1853
1857
  focusItemOnOpen: !1,
1854
- disabledIndices: h
1855
- }), { getReferenceProps: R, getFloatingProps: y, getItemProps: D } = fn([I]), T = C.useRef({
1856
- onOutsideClick: s,
1857
- floatingStyles: m,
1858
- setFloating: p.setFloating,
1859
- placement: n,
1860
- getFloatingProps: y
1858
+ disabledIndices: N
1859
+ }), x = St(p, {
1860
+ outsidePress: !0,
1861
+ escapeKey: !1
1862
+ }), { getReferenceProps: y, getFloatingProps: k, getItemProps: S } = Dt([I, x]), O = C.useRef({
1863
+ floatingStyles: f,
1864
+ setFloating: v.setFloating,
1865
+ placement: t,
1866
+ getFloatingProps: k
1861
1867
  });
1862
- T.current = {
1863
- onOutsideClick: s,
1864
- floatingStyles: m,
1865
- setFloating: p.setFloating,
1868
+ O.current = {
1869
+ floatingStyles: f,
1870
+ setFloating: v.setFloating,
1866
1871
  placement: u,
1867
- getFloatingProps: y
1872
+ getFloatingProps: k
1868
1873
  };
1869
- const B = C.useMemo(() => {
1870
- const P = (z) => {
1871
- const { floatingStyles: N, setFloating: k, onOutsideClick: A, placement: O, getFloatingProps: $ } = T.current, { className: j, open: le, children: oe } = z;
1874
+ const P = C.useMemo(() => {
1875
+ const T = (z) => {
1876
+ const { floatingStyles: w, setFloating: g, placement: M, getFloatingProps: L } = O.current, { className: $, open: j, children: re } = z;
1872
1877
  return /* @__PURE__ */ e(
1873
- Ut,
1878
+ Ht,
1874
1879
  {
1875
- open: le,
1876
- className: j,
1877
- onOutsideClick: A,
1878
- floatingStyles: N,
1879
- setFloating: k,
1880
- placement: O,
1881
- floatingProps: $(),
1882
- children: oe
1880
+ open: j,
1881
+ className: $,
1882
+ floatingStyles: w,
1883
+ setFloating: g,
1884
+ placement: M,
1885
+ floatingProps: L(),
1886
+ children: re
1883
1887
  }
1884
1888
  );
1885
1889
  };
1886
- return C.memo(P);
1890
+ return C.memo(T);
1887
1891
  }, []);
1888
1892
  return {
1889
- anchorRef: p.setReference,
1890
- Popover: B,
1891
- getReferenceProps: R,
1892
- getItemProps: D
1893
+ anchorRef: v.setReference,
1894
+ Popover: P,
1895
+ getReferenceProps: y,
1896
+ getItemProps: S
1893
1897
  };
1894
- }, Pr = (t) => {
1898
+ }, Er = (n) => {
1895
1899
  const {
1896
- className: n,
1897
- label: s,
1898
- description: o,
1900
+ className: t,
1901
+ label: o,
1902
+ description: s,
1899
1903
  options: r,
1900
1904
  onChange: l,
1901
1905
  value: a,
1902
1906
  placeholder: i,
1903
1907
  maxHeight: c = 300,
1904
- error: g,
1905
- size: x = "md",
1906
- disabled: w = !1,
1908
+ error: b,
1909
+ size: R = "md",
1910
+ disabled: N = !1,
1907
1911
  clearable: h = !0
1908
- } = t, [b, p] = W(!1), [m, v] = W(null), u = C.useRef(null), I = C.useRef([]), R = r?.find((N) => H(N) && G(N.value, a)), y = ie(
1909
- () => r.map((N, k) => !H(N) || N.disabled ? k : -1).filter((N) => N !== -1),
1912
+ } = n, [v, f] = W(!1), [p, u] = W(null), I = C.useRef(null), x = C.useRef([]), y = r?.find((w) => H(w) && G(w.value, a)), k = se(
1913
+ () => r.map((w, g) => !H(w) || w.disabled ? g : -1).filter((w) => w !== -1),
1910
1914
  [r]
1911
1915
  );
1912
- we(b, () => p(!1)), _(() => {
1913
- if (b) {
1914
- u.current?.focus({ preventScroll: !0 });
1915
- const N = r.findIndex((k) => H(k) && G(k.value, a));
1916
- if (N >= 0)
1917
- v(N);
1916
+ xe(v, () => f(!1)), _(() => {
1917
+ if (v) {
1918
+ I.current?.focus({ preventScroll: !0 });
1919
+ const w = r.findIndex((g) => H(g) && G(g.value, a));
1920
+ if (w >= 0)
1921
+ u(w);
1918
1922
  else {
1919
- const k = r.findIndex((A) => H(A) && !A.disabled);
1920
- v(k >= 0 ? k : null);
1923
+ const g = r.findIndex((M) => H(M) && !M.disabled);
1924
+ u(g >= 0 ? g : null);
1921
1925
  }
1922
1926
  } else
1923
- v(null);
1924
- }, [b]);
1925
- const { anchorRef: D, Popover: T, getReferenceProps: B, getItemProps: P } = _e({
1927
+ u(null);
1928
+ }, [v]);
1929
+ const { anchorRef: S, Popover: O, getReferenceProps: P, getItemProps: T } = _e({
1926
1930
  placement: "bottom",
1927
1931
  fullWidth: !0,
1928
1932
  minWidth: 200,
1929
- onOutsideClick: () => p(!1),
1930
- open: b,
1931
- onOpenChange: p,
1932
- listRef: I,
1933
- activeIndex: m,
1934
- onNavigate: v,
1935
- disabledIndices: y
1936
- }), z = (N) => {
1937
- const k = r[N];
1938
- k && H(k) && !k.disabled && (l(k.value), p(!1));
1933
+ open: v,
1934
+ onOpenChange: f,
1935
+ listRef: x,
1936
+ activeIndex: p,
1937
+ onNavigate: u,
1938
+ disabledIndices: k
1939
+ }), z = (w) => {
1940
+ const g = r[w];
1941
+ g && H(g) && !g.disabled && (l(g.value), f(!1));
1939
1942
  };
1940
- return /* @__PURE__ */ e(Q.Provider, { value: x, children: /* @__PURE__ */ d(
1943
+ return /* @__PURE__ */ e(Q.Provider, { value: R, children: /* @__PURE__ */ d(
1941
1944
  "div",
1942
1945
  {
1943
- className: f(
1946
+ className: m(
1944
1947
  "flex flex-col",
1945
- n
1948
+ t
1946
1949
  ),
1947
1950
  children: [
1948
- /* @__PURE__ */ e(q, { children: s }),
1949
- /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: D, children: [
1951
+ /* @__PURE__ */ e(Y, { children: o }),
1952
+ /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: S, children: [
1950
1953
  /* @__PURE__ */ d(
1951
1954
  "div",
1952
1955
  {
1953
- ...B({
1954
- ref: u,
1956
+ ...P({
1957
+ ref: I,
1955
1958
  role: "button",
1956
- tabIndex: w ? -1 : 0,
1957
- "aria-disabled": w,
1959
+ tabIndex: N ? -1 : 0,
1960
+ "aria-disabled": N,
1958
1961
  onClick: () => {
1959
- w || p(!b);
1962
+ N || f(!v);
1960
1963
  },
1961
- onKeyDown: (N) => {
1962
- w || (N.key === " " ? (N.preventDefault(), p((k) => !k)) : N.key === "Enter" && (N.preventDefault(), b && m != null ? z(m) : p(!0)));
1964
+ onKeyDown: (w) => {
1965
+ N || (w.key === " " ? (w.preventDefault(), f((g) => !g)) : w.key === "Enter" && (w.preventDefault(), v && p != null ? z(p) : f(!0)));
1963
1966
  }
1964
1967
  }),
1965
- className: f(
1968
+ className: m(
1966
1969
  "flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",
1967
- ne[x],
1968
- Y[x],
1969
- fe[x],
1970
- h && a ? Be[x] : he[x],
1971
- w ? "select-trigger-disabled" : g && "select-trigger-error",
1972
- !w && b && "ring-4"
1970
+ te[R],
1971
+ J[R],
1972
+ me[R],
1973
+ h && a ? Be[R] : fe[R],
1974
+ N ? "select-trigger-disabled" : b && "select-trigger-error",
1975
+ !N && v && "ring-4"
1973
1976
  ),
1974
1977
  children: [
1975
- R && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: R.label }),
1976
- !R && i && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: i })
1978
+ y && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: y.label }),
1979
+ !y && i && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: i })
1977
1980
  ]
1978
1981
  }
1979
1982
  ),
1980
- /* @__PURE__ */ d(pe, { children: [
1981
- !w && g && /* @__PURE__ */ e(re, {}),
1982
- h && !!a && !w && /* @__PURE__ */ e(Z, { Icon: ue, onClick: () => l(null) }),
1983
- /* @__PURE__ */ e(Z, { Icon: ve })
1983
+ /* @__PURE__ */ d(he, { children: [
1984
+ !N && b && /* @__PURE__ */ e(ne, {}),
1985
+ h && !!a && !N && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => l(null) }),
1986
+ /* @__PURE__ */ e(Z, { Icon: be })
1984
1987
  ] }),
1985
- /* @__PURE__ */ e(T, { open: b, children: /* @__PURE__ */ e(xe, { className: "!p-0", style: { maxHeight: c }, children: /* @__PURE__ */ e("div", { className: "flex flex-col p-2 gap-1", children: r.map((N, k) => {
1986
- if (!H(N))
1987
- return N.kind === "header" ? /* @__PURE__ */ e(
1988
+ /* @__PURE__ */ e(O, { open: v, children: /* @__PURE__ */ e(ve, { className: "!p-0", style: { maxHeight: c }, children: /* @__PURE__ */ e("div", { className: "flex flex-col p-2 gap-1", children: r.map((w, g) => {
1989
+ if (!H(w))
1990
+ return w.kind === "header" ? /* @__PURE__ */ e(
1988
1991
  He,
1989
1992
  {
1990
- ref: (O) => {
1991
- I.current[k] = O;
1993
+ ref: (L) => {
1994
+ x.current[g] = L;
1992
1995
  },
1993
- children: N.label
1996
+ children: w.label
1994
1997
  },
1995
- `header-${k}`
1998
+ `header-${g}`
1996
1999
  ) : /* @__PURE__ */ e(
1997
2000
  $e,
1998
2001
  {
1999
- ref: (O) => {
2000
- I.current[k] = O;
2002
+ ref: (L) => {
2003
+ x.current[g] = L;
2001
2004
  }
2002
2005
  },
2003
- `divider-${k}`
2006
+ `divider-${g}`
2004
2007
  );
2005
- const A = G(N.value, a);
2008
+ const M = G(w.value, a);
2006
2009
  return /* @__PURE__ */ e(
2007
2010
  We,
2008
2011
  {
2009
- ...P({
2010
- ref(O) {
2011
- I.current[k] = O;
2012
+ ...T({
2013
+ ref(L) {
2014
+ x.current[g] = L;
2012
2015
  }
2013
2016
  }),
2014
- onClick: () => z(k),
2015
- selected: A,
2016
- active: m === k,
2017
- disabled: N.disabled,
2018
- children: N.label
2017
+ onClick: () => z(g),
2018
+ selected: M,
2019
+ active: p === g,
2020
+ disabled: w.disabled,
2021
+ children: w.label
2019
2022
  },
2020
- `option-${k}`
2023
+ `option-${g}`
2021
2024
  );
2022
2025
  }) }) }) })
2023
2026
  ] }),
2024
- /* @__PURE__ */ e(V, { children: o }),
2025
- /* @__PURE__ */ e(K, { children: g })
2027
+ /* @__PURE__ */ e(V, { children: s }),
2028
+ /* @__PURE__ */ e(K, { children: b })
2026
2029
  ]
2027
2030
  }
2028
2031
  ) });
2029
- }, Ol = (t) => {
2032
+ }, zl = (n) => {
2030
2033
  const {
2031
- className: n,
2032
- label: s,
2033
- description: o,
2034
+ className: t,
2035
+ label: o,
2036
+ description: s,
2034
2037
  options: r,
2035
2038
  onChange: l,
2036
2039
  onSearch: a,
2037
2040
  value: i,
2038
2041
  placeholder: c,
2039
- maxHeight: g = 300,
2040
- error: x,
2041
- size: w = "md",
2042
+ maxHeight: b = 300,
2043
+ error: R,
2044
+ size: N = "md",
2042
2045
  disabled: h = !1,
2043
- clearable: b = !0
2044
- } = t, [p, m] = W(!1), [v, u] = W(r), [I, R] = W(""), [y, D] = W(null), T = C.useRef(null), B = C.useRef(null), P = C.useRef([]), z = r?.find((L) => H(L) && G(L.value, i)), N = ie(() => I !== "" ? v : r, [I, v, r]), k = ie(
2045
- () => N.map((L, U) => !H(L) || L.disabled ? U : -1).filter((L) => L !== -1),
2046
- [N]
2046
+ clearable: v = !0
2047
+ } = n, [f, p] = W(!1), [u, I] = W(r), [x, y] = W(""), [k, S] = W(null), O = C.useRef(null), P = C.useRef(null), T = C.useRef([]), z = r?.find((E) => H(E) && G(E.value, i)), w = se(() => x !== "" ? u : r, [x, u, r]), g = se(
2048
+ () => w.map((E, U) => !H(E) || E.disabled ? U : -1).filter((E) => E !== -1),
2049
+ [w]
2047
2050
  );
2048
- we(p, () => m(!1)), _(() => {
2049
- u(a(I));
2050
- }, [I, r, a]), _(() => {
2051
- if (p) {
2052
- setTimeout(() => B.current?.focus(), 100);
2053
- const L = r.findIndex((U) => H(U) && G(U.value, i));
2054
- if (L >= 0)
2055
- D(L);
2051
+ xe(f, () => p(!1)), _(() => {
2052
+ I(a(x));
2053
+ }, [x, r, a]), _(() => {
2054
+ if (f) {
2055
+ setTimeout(() => P.current?.focus(), 100);
2056
+ const E = r.findIndex((U) => H(U) && G(U.value, i));
2057
+ if (E >= 0)
2058
+ S(E);
2056
2059
  else {
2057
- const U = r.findIndex((se) => H(se) && !se.disabled);
2058
- D(U >= 0 ? U : null);
2060
+ const U = r.findIndex((le) => H(le) && !le.disabled);
2061
+ S(U >= 0 ? U : null);
2059
2062
  }
2060
2063
  } else
2061
- D(null), R("");
2062
- }, [p]), _(() => {
2063
- if (!p) return;
2064
- const L = N.findIndex((U) => H(U) && !U.disabled);
2065
- D(L >= 0 ? L : null);
2066
- }, [I, p, N]);
2067
- const { anchorRef: A, Popover: O, getReferenceProps: $, getItemProps: j } = _e({
2064
+ S(null), y("");
2065
+ }, [f]), _(() => {
2066
+ if (!f) return;
2067
+ const E = w.findIndex((U) => H(U) && !U.disabled);
2068
+ S(E >= 0 ? E : null);
2069
+ }, [x, f, w]);
2070
+ const { anchorRef: M, Popover: L, getReferenceProps: $, getItemProps: j } = _e({
2068
2071
  placement: "bottom",
2069
2072
  fullWidth: !0,
2070
2073
  minWidth: 200,
2071
- onOutsideClick: () => m(!1),
2072
- open: p,
2073
- onOpenChange: m,
2074
- listRef: P,
2075
- activeIndex: y,
2076
- onNavigate: D,
2077
- disabledIndices: k
2078
- }), le = (L) => {
2079
- const U = N[L];
2080
- U && H(U) && !U.disabled && (l(U.value), m(!1));
2081
- }, oe = N.some((L) => H(L));
2082
- return /* @__PURE__ */ e(Q.Provider, { value: w, children: /* @__PURE__ */ d(
2074
+ open: f,
2075
+ onOpenChange: p,
2076
+ listRef: T,
2077
+ activeIndex: k,
2078
+ onNavigate: S,
2079
+ disabledIndices: g
2080
+ }), re = (E) => {
2081
+ const U = w[E];
2082
+ U && H(U) && !U.disabled && (l(U.value), p(!1));
2083
+ }, Ne = w.some((E) => H(E));
2084
+ return /* @__PURE__ */ e(Q.Provider, { value: N, children: /* @__PURE__ */ d(
2083
2085
  "div",
2084
2086
  {
2085
- className: f(
2087
+ className: m(
2086
2088
  "flex flex-col",
2087
- n
2089
+ t
2088
2090
  ),
2089
2091
  children: [
2090
- /* @__PURE__ */ e(q, { children: s }),
2091
- /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: A, children: [
2092
+ /* @__PURE__ */ e(Y, { children: o }),
2093
+ /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: M, children: [
2092
2094
  /* @__PURE__ */ d(
2093
2095
  "div",
2094
2096
  {
2095
2097
  ...$({
2096
- ref: T,
2098
+ ref: O,
2097
2099
  role: "button",
2098
2100
  tabIndex: h ? -1 : 0,
2099
2101
  "aria-disabled": h,
2100
2102
  onClick: () => {
2101
- h || m(!p);
2103
+ h || p(!f);
2102
2104
  },
2103
- onKeyDown: (L) => {
2104
- h || (L.key === " " ? (L.preventDefault(), m((U) => !U)) : L.key === "Enter" && !p && (L.preventDefault(), m(!0)));
2105
+ onKeyDown: (E) => {
2106
+ h || (E.key === " " ? (E.preventDefault(), p((U) => !U)) : E.key === "Enter" && !f && (E.preventDefault(), p(!0)));
2105
2107
  }
2106
2108
  }),
2107
- className: f(
2109
+ className: m(
2108
2110
  "flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",
2109
- ne[w],
2110
- Y[w],
2111
- fe[w],
2112
- b && i ? Be[w] : he[w],
2113
- h ? "select-trigger-disabled" : x && "select-trigger-error",
2114
- !h && p && "ring-4"
2111
+ te[N],
2112
+ J[N],
2113
+ me[N],
2114
+ v && i ? Be[N] : fe[N],
2115
+ h ? "select-trigger-disabled" : R && "select-trigger-error",
2116
+ !h && f && "ring-4"
2115
2117
  ),
2116
2118
  children: [
2117
2119
  z && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: z.label }),
@@ -2119,65 +2121,65 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
2119
2121
  ]
2120
2122
  }
2121
2123
  ),
2122
- /* @__PURE__ */ d(pe, { children: [
2123
- !h && x && /* @__PURE__ */ e(re, {}),
2124
- b && !!i && !h && /* @__PURE__ */ e(Z, { Icon: ue, onClick: () => l(null) }),
2125
- /* @__PURE__ */ e(Z, { Icon: ve })
2124
+ /* @__PURE__ */ d(he, { children: [
2125
+ !h && R && /* @__PURE__ */ e(ne, {}),
2126
+ v && !!i && !h && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => l(null) }),
2127
+ /* @__PURE__ */ e(Z, { Icon: be })
2126
2128
  ] }),
2127
- /* @__PURE__ */ e(O, { open: p, children: /* @__PURE__ */ d(xe, { className: "gap-0 !p-0", style: { maxHeight: g }, children: [
2129
+ /* @__PURE__ */ e(L, { open: f, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: b }, children: [
2128
2130
  /* @__PURE__ */ d("div", { className: "sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm", children: [
2129
2131
  /* @__PURE__ */ e(
2130
2132
  "input",
2131
2133
  {
2132
- ref: B,
2134
+ ref: P,
2133
2135
  type: "text",
2134
2136
  placeholder: "Search",
2135
- value: I,
2137
+ value: x,
2136
2138
  className: "appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",
2137
- onChange: (L) => R(L.target.value),
2138
- onKeyDown: (L) => {
2139
- L.key === "Enter" && y != null && (L.preventDefault(), le(y));
2139
+ onChange: (E) => y(E.target.value),
2140
+ onKeyDown: (E) => {
2141
+ E.key === "Enter" && k != null && (E.preventDefault(), re(k));
2140
2142
  }
2141
2143
  }
2142
2144
  ),
2143
- /* @__PURE__ */ e(Me, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
2145
+ /* @__PURE__ */ e(Fe, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
2144
2146
  ] }),
2145
2147
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
2146
- I !== "" && !oe && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2147
- N.map((L, U) => {
2148
- if (!H(L))
2149
- return L.kind === "header" ? /* @__PURE__ */ e(
2148
+ x !== "" && !Ne && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2149
+ w.map((E, U) => {
2150
+ if (!H(E))
2151
+ return E.kind === "header" ? /* @__PURE__ */ e(
2150
2152
  He,
2151
2153
  {
2152
2154
  ref: (ee) => {
2153
- P.current[U] = ee;
2155
+ T.current[U] = ee;
2154
2156
  },
2155
- children: L.label
2157
+ children: E.label
2156
2158
  },
2157
2159
  `header-${U}`
2158
2160
  ) : /* @__PURE__ */ e(
2159
2161
  $e,
2160
2162
  {
2161
2163
  ref: (ee) => {
2162
- P.current[U] = ee;
2164
+ T.current[U] = ee;
2163
2165
  }
2164
2166
  },
2165
2167
  `divider-${U}`
2166
2168
  );
2167
- const se = G(L.value, i);
2169
+ const le = G(E.value, i);
2168
2170
  return /* @__PURE__ */ e(
2169
2171
  We,
2170
2172
  {
2171
2173
  ...j({
2172
2174
  ref(ee) {
2173
- P.current[U] = ee;
2175
+ T.current[U] = ee;
2174
2176
  }
2175
2177
  }),
2176
- onClick: () => le(U),
2177
- selected: se,
2178
- active: y === U,
2179
- disabled: L.disabled,
2180
- children: L.label
2178
+ onClick: () => re(U),
2179
+ selected: le,
2180
+ active: k === U,
2181
+ disabled: E.disabled,
2182
+ children: E.label
2181
2183
  },
2182
2184
  `option-${U}`
2183
2185
  );
@@ -2185,192 +2187,191 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
2185
2187
  ] })
2186
2188
  ] }) })
2187
2189
  ] }),
2188
- /* @__PURE__ */ e(V, { children: o }),
2189
- /* @__PURE__ */ e(K, { children: x })
2190
+ /* @__PURE__ */ e(V, { children: s }),
2191
+ /* @__PURE__ */ e(K, { children: R })
2190
2192
  ]
2191
2193
  }
2192
2194
  ) });
2193
- }, Er = (t, n) => {
2194
- const [s, o] = W(t);
2195
+ }, Fr = (n, t) => {
2196
+ const [o, s] = W(n);
2195
2197
  return _(() => {
2196
2198
  const r = setTimeout(() => {
2197
- o(t);
2198
- }, n);
2199
+ s(n);
2200
+ }, t);
2199
2201
  return () => {
2200
2202
  clearTimeout(r);
2201
2203
  };
2202
- }, [t, n]), s;
2203
- }, zl = (t) => {
2204
+ }, [n, t]), o;
2205
+ }, Tl = (n) => {
2204
2206
  const {
2205
- className: n,
2206
- label: s,
2207
- description: o,
2207
+ className: t,
2208
+ label: o,
2209
+ description: s,
2208
2210
  onChange: r,
2209
2211
  fetchOptionsByQuery: l,
2210
2212
  fetchOptionByValue: a,
2211
2213
  onSearchDebounceMs: i = 300,
2212
2214
  value: c,
2213
- placeholder: g,
2214
- maxHeight: x = 300,
2215
- error: w,
2215
+ placeholder: b,
2216
+ maxHeight: R = 300,
2217
+ error: N,
2216
2218
  size: h = "md",
2217
- disabled: b = !1,
2218
- clearable: p = !0
2219
- } = t, [m, v] = W(!1), u = C.useRef(null), [I, R] = W(""), [y, D] = W([]), [T, B] = W(null), P = C.useRef(null), [z, N] = W(!1), [k, A] = W(!1), [O, $] = W(null), j = C.useRef([]), le = ie(
2220
- () => y.map((M, F) => !H(M) || M.disabled ? F : -1).filter((M) => M !== -1),
2221
- [y]
2219
+ disabled: v = !1,
2220
+ clearable: f = !0
2221
+ } = n, [p, u] = W(!1), I = C.useRef(null), [x, y] = W(""), [k, S] = W([]), [O, P] = W(null), T = C.useRef(null), [z, w] = W(!1), [g, M] = W(!1), [L, $] = W(null), j = C.useRef([]), re = se(
2222
+ () => k.map((B, A) => !H(B) || B.disabled ? A : -1).filter((B) => B !== -1),
2223
+ [k]
2222
2224
  );
2223
- we(m, () => v(!1));
2224
- const oe = Er(I, i);
2225
+ xe(p, () => u(!1));
2226
+ const Ne = Fr(x, i);
2225
2227
  _(() => {
2226
2228
  (async () => {
2227
- N(!0);
2228
- const F = await l(oe);
2229
- D(F), N(!1);
2229
+ w(!0);
2230
+ const A = await l(Ne);
2231
+ S(A), w(!1);
2230
2232
  })();
2231
- }, [oe, l]), _(() => {
2233
+ }, [Ne, l]), _(() => {
2232
2234
  if (c == null) {
2233
- B(null);
2235
+ P(null);
2234
2236
  return;
2235
2237
  }
2236
- const M = y?.find((F) => H(F) && G(F.value, c));
2237
- M ? B(M) : (async () => {
2238
- A(!0);
2239
- const ae = await a(c);
2240
- B(ae), A(!1);
2238
+ const B = k?.find((A) => H(A) && G(A.value, c));
2239
+ B ? P(B) : (async () => {
2240
+ M(!0);
2241
+ const oe = await a(c);
2242
+ P(oe), M(!1);
2241
2243
  })();
2242
- }, [a, y, c]), _(() => {
2243
- m ? setTimeout(() => P.current?.focus(), 100) : ($(null), R(""));
2244
- }, [m]), _(() => {
2245
- if (!m) return;
2246
- const M = y.findIndex((F) => H(F) && !F.disabled);
2247
- $(M >= 0 ? M : null);
2248
- }, [y, m]);
2249
- const { anchorRef: L, Popover: U, getReferenceProps: se, getItemProps: ee } = _e({
2244
+ }, [a, k, c]), _(() => {
2245
+ p ? setTimeout(() => T.current?.focus(), 100) : ($(null), y(""));
2246
+ }, [p]), _(() => {
2247
+ if (!p) return;
2248
+ const B = k.findIndex((A) => H(A) && !A.disabled);
2249
+ $(B >= 0 ? B : null);
2250
+ }, [k, p]);
2251
+ const { anchorRef: E, Popover: U, getReferenceProps: le, getItemProps: ee } = _e({
2250
2252
  placement: "bottom",
2251
2253
  fullWidth: !0,
2252
2254
  minWidth: 200,
2253
- onOutsideClick: () => v(!1),
2254
- open: m,
2255
- onOpenChange: v,
2255
+ open: p,
2256
+ onOpenChange: u,
2256
2257
  listRef: j,
2257
- activeIndex: O,
2258
+ activeIndex: L,
2258
2259
  onNavigate: $,
2259
- disabledIndices: le
2260
- }), Oe = (M) => {
2261
- const F = y[M];
2262
- F && H(F) && !F.disabled && (r(F.value), v(!1));
2263
- }, ze = y.some((M) => H(M));
2260
+ disabledIndices: re
2261
+ }), Oe = (B) => {
2262
+ const A = k[B];
2263
+ A && H(A) && !A.disabled && (r(A.value), u(!1));
2264
+ }, ze = k.some((B) => H(B));
2264
2265
  return /* @__PURE__ */ e(Q.Provider, { value: h, children: /* @__PURE__ */ d(
2265
2266
  "div",
2266
2267
  {
2267
- className: f(
2268
+ className: m(
2268
2269
  "flex flex-col",
2269
- n
2270
+ t
2270
2271
  ),
2271
2272
  children: [
2272
- /* @__PURE__ */ e(q, { children: s }),
2273
- /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: L, children: [
2273
+ /* @__PURE__ */ e(Y, { children: o }),
2274
+ /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: E, children: [
2274
2275
  /* @__PURE__ */ d(
2275
2276
  "div",
2276
2277
  {
2277
- ...se({
2278
- ref: u,
2278
+ ...le({
2279
+ ref: I,
2279
2280
  role: "button",
2280
- tabIndex: b ? -1 : 0,
2281
- "aria-disabled": b,
2281
+ tabIndex: v ? -1 : 0,
2282
+ "aria-disabled": v,
2282
2283
  onClick: () => {
2283
- b || v(!m);
2284
+ v || u(!p);
2284
2285
  },
2285
- onKeyDown: (M) => {
2286
- b || (M.key === " " ? (M.preventDefault(), v((F) => !F)) : M.key === "Enter" && !m && (M.preventDefault(), v(!0)));
2286
+ onKeyDown: (B) => {
2287
+ v || (B.key === " " ? (B.preventDefault(), u((A) => !A)) : B.key === "Enter" && !p && (B.preventDefault(), u(!0)));
2287
2288
  }
2288
2289
  }),
2289
- className: f(
2290
+ className: m(
2290
2291
  "flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",
2291
- ne[h],
2292
- Y[h],
2293
- fe[h],
2294
- p && c ? Be[h] : he[h],
2295
- b ? "select-trigger-disabled" : w && "select-trigger-error",
2296
- !b && m && "ring-4"
2292
+ te[h],
2293
+ J[h],
2294
+ me[h],
2295
+ f && c ? Be[h] : fe[h],
2296
+ v ? "select-trigger-disabled" : N && "select-trigger-error",
2297
+ !v && p && "ring-4"
2297
2298
  ),
2298
2299
  children: [
2299
- !k && T && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: T.label }),
2300
- !k && !T && g && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: g }),
2301
- k && /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-text)]" })
2300
+ !g && O && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: O.label }),
2301
+ !g && !O && b && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: b }),
2302
+ g && /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-text)]" })
2302
2303
  ]
2303
2304
  }
2304
2305
  ),
2305
- /* @__PURE__ */ d(pe, { children: [
2306
- !b && w && /* @__PURE__ */ e(re, {}),
2307
- p && !!c && !b && /* @__PURE__ */ e(Z, { Icon: ue, onClick: () => r(null) }),
2308
- /* @__PURE__ */ e(Z, { Icon: ve })
2306
+ /* @__PURE__ */ d(he, { children: [
2307
+ !v && N && /* @__PURE__ */ e(ne, {}),
2308
+ f && !!c && !v && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => r(null) }),
2309
+ /* @__PURE__ */ e(Z, { Icon: be })
2309
2310
  ] }),
2310
- /* @__PURE__ */ e(U, { open: m, children: /* @__PURE__ */ d(xe, { className: "gap-0 !p-0", style: { maxHeight: x }, children: [
2311
+ /* @__PURE__ */ e(U, { open: p, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: R }, children: [
2311
2312
  /* @__PURE__ */ d("div", { className: "sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm", children: [
2312
2313
  /* @__PURE__ */ e(
2313
2314
  "input",
2314
2315
  {
2315
- ref: P,
2316
+ ref: T,
2316
2317
  type: "text",
2317
2318
  placeholder: "Search",
2318
- value: I,
2319
+ value: x,
2319
2320
  className: "appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",
2320
- onChange: (M) => R(M.target.value),
2321
- onKeyDown: (M) => {
2322
- M.key === "Enter" && O != null && (M.preventDefault(), Oe(O));
2321
+ onChange: (B) => y(B.target.value),
2322
+ onKeyDown: (B) => {
2323
+ B.key === "Enter" && L != null && (B.preventDefault(), Oe(L));
2323
2324
  }
2324
2325
  }
2325
2326
  ),
2326
- /* @__PURE__ */ e(Me, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
2327
+ /* @__PURE__ */ e(Fe, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
2327
2328
  ] }),
2328
2329
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
2329
2330
  !z && !ze && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2330
2331
  z && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(Se, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2331
- !z && y.map((M, F) => {
2332
- if (!H(M))
2333
- return M.kind === "header" ? /* @__PURE__ */ e(
2332
+ !z && k.map((B, A) => {
2333
+ if (!H(B))
2334
+ return B.kind === "header" ? /* @__PURE__ */ e(
2334
2335
  He,
2335
2336
  {
2336
- ref: (ge) => {
2337
- j.current[F] = ge;
2337
+ ref: (pe) => {
2338
+ j.current[A] = pe;
2338
2339
  },
2339
- children: M.label
2340
+ children: B.label
2340
2341
  },
2341
- `header-${F}`
2342
+ `header-${A}`
2342
2343
  ) : /* @__PURE__ */ e(
2343
2344
  $e,
2344
2345
  {
2345
- ref: (ge) => {
2346
- j.current[F] = ge;
2346
+ ref: (pe) => {
2347
+ j.current[A] = pe;
2347
2348
  }
2348
2349
  },
2349
- `divider-${F}`
2350
+ `divider-${A}`
2350
2351
  );
2351
- const ae = G(M.value, c);
2352
+ const oe = G(B.value, c);
2352
2353
  return /* @__PURE__ */ e(
2353
2354
  We,
2354
2355
  {
2355
2356
  ...ee({
2356
- ref(ge) {
2357
- j.current[F] = ge;
2357
+ ref(pe) {
2358
+ j.current[A] = pe;
2358
2359
  }
2359
2360
  }),
2360
- onClick: () => Oe(F),
2361
- selected: ae,
2362
- active: O === F,
2363
- disabled: M.disabled,
2364
- children: M.label
2361
+ onClick: () => Oe(A),
2362
+ selected: oe,
2363
+ active: L === A,
2364
+ disabled: B.disabled,
2365
+ children: B.label
2365
2366
  },
2366
- `option-${F}`
2367
+ `option-${A}`
2367
2368
  );
2368
2369
  })
2369
2370
  ] })
2370
2371
  ] }) })
2371
2372
  ] }),
2372
- /* @__PURE__ */ e(V, { children: o }),
2373
- /* @__PURE__ */ e(K, { children: w })
2373
+ /* @__PURE__ */ e(V, { children: s }),
2374
+ /* @__PURE__ */ e(K, { children: N })
2374
2375
  ]
2375
2376
  }
2376
2377
  ) });
@@ -2399,239 +2400,238 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
2399
2400
  stone: "bg-stone-100 text-stone-700 ring-stone-200 dark:bg-stone-950 dark:text-stone-300 dark:ring-stone-800",
2400
2401
  white: "bg-[var(--color-badge-white-bg)] text-[var(--color-badge-white-text)] ring-[var(--color-badge-white-ring)]",
2401
2402
  black: "bg-[var(--color-badge-black-bg)] text-[var(--color-badge-black-text)] ring-[var(--color-badge-black-ring)]"
2402
- }, Ee = C.forwardRef((t, n) => {
2403
+ }, Ee = C.forwardRef((n, t) => {
2403
2404
  const {
2404
- className: s,
2405
- children: o,
2405
+ className: o,
2406
+ children: s,
2406
2407
  onClick: r,
2407
2408
  showCloseIcon: l,
2408
2409
  Icon: a,
2409
2410
  color: i = "gray"
2410
- } = t, c = f(
2411
+ } = n, c = m(
2411
2412
  "inline-flex align-top items-center gap-2 px-3 h-7 rounded-lg font-semibold",
2412
2413
  Mr[i],
2413
- s
2414
+ o
2414
2415
  );
2415
- return r ? /* @__PURE__ */ e("div", { ref: n, children: /* @__PURE__ */ d(
2416
+ return r ? /* @__PURE__ */ e("div", { ref: t, children: /* @__PURE__ */ d(
2416
2417
  "button",
2417
2418
  {
2418
- className: f("cursor-pointer ring-0 hover:ring-4 active:ring-1 transition-all duration-100 select-none focus:outline-none focus:ring-4", c),
2419
+ className: m("cursor-pointer ring-0 hover:ring-4 active:ring-1 transition-all duration-100 select-none focus:outline-none focus:ring-4", c),
2419
2420
  onClick: r,
2420
2421
  children: [
2421
2422
  a && /* @__PURE__ */ e(a, { className: "h-4 w-4 shrink-0" }),
2422
- /* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: o }),
2423
+ /* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: s }),
2423
2424
  l && /* @__PURE__ */ e(
2424
- ue,
2425
+ de,
2425
2426
  {
2426
2427
  className: "h-4 w-4 shrink-0"
2427
2428
  }
2428
2429
  )
2429
2430
  ]
2430
2431
  }
2431
- ) }) : /* @__PURE__ */ d("div", { className: c, ref: n, children: [
2432
+ ) }) : /* @__PURE__ */ d("div", { className: c, ref: t, children: [
2432
2433
  a && /* @__PURE__ */ e(a, { className: "h-4 w-4 shrink-0" }),
2433
- /* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: o })
2434
+ /* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: s })
2434
2435
  ] });
2435
2436
  });
2436
- function Fr(t) {
2437
+ function Br(n) {
2437
2438
  const {
2438
- enabled: n,
2439
- triggerRef: s,
2440
- measureRef: o,
2439
+ enabled: t,
2440
+ triggerRef: o,
2441
+ measureRef: s,
2441
2442
  trayRef: r,
2442
2443
  itemCount: l,
2443
2444
  deps: a = [],
2444
2445
  gap: i = 4
2445
- } = t, [c, g] = W(0);
2446
- return Rt(() => {
2447
- if (!n) return;
2448
- const x = s.current, w = o.current;
2449
- if (!x || !w) return;
2446
+ } = n, [c, b] = W(0);
2447
+ return It(() => {
2448
+ if (!t) return;
2449
+ const R = o.current, N = s.current;
2450
+ if (!R || !N) return;
2450
2451
  const h = () => {
2451
2452
  if (l === 0) {
2452
- g(0);
2453
+ b(0);
2453
2454
  return;
2454
2455
  }
2455
2456
  if (l === 1) {
2456
- g(1);
2457
+ b(1);
2457
2458
  return;
2458
2459
  }
2459
- const p = window.getComputedStyle(x), m = parseFloat(p.paddingLeft || "0"), v = x.getBoundingClientRect(), u = v.left + m;
2460
- let I = v.right - parseFloat(p.paddingRight || "0");
2461
- const R = r?.current;
2462
- if (R) {
2463
- const N = R.getBoundingClientRect();
2464
- N.width > 0 && (I = Math.min(I, N.left - i));
2460
+ const f = window.getComputedStyle(R), p = parseFloat(f.paddingLeft || "0"), u = R.getBoundingClientRect(), I = u.left + p;
2461
+ let x = u.right - parseFloat(f.paddingRight || "0");
2462
+ const y = r?.current;
2463
+ if (y) {
2464
+ const w = y.getBoundingClientRect();
2465
+ w.width > 0 && (x = Math.min(x, w.left - i));
2465
2466
  }
2466
- const y = Math.max(0, I - u), D = Array.from(w.children);
2467
- if (D.length < l + 1) return;
2468
- let T = 0;
2469
- for (let N = 0; N < l; N++)
2470
- T += D[N].offsetWidth + (N > 0 ? i : 0);
2471
- if (T <= y) {
2472
- g(l);
2467
+ const k = Math.max(0, x - I), S = Array.from(N.children);
2468
+ if (S.length < l + 1) return;
2469
+ let O = 0;
2470
+ for (let w = 0; w < l; w++)
2471
+ O += S[w].offsetWidth + (w > 0 ? i : 0);
2472
+ if (O <= k) {
2473
+ b(l);
2473
2474
  return;
2474
2475
  }
2475
- const B = D[l].offsetWidth;
2476
- let P = 0, z = 0;
2477
- for (let N = 0; N < l; N++) {
2478
- const k = D[N].offsetWidth, A = P + k + (N > 0 ? i : 0);
2479
- if (A + B + i > y) break;
2480
- P = A, z++;
2476
+ const P = S[l].offsetWidth;
2477
+ let T = 0, z = 0;
2478
+ for (let w = 0; w < l; w++) {
2479
+ const g = S[w].offsetWidth, M = T + g + (w > 0 ? i : 0);
2480
+ if (M + P + i > k) break;
2481
+ T = M, z++;
2481
2482
  }
2482
- g(Math.max(1, z));
2483
- }, b = new ResizeObserver(h);
2484
- return b.observe(x), r?.current && b.observe(r.current), h(), () => b.disconnect();
2485
- }, [n, l, ...a]), c;
2483
+ b(Math.max(1, z));
2484
+ }, v = new ResizeObserver(h);
2485
+ return v.observe(R), r?.current && v.observe(r.current), h(), () => v.disconnect();
2486
+ }, [t, l, ...a]), c;
2486
2487
  }
2487
- const Tl = (t) => {
2488
+ const Ll = (n) => {
2488
2489
  const {
2489
- className: n,
2490
- label: s,
2491
- description: o,
2490
+ className: t,
2491
+ label: o,
2492
+ description: s,
2492
2493
  options: r,
2493
2494
  onChange: l,
2494
2495
  onSearch: a,
2495
2496
  value: i,
2496
2497
  placeholder: c,
2497
- maxHeight: g = 300,
2498
- error: x,
2499
- size: w = "md",
2498
+ maxHeight: b = 300,
2499
+ error: R,
2500
+ size: N = "md",
2500
2501
  singleLine: h = !1,
2501
- color: b = "blue",
2502
- disabled: p = !1,
2503
- clearable: m = !0
2504
- } = t, [v, u] = W(!1), [I, R] = W(r), [y, D] = W(""), [T, B] = W(null), P = C.useRef(null), z = C.useRef(null), N = C.useRef([]), k = C.useRef(null), A = C.useRef(null), O = ie(
2505
- () => i.map((S) => r.find((E) => H(E) && G(E.value, S))).filter((S) => S !== void 0),
2502
+ color: v = "blue",
2503
+ disabled: f = !1,
2504
+ clearable: p = !0
2505
+ } = n, [u, I] = W(!1), [x, y] = W(r), [k, S] = W(""), [O, P] = W(null), T = C.useRef(null), z = C.useRef(null), w = C.useRef([]), g = C.useRef(null), M = C.useRef(null), L = se(
2506
+ () => i.map((D) => r.find((F) => H(F) && G(F.value, D))).filter((D) => D !== void 0),
2506
2507
  [i, r]
2507
- ), $ = (S) => {
2508
- if (S === "") return r;
2509
- const E = S.toLowerCase();
2510
- return r.filter((Ie) => H(Ie) && typeof Ie.label == "string" ? Ie.label.toLowerCase().includes(E) : !0);
2511
- }, j = ie(
2512
- () => y !== "" ? I : r,
2513
- [y, I, r]
2514
- ), le = ie(
2515
- () => j.map((S, E) => !H(S) || S.disabled ? E : -1).filter((S) => S !== -1),
2508
+ ), $ = (D) => {
2509
+ if (D === "") return r;
2510
+ const F = D.toLowerCase();
2511
+ return r.filter((Ie) => H(Ie) && typeof Ie.label == "string" ? Ie.label.toLowerCase().includes(F) : !0);
2512
+ }, j = se(
2513
+ () => k !== "" ? x : r,
2514
+ [k, x, r]
2515
+ ), re = se(
2516
+ () => j.map((D, F) => !H(D) || D.disabled ? F : -1).filter((D) => D !== -1),
2516
2517
  [j]
2517
2518
  );
2518
- we(v, () => u(!1)), _(() => {
2519
- R((a ?? $)(y));
2520
- }, [y, r, a]), _(() => {
2521
- if (v) {
2519
+ xe(u, () => I(!1)), _(() => {
2520
+ y((a ?? $)(k));
2521
+ }, [k, r, a]), _(() => {
2522
+ if (u) {
2522
2523
  setTimeout(() => z.current?.focus(), 100);
2523
- const S = r.findIndex((E) => H(E) && !E.disabled);
2524
- B(S >= 0 ? S : null);
2524
+ const D = r.findIndex((F) => H(F) && !F.disabled);
2525
+ P(D >= 0 ? D : null);
2525
2526
  } else
2526
- B(null), D("");
2527
- }, [v]), _(() => {
2528
- if (!v) return;
2529
- const S = j.findIndex((E) => H(E) && !E.disabled);
2530
- B(S >= 0 ? S : null);
2531
- }, [y, v, j]);
2532
- const oe = Fr({
2527
+ P(null), S("");
2528
+ }, [u]), _(() => {
2529
+ if (!u) return;
2530
+ const D = j.findIndex((F) => H(F) && !F.disabled);
2531
+ P(D >= 0 ? D : null);
2532
+ }, [k, u, j]);
2533
+ const Ne = Br({
2533
2534
  enabled: h,
2534
- triggerRef: P,
2535
- measureRef: k,
2536
- trayRef: A,
2537
- itemCount: O.length,
2538
- deps: [O, x]
2539
- }), { anchorRef: L, Popover: U, getReferenceProps: se, getItemProps: ee } = _e({
2535
+ triggerRef: T,
2536
+ measureRef: g,
2537
+ trayRef: M,
2538
+ itemCount: L.length,
2539
+ deps: [L, R]
2540
+ }), { anchorRef: E, Popover: U, getReferenceProps: le, getItemProps: ee } = _e({
2540
2541
  placement: "bottom",
2541
2542
  fullWidth: !0,
2542
2543
  minWidth: 200,
2543
- onOutsideClick: () => u(!1),
2544
- open: v,
2545
- onOpenChange: u,
2546
- listRef: N,
2547
- activeIndex: T,
2548
- onNavigate: B,
2549
- disabledIndices: le
2550
- }), Oe = (S) => {
2551
- i.some((E) => G(E, S)) ? l(i.filter((E) => !G(E, S))) : l([...i, S]);
2552
- }, ze = (S) => {
2553
- const E = j[S];
2554
- E && H(E) && !E.disabled && Oe(E.value);
2555
- }, M = j.some((S) => H(S)), F = i.length > 0, ae = h ? oe : O.length, ge = O.slice(0, ae), mt = O.length - ae;
2556
- return /* @__PURE__ */ e(Q.Provider, { value: w, children: /* @__PURE__ */ d(
2544
+ open: u,
2545
+ onOpenChange: I,
2546
+ listRef: w,
2547
+ activeIndex: O,
2548
+ onNavigate: P,
2549
+ disabledIndices: re
2550
+ }), Oe = (D) => {
2551
+ i.some((F) => G(F, D)) ? l(i.filter((F) => !G(F, D))) : l([...i, D]);
2552
+ }, ze = (D) => {
2553
+ const F = j[D];
2554
+ F && H(F) && !F.disabled && Oe(F.value);
2555
+ }, B = j.some((D) => H(D)), A = i.length > 0, oe = h ? Ne : L.length, pe = L.slice(0, oe), ut = L.length - oe;
2556
+ return /* @__PURE__ */ e(Q.Provider, { value: N, children: /* @__PURE__ */ d(
2557
2557
  "div",
2558
2558
  {
2559
- className: f(
2559
+ className: m(
2560
2560
  "flex flex-col",
2561
- n
2561
+ t
2562
2562
  ),
2563
2563
  children: [
2564
- /* @__PURE__ */ e(q, { children: s }),
2565
- /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: L, children: [
2564
+ /* @__PURE__ */ e(Y, { children: o }),
2565
+ /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: E, children: [
2566
2566
  /* @__PURE__ */ d(
2567
2567
  "div",
2568
2568
  {
2569
- ...se({
2570
- ref: P,
2569
+ ...le({
2570
+ ref: T,
2571
2571
  role: "button",
2572
- tabIndex: p ? -1 : 0,
2573
- "aria-disabled": p,
2572
+ tabIndex: f ? -1 : 0,
2573
+ "aria-disabled": f,
2574
2574
  onClick: () => {
2575
- p || u(!v);
2575
+ f || I(!u);
2576
2576
  },
2577
- onKeyDown: (S) => {
2578
- p || (S.key === " " ? (S.preventDefault(), u((E) => !E)) : S.key === "Enter" && !v ? (S.preventDefault(), u(!0)) : S.key === "Backspace" && !v && F && (S.preventDefault(), l(i.slice(0, -1))));
2577
+ onKeyDown: (D) => {
2578
+ f || (D.key === " " ? (D.preventDefault(), I((F) => !F)) : D.key === "Enter" && !u ? (D.preventDefault(), I(!0)) : D.key === "Backspace" && !u && A && (D.preventDefault(), l(i.slice(0, -1))));
2579
2579
  }
2580
2580
  }),
2581
- className: f(
2581
+ className: m(
2582
2582
  "flex flex-row items-center gap-1 border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",
2583
- h && f("flex-nowrap overflow-hidden", ne[w]),
2584
- !h && f("flex-wrap py-1.5", Pt[w]),
2585
- Y[w],
2586
- fe[w],
2587
- m && F ? Be[w] : he[w],
2588
- p ? "select-trigger-disabled" : x && "select-trigger-error",
2589
- !p && v && "ring-4"
2583
+ h && m("flex-nowrap overflow-hidden", te[N]),
2584
+ !h && m("flex-wrap py-1.5", Ft[N]),
2585
+ J[N],
2586
+ me[N],
2587
+ p && A ? Be[N] : fe[N],
2588
+ f ? "select-trigger-disabled" : R && "select-trigger-error",
2589
+ !f && u && "ring-4"
2590
2590
  ),
2591
2591
  children: [
2592
- F && ge.map((S, E) => /* @__PURE__ */ e(
2592
+ A && pe.map((D, F) => /* @__PURE__ */ e(
2593
2593
  Ee,
2594
2594
  {
2595
- color: b,
2596
- className: f(
2597
- h && ae > 1 && "shrink-0",
2598
- (!h || ae === 1) && "max-w-full min-w-0"
2595
+ color: v,
2596
+ className: m(
2597
+ h && oe > 1 && "shrink-0",
2598
+ (!h || oe === 1) && "max-w-full min-w-0"
2599
2599
  ),
2600
- children: S.label
2600
+ children: D.label
2601
2601
  },
2602
- `badge-${E}`
2602
+ `badge-${F}`
2603
2603
  )),
2604
- F && mt > 0 && /* @__PURE__ */ d("span", { className: "shrink-0 text-sm font-medium select-placeholder px-1", children: [
2604
+ A && ut > 0 && /* @__PURE__ */ d("span", { className: "shrink-0 text-sm font-medium select-placeholder px-1", children: [
2605
2605
  "+",
2606
- mt,
2606
+ ut,
2607
2607
  " more"
2608
2608
  ] }),
2609
- !F && c && /* @__PURE__ */ e("span", { className: "select-placeholder", children: c })
2609
+ !A && c && /* @__PURE__ */ e("span", { className: "select-placeholder", children: c })
2610
2610
  ]
2611
2611
  }
2612
2612
  ),
2613
2613
  h && /* @__PURE__ */ d(
2614
2614
  "div",
2615
2615
  {
2616
- ref: k,
2616
+ ref: g,
2617
2617
  "aria-hidden": !0,
2618
2618
  className: "absolute top-0 left-0 invisible pointer-events-none flex flex-row flex-nowrap items-center gap-1 w-max",
2619
2619
  children: [
2620
- O.map((S, E) => /* @__PURE__ */ e(Ee, { color: b, children: S.label }, `measure-${E}`)),
2621
- O.length > 0 && /* @__PURE__ */ d("span", { className: "text-sm font-medium px-1", children: [
2620
+ L.map((D, F) => /* @__PURE__ */ e(Ee, { color: v, children: D.label }, `measure-${F}`)),
2621
+ L.length > 0 && /* @__PURE__ */ d("span", { className: "text-sm font-medium px-1", children: [
2622
2622
  "+",
2623
- O.length,
2623
+ L.length,
2624
2624
  " more"
2625
2625
  ] })
2626
2626
  ]
2627
2627
  }
2628
2628
  ),
2629
- /* @__PURE__ */ d(pe, { ref: A, children: [
2630
- !p && x && /* @__PURE__ */ e(re, {}),
2631
- m && F && !p && /* @__PURE__ */ e(Z, { Icon: ue, onClick: () => l([]) }),
2632
- /* @__PURE__ */ e(Z, { Icon: ve })
2629
+ /* @__PURE__ */ d(he, { ref: M, children: [
2630
+ !f && R && /* @__PURE__ */ e(ne, {}),
2631
+ p && A && !f && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => l([]) }),
2632
+ /* @__PURE__ */ e(Z, { Icon: be })
2633
2633
  ] }),
2634
- /* @__PURE__ */ e(U, { open: v, children: /* @__PURE__ */ d(xe, { className: "gap-0 !p-0", style: { maxHeight: g }, children: [
2634
+ /* @__PURE__ */ e(U, { open: u, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: b }, children: [
2635
2635
  /* @__PURE__ */ d("div", { className: "sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm", children: [
2636
2636
  /* @__PURE__ */ e(
2637
2637
  "input",
@@ -2639,170 +2639,170 @@ const Tl = (t) => {
2639
2639
  ref: z,
2640
2640
  type: "text",
2641
2641
  placeholder: "Search",
2642
- value: y,
2642
+ value: k,
2643
2643
  className: "appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",
2644
- onChange: (S) => D(S.target.value),
2645
- onKeyDown: (S) => {
2646
- S.key === "Enter" && T != null ? (S.preventDefault(), ze(T)) : S.key === "Backspace" && y === "" && F && (S.preventDefault(), l(i.slice(0, -1)));
2644
+ onChange: (D) => S(D.target.value),
2645
+ onKeyDown: (D) => {
2646
+ D.key === "Enter" && O != null ? (D.preventDefault(), ze(O)) : D.key === "Backspace" && k === "" && A && (D.preventDefault(), l(i.slice(0, -1)));
2647
2647
  }
2648
2648
  }
2649
2649
  ),
2650
- /* @__PURE__ */ e(Me, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
2650
+ /* @__PURE__ */ e(Fe, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
2651
2651
  ] }),
2652
2652
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
2653
- y !== "" && !M && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2654
- j.map((S, E) => {
2655
- if (!H(S))
2656
- return S.kind === "header" ? /* @__PURE__ */ e(
2653
+ k !== "" && !B && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2654
+ j.map((D, F) => {
2655
+ if (!H(D))
2656
+ return D.kind === "header" ? /* @__PURE__ */ e(
2657
2657
  He,
2658
2658
  {
2659
- ref: (be) => {
2660
- N.current[E] = be;
2659
+ ref: (ge) => {
2660
+ w.current[F] = ge;
2661
2661
  },
2662
- children: S.label
2662
+ children: D.label
2663
2663
  },
2664
- `header-${E}`
2664
+ `header-${F}`
2665
2665
  ) : /* @__PURE__ */ e(
2666
2666
  $e,
2667
2667
  {
2668
- ref: (be) => {
2669
- N.current[E] = be;
2668
+ ref: (ge) => {
2669
+ w.current[F] = ge;
2670
2670
  }
2671
2671
  },
2672
- `divider-${E}`
2672
+ `divider-${F}`
2673
2673
  );
2674
- const Ie = i.some((be) => G(be, S.value));
2674
+ const Ie = i.some((ge) => G(ge, D.value));
2675
2675
  return /* @__PURE__ */ e(
2676
2676
  We,
2677
2677
  {
2678
2678
  ...ee({
2679
- ref(be) {
2680
- N.current[E] = be;
2679
+ ref(ge) {
2680
+ w.current[F] = ge;
2681
2681
  }
2682
2682
  }),
2683
- onClick: () => ze(E),
2683
+ onClick: () => ze(F),
2684
2684
  selected: Ie,
2685
- active: T === E,
2686
- disabled: S.disabled,
2687
- children: S.label
2685
+ active: O === F,
2686
+ disabled: D.disabled,
2687
+ children: D.label
2688
2688
  },
2689
- `option-${E}`
2689
+ `option-${F}`
2690
2690
  );
2691
2691
  })
2692
2692
  ] })
2693
2693
  ] }) })
2694
2694
  ] }),
2695
- /* @__PURE__ */ e(V, { children: o }),
2696
- /* @__PURE__ */ e(K, { children: x })
2695
+ /* @__PURE__ */ e(V, { children: s }),
2696
+ /* @__PURE__ */ e(K, { children: R })
2697
2697
  ]
2698
2698
  }
2699
2699
  ) });
2700
- }, Ll = C.forwardRef((t, n) => {
2700
+ }, Pl = C.forwardRef((n, t) => {
2701
2701
  const {
2702
- className: s,
2703
- children: o,
2702
+ className: o,
2703
+ children: s,
2704
2704
  ...r
2705
- } = t;
2705
+ } = n;
2706
2706
  return /* @__PURE__ */ e(
2707
2707
  "div",
2708
2708
  {
2709
- ref: n,
2710
- className: f(
2709
+ ref: t,
2710
+ className: m(
2711
2711
  "flex flex-col gap-6 border panel-base rounded-2xl shadow-sm px-6 py-6",
2712
- s
2712
+ o
2713
2713
  ),
2714
2714
  ...r,
2715
- children: o
2715
+ children: s
2716
2716
  }
2717
2717
  );
2718
- }), Pl = C.forwardRef((t, n) => {
2718
+ }), El = C.forwardRef((n, t) => {
2719
2719
  const {
2720
- className: s,
2721
- children: o,
2720
+ className: o,
2721
+ children: s,
2722
2722
  ...r
2723
- } = t;
2723
+ } = n;
2724
2724
  return /* @__PURE__ */ e(
2725
2725
  "div",
2726
2726
  {
2727
- ref: n,
2728
- className: f(
2727
+ ref: t,
2728
+ className: m(
2729
2729
  "flex flex-col gap-1 border panel-base rounded-2xl shadow-sm p-2",
2730
- s
2730
+ o
2731
2731
  ),
2732
2732
  ...r,
2733
- children: o
2733
+ children: s
2734
2734
  }
2735
2735
  );
2736
- }), yt = "input-description text-sm font-medium", El = (t) => {
2736
+ }), yt = "input-description text-sm font-medium", Fl = (n) => {
2737
2737
  const {
2738
- className: n,
2739
- label: s,
2740
- children: o,
2738
+ className: t,
2739
+ label: o,
2740
+ children: s,
2741
2741
  orientation: r = "vertical",
2742
2742
  ...l
2743
- } = t;
2743
+ } = n;
2744
2744
  return r === "horizontal" ? /* @__PURE__ */ d(
2745
2745
  "div",
2746
2746
  {
2747
- className: f(
2747
+ className: m(
2748
2748
  "flex flex-row items-center gap-3 px-3 py-2",
2749
- n
2749
+ t
2750
2750
  ),
2751
2751
  ...l,
2752
2752
  children: [
2753
- /* @__PURE__ */ e("div", { className: f(yt, "w-1/2 line-clamp-1 break-all"), children: s }),
2754
- /* @__PURE__ */ e("div", { className: "w-1/2 line-clamp-1 break-all", children: o })
2753
+ /* @__PURE__ */ e("div", { className: m(yt, "w-1/2 line-clamp-1 break-all"), children: o }),
2754
+ /* @__PURE__ */ e("div", { className: "w-1/2 line-clamp-1 break-all", children: s })
2755
2755
  ]
2756
2756
  }
2757
2757
  ) : /* @__PURE__ */ d(
2758
2758
  "div",
2759
2759
  {
2760
- className: f(
2760
+ className: m(
2761
2761
  "flex flex-col gap-1 px-3 py-2",
2762
- n
2762
+ t
2763
2763
  ),
2764
2764
  ...l,
2765
2765
  children: [
2766
- s && /* @__PURE__ */ e("div", { className: yt, children: s }),
2767
- /* @__PURE__ */ e("div", { children: o })
2766
+ o && /* @__PURE__ */ e("div", { className: yt, children: o }),
2767
+ /* @__PURE__ */ e("div", { children: s })
2768
2768
  ]
2769
2769
  }
2770
2770
  );
2771
- }, Br = {
2771
+ }, Ar = {
2772
2772
  error: et,
2773
- warning: on,
2773
+ warning: an,
2774
2774
  success: tt,
2775
- info: ln
2776
- }, Ar = {
2775
+ info: sn
2776
+ }, Ur = {
2777
2777
  error: "text-[var(--color-status-error)]",
2778
2778
  warning: "text-[var(--color-status-warning)]",
2779
2779
  success: "text-[var(--color-status-success)]",
2780
2780
  info: "text-[var(--color-status-info)]"
2781
- }, Ct = "inline-flex flex-row gap-3 items-center justify-between h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent", Ml = (t) => {
2781
+ }, kt = "inline-flex flex-row gap-3 items-center justify-between h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent", Ml = (n) => {
2782
2782
  const {
2783
- className: n,
2784
- children: s,
2785
- Icon: o,
2783
+ className: t,
2784
+ children: o,
2785
+ Icon: s,
2786
2786
  status: r,
2787
2787
  ...l
2788
- } = t, a = r ? Br[r] : null, i = /* @__PURE__ */ d(te, { children: [
2788
+ } = n, a = r ? Ar[r] : null, i = /* @__PURE__ */ d(ce, { children: [
2789
2789
  /* @__PURE__ */ d("span", { className: "inline-flex flex-row items-center gap-3 min-w-0", children: [
2790
- o && /* @__PURE__ */ e(o, { className: "h-5 w-5 shrink-0" }),
2791
- /* @__PURE__ */ e("span", { className: "truncate", children: s })
2790
+ s && /* @__PURE__ */ e(s, { className: "h-5 w-5 shrink-0" }),
2791
+ /* @__PURE__ */ e("span", { className: "truncate", children: o })
2792
2792
  ] }),
2793
2793
  /* @__PURE__ */ d("span", { className: "inline-flex flex-row items-center gap-2 shrink-0", children: [
2794
- a && r && /* @__PURE__ */ e(a, { className: f("h-5 w-5", Ar[r]) }),
2795
- /* @__PURE__ */ e(sn, { className: "h-5 w-5 text-[var(--color-input-icon-button-icon)]" })
2794
+ a && r && /* @__PURE__ */ e(a, { className: m("h-5 w-5", Ur[r]) }),
2795
+ /* @__PURE__ */ e(cn, { className: "h-5 w-5 text-[var(--color-input-icon-button-icon)]" })
2796
2796
  ] })
2797
2797
  ] });
2798
2798
  if (l.href !== void 0) {
2799
- const { href: c, ...g } = l;
2799
+ const { href: c, ...b } = l;
2800
2800
  return /* @__PURE__ */ e(
2801
2801
  "a",
2802
2802
  {
2803
2803
  href: c,
2804
- className: f(Ct, n),
2805
- ...g,
2804
+ className: m(kt, t),
2805
+ ...b,
2806
2806
  children: i
2807
2807
  }
2808
2808
  );
@@ -2810,36 +2810,36 @@ const Tl = (t) => {
2810
2810
  return /* @__PURE__ */ e(
2811
2811
  "button",
2812
2812
  {
2813
- className: f(Ct, n),
2813
+ className: m(kt, t),
2814
2814
  ...l,
2815
2815
  children: i
2816
2816
  }
2817
2817
  );
2818
- }, Fl = (t) => {
2818
+ }, Bl = (n) => {
2819
2819
  const {
2820
- className: n,
2821
- vertical: s = !1,
2822
- ...o
2823
- } = t;
2820
+ className: t,
2821
+ vertical: o = !1,
2822
+ ...s
2823
+ } = n;
2824
2824
  return /* @__PURE__ */ e(
2825
2825
  "div",
2826
2826
  {
2827
- className: f(
2828
- s ? "w-px h-full bg-[var(--color-divider)]" : "w-full h-px bg-[var(--color-divider)]",
2829
- n
2827
+ className: m(
2828
+ o ? "w-px h-full bg-[var(--color-divider)]" : "w-full h-px bg-[var(--color-divider)]",
2829
+ t
2830
2830
  ),
2831
- ...o
2831
+ ...s
2832
2832
  }
2833
2833
  );
2834
- }, Bl = (t) => {
2834
+ }, Al = (n) => {
2835
2835
  const {
2836
- children: n,
2837
- content: s,
2838
- className: o,
2836
+ children: t,
2837
+ content: o,
2838
+ className: s,
2839
2839
  placement: r = "top",
2840
2840
  minWidth: l = 100,
2841
2841
  maxWidth: a = 200
2842
- } = t, [i, c] = W(!1), { anchorRef: g, Popover: x } = dt({
2842
+ } = n, [i, c] = W(!1), { anchorRef: b, Popover: R } = ct({
2843
2843
  placement: r,
2844
2844
  minWidth: l,
2845
2845
  maxWidth: a
@@ -2847,31 +2847,31 @@ const Tl = (t) => {
2847
2847
  return /* @__PURE__ */ d(
2848
2848
  "span",
2849
2849
  {
2850
- ref: g,
2851
- className: o,
2850
+ ref: b,
2851
+ className: s,
2852
2852
  onMouseEnter: () => c(!0),
2853
2853
  onMouseLeave: () => c(!1),
2854
2854
  children: [
2855
- n,
2856
- /* @__PURE__ */ e(x, { open: i, children: /* @__PURE__ */ e(xe, { children: s }) })
2855
+ t,
2856
+ /* @__PURE__ */ e(R, { open: i, children: /* @__PURE__ */ e(ve, { children: o }) })
2857
2857
  ]
2858
2858
  }
2859
2859
  );
2860
- }, Al = (t) => {
2860
+ }, Ul = (n) => {
2861
2861
  const {
2862
- open: n,
2863
- onDismiss: s,
2864
- enableDismissOnOutsideClick: o,
2862
+ open: t,
2863
+ onDismiss: o,
2864
+ enableDismissOnOutsideClick: s,
2865
2865
  enableDismissOnEscKey: r,
2866
2866
  enableDismissButton: l,
2867
2867
  className: a,
2868
2868
  children: i,
2869
2869
  maxWidth: c = 600
2870
- } = t;
2871
- return we(!!r && n, s || (() => {
2872
- })), /* @__PURE__ */ e(De, { children: n && /* @__PURE__ */ d(Fe, { children: [
2870
+ } = n;
2871
+ return xe(!!r && t, o || (() => {
2872
+ })), /* @__PURE__ */ e(De, { children: t && /* @__PURE__ */ d(Me, { children: [
2873
2873
  /* @__PURE__ */ e(
2874
- J.div,
2874
+ q.div,
2875
2875
  {
2876
2876
  className: "z-40",
2877
2877
  style: { transformOrigin: "center" },
@@ -2880,19 +2880,19 @@ const Tl = (t) => {
2880
2880
  exit: { opacity: 0 },
2881
2881
  transition: { duration: 0.15, ease: "easeInOut" },
2882
2882
  children: /* @__PURE__ */ e(
2883
- rt,
2883
+ Ot,
2884
2884
  {
2885
2885
  className: "modal-overlay backdrop-blur-[1px]",
2886
- onClick: o ? s : void 0,
2886
+ onClick: s ? o : void 0,
2887
2887
  lockScroll: !0
2888
2888
  }
2889
2889
  )
2890
2890
  }
2891
2891
  ),
2892
2892
  /* @__PURE__ */ e("div", { className: "fixed inset-0 flex flex-col items-center pointer-events-none p-4 lg:p-12 overflow-y-auto z-50", children: /* @__PURE__ */ d(
2893
- J.div,
2893
+ q.div,
2894
2894
  {
2895
- className: f(
2895
+ className: m(
2896
2896
  "flex flex-col modal-content rounded-2xl shadow-xl p-6 lg:p-12 pointer-events-auto w-full relative",
2897
2897
  a
2898
2898
  ),
@@ -2903,13 +2903,13 @@ const Tl = (t) => {
2903
2903
  transition: { duration: 0.15, ease: "easeInOut" },
2904
2904
  children: [
2905
2905
  l && /* @__PURE__ */ e(
2906
- Bt,
2906
+ Ut,
2907
2907
  {
2908
- Icon: ue,
2908
+ Icon: de,
2909
2909
  className: "absolute top-4 right-4",
2910
2910
  variant: "transparent",
2911
2911
  size: "sm",
2912
- onClick: s
2912
+ onClick: o
2913
2913
  }
2914
2914
  ),
2915
2915
  i
@@ -2917,21 +2917,21 @@ const Tl = (t) => {
2917
2917
  }
2918
2918
  ) })
2919
2919
  ] }) });
2920
- }, Ul = (t) => {
2920
+ }, Wl = (n) => {
2921
2921
  const {
2922
- open: n,
2923
- onDismiss: s,
2924
- enableDismissOnOutsideClick: o,
2922
+ open: t,
2923
+ onDismiss: o,
2924
+ enableDismissOnOutsideClick: s,
2925
2925
  enableDismissOnEscKey: r,
2926
2926
  enableDismissButton: l,
2927
2927
  className: a,
2928
2928
  children: i,
2929
2929
  maxWidth: c = 480
2930
- } = t;
2931
- return we(!!r && n, s || (() => {
2932
- })), /* @__PURE__ */ e(De, { children: n && /* @__PURE__ */ d(Fe, { children: [
2930
+ } = n;
2931
+ return xe(!!r && t, o || (() => {
2932
+ })), /* @__PURE__ */ e(De, { children: t && /* @__PURE__ */ d(Me, { children: [
2933
2933
  /* @__PURE__ */ e(
2934
- J.div,
2934
+ q.div,
2935
2935
  {
2936
2936
  className: "z-40",
2937
2937
  style: { transformOrigin: "center" },
@@ -2940,19 +2940,19 @@ const Tl = (t) => {
2940
2940
  exit: { opacity: 0 },
2941
2941
  transition: { duration: 0.15, ease: "easeInOut" },
2942
2942
  children: /* @__PURE__ */ e(
2943
- rt,
2943
+ Ot,
2944
2944
  {
2945
2945
  className: "modal-overlay backdrop-blur-[1px]",
2946
- onClick: o ? s : void 0,
2946
+ onClick: s ? o : void 0,
2947
2947
  lockScroll: !0
2948
2948
  }
2949
2949
  )
2950
2950
  }
2951
2951
  ),
2952
2952
  /* @__PURE__ */ e("div", { className: "fixed inset-0 flex flex-row justify-end pointer-events-none z-50", children: /* @__PURE__ */ d(
2953
- J.div,
2953
+ q.div,
2954
2954
  {
2955
- className: f(
2955
+ className: m(
2956
2956
  "flex flex-col modal-content shadow-xl p-6 lg:p-12 pointer-events-auto h-full w-full overflow-y-auto relative",
2957
2957
  a
2958
2958
  ),
@@ -2963,13 +2963,13 @@ const Tl = (t) => {
2963
2963
  transition: { duration: 0.25, ease: [0.32, 0.72, 0, 1] },
2964
2964
  children: [
2965
2965
  l && /* @__PURE__ */ e(
2966
- Bt,
2966
+ Ut,
2967
2967
  {
2968
- Icon: ue,
2968
+ Icon: de,
2969
2969
  className: "absolute top-4 right-4",
2970
2970
  variant: "transparent",
2971
2971
  size: "sm",
2972
- onClick: s
2972
+ onClick: o
2973
2973
  }
2974
2974
  ),
2975
2975
  i
@@ -2977,27 +2977,27 @@ const Tl = (t) => {
2977
2977
  }
2978
2978
  ) })
2979
2979
  ] }) });
2980
- }, Ur = (t) => {
2980
+ }, Wr = (n) => {
2981
2981
  const {
2982
- className: n,
2983
- tabs: s
2984
- } = t;
2985
- return /* @__PURE__ */ e("div", { className: f(
2982
+ className: t,
2983
+ tabs: o
2984
+ } = n;
2985
+ return /* @__PURE__ */ e("div", { className: m(
2986
2986
  "h-12 tab-container p-1 rounded-xl inline-flex flex-row space-x-1 overflow-x-auto mat-ui-hide-scrollbars",
2987
- n
2988
- ), children: s.map((o, r) => {
2989
- const l = f(
2987
+ t
2988
+ ), children: o.map((s, r) => {
2989
+ const l = m(
2990
2990
  "shrink-0 px-4 h-full inline-flex flex-row items-center font-semibold rounded-xl cursor-pointer border border-transparent ing-0 tab-button transition-all duration-150 select-none focus:outline-none focus:ring-0",
2991
- o.active && "tab-button-active shadow-sm"
2991
+ s.active && "tab-button-active shadow-sm"
2992
2992
  );
2993
- return o.href ? /* @__PURE__ */ d(
2993
+ return s.href ? /* @__PURE__ */ d(
2994
2994
  "a",
2995
2995
  {
2996
- href: o.href,
2996
+ href: s.href,
2997
2997
  className: l,
2998
2998
  children: [
2999
- o.Icon && /* @__PURE__ */ e(o.Icon, { className: "h-5 w-5 shrink-0 mr-2 -ml-1" }),
3000
- o.label
2999
+ s.Icon && /* @__PURE__ */ e(s.Icon, { className: "h-5 w-5 shrink-0 mr-2 -ml-1" }),
3000
+ s.label
3001
3001
  ]
3002
3002
  },
3003
3003
  r
@@ -3005,158 +3005,177 @@ const Tl = (t) => {
3005
3005
  "button",
3006
3006
  {
3007
3007
  className: l,
3008
- onClick: o.onClick,
3008
+ onClick: s.onClick,
3009
3009
  children: [
3010
- o.Icon && /* @__PURE__ */ e(o.Icon, { className: "h-5 w-5 shrink-0 mr-2 -ml-1" }),
3011
- o.label
3010
+ s.Icon && /* @__PURE__ */ e(s.Icon, { className: "h-5 w-5 shrink-0 mr-2 -ml-1" }),
3011
+ s.label
3012
3012
  ]
3013
3013
  },
3014
3014
  r
3015
3015
  );
3016
3016
  }) });
3017
- }, Wl = (t) => {
3017
+ }, Hl = (n) => {
3018
3018
  const {
3019
- duration: n = 0.3,
3020
- ease: s = "easeInOut",
3021
- horizontal: o = !1,
3022
- children: r,
3023
- className: l,
3024
- ...a
3025
- } = t, i = C.useRef(null), c = C.useRef(null), g = C.useRef(null);
3026
- return C.useEffect(() => {
3027
- const x = i.current, w = c.current;
3028
- if (!x || !w) return;
3029
- let h = !0;
3030
- const b = () => {
3031
- const m = o ? x.scrollWidth - x.clientWidth : x.scrollHeight - x.clientHeight, v = o ? x.scrollLeft : x.scrollTop;
3032
- if (!(m <= 0 || Math.abs(m - v) < 1)) {
3033
- if (h) {
3034
- h = !1, o ? x.scrollLeft = m : x.scrollTop = m;
3019
+ duration: t = 0.3,
3020
+ ease: o = "easeInOut",
3021
+ horizontal: s = !1,
3022
+ pauseOnScroll: r = !1,
3023
+ threshold: l = 1,
3024
+ onPinnedChange: a,
3025
+ children: i,
3026
+ className: c,
3027
+ ...b
3028
+ } = n, R = C.useRef(null), N = C.useRef(null), h = C.useRef(null), v = C.useRef(!0), f = C.useRef(!1), p = C.useRef(a);
3029
+ return p.current = a, C.useEffect(() => {
3030
+ const u = R.current, I = N.current;
3031
+ if (!u || !I) return;
3032
+ let x = !0;
3033
+ const y = () => s ? u.scrollWidth - u.clientWidth : u.scrollHeight - u.clientHeight, k = () => s ? u.scrollLeft : u.scrollTop, S = (g) => {
3034
+ s ? u.scrollLeft = g : u.scrollTop = g;
3035
+ }, O = (g) => {
3036
+ v.current !== g && (v.current = g, p.current?.(g));
3037
+ }, P = () => {
3038
+ if (r && !v.current) return;
3039
+ const g = y(), M = k();
3040
+ if (!(g <= 0 || Math.abs(g - M) < 1)) {
3041
+ if (x) {
3042
+ x = !1, f.current = !0, S(g), requestAnimationFrame(() => {
3043
+ f.current = !1;
3044
+ });
3035
3045
  return;
3036
3046
  }
3037
- g.current?.stop(), g.current = Xt(v, m, {
3038
- duration: n,
3039
- ease: s,
3040
- onUpdate: (u) => {
3041
- o ? x.scrollLeft = u : x.scrollTop = u;
3047
+ h.current?.stop(), f.current = !0, h.current = Kt(M, g, {
3048
+ duration: t,
3049
+ ease: o,
3050
+ onUpdate: S,
3051
+ onComplete: () => {
3052
+ requestAnimationFrame(() => {
3053
+ f.current = !1;
3054
+ });
3042
3055
  }
3043
3056
  });
3044
3057
  }
3045
- }, p = new ResizeObserver(b);
3046
- return p.observe(w), () => {
3047
- p.disconnect(), g.current?.stop();
3058
+ }, T = new ResizeObserver(P);
3059
+ T.observe(I);
3060
+ const z = () => {
3061
+ f.current || O(y() - k() <= l);
3062
+ }, w = () => {
3063
+ h.current?.stop(), f.current = !1;
3064
+ };
3065
+ return r && (u.addEventListener("scroll", z, { passive: !0 }), u.addEventListener("wheel", w, { passive: !0 }), u.addEventListener("touchstart", w, { passive: !0 })), () => {
3066
+ T.disconnect(), h.current?.stop(), r && (u.removeEventListener("scroll", z), u.removeEventListener("wheel", w), u.removeEventListener("touchstart", w));
3048
3067
  };
3049
- }, [n, s, o]), /* @__PURE__ */ e(
3068
+ }, [t, o, s, r, l]), /* @__PURE__ */ e(
3050
3069
  "div",
3051
3070
  {
3052
- ref: i,
3053
- className: f(
3071
+ ref: R,
3072
+ className: m(
3054
3073
  "min-h-0 min-w-0",
3055
- o ? "overflow-x-auto" : "overflow-y-auto",
3056
- l
3074
+ s ? "overflow-x-auto" : "overflow-y-auto",
3075
+ c
3057
3076
  ),
3058
- ...a,
3059
- children: /* @__PURE__ */ e("div", { ref: c, children: r })
3077
+ ...b,
3078
+ children: /* @__PURE__ */ e("div", { ref: N, children: i })
3060
3079
  }
3061
3080
  );
3062
3081
  };
3063
- function Wr(t) {
3082
+ function Hr(n) {
3064
3083
  const {
3065
- onDelta: n,
3066
- onDragStart: s,
3067
- onDragEnd: o,
3084
+ onDelta: t,
3085
+ onDragStart: o,
3086
+ onDragEnd: s,
3068
3087
  disabled: r = !1,
3069
3088
  primaryButtonOnly: l = !0,
3070
3089
  preventScrollOnMove: a = !0
3071
- } = t, [i, c] = C.useState(!1), g = C.useRef(!1), x = C.useRef(0), w = C.useRef(0), h = C.useRef(0), b = C.useRef(null), p = C.useRef(null), m = C.useRef({ onDelta: n, onDragStart: s, onDragEnd: o, preventScrollOnMove: a });
3090
+ } = n, [i, c] = C.useState(!1), b = C.useRef(!1), R = C.useRef(0), N = C.useRef(0), h = C.useRef(0), v = C.useRef(null), f = C.useRef(null), p = C.useRef({ onDelta: t, onDragStart: o, onDragEnd: s, preventScrollOnMove: a });
3072
3091
  C.useEffect(() => {
3073
- m.current = { onDelta: n, onDragStart: s, onDragEnd: o, preventScrollOnMove: a };
3092
+ p.current = { onDelta: t, onDragStart: o, onDragEnd: s, preventScrollOnMove: a };
3074
3093
  });
3075
- const v = C.useRef({}), u = C.useCallback((R) => {
3076
- if (!g.current) return;
3077
- const y = {
3078
- clientX: R ?? w.current,
3079
- startX: x.current,
3094
+ const u = C.useRef({}), I = C.useCallback((y) => {
3095
+ if (!b.current) return;
3096
+ const k = {
3097
+ clientX: y ?? N.current,
3098
+ startX: R.current,
3080
3099
  totalDeltaX: h.current,
3081
- target: b.current
3100
+ target: v.current
3082
3101
  };
3083
- g.current = !1, c(!1);
3084
- const { move: D, up: T, keydown: B } = v.current;
3085
- D && window.removeEventListener("pointermove", D, !0), T && (window.removeEventListener("pointerup", T, !0), window.removeEventListener("pointercancel", T, !0)), B && window.removeEventListener("keydown", B, !0), v.current = {}, p.current != null && (cancelAnimationFrame(p.current), p.current = null), m.current.onDragEnd?.(y), b.current = null, h.current = 0;
3086
- }, []), I = C.useCallback((R) => {
3087
- if (r || l && R.button !== 0) return;
3088
- R.target.setPointerCapture?.(R.pointerId), x.current = R.clientX, w.current = R.clientX, h.current = 0, b.current = R.target, g.current = !0, c(!0);
3089
- const y = {
3090
- clientX: R.clientX,
3091
- startX: R.clientX,
3102
+ b.current = !1, c(!1);
3103
+ const { move: S, up: O, keydown: P } = u.current;
3104
+ S && window.removeEventListener("pointermove", S, !0), O && (window.removeEventListener("pointerup", O, !0), window.removeEventListener("pointercancel", O, !0)), P && window.removeEventListener("keydown", P, !0), u.current = {}, f.current != null && (cancelAnimationFrame(f.current), f.current = null), p.current.onDragEnd?.(k), v.current = null, h.current = 0;
3105
+ }, []), x = C.useCallback((y) => {
3106
+ if (r || l && y.button !== 0) return;
3107
+ y.target.setPointerCapture?.(y.pointerId), R.current = y.clientX, N.current = y.clientX, h.current = 0, v.current = y.target, b.current = !0, c(!0);
3108
+ const k = {
3109
+ clientX: y.clientX,
3110
+ startX: y.clientX,
3092
3111
  totalDeltaX: 0,
3093
- target: R.target
3112
+ target: y.target
3094
3113
  };
3095
- m.current.onDragStart?.(y);
3096
- const D = (P) => {
3097
- g.current && p.current == null && (p.current = requestAnimationFrame(() => {
3098
- p.current = null;
3099
- const z = P.clientX, N = z - w.current;
3100
- if (N === 0) return;
3101
- w.current = z, h.current += N;
3102
- const k = {
3114
+ p.current.onDragStart?.(k);
3115
+ const S = (T) => {
3116
+ b.current && f.current == null && (f.current = requestAnimationFrame(() => {
3117
+ f.current = null;
3118
+ const z = T.clientX, w = z - N.current;
3119
+ if (w === 0) return;
3120
+ N.current = z, h.current += w;
3121
+ const g = {
3103
3122
  clientX: z,
3104
- startX: x.current,
3123
+ startX: R.current,
3105
3124
  totalDeltaX: h.current,
3106
- target: b.current
3125
+ target: v.current
3107
3126
  };
3108
- m.current.preventScrollOnMove && P.preventDefault(), m.current.onDelta(N, k);
3127
+ p.current.preventScrollOnMove && T.preventDefault(), p.current.onDelta(w, g);
3109
3128
  }));
3110
- }, T = (P) => {
3111
- u(P.clientX);
3112
- }, B = (P) => {
3113
- P.key === "Escape" && (P.preventDefault(), u());
3129
+ }, O = (T) => {
3130
+ I(T.clientX);
3131
+ }, P = (T) => {
3132
+ T.key === "Escape" && (T.preventDefault(), I());
3114
3133
  };
3115
- v.current = { move: D, up: T, keydown: B }, window.addEventListener("pointermove", D, {
3134
+ u.current = { move: S, up: O, keydown: P }, window.addEventListener("pointermove", S, {
3116
3135
  passive: !a,
3117
3136
  capture: !0
3118
- }), window.addEventListener("pointerup", T, { capture: !0 }), window.addEventListener("pointercancel", T, { capture: !0 }), window.addEventListener("keydown", B, !0);
3119
- }, [u, r, a, l]);
3137
+ }), window.addEventListener("pointerup", O, { capture: !0 }), window.addEventListener("pointercancel", O, { capture: !0 }), window.addEventListener("keydown", P, !0);
3138
+ }, [I, r, a, l]);
3120
3139
  return C.useEffect(() => () => {
3121
- g.current && u();
3122
- }, [u]), {
3140
+ b.current && I();
3141
+ }, [I]), {
3123
3142
  isDragging: i,
3124
3143
  bind: {
3125
- onPointerDown: I,
3144
+ onPointerDown: x,
3126
3145
  role: "separator",
3127
3146
  style: { touchAction: "none", cursor: "col-resize", userSelect: "none" }
3128
3147
  }
3129
3148
  };
3130
3149
  }
3131
- const Hr = (t) => {
3150
+ const $r = (n) => {
3132
3151
  const {
3133
- column: n,
3134
- width: s,
3135
- height: o,
3152
+ column: t,
3153
+ width: o,
3154
+ height: s,
3136
3155
  onResize: r,
3137
3156
  sortDirection: l,
3138
3157
  onSortClick: a
3139
- } = t, i = !!n.sortable, { bind: c } = Wr({
3140
- onDelta: (g) => r(g)
3158
+ } = n, i = !!t.sortable, { bind: c } = Hr({
3159
+ onDelta: (b) => r(b)
3141
3160
  });
3142
3161
  return /* @__PURE__ */ d(
3143
3162
  "div",
3144
3163
  {
3145
- style: { width: s, height: o },
3164
+ style: { width: o, height: s },
3146
3165
  className: "flex flex-row items-stretch select-none shrink-0",
3147
3166
  children: [
3148
3167
  /* @__PURE__ */ d(
3149
3168
  "div",
3150
3169
  {
3151
- className: f(
3170
+ className: m(
3152
3171
  "flex-1 min-w-0 px-4 table-header-cell transition-colors duration-100 flex flex-row items-center gap-2",
3153
3172
  i && "cursor-pointer"
3154
3173
  ),
3155
3174
  onClick: i ? a : void 0,
3156
3175
  children: [
3157
- /* @__PURE__ */ e("span", { className: "truncate", children: n.header }),
3158
- i && l === "asc" && /* @__PURE__ */ e(an, { className: "h-4 w-4 shrink-0" }),
3159
- i && l === "desc" && /* @__PURE__ */ e(ve, { className: "h-4 w-4 shrink-0" })
3176
+ /* @__PURE__ */ e("span", { className: "truncate", children: t.header }),
3177
+ i && l === "asc" && /* @__PURE__ */ e(dn, { className: "h-4 w-4 shrink-0" }),
3178
+ i && l === "desc" && /* @__PURE__ */ e(be, { className: "h-4 w-4 shrink-0" })
3160
3179
  ]
3161
3180
  }
3162
3181
  ),
@@ -3176,78 +3195,79 @@ const Hr = (t) => {
3176
3195
  ]
3177
3196
  }
3178
3197
  );
3179
- }, ye = 200, $r = 60, _r = (t) => {
3180
- const n = {};
3181
- for (const s of t)
3182
- n[s.id] = s.defaultWidth ?? ye;
3183
- return n;
3184
- }, jr = (t) => {
3198
+ }, ke = 200, _r = 60, jr = (n) => {
3199
+ const t = {};
3200
+ for (const o of n)
3201
+ t[o.id] = o.defaultWidth ?? ke;
3202
+ return t;
3203
+ }, Xr = (n) => {
3185
3204
  const {
3186
- columns: n,
3187
- rows: s,
3188
- getRowId: o,
3205
+ columns: t,
3206
+ rows: o,
3207
+ getRowId: s,
3189
3208
  onRowClick: r,
3190
3209
  sort: l,
3191
3210
  onSortChange: a,
3192
3211
  className: i,
3193
3212
  rowHeight: c = 44,
3194
- headerHeight: g = 44
3195
- } = t, [x, w] = W(() => _r(n));
3213
+ headerHeight: b = 44,
3214
+ emptyState: R
3215
+ } = n, [N, h] = W(() => jr(t));
3196
3216
  _(() => {
3197
- w((u) => {
3198
- const I = {};
3199
- let R = Object.keys(u).length !== n.length;
3200
- for (const y of n)
3201
- y.id in u ? I[y.id] = u[y.id] : (I[y.id] = y.defaultWidth ?? ye, R = !0);
3202
- return R ? I : u;
3217
+ h((x) => {
3218
+ const y = {};
3219
+ let k = Object.keys(x).length !== t.length;
3220
+ for (const S of t)
3221
+ S.id in x ? y[S.id] = x[S.id] : (y[S.id] = S.defaultWidth ?? ke, k = !0);
3222
+ return k ? y : x;
3203
3223
  });
3204
- }, [n]);
3205
- const h = Le((u, I, R) => {
3206
- w((y) => {
3207
- const D = y[u] ?? ye, T = Math.max(R, D + I);
3208
- return T === D ? y : { ...y, [u]: T };
3224
+ }, [t]);
3225
+ const v = Le((x, y, k) => {
3226
+ h((S) => {
3227
+ const O = S[x] ?? ke, P = Math.max(k, O + y);
3228
+ return P === O ? S : { ...S, [x]: P };
3209
3229
  });
3210
- }, []), b = Le((u) => {
3230
+ }, []), f = Le((x) => {
3211
3231
  if (a) {
3212
- if (!l || l.columnId !== u) {
3213
- a({ columnId: u, direction: "asc" });
3232
+ if (!l || l.columnId !== x) {
3233
+ a({ columnId: x, direction: "asc" });
3214
3234
  return;
3215
3235
  }
3216
3236
  if (l.direction === "asc") {
3217
- a({ columnId: u, direction: "desc" });
3237
+ a({ columnId: x, direction: "desc" });
3218
3238
  return;
3219
3239
  }
3220
3240
  a(null);
3221
3241
  }
3222
- }, [l, a]), p = n.reduce(
3223
- (u, I) => u + (x[I.id] ?? I.defaultWidth ?? ye),
3242
+ }, [l, a]), p = t.reduce(
3243
+ (x, y) => x + (N[y.id] ?? y.defaultWidth ?? ke),
3224
3244
  0
3225
- ), m = Ce(null), v = (u) => {
3226
- m.current && (m.current.scrollLeft = u.currentTarget.scrollLeft);
3245
+ ), u = Ce(null), I = (x) => {
3246
+ u.current && (u.current.scrollLeft = x.currentTarget.scrollLeft);
3227
3247
  };
3228
- return /* @__PURE__ */ d("div", { className: f("flex flex-col h-full w-full", i), children: [
3248
+ return /* @__PURE__ */ d("div", { className: m("flex flex-col h-full w-full", i), children: [
3229
3249
  /* @__PURE__ */ e(
3230
3250
  "div",
3231
3251
  {
3232
- ref: m,
3252
+ ref: u,
3233
3253
  className: "overflow-hidden shrink-0 table-header-strip",
3234
- style: { height: g },
3254
+ style: { height: b },
3235
3255
  children: /* @__PURE__ */ e(
3236
3256
  "div",
3237
3257
  {
3238
3258
  className: "flex flex-row table-header font-medium",
3239
3259
  style: { width: p, minWidth: "100%" },
3240
- children: n.map((u) => /* @__PURE__ */ e(
3241
- Hr,
3260
+ children: t.map((x) => /* @__PURE__ */ e(
3261
+ $r,
3242
3262
  {
3243
- column: u,
3244
- width: x[u.id] ?? u.defaultWidth ?? ye,
3245
- height: g,
3246
- onResize: (I) => h(u.id, I, u.minWidth ?? $r),
3247
- sortDirection: l?.columnId === u.id ? l.direction : null,
3248
- onSortClick: () => b(u.id)
3263
+ column: x,
3264
+ width: N[x.id] ?? x.defaultWidth ?? ke,
3265
+ height: b,
3266
+ onResize: (y) => v(x.id, y, x.minWidth ?? _r),
3267
+ sortDirection: l?.columnId === x.id ? l.direction : null,
3268
+ onSortClick: () => f(x.id)
3249
3269
  },
3250
- u.id
3270
+ x.id
3251
3271
  ))
3252
3272
  }
3253
3273
  )
@@ -3257,47 +3277,57 @@ const Hr = (t) => {
3257
3277
  "div",
3258
3278
  {
3259
3279
  className: "flex-1 overflow-auto",
3260
- onScroll: v,
3261
- children: /* @__PURE__ */ e(
3280
+ onScroll: I,
3281
+ children: o.length === 0 && R ? /* @__PURE__ */ e("div", { className: "flex h-full min-w-full items-center justify-center p-8", children: R }) : /* @__PURE__ */ e(
3262
3282
  "div",
3263
3283
  {
3264
3284
  className: "flex flex-col",
3265
3285
  style: { width: p, minWidth: "100%" },
3266
- children: s.map((u, I) => /* @__PURE__ */ e(
3286
+ children: o.map((x, y) => /* @__PURE__ */ e(
3267
3287
  "div",
3268
3288
  {
3269
- className: f(
3289
+ className: m(
3270
3290
  "flex flex-row table-body-row transition-colors duration-100",
3271
3291
  r && "cursor-pointer"
3272
3292
  ),
3273
- onClick: r ? () => r(u, I) : void 0,
3274
- children: n.map((R) => /* @__PURE__ */ e(
3293
+ onClick: r ? () => r(x, y) : void 0,
3294
+ children: t.map((k) => /* @__PURE__ */ e(
3275
3295
  "div",
3276
3296
  {
3277
3297
  className: "shrink-0 content-center px-4 relative",
3278
3298
  style: {
3279
- width: x[R.id] ?? R.defaultWidth ?? ye,
3299
+ width: N[k.id] ?? k.defaultWidth ?? ke,
3280
3300
  height: c
3281
3301
  },
3282
- children: /* @__PURE__ */ e("div", { className: "break-all line-clamp-1", children: R.renderCell(u, I) })
3302
+ children: /* @__PURE__ */ e("div", { className: "break-all line-clamp-1", children: k.renderCell(x, y) })
3283
3303
  },
3284
- R.id
3304
+ k.id
3285
3305
  ))
3286
3306
  },
3287
- o(u, I)
3307
+ s(x, y)
3288
3308
  ))
3289
3309
  }
3290
3310
  )
3291
3311
  }
3292
3312
  )
3293
3313
  ] });
3294
- }, It = (t) => {
3295
- const { label: n, children: s, className: o } = t;
3296
- return /* @__PURE__ */ d("div", { className: f("flex flex-col dropdown-button-group", o), children: [
3297
- n && /* @__PURE__ */ e("div", { className: "mb-2 text-sm dropdown-group-label font-semibold px-3", children: n }),
3298
- s
3314
+ }, $l = (n) => {
3315
+ const { Icon: t, title: o, description: s, children: r, className: l } = n;
3316
+ return /* @__PURE__ */ d("div", { className: m("flex flex-col items-center gap-3 text-center", l), children: [
3317
+ t && /* @__PURE__ */ e("div", { className: "flex h-14 w-14 items-center justify-center rounded-2xl bg-[var(--color-table-header-bg)]", children: /* @__PURE__ */ e(t, { className: "h-6 w-6 text-[var(--color-input-icon)]" }) }),
3318
+ (o || s) && /* @__PURE__ */ d("div", { className: "flex flex-col gap-1", children: [
3319
+ o && /* @__PURE__ */ e("div", { className: "font-medium text-[var(--color-input-text)]", children: o }),
3320
+ s && /* @__PURE__ */ e("div", { className: "text-sm text-[var(--color-input-description-text)]", children: s })
3321
+ ] }),
3322
+ r
3323
+ ] });
3324
+ }, Ct = (n) => {
3325
+ const { label: t, children: o, className: s } = n;
3326
+ return /* @__PURE__ */ d("div", { className: m("flex flex-col dropdown-button-group", s), children: [
3327
+ t && /* @__PURE__ */ e("div", { className: "mb-2 text-sm dropdown-group-label font-semibold px-3", children: t }),
3328
+ o
3299
3329
  ] });
3300
- }, Xr = () => /* @__PURE__ */ e("div", {}), Vr = [
3330
+ }, Vr = () => /* @__PURE__ */ e("div", {}), Kr = [
3301
3331
  { id: 1, email: "sarah.jennings@example.com", firstname: "Sarah", lastname: "Jennings", status: "active" },
3302
3332
  { id: 2, email: "liam.patel@outlook.com", firstname: "Liam", lastname: "Patel", status: "inactive" },
3303
3333
  { id: 3, email: "emily.wong@gmail.com", firstname: "Emily", lastname: "Wong", status: "active" },
@@ -3310,40 +3340,40 @@ const Hr = (t) => {
3310
3340
  { id: 10, email: "jackson.rivera@outlook.com", firstname: "Jackson", lastname: "Rivera", status: "active" },
3311
3341
  { id: 11, email: "ava.sanders@example.com", firstname: "Ava", lastname: "Sanders", status: "active" },
3312
3342
  { id: 12, email: "logan.bennett@company.io", firstname: "Logan", lastname: "Bennett", status: "inactive" }
3313
- ], Kr = [
3314
- { id: "id", header: "ID", renderCell: (t) => t.id },
3343
+ ], Gr = [
3344
+ { id: "id", header: "ID", renderCell: (n) => n.id },
3315
3345
  {
3316
3346
  id: "email",
3317
3347
  header: "Email",
3318
- renderCell: (t) => /* @__PURE__ */ e(Ee, { Icon: dn, onClick: () => {
3319
- }, children: t.email })
3348
+ renderCell: (n) => /* @__PURE__ */ e(Ee, { Icon: mn, onClick: () => {
3349
+ }, children: n.email })
3320
3350
  },
3321
- { id: "firstname", header: "First Name", renderCell: (t) => t.firstname },
3322
- { id: "lastname", header: "Last Name", renderCell: (t) => t.lastname },
3351
+ { id: "firstname", header: "First Name", renderCell: (n) => n.firstname },
3352
+ { id: "lastname", header: "Last Name", renderCell: (n) => n.lastname },
3323
3353
  {
3324
3354
  id: "status",
3325
3355
  header: "Status",
3326
- renderCell: () => /* @__PURE__ */ e(Gr, {})
3356
+ renderCell: () => /* @__PURE__ */ e(qr, {})
3327
3357
  }
3328
- ], Hl = () => /* @__PURE__ */ d("div", { className: "flex flex-col gap-6", children: [
3358
+ ], _l = () => /* @__PURE__ */ d("div", { className: "flex flex-col gap-6", children: [
3329
3359
  /* @__PURE__ */ d("div", { className: "flex flex-row items-center justify-start gap-3", children: [
3330
- /* @__PURE__ */ e(At, { Icon: Me, placeholder: "Search..." }),
3331
- /* @__PURE__ */ e(qe, { Icon: ft }),
3332
- /* @__PURE__ */ e(Kn, { Icon: ht, children: "New" }),
3360
+ /* @__PURE__ */ e(Wt, { Icon: Fe, placeholder: "Search..." }),
3361
+ /* @__PURE__ */ e(Ye, { Icon: mt }),
3362
+ /* @__PURE__ */ e(Gn, { Icon: ft, children: "New" }),
3333
3363
  /* @__PURE__ */ d(
3334
3364
  Ue,
3335
3365
  {
3336
- trigger: /* @__PURE__ */ e(qe, { Icon: ft }),
3366
+ trigger: /* @__PURE__ */ e(Ye, { Icon: mt }),
3337
3367
  children: [
3338
- /* @__PURE__ */ e(X, { dismissOnClick: !1, Icon: ht, children: "Add new" }),
3339
- /* @__PURE__ */ e(X, { Icon: cn, children: "Remove" }),
3340
- /* @__PURE__ */ d(It, { label: "Test", className: "mt-2", children: [
3368
+ /* @__PURE__ */ e(X, { dismissOnClick: !1, Icon: ft, children: "Add new" }),
3369
+ /* @__PURE__ */ e(X, { Icon: un, children: "Remove" }),
3370
+ /* @__PURE__ */ d(Ct, { label: "Test", className: "mt-2", children: [
3341
3371
  /* @__PURE__ */ e(X, { children: "Item 1" }),
3342
3372
  /* @__PURE__ */ e(X, { children: "Item 2" }),
3343
3373
  /* @__PURE__ */ e(X, { children: "Item 3" }),
3344
3374
  /* @__PURE__ */ e(X, { children: "Item 4" })
3345
3375
  ] }),
3346
- /* @__PURE__ */ d(It, { label: "Test", className: "mt-2", children: [
3376
+ /* @__PURE__ */ d(Ct, { label: "Test", className: "mt-2", children: [
3347
3377
  /* @__PURE__ */ e(X, { children: "Item 1" }),
3348
3378
  /* @__PURE__ */ e(X, { children: "Item 2" }),
3349
3379
  /* @__PURE__ */ e(X, { children: "Item 3" }),
@@ -3352,10 +3382,10 @@ const Hr = (t) => {
3352
3382
  ]
3353
3383
  }
3354
3384
  ),
3355
- /* @__PURE__ */ e(Ur, { tabs: [
3385
+ /* @__PURE__ */ e(Wr, { tabs: [
3356
3386
  {
3357
3387
  label: "Tab 1",
3358
- Icon: Ye,
3388
+ Icon: Je,
3359
3389
  active: !0,
3360
3390
  onClick: () => {
3361
3391
  }
@@ -3368,30 +3398,30 @@ const Hr = (t) => {
3368
3398
  },
3369
3399
  {
3370
3400
  label: "Tab 3",
3371
- Icon: Ye,
3401
+ Icon: Je,
3372
3402
  active: !1,
3373
3403
  onClick: () => {
3374
3404
  }
3375
3405
  }
3376
3406
  ] })
3377
3407
  ] }),
3378
- /* @__PURE__ */ e(Pr, { options: [
3408
+ /* @__PURE__ */ e(Er, { options: [
3379
3409
  { label: "Option 1", value: 1 },
3380
3410
  { label: "Option 2", value: 2 },
3381
3411
  { label: "Option 3", value: 3 }
3382
3412
  ], value: null, onChange: () => {
3383
3413
  } }),
3384
3414
  /* @__PURE__ */ e(
3385
- jr,
3415
+ Xr,
3386
3416
  {
3387
3417
  className: "h-[300px] w-[300px]",
3388
- columns: Kr,
3389
- rows: Vr,
3390
- getRowId: (t) => t.id
3418
+ columns: Gr,
3419
+ rows: Kr,
3420
+ getRowId: (n) => n.id
3391
3421
  }
3392
3422
  ),
3393
- /* @__PURE__ */ e(Xr, {})
3394
- ] }), Gr = () => /* @__PURE__ */ e(te, { children: /* @__PURE__ */ d(
3423
+ /* @__PURE__ */ e(Vr, {})
3424
+ ] }), qr = () => /* @__PURE__ */ e(ce, { children: /* @__PURE__ */ d(
3395
3425
  Ue,
3396
3426
  {
3397
3427
  placement: "bottom-end",
@@ -3406,72 +3436,73 @@ const Hr = (t) => {
3406
3436
  }
3407
3437
  ) });
3408
3438
  export {
3409
- Wl as AutoScroll,
3439
+ Hl as AutoScroll,
3410
3440
  Ee as Badge,
3411
3441
  Mr as BadgeColor,
3412
- Kn as Button,
3413
- Bt as ButtonIconRound,
3414
- qe as ButtonIconSquare,
3415
- Fl as Divider,
3442
+ Gn as Button,
3443
+ Ut as ButtonIconRound,
3444
+ Ye as ButtonIconSquare,
3445
+ Bl as Divider,
3416
3446
  X as DropdownButton,
3417
- It as DropdownButtonGroup,
3447
+ Ct as DropdownButtonGroup,
3418
3448
  Ue as DropdownMenu,
3419
- xe as DropdownPanel,
3420
- At as Input,
3421
- yl as InputCheck,
3422
- vl as InputColor,
3449
+ ve as DropdownPanel,
3450
+ Wt as Input,
3451
+ Cl as InputCheck,
3452
+ xl as InputColor,
3423
3453
  V as InputDescription,
3424
3454
  K as InputError,
3425
- re as InputErrorIcon,
3426
- Il as InputFileMultiple,
3427
- Cl as InputFileSingle,
3455
+ ne as InputErrorIcon,
3456
+ Rl as InputFileMultiple,
3457
+ Il as InputFileSingle,
3428
3458
  Z as InputIconButton,
3429
- pe as InputIconButtonTray,
3430
- q as InputLabel,
3431
- Sl as InputLexical,
3432
- xl as InputPassword,
3433
- Nl as InputRadio,
3434
- Pr as InputSelect,
3459
+ he as InputIconButtonTray,
3460
+ Y as InputLabel,
3461
+ Dl as InputLexical,
3462
+ wl as InputPassword,
3463
+ yl as InputRadio,
3464
+ Er as InputSelect,
3435
3465
  $e as InputSelectDivider,
3436
3466
  He as InputSelectGroupHeader,
3437
- Tl as InputSelectMultiple,
3438
- Dl as InputSelectNative,
3467
+ Ll as InputSelectMultiple,
3468
+ Ol as InputSelectNative,
3439
3469
  We as InputSelectOption,
3440
- Ol as InputSelectSearchable,
3441
- zl as InputSelectSearchableAsync,
3442
- wl as InputTextArea,
3470
+ zl as InputSelectSearchable,
3471
+ Tl as InputSelectSearchableAsync,
3472
+ Nl as InputTextArea,
3443
3473
  kl as InputToggle,
3444
- wr as LEXICAL_NODES,
3445
- yr as LexicalBlockTypeSelect,
3446
- Rl as LexicalDefaultToolbarContent,
3447
- Lr as LexicalFloatingToolbar,
3448
- Ir as LexicalFormatButtons,
3449
- Dr as LexicalHistoryButtons,
3450
- Sr as LexicalLinkButton,
3451
- Rr as LexicalListButtons,
3452
- Tr as LexicalToolbar,
3453
- de as LexicalToolbarButton,
3454
- Je as LexicalToolbarDivider,
3455
- jt as LexicalToolbarItems,
3456
- Al as Modal,
3457
- Ll as Panel,
3458
- El as PanelField,
3474
+ Nr as LEXICAL_NODES,
3475
+ Cr as LexicalBlockTypeSelect,
3476
+ Sl as LexicalDefaultToolbarContent,
3477
+ Pr as LexicalFloatingToolbar,
3478
+ Rr as LexicalFormatButtons,
3479
+ Or as LexicalHistoryButtons,
3480
+ Dr as LexicalLinkButton,
3481
+ Sr as LexicalListButtons,
3482
+ Lr as LexicalToolbar,
3483
+ ie as LexicalToolbarButton,
3484
+ qe as LexicalToolbarDivider,
3485
+ Vt as LexicalToolbarItems,
3486
+ Ul as Modal,
3487
+ Pl as Panel,
3488
+ Fl as PanelField,
3459
3489
  Ml as PanelLink,
3460
- Pl as PanelStack,
3461
- Ut as PopoverBase,
3462
- Ul as SidebarModal,
3490
+ El as PanelStack,
3491
+ Ht as PopoverBase,
3492
+ Wl as SidebarModal,
3463
3493
  Se as Spinner,
3464
- Ur as TabButtons,
3465
- jr as Table,
3466
- Hr as TableColumnHead,
3467
- Hl as Test,
3468
- Bl as Tooltip,
3469
- xr as UploadFileTile,
3494
+ Wr as TabButtons,
3495
+ Xr as Table,
3496
+ $r as TableColumnHead,
3497
+ $l as TableEmpty,
3498
+ _l as Test,
3499
+ Al as Tooltip,
3500
+ wr as UploadFileTile,
3470
3501
  H as isSelectOption,
3471
- Nt as lexicalTheme,
3472
- Ne as useLexicalToolbar,
3473
- Ht as useLexicalToolbarState,
3474
- dt as usePopover,
3502
+ wt as lexicalTheme,
3503
+ we as useLexicalToolbar,
3504
+ _t as useLexicalToolbarState,
3505
+ ct as usePopover,
3475
3506
  _e as useSelectPopover
3476
3507
  };
3477
3508
  //# sourceMappingURL=index.js.map