@matthiaskrijgsman/mat-ui 0.0.38 → 0.0.39

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,46 +1,46 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as d, Fragment as te } from "react/jsx-runtime";
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";
2
+ import { jsx as e, jsxs as d, Fragment as ce } from "react/jsx-runtime";
3
+ import * as R from "react";
4
+ import { createContext as Qe, useContext as Ze, useEffect as _, useState as W, useRef as Ce, useCallback as Pe, useLayoutEffect as It, useMemo as se } from "react";
5
+ import { AnimatePresence as De, motion as J, animate as Kt } from "motion/react";
6
+ import { IconExclamationCircleFilled as et, IconEyeOff as Gt, IconEye as Jt, IconPaperclip as Yt, IconCircleCheckFilled as tt, IconX as de, IconCloudUpload as qt, IconCheck as Rt, IconChevronDown as be, IconBold as Qt, IconItalic as Zt, IconUnderline as en, IconList as Ye, 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 Pn } from "@lexical/list";
21
+ import { LinkNode as Ln, $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 Le, CAN_REDO_COMMAND as Fn, $getSelection as Pt, $isRangeSelection as Lt, $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,
34
+ speed: t = 1,
35
35
  className: s
36
- } = t, o = 1 / n, r = 2 / n;
36
+ } = n, l = 1 / t, r = 2 / t;
37
37
  return /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(
38
38
  J.div,
39
39
  {
40
40
  role: "status",
41
- className: f("relative rounded-full", s),
41
+ className: m("relative rounded-full", s),
42
42
  animate: { rotate: 360 },
43
- transition: { repeat: 1 / 0, ease: "linear", duration: o },
43
+ transition: { repeat: 1 / 0, ease: "linear", duration: l },
44
44
  children: /* @__PURE__ */ e(
45
45
  J.div,
46
46
  {
@@ -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,11 +61,11 @@ 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)]"
@@ -73,23 +73,23 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
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,302 +97,302 @@ 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 = R.forwardRef((n, t) => {
134
134
  const {
135
135
  variant: s = "white",
136
- size: o = "md",
136
+ size: l = "md",
137
137
  className: r,
138
- children: l,
138
+ children: o,
139
139
  loading: a = !1,
140
140
  Icon: i,
141
141
  IconRight: c,
142
- ...g
143
- } = t;
142
+ ...f
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[s],
151
+ te[l],
152
+ jn[l],
153
+ Y[l],
154
+ _n[l],
155
155
  r
156
156
  ),
157
- ...g,
157
+ ...f,
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") }),
162
- l,
163
- c && /* @__PURE__ */ e(c, { className: f(ce[o], "-mr-1") })
159
+ a && /* @__PURE__ */ e(Se, { className: m(ae[l]) }),
160
+ !a && /* @__PURE__ */ d(ce, { children: [
161
+ i && /* @__PURE__ */ e(i, { className: m(ae[l], "-ml-1") }),
162
+ o,
163
+ c && /* @__PURE__ */ e(c, { className: m(ae[l], "-mr-1") })
164
164
  ] })
165
165
  ]
166
166
  }
167
167
  );
168
- }), Gn = `
168
+ }), Jn = `
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)]
172
172
  cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-4
173
173
  disabled:cursor-default
174
- `, Jn = {
174
+ `, Yn = {
175
175
  primary: "border button-primary shadow-sm",
176
176
  secondary: "border button-secondary shadow-sm",
177
177
  tertiary: "border button-tertiary",
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
+ }, qe = R.forwardRef((n, t) => {
182
182
  const {
183
183
  variant: s = "white",
184
- size: o = "md",
184
+ size: l = "md",
185
185
  className: r,
186
- Icon: l,
186
+ Icon: o,
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
+ Jn,
195
+ Yn[s],
196
+ At[l],
197
197
  r
198
198
  ),
199
199
  ...a,
200
- children: /* @__PURE__ */ e(l, { className: ce[o] })
200
+ children: /* @__PURE__ */ e(o, { className: ae[l] })
201
201
  }
202
202
  );
203
- }), Yn = `
203
+ }), qn = `
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 = R.forwardRef((n, t) => {
215
215
  const {
216
216
  variant: s = "white",
217
- size: o = "md",
217
+ size: l = "md",
218
218
  className: r,
219
- Icon: l,
219
+ Icon: o,
220
220
  ...a
221
- } = t;
221
+ } = n;
222
222
  return /* @__PURE__ */ e(
223
223
  "button",
224
224
  {
225
- ref: n,
226
- className: f(
227
- Yn,
228
- qn[s],
229
- Ft[o],
225
+ ref: t,
226
+ className: m(
227
+ qn,
228
+ Qn[s],
229
+ At[l],
230
230
  r
231
231
  ),
232
232
  ...a,
233
- children: /* @__PURE__ */ e(l, { className: ce[o] })
233
+ children: /* @__PURE__ */ e(o, { className: ae[l] })
234
234
  }
235
235
  );
236
- }), q = (t) => {
236
+ }), q = (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 = R.forwardRef((n, t) => {
242
242
  const {
243
243
  children: s,
244
- className: o
245
- } = t, r = Qn();
244
+ className: l
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
+ l
254
254
  ),
255
255
  children: s
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,
270
+ className: t,
271
271
  label: s,
272
- description: o,
272
+ description: l,
273
273
  Icon: r,
274
- error: l,
274
+ error: o,
275
275
  buttonTray: a,
276
276
  size: i = "md",
277
277
  ...c
278
- } = t, g = !!l || !!a;
278
+ } = n, f = !!o || !!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
287
  /* @__PURE__ */ e(q, { children: s }),
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],
299
+ te[i],
300
300
  Y[i],
301
- r ? Et[i] : fe[i],
302
- g ? he[i] : ct[i],
303
- l && "input-error"
301
+ r ? Mt[i] : me[i],
302
+ f ? fe[i] : it[i],
303
+ o && "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
+ o && /* @__PURE__ */ e(ne, {}),
310
310
  a
311
311
  ] })
312
312
  ] }),
