rharuow-ds 1.8.2 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,737 +1,737 @@
1
- import * as e from "react";
2
- import o, { useState as le, useRef as pe, useEffect as be } from "react";
1
+ import * as t from "react";
2
+ import n, { useState as ne, useRef as pe, useEffect as ve, createContext as $e, useCallback as ge, useContext as We } from "react";
3
3
  import { useFormContext as ce, useWatch as de } from "react-hook-form";
4
- import { createPortal as he } from "react-dom";
5
- function xe(t) {
6
- var n, r, a = "";
7
- if (typeof t == "string" || typeof t == "number") a += t;
8
- else if (typeof t == "object") if (Array.isArray(t)) {
9
- var l = t.length;
10
- for (n = 0; n < l; n++) t[n] && (r = xe(t[n])) && (a && (a += " "), a += r);
11
- } else for (r in t) t[r] && (a && (a += " "), a += r);
12
- return a;
4
+ import { createPortal as be } from "react-dom";
5
+ function ye(e) {
6
+ var a, r, o = "";
7
+ if (typeof e == "string" || typeof e == "number") o += e;
8
+ else if (typeof e == "object") if (Array.isArray(e)) {
9
+ var l = e.length;
10
+ for (a = 0; a < l; a++) e[a] && (r = ye(e[a])) && (o && (o += " "), o += r);
11
+ } else for (r in e) e[r] && (o && (o += " "), o += r);
12
+ return o;
13
13
  }
14
- function Ae() {
15
- for (var t, n, r = 0, a = "", l = arguments.length; r < l; r++) (t = arguments[r]) && (n = xe(t)) && (a && (a += " "), a += n);
16
- return a;
14
+ function Oe() {
15
+ for (var e, a, r = 0, o = "", l = arguments.length; r < l; r++) (e = arguments[r]) && (a = ye(e)) && (o && (o += " "), o += a);
16
+ return o;
17
17
  }
18
- function d(...t) {
19
- return Ae(...t);
18
+ function i(...e) {
19
+ return Oe(...e);
20
20
  }
21
- const Xe = ({
22
- children: t,
23
- variant: n = "default",
21
+ const lt = ({
22
+ children: e,
23
+ variant: a = "default",
24
24
  className: r = "",
25
- ...a
25
+ ...o
26
26
  }) => {
27
- const l = "px-4 py-2 rounded font-medium transition", w = {
27
+ const l = "px-4 py-2 rounded font-medium transition", v = {
28
28
  default: "bg-[var(--primary,#2563eb)] text-[var(--primary-text,#fff)] hover:bg-[var(--primary-hover,#1d4ed8)]",
29
29
  outline: "border border-[var(--primary,#2563eb)] text-[var(--primary,#2563eb)] bg-white hover:bg-[var(--primary-hover,#e0e7ff)]",
30
30
  secondary: "bg-[var(--secondary,#fbbf24)] text-[var(--secondary-text,#222)] hover:bg-[var(--secondary-hover,#f59e42)]"
31
31
  };
32
- return /* @__PURE__ */ o.createElement("button", { className: d(l, w[n], r), ...a }, t);
33
- }, we = (t) => t.replace(/\D/g, ""), Te = (t) => {
34
- const r = we(t).slice(0, 11);
32
+ return /* @__PURE__ */ n.createElement("button", { className: i(l, v[a], r), ...o }, e);
33
+ }, Ee = (e) => e.replace(/\D/g, ""), Ve = (e) => {
34
+ const r = Ee(e).slice(0, 11);
35
35
  return r.length <= 3 ? r : r.length <= 6 ? `${r.slice(0, 3)}.${r.slice(3)}` : r.length <= 9 ? `${r.slice(0, 3)}.${r.slice(3, 6)}.${r.slice(6)}` : `${r.slice(0, 3)}.${r.slice(3, 6)}.${r.slice(6, 9)}-${r.slice(9, 11)}`;
36
- }, ve = (t) => {
37
- const n = we(t);
38
- if (n.length !== 11 || /^(\d)\1{10}$/.test(n))
36
+ }, we = (e) => {
37
+ const a = Ee(e);
38
+ if (a.length !== 11 || /^(\d)\1{10}$/.test(a))
39
39
  return !1;
40
40
  let r = 0;
41
41
  for (let l = 0; l < 9; l++)
42
- r += parseInt(n.charAt(l)) * (10 - l);
43
- let a = r * 10 % 11;
44
- if ((a === 10 || a === 11) && (a = 0), a !== parseInt(n.charAt(9)))
42
+ r += parseInt(a.charAt(l)) * (10 - l);
43
+ let o = r * 10 % 11;
44
+ if ((o === 10 || o === 11) && (o = 0), o !== parseInt(a.charAt(9)))
45
45
  return !1;
46
46
  r = 0;
47
47
  for (let l = 0; l < 10; l++)
48
- r += parseInt(n.charAt(l)) * (11 - l);
49
- return a = r * 10 % 11, (a === 10 || a === 11) && (a = 0), a === parseInt(n.charAt(10));
50
- }, $e = e.forwardRef(
48
+ r += parseInt(a.charAt(l)) * (11 - l);
49
+ return o = r * 10 % 11, (o === 10 || o === 11) && (o = 0), o === parseInt(a.charAt(10));
50
+ }, He = t.forwardRef(
51
51
  ({
52
- name: t,
53
- className: n,
52
+ name: e,
53
+ className: a,
54
54
  type: r = "text",
55
- label: a,
55
+ label: o,
56
56
  onFocus: l,
57
- onBlur: w,
58
- onChange: b,
59
- Icon: M,
60
- iconClassName: N,
61
- iconAction: y,
62
- containerClassName: f,
57
+ onBlur: v,
58
+ onChange: d,
59
+ Icon: k,
60
+ iconClassName: h,
61
+ iconAction: g,
62
+ containerClassName: u,
63
63
  cpf: x = !1,
64
- ...c
65
- }, I) => {
66
- var _, P, q;
67
- const [k, S] = e.useState(!1), [v, h] = e.useState(!1), [E, C] = e.useState(null), i = ce(), R = i == null ? void 0 : i.control, F = i == null ? void 0 : i.register, B = R && t ? de({ control: R, name: t }) : void 0, p = c.value ?? B ?? "", V = ((q = (P = (_ = i == null ? void 0 : i.formState) == null ? void 0 : _.errors) == null ? void 0 : P[t]) == null ? void 0 : q.message) || E, L = ["date", "datetime-local", "time", "month", "week"].includes(r), J = k || !!p || L, Z = r === "password" ? v ? "text" : "password" : r, G = () => /* @__PURE__ */ e.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ e.createElement(
64
+ ...s
65
+ }, S) => {
66
+ var T, P, q;
67
+ const [L, M] = t.useState(!1), [y, E] = t.useState(!1), [N, C] = t.useState(null), m = ce(), R = m == null ? void 0 : m.control, F = m == null ? void 0 : m.register, I = R && e ? de({ control: R, name: e }) : void 0, b = s.value ?? I ?? "", V = ((q = (P = (T = m == null ? void 0 : m.formState) == null ? void 0 : T.errors) == null ? void 0 : P[e]) == null ? void 0 : q.message) || N, B = ["date", "datetime-local", "time", "month", "week"].includes(r), J = L || !!b || B, Z = r === "password" ? y ? "text" : "password" : r, G = () => /* @__PURE__ */ t.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ t.createElement(
68
68
  "path",
69
69
  {
70
70
  d: "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",
71
71
  fill: "currentColor"
72
72
  }
73
- )), W = () => /* @__PURE__ */ e.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ e.createElement(
73
+ )), O = () => /* @__PURE__ */ t.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ t.createElement(
74
74
  "path",
75
75
  {
76
76
  d: "M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z",
77
77
  fill: "currentColor"
78
78
  }
79
- )), $ = () => {
80
- h(!v);
81
- }, X = (z) => {
79
+ )), z = () => {
80
+ E(!y);
81
+ }, X = ($) => {
82
82
  if (x) {
83
- const Y = z.target.value, j = Te(Y);
84
- z.target.value = j, j.length === 14 ? ve(j) ? C(null) : C("CPF inválido") : C(null);
83
+ const Y = $.target.value, j = Ve(Y);
84
+ $.target.value = j, j.length === 14 ? we(j) ? C(null) : C("CPF inválido") : C(null);
85
85
  }
86
- b && b(z);
86
+ d && d($);
87
87
  };
88
- return /* @__PURE__ */ e.createElement("div", { className: d("relative", f) }, /* @__PURE__ */ e.createElement(
88
+ return /* @__PURE__ */ t.createElement("div", { className: i("relative", u) }, /* @__PURE__ */ t.createElement(
89
89
  "input",
90
90
  {
91
- id: c.id || t,
91
+ id: s.id || e,
92
92
  type: Z,
93
- className: d(
93
+ className: i(
94
94
  "peer flex h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50",
95
- r === "password" || M ? "pr-12" : "",
95
+ r === "password" || k ? "pr-12" : "",
96
96
  // espaço extra para qualquer ícone (password ou customizado)
97
97
  V ? "border-red-500" : "",
98
- n
98
+ a
99
99
  ),
100
- onFocus: (z) => {
101
- S(!0), l && l(z);
100
+ onFocus: ($) => {
101
+ M(!0), l && l($);
102
102
  },
103
- maxLength: x ? 14 : c.maxLength,
104
- inputMode: x ? "numeric" : c.inputMode,
105
- ...i && t ? (() => {
106
- const z = F(t, x ? {
107
- validate: (D) => D ? D.length < 14 ? "CPF incompleto" : ve(D) ? !0 : "CPF inválido" : "CPF é obrigatório"
108
- } : void 0), Y = z.onBlur, j = z.onChange;
103
+ maxLength: x ? 14 : s.maxLength,
104
+ inputMode: x ? "numeric" : s.inputMode,
105
+ ...m && e ? (() => {
106
+ const $ = F(e, x ? {
107
+ validate: (D) => D ? D.length < 14 ? "CPF incompleto" : we(D) ? !0 : "CPF inválido" : "CPF é obrigatório"
108
+ } : void 0), Y = $.onBlur, j = $.onChange;
109
109
  return {
110
- ...z,
110
+ ...$,
111
111
  ref: (D) => {
112
- typeof I == "function" ? I(D) : I && (I.current = D), z.ref && z.ref(D);
112
+ typeof S == "function" ? S(D) : S && (S.current = D), $.ref && $.ref(D);
113
113
  },
114
114
  onBlur: (D) => {
115
- S(!1), w && w(D), Y && Y(D);
115
+ M(!1), v && v(D), Y && Y(D);
116
116
  },
117
117
  onChange: (D) => {
118
118
  X(D), j && j(D);
119
119
  }
120
120
  };
121
121
  })() : {
122
- ref: I,
123
- onBlur: (z) => {
124
- S(!1), w && w(z);
122
+ ref: S,
123
+ onBlur: ($) => {
124
+ M(!1), v && v($);
125
125
  },
126
126
  onChange: X
127
127
  },
128
- ...c
128
+ ...s
129
129
  }
130
- ), a && /* @__PURE__ */ e.createElement(
130
+ ), o && /* @__PURE__ */ t.createElement(
131
131
  "label",
132
132
  {
133
- htmlFor: c.id || t,
134
- className: d(
133
+ htmlFor: s.id || e,
134
+ className: i(
135
135
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
136
136
  J ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
137
137
  )
138
138
  },
139
- a
140
- ), r === "password" && /* @__PURE__ */ e.createElement(
139
+ o
140
+ ), r === "password" && /* @__PURE__ */ t.createElement(
141
141
  "button",
142
142
  {
143
143
  type: "button",
144
144
  className: "absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 hover:text-[var(--primary,#2563eb)] transition-colors duration-200 focus:outline-none focus:text-[var(--primary,#2563eb)]",
145
- onClick: $,
146
- "aria-label": v ? "Esconder senha" : "Mostrar senha",
145
+ onClick: z,
146
+ "aria-label": y ? "Esconder senha" : "Mostrar senha",
147
147
  tabIndex: -1
148
148
  },
149
- v ? /* @__PURE__ */ e.createElement(W, null) : /* @__PURE__ */ e.createElement(G, null)
150
- ), M && r !== "password" && /* @__PURE__ */ e.createElement(
149
+ y ? /* @__PURE__ */ t.createElement(O, null) : /* @__PURE__ */ t.createElement(G, null)
150
+ ), k && r !== "password" && /* @__PURE__ */ t.createElement(
151
151
  "div",
152
152
  {
153
- className: d(
153
+ className: i(
154
154
  "absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",
155
- N
155
+ h
156
156
  ),
157
- onClick: y
157
+ onClick: g
158
158
  },
159
- /* @__PURE__ */ e.createElement(M, null)
160
- ), V && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, V));
159
+ /* @__PURE__ */ t.createElement(k, null)
160
+ ), V && /* @__PURE__ */ t.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, V));
161
161
  }
162
162
  );
163
- $e.displayName = "Input";
164
- const ze = e.forwardRef(
163
+ He.displayName = "Input";
164
+ const De = t.forwardRef(
165
165
  ({
166
- name: t,
167
- label: n,
166
+ name: e,
167
+ label: a,
168
168
  options: r,
169
- className: a,
169
+ className: o,
170
170
  containerClassName: l,
171
- isClearable: w,
172
- searchable: b = !1,
173
- filterPlaceholder: M = "Digite para filtrar...",
174
- caseSensitive: N = !1,
175
- filterFunction: y,
176
- onFocus: f,
171
+ isClearable: v,
172
+ searchable: d = !1,
173
+ filterPlaceholder: k = "Digite para filtrar...",
174
+ caseSensitive: h = !1,
175
+ filterFunction: g,
176
+ onFocus: u,
177
177
  onBlur: x,
178
- ...c
179
- }, I) => {
180
- var re, ne, u, T;
181
- const [k, S] = e.useState(!1), [v, h] = e.useState(!1), [E, C] = e.useState(""), [i, R] = e.useState({
178
+ ...s
179
+ }, S) => {
180
+ var re, oe, f, A;
181
+ const [L, M] = t.useState(!1), [y, E] = t.useState(!1), [N, C] = t.useState(""), [m, R] = t.useState({
182
182
  top: 0,
183
183
  left: 0,
184
184
  width: 0
185
- }), F = e.useRef(null), B = e.useRef(null), p = ce(), V = p == null ? void 0 : p.control, U = V && t ? de({ control: V, name: t }) : void 0, L = c.value ?? U ?? "", J = (u = (ne = (re = p == null ? void 0 : p.formState) == null ? void 0 : re.errors) == null ? void 0 : ne[t]) == null ? void 0 : u.message, G = y || ((s, O) => {
186
- const K = N ? s.label : s.label.toLowerCase(), te = N ? O : O.toLowerCase();
185
+ }), F = t.useRef(null), I = t.useRef(null), b = ce(), V = b == null ? void 0 : b.control, U = V && e ? de({ control: V, name: e }) : void 0, B = s.value ?? U ?? "", J = (f = (oe = (re = b == null ? void 0 : b.formState) == null ? void 0 : re.errors) == null ? void 0 : oe[e]) == null ? void 0 : f.message, G = g || ((c, W) => {
186
+ const K = h ? c.label : c.label.toLowerCase(), te = h ? W : W.toLowerCase();
187
187
  return K.includes(te);
188
- }), W = E.trim() ? r.filter((s) => G(s, E.trim())) : r, $ = r.find((s) => s.value === L), X = b && v ? E : ($ == null ? void 0 : $.label) || "", _ = k || !!L || b && !!E, P = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), q = e.useCallback(() => {
189
- if (F.current && v) {
190
- const s = F.current.getBoundingClientRect(), O = P(), K = window.innerHeight, te = window.innerWidth, Q = 152;
191
- let g = s.bottom + 4, H = s.left;
192
- if (O) {
193
- const ae = K - s.bottom, m = s.top;
194
- ae < Q && m > Q && (g = s.top - Q - 4);
195
- const A = 16, ee = te - s.width - A;
196
- H = Math.min(Math.max(H, A), ee);
188
+ }), O = N.trim() ? r.filter((c) => G(c, N.trim())) : r, z = r.find((c) => c.value === B), X = d && y ? N : (z == null ? void 0 : z.label) || "", T = L || !!B || d && !!N, P = t.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), q = t.useCallback(() => {
189
+ if (F.current && y) {
190
+ const c = F.current.getBoundingClientRect(), W = P(), K = window.innerHeight, te = window.innerWidth, Q = 152;
191
+ let w = c.bottom + 4, H = c.left;
192
+ if (W) {
193
+ const ae = K - c.bottom, p = c.top;
194
+ ae < Q && p > Q && (w = c.top - Q - 4);
195
+ const _ = 16, ee = te - c.width - _;
196
+ H = Math.min(Math.max(H, _), ee);
197
197
  } else
198
- K - s.bottom < Q && (g = s.top - Q - 4);
198
+ K - c.bottom < Q && (w = c.top - Q - 4);
199
199
  R({
200
- top: g,
200
+ top: w,
201
201
  left: H,
202
- width: s.width
202
+ width: c.width
203
203
  });
204
204
  }
205
- }, [v, P]);
206
- e.useEffect(() => {
207
- if (q(), v) {
208
- const s = () => q(), O = () => q();
209
- return window.addEventListener("resize", s), window.addEventListener("scroll", O, !0), () => {
210
- window.removeEventListener("resize", s), window.removeEventListener("scroll", O, !0);
205
+ }, [y, P]);
206
+ t.useEffect(() => {
207
+ if (q(), y) {
208
+ const c = () => q(), W = () => q();
209
+ return window.addEventListener("resize", c), window.addEventListener("scroll", W, !0), () => {
210
+ window.removeEventListener("resize", c), window.removeEventListener("scroll", W, !0);
211
211
  };
212
212
  }
213
- }, [v, q]), e.useEffect(() => {
214
- const s = (O) => {
215
- F.current && !F.current.contains(O.target) && (h(!1), S(!1));
213
+ }, [y, q]), t.useEffect(() => {
214
+ const c = (W) => {
215
+ F.current && !F.current.contains(W.target) && (E(!1), M(!1));
216
216
  };
217
- return document.addEventListener("mousedown", s), () => {
218
- document.removeEventListener("mousedown", s);
217
+ return document.addEventListener("mousedown", c), () => {
218
+ document.removeEventListener("mousedown", c);
219
219
  };
220
220
  }, []);
221
- const z = () => {
222
- h((s) => !s), S(!0);
223
- }, Y = (s) => {
224
- S(!0), f && f(s);
225
- }, j = (s) => {
226
- x && x(s);
227
- }, D = (s) => {
228
- C(s.target.value);
229
- }, oe = (s) => {
230
- if (p && t && p.setValue(t, s), c.onChange) {
231
- const O = {
232
- target: { value: s }
221
+ const $ = () => {
222
+ E((c) => !c), M(!0);
223
+ }, Y = (c) => {
224
+ M(!0), u && u(c);
225
+ }, j = (c) => {
226
+ x && x(c);
227
+ }, D = (c) => {
228
+ C(c.target.value);
229
+ }, le = (c) => {
230
+ if (b && e && b.setValue(e, c), s.onChange) {
231
+ const W = {
232
+ target: { value: c }
233
233
  };
234
- c.onChange(O);
234
+ s.onChange(W);
235
235
  }
236
- h(!1), S(!1), C("");
236
+ E(!1), M(!1), C("");
237
237
  };
238
- return /* @__PURE__ */ e.createElement("div", { className: d("relative", l), ref: F }, /* @__PURE__ */ e.createElement(
238
+ return /* @__PURE__ */ t.createElement("div", { className: i("relative", l), ref: F }, /* @__PURE__ */ t.createElement(
239
239
  "div",
240
240
  {
241
- id: c.id || t,
241
+ id: s.id || e,
242
242
  tabIndex: 0,
243
243
  role: "button",
244
244
  "aria-haspopup": "listbox",
245
- "aria-expanded": v,
246
- className: d(
245
+ "aria-expanded": y,
246
+ className: i(
247
247
  "peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
248
- a
248
+ o
249
249
  ),
250
- onClick: b ? void 0 : z,
251
- onFocus: b ? void 0 : Y,
252
- onBlur: b ? void 0 : j,
253
- ref: I
250
+ onClick: d ? void 0 : $,
251
+ onFocus: d ? void 0 : Y,
252
+ onBlur: d ? void 0 : j,
253
+ ref: S
254
254
  },
255
- b ? /* @__PURE__ */ e.createElement(
255
+ d ? /* @__PURE__ */ t.createElement(
256
256
  "input",
257
257
  {
258
- ref: B,
258
+ ref: I,
259
259
  type: "text",
260
260
  value: X,
261
261
  onChange: D,
262
- onFocus: b ? (s) => {
263
- S(!0), h(!0), f && f(s);
262
+ onFocus: d ? (c) => {
263
+ M(!0), E(!0), u && u(c);
264
264
  } : void 0,
265
- onBlur: b ? (s) => {
266
- x && x(s);
265
+ onBlur: d ? (c) => {
266
+ x && x(c);
267
267
  } : void 0,
268
- placeholder: n ? "" : M || "Selecione...",
269
- className: d(
268
+ placeholder: a ? "" : k || "Selecione...",
269
+ className: i(
270
270
  "w-full bg-transparent border-none outline-none text-sm",
271
- !L && !E && "text-gray-400"
271
+ !B && !N && "text-gray-400"
272
272
  )
273
273
  }
274
- ) : /* @__PURE__ */ e.createElement("span", { className: d("block truncate", !L && "text-gray-400") }, ((T = r.find((s) => s.value === L)) == null ? void 0 : T.label) || !n && "Selecione..."),
275
- w && L && /* @__PURE__ */ e.createElement(
274
+ ) : /* @__PURE__ */ t.createElement("span", { className: i("block truncate", !B && "text-gray-400") }, ((A = r.find((c) => c.value === B)) == null ? void 0 : A.label) || !a && "Selecione..."),
275
+ v && B && /* @__PURE__ */ t.createElement(
276
276
  "button",
277
277
  {
278
278
  type: "button",
279
279
  tabIndex: -1,
280
280
  "aria-label": "Limpar seleção",
281
281
  className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",
282
- onClick: (s) => {
283
- if (s.stopPropagation(), p && t && p.setValue(t, ""), c.onChange) {
284
- const O = {
282
+ onClick: (c) => {
283
+ if (c.stopPropagation(), b && e && b.setValue(e, ""), s.onChange) {
284
+ const W = {
285
285
  target: { value: "" }
286
286
  };
287
- c.onChange(O);
287
+ s.onChange(W);
288
288
  }
289
- h(!1), S(!1);
289
+ E(!1), M(!1);
290
290
  }
291
291
  },
292
292
  "✕"
293
293
  )
294
- ), n && /* @__PURE__ */ e.createElement(
294
+ ), a && /* @__PURE__ */ t.createElement(
295
295
  "label",
296
296
  {
297
- htmlFor: c.id || t,
298
- className: d(
297
+ htmlFor: s.id || e,
298
+ className: i(
299
299
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
300
- _ ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
300
+ T ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
301
301
  )
302
302
  },
303
- n
304
- ), /* @__PURE__ */ e.createElement(
303
+ a
304
+ ), /* @__PURE__ */ t.createElement(
305
305
  "div",
306
306
  {
307
- className: d(
307
+ className: i(
308
308
  "absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
309
309
  "bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
310
- v ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
310
+ y ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
311
311
  ),
312
312
  style: {
313
- maxHeight: v ? "9.5rem" : "0",
313
+ maxHeight: y ? "9.5rem" : "0",
314
314
  // 3 options * 2.5rem + padding
315
315
  overflowY: r.length > 3 ? "auto" : "hidden",
316
316
  position: "fixed",
317
317
  // Use fixed positioning to escape container overflow
318
- top: v ? `${i.top}px` : "auto",
319
- left: v ? `${i.left}px` : "auto",
320
- width: v ? `${i.width}px` : "auto",
318
+ top: y ? `${m.top}px` : "auto",
319
+ left: y ? `${m.left}px` : "auto",
320
+ width: y ? `${m.width}px` : "auto",
321
321
  zIndex: 9999,
322
- boxShadow: v ? "var(--select-dropdown-shadow)" : "none"
322
+ boxShadow: y ? "var(--select-dropdown-shadow)" : "none"
323
323
  }
324
324
  },
325
- W.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, "Nenhuma opção encontrada") : W.map((s) => /* @__PURE__ */ e.createElement(
325
+ O.length === 0 ? /* @__PURE__ */ t.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, "Nenhuma opção encontrada") : O.map((c) => /* @__PURE__ */ t.createElement(
326
326
  "div",
327
327
  {
328
- key: s.value,
329
- className: d(
328
+ key: c.value,
329
+ className: i(
330
330
  "px-3 py-2 cursor-pointer text-sm transition-colors duration-150",
331
331
  "hover:bg-[var(--select-dropdown-hover)]",
332
- L === s.value && "bg-[var(--select-dropdown-selected)]"
332
+ B === c.value && "bg-[var(--select-dropdown-selected)]"
333
333
  ),
334
- onMouseDown: () => oe(s.value)
334
+ onMouseDown: () => le(c.value)
335
335
  },
336
- s.label
336
+ c.label
337
337
  ))
338
- ), J && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, J));
338
+ ), J && /* @__PURE__ */ t.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, J));
339
339
  }
340
340
  );
341
- ze.displayName = "Select";
342
- const Oe = e.forwardRef(
341
+ De.displayName = "Select";
342
+ const je = t.forwardRef(
343
343
  ({
344
- name: t,
345
- className: n,
344
+ name: e,
345
+ className: a,
346
346
  label: r,
347
- onFocus: a,
347
+ onFocus: o,
348
348
  onBlur: l,
349
- Icon: w,
350
- iconClassName: b,
351
- iconAction: M,
352
- containerClassName: N,
353
- rows: y = 4,
354
- ...f
349
+ Icon: v,
350
+ iconClassName: d,
351
+ iconAction: k,
352
+ containerClassName: h,
353
+ rows: g = 4,
354
+ ...u
355
355
  }, x) => {
356
- var R, F, B;
357
- const [c, I] = e.useState(!1), k = ce(), S = k == null ? void 0 : k.control, v = k == null ? void 0 : k.register, h = S && t ? de({ control: S, name: t }) : void 0, E = f.value ?? h ?? "", C = (B = (F = (R = k == null ? void 0 : k.formState) == null ? void 0 : R.errors) == null ? void 0 : F[t]) == null ? void 0 : B.message, i = c || !!E;
358
- return /* @__PURE__ */ e.createElement("div", { className: d("relative", N) }, /* @__PURE__ */ e.createElement(
356
+ var R, F, I;
357
+ const [s, S] = t.useState(!1), L = ce(), M = L == null ? void 0 : L.control, y = L == null ? void 0 : L.register, E = M && e ? de({ control: M, name: e }) : void 0, N = u.value ?? E ?? "", C = (I = (F = (R = L == null ? void 0 : L.formState) == null ? void 0 : R.errors) == null ? void 0 : F[e]) == null ? void 0 : I.message, m = s || !!N;
358
+ return /* @__PURE__ */ t.createElement("div", { className: i("relative", h) }, /* @__PURE__ */ t.createElement(
359
359
  "textarea",
360
360
  {
361
- id: f.id || t,
362
- rows: y,
363
- className: d(
361
+ id: u.id || e,
362
+ rows: g,
363
+ className: i(
364
364
  "peer flex min-h-[80px] w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 resize-vertical",
365
- w ? "pr-12" : "",
365
+ v ? "pr-12" : "",
366
366
  // espaço extra para ícone customizado
367
- n
367
+ a
368
368
  ),
369
- onFocus: (p) => {
370
- I(!0), a && a(p);
369
+ onFocus: (b) => {
370
+ S(!0), o && o(b);
371
371
  },
372
- ...k && t ? (() => {
373
- const p = v(t), V = p.onBlur;
372
+ ...L && e ? (() => {
373
+ const b = y(e), V = b.onBlur;
374
374
  return {
375
- ...p,
375
+ ...b,
376
376
  ref: (U) => {
377
- typeof x == "function" ? x(U) : x && (x.current = U), p.ref && p.ref(U);
377
+ typeof x == "function" ? x(U) : x && (x.current = U), b.ref && b.ref(U);
378
378
  },
379
379
  onBlur: (U) => {
380
- I(!1), l && l(U), V && V(U);
380
+ S(!1), l && l(U), V && V(U);
381
381
  }
382
382
  };
383
383
  })() : {
384
384
  ref: x,
385
- onBlur: (p) => {
386
- I(!1), l && l(p);
385
+ onBlur: (b) => {
386
+ S(!1), l && l(b);
387
387
  }
388
388
  },
389
- ...f
389
+ ...u
390
390
  }
391
- ), r && /* @__PURE__ */ e.createElement(
391
+ ), r && /* @__PURE__ */ t.createElement(
392
392
  "label",
393
393
  {
394
- htmlFor: f.id || t,
395
- className: d(
394
+ htmlFor: u.id || e,
395
+ className: i(
396
396
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
397
- i ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
397
+ m ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
398
398
  )
399
399
  },
400
400
  r
401
- ), w && /* @__PURE__ */ e.createElement(
401
+ ), v && /* @__PURE__ */ t.createElement(
402
402
  "div",
403
403
  {
404
- className: d(
404
+ className: i(
405
405
  "absolute top-3 right-3 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",
406
- b
406
+ d
407
407
  ),
408
- onClick: M
408
+ onClick: k
409
409
  },
410
- /* @__PURE__ */ e.createElement(w, null)
411
- ), C && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, C));
410
+ /* @__PURE__ */ t.createElement(v, null)
411
+ ), C && /* @__PURE__ */ t.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, C));
412
412
  }
413
413
  );
414
- Oe.displayName = "Textarea";
415
- const We = e.forwardRef(
414
+ je.displayName = "Textarea";
415
+ const Ue = t.forwardRef(
416
416
  ({
417
- name: t,
418
- label: n,
417
+ name: e,
418
+ label: a,
419
419
  loadOptions: r,
420
- className: a,
420
+ className: o,
421
421
  containerClassName: l,
422
- isClearable: w,
423
- defaultOptions: b = !1,
424
- loadingMessage: M = "Carregando...",
425
- noOptionsMessage: N = "Nenhuma opção encontrada",
426
- searchable: y = !1,
427
- debounceMs: f = 300,
422
+ isClearable: v,
423
+ defaultOptions: d = !1,
424
+ loadingMessage: k = "Carregando...",
425
+ noOptionsMessage: h = "Nenhuma opção encontrada",
426
+ searchable: g = !1,
427
+ debounceMs: u = 300,
428
428
  onFocus: x,
429
- onBlur: c,
430
- ...I
431
- }, k) => {
429
+ onBlur: s,
430
+ ...S
431
+ }, L) => {
432
432
  var K, te, Q;
433
- const [S, v] = e.useState(!1), [h, E] = e.useState(!1), [C, i] = e.useState([]), [R, F] = e.useState(!1), [B, p] = e.useState(""), [V, U] = e.useState(""), [L, J] = e.useState({
433
+ const [M, y] = t.useState(!1), [E, N] = t.useState(!1), [C, m] = t.useState([]), [R, F] = t.useState(!1), [I, b] = t.useState(""), [V, U] = t.useState(""), [B, J] = t.useState({
434
434
  top: 0,
435
435
  left: 0,
436
436
  width: 0
437
- }), Z = e.useRef(null), G = e.useRef(null), W = ce(), $ = W == null ? void 0 : W.control, X = $ && t ? de({ control: $, name: t }) : void 0, _ = I.value ?? X ?? "", P = (Q = (te = (K = W == null ? void 0 : W.formState) == null ? void 0 : K.errors) == null ? void 0 : te[t]) == null ? void 0 : Q.message, q = S || !!_, z = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), Y = e.useCallback(() => {
438
- if (Z.current && h) {
439
- const g = Z.current.getBoundingClientRect(), H = z(), ae = window.innerHeight, m = window.innerWidth, A = 152;
440
- let ee = g.bottom + 4, ie = g.left;
437
+ }), Z = t.useRef(null), G = t.useRef(null), O = ce(), z = O == null ? void 0 : O.control, X = z && e ? de({ control: z, name: e }) : void 0, T = S.value ?? X ?? "", P = (Q = (te = (K = O == null ? void 0 : O.formState) == null ? void 0 : K.errors) == null ? void 0 : te[e]) == null ? void 0 : Q.message, q = M || !!T, $ = t.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), Y = t.useCallback(() => {
438
+ if (Z.current && E) {
439
+ const w = Z.current.getBoundingClientRect(), H = $(), ae = window.innerHeight, p = window.innerWidth, _ = 152;
440
+ let ee = w.bottom + 4, ie = w.left;
441
441
  if (H) {
442
- const se = ae - g.bottom, fe = g.top;
443
- se < A && fe > A && (ee = g.top - A - 4);
444
- const ue = 16, me = m - g.width - ue;
445
- ie = Math.min(Math.max(ie, ue), me);
442
+ const se = ae - w.bottom, me = w.top;
443
+ se < _ && me > _ && (ee = w.top - _ - 4);
444
+ const ue = 16, fe = p - w.width - ue;
445
+ ie = Math.min(Math.max(ie, ue), fe);
446
446
  } else
447
- ae - g.bottom < A && (ee = g.top - A - 4);
447
+ ae - w.bottom < _ && (ee = w.top - _ - 4);
448
448
  J({
449
449
  top: ee,
450
450
  left: ie,
451
- width: g.width
451
+ width: w.width
452
452
  });
453
453
  }
454
- }, [h, z]);
455
- e.useEffect(() => {
456
- if (Y(), h) {
457
- const g = () => Y(), H = () => Y();
458
- return window.addEventListener("resize", g), window.addEventListener("scroll", H, !0), () => {
459
- window.removeEventListener("resize", g), window.removeEventListener("scroll", H, !0);
454
+ }, [E, $]);
455
+ t.useEffect(() => {
456
+ if (Y(), E) {
457
+ const w = () => Y(), H = () => Y();
458
+ return window.addEventListener("resize", w), window.addEventListener("scroll", H, !0), () => {
459
+ window.removeEventListener("resize", w), window.removeEventListener("scroll", H, !0);
460
460
  };
461
461
  }
462
- }, [h, Y]), e.useEffect(() => {
463
- const g = setTimeout(() => {
464
- U(B);
465
- }, f);
466
- return () => clearTimeout(g);
467
- }, [B, f]), e.useEffect(() => {
468
- (h || b && C.length === 0) && j(y ? V : void 0);
469
- }, [V, h]), e.useEffect(() => {
470
- b === !0 ? j() : Array.isArray(b) && i(b);
462
+ }, [E, Y]), t.useEffect(() => {
463
+ const w = setTimeout(() => {
464
+ U(I);
465
+ }, u);
466
+ return () => clearTimeout(w);
467
+ }, [I, u]), t.useEffect(() => {
468
+ (E || d && C.length === 0) && j(g ? V : void 0);
469
+ }, [V, E]), t.useEffect(() => {
470
+ d === !0 ? j() : Array.isArray(d) && m(d);
471
471
  }, []);
472
- const j = async (g) => {
472
+ const j = async (w) => {
473
473
  try {
474
474
  F(!0);
475
- const H = await r(g);
476
- i(H);
475
+ const H = await r(w);
476
+ m(H);
477
477
  } catch (H) {
478
- console.error("Error loading options:", H), i([]);
478
+ console.error("Error loading options:", H), m([]);
479
479
  } finally {
480
480
  F(!1);
481
481
  }
482
482
  };
483
- e.useEffect(() => {
484
- const g = (H) => {
485
- Z.current && !Z.current.contains(H.target) && (E(!1), v(!1), p(""));
483
+ t.useEffect(() => {
484
+ const w = (H) => {
485
+ Z.current && !Z.current.contains(H.target) && (N(!1), y(!1), b(""));
486
486
  };
487
- return document.addEventListener("mousedown", g), () => {
488
- document.removeEventListener("mousedown", g);
487
+ return document.addEventListener("mousedown", w), () => {
488
+ document.removeEventListener("mousedown", w);
489
489
  };
490
490
  }, []);
491
491
  const D = () => {
492
- h || (E(!0), v(!0), y && G.current && setTimeout(() => {
493
- var g;
494
- return (g = G.current) == null ? void 0 : g.focus();
492
+ E || (N(!0), y(!0), g && G.current && setTimeout(() => {
493
+ var w;
494
+ return (w = G.current) == null ? void 0 : w.focus();
495
495
  }, 0));
496
- }, oe = (g) => {
497
- v(!0), x && x(g);
498
- }, re = (g) => {
499
- c && c(g);
500
- }, ne = (g) => {
501
- p(g.target.value);
502
- }, u = (g) => {
503
- if (W && t && W.setValue(t, g), I.onChange) {
496
+ }, le = (w) => {
497
+ y(!0), x && x(w);
498
+ }, re = (w) => {
499
+ s && s(w);
500
+ }, oe = (w) => {
501
+ b(w.target.value);
502
+ }, f = (w) => {
503
+ if (O && e && O.setValue(e, w), S.onChange) {
504
504
  const H = {
505
- target: { value: g }
505
+ target: { value: w }
506
506
  };
507
- I.onChange(H);
507
+ S.onChange(H);
508
508
  }
509
- E(!1), v(!1), p("");
510
- }, T = (g) => {
511
- if (g.stopPropagation(), W && t && W.setValue(t, ""), I.onChange) {
509
+ N(!1), y(!1), b("");
510
+ }, A = (w) => {
511
+ if (w.stopPropagation(), O && e && O.setValue(e, ""), S.onChange) {
512
512
  const H = {
513
513
  target: { value: "" }
514
514
  };
515
- I.onChange(H);
515
+ S.onChange(H);
516
516
  }
517
- E(!1), v(!1), p("");
518
- }, s = C.find((g) => g.value === _), O = y && h ? B : (s == null ? void 0 : s.label) || "";
519
- return /* @__PURE__ */ e.createElement("div", { className: d("relative", l), ref: Z }, /* @__PURE__ */ e.createElement(
517
+ N(!1), y(!1), b("");
518
+ }, c = C.find((w) => w.value === T), W = g && E ? I : (c == null ? void 0 : c.label) || "";
519
+ return /* @__PURE__ */ t.createElement("div", { className: i("relative", l), ref: Z }, /* @__PURE__ */ t.createElement(
520
520
  "div",
521
521
  {
522
- id: I.id || t,
523
- tabIndex: y ? -1 : 0,
522
+ id: S.id || e,
523
+ tabIndex: g ? -1 : 0,
524
524
  role: "button",
525
525
  "aria-haspopup": "listbox",
526
- "aria-expanded": h,
527
- className: d(
526
+ "aria-expanded": E,
527
+ className: i(
528
528
  "peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
529
- a
529
+ o
530
530
  ),
531
531
  onClick: D,
532
- onFocus: y ? void 0 : oe,
533
- onBlur: y ? void 0 : re,
534
- ref: k
532
+ onFocus: g ? void 0 : le,
533
+ onBlur: g ? void 0 : re,
534
+ ref: L
535
535
  },
536
- y ? /* @__PURE__ */ e.createElement(
536
+ g ? /* @__PURE__ */ t.createElement(
537
537
  "input",
538
538
  {
539
539
  ref: G,
540
540
  type: "text",
541
- value: O,
542
- onChange: ne,
543
- onFocus: oe,
541
+ value: W,
542
+ onChange: oe,
543
+ onFocus: le,
544
544
  onBlur: re,
545
- placeholder: n ? "" : "Selecione...",
546
- className: d(
545
+ placeholder: a ? "" : "Selecione...",
546
+ className: i(
547
547
  "w-full bg-transparent border-none outline-none text-sm",
548
- !_ && !B && "text-gray-400"
548
+ !T && !I && "text-gray-400"
549
549
  )
550
550
  }
551
- ) : /* @__PURE__ */ e.createElement("span", { className: d("block truncate", !_ && "text-gray-400") }, (s == null ? void 0 : s.label) || !n && "Selecione..."),
552
- R && /* @__PURE__ */ e.createElement("div", { className: "absolute right-8 top-1/2 -translate-y-1/2" }, /* @__PURE__ */ e.createElement("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]" })),
553
- w && _ && !R && /* @__PURE__ */ e.createElement(
551
+ ) : /* @__PURE__ */ t.createElement("span", { className: i("block truncate", !T && "text-gray-400") }, (c == null ? void 0 : c.label) || !a && "Selecione..."),
552
+ R && /* @__PURE__ */ t.createElement("div", { className: "absolute right-8 top-1/2 -translate-y-1/2" }, /* @__PURE__ */ t.createElement("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]" })),
553
+ v && T && !R && /* @__PURE__ */ t.createElement(
554
554
  "button",
555
555
  {
556
556
  type: "button",
557
557
  tabIndex: -1,
558
558
  "aria-label": "Limpar seleção",
559
559
  className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",
560
- onClick: T
560
+ onClick: A
561
561
  },
562
562
  "✕"
563
563
  )
564
- ), n && /* @__PURE__ */ e.createElement(
564
+ ), a && /* @__PURE__ */ t.createElement(
565
565
  "label",
566
566
  {
567
- htmlFor: I.id || t,
568
- className: d(
567
+ htmlFor: S.id || e,
568
+ className: i(
569
569
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
570
570
  q ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
571
571
  )
572
572
  },
573
- n
574
- ), /* @__PURE__ */ e.createElement(
573
+ a
574
+ ), /* @__PURE__ */ t.createElement(
575
575
  "div",
576
576
  {
577
- className: d(
577
+ className: i(
578
578
  "absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
579
579
  "bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
580
- h ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
580
+ E ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
581
581
  ),
582
582
  style: {
583
- maxHeight: h ? "9.5rem" : "0",
583
+ maxHeight: E ? "9.5rem" : "0",
584
584
  overflowY: C.length > 3 ? "auto" : "hidden",
585
585
  position: "fixed",
586
586
  // Use fixed positioning to escape container overflow
587
- top: h ? `${L.top}px` : "auto",
588
- left: h ? `${L.left}px` : "auto",
589
- width: h ? `${L.width}px` : "auto",
587
+ top: E ? `${B.top}px` : "auto",
588
+ left: E ? `${B.left}px` : "auto",
589
+ width: E ? `${B.width}px` : "auto",
590
590
  zIndex: 9999,
591
- boxShadow: h ? "var(--select-dropdown-shadow)" : "none"
591
+ boxShadow: E ? "var(--select-dropdown-shadow)" : "none"
592
592
  }
593
593
  },
594
- R ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, M) : C.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, N) : C.map((g) => /* @__PURE__ */ e.createElement(
594
+ R ? /* @__PURE__ */ t.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, k) : C.length === 0 ? /* @__PURE__ */ t.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, h) : C.map((w) => /* @__PURE__ */ t.createElement(
595
595
  "div",
596
596
  {
597
- key: g.value,
598
- className: d(
597
+ key: w.value,
598
+ className: i(
599
599
  "px-3 py-2 cursor-pointer text-sm transition-colors duration-150",
600
600
  "hover:bg-[var(--select-dropdown-hover)]",
601
- _ === g.value && "bg-[var(--select-dropdown-selected)]"
601
+ T === w.value && "bg-[var(--select-dropdown-selected)]"
602
602
  ),
603
- onMouseDown: () => u(g.value)
603
+ onMouseDown: () => f(w.value)
604
604
  },
605
- g.label
605
+ w.label
606
606
  ))
607
- ), P && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, P));
607
+ ), P && /* @__PURE__ */ t.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, P));
608
608
  }
609
609
  );
610
- We.displayName = "AsyncSelect";
611
- const Ve = e.forwardRef(
610
+ Ue.displayName = "AsyncSelect";
611
+ const Ye = t.forwardRef(
612
612
  ({
613
- name: t,
614
- label: n,
613
+ name: e,
614
+ label: a,
615
615
  options: r,
616
- className: a,
616
+ className: o,
617
617
  containerClassName: l,
618
- isClearable: w,
619
- searchable: b = !1,
620
- filterPlaceholder: M = "Digite para filtrar...",
621
- caseSensitive: N = !1,
622
- filterFunction: y,
623
- onFocus: f,
618
+ isClearable: v,
619
+ searchable: d = !1,
620
+ filterPlaceholder: k = "Digite para filtrar...",
621
+ caseSensitive: h = !1,
622
+ filterFunction: g,
623
+ onFocus: u,
624
624
  onBlur: x,
625
- ...c
626
- }, I) => {
627
- var oe, re, ne;
628
- const [k, S] = e.useState(!1), [v, h] = e.useState(!1), [E, C] = e.useState(""), [i, R] = e.useState({
625
+ ...s
626
+ }, S) => {
627
+ var le, re, oe;
628
+ const [L, M] = t.useState(!1), [y, E] = t.useState(!1), [N, C] = t.useState(""), [m, R] = t.useState({
629
629
  top: 0,
630
630
  left: 0,
631
631
  width: 0
632
- }), F = e.useRef(null), B = e.useRef(null), p = ce(), V = p == null ? void 0 : p.control, U = V && t ? de({ control: V, name: t }) : void 0, L = c.value ?? U ?? [], J = (ne = (re = (oe = p == null ? void 0 : p.formState) == null ? void 0 : oe.errors) == null ? void 0 : re[t]) == null ? void 0 : ne.message, G = y || ((u, T) => {
633
- const s = N ? u.label : u.label.toLowerCase(), O = N ? T : T.toLowerCase();
634
- return s.includes(O);
635
- }), W = E.trim() ? r.filter((u) => G(u, E.trim())) : r, $ = k || L && L.length > 0 || b && !!E, X = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), _ = e.useCallback(() => {
636
- if (F.current && v) {
637
- const u = F.current.getBoundingClientRect(), T = X(), s = window.innerHeight, O = window.innerWidth, K = 152;
638
- let te = u.bottom + 4, Q = u.left;
639
- if (T) {
640
- const g = s - u.bottom, H = u.top;
641
- g < K && H > K && (te = u.top - K - 4);
642
- const ae = 16, m = O - u.width - ae;
643
- Q = Math.min(Math.max(Q, ae), m);
632
+ }), F = t.useRef(null), I = t.useRef(null), b = ce(), V = b == null ? void 0 : b.control, U = V && e ? de({ control: V, name: e }) : void 0, B = s.value ?? U ?? [], J = (oe = (re = (le = b == null ? void 0 : b.formState) == null ? void 0 : le.errors) == null ? void 0 : re[e]) == null ? void 0 : oe.message, G = g || ((f, A) => {
633
+ const c = h ? f.label : f.label.toLowerCase(), W = h ? A : A.toLowerCase();
634
+ return c.includes(W);
635
+ }), O = N.trim() ? r.filter((f) => G(f, N.trim())) : r, z = L || B && B.length > 0 || d && !!N, X = t.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), T = t.useCallback(() => {
636
+ if (F.current && y) {
637
+ const f = F.current.getBoundingClientRect(), A = X(), c = window.innerHeight, W = window.innerWidth, K = 152;
638
+ let te = f.bottom + 4, Q = f.left;
639
+ if (A) {
640
+ const w = c - f.bottom, H = f.top;
641
+ w < K && H > K && (te = f.top - K - 4);
642
+ const ae = 16, p = W - f.width - ae;
643
+ Q = Math.min(Math.max(Q, ae), p);
644
644
  } else
645
- s - u.bottom < K && (te = u.top - K - 4);
645
+ c - f.bottom < K && (te = f.top - K - 4);
646
646
  R({
647
647
  top: te,
648
648
  left: Q,
649
- width: u.width
649
+ width: f.width
650
650
  });
651
651
  }
652
- }, [v, X]);
653
- e.useEffect(() => {
654
- if (_(), v) {
655
- const u = () => _(), T = () => _();
656
- return window.addEventListener("resize", u), window.addEventListener("scroll", T, !0), () => {
657
- window.removeEventListener("resize", u), window.removeEventListener("scroll", T, !0);
652
+ }, [y, X]);
653
+ t.useEffect(() => {
654
+ if (T(), y) {
655
+ const f = () => T(), A = () => T();
656
+ return window.addEventListener("resize", f), window.addEventListener("scroll", A, !0), () => {
657
+ window.removeEventListener("resize", f), window.removeEventListener("scroll", A, !0);
658
658
  };
659
659
  }
660
- }, [v, _]), e.useEffect(() => {
661
- const u = (T) => {
662
- F.current && !F.current.contains(T.target) && (h(!1), S(!1));
660
+ }, [y, T]), t.useEffect(() => {
661
+ const f = (A) => {
662
+ F.current && !F.current.contains(A.target) && (E(!1), M(!1));
663
663
  };
664
- return document.addEventListener("mousedown", u), () => {
665
- document.removeEventListener("mousedown", u);
664
+ return document.addEventListener("mousedown", f), () => {
665
+ document.removeEventListener("mousedown", f);
666
666
  };
667
667
  }, []);
668
668
  const P = () => {
669
- h((u) => !u), S(!0);
670
- }, q = (u) => {
671
- S(!0), f && f(u);
672
- }, z = (u) => {
673
- x && x(u);
674
- }, Y = (u) => {
675
- var s;
676
- let T;
677
- L.includes(u) ? T = L.filter((O) => O !== u) : T = [...L, u], p && t && p.setValue(t, T), c.onChange && ((s = c.onChange) == null || s.call(c, {
678
- target: { value: T }
679
- })), S(!0);
680
- }, j = (u) => {
681
- var T;
682
- u.stopPropagation(), p && t && p.setValue(t, []), c.onChange && ((T = c.onChange) == null || T.call(c, {
669
+ E((f) => !f), M(!0);
670
+ }, q = (f) => {
671
+ M(!0), u && u(f);
672
+ }, $ = (f) => {
673
+ x && x(f);
674
+ }, Y = (f) => {
675
+ var c;
676
+ let A;
677
+ B.includes(f) ? A = B.filter((W) => W !== f) : A = [...B, f], b && e && b.setValue(e, A), s.onChange && ((c = s.onChange) == null || c.call(s, {
678
+ target: { value: A }
679
+ })), M(!0);
680
+ }, j = (f) => {
681
+ var A;
682
+ f.stopPropagation(), b && e && b.setValue(e, []), s.onChange && ((A = s.onChange) == null || A.call(s, {
683
683
  target: { value: [] }
684
- })), h(!1), S(!1);
685
- }, D = (u) => {
686
- C(u.target.value);
684
+ })), E(!1), M(!1);
685
+ }, D = (f) => {
686
+ C(f.target.value);
687
687
  };
688
- return /* @__PURE__ */ e.createElement("div", { className: d("relative", l), ref: F }, /* @__PURE__ */ e.createElement(
688
+ return /* @__PURE__ */ t.createElement("div", { className: i("relative", l), ref: F }, /* @__PURE__ */ t.createElement(
689
689
  "div",
690
690
  {
691
- id: c.id || t,
691
+ id: s.id || e,
692
692
  tabIndex: 0,
693
693
  role: "button",
694
694
  "aria-haspopup": "listbox",
695
- "aria-expanded": v,
696
- className: d(
695
+ "aria-expanded": y,
696
+ className: i(
697
697
  "peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
698
- a
698
+ o
699
699
  ),
700
- onClick: b ? void 0 : P,
701
- onFocus: b ? void 0 : q,
702
- onBlur: b ? void 0 : z,
703
- ref: I
700
+ onClick: d ? void 0 : P,
701
+ onFocus: d ? void 0 : q,
702
+ onBlur: d ? void 0 : $,
703
+ ref: S
704
704
  },
705
- /* @__PURE__ */ e.createElement(
705
+ /* @__PURE__ */ t.createElement(
706
706
  "div",
707
707
  {
708
708
  className: "flex flex-nowrap gap-1 items-center min-h-[1.5rem] w-full overflow-x-auto",
709
709
  style: { scrollbarWidth: "none" }
710
710
  },
711
- L && L.length > 0 ? r.filter((u) => L.includes(u.value)).map((u) => /* @__PURE__ */ e.createElement(
711
+ B && B.length > 0 ? r.filter((f) => B.includes(f.value)).map((f) => /* @__PURE__ */ t.createElement(
712
712
  "span",
713
713
  {
714
- key: u.value,
714
+ key: f.value,
715
715
  className: "flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm mr-1 gap-2",
716
716
  style: { maxWidth: "140px" }
717
717
  },
718
- /* @__PURE__ */ e.createElement("span", { className: "truncate", title: u.label }, u.label),
719
- /* @__PURE__ */ e.createElement(
718
+ /* @__PURE__ */ t.createElement("span", { className: "truncate", title: f.label }, f.label),
719
+ /* @__PURE__ */ t.createElement(
720
720
  "button",
721
721
  {
722
722
  type: "button",
723
723
  className: "ml-1 text-[var(--primary,#2563eb)] hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150",
724
- "aria-label": `Remover ${u.label}`,
724
+ "aria-label": `Remover ${f.label}`,
725
725
  tabIndex: -1,
726
- onClick: (T) => {
727
- T.stopPropagation();
728
- const s = L.filter((O) => O !== u.value);
729
- p && t && p.setValue(t, s), c.onChange && c.onChange({
730
- target: { value: s }
726
+ onClick: (A) => {
727
+ A.stopPropagation();
728
+ const c = B.filter((W) => W !== f.value);
729
+ b && e && b.setValue(e, c), s.onChange && s.onChange({
730
+ target: { value: c }
731
731
  });
732
732
  }
733
733
  },
734
- /* @__PURE__ */ e.createElement(
734
+ /* @__PURE__ */ t.createElement(
735
735
  "svg",
736
736
  {
737
737
  width: "12",
@@ -740,7 +740,7 @@ const Ve = e.forwardRef(
740
740
  fill: "none",
741
741
  xmlns: "http://www.w3.org/2000/svg"
742
742
  },
743
- /* @__PURE__ */ e.createElement(
743
+ /* @__PURE__ */ t.createElement(
744
744
  "path",
745
745
  {
746
746
  d: "M3 3L9 9M9 3L3 9",
@@ -751,26 +751,26 @@ const Ve = e.forwardRef(
751
751
  )
752
752
  )
753
753
  )
754
- )) : !n && !b && /* @__PURE__ */ e.createElement("span", { className: "text-gray-400 text-sm" }, "Selecione..."),
755
- b && /* @__PURE__ */ e.createElement(
754
+ )) : !a && !d && /* @__PURE__ */ t.createElement("span", { className: "text-gray-400 text-sm" }, "Selecione..."),
755
+ d && /* @__PURE__ */ t.createElement(
756
756
  "input",
757
757
  {
758
- ref: B,
758
+ ref: I,
759
759
  type: "text",
760
- value: E,
760
+ value: N,
761
761
  onChange: D,
762
- onFocus: (u) => {
763
- S(!0), h(!0), f && f(u);
762
+ onFocus: (f) => {
763
+ M(!0), E(!0), u && u(f);
764
764
  },
765
- onBlur: (u) => {
766
- x && x(u);
765
+ onBlur: (f) => {
766
+ x && x(f);
767
767
  },
768
- placeholder: n ? L && L.length > 0 ? "" : M : M || "Selecione...",
768
+ placeholder: a ? B && B.length > 0 ? "" : k : k || "Selecione...",
769
769
  className: "flex-1 bg-transparent border-none outline-none text-sm min-w-[100px]"
770
770
  }
771
771
  )
772
772
  ),
773
- w && L && L.length > 0 && /* @__PURE__ */ e.createElement(
773
+ v && B && B.length > 0 && /* @__PURE__ */ t.createElement(
774
774
  "button",
775
775
  {
776
776
  type: "button",
@@ -781,201 +781,201 @@ const Ve = e.forwardRef(
781
781
  },
782
782
  "✕"
783
783
  )
784
- ), n && /* @__PURE__ */ e.createElement(
784
+ ), a && /* @__PURE__ */ t.createElement(
785
785
  "label",
786
786
  {
787
- htmlFor: c.id || t,
788
- className: d(
787
+ htmlFor: s.id || e,
788
+ className: i(
789
789
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
790
- $ ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
790
+ z ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
791
791
  )
792
792
  },
793
- n
794
- ), /* @__PURE__ */ e.createElement(
793
+ a
794
+ ), /* @__PURE__ */ t.createElement(
795
795
  "div",
796
796
  {
797
- className: d(
797
+ className: i(
798
798
  "absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
799
799
  "bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
800
- v ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
800
+ y ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
801
801
  ),
802
802
  style: {
803
- maxHeight: v ? "9.5rem" : "0",
803
+ maxHeight: y ? "9.5rem" : "0",
804
804
  overflowY: r.length > 3 ? "auto" : "hidden",
805
805
  position: "fixed",
806
806
  // Use fixed positioning to escape container overflow
807
- top: v ? `${i.top}px` : "auto",
808
- left: v ? `${i.left}px` : "auto",
809
- width: v ? `${i.width}px` : "auto",
807
+ top: y ? `${m.top}px` : "auto",
808
+ left: y ? `${m.left}px` : "auto",
809
+ width: y ? `${m.width}px` : "auto",
810
810
  zIndex: 9999,
811
- boxShadow: v ? "var(--select-dropdown-shadow)" : "none"
811
+ boxShadow: y ? "var(--select-dropdown-shadow)" : "none"
812
812
  }
813
813
  },
814
- W.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, "Nenhuma opção encontrada") : W.map((u) => /* @__PURE__ */ e.createElement(
814
+ O.length === 0 ? /* @__PURE__ */ t.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, "Nenhuma opção encontrada") : O.map((f) => /* @__PURE__ */ t.createElement(
815
815
  "div",
816
816
  {
817
- key: u.value,
818
- className: d(
817
+ key: f.value,
818
+ className: i(
819
819
  "px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150",
820
820
  "hover:bg-[var(--select-dropdown-hover)]",
821
- L.includes(u.value) && "bg-[var(--select-dropdown-selected)] font-semibold"
821
+ B.includes(f.value) && "bg-[var(--select-dropdown-selected)] font-semibold"
822
822
  ),
823
- onMouseDown: () => Y(u.value)
823
+ onMouseDown: () => Y(f.value)
824
824
  },
825
- /* @__PURE__ */ e.createElement(
825
+ /* @__PURE__ */ t.createElement(
826
826
  "input",
827
827
  {
828
828
  type: "checkbox",
829
- checked: L.includes(u.value),
829
+ checked: B.includes(f.value),
830
830
  readOnly: !0,
831
831
  className: "accent-blue-500"
832
832
  }
833
833
  ),
834
- u.label
834
+ f.label
835
835
  ))
836
- ), J && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, J));
836
+ ), J && /* @__PURE__ */ t.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, J));
837
837
  }
838
838
  );
839
- Ve.displayName = "MultiSelect";
840
- const He = e.forwardRef(
839
+ Ye.displayName = "MultiSelect";
840
+ const Ge = t.forwardRef(
841
841
  ({
842
- name: t,
843
- label: n,
842
+ name: e,
843
+ label: a,
844
844
  loadOptions: r,
845
- className: a,
845
+ className: o,
846
846
  containerClassName: l,
847
- isClearable: w,
848
- defaultOptions: b = !1,
849
- loadingMessage: M = "Carregando...",
850
- noOptionsMessage: N = "Nenhuma opção encontrada",
851
- searchable: y = !1,
852
- debounceMs: f = 300,
847
+ isClearable: v,
848
+ defaultOptions: d = !1,
849
+ loadingMessage: k = "Carregando...",
850
+ noOptionsMessage: h = "Nenhuma opção encontrada",
851
+ searchable: g = !1,
852
+ debounceMs: u = 300,
853
853
  maxSelectedDisplay: x = 3,
854
- onFocus: c,
855
- onBlur: I,
856
- ...k
857
- }, S) => {
858
- var g, H, ae;
859
- const [v, h] = e.useState(!1), [E, C] = e.useState(!1), [i, R] = e.useState([]), [F, B] = e.useState(!1), [p, V] = e.useState(""), [U, L] = e.useState(""), [J, Z] = e.useState({
854
+ onFocus: s,
855
+ onBlur: S,
856
+ ...L
857
+ }, M) => {
858
+ var w, H, ae;
859
+ const [y, E] = t.useState(!1), [N, C] = t.useState(!1), [m, R] = t.useState([]), [F, I] = t.useState(!1), [b, V] = t.useState(""), [U, B] = t.useState(""), [J, Z] = t.useState({
860
860
  top: 0,
861
861
  left: 0,
862
862
  width: 0
863
- }), G = e.useRef(null), W = e.useRef(null), $ = ce(), X = $ == null ? void 0 : $.control, _ = X && t ? de({ control: X, name: t }) : void 0, P = k.value ?? _ ?? [], q = (ae = (H = (g = $ == null ? void 0 : $.formState) == null ? void 0 : g.errors) == null ? void 0 : H[t]) == null ? void 0 : ae.message, z = v || P && P.length > 0, Y = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), j = e.useCallback(() => {
864
- if (G.current && E) {
865
- const m = G.current.getBoundingClientRect(), A = Y(), ee = window.innerHeight, ie = window.innerWidth, se = 152;
866
- let fe = m.bottom + 4, ue = m.left;
867
- if (A) {
868
- const me = ee - m.bottom, Pe = m.top;
869
- me < se && Pe > se && (fe = m.top - se - 4);
870
- const ge = 16, _e = ie - m.width - ge;
871
- ue = Math.min(Math.max(ue, ge), _e);
863
+ }), G = t.useRef(null), O = t.useRef(null), z = ce(), X = z == null ? void 0 : z.control, T = X && e ? de({ control: X, name: e }) : void 0, P = L.value ?? T ?? [], q = (ae = (H = (w = z == null ? void 0 : z.formState) == null ? void 0 : w.errors) == null ? void 0 : H[e]) == null ? void 0 : ae.message, $ = y || P && P.length > 0, Y = t.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), j = t.useCallback(() => {
864
+ if (G.current && N) {
865
+ const p = G.current.getBoundingClientRect(), _ = Y(), ee = window.innerHeight, ie = window.innerWidth, se = 152;
866
+ let me = p.bottom + 4, ue = p.left;
867
+ if (_) {
868
+ const fe = ee - p.bottom, Ae = p.top;
869
+ fe < se && Ae > se && (me = p.top - se - 4);
870
+ const xe = 16, ze = ie - p.width - xe;
871
+ ue = Math.min(Math.max(ue, xe), ze);
872
872
  } else
873
- ee - m.bottom < se && (fe = m.top - se - 4);
873
+ ee - p.bottom < se && (me = p.top - se - 4);
874
874
  Z({
875
- top: fe,
875
+ top: me,
876
876
  left: ue,
877
- width: m.width
877
+ width: p.width
878
878
  });
879
879
  }
880
- }, [E, Y]);
881
- e.useEffect(() => {
882
- if (j(), E) {
883
- const m = () => j(), A = () => j();
884
- return window.addEventListener("resize", m), window.addEventListener("scroll", A, !0), () => {
885
- window.removeEventListener("resize", m), window.removeEventListener("scroll", A, !0);
880
+ }, [N, Y]);
881
+ t.useEffect(() => {
882
+ if (j(), N) {
883
+ const p = () => j(), _ = () => j();
884
+ return window.addEventListener("resize", p), window.addEventListener("scroll", _, !0), () => {
885
+ window.removeEventListener("resize", p), window.removeEventListener("scroll", _, !0);
886
886
  };
887
887
  }
888
- }, [E, j]), e.useEffect(() => {
889
- const m = setTimeout(() => {
890
- L(p);
891
- }, f);
892
- return () => clearTimeout(m);
893
- }, [p, f]), e.useEffect(() => {
894
- (E || b && i.length === 0) && D(y ? U : void 0);
895
- }, [U, E]), e.useEffect(() => {
896
- b === !0 ? D() : Array.isArray(b) && R(b);
888
+ }, [N, j]), t.useEffect(() => {
889
+ const p = setTimeout(() => {
890
+ B(b);
891
+ }, u);
892
+ return () => clearTimeout(p);
893
+ }, [b, u]), t.useEffect(() => {
894
+ (N || d && m.length === 0) && D(g ? U : void 0);
895
+ }, [U, N]), t.useEffect(() => {
896
+ d === !0 ? D() : Array.isArray(d) && R(d);
897
897
  }, []);
898
- const D = async (m) => {
898
+ const D = async (p) => {
899
899
  try {
900
- B(!0);
901
- const A = await r(m);
902
- R(A);
903
- } catch (A) {
904
- console.error("Error loading options:", A), R([]);
900
+ I(!0);
901
+ const _ = await r(p);
902
+ R(_);
903
+ } catch (_) {
904
+ console.error("Error loading options:", _), R([]);
905
905
  } finally {
906
- B(!1);
906
+ I(!1);
907
907
  }
908
908
  };
909
- e.useEffect(() => {
910
- const m = (A) => {
911
- G.current && !G.current.contains(A.target) && (C(!1), h(!1), V(""));
909
+ t.useEffect(() => {
910
+ const p = (_) => {
911
+ G.current && !G.current.contains(_.target) && (C(!1), E(!1), V(""));
912
912
  };
913
- return document.addEventListener("mousedown", m), () => {
914
- document.removeEventListener("mousedown", m);
913
+ return document.addEventListener("mousedown", p), () => {
914
+ document.removeEventListener("mousedown", p);
915
915
  };
916
916
  }, []);
917
- const oe = () => {
918
- E || (C(!0), h(!0), y && W.current && setTimeout(() => {
919
- var m;
920
- return (m = W.current) == null ? void 0 : m.focus();
917
+ const le = () => {
918
+ N || (C(!0), E(!0), g && O.current && setTimeout(() => {
919
+ var p;
920
+ return (p = O.current) == null ? void 0 : p.focus();
921
921
  }, 0));
922
- }, re = (m) => {
923
- h(!0), c && c(m);
924
- }, ne = (m) => {
925
- I && I(m);
926
- }, u = (m) => {
927
- V(m.target.value);
928
- }, T = (m) => {
929
- let A;
930
- P.includes(m) ? A = P.filter((ee) => ee !== m) : A = [...P, m], $ && t && $.setValue(t, A), k.onChange && k.onChange({
931
- target: { value: A }
932
- }), h(!0);
933
- }, s = (m, A) => {
934
- A.stopPropagation();
935
- const ee = P.filter((ie) => ie !== m);
936
- $ && t && $.setValue(t, ee), k.onChange && k.onChange({
922
+ }, re = (p) => {
923
+ E(!0), s && s(p);
924
+ }, oe = (p) => {
925
+ S && S(p);
926
+ }, f = (p) => {
927
+ V(p.target.value);
928
+ }, A = (p) => {
929
+ let _;
930
+ P.includes(p) ? _ = P.filter((ee) => ee !== p) : _ = [...P, p], z && e && z.setValue(e, _), L.onChange && L.onChange({
931
+ target: { value: _ }
932
+ }), E(!0);
933
+ }, c = (p, _) => {
934
+ _.stopPropagation();
935
+ const ee = P.filter((ie) => ie !== p);
936
+ z && e && z.setValue(e, ee), L.onChange && L.onChange({
937
937
  target: { value: ee }
938
938
  });
939
- }, O = (m) => {
940
- m.stopPropagation(), $ && t && $.setValue(t, []), k.onChange && k.onChange({
939
+ }, W = (p) => {
940
+ p.stopPropagation(), z && e && z.setValue(e, []), L.onChange && L.onChange({
941
941
  target: { value: [] }
942
- }), C(!1), h(!1), V("");
943
- }, K = i.filter((m) => P.includes(m.value)), te = K.slice(0, x), Q = K.length - x;
944
- return /* @__PURE__ */ e.createElement("div", { className: d("relative", l), ref: G }, /* @__PURE__ */ e.createElement(
942
+ }), C(!1), E(!1), V("");
943
+ }, K = m.filter((p) => P.includes(p.value)), te = K.slice(0, x), Q = K.length - x;
944
+ return /* @__PURE__ */ t.createElement("div", { className: i("relative", l), ref: G }, /* @__PURE__ */ t.createElement(
945
945
  "div",
946
946
  {
947
- id: k.id || t,
948
- tabIndex: y ? -1 : 0,
947
+ id: L.id || e,
948
+ tabIndex: g ? -1 : 0,
949
949
  role: "button",
950
950
  "aria-haspopup": "listbox",
951
- "aria-expanded": E,
952
- className: d(
951
+ "aria-expanded": N,
952
+ className: i(
953
953
  "peer flex items-center min-h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-2 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
954
- a
954
+ o
955
955
  ),
956
- onClick: oe,
957
- onFocus: y ? void 0 : re,
958
- onBlur: y ? void 0 : ne,
959
- ref: S
956
+ onClick: le,
957
+ onFocus: g ? void 0 : re,
958
+ onBlur: g ? void 0 : oe,
959
+ ref: M
960
960
  },
961
- /* @__PURE__ */ e.createElement("div", { className: "flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full" }, te.map((m) => /* @__PURE__ */ e.createElement(
961
+ /* @__PURE__ */ t.createElement("div", { className: "flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full" }, te.map((p) => /* @__PURE__ */ t.createElement(
962
962
  "span",
963
963
  {
964
- key: m.value,
964
+ key: p.value,
965
965
  className: "flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm gap-2",
966
966
  style: { maxWidth: "140px" }
967
967
  },
968
- /* @__PURE__ */ e.createElement("span", { className: "truncate", title: m.label }, m.label),
969
- /* @__PURE__ */ e.createElement(
968
+ /* @__PURE__ */ t.createElement("span", { className: "truncate", title: p.label }, p.label),
969
+ /* @__PURE__ */ t.createElement(
970
970
  "button",
971
971
  {
972
972
  type: "button",
973
973
  className: "ml-1 text-[var(--primary,#2563eb)] hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150",
974
- "aria-label": `Remover ${m.label}`,
974
+ "aria-label": `Remover ${p.label}`,
975
975
  tabIndex: -1,
976
- onClick: (A) => s(m.value, A)
976
+ onClick: (_) => c(p.value, _)
977
977
  },
978
- /* @__PURE__ */ e.createElement(
978
+ /* @__PURE__ */ t.createElement(
979
979
  "svg",
980
980
  {
981
981
  width: "12",
@@ -984,7 +984,7 @@ const He = e.forwardRef(
984
984
  fill: "none",
985
985
  xmlns: "http://www.w3.org/2000/svg"
986
986
  },
987
- /* @__PURE__ */ e.createElement(
987
+ /* @__PURE__ */ t.createElement(
988
988
  "path",
989
989
  {
990
990
  d: "M3 3L9 9M9 3L3 9",
@@ -995,230 +995,230 @@ const He = e.forwardRef(
995
995
  )
996
996
  )
997
997
  )
998
- )), Q > 0 && /* @__PURE__ */ e.createElement("span", { className: "flex items-center border border-gray-200 bg-gray-100 text-gray-600 rounded-2xl px-3 py-1 text-xs" }, "+", Q, " mais"), y ? /* @__PURE__ */ e.createElement(
998
+ )), Q > 0 && /* @__PURE__ */ t.createElement("span", { className: "flex items-center border border-gray-200 bg-gray-100 text-gray-600 rounded-2xl px-3 py-1 text-xs" }, "+", Q, " mais"), g ? /* @__PURE__ */ t.createElement(
999
999
  "input",
1000
1000
  {
1001
- ref: W,
1001
+ ref: O,
1002
1002
  type: "text",
1003
- value: p,
1004
- onChange: u,
1003
+ value: b,
1004
+ onChange: f,
1005
1005
  onFocus: re,
1006
- onBlur: ne,
1007
- placeholder: P.length === 0 && !n ? "Selecione..." : "",
1006
+ onBlur: oe,
1007
+ placeholder: P.length === 0 && !a ? "Selecione..." : "",
1008
1008
  className: "flex-1 min-w-[120px] bg-transparent border-none outline-none text-sm"
1009
1009
  }
1010
- ) : P.length === 0 && !n && /* @__PURE__ */ e.createElement("span", { className: "text-gray-400 text-sm" }, "Selecione...")),
1011
- F && /* @__PURE__ */ e.createElement("div", { className: "absolute right-8 top-1/2 -translate-y-1/2" }, /* @__PURE__ */ e.createElement("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]" })),
1012
- w && P && P.length > 0 && !F && /* @__PURE__ */ e.createElement(
1010
+ ) : P.length === 0 && !a && /* @__PURE__ */ t.createElement("span", { className: "text-gray-400 text-sm" }, "Selecione...")),
1011
+ F && /* @__PURE__ */ t.createElement("div", { className: "absolute right-8 top-1/2 -translate-y-1/2" }, /* @__PURE__ */ t.createElement("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]" })),
1012
+ v && P && P.length > 0 && !F && /* @__PURE__ */ t.createElement(
1013
1013
  "button",
1014
1014
  {
1015
1015
  type: "button",
1016
1016
  tabIndex: -1,
1017
1017
  "aria-label": "Limpar seleção",
1018
1018
  className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",
1019
- onClick: O
1019
+ onClick: W
1020
1020
  },
1021
1021
  "✕"
1022
1022
  )
1023
- ), n && /* @__PURE__ */ e.createElement(
1023
+ ), a && /* @__PURE__ */ t.createElement(
1024
1024
  "label",
1025
1025
  {
1026
- htmlFor: k.id || t,
1027
- className: d(
1026
+ htmlFor: L.id || e,
1027
+ className: i(
1028
1028
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
1029
- z ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
1029
+ $ ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
1030
1030
  )
1031
1031
  },
1032
- n
1033
- ), /* @__PURE__ */ e.createElement(
1032
+ a
1033
+ ), /* @__PURE__ */ t.createElement(
1034
1034
  "div",
1035
1035
  {
1036
- className: d(
1036
+ className: i(
1037
1037
  "absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
1038
1038
  "bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
1039
- E ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
1039
+ N ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
1040
1040
  ),
1041
1041
  style: {
1042
- maxHeight: E ? "9.5rem" : "0",
1043
- overflowY: i.length > 3 ? "auto" : "hidden",
1042
+ maxHeight: N ? "9.5rem" : "0",
1043
+ overflowY: m.length > 3 ? "auto" : "hidden",
1044
1044
  position: "fixed",
1045
1045
  // Use fixed positioning to escape container overflow
1046
- top: E ? `${J.top}px` : "auto",
1047
- left: E ? `${J.left}px` : "auto",
1048
- width: E ? `${J.width}px` : "auto",
1046
+ top: N ? `${J.top}px` : "auto",
1047
+ left: N ? `${J.left}px` : "auto",
1048
+ width: N ? `${J.width}px` : "auto",
1049
1049
  zIndex: 9999,
1050
- boxShadow: E ? "var(--select-dropdown-shadow)" : "none"
1050
+ boxShadow: N ? "var(--select-dropdown-shadow)" : "none"
1051
1051
  }
1052
1052
  },
1053
- F ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, M) : i.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, N) : i.map((m) => /* @__PURE__ */ e.createElement(
1053
+ F ? /* @__PURE__ */ t.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, k) : m.length === 0 ? /* @__PURE__ */ t.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, h) : m.map((p) => /* @__PURE__ */ t.createElement(
1054
1054
  "div",
1055
1055
  {
1056
- key: m.value,
1057
- className: d(
1056
+ key: p.value,
1057
+ className: i(
1058
1058
  "px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150",
1059
1059
  "hover:bg-[var(--select-dropdown-hover)]",
1060
- P.includes(m.value) && "bg-[var(--select-dropdown-selected)] font-semibold"
1060
+ P.includes(p.value) && "bg-[var(--select-dropdown-selected)] font-semibold"
1061
1061
  ),
1062
- onMouseDown: () => T(m.value)
1062
+ onMouseDown: () => A(p.value)
1063
1063
  },
1064
- /* @__PURE__ */ e.createElement(
1064
+ /* @__PURE__ */ t.createElement(
1065
1065
  "input",
1066
1066
  {
1067
1067
  type: "checkbox",
1068
- checked: P.includes(m.value),
1068
+ checked: P.includes(p.value),
1069
1069
  readOnly: !0,
1070
1070
  className: "accent-blue-500"
1071
1071
  }
1072
1072
  ),
1073
- m.label
1073
+ p.label
1074
1074
  ))
1075
- ), q && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, q));
1075
+ ), q && /* @__PURE__ */ t.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, q));
1076
1076
  }
1077
1077
  );
1078
- He.displayName = "MultiAsyncSelect";
1079
- const De = {
1078
+ Ge.displayName = "MultiAsyncSelect";
1079
+ const qe = {
1080
1080
  sm: "h-10 text-sm px-3",
1081
1081
  md: "h-12 text-base px-4",
1082
1082
  lg: "h-16 text-lg px-6"
1083
- }, je = e.forwardRef(
1083
+ }, Ke = t.forwardRef(
1084
1084
  ({
1085
- name: t,
1086
- label: n,
1085
+ name: e,
1086
+ label: a,
1087
1087
  options: r,
1088
- className: a,
1088
+ className: o,
1089
1089
  containerClassName: l,
1090
- optionClassName: w,
1091
- direction: b = "row",
1092
- size: M = "md",
1093
- onFocus: N,
1094
- onBlur: y,
1095
- ...f
1090
+ optionClassName: v,
1091
+ direction: d = "row",
1092
+ size: k = "md",
1093
+ onFocus: h,
1094
+ onBlur: g,
1095
+ ...u
1096
1096
  }, x) => {
1097
- var E, C, i;
1098
- const c = ce(), I = c == null ? void 0 : c.control, k = I && t ? de({ control: I, name: t }) : void 0, S = f.value ?? k ?? "", v = (i = (C = (E = c == null ? void 0 : c.formState) == null ? void 0 : E.errors) == null ? void 0 : C[t]) == null ? void 0 : i.message, h = (R) => {
1099
- c && t && c.setValue(t, R), f.onChange && f.onChange({ target: { value: R } });
1097
+ var N, C, m;
1098
+ const s = ce(), S = s == null ? void 0 : s.control, L = S && e ? de({ control: S, name: e }) : void 0, M = u.value ?? L ?? "", y = (m = (C = (N = s == null ? void 0 : s.formState) == null ? void 0 : N.errors) == null ? void 0 : C[e]) == null ? void 0 : m.message, E = (R) => {
1099
+ s && e && s.setValue(e, R), u.onChange && u.onChange({ target: { value: R } });
1100
1100
  };
1101
- return /* @__PURE__ */ e.createElement("div", { className: d("relative", l), ref: x }, n && /* @__PURE__ */ e.createElement(
1101
+ return /* @__PURE__ */ t.createElement("div", { className: i("relative", l), ref: x }, a && /* @__PURE__ */ t.createElement(
1102
1102
  "label",
1103
1103
  {
1104
- htmlFor: t,
1105
- className: d(
1104
+ htmlFor: e,
1105
+ className: i(
1106
1106
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm transition-all duration-200",
1107
1107
  "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white"
1108
1108
  )
1109
1109
  },
1110
- n
1111
- ), /* @__PURE__ */ e.createElement(
1110
+ a
1111
+ ), /* @__PURE__ */ t.createElement(
1112
1112
  "div",
1113
1113
  {
1114
- className: d(
1114
+ className: i(
1115
1115
  "flex gap-2 w-full pt-6",
1116
1116
  // espaço para label flutuante
1117
- b === "row" ? "flex-row" : "flex-col",
1118
- a
1117
+ d === "row" ? "flex-row" : "flex-col",
1118
+ o
1119
1119
  ),
1120
- "aria-label": n,
1120
+ "aria-label": a,
1121
1121
  tabIndex: -1,
1122
- onFocus: N,
1123
- onBlur: y
1122
+ onFocus: h,
1123
+ onBlur: g
1124
1124
  },
1125
- r.map((R) => /* @__PURE__ */ e.createElement(
1125
+ r.map((R) => /* @__PURE__ */ t.createElement(
1126
1126
  "button",
1127
1127
  {
1128
1128
  key: R.value,
1129
1129
  type: "button",
1130
- className: d(
1130
+ className: i(
1131
1131
  "relative flex items-center justify-center border rounded-lg transition-all duration-200 shadow-sm px-4 focus:outline-none focus:ring-2 focus:ring-[var(--primary-hover,#dbeafe)]",
1132
- De[M],
1133
- S === R.value ? "border-[var(--primary,#2563eb)] bg-[var(--primary-hover,#dbeafe)] text-[var(--primary,#2563eb)] ring-2 ring-[var(--primary-hover,#dbeafe)] shadow-md transform scale-[1.02]" : "border-gray-200 bg-white text-gray-600 hover:border-[var(--primary,#2563eb)] hover:bg-[var(--primary-hover,#dbeafe)] hover:text-[var(--primary,#2563eb)] hover:shadow-md",
1134
- w
1132
+ qe[k],
1133
+ M === R.value ? "border-[var(--primary,#2563eb)] bg-[var(--primary-hover,#dbeafe)] text-[var(--primary,#2563eb)] ring-2 ring-[var(--primary-hover,#dbeafe)] shadow-md transform scale-[1.02]" : "border-gray-200 bg-white text-gray-600 hover:border-[var(--primary,#2563eb)] hover:bg-[var(--primary-hover,#dbeafe)] hover:text-[var(--primary,#2563eb)] hover:shadow-md",
1134
+ v
1135
1135
  ),
1136
- "aria-pressed": S === R.value,
1137
- "data-selected": S === R.value,
1136
+ "aria-pressed": M === R.value,
1137
+ "data-selected": M === R.value,
1138
1138
  tabIndex: 0,
1139
- onClick: () => h(R.value),
1139
+ onClick: () => E(R.value),
1140
1140
  onKeyDown: (F) => {
1141
- (F.key === "Enter" || F.key === " ") && (F.preventDefault(), h(R.value));
1141
+ (F.key === "Enter" || F.key === " ") && (F.preventDefault(), E(R.value));
1142
1142
  }
1143
1143
  },
1144
- R.icon && /* @__PURE__ */ e.createElement("span", { className: "mr-2 text-lg flex items-center" }, R.icon),
1145
- /* @__PURE__ */ e.createElement("span", { className: "truncate font-medium" }, R.label)
1144
+ R.icon && /* @__PURE__ */ t.createElement("span", { className: "mr-2 text-lg flex items-center" }, R.icon),
1145
+ /* @__PURE__ */ t.createElement("span", { className: "truncate font-medium" }, R.label)
1146
1146
  ))
1147
- ), v && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, v));
1147
+ ), y && /* @__PURE__ */ t.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, y));
1148
1148
  }
1149
1149
  );
1150
- je.displayName = "RadioGroup";
1151
- const ye = o.forwardRef(
1152
- ({ children: t, className: n, as: r = "div", ...a }, l) => /* @__PURE__ */ o.createElement(
1150
+ Ke.displayName = "RadioGroup";
1151
+ const Ne = n.forwardRef(
1152
+ ({ children: e, className: a, as: r = "div", ...o }, l) => /* @__PURE__ */ n.createElement(
1153
1153
  r,
1154
1154
  {
1155
1155
  ref: l,
1156
- className: d(
1156
+ className: i(
1157
1157
  "px-2 py-1 sm:px-4 sm:py-2 lg:px-6 lg:py-4 border-b",
1158
1158
  "bg-[var(--card-header-bg,rgba(249,250,251,0.5))]",
1159
1159
  "border-[var(--card-header-border,#e5e7eb)]",
1160
1160
  "text-[var(--card-text,#111827)]",
1161
- n
1161
+ a
1162
1162
  ),
1163
- ...a
1163
+ ...o
1164
1164
  },
1165
- t
1165
+ e
1166
1166
  )
1167
1167
  );
1168
- ye.displayName = "CardHeader";
1169
- const Ee = o.forwardRef(
1170
- ({ children: t, className: n, as: r = "div", ...a }, l) => /* @__PURE__ */ o.createElement(
1168
+ Ne.displayName = "CardHeader";
1169
+ const Ce = n.forwardRef(
1170
+ ({ children: e, className: a, as: r = "div", ...o }, l) => /* @__PURE__ */ n.createElement(
1171
1171
  r,
1172
1172
  {
1173
1173
  ref: l,
1174
- className: d(
1174
+ className: i(
1175
1175
  "px-2 py-1 sm:px-4 sm:py-2 lg:px-6 lg:py-4",
1176
1176
  "flex-1",
1177
1177
  // Para ocupar o espaço disponível
1178
1178
  "bg-[var(--card-bg,#ffffff)]",
1179
1179
  "text-[var(--card-text,#111827)]",
1180
- n
1180
+ a
1181
1181
  ),
1182
- ...a
1182
+ ...o
1183
1183
  },
1184
- t
1184
+ e
1185
1185
  )
1186
1186
  );
1187
- Ee.displayName = "CardBody";
1188
- const Ce = o.forwardRef(
1189
- ({ children: t, className: n, as: r = "div", ...a }, l) => /* @__PURE__ */ o.createElement(
1187
+ Ce.displayName = "CardBody";
1188
+ const ke = n.forwardRef(
1189
+ ({ children: e, className: a, as: r = "div", ...o }, l) => /* @__PURE__ */ n.createElement(
1190
1190
  r,
1191
1191
  {
1192
1192
  ref: l,
1193
- className: d(
1193
+ className: i(
1194
1194
  "px-6 py-4 border-t",
1195
1195
  "bg-[var(--card-footer-bg,rgba(249,250,251,0.5))]",
1196
1196
  "border-[var(--card-footer-border,#e5e7eb)]",
1197
1197
  "text-[var(--card-text,#111827)]",
1198
- n
1198
+ a
1199
1199
  ),
1200
- ...a
1200
+ ...o
1201
1201
  },
1202
- t
1202
+ e
1203
1203
  )
1204
1204
  );
1205
- Ce.displayName = "CardFooter";
1206
- const Ue = o.forwardRef(
1205
+ ke.displayName = "CardFooter";
1206
+ const Je = n.forwardRef(
1207
1207
  ({
1208
- children: t,
1209
- className: n,
1208
+ children: e,
1209
+ className: a,
1210
1210
  variant: r = "default",
1211
- size: a = "md",
1211
+ size: o = "md",
1212
1212
  padding: l = "none",
1213
1213
  // none pois cada seção tem seu próprio padding
1214
- rounded: w = "lg",
1215
- constrainWidth: b = !1,
1214
+ rounded: v = "lg",
1215
+ constrainWidth: d = !1,
1216
1216
  // Por padrão, não aplicar max-width
1217
- allowOverflow: M = !1,
1217
+ allowOverflow: k = !1,
1218
1218
  // Por padrão, aplicar overflow hidden para interface limpa
1219
- ...N
1220
- }, y) => {
1221
- const f = {
1219
+ ...h
1220
+ }, g) => {
1221
+ const u = {
1222
1222
  default: "bg-[var(--card-bg,#ffffff)] border border-[var(--card-border,#e5e7eb)] shadow-[var(--card-shadow-sm,0_1px_2px_0_rgb(0_0_0_/_0.05))]",
1223
1223
  outlined: "bg-[var(--card-bg,#ffffff)] border-2 border-[var(--primary,#2563eb)]",
1224
1224
  elevated: "bg-[var(--card-bg,#ffffff)] border border-[var(--card-border,#e5e7eb)] shadow-[var(--card-shadow-lg,0_10px_15px_-3px_rgb(0_0_0_/_0.1),_0_4px_6px_-4px_rgb(0_0_0_/_0.1))]",
@@ -1227,54 +1227,54 @@ const Ue = o.forwardRef(
1227
1227
  sm: "max-w-sm",
1228
1228
  md: "max-w-md",
1229
1229
  lg: "max-w-lg"
1230
- }, c = {
1230
+ }, s = {
1231
1231
  none: "",
1232
1232
  sm: "p-3",
1233
1233
  md: "p-4",
1234
1234
  lg: "p-6"
1235
- }, I = {
1235
+ }, S = {
1236
1236
  none: "rounded-none",
1237
1237
  sm: "rounded-sm",
1238
1238
  md: "rounded-md",
1239
1239
  lg: "rounded-lg",
1240
1240
  xl: "rounded-xl"
1241
1241
  };
1242
- return /* @__PURE__ */ o.createElement(
1242
+ return /* @__PURE__ */ n.createElement(
1243
1243
  "div",
1244
1244
  {
1245
- ref: y,
1246
- className: d(
1245
+ ref: g,
1246
+ className: i(
1247
1247
  "flex flex-col",
1248
1248
  // Flex column para organizar header, body, footer
1249
- !M && "overflow-hidden",
1249
+ !k && "overflow-hidden",
1250
1250
  // Overflow hidden por padrão para bordas limpas
1251
- f[r],
1252
- b && x[a],
1251
+ u[r],
1252
+ d && x[o],
1253
1253
  // Aplicar max-width apenas se constrainWidth for true
1254
- c[l],
1255
- I[w],
1256
- n
1254
+ s[l],
1255
+ S[v],
1256
+ a
1257
1257
  ),
1258
- ...N
1258
+ ...h
1259
1259
  },
1260
- t
1260
+ e
1261
1261
  );
1262
1262
  }
1263
- ), Ze = Object.assign(Ue, {
1264
- Header: ye,
1265
- Body: Ee,
1266
- Footer: Ce
1267
- }), Ne = o.forwardRef(
1263
+ ), st = Object.assign(Je, {
1264
+ Header: Ne,
1265
+ Body: Ce,
1266
+ Footer: ke
1267
+ }), Se = n.forwardRef(
1268
1268
  ({
1269
- children: t,
1270
- className: n,
1269
+ children: e,
1270
+ className: a,
1271
1271
  variant: r = "default",
1272
- size: a = "md",
1272
+ size: o = "md",
1273
1273
  responsive: l = !1,
1274
- stickyHeader: w = !1,
1275
- ...b
1276
- }, M) => {
1277
- const N = d(
1274
+ stickyHeader: v = !1,
1275
+ ...d
1276
+ }, k) => {
1277
+ const h = i(
1278
1278
  // Base styles
1279
1279
  "w-full border-collapse bg-[var(--table-bg)] text-[var(--table-text)]",
1280
1280
  // Variant styles
@@ -1283,179 +1283,179 @@ const Ue = o.forwardRef(
1283
1283
  },
1284
1284
  // Size styles
1285
1285
  {
1286
- "text-sm": a === "sm",
1287
- "text-base": a === "md",
1288
- "text-lg": a === "lg"
1286
+ "text-sm": o === "sm",
1287
+ "text-base": o === "md",
1288
+ "text-lg": o === "lg"
1289
1289
  },
1290
- n
1291
- ), y = d(
1290
+ a
1291
+ ), g = i(
1292
1292
  {
1293
1293
  "overflow-x-auto": l,
1294
- "max-h-96 overflow-y-auto": w
1294
+ "max-h-96 overflow-y-auto": v
1295
1295
  }
1296
- ), f = /* @__PURE__ */ o.createElement(
1296
+ ), u = /* @__PURE__ */ n.createElement(
1297
1297
  "table",
1298
1298
  {
1299
- ref: M,
1300
- className: N,
1301
- ...b
1299
+ ref: k,
1300
+ className: h,
1301
+ ...d
1302
1302
  },
1303
- t
1303
+ e
1304
1304
  );
1305
- return l || w ? /* @__PURE__ */ o.createElement("div", { className: y }, f) : f;
1305
+ return l || v ? /* @__PURE__ */ n.createElement("div", { className: g }, u) : u;
1306
1306
  }
1307
- ), ke = o.forwardRef(
1308
- ({ children: t, className: n, as: r = "thead", ...a }, l) => /* @__PURE__ */ o.createElement(
1307
+ ), Le = n.forwardRef(
1308
+ ({ children: e, className: a, as: r = "thead", ...o }, l) => /* @__PURE__ */ n.createElement(
1309
1309
  r,
1310
1310
  {
1311
1311
  ref: l,
1312
- className: d(
1312
+ className: i(
1313
1313
  "border-b border-[var(--table-border)] bg-[var(--table-header-bg)]",
1314
1314
  {
1315
1315
  "sticky top-0 z-10": r === "thead"
1316
1316
  },
1317
- n
1317
+ a
1318
1318
  ),
1319
- ...a
1319
+ ...o
1320
1320
  },
1321
- t
1321
+ e
1322
1322
  )
1323
- ), Se = o.forwardRef(
1324
- ({ children: t, className: n, as: r = "tbody", ...a }, l) => /* @__PURE__ */ o.createElement(
1323
+ ), Me = n.forwardRef(
1324
+ ({ children: e, className: a, as: r = "tbody", ...o }, l) => /* @__PURE__ */ n.createElement(
1325
1325
  r,
1326
1326
  {
1327
1327
  ref: l,
1328
- className: d(
1328
+ className: i(
1329
1329
  "[&_tr:nth-child(odd)]:bg-[var(--table-row-odd)]",
1330
1330
  "[&_tr:nth-child(even)]:bg-[var(--table-row-even)]",
1331
- n
1331
+ a
1332
1332
  ),
1333
- ...a
1333
+ ...o
1334
1334
  },
1335
- t
1335
+ e
1336
1336
  )
1337
- ), Re = o.forwardRef(
1338
- ({ children: t, className: n, as: r = "tfoot", ...a }, l) => /* @__PURE__ */ o.createElement(
1337
+ ), Re = n.forwardRef(
1338
+ ({ children: e, className: a, as: r = "tfoot", ...o }, l) => /* @__PURE__ */ n.createElement(
1339
1339
  r,
1340
1340
  {
1341
1341
  ref: l,
1342
- className: d(
1342
+ className: i(
1343
1343
  "border-t border-[var(--table-border)] bg-[var(--table-header-bg)] font-medium",
1344
- n
1344
+ a
1345
1345
  ),
1346
- ...a
1346
+ ...o
1347
1347
  },
1348
- t
1348
+ e
1349
1349
  )
1350
- ), Fe = o.forwardRef(
1351
- ({ children: t, className: n, variant: r = "default", ...a }, l) => /* @__PURE__ */ o.createElement(
1350
+ ), Fe = n.forwardRef(
1351
+ ({ children: e, className: a, variant: r = "default", ...o }, l) => /* @__PURE__ */ n.createElement(
1352
1352
  "tr",
1353
1353
  {
1354
1354
  ref: l,
1355
- className: d(
1355
+ className: i(
1356
1356
  "border-b border-[var(--table-border)] transition-colors",
1357
1357
  {
1358
1358
  "hover:bg-[var(--table-row-hover)]": r === "hover",
1359
1359
  "bg-[var(--table-row-selected)]": r === "selected"
1360
1360
  },
1361
- n
1361
+ a
1362
1362
  ),
1363
- ...a
1363
+ ...o
1364
1364
  },
1365
- t
1365
+ e
1366
1366
  )
1367
- ), Ie = o.forwardRef(
1367
+ ), Be = n.forwardRef(
1368
1368
  ({
1369
- children: t,
1370
- className: n,
1369
+ children: e,
1370
+ className: a,
1371
1371
  as: r = "td",
1372
- align: a = "left",
1372
+ align: o = "left",
1373
1373
  scope: l,
1374
- colSpan: w,
1375
- rowSpan: b,
1376
- ...M
1377
- }, N) => /* @__PURE__ */ o.createElement(
1374
+ colSpan: v,
1375
+ rowSpan: d,
1376
+ ...k
1377
+ }, h) => /* @__PURE__ */ n.createElement(
1378
1378
  r,
1379
1379
  {
1380
- ref: N,
1380
+ ref: h,
1381
1381
  scope: r === "th" ? l : void 0,
1382
- colSpan: w,
1383
- rowSpan: b,
1384
- className: d(
1382
+ colSpan: v,
1383
+ rowSpan: d,
1384
+ className: i(
1385
1385
  "px-4 py-3 text-left",
1386
1386
  {
1387
1387
  "font-semibold": r === "th",
1388
1388
  "text-sm": r === "td",
1389
- "text-center": a === "center",
1390
- "text-right": a === "right"
1389
+ "text-center": o === "center",
1390
+ "text-right": o === "right"
1391
1391
  },
1392
- n
1392
+ a
1393
1393
  ),
1394
- ...M
1394
+ ...k
1395
1395
  },
1396
- t
1396
+ e
1397
1397
  )
1398
1398
  );
1399
- Ne.displayName = "Table";
1400
- ke.displayName = "TableHeader";
1401
- Se.displayName = "TableBody";
1399
+ Se.displayName = "Table";
1400
+ Le.displayName = "TableHeader";
1401
+ Me.displayName = "TableBody";
1402
1402
  Re.displayName = "TableFooter";
1403
1403
  Fe.displayName = "TableRow";
1404
- Ie.displayName = "TableCell";
1405
- const et = Object.assign(Ne, {
1406
- Header: ke,
1407
- Body: Se,
1404
+ Be.displayName = "TableCell";
1405
+ const it = Object.assign(Se, {
1406
+ Header: Le,
1407
+ Body: Me,
1408
1408
  Footer: Re,
1409
1409
  Row: Fe,
1410
- Cell: Ie
1411
- }), tt = ({
1412
- content: t,
1413
- children: n,
1410
+ Cell: Be
1411
+ }), ct = ({
1412
+ content: e,
1413
+ children: a,
1414
1414
  position: r = "top",
1415
- className: a = "",
1415
+ className: o = "",
1416
1416
  disabled: l = !1
1417
1417
  }) => {
1418
- const [w, b] = le(!1), [M, N] = le(r), [y, f] = le({}), x = pe(null), c = pe(null);
1419
- be(() => {
1420
- if (!w || !c.current) return;
1421
- const i = c.current.getBoundingClientRect();
1422
- let R = r, F = 0, B = 0;
1418
+ const [v, d] = ne(!1), [k, h] = ne(r), [g, u] = ne({}), x = pe(null), s = pe(null);
1419
+ ve(() => {
1420
+ if (!v || !s.current) return;
1421
+ const m = s.current.getBoundingClientRect();
1422
+ let R = r, F = 0, I = 0;
1423
1423
  switch (r) {
1424
1424
  case "top":
1425
- F = i.top - 8, B = i.left + i.width / 2;
1425
+ F = m.top - 8, I = m.left + m.width / 2;
1426
1426
  break;
1427
1427
  case "bottom":
1428
- F = i.bottom + 8, B = i.left + i.width / 2;
1428
+ F = m.bottom + 8, I = m.left + m.width / 2;
1429
1429
  break;
1430
1430
  case "left":
1431
- F = i.top + i.height / 2, B = i.left - 8;
1431
+ F = m.top + m.height / 2, I = m.left - 8;
1432
1432
  break;
1433
1433
  case "right":
1434
- F = i.top + i.height / 2, B = i.right + 8;
1434
+ F = m.top + m.height / 2, I = m.right + 8;
1435
1435
  break;
1436
1436
  }
1437
1437
  if (x.current) {
1438
- const p = x.current.getBoundingClientRect(), V = window.innerWidth, U = window.innerHeight;
1439
- r === "top" && i.top < p.height + 16 ? (R = "bottom", F = i.bottom + 8) : r === "bottom" && i.bottom + p.height + 16 > U ? (R = "top", F = i.top - 8) : r === "left" && i.left < p.width + 16 ? (R = "right", B = i.right + 8) : r === "right" && i.right + p.width + 16 > V && (R = "left", B = i.left - 8);
1438
+ const b = x.current.getBoundingClientRect(), V = window.innerWidth, U = window.innerHeight;
1439
+ r === "top" && m.top < b.height + 16 ? (R = "bottom", F = m.bottom + 8) : r === "bottom" && m.bottom + b.height + 16 > U ? (R = "top", F = m.top - 8) : r === "left" && m.left < b.width + 16 ? (R = "right", I = m.right + 8) : r === "right" && m.right + b.width + 16 > V && (R = "left", I = m.left - 8);
1440
1440
  }
1441
- N(R), f({
1441
+ h(R), u({
1442
1442
  position: "fixed",
1443
1443
  top: `${F}px`,
1444
- left: `${B}px`,
1444
+ left: `${I}px`,
1445
1445
  zIndex: 9999
1446
1446
  });
1447
- }, [w, r]);
1448
- const I = () => {
1449
- l || b(!0);
1450
- }, k = () => {
1451
- b(!1);
1452
- }, S = () => {
1453
- l || b(!0);
1454
- }, v = () => {
1455
- b(!1);
1456
- }, h = () => {
1447
+ }, [v, r]);
1448
+ const S = () => {
1449
+ l || d(!0);
1450
+ }, L = () => {
1451
+ d(!1);
1452
+ }, M = () => {
1453
+ l || d(!0);
1454
+ }, y = () => {
1455
+ d(!1);
1456
+ }, E = () => {
1457
1457
  const C = "pointer-events-none";
1458
- switch (M) {
1458
+ switch (k) {
1459
1459
  case "top":
1460
1460
  return `${C} transform -translate-x-1/2 -translate-y-full`;
1461
1461
  case "bottom":
@@ -1467,9 +1467,9 @@ const et = Object.assign(Ne, {
1467
1467
  default:
1468
1468
  return `${C} transform -translate-x-1/2 -translate-y-full`;
1469
1469
  }
1470
- }, E = () => {
1470
+ }, N = () => {
1471
1471
  const C = "absolute w-2 h-2 bg-[var(--tooltip-bg,#374151)] transform rotate-45";
1472
- switch (M) {
1472
+ switch (k) {
1473
1473
  case "top":
1474
1474
  return `${C} top-full left-1/2 -translate-x-1/2 -translate-y-1/2`;
1475
1475
  case "bottom":
@@ -1482,208 +1482,208 @@ const et = Object.assign(Ne, {
1482
1482
  return `${C} top-full left-1/2 -translate-x-1/2 -translate-y-1/2`;
1483
1483
  }
1484
1484
  };
1485
- return l || !t ? /* @__PURE__ */ o.createElement(o.Fragment, null, n) : /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
1485
+ return l || !e ? /* @__PURE__ */ n.createElement(n.Fragment, null, a) : /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
1486
1486
  "div",
1487
1487
  {
1488
1488
  className: "relative inline-block",
1489
- ref: c,
1490
- onMouseEnter: I,
1491
- onMouseLeave: k,
1492
- onFocus: S,
1493
- onBlur: v
1489
+ ref: s,
1490
+ onMouseEnter: S,
1491
+ onMouseLeave: L,
1492
+ onFocus: M,
1493
+ onBlur: y
1494
1494
  },
1495
- n
1496
- ), w && typeof document < "u" && he(
1497
- /* @__PURE__ */ o.createElement(
1495
+ a
1496
+ ), v && typeof document < "u" && be(
1497
+ /* @__PURE__ */ n.createElement(
1498
1498
  "div",
1499
1499
  {
1500
1500
  ref: x,
1501
- style: y,
1502
- className: d(
1503
- h(),
1501
+ style: g,
1502
+ className: i(
1503
+ E(),
1504
1504
  "px-2 py-1 text-sm rounded whitespace-nowrap",
1505
1505
  "bg-[var(--tooltip-bg,#374151)] text-[var(--tooltip-text,#fff)]",
1506
1506
  "shadow-[var(--tooltip-shadow,0_10px_15px_-3px_rgb(0_0_0_/_0.1),_0_4px_6px_-4px_rgb(0_0_0_/_0.1))]",
1507
1507
  "transition-opacity duration-200 ease-in-out",
1508
- a
1508
+ o
1509
1509
  ),
1510
1510
  role: "tooltip",
1511
- "aria-hidden": !w
1511
+ "aria-hidden": !v
1512
1512
  },
1513
- t,
1514
- /* @__PURE__ */ o.createElement("div", { className: E() })
1513
+ e,
1514
+ /* @__PURE__ */ n.createElement("div", { className: N() })
1515
1515
  ),
1516
1516
  document.body
1517
1517
  ));
1518
- }, Ye = ({
1519
- open: t,
1520
- onClose: n,
1518
+ }, Qe = ({
1519
+ open: e,
1520
+ onClose: a,
1521
1521
  side: r = "right",
1522
- size: a = "md",
1522
+ size: o = "md",
1523
1523
  closeOnOverlayClick: l = !0,
1524
- children: w,
1525
- className: b = "",
1526
- ...M
1524
+ children: v,
1525
+ className: d = "",
1526
+ ...k
1527
1527
  }) => {
1528
- const N = typeof document < "u" ? document.body : null, y = a === "sm" ? "w-64" : a === "md" ? "w-96" : a === "lg" ? "w-[36rem]" : void 0, f = typeof a == "string" && !["sm", "md", "lg"].includes(a) ? { width: a } : void 0, x = /* @__PURE__ */ o.createElement(
1528
+ const h = typeof document < "u" ? document.body : null, g = o === "sm" ? "w-64" : o === "md" ? "w-96" : o === "lg" ? "w-[36rem]" : void 0, u = typeof o == "string" && !["sm", "md", "lg"].includes(o) ? { width: o } : void 0, x = /* @__PURE__ */ n.createElement(
1529
1529
  "div",
1530
1530
  {
1531
- "aria-hidden": !t,
1532
- className: d(
1531
+ "aria-hidden": !e,
1532
+ className: i(
1533
1533
  "fixed inset-0 z-50 flex",
1534
- t ? "pointer-events-auto" : "pointer-events-none"
1534
+ e ? "pointer-events-auto" : "pointer-events-none"
1535
1535
  )
1536
1536
  },
1537
- /* @__PURE__ */ o.createElement(
1537
+ /* @__PURE__ */ n.createElement(
1538
1538
  "div",
1539
1539
  {
1540
- className: d(
1540
+ className: i(
1541
1541
  "absolute inset-0 bg-black/40 transition-opacity duration-200",
1542
- t ? "opacity-100" : "opacity-0"
1542
+ e ? "opacity-100" : "opacity-0"
1543
1543
  ),
1544
- onMouseDown: (c) => {
1545
- l && c.target === c.currentTarget && n();
1544
+ onMouseDown: (s) => {
1545
+ l && s.target === s.currentTarget && a();
1546
1546
  }
1547
1547
  }
1548
1548
  ),
1549
- /* @__PURE__ */ o.createElement(
1549
+ /* @__PURE__ */ n.createElement(
1550
1550
  "div",
1551
1551
  {
1552
- className: d(
1552
+ className: i(
1553
1553
  "relative h-full",
1554
1554
  r === "right" ? "ml-auto" : "mr-auto",
1555
1555
  // ensure the sheet doesn't shrink
1556
1556
  "flex-shrink-0"
1557
1557
  ),
1558
- style: f
1558
+ style: u
1559
1559
  },
1560
- /* @__PURE__ */ o.createElement(
1560
+ /* @__PURE__ */ n.createElement(
1561
1561
  "aside",
1562
1562
  {
1563
1563
  role: "dialog",
1564
1564
  "aria-modal": !0,
1565
- className: d(
1565
+ className: i(
1566
1566
  "h-full bg-white shadow-xl border-l border-gray-100 overflow-auto transition-transform duration-300",
1567
- r === "right" ? t ? "translate-x-0" : "translate-x-full" : t ? "translate-x-0" : "-translate-x-full",
1568
- y,
1569
- b
1567
+ r === "right" ? e ? "translate-x-0" : "translate-x-full" : e ? "translate-x-0" : "-translate-x-full",
1568
+ g,
1569
+ d
1570
1570
  ),
1571
- style: f,
1572
- ...M
1571
+ style: u,
1572
+ ...k
1573
1573
  },
1574
- w
1574
+ v
1575
1575
  )
1576
1576
  )
1577
1577
  );
1578
- return N ? he(x, N) : null;
1578
+ return h ? be(x, h) : null;
1579
1579
  };
1580
- Ye.displayName = "AsideSheet";
1581
- const rt = ({
1582
- avatar: t = !1,
1583
- value: n,
1580
+ Qe.displayName = "AsideSheet";
1581
+ const dt = ({
1582
+ avatar: e = !1,
1583
+ value: a,
1584
1584
  onUpload: r,
1585
- onRemove: a,
1585
+ onRemove: o,
1586
1586
  accept: l = "image/*",
1587
- maxSize: w,
1588
- placeholder: b = "Selecionar imagem",
1589
- loading: M = !1,
1590
- size: N = "md",
1591
- label: y,
1592
- error: f,
1587
+ maxSize: v,
1588
+ placeholder: d = "Selecionar imagem",
1589
+ loading: k = !1,
1590
+ size: h = "md",
1591
+ label: g,
1592
+ error: u,
1593
1593
  disabled: x,
1594
- className: c,
1595
- ...I
1594
+ className: s,
1595
+ ...S
1596
1596
  }) => {
1597
- const [k, S] = le(null), [v, h] = le(""), [E, C] = le(!1), i = pe(null), R = !!n, F = !!k, B = R || F, p = M || E, V = {
1598
- sm: t ? "w-16 h-16" : "w-24 h-16",
1599
- md: t ? "w-24 h-24" : "w-32 h-24",
1600
- lg: t ? "w-32 h-32" : "w-40 h-32"
1601
- }, L = b || (t ? "Adicionar foto" : "Selecionar imagem"), J = (_) => {
1602
- var z;
1603
- const P = (z = _.target.files) == null ? void 0 : z[0];
1597
+ const [L, M] = ne(null), [y, E] = ne(""), [N, C] = ne(!1), m = pe(null), R = !!a, F = !!L, I = R || F, b = k || N, V = {
1598
+ sm: e ? "w-16 h-16" : "w-24 h-16",
1599
+ md: e ? "w-24 h-24" : "w-32 h-24",
1600
+ lg: e ? "w-32 h-32" : "w-40 h-32"
1601
+ }, B = d || (e ? "Adicionar foto" : "Selecionar imagem"), J = (T) => {
1602
+ var $;
1603
+ const P = ($ = T.target.files) == null ? void 0 : $[0];
1604
1604
  if (!P) return;
1605
- if (w && P.size > w) {
1606
- alert(`Arquivo muito grande. Tamanho máximo: ${(w / 1024 / 1024).toFixed(1)}MB`);
1605
+ if (v && P.size > v) {
1606
+ alert(`Arquivo muito grande. Tamanho máximo: ${(v / 1024 / 1024).toFixed(1)}MB`);
1607
1607
  return;
1608
1608
  }
1609
1609
  const q = new FileReader();
1610
1610
  q.onload = (Y) => {
1611
1611
  var j;
1612
- h((j = Y.target) == null ? void 0 : j.result), S(P);
1612
+ E((j = Y.target) == null ? void 0 : j.result), M(P);
1613
1613
  }, q.readAsDataURL(P);
1614
1614
  }, Z = async () => {
1615
- if (!(!k || !r))
1615
+ if (!(!L || !r))
1616
1616
  try {
1617
1617
  C(!0);
1618
- const _ = await r(k);
1619
- S(null), h(""), i.current && (i.current.value = "");
1620
- } catch (_) {
1621
- console.error("Erro ao fazer upload:", _), alert("Erro ao fazer upload da imagem");
1618
+ const T = await r(L);
1619
+ M(null), E(""), m.current && (m.current.value = "");
1620
+ } catch (T) {
1621
+ console.error("Erro ao fazer upload:", T), alert("Erro ao fazer upload da imagem");
1622
1622
  } finally {
1623
1623
  C(!1);
1624
1624
  }
1625
1625
  }, G = () => {
1626
- S(null), h(""), i.current && (i.current.value = "");
1627
- }, W = async () => {
1626
+ M(null), E(""), m.current && (m.current.value = "");
1627
+ }, O = async () => {
1628
1628
  try {
1629
- a && await a(n), S(null), h(""), i.current && (i.current.value = "");
1630
- } catch (_) {
1631
- console.error("Erro ao remover imagem:", _), alert("Erro ao remover imagem");
1629
+ o && await o(a), M(null), E(""), m.current && (m.current.value = "");
1630
+ } catch (T) {
1631
+ console.error("Erro ao remover imagem:", T), alert("Erro ao remover imagem");
1632
1632
  }
1633
- }, $ = () => {
1634
- var _;
1635
- x || p || (_ = i.current) == null || _.click();
1636
- }, X = v || n;
1637
- return /* @__PURE__ */ o.createElement("div", { className: d("flex flex-col space-y-2", c) }, y && /* @__PURE__ */ o.createElement("label", { className: "text-sm font-medium text-gray-700" }, y), /* @__PURE__ */ o.createElement("div", { className: "relative flex flex-col items-center" }, /* @__PURE__ */ o.createElement(
1633
+ }, z = () => {
1634
+ var T;
1635
+ x || b || (T = m.current) == null || T.click();
1636
+ }, X = y || a;
1637
+ return /* @__PURE__ */ n.createElement("div", { className: i("flex flex-col space-y-2", s) }, g && /* @__PURE__ */ n.createElement("label", { className: "text-sm font-medium text-gray-700" }, g), /* @__PURE__ */ n.createElement("div", { className: "relative flex flex-col items-center" }, /* @__PURE__ */ n.createElement(
1638
1638
  "input",
1639
1639
  {
1640
- ref: i,
1640
+ ref: m,
1641
1641
  type: "file",
1642
1642
  accept: l,
1643
1643
  onChange: J,
1644
- disabled: x || p,
1644
+ disabled: x || b,
1645
1645
  className: "hidden",
1646
- ...I
1646
+ ...S
1647
1647
  }
1648
- ), /* @__PURE__ */ o.createElement(
1648
+ ), /* @__PURE__ */ n.createElement(
1649
1649
  "div",
1650
1650
  {
1651
- onClick: $,
1652
- className: d(
1651
+ onClick: z,
1652
+ className: i(
1653
1653
  // Base styles
1654
1654
  "relative border-2 border-dashed border-gray-300 transition-colors cursor-pointer",
1655
1655
  "hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",
1656
1656
  // Shape
1657
- t ? "rounded-full" : "rounded-lg",
1657
+ e ? "rounded-full" : "rounded-lg",
1658
1658
  // Size
1659
- V[N],
1659
+ V[h],
1660
1660
  // States
1661
1661
  x && "opacity-50 cursor-not-allowed",
1662
- p && "cursor-wait",
1663
- f && "border-red-300",
1662
+ b && "cursor-wait",
1663
+ u && "border-red-300",
1664
1664
  // Background
1665
- !B && "bg-gray-50 hover:bg-gray-100",
1666
- B && "border-solid border-gray-200"
1665
+ !I && "bg-gray-50 hover:bg-gray-100",
1666
+ I && "border-solid border-gray-200"
1667
1667
  )
1668
1668
  },
1669
- B ? (
1669
+ I ? (
1670
1670
  // Preview da imagem
1671
- /* @__PURE__ */ o.createElement(
1671
+ /* @__PURE__ */ n.createElement(
1672
1672
  "img",
1673
1673
  {
1674
1674
  src: X,
1675
1675
  alt: "Preview",
1676
- className: d(
1676
+ className: i(
1677
1677
  "w-full h-full object-cover",
1678
- t ? "rounded-full" : "rounded-lg"
1678
+ e ? "rounded-full" : "rounded-lg"
1679
1679
  )
1680
1680
  }
1681
1681
  )
1682
1682
  ) : (
1683
1683
  // Estado vazio
1684
- /* @__PURE__ */ o.createElement("div", { className: "flex flex-col items-center justify-center h-full text-gray-500 text-sm" }, t ? (
1684
+ /* @__PURE__ */ n.createElement("div", { className: "flex flex-col items-center justify-center h-full text-gray-500 text-sm" }, e ? (
1685
1685
  // Ícone de usuário para avatar
1686
- /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
1686
+ /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
1687
1687
  "svg",
1688
1688
  {
1689
1689
  className: "w-8 h-8 mb-1",
@@ -1691,7 +1691,7 @@ const rt = ({
1691
1691
  stroke: "currentColor",
1692
1692
  viewBox: "0 0 24 24"
1693
1693
  },
1694
- /* @__PURE__ */ o.createElement(
1694
+ /* @__PURE__ */ n.createElement(
1695
1695
  "path",
1696
1696
  {
1697
1697
  strokeLinecap: "round",
@@ -1700,10 +1700,10 @@ const rt = ({
1700
1700
  d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"
1701
1701
  }
1702
1702
  )
1703
- ), /* @__PURE__ */ o.createElement("span", { className: "text-center px-2 text-xs" }, L))
1703
+ ), /* @__PURE__ */ n.createElement("span", { className: "text-center px-2 text-xs" }, B))
1704
1704
  ) : (
1705
1705
  // Ícone de adicionar imagem genérica
1706
- /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
1706
+ /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
1707
1707
  "svg",
1708
1708
  {
1709
1709
  className: "w-6 h-6 mb-1",
@@ -1711,7 +1711,7 @@ const rt = ({
1711
1711
  stroke: "currentColor",
1712
1712
  viewBox: "0 0 24 24"
1713
1713
  },
1714
- /* @__PURE__ */ o.createElement(
1714
+ /* @__PURE__ */ n.createElement(
1715
1715
  "path",
1716
1716
  {
1717
1717
  strokeLinecap: "round",
@@ -1720,16 +1720,16 @@ const rt = ({
1720
1720
  d: "M12 6v6m0 0v6m0-6h6m-6 0H6"
1721
1721
  }
1722
1722
  )
1723
- ), /* @__PURE__ */ o.createElement("span", { className: "text-center px-2" }, L))
1723
+ ), /* @__PURE__ */ n.createElement("span", { className: "text-center px-2" }, B))
1724
1724
  ))
1725
1725
  ),
1726
- p && /* @__PURE__ */ o.createElement("div", { className: d(
1726
+ b && /* @__PURE__ */ n.createElement("div", { className: i(
1727
1727
  "absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center",
1728
- t ? "rounded-full" : "rounded-lg"
1729
- ) }, /* @__PURE__ */ o.createElement("div", { className: "w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin" }))
1730
- ), B && !p && /* @__PURE__ */ o.createElement("div", { className: "flex justify-center space-x-2 mt-3" }, F ? (
1728
+ e ? "rounded-full" : "rounded-lg"
1729
+ ) }, /* @__PURE__ */ n.createElement("div", { className: "w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin" }))
1730
+ ), I && !b && /* @__PURE__ */ n.createElement("div", { className: "flex justify-center space-x-2 mt-3" }, F ? (
1731
1731
  // Ações para arquivo selecionado (não salvo ainda)
1732
- /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
1732
+ /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
1733
1733
  "button",
1734
1734
  {
1735
1735
  onClick: Z,
@@ -1737,7 +1737,7 @@ const rt = ({
1737
1737
  className: "px-3 py-1 bg-blue-600 text-white text-sm rounded hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed"
1738
1738
  },
1739
1739
  "Confirmar"
1740
- ), /* @__PURE__ */ o.createElement(
1740
+ ), /* @__PURE__ */ n.createElement(
1741
1741
  "button",
1742
1742
  {
1743
1743
  onClick: G,
@@ -1747,44 +1747,44 @@ const rt = ({
1747
1747
  ))
1748
1748
  ) : (
1749
1749
  // Ações para imagem já salva
1750
- /* @__PURE__ */ o.createElement(
1750
+ /* @__PURE__ */ n.createElement(
1751
1751
  "button",
1752
1752
  {
1753
- onClick: W,
1754
- disabled: !a,
1753
+ onClick: O,
1754
+ disabled: !o,
1755
1755
  className: "px-3 py-1 bg-red-600 text-white text-sm rounded hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed"
1756
1756
  },
1757
1757
  "Remover"
1758
1758
  )
1759
- ))), f && /* @__PURE__ */ o.createElement("p", { className: "text-sm text-red-600" }, f), w && !B && /* @__PURE__ */ o.createElement("p", { className: "text-xs text-gray-500" }, "Tamanho máximo: ", (w / 1024 / 1024).toFixed(1), "MB"), t && !B && /* @__PURE__ */ o.createElement("p", { className: "text-xs text-gray-500 text-center" }, "Use uma foto com seu rosto centralizado e bem visível"));
1760
- }, Me = o.createContext(null), Ge = () => {
1761
- const t = o.useContext(Me);
1762
- if (!t)
1759
+ ))), u && /* @__PURE__ */ n.createElement("p", { className: "text-sm text-red-600" }, u), v && !I && /* @__PURE__ */ n.createElement("p", { className: "text-xs text-gray-500" }, "Tamanho máximo: ", (v / 1024 / 1024).toFixed(1), "MB"), e && !I && /* @__PURE__ */ n.createElement("p", { className: "text-xs text-gray-500 text-center" }, "Use uma foto com seu rosto centralizado e bem visível"));
1760
+ }, Ie = n.createContext(null), Xe = () => {
1761
+ const e = n.useContext(Ie);
1762
+ if (!e)
1763
1763
  throw new Error("AccordionItem must be used within an Accordion");
1764
- return t;
1764
+ return e;
1765
1765
  };
1766
- let Le = 0;
1767
- const Be = ({
1768
- title: t,
1769
- children: n,
1766
+ let Pe = 0;
1767
+ const Te = ({
1768
+ title: e,
1769
+ children: a,
1770
1770
  defaultOpen: r = !1,
1771
- disabled: a = !1,
1771
+ disabled: o = !1,
1772
1772
  className: l,
1773
- headerClassName: w,
1774
- contentClassName: b,
1775
- icon: M
1773
+ headerClassName: v,
1774
+ contentClassName: d,
1775
+ icon: k
1776
1776
  }) => {
1777
- const { openItems: N, toggleItem: y, variant: f } = Ge(), [x] = le(() => Le++), c = N.has(x), I = pe(null), [k, S] = le(r ? void 0 : 0);
1778
- be(() => {
1779
- if (c) {
1780
- const C = I.current;
1781
- C && S(C.scrollHeight);
1777
+ const { openItems: h, toggleItem: g, variant: u } = Xe(), [x] = ne(() => Pe++), s = h.has(x), S = pe(null), [L, M] = ne(r ? void 0 : 0);
1778
+ ve(() => {
1779
+ if (s) {
1780
+ const C = S.current;
1781
+ C && M(C.scrollHeight);
1782
1782
  } else
1783
- S(0);
1784
- }, [c]);
1785
- const v = () => {
1786
- a || y(x);
1787
- }, E = {
1783
+ M(0);
1784
+ }, [s]);
1785
+ const y = () => {
1786
+ o || g(x);
1787
+ }, N = {
1788
1788
  default: {
1789
1789
  item: "border-b border-[var(--accordion-border,#e5e7eb)] last:border-b-0",
1790
1790
  header: "",
@@ -1800,122 +1800,457 @@ const Be = ({
1800
1800
  header: "",
1801
1801
  content: ""
1802
1802
  }
1803
- }[f];
1804
- return /* @__PURE__ */ o.createElement("div", { className: d(E.item, l) }, /* @__PURE__ */ o.createElement(
1803
+ }[u];
1804
+ return /* @__PURE__ */ n.createElement("div", { className: i(N.item, l) }, /* @__PURE__ */ n.createElement(
1805
1805
  "button",
1806
1806
  {
1807
1807
  type: "button",
1808
- onClick: v,
1809
- disabled: a,
1810
- "aria-expanded": c,
1811
- className: d(
1808
+ onClick: y,
1809
+ disabled: o,
1810
+ "aria-expanded": s,
1811
+ className: i(
1812
1812
  "w-full flex items-center justify-between px-4 py-3 text-left transition-colors",
1813
1813
  "bg-[var(--accordion-header-bg,transparent)]",
1814
1814
  "hover:bg-[var(--accordion-header-hover,rgba(0,0,0,0.05))]",
1815
1815
  "text-[var(--accordion-text,#111827)]",
1816
1816
  "font-medium",
1817
- a && "opacity-50 cursor-not-allowed",
1818
- c && f !== "default" && E.header,
1819
- w
1817
+ o && "opacity-50 cursor-not-allowed",
1818
+ s && u !== "default" && N.header,
1819
+ v
1820
1820
  )
1821
1821
  },
1822
- /* @__PURE__ */ o.createElement("span", { className: "flex items-center gap-2" }, M && /* @__PURE__ */ o.createElement("span", { className: "flex-shrink-0" }, M), t),
1823
- /* @__PURE__ */ o.createElement(
1822
+ /* @__PURE__ */ n.createElement("span", { className: "flex items-center gap-2" }, k && /* @__PURE__ */ n.createElement("span", { className: "flex-shrink-0" }, k), e),
1823
+ /* @__PURE__ */ n.createElement(
1824
1824
  "svg",
1825
1825
  {
1826
- className: d(
1826
+ className: i(
1827
1827
  "w-5 h-5 transition-transform duration-200 flex-shrink-0",
1828
1828
  "text-[var(--accordion-icon,#6b7280)]",
1829
- c && "rotate-180"
1829
+ s && "rotate-180"
1830
1830
  ),
1831
1831
  fill: "none",
1832
1832
  strokeWidth: "2",
1833
1833
  stroke: "currentColor",
1834
1834
  viewBox: "0 0 24 24"
1835
1835
  },
1836
- /* @__PURE__ */ o.createElement("path", { d: "M19 9l-7 7-7-7" })
1836
+ /* @__PURE__ */ n.createElement("path", { d: "M19 9l-7 7-7-7" })
1837
1837
  )
1838
- ), /* @__PURE__ */ o.createElement(
1838
+ ), /* @__PURE__ */ n.createElement(
1839
1839
  "div",
1840
1840
  {
1841
1841
  style: {
1842
- height: k,
1842
+ height: L,
1843
1843
  overflow: "hidden",
1844
1844
  transition: "height 0.3s ease-in-out"
1845
1845
  }
1846
1846
  },
1847
- /* @__PURE__ */ o.createElement(
1847
+ /* @__PURE__ */ n.createElement(
1848
1848
  "div",
1849
1849
  {
1850
- ref: I,
1851
- className: d(
1850
+ ref: S,
1851
+ className: i(
1852
1852
  "px-4 py-3",
1853
1853
  "text-[var(--accordion-content-text,#374151)]",
1854
1854
  "bg-[var(--accordion-content-bg,transparent)]",
1855
- b
1855
+ d
1856
1856
  )
1857
1857
  },
1858
- n
1858
+ a
1859
1859
  )
1860
1860
  ));
1861
1861
  };
1862
- Be.displayName = "AccordionItem";
1863
- const qe = ({
1864
- children: t,
1865
- type: n = "single",
1862
+ Te.displayName = "AccordionItem";
1863
+ const Ze = ({
1864
+ children: e,
1865
+ type: a = "single",
1866
1866
  className: r,
1867
- variant: a = "default",
1867
+ variant: o = "default",
1868
1868
  collapsible: l = !0
1869
1869
  }) => {
1870
- const [w, b] = le(/* @__PURE__ */ new Set());
1871
- be(() => {
1872
- Le = 0;
1873
- const N = o.Children.toArray(t), y = /* @__PURE__ */ new Set();
1874
- if (N.forEach((f, x) => {
1875
- o.isValidElement(f) && f.props.defaultOpen && y.add(x);
1876
- }), n === "single" && y.size > 1) {
1877
- const f = Array.from(y)[0];
1878
- b(/* @__PURE__ */ new Set([f]));
1870
+ const [v, d] = ne(/* @__PURE__ */ new Set());
1871
+ ve(() => {
1872
+ Pe = 0;
1873
+ const h = n.Children.toArray(e), g = /* @__PURE__ */ new Set();
1874
+ if (h.forEach((u, x) => {
1875
+ n.isValidElement(u) && u.props.defaultOpen && g.add(x);
1876
+ }), a === "single" && g.size > 1) {
1877
+ const u = Array.from(g)[0];
1878
+ d(/* @__PURE__ */ new Set([u]));
1879
1879
  } else
1880
- b(y);
1881
- }, [t, n]);
1882
- const M = (N) => {
1883
- b((y) => {
1884
- const f = new Set(y);
1885
- return n === "single" ? f.has(N) ? l && f.clear() : (f.clear(), f.add(N)) : f.has(N) ? f.delete(N) : f.add(N), f;
1880
+ d(g);
1881
+ }, [e, a]);
1882
+ const k = (h) => {
1883
+ d((g) => {
1884
+ const u = new Set(g);
1885
+ return a === "single" ? u.has(h) ? l && u.clear() : (u.clear(), u.add(h)) : u.has(h) ? u.delete(h) : u.add(h), u;
1886
1886
  });
1887
1887
  };
1888
- return /* @__PURE__ */ o.createElement(
1889
- Me.Provider,
1888
+ return /* @__PURE__ */ n.createElement(
1889
+ Ie.Provider,
1890
+ {
1891
+ value: { type: a, openItems: v, toggleItem: k, collapsible: l, variant: o }
1892
+ },
1893
+ /* @__PURE__ */ n.createElement("div", { className: i("w-full", r) }, e)
1894
+ );
1895
+ };
1896
+ Ze.Item = Te;
1897
+ const he = ({
1898
+ open: e,
1899
+ onClose: a,
1900
+ size: r = "md",
1901
+ closeOnOverlayClick: o = !0,
1902
+ closeOnEscape: l = !0,
1903
+ showCloseButton: v = !0,
1904
+ children: d,
1905
+ className: k = "",
1906
+ ...h
1907
+ }) => {
1908
+ const g = typeof document < "u" ? document.body : null;
1909
+ n.useEffect(() => {
1910
+ if (!e || !l) return;
1911
+ const s = (S) => {
1912
+ S.key === "Escape" && a();
1913
+ };
1914
+ return document.addEventListener("keydown", s), () => document.removeEventListener("keydown", s);
1915
+ }, [e, l, a]), n.useEffect(() => (e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
1916
+ document.body.style.overflow = "";
1917
+ }), [e]);
1918
+ const u = {
1919
+ sm: "max-w-sm",
1920
+ md: "max-w-md",
1921
+ lg: "max-w-lg",
1922
+ xl: "max-w-xl",
1923
+ full: "max-w-full mx-4"
1924
+ };
1925
+ if (!g || !e) return null;
1926
+ const x = /* @__PURE__ */ n.createElement(
1927
+ "div",
1928
+ {
1929
+ className: i(
1930
+ "fixed inset-0 z-50 flex items-center justify-center p-4",
1931
+ e ? "pointer-events-auto" : "pointer-events-none"
1932
+ )
1933
+ },
1934
+ /* @__PURE__ */ n.createElement(
1935
+ "div",
1936
+ {
1937
+ className: i(
1938
+ "absolute inset-0 bg-black/50 transition-opacity duration-200",
1939
+ e ? "opacity-100" : "opacity-0"
1940
+ ),
1941
+ onClick: (s) => {
1942
+ o && s.target === s.currentTarget && a();
1943
+ }
1944
+ }
1945
+ ),
1946
+ /* @__PURE__ */ n.createElement(
1947
+ "div",
1948
+ {
1949
+ role: "dialog",
1950
+ "aria-modal": !0,
1951
+ className: i(
1952
+ "relative bg-white rounded-lg shadow-xl w-full transition-all duration-200",
1953
+ u[r],
1954
+ e ? "scale-100 opacity-100" : "scale-95 opacity-0",
1955
+ k
1956
+ ),
1957
+ ...h
1958
+ },
1959
+ v && /* @__PURE__ */ n.createElement(
1960
+ "button",
1961
+ {
1962
+ onClick: a,
1963
+ className: "absolute top-4 right-4 text-gray-400 hover:text-gray-600 transition-colors",
1964
+ "aria-label": "Fechar modal"
1965
+ },
1966
+ /* @__PURE__ */ n.createElement(
1967
+ "svg",
1968
+ {
1969
+ xmlns: "http://www.w3.org/2000/svg",
1970
+ className: "h-6 w-6",
1971
+ fill: "none",
1972
+ viewBox: "0 0 24 24",
1973
+ stroke: "currentColor"
1974
+ },
1975
+ /* @__PURE__ */ n.createElement(
1976
+ "path",
1977
+ {
1978
+ strokeLinecap: "round",
1979
+ strokeLinejoin: "round",
1980
+ strokeWidth: 2,
1981
+ d: "M6 18L18 6M6 6l12 12"
1982
+ }
1983
+ )
1984
+ )
1985
+ ),
1986
+ /* @__PURE__ */ n.createElement("div", { className: "p-6" }, d)
1987
+ )
1988
+ );
1989
+ return be(x, g);
1990
+ };
1991
+ he.Header = function({
1992
+ children: a,
1993
+ className: r = "",
1994
+ ...o
1995
+ }) {
1996
+ return /* @__PURE__ */ n.createElement("div", { className: i("mb-4 pr-8", r), ...o }, a);
1997
+ };
1998
+ he.Body = function({
1999
+ children: a,
2000
+ className: r = "",
2001
+ ...o
2002
+ }) {
2003
+ return /* @__PURE__ */ n.createElement("div", { className: i("mb-4", r), ...o }, a);
2004
+ };
2005
+ he.Footer = function({
2006
+ children: a,
2007
+ className: r = "",
2008
+ ...o
2009
+ }) {
2010
+ return /* @__PURE__ */ n.createElement(
2011
+ "div",
2012
+ {
2013
+ className: i("flex justify-end gap-2 mt-6 pt-4 border-t border-gray-200", r),
2014
+ ...o
2015
+ },
2016
+ a
2017
+ );
2018
+ };
2019
+ const _e = $e(null), ut = ({
2020
+ children: e,
2021
+ position: a = "top-right",
2022
+ maxToasts: r = 5
2023
+ }) => {
2024
+ const [o, l] = ne([]), v = ge(
2025
+ (h) => {
2026
+ const g = `toast-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, u = { ...h, id: g };
2027
+ if (l((x) => [...x, u].slice(-r)), h.duration !== 0) {
2028
+ const x = h.duration || 5e3;
2029
+ setTimeout(() => {
2030
+ var s;
2031
+ d(g), (s = h.onClose) == null || s.call(h);
2032
+ }, x);
2033
+ }
2034
+ return g;
2035
+ },
2036
+ [r]
2037
+ ), d = ge((h) => {
2038
+ l((g) => g.filter((u) => u.id !== h));
2039
+ }, []), k = ge(() => {
2040
+ l([]);
2041
+ }, []);
2042
+ return /* @__PURE__ */ n.createElement(_e.Provider, { value: { toasts: o, addToast: v, removeToast: d, clearAll: k } }, e, /* @__PURE__ */ n.createElement(tt, { toasts: o, position: a, onClose: d }));
2043
+ }, et = () => {
2044
+ const e = We(_e);
2045
+ if (!e)
2046
+ throw new Error("useToaster must be used within ToasterProvider");
2047
+ return e;
2048
+ }, mt = () => {
2049
+ const { addToast: e } = et();
2050
+ return {
2051
+ toast: (a, r) => e({ message: a, ...r }),
2052
+ success: (a, r) => e({ message: a, variant: "success", duration: r }),
2053
+ error: (a, r) => e({ message: a, variant: "error", duration: r }),
2054
+ warning: (a, r) => e({ message: a, variant: "warning", duration: r }),
2055
+ info: (a, r) => e({ message: a, variant: "info", duration: r })
2056
+ };
2057
+ }, tt = ({
2058
+ toasts: e,
2059
+ position: a,
2060
+ onClose: r
2061
+ }) => {
2062
+ const o = typeof document < "u" ? document.body : null;
2063
+ if (!o || e.length === 0) return null;
2064
+ const l = {
2065
+ "top-left": "top-4 left-4 items-start",
2066
+ "top-center": "top-4 left-1/2 -translate-x-1/2 items-center",
2067
+ "top-right": "top-4 right-4 items-end",
2068
+ "bottom-left": "bottom-4 left-4 items-start",
2069
+ "bottom-center": "bottom-4 left-1/2 -translate-x-1/2 items-center",
2070
+ "bottom-right": "bottom-4 right-4 items-end"
2071
+ }, v = /* @__PURE__ */ n.createElement(
2072
+ "div",
2073
+ {
2074
+ className: i(
2075
+ "fixed z-[100] flex flex-col gap-2 pointer-events-none",
2076
+ l[a]
2077
+ ),
2078
+ style: { maxWidth: "calc(100vw - 2rem)" }
2079
+ },
2080
+ e.map((d) => /* @__PURE__ */ n.createElement(rt, { key: d.id, toast: d, onClose: r }))
2081
+ );
2082
+ return be(v, o);
2083
+ }, rt = ({ toast: e, onClose: a }) => {
2084
+ const [r, o] = ne(!1), l = () => {
2085
+ o(!0), setTimeout(() => {
2086
+ var h;
2087
+ a(e.id), (h = e.onClose) == null || h.call(e);
2088
+ }, 200);
2089
+ }, v = {
2090
+ success: "bg-green-50 text-green-800 border-green-200",
2091
+ error: "bg-red-50 text-red-800 border-red-200",
2092
+ warning: "bg-yellow-50 text-yellow-800 border-yellow-200",
2093
+ info: "bg-blue-50 text-blue-800 border-blue-200",
2094
+ default: "bg-white text-gray-800 border-gray-200"
2095
+ }, d = {
2096
+ success: /* @__PURE__ */ n.createElement(
2097
+ "svg",
2098
+ {
2099
+ className: "w-5 h-5 text-green-600",
2100
+ fill: "none",
2101
+ viewBox: "0 0 24 24",
2102
+ stroke: "currentColor"
2103
+ },
2104
+ /* @__PURE__ */ n.createElement(
2105
+ "path",
2106
+ {
2107
+ strokeLinecap: "round",
2108
+ strokeLinejoin: "round",
2109
+ strokeWidth: 2,
2110
+ d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"
2111
+ }
2112
+ )
2113
+ ),
2114
+ error: /* @__PURE__ */ n.createElement(
2115
+ "svg",
2116
+ {
2117
+ className: "w-5 h-5 text-red-600",
2118
+ fill: "none",
2119
+ viewBox: "0 0 24 24",
2120
+ stroke: "currentColor"
2121
+ },
2122
+ /* @__PURE__ */ n.createElement(
2123
+ "path",
2124
+ {
2125
+ strokeLinecap: "round",
2126
+ strokeLinejoin: "round",
2127
+ strokeWidth: 2,
2128
+ d: "M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"
2129
+ }
2130
+ )
2131
+ ),
2132
+ warning: /* @__PURE__ */ n.createElement(
2133
+ "svg",
2134
+ {
2135
+ className: "w-5 h-5 text-yellow-600",
2136
+ fill: "none",
2137
+ viewBox: "0 0 24 24",
2138
+ stroke: "currentColor"
2139
+ },
2140
+ /* @__PURE__ */ n.createElement(
2141
+ "path",
2142
+ {
2143
+ strokeLinecap: "round",
2144
+ strokeLinejoin: "round",
2145
+ strokeWidth: 2,
2146
+ d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
2147
+ }
2148
+ )
2149
+ ),
2150
+ info: /* @__PURE__ */ n.createElement(
2151
+ "svg",
2152
+ {
2153
+ className: "w-5 h-5 text-blue-600",
2154
+ fill: "none",
2155
+ viewBox: "0 0 24 24",
2156
+ stroke: "currentColor"
2157
+ },
2158
+ /* @__PURE__ */ n.createElement(
2159
+ "path",
2160
+ {
2161
+ strokeLinecap: "round",
2162
+ strokeLinejoin: "round",
2163
+ strokeWidth: 2,
2164
+ d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
2165
+ }
2166
+ )
2167
+ ),
2168
+ default: /* @__PURE__ */ n.createElement(
2169
+ "svg",
2170
+ {
2171
+ className: "w-5 h-5 text-gray-600",
2172
+ fill: "none",
2173
+ viewBox: "0 0 24 24",
2174
+ stroke: "currentColor"
2175
+ },
2176
+ /* @__PURE__ */ n.createElement(
2177
+ "path",
2178
+ {
2179
+ strokeLinecap: "round",
2180
+ strokeLinejoin: "round",
2181
+ strokeWidth: 2,
2182
+ d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
2183
+ }
2184
+ )
2185
+ )
2186
+ }, k = e.variant || "default";
2187
+ return /* @__PURE__ */ n.createElement(
2188
+ "div",
1890
2189
  {
1891
- value: { type: n, openItems: w, toggleItem: M, collapsible: l, variant: a }
2190
+ role: "alert",
2191
+ className: i(
2192
+ "pointer-events-auto flex items-start gap-3 px-4 py-3 rounded-lg border shadow-lg min-w-[300px] max-w-[500px]",
2193
+ "transition-all duration-200 ease-in-out",
2194
+ r ? "opacity-0 scale-95 translate-x-4" : "opacity-100 scale-100 translate-x-0",
2195
+ v[k]
2196
+ )
1892
2197
  },
1893
- /* @__PURE__ */ o.createElement("div", { className: d("w-full", r) }, t)
2198
+ /* @__PURE__ */ n.createElement("div", { className: "flex-shrink-0 mt-0.5" }, d[k]),
2199
+ /* @__PURE__ */ n.createElement("p", { className: "flex-1 text-sm font-medium leading-relaxed" }, e.message),
2200
+ /* @__PURE__ */ n.createElement(
2201
+ "button",
2202
+ {
2203
+ onClick: l,
2204
+ className: "flex-shrink-0 text-current opacity-60 hover:opacity-100 transition-opacity",
2205
+ "aria-label": "Fechar notificação"
2206
+ },
2207
+ /* @__PURE__ */ n.createElement(
2208
+ "svg",
2209
+ {
2210
+ className: "w-4 h-4",
2211
+ fill: "none",
2212
+ viewBox: "0 0 24 24",
2213
+ stroke: "currentColor"
2214
+ },
2215
+ /* @__PURE__ */ n.createElement(
2216
+ "path",
2217
+ {
2218
+ strokeLinecap: "round",
2219
+ strokeLinejoin: "round",
2220
+ strokeWidth: 2,
2221
+ d: "M6 18L18 6M6 6l12 12"
2222
+ }
2223
+ )
2224
+ )
2225
+ )
1894
2226
  );
1895
2227
  };
1896
- qe.Item = Be;
1897
2228
  export {
1898
- qe as Accordion,
1899
- Be as AccordionItem,
1900
- Ye as AsideSheet,
1901
- We as AsyncSelect,
1902
- Xe as Button,
1903
- Ze as Card,
1904
- Ee as CardBody,
1905
- Ce as CardFooter,
1906
- ye as CardHeader,
1907
- rt as ImageInput,
1908
- $e as Input,
1909
- He as MultiAsyncSelect,
1910
- Ve as MultiSelect,
1911
- je as RadioGroup,
1912
- ze as Select,
1913
- et as Table,
1914
- Se as TableBody,
1915
- Ie as TableCell,
2229
+ Ze as Accordion,
2230
+ Te as AccordionItem,
2231
+ Qe as AsideSheet,
2232
+ Ue as AsyncSelect,
2233
+ lt as Button,
2234
+ st as Card,
2235
+ Ce as CardBody,
2236
+ ke as CardFooter,
2237
+ Ne as CardHeader,
2238
+ dt as ImageInput,
2239
+ He as Input,
2240
+ he as Modal,
2241
+ Ge as MultiAsyncSelect,
2242
+ Ye as MultiSelect,
2243
+ Ke as RadioGroup,
2244
+ De as Select,
2245
+ it as Table,
2246
+ Me as TableBody,
2247
+ Be as TableCell,
1916
2248
  Re as TableFooter,
1917
- ke as TableHeader,
2249
+ Le as TableHeader,
1918
2250
  Fe as TableRow,
1919
- Oe as Textarea,
1920
- tt as Tooltip
2251
+ je as Textarea,
2252
+ ut as ToasterProvider,
2253
+ ct as Tooltip,
2254
+ mt as useToast,
2255
+ et as useToaster
1921
2256
  };