313
- /* @__PURE__ */ e(V, { children: o }),
314
- /* @__PURE__ */ e(K, { children: l })
313
+ /* @__PURE__ */ e(V, { children: l }),
314
+ /* @__PURE__ */ e(K, { children: o })
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);
318
+ }, er = (n) => {
319
+ const t = n.match(/^#?([0-9a-fA-F]{6})$/);
320
+ if (!t) return null;
321
+ const s = parseInt(t[1], 16);
322
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;
323
+ }, tr = (n, t, s) => {
324
+ const l = (r) => Math.round(r * 255).toString(16).padStart(2, "0").toUpperCase();
325
+ return "#" + l(n) + l(t) + l(s);
326
+ }, nr = (n, t, s) => {
327
+ const l = Math.max(n, t, s), r = Math.min(n, t, s), o = l - 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 o !== 0 && (l === n ? a = ((t - s) / o + 6) % 6 : l === t ? a = (s - n) / o + 2 : a = (n - t) / o + 4, a *= 60), [a, l === 0 ? 0 : o / l, l];
330
+ }, rr = (n, t, s) => {
331
+ const l = s * t, r = n / 60, o = l * (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})$/);
333
+ r < 1 ? (a = l, i = o) : r < 2 ? (a = o, i = l) : r < 3 ? (i = l, c = o) : r < 4 ? (i = o, c = l) : r < 5 ? (a = o, c = l) : (a = l, c = o);
334
+ const f = s - l;
335
+ return [a + f, i + f, c + f];
336
+ }, Re = (n, t, s) => {
337
+ const [l, r, o] = rr(n, t, s);
338
+ return tr(l, r, o);
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 s = t.match(/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);
346
346
  if (s) {
347
347
  let a = s[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);
356
- const l = r.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
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);
351
+ const l = document.createElement("div");
352
+ if (l.style.color = t, !l.style.color) return null;
353
+ document.body.appendChild(l);
354
+ const r = getComputedStyle(l).color;
355
+ document.body.removeChild(l);
356
+ const o = r.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
357
+ return o ? "#" + [o[1], o[2], o[3]].map((a) => parseInt(a, 10).toString(16).padStart(2, "0")).join("").toUpperCase() : null;
358
+ }, Xe = (n) => {
359
+ const t = R.useRef(null), [s, l] = R.useState(!1), r = (o) => {
360
+ t.current = null, l(!1), o.currentTarget.releasePointerCapture?.(o.pointerId);
361
361
  };
362
362
  return {
363
363
  isDragging: s,
364
364
  bind: {
365
- onPointerDown: (l) => {
366
- const a = l.currentTarget;
367
- n.current = a.getBoundingClientRect(), a.setPointerCapture?.(l.pointerId), o(!0), t(l.clientX, l.clientY, n.current);
365
+ onPointerDown: (o) => {
366
+ const a = o.currentTarget;
367
+ t.current = a.getBoundingClientRect(), a.setPointerCapture?.(o.pointerId), l(!0), n(o.clientX, o.clientY, t.current);
368
368
  },
369
- onPointerMove: (l) => {
370
- n.current && t(l.clientX, l.clientY, n.current);
369
+ onPointerMove: (o) => {
370
+ t.current && n(o.clientX, o.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,
382
+ className: t,
383
383
  children: s,
384
- padding: o = "md",
384
+ padding: l = "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[l], t),
391
391
  ...r,
392
392
  children: s
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 = R.memo(
409
+ ({ open: n, children: t, className: s, floatingStyles: l, setFloating: r, placement: o, floatingProps: a }) => /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(De, { children: n && /* @__PURE__ */ e("div", { ref: r, style: l, className: "z-50", ...a, children: /* @__PURE__ */ e(
410
+ J.div,
411
+ {
412
+ className: s,
413
+ style: { transformOrigin: ar[o] },
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: s, onOpenChange: l, fullWidth: r, minWidth: o, maxWidth: a } = n, i = R.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: b, elements: C }) {
427
+ r && (C.floating.style.width = `${b.reference.width}px`), o && (C.floating.style.minWidth = `${o}px`), a && (C.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, o]), { refs: c, floatingStyles: f, context: w, placement: x } = st({
431
+ placement: t,
432
+ open: s,
433
+ onOpenChange: l,
434
+ middleware: i,
435
+ whileElementsMounted: at
436
+ }), h = St(w, {
437
+ enabled: !!l,
438
+ outsidePress: !0,
439
+ escapeKey: !1
440
+ }), { getFloatingProps: g } = Dt([h]), p = R.useRef({
441
+ floatingStyles: f,
442
+ setFloating: c.setFloating,
443
+ placement: t,
444
+ getFloatingProps: g
442
445
  });
443
- x.current = {
444
- onOutsideClick: s,
445
- floatingStyles: c,
446
- setFloating: i.setFloating,
447
- placement: g
446
+ p.current = {
447
+ floatingStyles: f,
448
+ setFloating: c.setFloating,
449
+ placement: x,
450
+ getFloatingProps: g
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 u = R.useMemo(() => {
453
+ const b = (C) => {
454
+ const { floatingStyles: v, setFloating: k, placement: I, getFloatingProps: D } = p.current, { className: O, open: P, children: L } = C;
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: v,
461
+ setFloating: k,
462
+ placement: I,
463
+ floatingProps: D(),
464
+ children: L
462
465
  }
463
466
  );
464
467
  };
465
- return C.memo(h);
468
+ return R.memo(b);
466
469
  }, []);
467
470
  return {
468
- anchorRef: i.setReference,
469
- Popover: w
471
+ anchorRef: c.setReference,
472
+ Popover: u
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 s = (l) => {
478
+ l.key === "Escape" && t();
476
479
  };
477
480
  return document.addEventListener("keydown", s), () => {
478
481
  document.removeEventListener("keydown", s);
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, s = t / 2;
483
486
  return {
484
- width: n,
485
- height: n,
487
+ width: t,
488
+ height: t,
486
489
  marginLeft: -s,
487
490
  marginTop: -s,
488
- borderRadius: t ? fr : mr
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 [s, l] = W(() => vt(n) ?? [0, 0, 1]), r = Ce(Re(s[0], s[1], s[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 u = vt(n);
500
+ u && l(u);
501
+ }, [n]);
502
+ const o = (u) => {
503
+ l(u);
504
+ const b = Re(u[0], u[1], u[2]);
505
+ r.current = b, t(b);
506
+ }, [a, i, c] = s, f = Re(a, 1, 1), w = Re(a, i, 1), x = Re(a, i, c), h = Xe((u, b, C) => {
507
+ o([a, Te((u - C.left) / C.width), 1 - Te((b - C.top) / C.height)]);
508
+ }), g = Xe((u, b, C) => {
509
+ o([Te((u - C.left) / C.width) * 360, i, c]);
510
+ }), p = Xe((u, b, C) => {
511
+ o([a, i, Te((u - C.left) / C.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: (u) => u.preventDefault(),
516
519
  children: [
517
520
  /* @__PURE__ */ d(
518
521
  "div",
@@ -529,20 +532,20 @@ 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: f },
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
  ]
@@ -556,10 +559,10 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
556
559
  left: `${i * 100}%`,
557
560
  top: `${(1 - c) * 100}%`,
558
561
  boxShadow: Ve,
559
- backgroundColor: w
562
+ backgroundColor: x
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,11 +575,11 @@ 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
+ ...g.bind,
580
583
  children: /* @__PURE__ */ e(
581
584
  J.div,
582
585
  {
@@ -584,11 +587,11 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
584
587
  style: {
585
588
  top: "50%",
586
589
  left: `${a / 360 * 100}%`,
587
- backgroundColor: g,
590
+ backgroundColor: f,
588
591
  boxShadow: Ve
589
592
  },
590
- initial: ke(!1),
591
- animate: ke(b.isDragging),
593
+ initial: ye(!1),
594
+ animate: ye(g.isDragging),
592
595
  transition: Ke
593
596
  }
594
597
  )
@@ -600,7 +603,7 @@ 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, ${w})`,
604
607
  touchAction: "none",
605
608
  cursor: "ew-resize"
606
609
  },
@@ -612,11 +615,11 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
612
615
  style: {
613
616
  top: "50%",
614
617
  left: `${c * 100}%`,
615
- backgroundColor: w,
618
+ backgroundColor: x,
616
619
  boxShadow: Ve
617
620
  },
618
- initial: ke(!1),
619
- animate: ke(p.isDragging),
621
+ initial: ye(!1),
622
+ animate: ye(p.isDragging),
620
623
  transition: Ke
621
624
  }
622
625
  )
@@ -625,160 +628,161 @@ 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,
633
+ className: t,
631
634
  label: s,
632
- description: o,
635
+ description: l,
633
636
  error: r,
634
- buttonTray: l,
637
+ buttonTray: o,
635
638
  size: a = "md",
636
639
  value: i,
637
640
  defaultValue: c,
638
- onChange: g,
639
- onBlur: x,
640
- onFocus: w,
641
+ onChange: f,
642
+ onBlur: w,
643
+ onFocus: x,
641
644
  ...h
642
- } = t, [b, p] = W(
645
+ } = n, [g, p] = 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
+ ), [u, b] = W(!1), C = Ce(null), v = i != null ? String(i) : g, k = v || "white";
648
+ xe(u, () => b(!1));
649
+ const { anchorRef: I, Popover: D } = 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: u,
652
+ onOpenChange: b
653
+ }), O = (y) => {
654
+ p(y.target.value), f?.(y);
655
+ }, P = (y) => {
656
+ b(!0), x?.(y);
657
+ }, L = (y) => {
658
+ const A = y.target.value, z = lr(A);
659
+ z && z !== A && C.current && xt(C.current, z), b(!1), w?.(y);
660
+ }, T = (y) => {
661
+ C.current && xt(C.current, y);
662
+ }, N = !!r || !!o;
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
671
  /* @__PURE__ */ e(q, { children: s }),
668
- /* @__PURE__ */ d("div", { className: "flex flex-col relative", ref: y, children: [
672
+ /* @__PURE__ */ d("div", { className: "flex flex-col relative", ref: I, 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: k }
678
682
  }
679
683
  ),
680
684
  /* @__PURE__ */ e(
681
685
  "input",
682
686
  {
683
- ref: u,
684
- className: f(
687
+ ref: C,
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],
690
+ te[a],
687
691
  Y[a],
688
- Et[a],
689
- N ? he[a] : ct[a],
692
+ Mt[a],
693
+ N ? 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 ?? g,
697
+ onChange: O,
698
+ onFocus: P,
699
+ onBlur: L,
700
+ onClick: () => b(!0),
697
701
  ...h
698
702
  }
699
703
  ),
700
- /* @__PURE__ */ d(pe, { children: [
701
- r && /* @__PURE__ */ e(re, {}),
702
- l
704
+ /* @__PURE__ */ d(he, { children: [
705
+ r && /* @__PURE__ */ e(ne, {}),
706
+ o
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(D, { open: u, children: /* @__PURE__ */ e(ve, { padding: "md", children: /* @__PURE__ */ e(pr, { value: v, onChange: T }) }) })
705
709
  ] }),
706
- /* @__PURE__ */ e(V, { children: o }),
710
+ /* @__PURE__ */ e(V, { children: l }),
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,
717
+ onClick: t,
714
718
  Icon: s
715
- } = t;
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(s, { 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",
733
+ type: t = "password",
730
734
  enableShowPasswordToggle: s = !0,
731
- ...o
732
- } = t, [r, l] = W(!1);
735
+ ...l
736
+ } = n, [r, o] = 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: () => {
738
- l(!r);
740
+ type: r ? "text" : t,
741
+ buttonTray: s ? /* @__PURE__ */ e(Z, { Icon: r ? Gt : Jt, onClick: () => {
742
+ o(!r);
739
743
  } }) : void 0,
740
- ...o
744
+ ...l
741
745
  }
742
746
  );
743
- }, wl = (t) => {
747
+ }, Nl = (n) => {
744
748
  const {
745
- className: n,
749
+ className: t,
746
750
  label: s,
747
- description: o,
751
+ description: l,
748
752
  error: r,
749
- size: l = "md",
753
+ size: o = "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
+ onChange: f,
758
+ ...w
759
+ } = n, x = R.useRef(null), h = R.useCallback(() => {
760
+ const p = x.current;
757
761
  if (!p) return;
758
762
  p.style.height = "auto";
759
- let m = p.scrollHeight;
763
+ let u = p.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 b = window.getComputedStyle(p), C = parseFloat(b.lineHeight), v = parseFloat(b.paddingTop), k = parseFloat(b.paddingBottom), I = parseFloat(b.borderTopWidth), D = parseFloat(b.borderBottomWidth), O = C * i + v + k + I + D;
766
+ u = Math.min(p.scrollHeight, O);
763
767
  }
764
- p.style.height = `${m}px`;
768
+ p.style.height = `${u}px`;
765
769
  }, [i]);
766
- C.useLayoutEffect(() => {
770
+ R.useLayoutEffect(() => {
767
771
  if (!a) {
768
- w.current && (w.current.style.height = "");
772
+ x.current && (x.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, o]);
777
+ const g = (p) => {
778
+ f?.(p), a && h();
775
779
  };
776
- return /* @__PURE__ */ e(Q.Provider, { value: l, children: /* @__PURE__ */ d(
780
+ return /* @__PURE__ */ e(Q.Provider, { value: o, 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
788
  /* @__PURE__ */ e(q, { children: s }),
@@ -786,41 +790,41 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
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, x]) : x,
794
+ onChange: g,
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[o],
798
+ Y[o],
799
+ me[o],
800
+ r ? fe[o] : it[o],
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
+ ...w
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: l }),
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,
816
+ className: t,
813
817
  label: s,
814
- description: o,
818
+ description: l,
815
819
  error: r,
816
- ...l
817
- } = t;
820
+ ...o
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: [
@@ -829,33 +833,33 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
829
833
  {
830
834
  type: "radio",
831
835
  className: "h-6 w-6 shrink-0 rounded-full border check-base shadow-sm ring-0 hover:ring-4 focus:ring-4 ring-offset-0 focus:outline-0 transition-all duration-150",
832
- ...l
836
+ ...o
833
837
  }
834
838
  ),
835
- s && /* @__PURE__ */ e("label", { htmlFor: t.id, className: f(
839
+ s && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
836
840
  "input-label font-medium mb-1",
837
- t.id && "cursor-pointer"
841
+ n.id && "cursor-pointer"
838
842
  ), children: s })
839
843
  ] }),
840
- /* @__PURE__ */ e(V, { children: o }),
844
+ /* @__PURE__ */ e(V, { children: l }),
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,
851
+ className: t,
848
852
  label: s,
849
- description: o,
853
+ description: l,
850
854
  error: r,
851
- ...l
852
- } = t;
855
+ ...o
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: [
@@ -865,41 +869,41 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
865
869
  {
866
870
  type: "checkbox",
867
871
  className: "appearance-none absolute inset-0 h-6 w-10 rounded-full checked:bg-transparent border-0 toggle-input ring-0 hover:ring-4 focus:ring-4 ring-offset-0 focus:outline-0 transition-all duration-150",
868
- ...l
872
+ ...o
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
+ s && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
880
884
  "input-label font-medium mb-1",
881
- t.id && "cursor-pointer"
885
+ n.id && "cursor-pointer"
882
886
  ), children: s })
883
887
  ] }),
884
- /* @__PURE__ */ e(V, { children: o }),
888
+ /* @__PURE__ */ e(V, { children: l }),
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,
895
+ className: t,
892
896
  label: s,
893
- description: o,
897
+ description: l,
894
898
  error: r,
895
- ...l
896
- } = t;
899
+ ...o
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: [
@@ -908,144 +912,144 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
908
912
  {
909
913
  type: "checkbox",
910
914
  className: "h-6 w-6 shrink-0 rounded-lg border check-base shadow-sm ring-0 hover:ring-4 focus:ring-4 ring-offset-0 focus:outline-0 transition-all duration-150",
911
- ...l
915
+ ...o
912
916
  }
913
917
  ),
914
- s && /* @__PURE__ */ e("label", { htmlFor: t.id, className: f(
918
+ s && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
915
919
  "input-label font-medium mb-1",
916
- t.id && "cursor-pointer"
920
+ n.id && "cursor-pointer"
917
921
  ), children: s })
918
922
  ] }),
919
- /* @__PURE__ */ e(V, { children: o }),
923
+ /* @__PURE__ */ e(V, { children: l }),
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,
942
+ label: t,
939
943
  description: s,
940
- error: o,
944
+ error: l,
941
945
  placeholder: r = "No file chosen",
942
- buttonText: l = "Choose",
943
- Icon: a = Gt,
946
+ buttonText: o = "Choose",
947
+ Icon: a = Yt,
944
948
  size: i = "md",
945
949
  value: c,
946
- isUploaded: g = !1,
947
- isUploading: x = !1,
948
- onChange: w,
950
+ isUploaded: f = !1,
951
+ isUploading: w = !1,
952
+ onChange: x,
949
953
  onDropRejected: h,
950
- accept: b,
954
+ accept: g,
951
955
  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);
956
+ minSize: u,
957
+ disabled: b = !1,
958
+ className: C
959
+ } = n, v = async (T) => {
960
+ const [N] = T;
961
+ N && await x?.(N);
958
962
  }, {
959
- getRootProps: R,
960
- getInputProps: y,
963
+ getRootProps: k,
964
+ getInputProps: I,
961
965
  open: D,
962
- isDragActive: T,
963
- isFocused: B
964
- } = Dt({
966
+ isDragActive: O,
967
+ isFocused: P
968
+ } = zt({
965
969
  multiple: !1,
966
- accept: b,
970
+ accept: g,
967
971
  maxSize: p,
968
- minSize: m,
969
- disabled: v,
970
- onDrop: I,
972
+ minSize: u,
973
+ disabled: b,
974
+ onDrop: v,
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
+ }), L = c?.name;
977
+ return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: m("flex flex-col", C), children: [
978
+ /* @__PURE__ */ e(q, { children: t }),
975
979
  /* @__PURE__ */ d(
976
980
  "div",
977
981
  {
978
- ...R({
979
- className: f(
982
+ ...k({
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
+ l && "input-error",
989
+ b && "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", { ...I() }),
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
1003
  Y[i],
1000
- !P && "text-[var(--color-input-placeholder)]"
1004
+ !L && "text-[var(--color-input-placeholder)]"
1001
1005
  ),
1002
- children: P ?? r
1006
+ children: L ?? 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
+ l && /* @__PURE__ */ e(ne, {}),
1010
+ w && !l && /* @__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
+ f && !w && !l && /* @__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,
1013
- onClick: (z) => {
1014
- z.stopPropagation(), D();
1016
+ disabled: b,
1017
+ onClick: (T) => {
1018
+ T.stopPropagation(), D();
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
- children: l
1031
+ children: o
1028
1032
  }
1029
1033
  )
1030
1034
  ]
1031
1035
  }
1032
1036
  ),
1033
1037
  /* @__PURE__ */ e(V, { children: s }),
1034
- /* @__PURE__ */ e(K, { children: o })
1038
+ /* @__PURE__ */ e(K, { children: l })
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,
1042
+ file: t,
1039
1043
  isUploaded: s = !1,
1040
- isUploading: o = !1,
1044
+ isUploading: l = !1,
1041
1045
  error: r,
1042
- onRemove: l,
1046
+ onRemove: o,
1043
1047
  className: a
1044
- } = t, i = o || s || !!r;
1048
+ } = n, i = l || s || !!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,16 +1057,16 @@ 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) }),
1059
- l && /* @__PURE__ */ e(
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" }) : l ? /* @__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) }),
1063
+ o && /* @__PURE__ */ e(
1060
1064
  qe,
1061
1065
  {
1062
1066
  variant: "transparent",
1063
1067
  size: "sm",
1064
- Icon: ue,
1065
- onClick: l,
1068
+ Icon: de,
1069
+ onClick: o,
1066
1070
  "aria-label": "Remove file",
1067
1071
  className: "shrink-0"
1068
1072
  }
@@ -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,
1079
+ label: t,
1076
1080
  description: s,
1077
- error: o,
1081
+ error: l,
1078
1082
  title: r = "Drop files here",
1079
- hint: l,
1080
- Icon: a = Jt,
1083
+ hint: o,
1084
+ Icon: a = qt,
1081
1085
  onUpload: i,
1082
1086
  onFileRemoved: c,
1083
- onDropRejected: g,
1084
- renderFileTile: x,
1085
- accept: w,
1087
+ onDropRejected: f,
1088
+ renderFileTile: w,
1089
+ accept: x,
1086
1090
  maxSize: h,
1087
- minSize: b,
1091
+ minSize: g,
1088
1092
  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,
1093
+ disabled: u = !1,
1094
+ className: b
1095
+ } = n, [C, v] = W([]), k = Ce(0), I = (y, A) => {
1096
+ v((z) => z.map(($) => $.id === y ? { ...$, ...A } : $));
1097
+ }, D = (y) => {
1098
+ if (y.length === 0) return;
1099
+ const A = y.map((z) => ({
1100
+ id: String(++k.current),
1101
+ file: z,
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 (v((z) => [...z, ...A]), !!i)
1105
+ for (const z of A)
1106
+ Promise.resolve().then(() => i(z.file)).then(() => I(z.id, { status: "uploaded" })).catch(($) => {
1107
+ I(z.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 = (y) => {
1113
+ const A = C.find((z) => z.id === y);
1114
+ v((z) => z.filter(($) => $.id !== y)), A && c?.(A.file);
1111
1115
  }, {
1112
- getRootProps: B,
1113
- getInputProps: P,
1114
- isDragActive: z,
1116
+ getRootProps: P,
1117
+ getInputProps: L,
1118
+ isDragActive: T,
1115
1119
  isFocused: N
1116
- } = Dt({
1120
+ } = zt({
1117
1121
  multiple: !0,
1118
- accept: w,
1122
+ accept: x,
1119
1123
  maxSize: h,
1120
- minSize: b,
1124
+ minSize: g,
1121
1125
  maxFiles: p,
1122
- disabled: m,
1126
+ disabled: u,
1123
1127
  onDrop: D,
1124
- onDropRejected: g
1128
+ onDropRejected: f
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", b), children: [
1131
+ /* @__PURE__ */ e(q, { 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
+ (N || T) && "ring-4",
1142
+ l && "input-error",
1143
+ u && "opacity-60 cursor-not-allowed"
1140
1144
  )
1141
1145
  }),
1142
1146
  children: [
1143
- /* @__PURE__ */ e("input", { ...P() }),
1147
+ /* @__PURE__ */ e("input", { ...L() }),
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
- l && /* @__PURE__ */ e("div", { className: "text-sm text-[var(--color-input-description-text)] ", children: l })
1150
+ o && /* @__PURE__ */ e("div", { className: "text-sm text-[var(--color-input-description-text)] ", children: o })
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) => {
1154
+ C.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-col gap-2 mt-3", children: C.map((y) => {
1151
1155
  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)
1156
+ file: y.file,
1157
+ isUploading: y.status === "uploading",
1158
+ isUploaded: y.status === "uploaded",
1159
+ error: y.status === "error" ? y.error?.message : void 0,
1160
+ onRemove: () => O(y.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(R.Fragment, { children: w ? w(y.file, A) : /* @__PURE__ */ e(wr, { ...A }) }, y.id);
1159
1163
  }) }),
1160
1164
  /* @__PURE__ */ e(V, { children: s }),
1161
- /* @__PURE__ */ e(K, { children: o })
1165
+ /* @__PURE__ */ e(K, { children: l })
1162
1166
  ] });
1163
- }, wr = [
1164
- Cn,
1167
+ }, Nr = [
1165
1168
  In,
1166
- Ot,
1167
- Dn,
1169
+ Rn,
1170
+ Tt,
1171
+ On,
1168
1172
  Ln
1169
- ], Nt = {
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, s] = W($t);
1208
1212
  return _(() => {
1209
- const o = () => {
1210
- t.getEditorState().read(() => {
1211
- const r = zt();
1212
- if (!Tt(r))
1213
+ const l = () => {
1214
+ n.getEditorState().read(() => {
1215
+ const r = Pt();
1216
+ if (!Lt(r))
1213
1217
  return;
1214
- const l = r.anchor.getNode(), a = Wn(l, Ot), i = a && On(a) ? a.getListType() : null;
1218
+ const o = r.anchor.getNode(), a = Hn(o, 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 g = o.getKey() === "root" ? o : o.getTopLevelElementOrThrow();
1222
+ Sn(g) && (c = g.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 f = r.hasFormat("bold"), w = r.hasFormat("italic"), x = r.hasFormat("underline"), h = pt(o.getParent()) || pt(o);
1225
+ s((g) => ({
1226
+ ...g,
1227
+ isBold: f,
1228
+ isItalic: w,
1229
+ isUnderline: x,
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),
1238
- Pe
1239
- ),
1240
- t.registerCommand(
1237
+ return Et(
1238
+ n.registerUpdateListener(() => l()),
1239
+ n.registerCommand(
1241
1240
  En,
1242
- (r) => (s((l) => ({ ...l, canRedo: r })), !1),
1243
- Pe
1241
+ (r) => (s((o) => ({ ...o, canUndo: r })), !1),
1242
+ Le
1243
+ ),
1244
+ n.registerCommand(
1245
+ Fn,
1246
+ (r) => (s((o) => ({ ...o, canRedo: r })), !1),
1247
+ Le
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: s, placement: l = "bottom-end", minWidth: r = 200, className: o } = n, [a, i] = W(!1), { Popover: c, anchorRef: f } = ct({
1256
+ placement: l,
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: f, className: o, 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: s }) }) })
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 = R.forwardRef((n, t) => {
1261
1266
  const {
1262
1267
  className: s,
1263
- children: o,
1268
+ children: l,
1264
1269
  Icon: r,
1265
- onClick: l,
1270
+ onClick: o,
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(), f = (w) => {
1274
+ o && o(w), 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
1282
  s
1278
1283
  ),
1279
- onClick: g,
1284
+ onClick: f,
1280
1285
  ...i,
1281
1286
  children: [
1282
1287
  r && /* @__PURE__ */ e(r, { className: "h-5 w-5" }),
1283
- o
1288
+ l
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: s } = we(), l = (o) => {
1300
+ n.update(() => {
1301
+ const a = Pt();
1302
+ Lt(a) && (o === "paragraph" ? bt(a, () => Mn()) : bt(a, () => Dn(o)));
1298
1303
  });
1299
- }, r = Ge.find((l) => l.value === n.blockType) ?? Ge[0];
1304
+ }, r = Ge.find((o) => o.value === t.blockType) ?? Ge[0];
1300
1305
  return /* @__PURE__ */ e(
1301
1306
  Ue,
1302
1307
  {
@@ -1306,216 +1311,216 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1306
1311
  "button",
1307
1312
  {
1308
1313
  type: "button",
1309
- onMouseDown: (l) => l.preventDefault(),
1310
- className: f(
1314
+ onMouseDown: (o) => o.preventDefault(),
1315
+ className: m(
1311
1316
  "lexical-tb-btn h-8 px-2 gap-1 text-sm font-medium",
1312
1317
  s === "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
- children: Ge.map((l) => /* @__PURE__ */ e(
1325
+ children: Ge.map((o) => /* @__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",
1326
- children: l.label
1328
+ Icon: o.value === t.blockType ? Rt : void 0,
1329
+ onClick: () => l(o.value),
1330
+ className: o.value === t.blockType ? void 0 : "pl-11",
1331
+ children: o.label
1327
1332
  },
1328
- l.value
1333
+ o.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 = R.forwardRef(
1341
+ (n, t) => {
1342
+ const { Icon: s, active: l = !1, tone: r = "light", className: o, 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: (f) => {
1349
+ f.preventDefault(), a?.(f);
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",
1350
- l
1353
+ Ir[r],
1354
+ l && "lexical-tb-btn-active",
1355
+ o
1351
1356
  ),
1352
1357
  ...i,
1353
1358
  children: /* @__PURE__ */ e(s, { 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: s } = we();
1364
+ return /* @__PURE__ */ d(ce, { children: [
1360
1365
  /* @__PURE__ */ e(
1361
- de,
1366
+ ie,
1362
1367
  {
1363
- Icon: Yt,
1368
+ Icon: Qt,
1364
1369
  tone: s,
1365
- active: n.isBold,
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,
1378
+ Icon: Zt,
1374
1379
  tone: s,
1375
- active: n.isItalic,
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,
1388
+ Icon: en,
1384
1389
  tone: s,
1385
- active: n.isUnderline,
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: s } = we(), l = () => {
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 : Pn,
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
1412
  Icon: Ye,
1408
1413
  tone: s,
1409
- active: n.isUnorderedList,
1414
+ active: t.isUnorderedList,
1410
1415
  "aria-label": "Bullet list",
1411
- onClick: o
1416
+ onClick: l
1412
1417
  }
1413
1418
  ),
1414
1419
  /* @__PURE__ */ e(
1415
- de,
1420
+ ie,
1416
1421
  {
1417
- Icon: Zt,
1422
+ Icon: tn,
1418
1423
  tone: s,
1419
- active: n.isOrderedList,
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: s } = we(), l = () => {
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,
1442
+ Icon: nn,
1438
1443
  tone: s,
1439
- active: n.isLink,
1444
+ active: t.isLink,
1440
1445
  "aria-label": "Link",
1441
- onClick: o
1446
+ onClick: l
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: s } = we();
1451
+ return /* @__PURE__ */ d(ce, { children: [
1447
1452
  /* @__PURE__ */ e(
1448
- de,
1453
+ ie,
1449
1454
  {
1450
- Icon: tn,
1455
+ Icon: rn,
1451
1456
  tone: s,
1452
- disabled: !n.canUndo,
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,
1465
+ Icon: ln,
1461
1466
  tone: s,
1462
- disabled: !n.canRedo,
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
+ }, Je = (n) => {
1477
+ const { tone: t, className: s } = n, { tone: l, 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],
1484
+ zr[t ?? l],
1480
1485
  s
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 R.Children.forEach(n, (s) => {
1492
+ R.isValidElement(s) && s.type === R.Fragment ? t.push(...Xt(s.props.children)) : t.push(s);
1493
+ }), t;
1494
+ }, Vt = (n) => {
1495
+ const { children: t } = n, { state: s, tone: l } = we(), r = Xt(t), o = Ce(null), a = Ce(null), [i, c] = W(r.length), f = Pe(() => {
1496
+ const h = o.current, g = a.current;
1497
+ if (!h || !g) return;
1498
+ const p = h.clientWidth, u = Array.from(g.children).map((k) => k.offsetWidth);
1499
+ if (u.reduce((k, I, D) => k + I + (D > 0 ? Nt : 0), 0) <= p) {
1500
+ c(u.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 C = 0, v = 0;
1504
+ for (let k = 0; k < u.length; k++) {
1505
+ const I = u[k] + (k > 0 ? Nt : 0);
1506
+ if (C + I + Tr > p) break;
1507
+ C += I, v++;
1503
1508
  }
1504
- c(I);
1509
+ c(v);
1505
1510
  }, []);
1506
- Rt(() => {
1507
- g();
1511
+ It(() => {
1512
+ f();
1508
1513
  }), _(() => {
1509
- const h = l.current, b = a.current;
1514
+ const h = o.current, g = 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 p = new ResizeObserver(() => f());
1517
+ return p.observe(h), g && p.observe(g), () => p.disconnect();
1518
+ }, [f]);
1519
+ const w = r.slice(0, i), x = r.slice(i);
1515
1520
  return /* @__PURE__ */ d(
1516
1521
  "div",
1517
1522
  {
1518
- ref: l,
1523
+ ref: o,
1519
1524
  className: "relative flex flex-row items-center gap-1 min-w-0 flex-1",
1520
1525
  children: [
1521
1526
  /* @__PURE__ */ e(
@@ -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, g) => /* @__PURE__ */ e("div", { className: "flex flex-row items-center", children: h }, g))
1528
1533
  }
1529
1534
  ),
1530
- x.map((h, b) => /* @__PURE__ */ e(C.Fragment, { children: h }, b)),
1531
- w.length > 0 && /* @__PURE__ */ e(
1535
+ w.map((h, g) => /* @__PURE__ */ e(R.Fragment, { children: h }, g)),
1536
+ x.length > 0 && /* @__PURE__ */ e(
1532
1537
  Ue,
1533
1538
  {
1534
1539
  placement: "bottom-end",
@@ -1539,11 +1544,11 @@ 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
+ l === "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
1554
  children: /* @__PURE__ */ e(Ae.Provider, { value: { state: s, tone: "light", orientation: "vertical" }, children: /* @__PURE__ */ e(
@@ -1551,7 +1556,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
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: x.map((h, g) => /* @__PURE__ */ e(R.Fragment, { children: h }, g))
1555
1560
  }
1556
1561
  ) })
1557
1562
  }
@@ -1559,55 +1564,55 @@ 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, {}),
1567
+ }, dt = () => /* @__PURE__ */ d(ce, { children: [
1568
+ /* @__PURE__ */ e(Cr, {}),
1566
1569
  /* @__PURE__ */ e(Je, {}),
1567
1570
  /* @__PURE__ */ e(Rr, {}),
1571
+ /* @__PURE__ */ e(Je, {}),
1568
1572
  /* @__PURE__ */ e(Sr, {}),
1573
+ /* @__PURE__ */ e(Dr, {}),
1569
1574
  /* @__PURE__ */ e(Je, {}),
1570
- /* @__PURE__ */ e(Dr, {})
1571
- ] }), Rl = () => ut(), Tr = (t) => {
1572
- const { render: n, className: s } = t, [o] = me(), r = Ht();
1575
+ /* @__PURE__ */ e(Or, {})
1576
+ ] }), Sl = () => dt(), Pr = (n) => {
1577
+ const { render: t, className: s } = n, [l] = 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
1583
  s
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: l, 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
+ }, Lr = (n) => {
1589
+ const { render: t } = n, [s] = ue(), l = _t(), [r, o] = 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: f }) {
1598
+ f.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(
1604
+ return _(() => s.registerRootListener((c) => a.setReference(c ?? null)), [s, a]), _(() => Et(
1600
1605
  s.registerCommand(
1601
- An,
1602
- () => (l(!0), !1),
1603
- Pe
1606
+ Un,
1607
+ () => (o(!0), !1),
1608
+ Le
1604
1609
  ),
1605
1610
  s.registerCommand(
1606
- Un,
1607
- () => (l(!1), !1),
1608
- Pe
1611
+ Wn,
1612
+ () => (o(!1), !1),
1613
+ Le
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(
1615
+ ), [s]), /* @__PURE__ */ e(Ae.Provider, { value: { state: l, 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(
1611
1616
  J.div,
1612
1617
  {
1613
1618
  className: "lexical-floating-toolbar flex w-full flex-row items-center p-1 rounded-xl",
@@ -1615,75 +1620,75 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
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: s, state: l, tone: "dark" }) : dt() })
1619
1624
  }
1620
1625
  ) }) }) }) });
1621
- }, Sl = (t) => {
1626
+ }, Dl = (n) => {
1622
1627
  const {
1623
- label: n,
1628
+ label: t,
1624
1629
  description: s,
1625
- error: o,
1630
+ error: l,
1626
1631
  placeholder: r,
1627
- value: l,
1632
+ value: o,
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: f,
1637
+ minRows: w = 4,
1638
+ maxRows: x,
1634
1639
  autogrow: h = !1,
1635
- namespace: b = "InputLexical",
1640
+ namespace: g = "InputLexical",
1636
1641
  nodes: p,
1637
- theme: m,
1638
- autoFocus: v = !1,
1639
- children: u,
1640
- className: I
1641
- } = t, R = ie(
1642
+ theme: u,
1643
+ autoFocus: b = !1,
1644
+ children: C,
1645
+ className: v
1646
+ } = n, k = se(
1642
1647
  () => ({
1643
- namespace: b,
1644
- theme: m ? { ...Nt, ...m } : Nt,
1645
- nodes: [...wr, ...p ?? []],
1646
- editorState: l ?? null,
1647
- onError: (z) => {
1648
- throw z;
1648
+ namespace: g,
1649
+ theme: u ? { ...wt, ...u } : wt,
1650
+ nodes: [...Nr, ...p ?? []],
1651
+ editorState: o ?? null,
1652
+ onError: (T) => {
1653
+ throw T;
1649
1654
  }
1650
1655
  }),
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(
1655
- (z) => {
1656
- a?.(JSON.stringify(z.toJSON()));
1659
+ ), I = Pe(
1660
+ (T) => {
1661
+ a?.(JSON.stringify(T.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
+ ), D = Y[i], O = !!l, P = (T) => `calc(${T} * 1lh + 1.5rem)`, L = h ? { minHeight: P(w), maxHeight: x ? P(x) : void 0 } : { height: P(w) };
1665
+ return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: m("flex flex-col", v), children: [
1666
+ /* @__PURE__ */ e(q, { children: t }),
1667
+ /* @__PURE__ */ e(gn, { initialConfig: k, 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(Pr, { render: f }),
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
1684
  D
1680
1685
  ),
1681
- style: P,
1686
+ style: L,
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
1693
  D
1689
1694
  ),
@@ -1692,38 +1697,38 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
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
+ b && /* @__PURE__ */ e(kn, {}),
1707
+ a && /* @__PURE__ */ e(yn, { onChange: I }),
1708
+ C,
1709
+ c === "floating" && /* @__PURE__ */ e(Lr, { render: f })
1705
1710
  ]
1706
1711
  }
1707
1712
  ) }),
1708
1713
  /* @__PURE__ */ e(V, { children: s }),
1709
- /* @__PURE__ */ e(K, { children: o })
1714
+ /* @__PURE__ */ e(K, { children: l })
1710
1715
  ] }) });
1711
- }, Dl = (t) => {
1716
+ }, Ol = (n) => {
1712
1717
  const {
1713
- className: n,
1718
+ className: t,
1714
1719
  label: s,
1715
- description: o,
1720
+ description: l,
1716
1721
  options: r,
1717
- error: l,
1722
+ error: o,
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
1734
  /* @__PURE__ */ e(q, { children: s }),
@@ -1731,218 +1736,216 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
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],
1741
+ te[a],
1737
1742
  Y[a],
1738
- fe[a],
1739
- he[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, f) => /* @__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
+ f
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
+ o && /* @__PURE__ */ e(ne, {}),
1760
+ /* @__PURE__ */ e(Z, { Icon: be })
1756
1761
  ] })
1757
1762
  ] }),
1758
- /* @__PURE__ */ e(V, { children: o }),
1759
- /* @__PURE__ */ e(K, { children: l })
1763
+ /* @__PURE__ */ e(V, { children: l }),
1764
+ /* @__PURE__ */ e(K, { children: o })
1760
1765
  ]
1761
1766
  }
1762
1767
  ) });
1763
- }, We = C.forwardRef((t, n) => {
1768
+ }, We = R.forwardRef((n, t) => {
1764
1769
  const {
1765
1770
  children: s,
1766
- onClick: o,
1771
+ onClick: l,
1767
1772
  selected: r,
1768
- disabled: l = !1,
1773
+ disabled: o = !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: () => !o && l && l(),
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
- r && !l && "option-selected",
1782
- a && !l && "option-active",
1783
- l && "option-disabled cursor-not-allowed hover:bg-transparent active:bg-transparent",
1786
+ r && !o && "option-selected",
1787
+ a && !o && "option-active",
1788
+ o && "option-disabled cursor-not-allowed hover:bg-transparent active:bg-transparent",
1784
1789
  i
1785
1790
  ),
1786
1791
  children: [
1787
1792
  /* @__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" }) })
1793
+ r && !o && /* @__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 = R.forwardRef((n, t) => {
1798
+ const { children: s, className: l, ...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
+ l
1802
1807
  ),
1803
1808
  children: s
1804
1809
  }
1805
1810
  );
1806
- }), $e = C.forwardRef((t, n) => {
1807
- const { className: s, ...o } = t;
1811
+ }), $e = R.forwardRef((n, t) => {
1812
+ const { className: s, ...l } = n;
1808
1813
  return /* @__PURE__ */ e(
1809
1814
  "div",
1810
1815
  {
1811
- ref: n,
1812
- ...o,
1813
- className: f(
1816
+ ref: t,
1817
+ ...l,
1818
+ className: m(
1814
1819
  "option-divider my-1 h-px",
1815
1820
  s
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,
1823
- fullWidth: o,
1824
- minWidth: r,
1825
- maxWidth: l,
1826
- open: a,
1827
- onOpenChange: i,
1828
- listRef: c,
1829
- activeIndex: g,
1830
- onNavigate: x,
1826
+ placement: t = "bottom",
1827
+ fullWidth: s,
1828
+ minWidth: l,
1829
+ maxWidth: r,
1830
+ open: o,
1831
+ onOpenChange: a,
1832
+ listRef: i,
1833
+ activeIndex: c,
1834
+ onNavigate: f,
1831
1835
  loop: w = !0,
1832
- disabledIndices: h
1833
- } = t, b = C.useMemo(() => [
1836
+ disabledIndices: x
1837
+ } = n, h = R.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: L, elements: T }) {
1842
+ s && (T.floating.style.width = `${L.reference.width}px`), l && (T.floating.style.minWidth = `${l}px`), r && (T.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,
1845
+ ], [s, r, l]), { refs: g, floatingStyles: p, context: u, placement: b } = st({
1846
+ placement: t,
1847
+ open: o,
1848
+ onOpenChange: a,
1849
+ middleware: h,
1850
+ whileElementsMounted: at
1851
+ }), C = hn(u, {
1852
+ listRef: i,
1853
+ activeIndex: c,
1854
+ onNavigate: f,
1851
1855
  loop: w,
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: x
1859
+ }), v = St(u, {
1860
+ outsidePress: !0,
1861
+ escapeKey: !1
1862
+ }), { getReferenceProps: k, getFloatingProps: I, getItemProps: D } = Dt([C, v]), O = R.useRef({
1863
+ floatingStyles: p,
1864
+ setFloating: g.setFloating,
1865
+ placement: t,
1866
+ getFloatingProps: I
1861
1867
  });
1862
- T.current = {
1863
- onOutsideClick: s,
1864
- floatingStyles: m,
1865
- setFloating: p.setFloating,
1866
- placement: u,
1867
- getFloatingProps: y
1868
+ O.current = {
1869
+ floatingStyles: p,
1870
+ setFloating: g.setFloating,
1871
+ placement: b,
1872
+ getFloatingProps: I
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 = R.useMemo(() => {
1875
+ const L = (T) => {
1876
+ const { floatingStyles: N, setFloating: y, placement: A, getFloatingProps: z } = O.current, { className: $, open: j, children: re } = T;
1872
1877
  return /* @__PURE__ */ e(
1873
- Ut,
1878
+ Ht,
1874
1879
  {
1875
- open: le,
1876
- className: j,
1877
- onOutsideClick: A,
1880
+ open: j,
1881
+ className: $,
1878
1882
  floatingStyles: N,
1879
- setFloating: k,
1880
- placement: O,
1881
- floatingProps: $(),
1882
- children: oe
1883
+ setFloating: y,
1884
+ placement: A,
1885
+ floatingProps: z(),
1886
+ children: re
1883
1887
  }
1884
1888
  );
1885
1889
  };
1886
- return C.memo(P);
1890
+ return R.memo(L);
1887
1891
  }, []);
1888
1892
  return {
1889
- anchorRef: p.setReference,
1890
- Popover: B,
1891
- getReferenceProps: R,
1893
+ anchorRef: g.setReference,
1894
+ Popover: P,
1895
+ getReferenceProps: k,
1892
1896
  getItemProps: D
1893
1897
  };
1894
- }, Pr = (t) => {
1898
+ }, Er = (n) => {
1895
1899
  const {
1896
- className: n,
1900
+ className: t,
1897
1901
  label: s,
1898
- description: o,
1902
+ description: l,
1899
1903
  options: r,
1900
- onChange: l,
1904
+ onChange: o,
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: f,
1909
+ size: w = "md",
1910
+ disabled: x = !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, [g, p] = W(!1), [u, b] = W(null), C = R.useRef(null), v = R.useRef([]), k = r?.find((N) => H(N) && G(N.value, a)), I = se(
1913
+ () => r.map((N, y) => !H(N) || N.disabled ? y : -1).filter((N) => N !== -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
+ xe(g, () => p(!1)), _(() => {
1917
+ if (g) {
1918
+ C.current?.focus({ preventScroll: !0 });
1919
+ const N = r.findIndex((y) => H(y) && G(y.value, a));
1916
1920
  if (N >= 0)
1917
- v(N);
1921
+ b(N);
1918
1922
  else {
1919
- const k = r.findIndex((A) => H(A) && !A.disabled);
1920
- v(k >= 0 ? k : null);
1923
+ const y = r.findIndex((A) => H(A) && !A.disabled);
1924
+ b(y >= 0 ? y : null);
1921
1925
  }
1922
1926
  } else
1923
- v(null);
1924
- }, [b]);
1925
- const { anchorRef: D, Popover: T, getReferenceProps: B, getItemProps: P } = _e({
1927
+ b(null);
1928
+ }, [g]);
1929
+ const { anchorRef: D, Popover: O, getReferenceProps: P, getItemProps: L } = _e({
1926
1930
  placement: "bottom",
1927
1931
  fullWidth: !0,
1928
1932
  minWidth: 200,
1929
- onOutsideClick: () => p(!1),
1930
- open: b,
1933
+ open: g,
1931
1934
  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));
1935
+ listRef: v,
1936
+ activeIndex: u,
1937
+ onNavigate: b,
1938
+ disabledIndices: I
1939
+ }), T = (N) => {
1940
+ const y = r[N];
1941
+ y && H(y) && !y.disabled && (o(y.value), p(!1));
1939
1942
  };
1940
- return /* @__PURE__ */ e(Q.Provider, { value: x, children: /* @__PURE__ */ d(
1943
+ return /* @__PURE__ */ e(Q.Provider, { value: w, 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
1951
  /* @__PURE__ */ e(q, { children: s }),
@@ -1950,141 +1953,140 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1950
1953
  /* @__PURE__ */ d(
1951
1954
  "div",
1952
1955
  {
1953
- ...B({
1954
- ref: u,
1956
+ ...P({
1957
+ ref: C,
1955
1958
  role: "button",
1956
- tabIndex: w ? -1 : 0,
1957
- "aria-disabled": w,
1959
+ tabIndex: x ? -1 : 0,
1960
+ "aria-disabled": x,
1958
1961
  onClick: () => {
1959
- w || p(!b);
1962
+ x || p(!g);
1960
1963
  },
1961
1964
  onKeyDown: (N) => {
1962
- w || (N.key === " " ? (N.preventDefault(), p((k) => !k)) : N.key === "Enter" && (N.preventDefault(), b && m != null ? z(m) : p(!0)));
1965
+ x || (N.key === " " ? (N.preventDefault(), p((y) => !y)) : N.key === "Enter" && (N.preventDefault(), g && u != null ? T(u) : p(!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[w],
1971
+ Y[w],
1972
+ me[w],
1973
+ h && a ? Be[w] : fe[w],
1974
+ x ? "select-trigger-disabled" : f && "select-trigger-error",
1975
+ !x && g && "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
+ k && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: k.label }),
1979
+ !k && 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
+ !x && f && /* @__PURE__ */ e(ne, {}),
1985
+ h && !!a && !x && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => o(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) => {
1988
+ /* @__PURE__ */ e(O, { open: g, 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((N, y) => {
1986
1989
  if (!H(N))
1987
1990
  return N.kind === "header" ? /* @__PURE__ */ e(
1988
1991
  He,
1989
1992
  {
1990
- ref: (O) => {
1991
- I.current[k] = O;
1993
+ ref: (z) => {
1994
+ v.current[y] = z;
1992
1995
  },
1993
1996
  children: N.label
1994
1997
  },
1995
- `header-${k}`
1998
+ `header-${y}`
1996
1999
  ) : /* @__PURE__ */ e(
1997
2000
  $e,
1998
2001
  {
1999
- ref: (O) => {
2000
- I.current[k] = O;
2002
+ ref: (z) => {
2003
+ v.current[y] = z;
2001
2004
  }
2002
2005
  },
2003
- `divider-${k}`
2006
+ `divider-${y}`
2004
2007
  );
2005
2008
  const A = G(N.value, a);
2006
2009
  return /* @__PURE__ */ e(
2007
2010
  We,
2008
2011
  {
2009
- ...P({
2010
- ref(O) {
2011
- I.current[k] = O;
2012
+ ...L({
2013
+ ref(z) {
2014
+ v.current[y] = z;
2012
2015
  }
2013
2016
  }),
2014
- onClick: () => z(k),
2017
+ onClick: () => T(y),
2015
2018
  selected: A,
2016
- active: m === k,
2019
+ active: u === y,
2017
2020
  disabled: N.disabled,
2018
2021
  children: N.label
2019
2022
  },
2020
- `option-${k}`
2023
+ `option-${y}`
2021
2024
  );
2022
2025
  }) }) }) })
2023
2026
  ] }),
2024
- /* @__PURE__ */ e(V, { children: o }),
2025
- /* @__PURE__ */ e(K, { children: g })
2027
+ /* @__PURE__ */ e(V, { children: l }),
2028
+ /* @__PURE__ */ e(K, { children: f })
2026
2029
  ]
2027
2030
  }
2028
2031
  ) });
2029
- }, Ol = (t) => {
2032
+ }, zl = (n) => {
2030
2033
  const {
2031
- className: n,
2034
+ className: t,
2032
2035
  label: s,
2033
- description: o,
2036
+ description: l,
2034
2037
  options: r,
2035
- onChange: l,
2038
+ onChange: o,
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: f = 300,
2043
+ error: w,
2044
+ size: x = "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
+ clearable: g = !0
2047
+ } = n, [p, u] = W(!1), [b, C] = W(r), [v, k] = W(""), [I, D] = W(null), O = R.useRef(null), P = R.useRef(null), L = R.useRef([]), T = r?.find((E) => H(E) && G(E.value, i)), N = se(() => v !== "" ? b : r, [v, b, r]), y = se(
2048
+ () => N.map((E, U) => !H(E) || E.disabled ? U : -1).filter((E) => E !== -1),
2046
2049
  [N]
2047
2050
  );
2048
- we(p, () => m(!1)), _(() => {
2049
- u(a(I));
2050
- }, [I, r, a]), _(() => {
2051
+ xe(p, () => u(!1)), _(() => {
2052
+ C(a(v));
2053
+ }, [v, r, a]), _(() => {
2051
2054
  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);
2055
+ setTimeout(() => P.current?.focus(), 100);
2056
+ const E = r.findIndex((U) => H(U) && G(U.value, i));
2057
+ if (E >= 0)
2058
+ D(E);
2056
2059
  else {
2057
- const U = r.findIndex((se) => H(se) && !se.disabled);
2060
+ const U = r.findIndex((le) => H(le) && !le.disabled);
2058
2061
  D(U >= 0 ? U : null);
2059
2062
  }
2060
2063
  } else
2061
- D(null), R("");
2064
+ D(null), k("");
2062
2065
  }, [p]), _(() => {
2063
2066
  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({
2067
+ const E = N.findIndex((U) => H(U) && !U.disabled);
2068
+ D(E >= 0 ? E : null);
2069
+ }, [v, p, N]);
2070
+ const { anchorRef: A, Popover: z, getReferenceProps: $, getItemProps: j } = _e({
2068
2071
  placement: "bottom",
2069
2072
  fullWidth: !0,
2070
2073
  minWidth: 200,
2071
- onOutsideClick: () => m(!1),
2072
2074
  open: p,
2073
- onOpenChange: m,
2074
- listRef: P,
2075
- activeIndex: y,
2075
+ onOpenChange: u,
2076
+ listRef: L,
2077
+ activeIndex: I,
2076
2078
  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(
2079
+ disabledIndices: y
2080
+ }), re = (E) => {
2081
+ const U = N[E];
2082
+ U && H(U) && !U.disabled && (o(U.value), u(!1));
2083
+ }, Ne = N.some((E) => H(E));
2084
+ return /* @__PURE__ */ e(Q.Provider, { value: x, 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
2092
  /* @__PURE__ */ e(q, { children: s }),
@@ -2093,91 +2095,91 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
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 || u(!p);
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(), u((U) => !U)) : E.key === "Enter" && !p && (E.preventDefault(), u(!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",
2111
+ te[x],
2112
+ Y[x],
2113
+ me[x],
2114
+ g && i ? Be[x] : fe[x],
2115
+ h ? "select-trigger-disabled" : w && "select-trigger-error",
2114
2116
  !h && p && "ring-4"
2115
2117
  ),
2116
2118
  children: [
2117
- z && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: z.label }),
2118
- !z && c && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: c })
2119
+ T && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: T.label }),
2120
+ !T && c && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: c })
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 && w && /* @__PURE__ */ e(ne, {}),
2126
+ g && !!i && !h && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => o(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(z, { open: p, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: f }, 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: v,
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) => k(E.target.value),
2140
+ onKeyDown: (E) => {
2141
+ E.key === "Enter" && I != null && (E.preventDefault(), re(I));
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
+ v !== "" && !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
+ N.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
+ L.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
+ L.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
+ L.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: I === 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: l }),
2191
+ /* @__PURE__ */ e(K, { children: w })
2190
2192
  ]
2191
2193
  }
2192
2194
  ) });
2193
- }, Er = (t, n) => {
2194
- const [s, o] = W(t);
2195
+ }, Fr = (n, t) => {
2196
+ const [s, l] = W(n);
2195
2197
  return _(() => {
2196
2198
  const r = setTimeout(() => {
2197
- o(t);
2198
- }, n);
2199
+ l(n);
2200
+ }, t);
2199
2201
  return () => {
2200
2202
  clearTimeout(r);
2201
2203
  };
2202
- }, [t, n]), s;
2203
- }, zl = (t) => {
2204
+ }, [n, t]), s;
2205
+ }, Tl = (n) => {
2204
2206
  const {
2205
- className: n,
2207
+ className: t,
2206
2208
  label: s,
2207
- description: o,
2209
+ description: l,
2208
2210
  onChange: r,
2209
- fetchOptionsByQuery: l,
2211
+ fetchOptionsByQuery: o,
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: f,
2216
+ maxHeight: w = 300,
2217
+ error: x,
2216
2218
  size: h = "md",
2217
- disabled: b = !1,
2219
+ disabled: g = !1,
2218
2220
  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]
2221
+ } = n, [u, b] = W(!1), C = R.useRef(null), [v, k] = W(""), [I, D] = W([]), [O, P] = W(null), L = R.useRef(null), [T, N] = W(!1), [y, A] = W(!1), [z, $] = W(null), j = R.useRef([]), re = se(
2222
+ () => I.map((M, B) => !H(M) || M.disabled ? B : -1).filter((M) => M !== -1),
2223
+ [I]
2222
2224
  );
2223
- we(m, () => v(!1));
2224
- const oe = Er(I, i);
2225
+ xe(u, () => b(!1));
2226
+ const Ne = Fr(v, i);
2225
2227
  _(() => {
2226
2228
  (async () => {
2227
2229
  N(!0);
2228
- const F = await l(oe);
2229
- D(F), N(!1);
2230
+ const B = await o(Ne);
2231
+ D(B), N(!1);
2230
2232
  })();
2231
- }, [oe, l]), _(() => {
2233
+ }, [Ne, o]), _(() => {
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
+ const M = I?.find((B) => H(B) && G(B.value, c));
2239
+ M ? P(M) : (async () => {
2238
2240
  A(!0);
2239
- const ae = await a(c);
2240
- B(ae), A(!1);
2241
+ const oe = await a(c);
2242
+ P(oe), A(!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);
2244
+ }, [a, I, c]), _(() => {
2245
+ u ? setTimeout(() => L.current?.focus(), 100) : ($(null), k(""));
2246
+ }, [u]), _(() => {
2247
+ if (!u) return;
2248
+ const M = I.findIndex((B) => H(B) && !B.disabled);
2247
2249
  $(M >= 0 ? M : null);
2248
- }, [y, m]);
2249
- const { anchorRef: L, Popover: U, getReferenceProps: se, getItemProps: ee } = _e({
2250
+ }, [I, u]);
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: u,
2256
+ onOpenChange: b,
2256
2257
  listRef: j,
2257
- activeIndex: O,
2258
+ activeIndex: z,
2258
2259
  onNavigate: $,
2259
- disabledIndices: le
2260
+ disabledIndices: re
2260
2261
  }), 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));
2262
+ const B = I[M];
2263
+ B && H(B) && !B.disabled && (r(B.value), b(!1));
2264
+ }, ze = I.some((M) => H(M));
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
2273
  /* @__PURE__ */ e(q, { children: s }),
2273
- /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: L, children: [
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: C,
2279
2280
  role: "button",
2280
- tabIndex: b ? -1 : 0,
2281
- "aria-disabled": b,
2281
+ tabIndex: g ? -1 : 0,
2282
+ "aria-disabled": g,
2282
2283
  onClick: () => {
2283
- b || v(!m);
2284
+ g || b(!u);
2284
2285
  },
2285
2286
  onKeyDown: (M) => {
2286
- b || (M.key === " " ? (M.preventDefault(), v((F) => !F)) : M.key === "Enter" && !m && (M.preventDefault(), v(!0)));
2287
+ g || (M.key === " " ? (M.preventDefault(), b((B) => !B)) : M.key === "Enter" && !u && (M.preventDefault(), b(!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
+ te[h],
2292
2293
  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"
2294
+ me[h],
2295
+ p && c ? Be[h] : fe[h],
2296
+ g ? "select-trigger-disabled" : x && "select-trigger-error",
2297
+ !g && u && "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
+ !y && O && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: O.label }),
2301
+ !y && !O && f && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: f }),
2302
+ y && /* @__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
+ !g && x && /* @__PURE__ */ e(ne, {}),
2308
+ p && !!c && !g && /* @__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: u, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: w }, 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: L,
2316
2317
  type: "text",
2317
2318
  placeholder: "Search",
2318
- value: I,
2319
+ value: v,
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
+ onChange: (M) => k(M.target.value),
2321
2322
  onKeyDown: (M) => {
2322
- M.key === "Enter" && O != null && (M.preventDefault(), Oe(O));
2323
+ M.key === "Enter" && z != null && (M.preventDefault(), Oe(z));
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
- !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
- 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) => {
2330
+ !T && !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)]" }) }),
2331
+ T && /* @__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)]" }) }),
2332
+ !T && I.map((M, B) => {
2332
2333
  if (!H(M))
2333
2334
  return M.kind === "header" ? /* @__PURE__ */ e(
2334
2335
  He,
2335
2336
  {
2336
- ref: (ge) => {
2337
- j.current[F] = ge;
2337
+ ref: (pe) => {
2338
+ j.current[B] = pe;
2338
2339
  },
2339
2340
  children: M.label
2340
2341
  },
2341
- `header-${F}`
2342
+ `header-${B}`
2342
2343
  ) : /* @__PURE__ */ e(
2343
2344
  $e,
2344
2345
  {
2345
- ref: (ge) => {
2346
- j.current[F] = ge;
2346
+ ref: (pe) => {
2347
+ j.current[B] = pe;
2347
2348
  }
2348
2349
  },
2349
- `divider-${F}`
2350
+ `divider-${B}`
2350
2351
  );
2351
- const ae = G(M.value, c);
2352
+ const oe = G(M.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[B] = pe;
2358
2359
  }
2359
2360
  }),
2360
- onClick: () => Oe(F),
2361
- selected: ae,
2362
- active: O === F,
2361
+ onClick: () => Oe(B),
2362
+ selected: oe,
2363
+ active: z === B,
2363
2364
  disabled: M.disabled,
2364
2365
  children: M.label
2365
2366
  },
2366
- `option-${F}`
2367
+ `option-${B}`
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: l }),
2374
+ /* @__PURE__ */ e(K, { children: x })
2374
2375
  ]
2375
2376
  }
2376
2377
  ) });
@@ -2399,410 +2400,409 @@ 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 = R.forwardRef((n, t) => {
2403
2404
  const {
2404
2405
  className: s,
2405
- children: o,
2406
+ children: l,
2406
2407
  onClick: r,
2407
- showCloseIcon: l,
2408
+ showCloseIcon: o,
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
2414
  s
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
- l && /* @__PURE__ */ e(
2424
- ue,
2423
+ /* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: l }),
2424
+ o && /* @__PURE__ */ e(
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: l })
2434
2435
  ] });
2435
2436
  });
2436
- function Fr(t) {
2437
+ function Br(n) {
2437
2438
  const {
2438
- enabled: n,
2439
+ enabled: t,
2439
2440
  triggerRef: s,
2440
- measureRef: o,
2441
+ measureRef: l,
2441
2442
  trayRef: r,
2442
- itemCount: l,
2443
+ itemCount: o,
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, f] = W(0);
2447
+ return It(() => {
2448
+ if (!t) return;
2449
+ const w = s.current, x = l.current;
2450
+ if (!w || !x) return;
2450
2451
  const h = () => {
2451
- if (l === 0) {
2452
- g(0);
2452
+ if (o === 0) {
2453
+ f(0);
2453
2454
  return;
2454
2455
  }
2455
- if (l === 1) {
2456
- g(1);
2456
+ if (o === 1) {
2457
+ f(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 p = window.getComputedStyle(w), u = parseFloat(p.paddingLeft || "0"), b = w.getBoundingClientRect(), C = b.left + u;
2461
+ let v = b.right - parseFloat(p.paddingRight || "0");
2462
+ const k = r?.current;
2463
+ if (k) {
2464
+ const N = k.getBoundingClientRect();
2465
+ N.width > 0 && (v = Math.min(v, N.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 I = Math.max(0, v - C), D = Array.from(x.children);
2468
+ if (D.length < o + 1) return;
2469
+ let O = 0;
2470
+ for (let N = 0; N < o; N++)
2471
+ O += D[N].offsetWidth + (N > 0 ? i : 0);
2472
+ if (O <= I) {
2473
+ f(o);
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 = D[o].offsetWidth;
2477
+ let L = 0, T = 0;
2478
+ for (let N = 0; N < o; N++) {
2479
+ const y = D[N].offsetWidth, A = L + y + (N > 0 ? i : 0);
2480
+ if (A + P + i > I) break;
2481
+ L = A, T++;
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
+ f(Math.max(1, T));
2484
+ }, g = new ResizeObserver(h);
2485
+ return g.observe(w), r?.current && g.observe(r.current), h(), () => g.disconnect();
2486
+ }, [t, o, ...a]), c;
2486
2487
  }
2487
- const Tl = (t) => {
2488
+ const Pl = (n) => {
2488
2489
  const {
2489
- className: n,
2490
+ className: t,
2490
2491
  label: s,
2491
- description: o,
2492
+ description: l,
2492
2493
  options: r,
2493
- onChange: l,
2494
+ onChange: o,
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: f = 300,
2499
+ error: w,
2500
+ size: x = "md",
2500
2501
  singleLine: h = !1,
2501
- color: b = "blue",
2502
+ color: g = "blue",
2502
2503
  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),
2504
+ clearable: u = !0
2505
+ } = n, [b, C] = W(!1), [v, k] = W(r), [I, D] = W(""), [O, P] = W(null), L = R.useRef(null), T = R.useRef(null), N = R.useRef([]), y = R.useRef(null), A = R.useRef(null), z = se(
2506
+ () => i.map((S) => r.find((F) => H(F) && G(F.value, S))).filter((S) => S !== void 0),
2506
2507
  [i, r]
2507
2508
  ), $ = (S) => {
2508
2509
  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),
2510
+ const F = S.toLowerCase();
2511
+ return r.filter((Ie) => H(Ie) && typeof Ie.label == "string" ? Ie.label.toLowerCase().includes(F) : !0);
2512
+ }, j = se(
2513
+ () => I !== "" ? v : r,
2514
+ [I, v, r]
2515
+ ), re = se(
2516
+ () => j.map((S, F) => !H(S) || S.disabled ? F : -1).filter((S) => S !== -1),
2516
2517
  [j]
2517
2518
  );
2518
- we(v, () => u(!1)), _(() => {
2519
- R((a ?? $)(y));
2520
- }, [y, r, a]), _(() => {
2521
- if (v) {
2522
- setTimeout(() => z.current?.focus(), 100);
2523
- const S = r.findIndex((E) => H(E) && !E.disabled);
2524
- B(S >= 0 ? S : null);
2519
+ xe(b, () => C(!1)), _(() => {
2520
+ k((a ?? $)(I));
2521
+ }, [I, r, a]), _(() => {
2522
+ if (b) {
2523
+ setTimeout(() => T.current?.focus(), 100);
2524
+ const S = r.findIndex((F) => H(F) && !F.disabled);
2525
+ P(S >= 0 ? S : 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), D("");
2528
+ }, [b]), _(() => {
2529
+ if (!b) return;
2530
+ const S = j.findIndex((F) => H(F) && !F.disabled);
2531
+ P(S >= 0 ? S : null);
2532
+ }, [I, b, j]);
2533
+ const Ne = Br({
2533
2534
  enabled: h,
2534
- triggerRef: P,
2535
- measureRef: k,
2535
+ triggerRef: L,
2536
+ measureRef: y,
2536
2537
  trayRef: A,
2537
- itemCount: O.length,
2538
- deps: [O, x]
2539
- }), { anchorRef: L, Popover: U, getReferenceProps: se, getItemProps: ee } = _e({
2538
+ itemCount: z.length,
2539
+ deps: [z, w]
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,
2544
+ open: b,
2545
+ onOpenChange: C,
2546
2546
  listRef: N,
2547
- activeIndex: T,
2548
- onNavigate: B,
2549
- disabledIndices: le
2547
+ activeIndex: O,
2548
+ onNavigate: P,
2549
+ disabledIndices: re
2550
2550
  }), Oe = (S) => {
2551
- i.some((E) => G(E, S)) ? l(i.filter((E) => !G(E, S))) : l([...i, S]);
2551
+ i.some((F) => G(F, S)) ? o(i.filter((F) => !G(F, S))) : o([...i, S]);
2552
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(
2553
+ const F = j[S];
2554
+ F && H(F) && !F.disabled && Oe(F.value);
2555
+ }, M = j.some((S) => H(S)), B = i.length > 0, oe = h ? Ne : z.length, pe = z.slice(0, oe), ut = z.length - oe;
2556
+ return /* @__PURE__ */ e(Q.Provider, { value: x, 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
2564
  /* @__PURE__ */ e(q, { children: s }),
2565
- /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: L, children: [
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: L,
2571
2571
  role: "button",
2572
2572
  tabIndex: p ? -1 : 0,
2573
2573
  "aria-disabled": p,
2574
2574
  onClick: () => {
2575
- p || u(!v);
2575
+ p || C(!b);
2576
2576
  },
2577
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))));
2578
+ p || (S.key === " " ? (S.preventDefault(), C((F) => !F)) : S.key === "Enter" && !b ? (S.preventDefault(), C(!0)) : S.key === "Backspace" && !b && B && (S.preventDefault(), o(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[x]),
2584
+ !h && m("flex-wrap py-1.5", Ft[x]),
2585
+ Y[x],
2586
+ me[x],
2587
+ u && B ? Be[x] : fe[x],
2588
+ p ? "select-trigger-disabled" : w && "select-trigger-error",
2589
+ !p && b && "ring-4"
2590
2590
  ),
2591
2591
  children: [
2592
- F && ge.map((S, E) => /* @__PURE__ */ e(
2592
+ B && pe.map((S, 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: g,
2596
+ className: m(
2597
+ h && oe > 1 && "shrink-0",
2598
+ (!h || oe === 1) && "max-w-full min-w-0"
2599
2599
  ),
2600
2600
  children: S.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
+ B && 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
+ !B && 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: y,
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
+ z.map((S, F) => /* @__PURE__ */ e(Ee, { color: g, children: S.label }, `measure-${F}`)),
2621
+ z.length > 0 && /* @__PURE__ */ d("span", { className: "text-sm font-medium px-1", children: [
2622
2622
  "+",
2623
- O.length,
2623
+ z.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: A, children: [
2630
+ !p && w && /* @__PURE__ */ e(ne, {}),
2631
+ u && B && !p && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => o([]) }),
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: b, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: f }, 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",
2638
2638
  {
2639
- ref: z,
2639
+ ref: T,
2640
2640
  type: "text",
2641
2641
  placeholder: "Search",
2642
- value: y,
2642
+ value: I,
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
2644
  onChange: (S) => D(S.target.value),
2645
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)));
2646
+ S.key === "Enter" && O != null ? (S.preventDefault(), ze(O)) : S.key === "Backspace" && I === "" && B && (S.preventDefault(), o(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) => {
2653
+ I !== "" && !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, F) => {
2655
2655
  if (!H(S))
2656
2656
  return S.kind === "header" ? /* @__PURE__ */ e(
2657
2657
  He,
2658
2658
  {
2659
- ref: (be) => {
2660
- N.current[E] = be;
2659
+ ref: (ge) => {
2660
+ N.current[F] = ge;
2661
2661
  },
2662
2662
  children: S.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
+ N.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, S.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
+ N.current[F] = ge;
2681
2681
  }
2682
2682
  }),
2683
- onClick: () => ze(E),
2683
+ onClick: () => ze(F),
2684
2684
  selected: Ie,
2685
- active: T === E,
2685
+ active: O === F,
2686
2686
  disabled: S.disabled,
2687
2687
  children: S.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: l }),
2696
+ /* @__PURE__ */ e(K, { children: w })
2697
2697
  ]
2698
2698
  }
2699
2699
  ) });
2700
- }, Ll = C.forwardRef((t, n) => {
2700
+ }, Ll = R.forwardRef((n, t) => {
2701
2701
  const {
2702
2702
  className: s,
2703
- children: o,
2703
+ children: l,
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
2712
  s
2713
2713
  ),
2714
2714
  ...r,
2715
- children: o
2715
+ children: l
2716
2716
  }
2717
2717
  );
2718
- }), Pl = C.forwardRef((t, n) => {
2718
+ }), El = R.forwardRef((n, t) => {
2719
2719
  const {
2720
2720
  className: s,
2721
- children: o,
2721
+ children: l,
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
2730
  s
2731
2731
  ),
2732
2732
  ...r,
2733
- children: o
2733
+ children: l
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,
2738
+ className: t,
2739
2739
  label: s,
2740
- children: o,
2740
+ children: l,
2741
2741
  orientation: r = "vertical",
2742
- ...l
2743
- } = t;
2742
+ ...o
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
- ...l,
2751
+ ...o,
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: s }),
2754
+ /* @__PURE__ */ e("div", { className: "w-1/2 line-clamp-1 break-all", children: l })
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
- ...l,
2764
+ ...o,
2765
2765
  children: [
2766
2766
  s && /* @__PURE__ */ e("div", { className: yt, children: s }),
2767
- /* @__PURE__ */ e("div", { children: o })
2767
+ /* @__PURE__ */ e("div", { children: l })
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,
2783
+ className: t,
2784
2784
  children: s,
2785
- Icon: o,
2785
+ Icon: l,
2786
2786
  status: r,
2787
- ...l
2788
- } = t, a = r ? Br[r] : null, i = /* @__PURE__ */ d(te, { children: [
2787
+ ...o
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" }),
2790
+ l && /* @__PURE__ */ e(l, { className: "h-5 w-5 shrink-0" }),
2791
2791
  /* @__PURE__ */ e("span", { className: "truncate", children: s })
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
- if (l.href !== void 0) {
2799
- const { href: c, ...g } = l;
2798
+ if (o.href !== void 0) {
2799
+ const { href: c, ...f } = o;
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
+ ...f,
2806
2806
  children: i
2807
2807
  }
2808
2808
  );
@@ -2810,66 +2810,66 @@ const Tl = (t) => {
2810
2810
  return /* @__PURE__ */ e(
2811
2811
  "button",
2812
2812
  {
2813
- className: f(Ct, n),
2814
- ...l,
2813
+ className: m(kt, t),
2814
+ ...o,
2815
2815
  children: i
2816
2816
  }
2817
2817
  );
2818
- }, Fl = (t) => {
2818
+ }, Bl = (n) => {
2819
2819
  const {
2820
- className: n,
2820
+ className: t,
2821
2821
  vertical: s = !1,
2822
- ...o
2823
- } = t;
2822
+ ...l
2823
+ } = n;
2824
2824
  return /* @__PURE__ */ e(
2825
2825
  "div",
2826
2826
  {
2827
- className: f(
2827
+ className: m(
2828
2828
  s ? "w-px h-full bg-[var(--color-divider)]" : "w-full h-px bg-[var(--color-divider)]",
2829
- n
2829
+ t
2830
2830
  ),
2831
- ...o
2831
+ ...l
2832
2832
  }
2833
2833
  );
2834
- }, Bl = (t) => {
2834
+ }, Al = (n) => {
2835
2835
  const {
2836
- children: n,
2836
+ children: t,
2837
2837
  content: s,
2838
- className: o,
2838
+ className: l,
2839
2839
  placement: r = "top",
2840
- minWidth: l = 100,
2840
+ minWidth: o = 100,
2841
2841
  maxWidth: a = 200
2842
- } = t, [i, c] = W(!1), { anchorRef: g, Popover: x } = dt({
2842
+ } = n, [i, c] = W(!1), { anchorRef: f, Popover: w } = ct({
2843
2843
  placement: r,
2844
- minWidth: l,
2844
+ minWidth: o,
2845
2845
  maxWidth: a
2846
2846
  });
2847
2847
  return /* @__PURE__ */ d(
2848
2848
  "span",
2849
2849
  {
2850
- ref: g,
2851
- className: o,
2850
+ ref: f,
2851
+ className: l,
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(w, { open: i, children: /* @__PURE__ */ e(ve, { children: s }) })
2857
2857
  ]
2858
2858
  }
2859
2859
  );
2860
- }, Al = (t) => {
2860
+ }, Ul = (n) => {
2861
2861
  const {
2862
- open: n,
2862
+ open: t,
2863
2863
  onDismiss: s,
2864
- enableDismissOnOutsideClick: o,
2864
+ enableDismissOnOutsideClick: l,
2865
2865
  enableDismissOnEscKey: r,
2866
- enableDismissButton: l,
2866
+ enableDismissButton: o,
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, s || (() => {
2872
+ })), /* @__PURE__ */ e(De, { children: t && /* @__PURE__ */ d(Me, { children: [
2873
2873
  /* @__PURE__ */ e(
2874
2874
  J.div,
2875
2875
  {
@@ -2880,10 +2880,10 @@ 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: l ? s : void 0,
2887
2887
  lockScroll: !0
2888
2888
  }
2889
2889
  )
@@ -2892,7 +2892,7 @@ const Tl = (t) => {
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
2893
  J.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
  ),
@@ -2902,10 +2902,10 @@ const Tl = (t) => {
2902
2902
  exit: { opacity: 0, scale: 0.98, translateY: 10 },
2903
2903
  transition: { duration: 0.15, ease: "easeInOut" },
2904
2904
  children: [
2905
- l && /* @__PURE__ */ e(
2906
- Bt,
2905
+ o && /* @__PURE__ */ e(
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",
@@ -2917,19 +2917,19 @@ const Tl = (t) => {
2917
2917
  }
2918
2918
  ) })
2919
2919
  ] }) });
2920
- }, Ul = (t) => {
2920
+ }, Wl = (n) => {
2921
2921
  const {
2922
- open: n,
2922
+ open: t,
2923
2923
  onDismiss: s,
2924
- enableDismissOnOutsideClick: o,
2924
+ enableDismissOnOutsideClick: l,
2925
2925
  enableDismissOnEscKey: r,
2926
- enableDismissButton: l,
2926
+ enableDismissButton: o,
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, s || (() => {
2932
+ })), /* @__PURE__ */ e(De, { children: t && /* @__PURE__ */ d(Me, { children: [
2933
2933
  /* @__PURE__ */ e(
2934
2934
  J.div,
2935
2935
  {
@@ -2940,10 +2940,10 @@ 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: l ? s : void 0,
2947
2947
  lockScroll: !0
2948
2948
  }
2949
2949
  )
@@ -2952,7 +2952,7 @@ const Tl = (t) => {
2952
2952
  /* @__PURE__ */ e("div", { className: "fixed inset-0 flex flex-row justify-end pointer-events-none z-50", children: /* @__PURE__ */ d(
2953
2953
  J.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
  ),
@@ -2962,10 +2962,10 @@ const Tl = (t) => {
2962
2962
  exit: { translateX: "100%" },
2963
2963
  transition: { duration: 0.25, ease: [0.32, 0.72, 0, 1] },
2964
2964
  children: [
2965
- l && /* @__PURE__ */ e(
2966
- Bt,
2965
+ o && /* @__PURE__ */ e(
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",
@@ -2977,186 +2977,186 @@ const Tl = (t) => {
2977
2977
  }
2978
2978
  ) })
2979
2979
  ] }) });
2980
- }, Ur = (t) => {
2980
+ }, Wr = (n) => {
2981
2981
  const {
2982
- className: n,
2982
+ className: t,
2983
2983
  tabs: s
2984
- } = t;
2985
- return /* @__PURE__ */ e("div", { className: f(
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: s.map((l, r) => {
2989
+ const o = 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
+ l.active && "tab-button-active shadow-sm"
2992
2992
  );
2993
- return o.href ? /* @__PURE__ */ d(
2993
+ return l.href ? /* @__PURE__ */ d(
2994
2994
  "a",
2995
2995
  {
2996
- href: o.href,
2997
- className: l,
2996
+ href: l.href,
2997
+ className: o,
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
+ l.Icon && /* @__PURE__ */ e(l.Icon, { className: "h-5 w-5 shrink-0 mr-2 -ml-1" }),
3000
+ l.label
3001
3001
  ]
3002
3002
  },
3003
3003
  r
3004
3004
  ) : /* @__PURE__ */ d(
3005
3005
  "button",
3006
3006
  {
3007
- className: l,
3008
- onClick: o.onClick,
3007
+ className: o,
3008
+ onClick: l.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
+ l.Icon && /* @__PURE__ */ e(l.Icon, { className: "h-5 w-5 shrink-0 mr-2 -ml-1" }),
3011
+ l.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,
3019
+ duration: t = 0.3,
3020
3020
  ease: s = "easeInOut",
3021
- horizontal: o = !1,
3021
+ horizontal: l = !1,
3022
3022
  children: r,
3023
- className: l,
3023
+ className: o,
3024
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;
3025
+ } = n, i = R.useRef(null), c = R.useRef(null), f = R.useRef(null);
3026
+ return R.useEffect(() => {
3027
+ const w = i.current, x = c.current;
3028
+ if (!w || !x) return;
3029
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)) {
3030
+ const g = () => {
3031
+ const u = l ? w.scrollWidth - w.clientWidth : w.scrollHeight - w.clientHeight, b = l ? w.scrollLeft : w.scrollTop;
3032
+ if (!(u <= 0 || Math.abs(u - b) < 1)) {
3033
3033
  if (h) {
3034
- h = !1, o ? x.scrollLeft = m : x.scrollTop = m;
3034
+ h = !1, l ? w.scrollLeft = u : w.scrollTop = u;
3035
3035
  return;
3036
3036
  }
3037
- g.current?.stop(), g.current = Xt(v, m, {
3038
- duration: n,
3037
+ f.current?.stop(), f.current = Kt(b, u, {
3038
+ duration: t,
3039
3039
  ease: s,
3040
- onUpdate: (u) => {
3041
- o ? x.scrollLeft = u : x.scrollTop = u;
3040
+ onUpdate: (C) => {
3041
+ l ? w.scrollLeft = C : w.scrollTop = C;
3042
3042
  }
3043
3043
  });
3044
3044
  }
3045
- }, p = new ResizeObserver(b);
3046
- return p.observe(w), () => {
3047
- p.disconnect(), g.current?.stop();
3045
+ }, p = new ResizeObserver(g);
3046
+ return p.observe(x), () => {
3047
+ p.disconnect(), f.current?.stop();
3048
3048
  };
3049
- }, [n, s, o]), /* @__PURE__ */ e(
3049
+ }, [t, s, l]), /* @__PURE__ */ e(
3050
3050
  "div",
3051
3051
  {
3052
3052
  ref: i,
3053
- className: f(
3053
+ className: m(
3054
3054
  "min-h-0 min-w-0",
3055
- o ? "overflow-x-auto" : "overflow-y-auto",
3056
- l
3055
+ l ? "overflow-x-auto" : "overflow-y-auto",
3056
+ o
3057
3057
  ),
3058
3058
  ...a,
3059
3059
  children: /* @__PURE__ */ e("div", { ref: c, children: r })
3060
3060
  }
3061
3061
  );
3062
3062
  };
3063
- function Wr(t) {
3063
+ function Hr(n) {
3064
3064
  const {
3065
- onDelta: n,
3065
+ onDelta: t,
3066
3066
  onDragStart: s,
3067
- onDragEnd: o,
3067
+ onDragEnd: l,
3068
3068
  disabled: r = !1,
3069
- primaryButtonOnly: l = !0,
3069
+ primaryButtonOnly: o = !0,
3070
3070
  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 });
3072
- C.useEffect(() => {
3073
- m.current = { onDelta: n, onDragStart: s, onDragEnd: o, preventScrollOnMove: a };
3071
+ } = n, [i, c] = R.useState(!1), f = R.useRef(!1), w = R.useRef(0), x = R.useRef(0), h = R.useRef(0), g = R.useRef(null), p = R.useRef(null), u = R.useRef({ onDelta: t, onDragStart: s, onDragEnd: l, preventScrollOnMove: a });
3072
+ R.useEffect(() => {
3073
+ u.current = { onDelta: t, onDragStart: s, onDragEnd: l, preventScrollOnMove: a };
3074
3074
  });
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,
3075
+ const b = R.useRef({}), C = R.useCallback((k) => {
3076
+ if (!f.current) return;
3077
+ const I = {
3078
+ clientX: k ?? x.current,
3079
+ startX: w.current,
3080
3080
  totalDeltaX: h.current,
3081
- target: b.current
3081
+ target: g.current
3082
3082
  };
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,
3083
+ f.current = !1, c(!1);
3084
+ const { move: D, up: O, keydown: P } = b.current;
3085
+ D && window.removeEventListener("pointermove", D, !0), O && (window.removeEventListener("pointerup", O, !0), window.removeEventListener("pointercancel", O, !0)), P && window.removeEventListener("keydown", P, !0), b.current = {}, p.current != null && (cancelAnimationFrame(p.current), p.current = null), u.current.onDragEnd?.(I), g.current = null, h.current = 0;
3086
+ }, []), v = R.useCallback((k) => {
3087
+ if (r || o && k.button !== 0) return;
3088
+ k.target.setPointerCapture?.(k.pointerId), w.current = k.clientX, x.current = k.clientX, h.current = 0, g.current = k.target, f.current = !0, c(!0);
3089
+ const I = {
3090
+ clientX: k.clientX,
3091
+ startX: k.clientX,
3092
3092
  totalDeltaX: 0,
3093
- target: R.target
3093
+ target: k.target
3094
3094
  };
3095
- m.current.onDragStart?.(y);
3096
- const D = (P) => {
3097
- g.current && p.current == null && (p.current = requestAnimationFrame(() => {
3095
+ u.current.onDragStart?.(I);
3096
+ const D = (L) => {
3097
+ f.current && p.current == null && (p.current = requestAnimationFrame(() => {
3098
3098
  p.current = null;
3099
- const z = P.clientX, N = z - w.current;
3099
+ const T = L.clientX, N = T - x.current;
3100
3100
  if (N === 0) return;
3101
- w.current = z, h.current += N;
3102
- const k = {
3103
- clientX: z,
3104
- startX: x.current,
3101
+ x.current = T, h.current += N;
3102
+ const y = {
3103
+ clientX: T,
3104
+ startX: w.current,
3105
3105
  totalDeltaX: h.current,
3106
- target: b.current
3106
+ target: g.current
3107
3107
  };
3108
- m.current.preventScrollOnMove && P.preventDefault(), m.current.onDelta(N, k);
3108
+ u.current.preventScrollOnMove && L.preventDefault(), u.current.onDelta(N, y);
3109
3109
  }));
3110
- }, T = (P) => {
3111
- u(P.clientX);
3112
- }, B = (P) => {
3113
- P.key === "Escape" && (P.preventDefault(), u());
3110
+ }, O = (L) => {
3111
+ C(L.clientX);
3112
+ }, P = (L) => {
3113
+ L.key === "Escape" && (L.preventDefault(), C());
3114
3114
  };
3115
- v.current = { move: D, up: T, keydown: B }, window.addEventListener("pointermove", D, {
3115
+ b.current = { move: D, up: O, keydown: P }, window.addEventListener("pointermove", D, {
3116
3116
  passive: !a,
3117
3117
  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]);
3120
- return C.useEffect(() => () => {
3121
- g.current && u();
3122
- }, [u]), {
3118
+ }), window.addEventListener("pointerup", O, { capture: !0 }), window.addEventListener("pointercancel", O, { capture: !0 }), window.addEventListener("keydown", P, !0);
3119
+ }, [C, r, a, o]);
3120
+ return R.useEffect(() => () => {
3121
+ f.current && C();
3122
+ }, [C]), {
3123
3123
  isDragging: i,
3124
3124
  bind: {
3125
- onPointerDown: I,
3125
+ onPointerDown: v,
3126
3126
  role: "separator",
3127
3127
  style: { touchAction: "none", cursor: "col-resize", userSelect: "none" }
3128
3128
  }
3129
3129
  };
3130
3130
  }
3131
- const Hr = (t) => {
3131
+ const $r = (n) => {
3132
3132
  const {
3133
- column: n,
3133
+ column: t,
3134
3134
  width: s,
3135
- height: o,
3135
+ height: l,
3136
3136
  onResize: r,
3137
- sortDirection: l,
3137
+ sortDirection: o,
3138
3138
  onSortClick: a
3139
- } = t, i = !!n.sortable, { bind: c } = Wr({
3140
- onDelta: (g) => r(g)
3139
+ } = n, i = !!t.sortable, { bind: c } = Hr({
3140
+ onDelta: (f) => r(f)
3141
3141
  });
3142
3142
  return /* @__PURE__ */ d(
3143
3143
  "div",
3144
3144
  {
3145
- style: { width: s, height: o },
3145
+ style: { width: s, height: l },
3146
3146
  className: "flex flex-row items-stretch select-none shrink-0",
3147
3147
  children: [
3148
3148
  /* @__PURE__ */ d(
3149
3149
  "div",
3150
3150
  {
3151
- className: f(
3151
+ className: m(
3152
3152
  "flex-1 min-w-0 px-4 table-header-cell transition-colors duration-100 flex flex-row items-center gap-2",
3153
3153
  i && "cursor-pointer"
3154
3154
  ),
3155
3155
  onClick: i ? a : void 0,
3156
3156
  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" })
3157
+ /* @__PURE__ */ e("span", { className: "truncate", children: t.header }),
3158
+ i && o === "asc" && /* @__PURE__ */ e(dn, { className: "h-4 w-4 shrink-0" }),
3159
+ i && o === "desc" && /* @__PURE__ */ e(be, { className: "h-4 w-4 shrink-0" })
3160
3160
  ]
3161
3161
  }
3162
3162
  ),
@@ -3176,78 +3176,79 @@ const Hr = (t) => {
3176
3176
  ]
3177
3177
  }
3178
3178
  );
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) => {
3179
+ }, ke = 200, _r = 60, jr = (n) => {
3180
+ const t = {};
3181
+ for (const s of n)
3182
+ t[s.id] = s.defaultWidth ?? ke;
3183
+ return t;
3184
+ }, Xr = (n) => {
3185
3185
  const {
3186
- columns: n,
3186
+ columns: t,
3187
3187
  rows: s,
3188
- getRowId: o,
3188
+ getRowId: l,
3189
3189
  onRowClick: r,
3190
- sort: l,
3190
+ sort: o,
3191
3191
  onSortChange: a,
3192
3192
  className: i,
3193
3193
  rowHeight: c = 44,
3194
- headerHeight: g = 44
3195
- } = t, [x, w] = W(() => _r(n));
3194
+ headerHeight: f = 44,
3195
+ emptyState: w
3196
+ } = n, [x, h] = W(() => jr(t));
3196
3197
  _(() => {
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;
3198
+ h((v) => {
3199
+ const k = {};
3200
+ let I = Object.keys(v).length !== t.length;
3201
+ for (const D of t)
3202
+ D.id in v ? k[D.id] = v[D.id] : (k[D.id] = D.defaultWidth ?? ke, I = !0);
3203
+ return I ? k : v;
3203
3204
  });
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 };
3205
+ }, [t]);
3206
+ const g = Pe((v, k, I) => {
3207
+ h((D) => {
3208
+ const O = D[v] ?? ke, P = Math.max(I, O + k);
3209
+ return P === O ? D : { ...D, [v]: P };
3209
3210
  });
3210
- }, []), b = Le((u) => {
3211
+ }, []), p = Pe((v) => {
3211
3212
  if (a) {
3212
- if (!l || l.columnId !== u) {
3213
- a({ columnId: u, direction: "asc" });
3213
+ if (!o || o.columnId !== v) {
3214
+ a({ columnId: v, direction: "asc" });
3214
3215
  return;
3215
3216
  }
3216
- if (l.direction === "asc") {
3217
- a({ columnId: u, direction: "desc" });
3217
+ if (o.direction === "asc") {
3218
+ a({ columnId: v, direction: "desc" });
3218
3219
  return;
3219
3220
  }
3220
3221
  a(null);
3221
3222
  }
3222
- }, [l, a]), p = n.reduce(
3223
- (u, I) => u + (x[I.id] ?? I.defaultWidth ?? ye),
3223
+ }, [o, a]), u = t.reduce(
3224
+ (v, k) => v + (x[k.id] ?? k.defaultWidth ?? ke),
3224
3225
  0
3225
- ), m = Ce(null), v = (u) => {
3226
- m.current && (m.current.scrollLeft = u.currentTarget.scrollLeft);
3226
+ ), b = Ce(null), C = (v) => {
3227
+ b.current && (b.current.scrollLeft = v.currentTarget.scrollLeft);
3227
3228
  };
3228
- return /* @__PURE__ */ d("div", { className: f("flex flex-col h-full w-full", i), children: [
3229
+ return /* @__PURE__ */ d("div", { className: m("flex flex-col h-full w-full", i), children: [
3229
3230
  /* @__PURE__ */ e(
3230
3231
  "div",
3231
3232
  {
3232
- ref: m,
3233
+ ref: b,
3233
3234
  className: "overflow-hidden shrink-0 table-header-strip",
3234
- style: { height: g },
3235
+ style: { height: f },
3235
3236
  children: /* @__PURE__ */ e(
3236
3237
  "div",
3237
3238
  {
3238
3239
  className: "flex flex-row table-header font-medium",
3239
- style: { width: p, minWidth: "100%" },
3240
- children: n.map((u) => /* @__PURE__ */ e(
3241
- Hr,
3240
+ style: { width: u, minWidth: "100%" },
3241
+ children: t.map((v) => /* @__PURE__ */ e(
3242
+ $r,
3242
3243
  {
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)
3244
+ column: v,
3245
+ width: x[v.id] ?? v.defaultWidth ?? ke,
3246
+ height: f,
3247
+ onResize: (k) => g(v.id, k, v.minWidth ?? _r),
3248
+ sortDirection: o?.columnId === v.id ? o.direction : null,
3249
+ onSortClick: () => p(v.id)
3249
3250
  },
3250
- u.id
3251
+ v.id
3251
3252
  ))
3252
3253
  }
3253
3254
  )
@@ -3257,47 +3258,57 @@ const Hr = (t) => {
3257
3258
  "div",
3258
3259
  {
3259
3260
  className: "flex-1 overflow-auto",
3260
- onScroll: v,
3261
- children: /* @__PURE__ */ e(
3261
+ onScroll: C,
3262
+ children: s.length === 0 && w ? /* @__PURE__ */ e("div", { className: "flex h-full min-w-full items-center justify-center p-8", children: w }) : /* @__PURE__ */ e(
3262
3263
  "div",
3263
3264
  {
3264
3265
  className: "flex flex-col",
3265
- style: { width: p, minWidth: "100%" },
3266
- children: s.map((u, I) => /* @__PURE__ */ e(
3266
+ style: { width: u, minWidth: "100%" },
3267
+ children: s.map((v, k) => /* @__PURE__ */ e(
3267
3268
  "div",
3268
3269
  {
3269
- className: f(
3270
+ className: m(
3270
3271
  "flex flex-row table-body-row transition-colors duration-100",
3271
3272
  r && "cursor-pointer"
3272
3273
  ),
3273
- onClick: r ? () => r(u, I) : void 0,
3274
- children: n.map((R) => /* @__PURE__ */ e(
3274
+ onClick: r ? () => r(v, k) : void 0,
3275
+ children: t.map((I) => /* @__PURE__ */ e(
3275
3276
  "div",
3276
3277
  {
3277
3278
  className: "shrink-0 content-center px-4 relative",
3278
3279
  style: {
3279
- width: x[R.id] ?? R.defaultWidth ?? ye,
3280
+ width: x[I.id] ?? I.defaultWidth ?? ke,
3280
3281
  height: c
3281
3282
  },
3282
- children: /* @__PURE__ */ e("div", { className: "break-all line-clamp-1", children: R.renderCell(u, I) })
3283
+ children: /* @__PURE__ */ e("div", { className: "break-all line-clamp-1", children: I.renderCell(v, k) })
3283
3284
  },
3284
- R.id
3285
+ I.id
3285
3286
  ))
3286
3287
  },
3287
- o(u, I)
3288
+ l(v, k)
3288
3289
  ))
3289
3290
  }
3290
3291
  )
3291
3292
  }
3292
3293
  )
3293
3294
  ] });
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 }),
3295
+ }, $l = (n) => {
3296
+ const { Icon: t, title: s, description: l, children: r, className: o } = n;
3297
+ return /* @__PURE__ */ d("div", { className: m("flex flex-col items-center gap-3 text-center", o), children: [
3298
+ 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)]" }) }),
3299
+ (s || l) && /* @__PURE__ */ d("div", { className: "flex flex-col gap-1", children: [
3300
+ s && /* @__PURE__ */ e("div", { className: "font-medium text-[var(--color-input-text)]", children: s }),
3301
+ l && /* @__PURE__ */ e("div", { className: "text-sm text-[var(--color-input-description-text)]", children: l })
3302
+ ] }),
3303
+ r
3304
+ ] });
3305
+ }, Ct = (n) => {
3306
+ const { label: t, children: s, className: l } = n;
3307
+ return /* @__PURE__ */ d("div", { className: m("flex flex-col dropdown-button-group", l), children: [
3308
+ t && /* @__PURE__ */ e("div", { className: "mb-2 text-sm dropdown-group-label font-semibold px-3", children: t }),
3298
3309
  s
3299
3310
  ] });
3300
- }, Xr = () => /* @__PURE__ */ e("div", {}), Vr = [
3311
+ }, Vr = () => /* @__PURE__ */ e("div", {}), Kr = [
3301
3312
  { id: 1, email: "sarah.jennings@example.com", firstname: "Sarah", lastname: "Jennings", status: "active" },
3302
3313
  { id: 2, email: "liam.patel@outlook.com", firstname: "Liam", lastname: "Patel", status: "inactive" },
3303
3314
  { id: 3, email: "emily.wong@gmail.com", firstname: "Emily", lastname: "Wong", status: "active" },
@@ -3310,40 +3321,40 @@ const Hr = (t) => {
3310
3321
  { id: 10, email: "jackson.rivera@outlook.com", firstname: "Jackson", lastname: "Rivera", status: "active" },
3311
3322
  { id: 11, email: "ava.sanders@example.com", firstname: "Ava", lastname: "Sanders", status: "active" },
3312
3323
  { id: 12, email: "logan.bennett@company.io", firstname: "Logan", lastname: "Bennett", status: "inactive" }
3313
- ], Kr = [
3314
- { id: "id", header: "ID", renderCell: (t) => t.id },
3324
+ ], Gr = [
3325
+ { id: "id", header: "ID", renderCell: (n) => n.id },
3315
3326
  {
3316
3327
  id: "email",
3317
3328
  header: "Email",
3318
- renderCell: (t) => /* @__PURE__ */ e(Ee, { Icon: dn, onClick: () => {
3319
- }, children: t.email })
3329
+ renderCell: (n) => /* @__PURE__ */ e(Ee, { Icon: mn, onClick: () => {
3330
+ }, children: n.email })
3320
3331
  },
3321
- { id: "firstname", header: "First Name", renderCell: (t) => t.firstname },
3322
- { id: "lastname", header: "Last Name", renderCell: (t) => t.lastname },
3332
+ { id: "firstname", header: "First Name", renderCell: (n) => n.firstname },
3333
+ { id: "lastname", header: "Last Name", renderCell: (n) => n.lastname },
3323
3334
  {
3324
3335
  id: "status",
3325
3336
  header: "Status",
3326
- renderCell: () => /* @__PURE__ */ e(Gr, {})
3337
+ renderCell: () => /* @__PURE__ */ e(Jr, {})
3327
3338
  }
3328
- ], Hl = () => /* @__PURE__ */ d("div", { className: "flex flex-col gap-6", children: [
3339
+ ], _l = () => /* @__PURE__ */ d("div", { className: "flex flex-col gap-6", children: [
3329
3340
  /* @__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" }),
3341
+ /* @__PURE__ */ e(Wt, { Icon: Fe, placeholder: "Search..." }),
3342
+ /* @__PURE__ */ e(qe, { Icon: mt }),
3343
+ /* @__PURE__ */ e(Gn, { Icon: ft, children: "New" }),
3333
3344
  /* @__PURE__ */ d(
3334
3345
  Ue,
3335
3346
  {
3336
- trigger: /* @__PURE__ */ e(qe, { Icon: ft }),
3347
+ trigger: /* @__PURE__ */ e(qe, { Icon: mt }),
3337
3348
  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: [
3349
+ /* @__PURE__ */ e(X, { dismissOnClick: !1, Icon: ft, children: "Add new" }),
3350
+ /* @__PURE__ */ e(X, { Icon: un, children: "Remove" }),
3351
+ /* @__PURE__ */ d(Ct, { label: "Test", className: "mt-2", children: [
3341
3352
  /* @__PURE__ */ e(X, { children: "Item 1" }),
3342
3353
  /* @__PURE__ */ e(X, { children: "Item 2" }),
3343
3354
  /* @__PURE__ */ e(X, { children: "Item 3" }),
3344
3355
  /* @__PURE__ */ e(X, { children: "Item 4" })
3345
3356
  ] }),
3346
- /* @__PURE__ */ d(It, { label: "Test", className: "mt-2", children: [
3357
+ /* @__PURE__ */ d(Ct, { label: "Test", className: "mt-2", children: [
3347
3358
  /* @__PURE__ */ e(X, { children: "Item 1" }),
3348
3359
  /* @__PURE__ */ e(X, { children: "Item 2" }),
3349
3360
  /* @__PURE__ */ e(X, { children: "Item 3" }),
@@ -3352,7 +3363,7 @@ const Hr = (t) => {
3352
3363
  ]
3353
3364
  }
3354
3365
  ),
3355
- /* @__PURE__ */ e(Ur, { tabs: [
3366
+ /* @__PURE__ */ e(Wr, { tabs: [
3356
3367
  {
3357
3368
  label: "Tab 1",
3358
3369
  Icon: Ye,
@@ -3375,23 +3386,23 @@ const Hr = (t) => {
3375
3386
  }
3376
3387
  ] })
3377
3388
  ] }),
3378
- /* @__PURE__ */ e(Pr, { options: [
3389
+ /* @__PURE__ */ e(Er, { options: [
3379
3390
  { label: "Option 1", value: 1 },
3380
3391
  { label: "Option 2", value: 2 },
3381
3392
  { label: "Option 3", value: 3 }
3382
3393
  ], value: null, onChange: () => {
3383
3394
  } }),
3384
3395
  /* @__PURE__ */ e(
3385
- jr,
3396
+ Xr,
3386
3397
  {
3387
3398
  className: "h-[300px] w-[300px]",
3388
- columns: Kr,
3389
- rows: Vr,
3390
- getRowId: (t) => t.id
3399
+ columns: Gr,
3400
+ rows: Kr,
3401
+ getRowId: (n) => n.id
3391
3402
  }
3392
3403
  ),
3393
- /* @__PURE__ */ e(Xr, {})
3394
- ] }), Gr = () => /* @__PURE__ */ e(te, { children: /* @__PURE__ */ d(
3404
+ /* @__PURE__ */ e(Vr, {})
3405
+ ] }), Jr = () => /* @__PURE__ */ e(ce, { children: /* @__PURE__ */ d(
3395
3406
  Ue,
3396
3407
  {
3397
3408
  placement: "bottom-end",
@@ -3406,72 +3417,73 @@ const Hr = (t) => {
3406
3417
  }
3407
3418
  ) });
3408
3419
  export {
3409
- Wl as AutoScroll,
3420
+ Hl as AutoScroll,
3410
3421
  Ee as Badge,
3411
3422
  Mr as BadgeColor,
3412
- Kn as Button,
3413
- Bt as ButtonIconRound,
3423
+ Gn as Button,
3424
+ Ut as ButtonIconRound,
3414
3425
  qe as ButtonIconSquare,
3415
- Fl as Divider,
3426
+ Bl as Divider,
3416
3427
  X as DropdownButton,
3417
- It as DropdownButtonGroup,
3428
+ Ct as DropdownButtonGroup,
3418
3429
  Ue as DropdownMenu,
3419
- xe as DropdownPanel,
3420
- At as Input,
3421
- yl as InputCheck,
3422
- vl as InputColor,
3430
+ ve as DropdownPanel,
3431
+ Wt as Input,
3432
+ Cl as InputCheck,
3433
+ xl as InputColor,
3423
3434
  V as InputDescription,
3424
3435
  K as InputError,
3425
- re as InputErrorIcon,
3426
- Il as InputFileMultiple,
3427
- Cl as InputFileSingle,
3436
+ ne as InputErrorIcon,
3437
+ Rl as InputFileMultiple,
3438
+ Il as InputFileSingle,
3428
3439
  Z as InputIconButton,
3429
- pe as InputIconButtonTray,
3440
+ he as InputIconButtonTray,
3430
3441
  q as InputLabel,
3431
- Sl as InputLexical,
3432
- xl as InputPassword,
3433
- Nl as InputRadio,
3434
- Pr as InputSelect,
3442
+ Dl as InputLexical,
3443
+ wl as InputPassword,
3444
+ yl as InputRadio,
3445
+ Er as InputSelect,
3435
3446
  $e as InputSelectDivider,
3436
3447
  He as InputSelectGroupHeader,
3437
- Tl as InputSelectMultiple,
3438
- Dl as InputSelectNative,
3448
+ Pl as InputSelectMultiple,
3449
+ Ol as InputSelectNative,
3439
3450
  We as InputSelectOption,
3440
- Ol as InputSelectSearchable,
3441
- zl as InputSelectSearchableAsync,
3442
- wl as InputTextArea,
3451
+ zl as InputSelectSearchable,
3452
+ Tl as InputSelectSearchableAsync,
3453
+ Nl as InputTextArea,
3443
3454
  kl as InputToggle,
3444
- wr as LEXICAL_NODES,
3445
- yr as LexicalBlockTypeSelect,
3446
- Rl as LexicalDefaultToolbarContent,
3455
+ Nr as LEXICAL_NODES,
3456
+ Cr as LexicalBlockTypeSelect,
3457
+ Sl as LexicalDefaultToolbarContent,
3447
3458
  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,
3459
+ Rr as LexicalFormatButtons,
3460
+ Or as LexicalHistoryButtons,
3461
+ Dr as LexicalLinkButton,
3462
+ Sr as LexicalListButtons,
3463
+ Pr as LexicalToolbar,
3464
+ ie as LexicalToolbarButton,
3454
3465
  Je as LexicalToolbarDivider,
3455
- jt as LexicalToolbarItems,
3456
- Al as Modal,
3466
+ Vt as LexicalToolbarItems,
3467
+ Ul as Modal,
3457
3468
  Ll as Panel,
3458
- El as PanelField,
3469
+ Fl as PanelField,
3459
3470
  Ml as PanelLink,
3460
- Pl as PanelStack,
3461
- Ut as PopoverBase,
3462
- Ul as SidebarModal,
3471
+ El as PanelStack,
3472
+ Ht as PopoverBase,
3473
+ Wl as SidebarModal,
3463
3474
  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,
3475
+ Wr as TabButtons,
3476
+ Xr as Table,
3477
+ $r as TableColumnHead,
3478
+ $l as TableEmpty,
3479
+ _l as Test,
3480
+ Al as Tooltip,
3481
+ wr as UploadFileTile,
3470
3482
  H as isSelectOption,
3471
- Nt as lexicalTheme,
3472
- Ne as useLexicalToolbar,
3473
- Ht as useLexicalToolbarState,
3474
- dt as usePopover,
3483
+ wt as lexicalTheme,
3484
+ we as useLexicalToolbar,
3485
+ _t as useLexicalToolbarState,
3486
+ ct as usePopover,
3475
3487
  _e as useSelectPopover
3476
3488
  };
3477
3489
  //# sourceMappingURL=index.js.map