@arkyn/components 3.0.1-beta.22 → 3.0.1-beta.24

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.
Files changed (78) hide show
  1. package/README.md +265 -0
  2. package/dist/bundle.js +1485 -859
  3. package/dist/bundle.umd.cjs +1 -1
  4. package/dist/components/audioUpload/hasFileContent/index.d.ts +13 -0
  5. package/dist/components/audioUpload/hasFileContent/index.d.ts.map +1 -0
  6. package/dist/components/audioUpload/hasFileContent/index.js +26 -0
  7. package/dist/components/audioUpload/index.d.ts +82 -0
  8. package/dist/components/audioUpload/index.d.ts.map +1 -0
  9. package/dist/components/audioUpload/index.js +120 -0
  10. package/dist/components/audioUpload/noFileContent/index.d.ts +12 -0
  11. package/dist/components/audioUpload/noFileContent/index.d.ts.map +1 -0
  12. package/dist/components/audioUpload/noFileContent/index.js +29 -0
  13. package/dist/components/clientOnly.d.ts +86 -0
  14. package/dist/components/clientOnly.d.ts.map +1 -0
  15. package/dist/components/clientOnly.js +86 -0
  16. package/dist/components/fileUpload/hasFileContent/index.d.ts +13 -0
  17. package/dist/components/fileUpload/hasFileContent/index.d.ts.map +1 -0
  18. package/dist/components/fileUpload/hasFileContent/index.js +34 -0
  19. package/dist/components/fileUpload/index.d.ts +94 -0
  20. package/dist/components/fileUpload/index.d.ts.map +1 -0
  21. package/dist/components/fileUpload/index.js +127 -0
  22. package/dist/components/fileUpload/noFileContent/index.d.ts +12 -0
  23. package/dist/components/fileUpload/noFileContent/index.d.ts.map +1 -0
  24. package/dist/components/fileUpload/noFileContent/index.js +29 -0
  25. package/dist/components/imageUpload/hasFileContent/index.d.ts +13 -0
  26. package/dist/components/imageUpload/hasFileContent/index.d.ts.map +1 -0
  27. package/dist/components/imageUpload/hasFileContent/index.js +24 -0
  28. package/dist/components/imageUpload/index.d.ts +114 -0
  29. package/dist/components/imageUpload/index.d.ts.map +1 -0
  30. package/dist/components/imageUpload/index.js +148 -0
  31. package/dist/components/imageUpload/noFileContent/index.d.ts +12 -0
  32. package/dist/components/imageUpload/noFileContent/index.d.ts.map +1 -0
  33. package/dist/components/imageUpload/noFileContent/index.js +29 -0
  34. package/dist/components/tab/tabContainer/index.d.ts +1 -1
  35. package/dist/components/tab/tabContainer/index.d.ts.map +1 -1
  36. package/dist/components/table/tableBody/index.d.ts +67 -0
  37. package/dist/components/table/tableBody/index.d.ts.map +1 -0
  38. package/dist/components/table/tableBody/index.js +69 -0
  39. package/dist/components/table/tableCaption/index.d.ts +62 -0
  40. package/dist/components/table/tableCaption/index.d.ts.map +1 -0
  41. package/dist/components/table/tableCaption/index.js +64 -0
  42. package/dist/components/table/tableContainer/index.d.ts +64 -0
  43. package/dist/components/table/tableContainer/index.d.ts.map +1 -0
  44. package/dist/components/table/tableContainer/index.js +66 -0
  45. package/dist/components/table/tableFooter/index.d.ts +45 -0
  46. package/dist/components/table/tableFooter/index.d.ts.map +1 -0
  47. package/dist/components/table/tableFooter/index.js +47 -0
  48. package/dist/components/table/tableHeader/index.d.ts +44 -0
  49. package/dist/components/table/tableHeader/index.d.ts.map +1 -0
  50. package/dist/components/table/tableHeader/index.js +46 -0
  51. package/dist/components/tooltip/index.d.ts.map +1 -1
  52. package/dist/components/tooltip/index.js +1 -1
  53. package/dist/hooks/useDrawer.d.ts +86 -0
  54. package/dist/hooks/useDrawer.d.ts.map +1 -0
  55. package/dist/hooks/useDrawer.js +20 -0
  56. package/dist/hooks/useHydrated.d.ts +76 -0
  57. package/dist/hooks/useHydrated.d.ts.map +1 -0
  58. package/dist/hooks/useHydrated.js +81 -0
  59. package/dist/hooks/useModal.d.ts +81 -0
  60. package/dist/hooks/useModal.d.ts.map +1 -0
  61. package/dist/hooks/useModal.js +20 -0
  62. package/dist/hooks/useToast.d.ts +70 -0
  63. package/dist/hooks/useToast.d.ts.map +1 -0
  64. package/dist/hooks/useToast.js +72 -0
  65. package/dist/index.d.ts +14 -0
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +14 -0
  68. package/dist/providers/drawerProvider.d.ts +106 -0
  69. package/dist/providers/drawerProvider.d.ts.map +1 -0
  70. package/dist/providers/drawerProvider.js +120 -0
  71. package/dist/providers/modalProvider.d.ts +103 -0
  72. package/dist/providers/modalProvider.d.ts.map +1 -0
  73. package/dist/providers/modalProvider.js +119 -0
  74. package/dist/providers/toastProvider.d.ts +48 -0
  75. package/dist/providers/toastProvider.d.ts.map +1 -0
  76. package/dist/providers/toastProvider.js +73 -0
  77. package/dist/style.css +1 -1
  78. package/package.json +21 -3
package/dist/bundle.js CHANGED
@@ -1,86 +1,86 @@
1
- import { jsx as a, jsxs as y, Fragment as Q } from "react/jsx-runtime";
2
- import { createContext as ce, useContext as re, useState as N, useRef as V, useEffect as ae, cloneElement as Ge, useId as ne, forwardRef as ye } from "react";
3
- import { Info as Ve, AlertTriangle as He, XCircle as Ke, CheckCircle2 as Ue, Pause as We, Play as je, Loader2 as ee, Check as ve, X as xe, ChevronDown as Ie, Search as Ze } from "lucide-react";
4
- import { AnimatePresence as $e, motion as ge } from "framer-motion";
5
- import { InputMask as Te } from "@react-input/mask";
6
- function Ye(e) {
1
+ import { jsx as a, jsxs as h, Fragment as X } from "react/jsx-runtime";
2
+ import { createContext as te, useContext as oe, useState as F, useRef as V, useEffect as re, cloneElement as qe, useId as ce, useSyncExternalStore as Ze, forwardRef as ve, Children as Ye } from "react";
3
+ import { Info as Xe, AlertTriangle as Je, XCircle as Qe, CheckCircle2 as en, Pause as nn, Play as an, Loader2 as se, RefreshCw as Fe, Check as xe, X as be, FileImage as sn, FileAudio as tn, FileArchive as on, File as cn, ChevronDown as Pe, Search as rn } from "lucide-react";
4
+ import { AnimatePresence as Ee, motion as ge } from "framer-motion";
5
+ import { InputMask as Be } from "@react-input/mask";
6
+ function ln(e) {
7
7
  const { className: n, ...s } = e, t = `arkynAlertTitle ${n}`;
8
8
  return /* @__PURE__ */ a("div", { className: t.trim(), ...s });
9
9
  }
10
- const Ae = ce({});
11
- function Xe() {
12
- return re(Ae);
10
+ const De = te({});
11
+ function _n() {
12
+ return oe(De);
13
13
  }
14
- function Dn(e) {
15
- const { schema: n, children: s, className: t, ...o } = e, i = !((d) => {
16
- let u = !1;
17
- const _ = (m) => {
18
- Array.isArray(m) ? m.forEach(_) : m && typeof m == "object" && "type" in m && (m.type === Ye ? u = !0 : m.props && typeof m.props == "object" && m.props !== null && "children" in m.props && _(m.props.children));
14
+ function ca(e) {
15
+ const { schema: n, children: s, className: t, ...o } = e, _ = !((r) => {
16
+ let l = !1;
17
+ const d = (m) => {
18
+ Array.isArray(m) ? m.forEach(d) : m && typeof m == "object" && "type" in m && (m.type === ln ? l = !0 : m.props && typeof m.props == "object" && m.props !== null && "children" in m.props && d(m.props.children));
19
19
  };
20
- return _(d), u;
21
- })(s) ? "nonExistsAlertTitle" : "existsAlertTitle", l = `arkynAlertContainer ${n} ${i} ${t}`;
22
- return /* @__PURE__ */ a(Ae.Provider, { value: e, children: /* @__PURE__ */ a("div", { className: l.trim(), ...o, children: s }) });
20
+ return d(r), l;
21
+ })(s) ? "nonExistsAlertTitle" : "existsAlertTitle", u = `arkynAlertContainer ${n} ${_} ${t}`;
22
+ return /* @__PURE__ */ a(De.Provider, { value: e, children: /* @__PURE__ */ a("div", { className: u.trim(), ...o, children: s }) });
23
23
  }
24
- function On(e) {
24
+ function ra(e) {
25
25
  const { className: n, ...s } = e, t = `arkynAlertContent ${n}`;
26
26
  return /* @__PURE__ */ a("div", { className: t.trim(), ...s });
27
27
  }
28
- function Gn(e) {
28
+ function ia(e) {
29
29
  const { className: n, ...s } = e, t = `arkynAlertDescription ${n}`;
30
30
  return /* @__PURE__ */ a("div", { className: t.trim(), ...s });
31
31
  }
32
- function Vn(e) {
33
- const { className: n, ...s } = e, { schema: t } = Xe(), o = `arkynAlertIcon ${t} ${n}`;
32
+ function la(e) {
33
+ const { className: n, ...s } = e, { schema: t } = _n(), o = `arkynAlertIcon ${t} ${n}`;
34
34
  switch (t) {
35
35
  case "success":
36
- return /* @__PURE__ */ a(Ue, { className: o, ...s });
36
+ return /* @__PURE__ */ a(en, { className: o, ...s });
37
37
  case "danger":
38
- return /* @__PURE__ */ a(Ke, { className: o, ...s });
38
+ return /* @__PURE__ */ a(Qe, { className: o, ...s });
39
39
  case "warning":
40
- return /* @__PURE__ */ a(He, { className: o, ...s });
40
+ return /* @__PURE__ */ a(Je, { className: o, ...s });
41
41
  case "info":
42
- return /* @__PURE__ */ a(Ve, { className: o, ...s });
42
+ return /* @__PURE__ */ a(Xe, { className: o, ...s });
43
43
  }
44
44
  }
45
- function Je(e) {
45
+ function un(e) {
46
46
  function n() {
47
47
  return !e || e <= 0 ? 0 : e >= 100 ? 100 : e;
48
48
  }
49
- const [s, t] = N(n());
49
+ const [s, t] = F(n());
50
50
  function o(c) {
51
51
  return c <= 0 ? t(0) : c >= 100 ? t(100) : t(c);
52
52
  }
53
53
  return [s, o];
54
54
  }
55
- function qe(e) {
55
+ function dn(e) {
56
56
  const {
57
57
  onChange: n,
58
58
  value: s,
59
59
  disabled: t = !1,
60
60
  onDragging: o,
61
61
  className: c = "",
62
- ...r
63
- } = e, [i, l] = N(!1), d = V(null), u = () => l(!0), _ = () => l(!1), m = (v) => {
64
- if (t || !i || !d.current) return;
65
- const x = d.current.getBoundingClientRect(), p = v.clientX - x.left, B = Math.min(Math.max(p / x.width * 100, 0), 100);
66
- n(B);
67
- }, f = (v) => {
68
- if (t || !d.current) return;
69
- const x = d.current.getBoundingClientRect(), p = v.clientX - x.left, B = Math.min(Math.max(p / x.width * 100, 0), 100);
70
- n(B);
62
+ ...i
63
+ } = e, [_, u] = F(!1), r = V(null), l = () => u(!0), d = () => u(!1), m = (v) => {
64
+ if (t || !_ || !r.current) return;
65
+ const x = r.current.getBoundingClientRect(), p = v.clientX - x.left, N = Math.min(Math.max(p / x.width * 100, 0), 100);
66
+ n(N);
67
+ }, g = (v) => {
68
+ if (t || !r.current) return;
69
+ const x = r.current.getBoundingClientRect(), p = v.clientX - x.left, N = Math.min(Math.max(p / x.width * 100, 0), 100);
70
+ n(N);
71
71
  };
72
- ae(() => (i ? (o && o(!0), document.addEventListener("mousemove", m), document.addEventListener("mouseup", _)) : (o && o(!1), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", _)), () => {
73
- document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", _);
74
- }), [i]);
75
- const h = `arkynSliderTrack ${i ? "isDragging" : "isNotDragging"} ${t ? "isDisabled" : "isEnabled"} ${c}`;
76
- return /* @__PURE__ */ y(
72
+ re(() => (_ ? (o && o(!0), document.addEventListener("mousemove", m), document.addEventListener("mouseup", d)) : (o && o(!1), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", d)), () => {
73
+ document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", d);
74
+ }), [_]);
75
+ const y = `arkynSliderTrack ${_ ? "isDragging" : "isNotDragging"} ${t ? "isDisabled" : "isEnabled"} ${c}`;
76
+ return /* @__PURE__ */ h(
77
77
  "div",
78
78
  {
79
- ...r,
80
- className: h,
81
- onMouseDown: u,
82
- onClick: f,
83
- ref: d,
79
+ ...i,
80
+ className: y,
81
+ onMouseDown: l,
82
+ onClick: g,
83
+ ref: r,
84
84
  children: [
85
85
  /* @__PURE__ */ a("div", { className: "arkynSliderFill", style: { width: `${s}%` } }),
86
86
  /* @__PURE__ */ a("div", { className: "arkynSliderThumb", style: { left: `${s}%` } })
@@ -88,246 +88,493 @@ function qe(e) {
88
88
  }
89
89
  );
90
90
  }
91
- function Hn(e) {
92
- var $, T, L, E;
93
- const { onPlayAudio: n, onPauseAudio: s, disabled: t, ...o } = e, [c, r] = Je(0), [i, l] = N(!1), [d, u] = N(!1), _ = V(null), m = ($ = _.current) == null ? void 0 : $.currentTime, f = (T = _.current) == null ? void 0 : T.duration, g = v(m), k = v(f), h = {
94
- totalTime: f,
91
+ function mn(e) {
92
+ var $, S, B, P;
93
+ const { onPlayAudio: n, onPauseAudio: s, disabled: t, ...o } = e, [c, i] = un(0), [_, u] = F(!1), [r, l] = F(!1), d = V(null), m = ($ = d.current) == null ? void 0 : $.currentTime, g = (S = d.current) == null ? void 0 : S.duration, f = v(m), k = v(g), y = {
94
+ totalTime: g,
95
95
  currentTime: m,
96
- formattedCurrentTime: g,
96
+ formattedCurrentTime: f,
97
97
  formattedTotalTime: k
98
98
  };
99
99
  function v(C) {
100
100
  if (!C) return "00:00";
101
- const b = Math.floor(C / 60), M = Math.floor(C % 60), A = String(b).padStart(2, "0"), S = String(M).padStart(2, "0");
102
- return `${A}:${S}`;
101
+ const I = Math.floor(C / 60), w = Math.floor(C % 60), M = String(I).padStart(2, "0"), T = String(w).padStart(2, "0");
102
+ return `${M}:${T}`;
103
103
  }
104
104
  function x() {
105
- const C = _.current;
106
- C && (e.onPlayAudio && e.onPlayAudio(h), C.play(), l(!0));
105
+ const C = d.current;
106
+ C && (e.onPlayAudio && e.onPlayAudio(y), C.play(), u(!0));
107
107
  }
108
108
  function p() {
109
- const C = _.current;
110
- C && (e.onPauseAudio && e.onPauseAudio(h), C.pause(), l(!1));
109
+ const C = d.current;
110
+ C && (e.onPauseAudio && e.onPauseAudio(y), C.pause(), u(!1));
111
111
  }
112
- function B() {
113
- i ? p() : x();
112
+ function N() {
113
+ _ ? p() : x();
114
114
  }
115
- function R(C) {
116
- const b = _.current;
117
- if (!b) return;
118
- const M = b.duration, A = C / 100 * M;
119
- b.currentTime = A;
115
+ function z(C) {
116
+ const I = d.current;
117
+ if (!I) return;
118
+ const w = I.duration, M = C / 100 * w;
119
+ I.currentTime = M;
120
120
  }
121
- return d || !i ? (L = _.current) == null || L.pause() : i && ((E = _.current) == null || E.play()), ae(() => {
122
- const C = _.current;
121
+ return r || !_ ? (B = d.current) == null || B.pause() : _ && ((P = d.current) == null || P.play()), re(() => {
122
+ const C = d.current;
123
123
  if (!C) return;
124
- const b = () => {
125
- const M = C.duration, S = C.currentTime / M * 100;
126
- r(S);
124
+ const I = () => {
125
+ const w = C.duration, T = C.currentTime / w * 100;
126
+ i(T);
127
127
  };
128
- return C.addEventListener("timeupdate", b), () => {
129
- C.removeEventListener("timeupdate", b);
128
+ return C.addEventListener("timeupdate", I), () => {
129
+ C.removeEventListener("timeupdate", I);
130
130
  };
131
- }, []), /* @__PURE__ */ y("div", { className: "arkynAudioPlayer", children: [
131
+ }, []), /* @__PURE__ */ h("div", { className: "arkynAudioPlayer", children: [
132
132
  /* @__PURE__ */ a(
133
133
  "audio",
134
134
  {
135
135
  ...o,
136
- ref: _,
136
+ ref: d,
137
137
  src: e.src,
138
138
  onEnded: p
139
139
  }
140
140
  ),
141
- /* @__PURE__ */ y("button", { type: "button", disabled: t, onClick: B, children: [
142
- i && /* @__PURE__ */ a(We, {}),
143
- !i && /* @__PURE__ */ a(je, {})
141
+ /* @__PURE__ */ h("button", { type: "button", disabled: t, onClick: N, children: [
142
+ _ && /* @__PURE__ */ a(nn, {}),
143
+ !_ && /* @__PURE__ */ a(an, {})
144
144
  ] }),
145
- /* @__PURE__ */ a("p", { children: g }),
145
+ /* @__PURE__ */ a("p", { children: f }),
146
146
  /* @__PURE__ */ a(
147
- qe,
147
+ dn,
148
148
  {
149
149
  value: c,
150
- onChange: R,
151
- onDragging: u,
150
+ onChange: z,
151
+ onDragging: l,
152
152
  disabled: t
153
153
  }
154
154
  ),
155
155
  /* @__PURE__ */ a("p", { children: k })
156
156
  ] });
157
157
  }
158
- function I(e) {
159
- const { iconSize: n, icon: s, className: t, show: o = !0 } = e;
160
- return o ? s ? typeof s == "string" ? /* @__PURE__ */ a("p", { className: t, children: s }) : /* @__PURE__ */ a(s, { size: n, className: t, strokeWidth: 2.5 }) : /* @__PURE__ */ a(Q, {}) : /* @__PURE__ */ a(Q, {});
158
+ const Le = te({});
159
+ function _a(e) {
160
+ const { children: n, fieldErrors: s, form: t } = e;
161
+ return /* @__PURE__ */ h(Le.Provider, { value: { fieldErrors: s }, children: [
162
+ !t && n,
163
+ t && qe(t, t.props, n)
164
+ ] });
161
165
  }
162
- function Kn(e) {
166
+ function J() {
167
+ return oe(Le);
168
+ }
169
+ function ne(e) {
170
+ const { children: n, className: s, ...t } = e, o = `arkynFieldError ${s}`;
171
+ return n ? /* @__PURE__ */ a("strong", { className: o.trim(), ...t, children: n }) : /* @__PURE__ */ a(X, {});
172
+ }
173
+ function K(e) {
163
174
  const {
164
- variant: n = "ghost",
165
- scheme: s = "primary",
166
- size: t = "lg",
167
- leftIcon: o,
168
- rightIcon: c,
169
- className: r = "",
170
- children: i,
171
- ...l
172
- } = e, u = { md: 12, lg: 14 }[t], _ = `arkynBadge ${n} ${s} ${t} ${r}`;
173
- return /* @__PURE__ */ y("div", { className: _.trim(), ...l, children: [
174
- /* @__PURE__ */ a(I, { iconSize: u, icon: o }),
175
- /* @__PURE__ */ a("p", { children: i }),
176
- /* @__PURE__ */ a(I, { iconSize: u, icon: c })
177
- ] });
175
+ showAsterisk: n = !1,
176
+ className: s = "",
177
+ ...t
178
+ } = e, c = `arkynFieldLabel ${n ? "asteriskTrue" : "asteriskFalse"} ${s}`;
179
+ return /* @__PURE__ */ a("label", { className: c.trim(), ...t });
178
180
  }
179
- function Un(e) {
181
+ function q(e) {
182
+ const { children: n, className: s, ...t } = e, o = `arkynFieldWrapper ${s}`;
183
+ return /* @__PURE__ */ a("section", { className: o.trim(), ...t, children: n });
184
+ }
185
+ function O(e) {
186
+ const { iconSize: n, icon: s, className: t, show: o = !0 } = e;
187
+ return o ? s ? typeof s == "string" ? /* @__PURE__ */ a("p", { className: t, children: s }) : /* @__PURE__ */ a(s, { size: n, className: t, strokeWidth: 2.5 }) : /* @__PURE__ */ a(X, {}) : /* @__PURE__ */ a(X, {});
188
+ }
189
+ function ue(e) {
180
190
  const {
181
191
  isLoading: n = !1,
182
192
  scheme: s = "primary",
183
193
  variant: t = "solid",
184
194
  loadingText: o,
185
195
  size: c = "md",
186
- leftIcon: r,
187
- rightIcon: i,
188
- disabled: l,
189
- className: d = "",
190
- children: u,
191
- ..._
192
- } = e, f = { xs: 12, sm: 16, md: 20, lg: 24 }[c], h = `arkynButton ${n ? "loadingTrue" : "loadingFalse"} ${t} ${s} ${c} ${o ? "loadingTextTrue" : "loadingTextFalse"} ${d}`;
193
- return /* @__PURE__ */ y("button", { className: h, disabled: l || n, ..._, children: [
194
- /* @__PURE__ */ y("div", { className: "arkynButtonSpinner", children: [
195
- /* @__PURE__ */ a(ee, { size: f, strokeWidth: 2.5 }),
196
+ leftIcon: i,
197
+ rightIcon: _,
198
+ disabled: u,
199
+ className: r = "",
200
+ children: l,
201
+ ...d
202
+ } = e, g = { xs: 12, sm: 16, md: 20, lg: 24 }[c], y = `arkynButton ${n ? "loadingTrue" : "loadingFalse"} ${t} ${s} ${c} ${o ? "loadingTextTrue" : "loadingTextFalse"} ${r}`;
203
+ return /* @__PURE__ */ h("button", { className: y, disabled: u || n, ...d, children: [
204
+ /* @__PURE__ */ h("div", { className: "arkynButtonSpinner", children: [
205
+ /* @__PURE__ */ a(se, { size: g, strokeWidth: 2.5 }),
196
206
  o && o
197
207
  ] }),
198
- /* @__PURE__ */ y("div", { className: "arkynButtonContent", children: [
199
- /* @__PURE__ */ a(I, { iconSize: f, icon: r }),
200
- u,
201
- /* @__PURE__ */ a(I, { iconSize: f, icon: i })
208
+ /* @__PURE__ */ h("div", { className: "arkynButtonContent", children: [
209
+ /* @__PURE__ */ a(O, { iconSize: g, icon: i }),
210
+ l,
211
+ /* @__PURE__ */ a(O, { iconSize: g, icon: _ })
202
212
  ] })
203
213
  ] });
204
214
  }
205
- const we = ce({});
206
- function Qe() {
207
- return re(we);
215
+ function Ne(e) {
216
+ const {
217
+ className: n,
218
+ orientation: s = "horizontal",
219
+ ...t
220
+ } = e, o = `arkynDivider ${s} ${n}`;
221
+ return /* @__PURE__ */ a("div", { className: o.trim(), ...t });
208
222
  }
209
- function en(e) {
210
- return /* @__PURE__ */ a(we.Provider, { value: e, children: e.children });
223
+ function Se(e) {
224
+ const {
225
+ isLoading: n = !1,
226
+ scheme: s = "primary",
227
+ variant: t = "solid",
228
+ size: o = "md",
229
+ icon: c,
230
+ disabled: i,
231
+ className: _ = "",
232
+ ...u
233
+ } = e, r = { xs: 12, sm: 16, md: 20, lg: 24 }, d = `arkynIconButton ${t} ${s} ${o} ${n ? "loadingTrue" : "loadingFalse"} ${_}`;
234
+ return /* @__PURE__ */ h(
235
+ "button",
236
+ {
237
+ disabled: i || n,
238
+ className: d.trim(),
239
+ ...u,
240
+ children: [
241
+ /* @__PURE__ */ a("div", { className: "arkynIconButtonSpinner", children: /* @__PURE__ */ a(se, { size: r[o], strokeWidth: 2.5 }) }),
242
+ /* @__PURE__ */ a("div", { className: "arkynIconButtonContent", children: /* @__PURE__ */ a(c, { size: r[o], strokeWidth: 2.5 }) })
243
+ ]
244
+ }
245
+ );
211
246
  }
212
- function Wn(e) {
247
+ function Ie(e) {
248
+ const {
249
+ text: n,
250
+ size: s = "lg",
251
+ children: t,
252
+ orientation: o = "top",
253
+ className: c = "",
254
+ ...i
255
+ } = e, _ = ce(), u = V(null), [r, l] = F(o);
256
+ re(() => {
257
+ const m = () => {
258
+ if (!u.current) return;
259
+ const k = document.getElementById(_);
260
+ k && (l(o), requestAnimationFrame(() => {
261
+ const y = k.getBoundingClientRect(), v = window.innerWidth, x = window.innerHeight;
262
+ let p = o;
263
+ o === "left" && y.left < 0 ? p = "right" : o === "right" && y.right > v ? p = "left" : o === "top" && y.top < 0 ? p = "bottom" : o === "bottom" && y.bottom > x && (p = "top"), p === "right" && y.right > v ? p = "left" : p === "left" && y.left < 0 ? p = "right" : p === "bottom" && y.bottom > x ? p = "top" : p === "top" && y.top < 0 && (p = "bottom"), l(p);
264
+ }));
265
+ }, g = u.current;
266
+ if (!g) return;
267
+ const f = () => {
268
+ setTimeout(m, 1);
269
+ };
270
+ return g.addEventListener("mouseenter", f), window.addEventListener("resize", m), () => {
271
+ g.removeEventListener("mouseenter", f), window.removeEventListener("resize", m);
272
+ };
273
+ }, [o, _]);
274
+ const d = `arkynTooltip ${s} ${r} ${c}`;
275
+ return /* @__PURE__ */ h("div", { className: d.trim(), ...i, ref: u, children: [
276
+ t,
277
+ /* @__PURE__ */ a(
278
+ "div",
279
+ {
280
+ className: "arkynTooltipText",
281
+ id: _,
282
+ dangerouslySetInnerHTML: { __html: n }
283
+ }
284
+ )
285
+ ] });
286
+ }
287
+ function fn(e) {
288
+ const {
289
+ filePath: n,
290
+ disabled: s,
291
+ acceptAudio: t,
292
+ handleSelectFile: o,
293
+ isLoading: c,
294
+ reSendAudio: i,
295
+ changeAudioButtonText: _
296
+ } = e;
297
+ function u() {
298
+ if (s) return;
299
+ const r = document.createElement("input");
300
+ r.type = "file", r.accept = t, r.onchange = (l) => {
301
+ var m;
302
+ const d = (m = l.target.files) == null ? void 0 : m[0];
303
+ d && o(d);
304
+ }, r.click();
305
+ }
306
+ return /* @__PURE__ */ h("div", { className: "arkynAudioUploadHasFileContentContainer", children: [
307
+ /* @__PURE__ */ a(mn, { src: n }),
308
+ /* @__PURE__ */ a(Ne, {}),
309
+ /* @__PURE__ */ h("div", { className: "arkynAudioUploadButtonsContainer", children: [
310
+ !!i && /* @__PURE__ */ a(Ie, { orientation: "bottom", text: "Reenviar áudio", children: /* @__PURE__ */ a(
311
+ Se,
312
+ {
313
+ type: "button",
314
+ "aria-label": "resend image",
315
+ variant: "outline",
316
+ scheme: "danger",
317
+ size: "sm",
318
+ isLoading: c,
319
+ onClick: i,
320
+ icon: Fe,
321
+ disabled: s
322
+ }
323
+ ) }),
324
+ /* @__PURE__ */ a(
325
+ ue,
326
+ {
327
+ isLoading: c,
328
+ onClick: u,
329
+ variant: "outline",
330
+ size: "sm",
331
+ type: "button",
332
+ disabled: s,
333
+ children: _
334
+ }
335
+ )
336
+ ] })
337
+ ] });
338
+ }
339
+ function gn(e) {
340
+ const {
341
+ dropAudioText: n,
342
+ isLoading: s,
343
+ acceptAudio: t,
344
+ handleSelectFile: o,
345
+ selectAudioButtonText: c,
346
+ disabled: i
347
+ } = e;
348
+ function _(r) {
349
+ if (i) return;
350
+ r.preventDefault();
351
+ const l = r.dataTransfer.files[0];
352
+ l && o(l);
353
+ }
354
+ function u() {
355
+ if (i) return;
356
+ const r = document.createElement("input");
357
+ r.type = "file", r.accept = t, r.onchange = (l) => {
358
+ var m;
359
+ const d = (m = l.target.files) == null ? void 0 : m[0];
360
+ d && o(d);
361
+ }, r.click();
362
+ }
363
+ return /* @__PURE__ */ h("div", { onDrop: _, className: "arkynAudioUploadNoFileContent", children: [
364
+ /* @__PURE__ */ a(
365
+ ue,
366
+ {
367
+ isLoading: s,
368
+ onClick: u,
369
+ variant: "ghost",
370
+ size: "sm",
371
+ type: "button",
372
+ disabled: i,
373
+ children: c
374
+ }
375
+ ),
376
+ /* @__PURE__ */ a("p", { children: n })
377
+ ] });
378
+ }
379
+ function ua(e) {
380
+ const {
381
+ name: n,
382
+ label: s,
383
+ fileName: t = "file",
384
+ method: o = "POST",
385
+ onChange: c,
386
+ fileResponseName: i = "url",
387
+ selectAudioButtonText: _ = "Selecionar arquivo de áudio",
388
+ dropAudioText: u = "Ou arraste e solte um arquivo de áudio aqui",
389
+ changeAudioButtonText: r = "Trocar arquivo de áudio",
390
+ acceptAudio: l = "audio/*",
391
+ action: d,
392
+ defaultValue: m = "",
393
+ showAsterisk: g = !1,
394
+ disabled: f = !1
395
+ } = e, { fieldErrors: k } = J(), y = k == null ? void 0 : k[n], [v, x] = F(m), [p, N] = F(""), [z, $] = F(null), [S, B] = F(m), [P, C] = F(!1);
396
+ async function I(E) {
397
+ if (f) return;
398
+ C(!0), $(E), N("");
399
+ const R = new FormData();
400
+ R.append(t, E), await fetch(d, { method: o, body: R }).then(async (b) => await b.json()).then((b) => {
401
+ b != null && b.error ? N(b.error) : x(b == null ? void 0 : b[i]), c && c(b == null ? void 0 : b[i]);
402
+ }).catch((b) => {
403
+ console.error(b), N("Erro ao enviar audio");
404
+ }).finally(() => C(!1));
405
+ }
406
+ function w(E) {
407
+ if (!f) {
408
+ if (E.type.indexOf("audio") === -1) {
409
+ N("O arquivo selecionado não é um arquivo de áudio");
410
+ return;
411
+ }
412
+ B(URL.createObjectURL(E)), I(E);
413
+ }
414
+ }
415
+ const M = y || p;
416
+ return /* @__PURE__ */ h(q, { children: [
417
+ s && /* @__PURE__ */ a(K, { showAsterisk: g, children: s }),
418
+ /* @__PURE__ */ h("div", { className: `arkynAudioUpload ${M ? "hasError" : "noHasError"} ${S ? "hasAudio" : "noHasAudio"}`, children: [
419
+ /* @__PURE__ */ a("input", { type: "hidden", name: n, value: v || "" }),
420
+ !S && /* @__PURE__ */ a(
421
+ gn,
422
+ {
423
+ disabled: f,
424
+ isLoading: P,
425
+ acceptAudio: l,
426
+ dropAudioText: u,
427
+ handleSelectFile: w,
428
+ selectAudioButtonText: _
429
+ }
430
+ ),
431
+ S && /* @__PURE__ */ a(
432
+ fn,
433
+ {
434
+ filePath: S,
435
+ acceptAudio: l,
436
+ changeAudioButtonText: r,
437
+ disabled: f,
438
+ handleSelectFile: w,
439
+ isLoading: P,
440
+ reSendAudio: M && z ? () => I(z) : void 0
441
+ }
442
+ )
443
+ ] }),
444
+ M && /* @__PURE__ */ a(ne, { children: M })
445
+ ] });
446
+ }
447
+ function da(e) {
448
+ const {
449
+ variant: n = "ghost",
450
+ scheme: s = "primary",
451
+ size: t = "lg",
452
+ leftIcon: o,
453
+ rightIcon: c,
454
+ className: i = "",
455
+ children: _,
456
+ ...u
457
+ } = e, l = { md: 12, lg: 14 }[t], d = `arkynBadge ${n} ${s} ${t} ${i}`;
458
+ return /* @__PURE__ */ h("div", { className: d.trim(), ...u, children: [
459
+ /* @__PURE__ */ a(O, { iconSize: l, icon: o }),
460
+ /* @__PURE__ */ a("p", { children: _ }),
461
+ /* @__PURE__ */ a(O, { iconSize: l, icon: c })
462
+ ] });
463
+ }
464
+ const ze = te({});
465
+ function kn() {
466
+ return oe(ze);
467
+ }
468
+ function hn(e) {
469
+ return /* @__PURE__ */ a(ze.Provider, { value: e, children: e.children });
470
+ }
471
+ function ma(e) {
213
472
  const {
214
473
  children: n,
215
474
  disabled: s = !1,
216
475
  className: t = "",
217
476
  onClick: o,
218
477
  value: c,
219
- ...r
220
- } = e, { disabled: i, currentTab: l, changeCurrentTab: d } = Qe(), u = i || s, f = `arkynCardTabButton ${u ? "isDisabled" : ""} ${l === c && c ? "isActive" : ""} ${t}`;
221
- function g(k) {
222
- d(c), o && o(k);
478
+ ...i
479
+ } = e, { disabled: _, currentTab: u, changeCurrentTab: r } = kn(), l = _ || s, g = `arkynCardTabButton ${l ? "isDisabled" : ""} ${u === c && c ? "isActive" : ""} ${t}`;
480
+ function f(k) {
481
+ r(c), o && o(k);
223
482
  }
224
483
  return /* @__PURE__ */ a(
225
484
  "button",
226
485
  {
227
- onClick: g,
228
- className: f.trim(),
229
- ...r,
230
- disabled: u,
486
+ onClick: f,
487
+ className: g.trim(),
488
+ ...i,
489
+ disabled: l,
231
490
  type: "button",
232
491
  children: n
233
492
  }
234
493
  );
235
494
  }
236
- function jn(e) {
495
+ function fa(e) {
237
496
  const {
238
497
  children: n,
239
498
  onChange: s,
240
499
  defaultValue: t,
241
500
  disabled: o = !1,
242
501
  className: c,
243
- ...r
244
- } = e, [i, l] = N(t || ""), d = `arkynCardTabContainer ${c || ""}`;
245
- function u(_) {
246
- l(_), s && s(_);
502
+ ...i
503
+ } = e, [_, u] = F(t || ""), r = `arkynCardTabContainer ${c || ""}`;
504
+ function l(d) {
505
+ u(d), s && s(d);
247
506
  }
248
507
  return /* @__PURE__ */ a(
249
- en,
508
+ hn,
250
509
  {
251
510
  disabled: o,
252
- currentTab: i,
253
- changeCurrentTab: u,
254
- children: /* @__PURE__ */ a("nav", { className: d.trim(), ...r, children: n })
511
+ currentTab: _,
512
+ changeCurrentTab: l,
513
+ children: /* @__PURE__ */ a("nav", { className: r.trim(), ...i, children: n })
255
514
  }
256
515
  );
257
516
  }
258
- const Pe = ce({});
259
- function Zn(e) {
260
- const { children: n, fieldErrors: s, form: t } = e;
261
- return /* @__PURE__ */ y(Pe.Provider, { value: { fieldErrors: s }, children: [
262
- !t && n,
263
- t && Ge(t, t.props, n)
264
- ] });
265
- }
266
- function te() {
267
- return re(Pe);
268
- }
269
- function se(e) {
270
- const { children: n, className: s, ...t } = e, o = `arkynFieldWrapper ${s}`;
271
- return /* @__PURE__ */ a("section", { className: o.trim(), ...t, children: n });
272
- }
273
- function ie(e) {
274
- const { children: n, className: s, ...t } = e, o = `arkynFieldError ${s}`;
275
- return n ? /* @__PURE__ */ a("strong", { className: o.trim(), ...t, children: n }) : /* @__PURE__ */ a(Q, {});
276
- }
277
- function Y(e) {
278
- const {
279
- showAsterisk: n = !1,
280
- className: s = "",
281
- ...t
282
- } = e, c = `arkynFieldLabel ${n ? "asteriskTrue" : "asteriskFalse"} ${s}`;
283
- return /* @__PURE__ */ a("label", { className: c.trim(), ...t });
284
- }
285
- function Yn(e) {
517
+ function ga(e) {
286
518
  const {
287
519
  id: n,
288
520
  name: s,
289
521
  className: t = "",
290
522
  size: o = "md",
291
523
  errorMessage: c,
292
- defaultChecked: r = !1,
293
- label: i,
294
- checked: l = null,
295
- onCheck: d,
296
- value: u,
297
- ..._
298
- } = e, { fieldErrors: m } = te(), f = V(null), g = n || ne(), k = c || (m == null ? void 0 : m[s]), h = !!k, [v, x] = N(r || !1), p = typeof l == "boolean" ? l : v, $ = `arkynCheckbox ${o} ${h ? "errorTrue" : "errorFalse"} ${p ? "checkedTrue" : "checkedFalse"} ${t}`;
299
- function T() {
300
- const L = v;
301
- x(!L), d && d(L ? "" : u || "checked");
302
- }
303
- return /* @__PURE__ */ y(se, { children: [
304
- i && /* @__PURE__ */ a(Y, { children: i }),
305
- /* @__PURE__ */ y(
524
+ defaultChecked: i = !1,
525
+ label: _,
526
+ checked: u = null,
527
+ onCheck: r,
528
+ value: l,
529
+ ...d
530
+ } = e, { fieldErrors: m } = J(), g = V(null), f = n || ce(), k = c || (m == null ? void 0 : m[s]), y = !!k, [v, x] = F(i || !1), p = typeof u == "boolean" ? u : v, $ = `arkynCheckbox ${o} ${y ? "errorTrue" : "errorFalse"} ${p ? "checkedTrue" : "checkedFalse"} ${t}`;
531
+ function S() {
532
+ const B = v;
533
+ x(!B), r && r(B ? "" : l || "checked");
534
+ }
535
+ return /* @__PURE__ */ h(q, { children: [
536
+ _ && /* @__PURE__ */ a(K, { children: _ }),
537
+ /* @__PURE__ */ h(
306
538
  "button",
307
539
  {
308
- id: g,
540
+ id: f,
309
541
  type: "button",
310
542
  className: $,
311
- onClick: T,
312
- ..._,
543
+ onClick: S,
544
+ ...d,
313
545
  children: [
314
546
  /* @__PURE__ */ a(
315
547
  "input",
316
548
  {
317
549
  type: "hidden",
318
550
  name: s,
319
- ref: f,
320
- value: p ? u || "checked" : ""
551
+ ref: g,
552
+ value: p ? l || "checked" : ""
321
553
  }
322
554
  ),
323
- /* @__PURE__ */ a(ve, {})
555
+ /* @__PURE__ */ a(xe, {})
324
556
  ]
325
557
  }
326
558
  ),
327
- k && /* @__PURE__ */ a(ie, { children: k })
559
+ k && /* @__PURE__ */ a(ne, { children: k })
328
560
  ] });
329
561
  }
330
- const Ce = (e) => e.replace(/[^0-9]/g, ""), _e = [
562
+ function pn() {
563
+ return () => {
564
+ };
565
+ }
566
+ function Cn() {
567
+ return Ze(
568
+ pn,
569
+ () => !0,
570
+ () => !1
571
+ );
572
+ }
573
+ function ka(e) {
574
+ const { children: n, fallback: s = null } = e;
575
+ return Cn() ? /* @__PURE__ */ a(X, { children: n() }) : /* @__PURE__ */ a(X, { children: s });
576
+ }
577
+ const ye = (e) => e.replace(/[^0-9]/g, ""), _e = [
331
578
  {
332
579
  name: "Afghanistan",
333
580
  code: "+93",
@@ -2280,7 +2527,7 @@ const Ce = (e) => e.replace(/[^0-9]/g, ""), _e = [
2280
2527
  flag: "https://cdn.kcak11.com/CountryFlags/countries/zw.svg",
2281
2528
  mask: "_-______"
2282
2529
  }
2283
- ], Ne = {
2530
+ ], we = {
2284
2531
  USD: { countryLanguage: "en-US", countryCurrency: "USD" },
2285
2532
  EUR: { countryLanguage: "de-DE", countryCurrency: "EUR" },
2286
2533
  JPY: { countryLanguage: "ja-JP", countryCurrency: "JPY" },
@@ -2303,142 +2550,134 @@ const Ce = (e) => e.replace(/[^0-9]/g, ""), _e = [
2303
2550
  TRY: { countryLanguage: "tr-TR", countryCurrency: "TRY" },
2304
2551
  IDR: { countryLanguage: "id-ID", countryCurrency: "IDR" },
2305
2552
  THB: { countryLanguage: "th-TH", countryCurrency: "THB" }
2306
- }, nn = (e) => e.replace(new RegExp("(?:R\\$|\\p{Sc}|[$€¥£])", "gu"), "").trim(), Se = (e, n, s = { showPrefix: !0 }) => {
2307
- if (!Ne[n])
2553
+ }, yn = (e) => e.replace(new RegExp("(?:R\\$|\\p{Sc}|[$€¥£])", "gu"), "").trim(), $e = (e, n, s = { showPrefix: !0 }) => {
2554
+ if (!we[n])
2308
2555
  throw new Error("Unsupported currency code");
2309
- const { countryCurrency: t, countryLanguage: o } = Ne[n], c = new Intl.NumberFormat(o, {
2556
+ const { countryCurrency: t, countryLanguage: o } = we[n], c = new Intl.NumberFormat(o, {
2310
2557
  style: "currency",
2311
2558
  currency: t
2312
2559
  }).format(e);
2313
- return s.showPrefix ? c.replace(/\s/g, " ") : nn(c).replace(/\s/g, " ");
2314
- }, sn = {
2560
+ return s.showPrefix ? c.replace(/\s/g, " ") : yn(c).replace(/\s/g, " ");
2561
+ }, vn = {
2315
2562
  NINE: "(99) 99999-9999"
2316
2563
  };
2317
- Ce(sn.NINE).length;
2318
- function an(e) {
2564
+ ye(vn.NINE).length;
2565
+ function Fn(e) {
2319
2566
  let n = e;
2320
- return typeof e == "string" ? (n = +Ce(e), n % 1 !== 0 && (n = n.toFixed(2))) : n = Number.isInteger(e) ? Number(e) * 10 ** 2 : e.toFixed(2), +Ce(String(n)) / 10 ** 2;
2567
+ return typeof e == "string" ? (n = +ye(e), n % 1 !== 0 && (n = n.toFixed(2))) : n = Number.isInteger(e) ? Number(e) * 10 ** 2 : e.toFixed(2), +ye(String(n)) / 10 ** 2;
2321
2568
  }
2322
- function he(e, n) {
2323
- if (!e) return [0, Se(0, n)];
2324
- const s = an(e), t = Se(s, n);
2569
+ function Ce(e, n) {
2570
+ if (!e) return [0, $e(0, n)];
2571
+ const s = Fn(e), t = $e(s, n);
2325
2572
  return [s, t];
2326
2573
  }
2327
- function Xn(e) {
2574
+ function ha(e) {
2328
2575
  const {
2329
2576
  name: n,
2330
2577
  disabled: s,
2331
2578
  title: t,
2332
2579
  style: o,
2333
2580
  variant: c = "solid",
2334
- label: r,
2335
- className: i = "",
2336
- value: l,
2337
- defaultValue: d,
2338
- max: u,
2339
- locale: _,
2581
+ label: i,
2582
+ className: _ = "",
2583
+ value: u,
2584
+ defaultValue: r,
2585
+ max: l,
2586
+ locale: d,
2340
2587
  onChange: m,
2341
- prefix: f,
2342
- suffix: g,
2588
+ prefix: g,
2589
+ suffix: f,
2343
2590
  isLoading: k = !1,
2344
- leftIcon: h,
2591
+ leftIcon: y,
2345
2592
  readOnly: v,
2346
2593
  onFocus: x,
2347
2594
  onBlur: p,
2348
- errorMessage: B,
2349
- showAsterisk: R,
2595
+ errorMessage: N,
2596
+ showAsterisk: z,
2350
2597
  rightIcon: $,
2351
- size: T = "md",
2352
- id: L,
2353
- ...E
2354
- } = e, { fieldErrors: C } = te(), [b, M] = N(!1), [A, S] = N("0"), w = V(null), X = L || ne(), D = B || (C == null ? void 0 : C[n]), O = !!D, z = { md: 20, lg: 20 }[T], j = $ ? "right" : "left", H = j === "left" && k, Z = j === "right" && k;
2355
- function U() {
2356
- s || !(w != null && w.current) || (M(!0), w.current.focus());
2598
+ size: S = "md",
2599
+ id: B,
2600
+ ...P
2601
+ } = e, { fieldErrors: C } = J(), [I, w] = F(!1), [M, T] = F("0"), D = V(null), L = B || ce(), E = N || (C == null ? void 0 : C[n]), R = !!E, H = { md: 20, lg: 20 }[S], Q = $ ? "right" : "left", W = Q === "left" && k, ee = Q === "right" && k;
2602
+ function Z() {
2603
+ s || !(D != null && D.current) || (w(!0), D.current.focus());
2357
2604
  }
2358
- function q(K) {
2359
- M(!0), x && x(K);
2605
+ function ae(j) {
2606
+ w(!0), x && x(j);
2360
2607
  }
2361
- function F(K) {
2362
- M(!1), p && p(K);
2608
+ function A(j) {
2609
+ w(!1), p && p(j);
2363
2610
  }
2364
- const G = (K) => {
2365
- const [le, me] = he(
2366
- K,
2367
- _
2611
+ const U = (j) => {
2612
+ const [le, fe] = Ce(
2613
+ j,
2614
+ d
2368
2615
  );
2369
- return !u || le <= u ? (S(me), [le, me]) : he(K, _);
2370
- }, ue = (K) => {
2371
- K.preventDefault();
2372
- const [le, me] = G(K.target.value);
2373
- m && m(K, String(le), String(me));
2616
+ return !l || le <= l ? (T(fe), [le, fe]) : Ce(j, d);
2617
+ }, de = (j) => {
2618
+ j.preventDefault();
2619
+ const [le, fe] = U(j.target.value);
2620
+ m && m(j, String(le), String(fe));
2374
2621
  };
2375
- ae(() => {
2376
- const K = l || +d || void 0, [, le] = he(K, _);
2377
- S(le);
2378
- }, [_, d, l]);
2379
- const pe = `arkynCurrencyInput ${f ? "hasPrefix" : ""} ${g ? "hasSuffix" : ""} ${c} ${T} ${s || v || k ? "opacity" : ""} ${O ? "errored" : ""} ${b ? "focused" : ""} ${i}`;
2380
- return /* @__PURE__ */ y(se, { children: [
2381
- r && /* @__PURE__ */ a(Y, { showAsterisk: R, htmlFor: X, children: r }),
2382
- /* @__PURE__ */ y(
2622
+ re(() => {
2623
+ const j = u || +r || void 0, [, le] = Ce(j, d);
2624
+ T(le);
2625
+ }, [d, r, u]);
2626
+ const pe = `arkynCurrencyInput ${g ? "hasPrefix" : ""} ${f ? "hasSuffix" : ""} ${c} ${S} ${s || v || k ? "opacity" : ""} ${R ? "errored" : ""} ${I ? "focused" : ""} ${_}`;
2627
+ return /* @__PURE__ */ h(q, { children: [
2628
+ i && /* @__PURE__ */ a(K, { showAsterisk: z, htmlFor: L, children: i }),
2629
+ /* @__PURE__ */ h(
2383
2630
  "section",
2384
2631
  {
2385
2632
  title: t,
2386
2633
  style: o,
2387
- onClick: U,
2634
+ onClick: Z,
2388
2635
  className: pe,
2389
2636
  children: [
2390
- /* @__PURE__ */ a(I, { iconSize: z, icon: f, className: "prefix" }),
2637
+ /* @__PURE__ */ a(O, { iconSize: H, icon: g, className: "prefix" }),
2391
2638
  /* @__PURE__ */ a(
2392
- I,
2639
+ O,
2393
2640
  {
2394
- show: H,
2395
- iconSize: z,
2641
+ show: W,
2642
+ iconSize: H,
2396
2643
  className: "spinner",
2397
- icon: ee
2644
+ icon: se
2398
2645
  }
2399
2646
  ),
2400
- /* @__PURE__ */ a(I, { show: !k, icon: h, iconSize: z }),
2647
+ /* @__PURE__ */ a(O, { show: !k, icon: y, iconSize: H }),
2401
2648
  /* @__PURE__ */ a(
2402
2649
  "input",
2403
2650
  {
2404
- value: A,
2651
+ value: M,
2405
2652
  disabled: s || k,
2406
2653
  readOnly: v,
2407
- ref: w,
2408
- onFocus: q,
2409
- onBlur: F,
2410
- onChange: ue,
2411
- id: X,
2412
- ...E
2654
+ ref: D,
2655
+ onFocus: ae,
2656
+ onBlur: A,
2657
+ onChange: de,
2658
+ id: L,
2659
+ ...P
2413
2660
  }
2414
2661
  ),
2415
- /* @__PURE__ */ a(I, { show: !k, icon: $, iconSize: z }),
2662
+ /* @__PURE__ */ a(O, { show: !k, icon: $, iconSize: H }),
2416
2663
  /* @__PURE__ */ a(
2417
- I,
2664
+ O,
2418
2665
  {
2419
- show: Z,
2420
- iconSize: z,
2666
+ show: ee,
2667
+ iconSize: H,
2421
2668
  className: "spinner",
2422
- icon: ee
2669
+ icon: se
2423
2670
  }
2424
2671
  ),
2425
- /* @__PURE__ */ a(I, { iconSize: z, icon: g, className: "suffix" })
2672
+ /* @__PURE__ */ a(O, { iconSize: H, icon: f, className: "suffix" })
2426
2673
  ]
2427
2674
  }
2428
2675
  ),
2429
- D && /* @__PURE__ */ a(ie, { children: D })
2676
+ E && /* @__PURE__ */ a(ne, { children: E })
2430
2677
  ] });
2431
2678
  }
2432
- function tn(e) {
2433
- const {
2434
- className: n,
2435
- orientation: s = "horizontal",
2436
- ...t
2437
- } = e, o = `arkynDivider ${s} ${n}`;
2438
- return /* @__PURE__ */ a("div", { className: o.trim(), ...t });
2439
- }
2440
- function fe(e) {
2441
- ae(() => {
2679
+ function ke(e) {
2680
+ re(() => {
2442
2681
  if (e) {
2443
2682
  const n = document.body.style.overflow;
2444
2683
  return document.body.style.overflow = "hidden", () => {
@@ -2447,25 +2686,25 @@ function fe(e) {
2447
2686
  }
2448
2687
  }, [e]);
2449
2688
  }
2450
- const Be = ce({});
2451
- function on(e) {
2452
- return /* @__PURE__ */ a(Be.Provider, { value: { makeInvisible: e.makeInvisible }, children: e.children });
2689
+ const Oe = te({});
2690
+ function xn(e) {
2691
+ return /* @__PURE__ */ a(Oe.Provider, { value: { makeInvisible: e.makeInvisible }, children: e.children });
2453
2692
  }
2454
- function cn() {
2455
- return re(Be);
2693
+ function bn() {
2694
+ return oe(Oe);
2456
2695
  }
2457
- function Jn(e) {
2696
+ function pa(e) {
2458
2697
  const {
2459
2698
  isVisible: n,
2460
2699
  makeInvisible: s,
2461
2700
  orientation: t = "left",
2462
2701
  children: o,
2463
2702
  className: c,
2464
- ...r
2703
+ ...i
2465
2704
  } = e;
2466
- fe(n);
2467
- const i = t === "left" ? "-100%" : "100%", d = `arkynDrawerContainer ${t} ${n ? "visibleTrue" : "visibleFalse"} ${c}`;
2468
- return /* @__PURE__ */ a(on, { makeInvisible: s, children: /* @__PURE__ */ a($e, { children: n && /* @__PURE__ */ y("aside", { className: d.trim(), ...r, children: [
2705
+ ke(n);
2706
+ const _ = t === "left" ? "-100%" : "100%", r = `arkynDrawerContainer ${t} ${n ? "visibleTrue" : "visibleFalse"} ${c}`;
2707
+ return /* @__PURE__ */ a(xn, { makeInvisible: s, children: /* @__PURE__ */ a(Ee, { children: n && /* @__PURE__ */ h("aside", { className: r.trim(), ...i, children: [
2469
2708
  /* @__PURE__ */ a(
2470
2709
  ge.div,
2471
2710
  {
@@ -2482,22 +2721,22 @@ function Jn(e) {
2482
2721
  {
2483
2722
  className: "arkynDrawerContainerContent",
2484
2723
  transition: { ease: "easeOut", duration: 0.15 },
2485
- initial: { transform: `translateX(${i})` },
2724
+ initial: { transform: `translateX(${_})` },
2486
2725
  animate: { transform: "translateX(0px)" },
2487
- exit: { transform: `translateX(${i})` },
2726
+ exit: { transform: `translateX(${_})` },
2488
2727
  children: o
2489
2728
  }
2490
2729
  )
2491
2730
  ] }) }) });
2492
2731
  }
2493
- function qn(e) {
2732
+ function Ca(e) {
2494
2733
  const {
2495
2734
  showCloseButton: n = !0,
2496
2735
  className: s,
2497
2736
  children: t,
2498
2737
  ...o
2499
- } = e, { makeInvisible: c } = cn(), r = `arkynDrawerHeader ${s}`;
2500
- return /* @__PURE__ */ y("header", { className: r.trim(), ...o, children: [
2738
+ } = e, { makeInvisible: c } = bn(), i = `arkynDrawerHeader ${s}`;
2739
+ return /* @__PURE__ */ h("header", { className: i.trim(), ...o, children: [
2501
2740
  t,
2502
2741
  n && /* @__PURE__ */ a(
2503
2742
  "button",
@@ -2506,67 +2745,359 @@ function qn(e) {
2506
2745
  type: "button",
2507
2746
  onClick: c,
2508
2747
  "aria-label": "Close drawer",
2509
- children: /* @__PURE__ */ a(xe, { size: 24 })
2748
+ children: /* @__PURE__ */ a(be, { size: 24 })
2510
2749
  }
2511
2750
  )
2512
2751
  ] });
2513
2752
  }
2514
- function Qn(e) {
2753
+ function Nn(e) {
2515
2754
  const {
2516
- isLoading: n = !1,
2517
- scheme: s = "primary",
2518
- variant: t = "solid",
2519
- size: o = "md",
2520
- icon: c,
2521
- disabled: r,
2522
- className: i = "",
2523
- ...l
2524
- } = e, d = { xs: 12, sm: 16, md: 20, lg: 24 }, _ = `arkynIconButton ${t} ${s} ${o} ${n ? "loadingTrue" : "loadingFalse"} ${i}`;
2525
- return /* @__PURE__ */ y(
2526
- "button",
2755
+ disabled: n,
2756
+ file: s,
2757
+ isLoading: t,
2758
+ acceptFile: o,
2759
+ changeFileButtonText: c,
2760
+ handleSelectFile: i,
2761
+ reSendFile: _
2762
+ } = e;
2763
+ function u() {
2764
+ if (n) return;
2765
+ const l = document.createElement("input");
2766
+ l.type = "file", l.accept = o, l.onchange = (d) => {
2767
+ var g;
2768
+ const m = (g = d.target.files) == null ? void 0 : g[0];
2769
+ m && i(m);
2770
+ }, l.click();
2771
+ }
2772
+ function r() {
2773
+ return s.type.startsWith("image/") ? /* @__PURE__ */ a(sn, {}) : s.type.startsWith("audio/") ? /* @__PURE__ */ a(tn, {}) : s.type.startsWith("application/zip") ? /* @__PURE__ */ a(on, {}) : /* @__PURE__ */ a(cn, {});
2774
+ }
2775
+ return /* @__PURE__ */ h("div", { className: "arkynFileUploadHasFileContent", children: [
2776
+ /* @__PURE__ */ h("section", { className: "arkynFileUploadFileContainer", children: [
2777
+ /* @__PURE__ */ a(r, {}),
2778
+ /* @__PURE__ */ a("p", { children: s.name })
2779
+ ] }),
2780
+ /* @__PURE__ */ a(Ne, {}),
2781
+ /* @__PURE__ */ h("div", { className: "arkynFileUploadButtonsContainer", children: [
2782
+ !!_ && /* @__PURE__ */ a(Ie, { orientation: "bottom", text: "Reenviar arquivo", children: /* @__PURE__ */ a(
2783
+ Se,
2784
+ {
2785
+ type: "button",
2786
+ "aria-label": "resend file",
2787
+ variant: "outline",
2788
+ scheme: "danger",
2789
+ size: "sm",
2790
+ isLoading: t,
2791
+ onClick: _,
2792
+ icon: Fe,
2793
+ disabled: n
2794
+ }
2795
+ ) }),
2796
+ /* @__PURE__ */ a(
2797
+ ue,
2798
+ {
2799
+ isLoading: t,
2800
+ onClick: u,
2801
+ variant: "outline",
2802
+ size: "sm",
2803
+ type: "button",
2804
+ disabled: n,
2805
+ children: c
2806
+ }
2807
+ )
2808
+ ] })
2809
+ ] });
2810
+ }
2811
+ function Sn(e) {
2812
+ const {
2813
+ dropFileText: n,
2814
+ isLoading: s,
2815
+ acceptFile: t,
2816
+ handleSelectFile: o,
2817
+ selectFileButtonText: c,
2818
+ disabled: i
2819
+ } = e;
2820
+ function _(r) {
2821
+ if (i) return;
2822
+ r.preventDefault();
2823
+ const l = r.dataTransfer.files[0];
2824
+ l && o(l);
2825
+ }
2826
+ function u() {
2827
+ if (i) return;
2828
+ const r = document.createElement("input");
2829
+ r.type = "file", r.accept = t, r.onchange = (l) => {
2830
+ var m;
2831
+ const d = (m = l.target.files) == null ? void 0 : m[0];
2832
+ d && o(d);
2833
+ }, r.click();
2834
+ }
2835
+ return /* @__PURE__ */ h("div", { onDrop: _, className: "arkynFileUploadNoFileContent", children: [
2836
+ /* @__PURE__ */ a(
2837
+ ue,
2838
+ {
2839
+ isLoading: s,
2840
+ onClick: u,
2841
+ variant: "ghost",
2842
+ size: "sm",
2843
+ type: "button",
2844
+ disabled: i,
2845
+ children: c
2846
+ }
2847
+ ),
2848
+ /* @__PURE__ */ a("p", { children: n })
2849
+ ] });
2850
+ }
2851
+ function ya(e) {
2852
+ const {
2853
+ name: n,
2854
+ label: s,
2855
+ showAsterisk: t = !1,
2856
+ action: o,
2857
+ fileName: c = "file",
2858
+ method: i = "POST",
2859
+ acceptFile: _ = "*",
2860
+ fileResponseName: u = "url",
2861
+ changeFileButtonText: r = "Alterar arquivo",
2862
+ selectFileButtonText: l = "Selecionar arquivo",
2863
+ dropFileText: d = "Ou arraste e solte o arquivo aqui",
2864
+ onChange: m,
2865
+ disabled: g = !1
2866
+ } = e, { fieldErrors: f } = J(), k = f == null ? void 0 : f[n], [y, v] = F(""), [x, p] = F(""), [N, z] = F(null), [$, S] = F(!1);
2867
+ async function B(T) {
2868
+ if (g) return;
2869
+ S(!0), z(T), p("");
2870
+ const D = new FormData();
2871
+ D.append(c, T), await fetch(o, { method: i, body: D }).then(async (L) => await L.json()).then((L) => {
2872
+ L != null && L.error ? p(L.error) : v(L == null ? void 0 : L[u]), m && m(L == null ? void 0 : L[u]);
2873
+ }).catch((L) => {
2874
+ console.error(L), p("Erro ao enviar o arquivo");
2875
+ }).finally(() => S(!1));
2876
+ }
2877
+ function P(T) {
2878
+ g || B(T);
2879
+ }
2880
+ const C = k || x;
2881
+ return /* @__PURE__ */ h(q, { children: [
2882
+ s && /* @__PURE__ */ a(K, { showAsterisk: t, children: s }),
2883
+ /* @__PURE__ */ h("div", { className: `arkynFileUpload ${C ? "hasError" : "noHasError"} ${N ? "hasFile" : "noHasFile"}`, children: [
2884
+ /* @__PURE__ */ a("input", { type: "hidden", name: n, value: y || "" }),
2885
+ !N && /* @__PURE__ */ a(
2886
+ Sn,
2887
+ {
2888
+ disabled: g,
2889
+ isLoading: $,
2890
+ acceptFile: _,
2891
+ dropFileText: d,
2892
+ handleSelectFile: P,
2893
+ selectFileButtonText: l
2894
+ }
2895
+ ),
2896
+ N && /* @__PURE__ */ a(
2897
+ Nn,
2898
+ {
2899
+ disabled: g,
2900
+ isLoading: $,
2901
+ acceptFile: _,
2902
+ file: N,
2903
+ handleSelectFile: P,
2904
+ changeFileButtonText: r,
2905
+ reSendFile: C && N ? () => B(N) : void 0
2906
+ }
2907
+ )
2908
+ ] }),
2909
+ C && /* @__PURE__ */ a(ne, { children: C })
2910
+ ] });
2911
+ }
2912
+ function In(e) {
2913
+ const {
2914
+ disabled: n,
2915
+ filePath: s,
2916
+ isLoading: t,
2917
+ acceptImage: o,
2918
+ changeImageButtonText: c,
2919
+ handleSelectFile: i,
2920
+ reSendImage: _
2921
+ } = e;
2922
+ function u() {
2923
+ if (n) return;
2924
+ const r = document.createElement("input");
2925
+ r.type = "file", r.accept = o, r.onchange = (l) => {
2926
+ var m;
2927
+ const d = (m = l.target.files) == null ? void 0 : m[0];
2928
+ d && i(d);
2929
+ }, r.click();
2930
+ }
2931
+ return /* @__PURE__ */ h(
2932
+ "div",
2527
2933
  {
2528
- disabled: r || n,
2529
- className: _.trim(),
2530
- ...l,
2934
+ className: "arkynImageUploadHasFileContent",
2935
+ style: { backgroundImage: `url("${s}")` },
2531
2936
  children: [
2532
- /* @__PURE__ */ a("div", { className: "arkynIconButtonSpinner", children: /* @__PURE__ */ a(ee, { size: d[o], strokeWidth: 2.5 }) }),
2533
- /* @__PURE__ */ a("div", { className: "arkynIconButtonContent", children: /* @__PURE__ */ a(c, { size: d[o], strokeWidth: 2.5 }) })
2937
+ _ && /* @__PURE__ */ a(Ie, { orientation: "bottom", text: "Reenviar imagem", children: /* @__PURE__ */ a(
2938
+ Se,
2939
+ {
2940
+ type: "button",
2941
+ "aria-label": "resend image",
2942
+ variant: "outline",
2943
+ scheme: "danger",
2944
+ size: "sm",
2945
+ isLoading: t,
2946
+ onClick: _,
2947
+ icon: Fe,
2948
+ disabled: n
2949
+ }
2950
+ ) }),
2951
+ /* @__PURE__ */ a(
2952
+ ue,
2953
+ {
2954
+ isLoading: t,
2955
+ onClick: u,
2956
+ variant: "outline",
2957
+ size: "sm",
2958
+ type: "button",
2959
+ disabled: n,
2960
+ children: c
2961
+ }
2962
+ )
2534
2963
  ]
2535
2964
  }
2536
2965
  );
2537
2966
  }
2538
- function rn(e) {
2967
+ function Mn(e) {
2968
+ const {
2969
+ dropImageText: n,
2970
+ isLoading: s,
2971
+ acceptImage: t,
2972
+ handleSelectFile: o,
2973
+ selectImageButtonText: c,
2974
+ disabled: i
2975
+ } = e;
2976
+ function _(r) {
2977
+ if (i) return;
2978
+ r.preventDefault();
2979
+ const l = r.dataTransfer.files[0];
2980
+ l && o(l);
2981
+ }
2982
+ function u() {
2983
+ if (i) return;
2984
+ const r = document.createElement("input");
2985
+ r.type = "file", r.accept = t, r.onchange = (l) => {
2986
+ var m;
2987
+ const d = (m = l.target.files) == null ? void 0 : m[0];
2988
+ d && o(d);
2989
+ }, r.click();
2990
+ }
2991
+ return /* @__PURE__ */ h("div", { onDrop: _, className: "arkynImageUploadNoFileContent", children: [
2992
+ /* @__PURE__ */ a(
2993
+ ue,
2994
+ {
2995
+ isLoading: s,
2996
+ onClick: u,
2997
+ variant: "ghost",
2998
+ size: "sm",
2999
+ type: "button",
3000
+ disabled: i,
3001
+ children: c
3002
+ }
3003
+ ),
3004
+ /* @__PURE__ */ a("p", { children: n })
3005
+ ] });
3006
+ }
3007
+ function va(e) {
3008
+ const {
3009
+ name: n,
3010
+ defaultValue: s = "",
3011
+ label: t,
3012
+ showAsterisk: o = !1,
3013
+ action: c,
3014
+ fileName: i = "file",
3015
+ method: _ = "POST",
3016
+ acceptImage: u = "image/*",
3017
+ fileResponseName: r = "url",
3018
+ changeImageButtonText: l = "Alterar imagem",
3019
+ selectImageButtonText: d = "Selecionar imagem",
3020
+ dropImageText: m = "Ou arraste e solte a imagem aqui",
3021
+ onChange: g,
3022
+ disabled: f = !1
3023
+ } = e, { fieldErrors: k } = J(), y = k == null ? void 0 : k[n], [v, x] = F(s), [p, N] = F(""), [z, $] = F(null), [S, B] = F(s), [P, C] = F(!1);
3024
+ async function I(E) {
3025
+ if (f) return;
3026
+ C(!0), $(E), N("");
3027
+ const R = new FormData();
3028
+ R.append(i, E), await fetch(c, { method: _, body: R }).then(async (b) => await b.json()).then((b) => {
3029
+ b != null && b.error ? N(b.error) : x(b == null ? void 0 : b[r]), g && g(b == null ? void 0 : b[r]);
3030
+ }).catch((b) => {
3031
+ console.error(b), N("Erro ao enviar imagem");
3032
+ }).finally(() => C(!1));
3033
+ }
3034
+ function w(E) {
3035
+ f || (B(URL.createObjectURL(E)), I(E));
3036
+ }
3037
+ const M = y || p;
3038
+ return /* @__PURE__ */ h(q, { children: [
3039
+ t && /* @__PURE__ */ a(K, { showAsterisk: o, children: t }),
3040
+ /* @__PURE__ */ h("div", { className: `arkynImageUpload ${M ? "hasError" : "noHasError"} ${S ? "hasImage" : "noHasImage"}`, children: [
3041
+ /* @__PURE__ */ a("input", { type: "hidden", name: n, value: v || "" }),
3042
+ !S && /* @__PURE__ */ a(
3043
+ Mn,
3044
+ {
3045
+ disabled: f,
3046
+ isLoading: P,
3047
+ acceptImage: u,
3048
+ dropImageText: m,
3049
+ handleSelectFile: w,
3050
+ selectImageButtonText: d
3051
+ }
3052
+ ),
3053
+ S && /* @__PURE__ */ a(
3054
+ In,
3055
+ {
3056
+ disabled: f,
3057
+ isLoading: P,
3058
+ acceptImage: u,
3059
+ filePath: S,
3060
+ handleSelectFile: w,
3061
+ changeImageButtonText: l,
3062
+ reSendImage: M && z ? () => I(z) : void 0
3063
+ }
3064
+ )
3065
+ ] }),
3066
+ M && /* @__PURE__ */ a(ne, { children: M })
3067
+ ] });
3068
+ }
3069
+ function Tn(e) {
2539
3070
  const {
2540
3071
  name: n,
2541
3072
  disabled: s,
2542
3073
  title: t,
2543
3074
  style: o,
2544
3075
  variant: c = "solid",
2545
- label: r,
2546
- className: i = "",
2547
- prefix: l,
2548
- suffix: d,
2549
- isLoading: u = !1,
2550
- leftIcon: _,
3076
+ label: i,
3077
+ className: _ = "",
3078
+ prefix: u,
3079
+ suffix: r,
3080
+ isLoading: l = !1,
3081
+ leftIcon: d,
2551
3082
  readOnly: m,
2552
- onFocus: f,
2553
- onBlur: g,
3083
+ onFocus: g,
3084
+ onBlur: f,
2554
3085
  errorMessage: k,
2555
- showAsterisk: h,
3086
+ showAsterisk: y,
2556
3087
  rightIcon: v,
2557
3088
  type: x = "text",
2558
3089
  size: p = "md",
2559
- id: B,
2560
- ...R
2561
- } = e, { fieldErrors: $ } = te(), [T, L] = N(!1), E = V(null), C = B || ne(), b = k || ($ == null ? void 0 : $[n]), M = !!b, S = { md: 20, lg: 20 }[p], w = v ? "right" : "left", X = w === "left" && u, D = w === "right" && u;
2562
- function O() {
2563
- s || !(E != null && E.current) || (L(!0), E.current.focus());
3090
+ id: N,
3091
+ ...z
3092
+ } = e, { fieldErrors: $ } = J(), [S, B] = F(!1), P = V(null), C = N || ce(), I = k || ($ == null ? void 0 : $[n]), w = !!I, T = { md: 20, lg: 20 }[p], D = v ? "right" : "left", L = D === "left" && l, E = D === "right" && l;
3093
+ function R() {
3094
+ s || !(P != null && P.current) || (B(!0), P.current.focus());
2564
3095
  }
2565
- function J(G) {
2566
- L(!0), f && f(G);
3096
+ function b(U) {
3097
+ B(!0), g && g(U);
2567
3098
  }
2568
- function z(G) {
2569
- L(!1), g && g(G);
3099
+ function H(U) {
3100
+ B(!1), f && f(U);
2570
3101
  }
2571
3102
  if (x === "hidden")
2572
3103
  return /* @__PURE__ */ a(
@@ -2575,164 +3106,164 @@ function rn(e) {
2575
3106
  style: { display: "none" },
2576
3107
  readOnly: !0,
2577
3108
  type: "text",
2578
- ref: E,
2579
- ...R
3109
+ ref: P,
3110
+ ...z
2580
3111
  }
2581
3112
  );
2582
- const F = `arkynInput ${l ? "hasPrefix" : ""} ${d ? "hasSuffix" : ""} ${c} ${p} ${s || m || u ? "opacity" : ""} ${M ? "errored" : ""} ${T ? "focused" : ""} ${i}`;
2583
- return /* @__PURE__ */ y(se, { children: [
2584
- r && /* @__PURE__ */ a(Y, { showAsterisk: h, htmlFor: C, children: r }),
2585
- /* @__PURE__ */ y(
3113
+ const A = `arkynInput ${u ? "hasPrefix" : ""} ${r ? "hasSuffix" : ""} ${c} ${p} ${s || m || l ? "opacity" : ""} ${w ? "errored" : ""} ${S ? "focused" : ""} ${_}`;
3114
+ return /* @__PURE__ */ h(q, { children: [
3115
+ i && /* @__PURE__ */ a(K, { showAsterisk: y, htmlFor: C, children: i }),
3116
+ /* @__PURE__ */ h(
2586
3117
  "section",
2587
3118
  {
2588
3119
  title: t,
2589
3120
  style: o,
2590
- onClick: O,
2591
- className: F,
3121
+ onClick: R,
3122
+ className: A,
2592
3123
  children: [
2593
- /* @__PURE__ */ a(I, { iconSize: S, icon: l, className: "prefix" }),
3124
+ /* @__PURE__ */ a(O, { iconSize: T, icon: u, className: "prefix" }),
2594
3125
  /* @__PURE__ */ a(
2595
- I,
3126
+ O,
2596
3127
  {
2597
- show: X,
2598
- iconSize: S,
3128
+ show: L,
3129
+ iconSize: T,
2599
3130
  className: "spinner",
2600
- icon: ee
3131
+ icon: se
2601
3132
  }
2602
3133
  ),
2603
- /* @__PURE__ */ a(I, { show: !u, icon: _, iconSize: S }),
3134
+ /* @__PURE__ */ a(O, { show: !l, icon: d, iconSize: T }),
2604
3135
  /* @__PURE__ */ a(
2605
3136
  "input",
2606
3137
  {
2607
- disabled: s || u,
3138
+ disabled: s || l,
2608
3139
  readOnly: m,
2609
- ref: E,
2610
- onFocus: J,
2611
- onBlur: z,
3140
+ ref: P,
3141
+ onFocus: b,
3142
+ onBlur: H,
2612
3143
  type: x,
2613
3144
  id: C,
2614
- ...R
3145
+ ...z
2615
3146
  }
2616
3147
  ),
2617
- /* @__PURE__ */ a(I, { show: !u, icon: v, iconSize: S }),
3148
+ /* @__PURE__ */ a(O, { show: !l, icon: v, iconSize: T }),
2618
3149
  /* @__PURE__ */ a(
2619
- I,
3150
+ O,
2620
3151
  {
2621
- show: D,
2622
- iconSize: S,
3152
+ show: E,
3153
+ iconSize: T,
2623
3154
  className: "spinner",
2624
- icon: ee
3155
+ icon: se
2625
3156
  }
2626
3157
  ),
2627
- /* @__PURE__ */ a(I, { iconSize: S, icon: d, className: "suffix" })
3158
+ /* @__PURE__ */ a(O, { iconSize: T, icon: r, className: "suffix" })
2628
3159
  ]
2629
3160
  }
2630
3161
  ),
2631
- b && /* @__PURE__ */ a(ie, { children: b })
3162
+ I && /* @__PURE__ */ a(ne, { children: I })
2632
3163
  ] });
2633
3164
  }
2634
- const ln = ye((e, n) => /* @__PURE__ */ a("input", { ref: n, ...e }));
2635
- function es(e) {
3165
+ const wn = ve((e, n) => /* @__PURE__ */ a("input", { ref: n, ...e }));
3166
+ function Fa(e) {
2636
3167
  const {
2637
3168
  name: n,
2638
3169
  disabled: s,
2639
3170
  title: t,
2640
3171
  style: o,
2641
3172
  variant: c = "solid",
2642
- separate: r,
2643
- mask: i,
2644
- showMask: l,
2645
- replacement: d,
2646
- label: u,
2647
- className: _ = "",
3173
+ separate: i,
3174
+ mask: _,
3175
+ showMask: u,
3176
+ replacement: r,
3177
+ label: l,
3178
+ className: d = "",
2648
3179
  prefix: m,
2649
- suffix: f,
2650
- isLoading: g = !1,
3180
+ suffix: g,
3181
+ isLoading: f = !1,
2651
3182
  leftIcon: k,
2652
- readOnly: h,
3183
+ readOnly: y,
2653
3184
  onFocus: v,
2654
3185
  onBlur: x,
2655
3186
  errorMessage: p,
2656
- defaultValue: B,
2657
- showAsterisk: R,
3187
+ defaultValue: N,
3188
+ showAsterisk: z,
2658
3189
  rightIcon: $,
2659
- size: T = "md",
2660
- id: L,
2661
- ...E
2662
- } = e, { fieldErrors: C } = te(), [b, M] = N(!1), A = V(null), S = L || ne(), w = p || (C == null ? void 0 : C[n]), X = !!w, O = { md: 20, lg: 20 }[T], J = $ ? "right" : "left", z = J === "left" && g, j = J === "right" && g;
2663
- function H() {
2664
- s || !(A != null && A.current) || (M(!0), A.current.focus());
3190
+ size: S = "md",
3191
+ id: B,
3192
+ ...P
3193
+ } = e, { fieldErrors: C } = J(), [I, w] = F(!1), M = V(null), T = B || ce(), D = p || (C == null ? void 0 : C[n]), L = !!D, R = { md: 20, lg: 20 }[S], b = $ ? "right" : "left", H = b === "left" && f, Q = b === "right" && f;
3194
+ function W() {
3195
+ s || !(M != null && M.current) || (w(!0), M.current.focus());
2665
3196
  }
2666
- function Z(oe) {
2667
- M(!0), v && v(oe);
3197
+ function ee(ie) {
3198
+ w(!0), v && v(ie);
2668
3199
  }
2669
- function U(oe) {
2670
- M(!1), x && x(oe);
3200
+ function Z(ie) {
3201
+ w(!1), x && x(ie);
2671
3202
  }
2672
- const de = `arkynMaskedInput ${m ? "hasPrefix" : ""} ${f ? "hasSuffix" : ""} ${c} ${T} ${s || h || g ? "opacity" : ""} ${X ? "errored" : ""} ${b ? "focused" : ""} ${_}`;
2673
- return /* @__PURE__ */ y(se, { children: [
2674
- u && /* @__PURE__ */ a(Y, { showAsterisk: R, htmlFor: S, children: u }),
2675
- /* @__PURE__ */ y(
3203
+ const me = `arkynMaskedInput ${m ? "hasPrefix" : ""} ${g ? "hasSuffix" : ""} ${c} ${S} ${s || y || f ? "opacity" : ""} ${L ? "errored" : ""} ${I ? "focused" : ""} ${d}`;
3204
+ return /* @__PURE__ */ h(q, { children: [
3205
+ l && /* @__PURE__ */ a(K, { showAsterisk: z, htmlFor: T, children: l }),
3206
+ /* @__PURE__ */ h(
2676
3207
  "section",
2677
3208
  {
2678
3209
  title: t,
2679
3210
  style: o,
2680
- onClick: H,
2681
- className: de,
3211
+ onClick: W,
3212
+ className: me,
2682
3213
  children: [
2683
- /* @__PURE__ */ a(I, { iconSize: O, icon: m, className: "prefix" }),
3214
+ /* @__PURE__ */ a(O, { iconSize: R, icon: m, className: "prefix" }),
2684
3215
  /* @__PURE__ */ a(
2685
- I,
3216
+ O,
2686
3217
  {
2687
- show: z,
2688
- iconSize: O,
3218
+ show: H,
3219
+ iconSize: R,
2689
3220
  className: "spinner",
2690
- icon: ee
3221
+ icon: se
2691
3222
  }
2692
3223
  ),
2693
- /* @__PURE__ */ a(I, { show: !g, icon: k, iconSize: O }),
3224
+ /* @__PURE__ */ a(O, { show: !f, icon: k, iconSize: R }),
2694
3225
  /* @__PURE__ */ a(
2695
- Te,
3226
+ Be,
2696
3227
  {
2697
- component: ln,
2698
- mask: i,
2699
- replacement: d,
2700
- separate: r,
2701
- showMask: l,
2702
- ref: A,
2703
- onFocus: Z,
2704
- onBlur: U,
3228
+ component: wn,
3229
+ mask: _,
3230
+ replacement: r,
3231
+ separate: i,
3232
+ showMask: u,
3233
+ ref: M,
3234
+ onFocus: ee,
3235
+ onBlur: Z,
2705
3236
  disabled: s,
2706
- readOnly: h,
2707
- id: S,
2708
- ...E
3237
+ readOnly: y,
3238
+ id: T,
3239
+ ...P
2709
3240
  }
2710
3241
  ),
2711
- /* @__PURE__ */ a(I, { show: !g, icon: $, iconSize: O }),
3242
+ /* @__PURE__ */ a(O, { show: !f, icon: $, iconSize: R }),
2712
3243
  /* @__PURE__ */ a(
2713
- I,
3244
+ O,
2714
3245
  {
2715
- show: j,
2716
- iconSize: O,
3246
+ show: Q,
3247
+ iconSize: R,
2717
3248
  className: "spinner",
2718
- icon: ee
3249
+ icon: se
2719
3250
  }
2720
3251
  ),
2721
- /* @__PURE__ */ a(I, { iconSize: O, icon: f, className: "suffix" })
3252
+ /* @__PURE__ */ a(O, { iconSize: R, icon: g, className: "suffix" })
2722
3253
  ]
2723
3254
  }
2724
3255
  ),
2725
- w && /* @__PURE__ */ a(ie, { children: w })
3256
+ D && /* @__PURE__ */ a(ne, { children: D })
2726
3257
  ] });
2727
3258
  }
2728
- const Le = ce({});
2729
- function _n(e) {
2730
- return /* @__PURE__ */ a(Le.Provider, { value: { makeInvisible: e.makeInvisible }, children: e.children });
3259
+ const Re = te({});
3260
+ function $n(e) {
3261
+ return /* @__PURE__ */ a(Re.Provider, { value: { makeInvisible: e.makeInvisible }, children: e.children });
2731
3262
  }
2732
- function un() {
2733
- return re(Le);
3263
+ function An() {
3264
+ return oe(Re);
2734
3265
  }
2735
- function ns(e) {
3266
+ function xa(e) {
2736
3267
  const {
2737
3268
  isVisible: n,
2738
3269
  makeInvisible: s,
@@ -2740,9 +3271,9 @@ function ns(e) {
2740
3271
  className: o = "",
2741
3272
  ...c
2742
3273
  } = e;
2743
- fe(n);
2744
- const i = `arkynModalContainer ${n ? "visibleTrue" : "visibleFalse"} ${o}`;
2745
- return /* @__PURE__ */ a(_n, { makeInvisible: s, children: /* @__PURE__ */ a($e, { children: n && /* @__PURE__ */ y("aside", { className: i.trim(), ...c, children: [
3274
+ ke(n);
3275
+ const _ = `arkynModalContainer ${n ? "visibleTrue" : "visibleFalse"} ${o}`;
3276
+ return /* @__PURE__ */ a($n, { makeInvisible: s, children: /* @__PURE__ */ a(Ee, { children: n && /* @__PURE__ */ h("aside", { className: _.trim(), ...c, children: [
2746
3277
  /* @__PURE__ */ a(
2747
3278
  ge.div,
2748
3279
  {
@@ -2767,18 +3298,18 @@ function ns(e) {
2767
3298
  )
2768
3299
  ] }) }) });
2769
3300
  }
2770
- function ss(e) {
3301
+ function ba(e) {
2771
3302
  const { alignment: n = "right", className: s, ...t } = e, o = `arkynModalFooter ${n} ${s}`;
2772
3303
  return /* @__PURE__ */ a("footer", { className: o.trim(), ...t });
2773
3304
  }
2774
- function as(e) {
3305
+ function Na(e) {
2775
3306
  const {
2776
3307
  showCloseButton: n = !0,
2777
3308
  className: s,
2778
3309
  children: t,
2779
3310
  ...o
2780
- } = e, { makeInvisible: c } = un(), r = `arkynModalHeader ${s}`;
2781
- return /* @__PURE__ */ y("header", { className: r.trim(), ...o, children: [
3311
+ } = e, { makeInvisible: c } = An(), i = `arkynModalHeader ${s}`;
3312
+ return /* @__PURE__ */ h("header", { className: i.trim(), ...o, children: [
2782
3313
  t,
2783
3314
  n && /* @__PURE__ */ a(
2784
3315
  "button",
@@ -2787,47 +3318,47 @@ function as(e) {
2787
3318
  onClick: c,
2788
3319
  "aria-label": "Close modal button",
2789
3320
  className: "arkynModalHeaderCloseButton",
2790
- children: /* @__PURE__ */ a(xe, { size: 24 })
3321
+ children: /* @__PURE__ */ a(be, { size: 24 })
2791
3322
  }
2792
3323
  )
2793
3324
  ] });
2794
3325
  }
2795
- function dn(e) {
2796
- const { iconSize: n, isLoading: s, disabled: t, readOnly: o, isFocused: c } = e, l = `arkynMultiSelectChevron ${t || o ? "notAnimate" : ""} ${c ? "focused" : ""}`;
2797
- return s ? /* @__PURE__ */ a(Q, {}) : /* @__PURE__ */ a(Ie, { className: l, size: n, strokeWidth: 2.5 });
3326
+ function Pn(e) {
3327
+ const { iconSize: n, isLoading: s, disabled: t, readOnly: o, isFocused: c } = e, u = `arkynMultiSelectChevron ${t || o ? "notAnimate" : ""} ${c ? "focused" : ""}`;
3328
+ return s ? /* @__PURE__ */ a(X, {}) : /* @__PURE__ */ a(Pe, { className: u, size: n, strokeWidth: 2.5 });
2798
3329
  }
2799
- function mn(e) {
3330
+ function En(e) {
2800
3331
  const {
2801
3332
  children: n,
2802
3333
  handleContainerFocus: s,
2803
3334
  disabled: t,
2804
3335
  isError: o,
2805
3336
  isLoading: c,
2806
- isFocused: r,
2807
- className: i,
2808
- readOnly: l,
2809
- variant: d,
2810
- size: u,
2811
- id: _,
3337
+ isFocused: i,
3338
+ className: _,
3339
+ readOnly: u,
3340
+ variant: r,
3341
+ size: l,
3342
+ id: d,
2812
3343
  prefixExists: m
2813
3344
  } = e;
2814
3345
  return /* @__PURE__ */ a(
2815
3346
  "section",
2816
3347
  {
2817
- id: _,
2818
- className: `arkynMultiSelectContainer ${m ? "hasPrefix" : ""} ${d} ${u} ${t || l || c ? "opacity" : ""} ${o ? "errored" : ""} ${r ? "focused" : ""} ${i}`,
3348
+ id: d,
3349
+ className: `arkynMultiSelectContainer ${m ? "hasPrefix" : ""} ${r} ${l} ${t || u || c ? "opacity" : ""} ${o ? "errored" : ""} ${i ? "focused" : ""} ${_}`,
2819
3350
  onClick: s,
2820
3351
  children: n
2821
3352
  }
2822
3353
  );
2823
3354
  }
2824
- function gn(e) {
3355
+ function Bn(e) {
2825
3356
  const { children: n, size: s } = e, t = `arkynMultiSelectContent ${s}`;
2826
3357
  return /* @__PURE__ */ a("div", { className: t, children: n });
2827
3358
  }
2828
- function fn(e) {
3359
+ function Dn(e) {
2829
3360
  const { label: n, value: s, disabled: t, handleChangeValue: o } = e;
2830
- return /* @__PURE__ */ y("div", { className: "arkynMultiSelectMark", children: [
3361
+ return /* @__PURE__ */ h("div", { className: "arkynMultiSelectMark", children: [
2831
3362
  n,
2832
3363
  /* @__PURE__ */ a(
2833
3364
  "button",
@@ -2837,209 +3368,209 @@ function fn(e) {
2837
3368
  onClick: (c) => {
2838
3369
  c.stopPropagation(), o(s);
2839
3370
  },
2840
- children: /* @__PURE__ */ a(xe, {})
3371
+ children: /* @__PURE__ */ a(be, {})
2841
3372
  }
2842
3373
  )
2843
3374
  ] });
2844
3375
  }
2845
- function kn(e) {
2846
- const { label: n, optionHasSelected: s, handleChangeValue: t, value: o, size: c } = e, r = s(o) ? "active" : "", i = `arkynMultiSelectOption ${c} ${r}`;
2847
- return /* @__PURE__ */ y("div", { onClick: () => t(o), className: i, children: [
3376
+ function Ln(e) {
3377
+ const { label: n, optionHasSelected: s, handleChangeValue: t, value: o, size: c } = e, i = s(o) ? "active" : "", _ = `arkynMultiSelectOption ${c} ${i}`;
3378
+ return /* @__PURE__ */ h("div", { onClick: () => t(o), className: _, children: [
2848
3379
  n,
2849
3380
  " ",
2850
- /* @__PURE__ */ a(ve, {})
3381
+ /* @__PURE__ */ a(xe, {})
2851
3382
  ] });
2852
3383
  }
2853
- function pn(e) {
2854
- const { children: n, isFocused: s, isSearchable: t, search: o, onSearch: c } = e, r = V(null), [i, l] = N("bottom");
2855
- fe(s), ae(() => {
3384
+ function zn(e) {
3385
+ const { children: n, isFocused: s, isSearchable: t, search: o, onSearch: c } = e, i = V(null), [_, u] = F("bottom");
3386
+ ke(s), re(() => {
2856
3387
  if (!s) return;
2857
3388
  (() => {
2858
- if (!r.current) return;
2859
- const _ = r.current.parentElement;
2860
- if (!_) return;
2861
- const m = _.getBoundingClientRect(), f = window.innerHeight, g = 300;
2862
- f - m.bottom < g && m.top > g ? l("top") : l("bottom");
3389
+ if (!i.current) return;
3390
+ const d = i.current.parentElement;
3391
+ if (!d) return;
3392
+ const m = d.getBoundingClientRect(), g = window.innerHeight, f = 300;
3393
+ g - m.bottom < f && m.top > f ? u("top") : u("bottom");
2863
3394
  })();
2864
3395
  }, [s]);
2865
- function d(u) {
2866
- t && c(u.target.value);
3396
+ function r(l) {
3397
+ t && c(l.target.value);
2867
3398
  }
2868
- return s ? /* @__PURE__ */ y(
3399
+ return s ? /* @__PURE__ */ h(
2869
3400
  "div",
2870
3401
  {
2871
- ref: r,
2872
- className: `arkynMultiSelectOptionsContainer ${i}`,
3402
+ ref: i,
3403
+ className: `arkynMultiSelectOptionsContainer ${_}`,
2873
3404
  children: [
2874
3405
  t && /* @__PURE__ */ a(
2875
- rn,
3406
+ Tn,
2876
3407
  {
2877
3408
  type: "search",
2878
3409
  name: "search-select",
2879
3410
  variant: "underline",
2880
- leftIcon: Ze,
3411
+ leftIcon: rn,
2881
3412
  value: o,
2882
- onChange: d
3413
+ onChange: r
2883
3414
  }
2884
3415
  ),
2885
3416
  n
2886
3417
  ]
2887
3418
  }
2888
- ) : /* @__PURE__ */ a(Q, {});
3419
+ ) : /* @__PURE__ */ a(X, {});
2889
3420
  }
2890
- function hn(e) {
3421
+ function On(e) {
2891
3422
  const { isFocused: n, handleBlur: s } = e;
2892
- return n ? /* @__PURE__ */ a("aside", { className: "arkynMultiSelectOverlay", onClick: s }) : /* @__PURE__ */ a(Q, {});
3423
+ return n ? /* @__PURE__ */ a("aside", { className: "arkynMultiSelectOverlay", onClick: s }) : /* @__PURE__ */ a(X, {});
2893
3424
  }
2894
- function Cn(e) {
3425
+ function Rn(e) {
2895
3426
  const { iconSize: n, isLoading: s } = e;
2896
3427
  return s ? /* @__PURE__ */ a(
2897
- ee,
3428
+ se,
2898
3429
  {
2899
3430
  className: "arkynMultiSelectSpinner",
2900
3431
  size: n,
2901
3432
  strokeWidth: 2.5
2902
3433
  }
2903
- ) : /* @__PURE__ */ a(Q, {});
3434
+ ) : /* @__PURE__ */ a(X, {});
2904
3435
  }
2905
- function ts(e) {
3436
+ function Sa(e) {
2906
3437
  const {
2907
3438
  name: n,
2908
3439
  options: s,
2909
3440
  className: t = "",
2910
3441
  placeholder: o = "Selecione...",
2911
3442
  closeOnSelect: c = !1,
2912
- defaultValue: r = [],
2913
- errorMessage: i,
2914
- isLoading: l = !1,
2915
- readOnly: d = !1,
2916
- isSearchable: u = !1,
2917
- id: _,
3443
+ defaultValue: i = [],
3444
+ errorMessage: _,
3445
+ isLoading: u = !1,
3446
+ readOnly: r = !1,
3447
+ isSearchable: l = !1,
3448
+ id: d,
2918
3449
  label: m,
2919
- optionMaxHeight: f,
2920
- showAsterisk: g,
3450
+ optionMaxHeight: g,
3451
+ showAsterisk: f,
2921
3452
  leftIcon: k,
2922
- onSearch: h,
3453
+ onSearch: y,
2923
3454
  onChange: v,
2924
3455
  onBlur: x,
2925
3456
  notFoundText: p = "Sem opções disponíveis",
2926
- onFocus: B,
2927
- disabled: R = !1,
3457
+ onFocus: N,
3458
+ disabled: z = !1,
2928
3459
  prefix: $,
2929
- size: T = "md",
2930
- value: L,
2931
- variant: E = "solid"
2932
- } = e, { fieldErrors: C } = te(), b = V(null), M = _ || ne(), A = i || (C == null ? void 0 : C[n]), S = !!A, w = R || l || d, D = { md: 20, lg: 20 }[T], [O, J] = N(""), [z, j] = N(!1), [H, Z] = N(r), U = L || H;
2933
- function q(P) {
2934
- return U.includes(P);
2935
- }
2936
- function F(P) {
2937
- const W = s.find((pe) => pe.value === P);
2938
- return (W == null ? void 0 : W.label) || "";
2939
- }
2940
- function G() {
2941
- w || !(b != null && b.current) || z || (j(!0), b.current.focus(), B && B());
2942
- }
2943
- function ue() {
2944
- j(!1), x && b.current && b.current.blur();
2945
- }
2946
- function ke(P) {
2947
- J(P), h && h(P);
2948
- }
2949
- function de(P) {
2950
- q(P) ? (Z(H.filter((W) => W !== P)), v && v(H.filter((W) => W !== P))) : (Z([...H, P]), v && v([...H, P])), c && ue();
2951
- }
2952
- const oe = s.filter((P) => !!(e.onSearch || !e.isSearchable || P.label.toLowerCase().includes(O.toLowerCase())));
2953
- return /* @__PURE__ */ y(se, { children: [
2954
- m && /* @__PURE__ */ a(Y, { showAsterisk: g, children: m }),
2955
- /* @__PURE__ */ y(
2956
- mn,
3460
+ size: S = "md",
3461
+ value: B,
3462
+ variant: P = "solid"
3463
+ } = e, { fieldErrors: C } = J(), I = V(null), w = d || ce(), M = _ || (C == null ? void 0 : C[n]), T = !!M, D = z || u || r, E = { md: 20, lg: 20 }[S], [R, b] = F(""), [H, Q] = F(!1), [W, ee] = F(i), Z = B || W;
3464
+ function ae(G) {
3465
+ return Z.includes(G);
3466
+ }
3467
+ function A(G) {
3468
+ const Y = s.find((pe) => pe.value === G);
3469
+ return (Y == null ? void 0 : Y.label) || "";
3470
+ }
3471
+ function U() {
3472
+ D || !(I != null && I.current) || H || (Q(!0), I.current.focus(), N && N());
3473
+ }
3474
+ function de() {
3475
+ Q(!1), x && I.current && I.current.blur();
3476
+ }
3477
+ function he(G) {
3478
+ b(G), y && y(G);
3479
+ }
3480
+ function me(G) {
3481
+ ae(G) ? (ee(W.filter((Y) => Y !== G)), v && v(W.filter((Y) => Y !== G))) : (ee([...W, G]), v && v([...W, G])), c && de();
3482
+ }
3483
+ const ie = s.filter((G) => !!(e.onSearch || !e.isSearchable || G.label.toLowerCase().includes(R.toLowerCase())));
3484
+ return /* @__PURE__ */ h(q, { children: [
3485
+ m && /* @__PURE__ */ a(K, { showAsterisk: f, children: m }),
3486
+ /* @__PURE__ */ h(
3487
+ En,
2957
3488
  {
2958
- handleContainerFocus: G,
2959
- disabled: w,
2960
- isError: S,
2961
- isFocused: z,
2962
- isLoading: l,
2963
- readOnly: d,
2964
- size: T,
2965
- variant: E,
3489
+ handleContainerFocus: U,
3490
+ disabled: D,
3491
+ isError: T,
3492
+ isFocused: H,
3493
+ isLoading: u,
3494
+ readOnly: r,
3495
+ size: S,
3496
+ variant: P,
2966
3497
  className: t,
2967
3498
  prefixExists: !!$,
2968
- id: M,
3499
+ id: w,
2969
3500
  children: [
2970
3501
  /* @__PURE__ */ a(
2971
3502
  "input",
2972
3503
  {
2973
- ref: b,
3504
+ ref: I,
2974
3505
  name: n,
2975
- value: JSON.stringify(U),
3506
+ value: JSON.stringify(Z),
2976
3507
  type: "hidden"
2977
3508
  }
2978
3509
  ),
2979
- /* @__PURE__ */ a(I, { iconSize: D, icon: $, className: "prefix" }),
2980
- k && /* @__PURE__ */ a(k, { size: D, strokeWidth: 2.5 }),
2981
- /* @__PURE__ */ y(gn, { size: T, children: [
2982
- U.map((P) => /* @__PURE__ */ a(
2983
- fn,
3510
+ /* @__PURE__ */ a(O, { iconSize: E, icon: $, className: "prefix" }),
3511
+ k && /* @__PURE__ */ a(k, { size: E, strokeWidth: 2.5 }),
3512
+ /* @__PURE__ */ h(Bn, { size: S, children: [
3513
+ Z.map((G) => /* @__PURE__ */ a(
3514
+ Dn,
2984
3515
  {
2985
- label: F(P),
2986
- value: P,
2987
- handleChangeValue: de,
2988
- disabled: w
3516
+ label: A(G),
3517
+ value: G,
3518
+ handleChangeValue: me,
3519
+ disabled: D
2989
3520
  },
2990
- P
3521
+ G
2991
3522
  )),
2992
- U.length <= 0 && /* @__PURE__ */ a("p", { children: o })
3523
+ Z.length <= 0 && /* @__PURE__ */ a("p", { children: o })
2993
3524
  ] }),
2994
- /* @__PURE__ */ y(
2995
- pn,
3525
+ /* @__PURE__ */ h(
3526
+ zn,
2996
3527
  {
2997
- isFocused: z,
2998
- isSearchable: u,
2999
- search: O,
3000
- onSearch: ke,
3528
+ isFocused: H,
3529
+ isSearchable: l,
3530
+ search: R,
3531
+ onSearch: he,
3001
3532
  children: [
3002
- oe.map(({ label: P, value: W }) => /* @__PURE__ */ a(
3003
- kn,
3533
+ ie.map(({ label: G, value: Y }) => /* @__PURE__ */ a(
3534
+ Ln,
3004
3535
  {
3005
- label: P,
3006
- value: W,
3007
- size: T,
3008
- handleChangeValue: de,
3009
- optionHasSelected: q
3536
+ label: G,
3537
+ value: Y,
3538
+ size: S,
3539
+ handleChangeValue: me,
3540
+ optionHasSelected: ae
3010
3541
  },
3011
- W
3542
+ Y
3012
3543
  )),
3013
- oe.length <= 0 && /* @__PURE__ */ a("p", { children: p })
3544
+ ie.length <= 0 && /* @__PURE__ */ a("p", { children: p })
3014
3545
  ]
3015
3546
  }
3016
3547
  ),
3017
3548
  /* @__PURE__ */ a(
3018
- dn,
3549
+ Pn,
3019
3550
  {
3020
- disabled: w,
3021
- isFocused: z,
3022
- readOnly: d,
3023
- iconSize: D,
3024
- isLoading: l
3551
+ disabled: D,
3552
+ isFocused: H,
3553
+ readOnly: r,
3554
+ iconSize: E,
3555
+ isLoading: u
3025
3556
  }
3026
3557
  ),
3027
- /* @__PURE__ */ a(Cn, { iconSize: D, isLoading: l }),
3028
- /* @__PURE__ */ a(hn, { handleBlur: ue, isFocused: z })
3558
+ /* @__PURE__ */ a(Rn, { iconSize: E, isLoading: u }),
3559
+ /* @__PURE__ */ a(On, { handleBlur: de, isFocused: H })
3029
3560
  ]
3030
3561
  }
3031
3562
  ),
3032
- A && /* @__PURE__ */ a(ie, { children: A })
3563
+ M && /* @__PURE__ */ a(ne, { children: M })
3033
3564
  ] });
3034
3565
  }
3035
- function Fe(e) {
3566
+ function Me(e) {
3036
3567
  return e && e.replace(/[^0-9]/g, "");
3037
3568
  }
3038
- const be = {
3569
+ const Te = {
3039
3570
  EIGHT: "(99) 9999-9999",
3040
3571
  NINE: "(99) 99999-9999"
3041
3572
  };
3042
- function Ee(e, n) {
3573
+ function Ge(e, n) {
3043
3574
  let s = "", t = 0;
3044
3575
  for (let o = 0; o < n.length; o++)
3045
3576
  if (n[o] === "9")
@@ -3053,15 +3584,15 @@ function Ee(e, n) {
3053
3584
  break;
3054
3585
  return s;
3055
3586
  }
3056
- function ze(e) {
3587
+ function He(e) {
3057
3588
  return e.length > 10 ? "NINE" : "EIGHT";
3058
3589
  }
3059
- const Re = Fe(be.NINE).length;
3060
- function Me(e, n) {
3590
+ const Ue = Me(Te.NINE).length;
3591
+ function Ae(e, n) {
3061
3592
  if (n.code === "+55") {
3062
- let o = Fe(e);
3063
- const c = ze(o);
3064
- return o.length > Re ? void 0 : (o = Ee(o, be[c]), o);
3593
+ let o = Me(e);
3594
+ const c = He(o);
3595
+ return o.length > Ue ? void 0 : (o = Ge(o, Te[c]), o);
3065
3596
  }
3066
3597
  let t = n.mask;
3067
3598
  if (n.prefix) {
@@ -3072,80 +3603,80 @@ function Me(e, n) {
3072
3603
  t[o] === "_" && (t = t.substring(0, o) + e[c] + t.substring(o + 1), c++);
3073
3604
  return t;
3074
3605
  }
3075
- function yn(e, n) {
3606
+ function Gn(e, n) {
3076
3607
  const s = _e.find(
3077
3608
  (t) => t.code === e && t.prefix === n
3078
3609
  );
3079
3610
  return s || null;
3080
3611
  }
3081
- function vn(e) {
3612
+ function Hn(e) {
3082
3613
  const n = _e.find((s) => s.code === e);
3083
3614
  return n || null;
3084
3615
  }
3085
- function xn(e) {
3616
+ function Un(e) {
3086
3617
  const n = e.split(" ")[0].split("-")[0], s = e.split(" ")[0].split("-")[1], t = e.split(" ")[1];
3087
3618
  if (!n || !t)
3088
3619
  return { country: null, formattedNumber: "" };
3089
3620
  if (s) {
3090
- const i = yn(n, s);
3091
- if (!i) return { country: null, formattedNumber: "" };
3092
- const l = Me(t, i);
3093
- return { country: i, formattedNumber: l };
3621
+ const _ = Gn(n, s);
3622
+ if (!_) return { country: null, formattedNumber: "" };
3623
+ const u = Ae(t, _);
3624
+ return { country: _, formattedNumber: u };
3094
3625
  }
3095
- const o = vn(n);
3626
+ const o = Hn(n);
3096
3627
  if (!o) return { country: null, formattedNumber: "" };
3097
- const c = Me(t, o);
3628
+ const c = Ae(t, o);
3098
3629
  return { country: o, formattedNumber: c };
3099
3630
  }
3100
- function Fn(e) {
3631
+ function Vn(e) {
3101
3632
  const {
3102
3633
  children: n,
3103
3634
  onFocus: s,
3104
3635
  disabled: t,
3105
3636
  isError: o,
3106
3637
  isLoading: c,
3107
- isFocused: r,
3108
- className: i = "",
3109
- readOnly: l,
3110
- variant: d,
3111
- size: u,
3112
- id: _
3113
- } = e, k = `arkynPhoneInputContainer ${d} ${u} ${t || l || c ? "opacity" : ""} ${o ? "errored" : ""} ${r ? "focused" : ""} ${i}`;
3114
- return /* @__PURE__ */ a("section", { id: _, className: k.trim(), onClick: s, children: n });
3115
- }
3116
- function bn(e) {
3638
+ isFocused: i,
3639
+ className: _ = "",
3640
+ readOnly: u,
3641
+ variant: r,
3642
+ size: l,
3643
+ id: d
3644
+ } = e, k = `arkynPhoneInputContainer ${r} ${l} ${t || u || c ? "opacity" : ""} ${o ? "errored" : ""} ${i ? "focused" : ""} ${_}`;
3645
+ return /* @__PURE__ */ a("section", { id: d, className: k.trim(), onClick: s, children: n });
3646
+ }
3647
+ function Kn(e) {
3117
3648
  const { isOpen: n, onClick: s } = e;
3118
- return n ? /* @__PURE__ */ a("aside", { className: "arkynPhoneInputCountriesOverlay", onClick: s }) : /* @__PURE__ */ a(Q, {});
3649
+ return n ? /* @__PURE__ */ a("aside", { className: "arkynPhoneInputCountriesOverlay", onClick: s }) : /* @__PURE__ */ a(X, {});
3119
3650
  }
3120
- function Nn(e) {
3121
- const { country: n, isActive: s, handleChangeValue: t, size: o } = e, r = `arkynPhoneInputCountryOption ${o} ${s ? "active" : ""}`;
3122
- return /* @__PURE__ */ y("div", { onClick: () => t(n), className: r, children: [
3651
+ function Wn(e) {
3652
+ const { country: n, isActive: s, handleChangeValue: t, size: o } = e, i = `arkynPhoneInputCountryOption ${o} ${s ? "active" : ""}`;
3653
+ return /* @__PURE__ */ h("div", { onClick: () => t(n), className: i, children: [
3123
3654
  /* @__PURE__ */ a("img", { src: n.flag, alt: n.name, className: "flag" }),
3124
3655
  n.name,
3125
3656
  " ",
3126
3657
  /* @__PURE__ */ a("span", { children: n.code }),
3127
- /* @__PURE__ */ a(ve, { className: "check" })
3658
+ /* @__PURE__ */ a(xe, { className: "check" })
3128
3659
  ] });
3129
3660
  }
3130
- function Sn(e) {
3131
- const { children: n, isOpen: s, onSearch: t, search: o, placeholder: c } = e, r = V(null), [i, l] = N("bottom");
3132
- function d(u) {
3133
- t(u.target.value);
3661
+ function jn(e) {
3662
+ const { children: n, isOpen: s, onSearch: t, search: o, placeholder: c } = e, i = V(null), [_, u] = F("bottom");
3663
+ function r(l) {
3664
+ t(l.target.value);
3134
3665
  }
3135
- return fe(s), ae(() => {
3666
+ return ke(s), re(() => {
3136
3667
  if (!s) return;
3137
3668
  (() => {
3138
- if (!r.current) return;
3139
- const _ = r.current.parentElement;
3140
- if (!_) return;
3141
- const m = _.getBoundingClientRect(), f = window.innerHeight, g = 300;
3142
- f - m.bottom < g && m.top > g ? l("top") : l("bottom");
3669
+ if (!i.current) return;
3670
+ const d = i.current.parentElement;
3671
+ if (!d) return;
3672
+ const m = d.getBoundingClientRect(), g = window.innerHeight, f = 300;
3673
+ g - m.bottom < f && m.top > f ? u("top") : u("bottom");
3143
3674
  })();
3144
- }, [s]), s ? /* @__PURE__ */ y(
3675
+ }, [s]), s ? /* @__PURE__ */ h(
3145
3676
  "div",
3146
3677
  {
3147
- className: `arkynPhoneInputCountryOptionsContainer ${i}`,
3148
- ref: r,
3678
+ className: `arkynPhoneInputCountryOptionsContainer ${_}`,
3679
+ ref: i,
3149
3680
  children: [
3150
3681
  /* @__PURE__ */ a(
3151
3682
  "input",
@@ -3156,17 +3687,17 @@ function Sn(e) {
3156
3687
  value: o,
3157
3688
  id: "input-search",
3158
3689
  placeholder: c,
3159
- onChange: d
3690
+ onChange: r
3160
3691
  }
3161
3692
  ),
3162
3693
  n
3163
3694
  ]
3164
3695
  }
3165
- ) : /* @__PURE__ */ a(Q, {});
3696
+ ) : /* @__PURE__ */ a(X, {});
3166
3697
  }
3167
- function Mn(e) {
3698
+ function qn(e) {
3168
3699
  const { currentCountry: n, onClick: s } = e;
3169
- return /* @__PURE__ */ y("div", { className: "phoneInputSelectCountry", onClick: s, children: [
3700
+ return /* @__PURE__ */ h("div", { className: "phoneInputSelectCountry", onClick: s, children: [
3170
3701
  /* @__PURE__ */ a(
3171
3702
  "img",
3172
3703
  {
@@ -3175,44 +3706,44 @@ function Mn(e) {
3175
3706
  alt: n.name
3176
3707
  }
3177
3708
  ),
3178
- /* @__PURE__ */ a(Ie, { className: "chevronDown", strokeWidth: 2.5 }),
3179
- /* @__PURE__ */ a(tn, { orientation: "vertical" })
3709
+ /* @__PURE__ */ a(Pe, { className: "chevronDown", strokeWidth: 2.5 }),
3710
+ /* @__PURE__ */ a(Ne, { orientation: "vertical" })
3180
3711
  ] });
3181
3712
  }
3182
- const In = ye((e, n) => /* @__PURE__ */ a("input", { ref: n, ...e })), $n = ye(
3713
+ const Zn = ve((e, n) => /* @__PURE__ */ a("input", { ref: n, ...e })), Yn = ve(
3183
3714
  (e, n) => {
3184
- const { onFocus: s, onBlur: t, size: o, onChange: c, value: r, currentCountry: i, disabled: l } = e, [d, u] = N(!1);
3185
- ae(() => {
3186
- d ? c(i.mask) : u(!0);
3187
- }, [i]);
3188
- const _ = `phoneInputMask ${o}`;
3189
- function m(f) {
3190
- let g = Fe(f.target.value);
3191
- const k = ze(g);
3192
- g.length > Re || (g = Ee(g, be[k]), f.target.value = g, c(g));
3715
+ const { onFocus: s, onBlur: t, size: o, onChange: c, value: i, currentCountry: _, disabled: u } = e, [r, l] = F(!1);
3716
+ re(() => {
3717
+ r ? c(_.mask) : l(!0);
3718
+ }, [_]);
3719
+ const d = `phoneInputMask ${o}`;
3720
+ function m(g) {
3721
+ let f = Me(g.target.value);
3722
+ const k = He(f);
3723
+ f.length > Ue || (f = Ge(f, Te[k]), g.target.value = f, c(f));
3193
3724
  }
3194
- return i.code === "+55" ? /* @__PURE__ */ a(
3725
+ return _.code === "+55" ? /* @__PURE__ */ a(
3195
3726
  "input",
3196
3727
  {
3197
- value: r,
3728
+ value: i,
3198
3729
  onChange: m,
3199
- className: _,
3730
+ className: d,
3200
3731
  onFocus: s,
3201
3732
  onBlur: t,
3202
- disabled: l,
3733
+ disabled: u,
3203
3734
  ref: n
3204
3735
  }
3205
3736
  ) : /* @__PURE__ */ a(
3206
- Te,
3737
+ Be,
3207
3738
  {
3208
- value: r,
3209
- onChange: (f) => c(f.target.value),
3210
- className: _,
3211
- component: In,
3739
+ value: i,
3740
+ onChange: (g) => c(g.target.value),
3741
+ className: d,
3742
+ component: Zn,
3212
3743
  onFocus: s,
3213
3744
  onBlur: t,
3214
- disabled: l,
3215
- mask: i.mask,
3745
+ disabled: u,
3746
+ mask: _.mask,
3216
3747
  showMask: !0,
3217
3748
  replacement: { _: /\d/ },
3218
3749
  ref: n
@@ -3220,196 +3751,196 @@ const In = ye((e, n) => /* @__PURE__ */ a("input", { ref: n, ...e })), $n = ye(
3220
3751
  );
3221
3752
  }
3222
3753
  );
3223
- function os(e) {
3754
+ function Ia(e) {
3224
3755
  const {
3225
3756
  defaultCountry: n,
3226
3757
  label: s,
3227
3758
  className: t = "",
3228
3759
  disabled: o = !1,
3229
3760
  errorMessage: c,
3230
- isLoading: r = !1,
3231
- readOnly: i = !1,
3232
- size: l = "md",
3233
- defaultValue: d = "",
3234
- variant: u = "solid",
3235
- showAsterisk: _,
3761
+ isLoading: i = !1,
3762
+ readOnly: _ = !1,
3763
+ size: u = "md",
3764
+ defaultValue: r = "",
3765
+ variant: l = "solid",
3766
+ showAsterisk: d,
3236
3767
  name: m,
3237
- onChange: f,
3238
- searchCountryPlaceholder: g = "Pesquisar país",
3768
+ onChange: g,
3769
+ searchCountryPlaceholder: f = "Pesquisar país",
3239
3770
  notFoundCountryText: k = "Nenhum país encontrado",
3240
- id: h
3241
- } = e, v = xn(d), [x, p] = N(!1), [B, R] = N(""), [$, T] = N(!1), [L, E] = N(v.formattedNumber || ""), [C, b] = N(() => {
3771
+ id: y
3772
+ } = e, v = Un(r), [x, p] = F(!1), [N, z] = F(""), [$, S] = F(!1), [B, P] = F(v.formattedNumber || ""), [C, I] = F(() => {
3242
3773
  if (v.country) return v.country;
3243
- const F = _e.find((G) => G.iso === n);
3244
- return F || _e[30];
3245
- }), { fieldErrors: M } = te(), A = V(null), S = h || ne(), w = c || (M == null ? void 0 : M[m]), X = !!w, D = V(null);
3246
- function O() {
3247
- x || $ || (p(!0), D.current && D.current.focus());
3774
+ const A = _e.find((U) => U.iso === n);
3775
+ return A || _e[30];
3776
+ }), { fieldErrors: w } = J(), M = V(null), T = y || ce(), D = c || (w == null ? void 0 : w[m]), L = !!D, E = V(null);
3777
+ function R() {
3778
+ x || $ || (p(!0), E.current && E.current.focus());
3248
3779
  }
3249
- function J() {
3250
- T(!0), p(!0);
3780
+ function b() {
3781
+ S(!0), p(!0);
3251
3782
  }
3252
- function z() {
3253
- T(!1), p(!1);
3783
+ function H() {
3784
+ S(!1), p(!1);
3254
3785
  }
3255
- function j() {
3786
+ function Q() {
3256
3787
  p(!0);
3257
3788
  }
3258
- function H() {
3789
+ function W() {
3259
3790
  p(!1);
3260
3791
  }
3261
- function Z(F) {
3262
- return F.name.toLowerCase().includes(B.toLowerCase());
3792
+ function ee(A) {
3793
+ return A.name.toLowerCase().includes(N.toLowerCase());
3263
3794
  }
3264
- function U(F) {
3265
- return C.prefix ? F.replace(C.prefix, "").replaceAll(" ", "").replaceAll("-", "").replaceAll("(", "").replaceAll(")", "").trim() : F.replaceAll(" ", "").replaceAll("-", "").replaceAll("(", "").replaceAll(")", "").trim();
3795
+ function Z(A) {
3796
+ return C.prefix ? A.replace(C.prefix, "").replaceAll(" ", "").replaceAll("-", "").replaceAll("(", "").replaceAll(")", "").trim() : A.replaceAll(" ", "").replaceAll("-", "").replaceAll("(", "").replaceAll(")", "").trim();
3266
3797
  }
3267
- function q(F) {
3268
- let G = C.code;
3269
- return C.prefix && (G += `-${C.prefix}`), G += " ", G += U(F || L), G;
3798
+ function ae(A) {
3799
+ let U = C.code;
3800
+ return C.prefix && (U += `-${C.prefix}`), U += " ", U += Z(A || B), U;
3270
3801
  }
3271
- return /* @__PURE__ */ y(se, { children: [
3272
- s && /* @__PURE__ */ a(Y, { showAsterisk: _, children: s }),
3273
- /* @__PURE__ */ y(
3274
- Fn,
3802
+ return /* @__PURE__ */ h(q, { children: [
3803
+ s && /* @__PURE__ */ a(K, { showAsterisk: d, children: s }),
3804
+ /* @__PURE__ */ h(
3805
+ Vn,
3275
3806
  {
3276
- id: S,
3807
+ id: T,
3277
3808
  disabled: o,
3278
- isError: X,
3279
- isLoading: r,
3809
+ isError: L,
3810
+ isLoading: i,
3280
3811
  isFocused: x,
3281
- readOnly: i,
3282
- size: l,
3283
- variant: u,
3812
+ readOnly: _,
3813
+ size: u,
3814
+ variant: l,
3284
3815
  className: t,
3285
- onFocus: O,
3816
+ onFocus: R,
3286
3817
  children: [
3287
3818
  /* @__PURE__ */ a(
3288
- Mn,
3819
+ qn,
3289
3820
  {
3290
3821
  currentCountry: C,
3291
- onClick: J,
3292
- size: l
3822
+ onClick: b,
3823
+ size: u
3293
3824
  }
3294
3825
  ),
3295
- /* @__PURE__ */ y(
3296
- Sn,
3826
+ /* @__PURE__ */ h(
3827
+ jn,
3297
3828
  {
3298
3829
  isOpen: $,
3299
- search: B,
3300
- placeholder: g,
3301
- onSearch: R,
3830
+ search: N,
3831
+ placeholder: f,
3832
+ onSearch: z,
3302
3833
  children: [
3303
- _e.filter((F) => Z(F)).map((F) => /* @__PURE__ */ a(
3304
- Nn,
3834
+ _e.filter((A) => ee(A)).map((A) => /* @__PURE__ */ a(
3835
+ Wn,
3305
3836
  {
3306
- country: F,
3837
+ country: A,
3307
3838
  handleChangeValue: () => {
3308
- b(F), T(!1), E(F.mask);
3839
+ I(A), S(!1), P(A.mask);
3309
3840
  },
3310
- isActive: F.iso === C.iso,
3311
- size: l
3841
+ isActive: A.iso === C.iso,
3842
+ size: u
3312
3843
  },
3313
- F.iso
3844
+ A.iso
3314
3845
  )),
3315
- _e.filter((F) => Z(F)).length === 0 && /* @__PURE__ */ a("p", { children: k })
3846
+ _e.filter((A) => ee(A)).length === 0 && /* @__PURE__ */ a("p", { children: k })
3316
3847
  ]
3317
3848
  }
3318
3849
  ),
3319
3850
  /* @__PURE__ */ a(
3320
- bn,
3851
+ Kn,
3321
3852
  {
3322
3853
  isOpen: $,
3323
- onClick: z
3854
+ onClick: H
3324
3855
  }
3325
3856
  ),
3326
3857
  /* @__PURE__ */ a(
3327
- $n,
3858
+ Yn,
3328
3859
  {
3329
- ref: D,
3860
+ ref: E,
3330
3861
  currentCountry: C,
3331
- value: L,
3332
- onChange: (F) => {
3333
- E(F), f && f(q(F));
3862
+ value: B,
3863
+ onChange: (A) => {
3864
+ P(A), g && g(ae(A));
3334
3865
  },
3335
3866
  disabled: o,
3336
- onBlur: H,
3337
- onFocus: j,
3338
- size: l
3867
+ onBlur: W,
3868
+ onFocus: Q,
3869
+ size: u
3339
3870
  }
3340
3871
  ),
3341
3872
  /* @__PURE__ */ a(
3342
3873
  "input",
3343
3874
  {
3344
- ref: A,
3875
+ ref: M,
3345
3876
  type: "hidden",
3346
3877
  name: m,
3347
- value: q()
3878
+ value: ae()
3348
3879
  }
3349
3880
  )
3350
3881
  ]
3351
3882
  }
3352
3883
  ),
3353
- w && /* @__PURE__ */ a(ie, { children: w })
3884
+ D && /* @__PURE__ */ a(ne, { children: D })
3354
3885
  ] });
3355
3886
  }
3356
- const De = ce({});
3357
- function Tn(e) {
3887
+ const Ve = te({});
3888
+ function Xn(e) {
3358
3889
  const { children: n, size: s, isError: t, handleChange: o, value: c } = e;
3359
- return /* @__PURE__ */ a(De.Provider, { value: { handleChange: o, value: c, size: s, isError: t }, children: n });
3890
+ return /* @__PURE__ */ a(Ve.Provider, { value: { handleChange: o, value: c, size: s, isError: t }, children: n });
3360
3891
  }
3361
- function An() {
3362
- return re(De);
3892
+ function Jn() {
3893
+ return oe(Ve);
3363
3894
  }
3364
- function cs(e) {
3895
+ function Ma(e) {
3365
3896
  const {
3366
3897
  value: n,
3367
3898
  size: s,
3368
3899
  disabled: t,
3369
3900
  children: o,
3370
3901
  className: c = "",
3371
- ...r
3372
- } = e, { handleChange: i, size: l, value: d, isError: u } = An(), h = `arkynRadioBox ${s || l} ${d === n ? "checkedTrue" : "checkedFalse"} ${u ? "errorTrue" : "errorFalse"} ${t ? "disabledTrue" : "disabledFalse"} ${c}`;
3373
- return /* @__PURE__ */ y("label", { className: h.trim(), children: [
3902
+ ...i
3903
+ } = e, { handleChange: _, size: u, value: r, isError: l } = Jn(), y = `arkynRadioBox ${s || u} ${r === n ? "checkedTrue" : "checkedFalse"} ${l ? "errorTrue" : "errorFalse"} ${t ? "disabledTrue" : "disabledFalse"} ${c}`;
3904
+ return /* @__PURE__ */ h("label", { className: y.trim(), children: [
3374
3905
  /* @__PURE__ */ a(
3375
3906
  "button",
3376
3907
  {
3377
3908
  type: "button",
3378
3909
  disabled: t,
3379
- onClick: () => i(n),
3380
- onFocus: () => i(n),
3381
- ...r
3910
+ onClick: () => _(n),
3911
+ onFocus: () => _(n),
3912
+ ...i
3382
3913
  }
3383
3914
  ),
3384
3915
  o
3385
3916
  ] });
3386
3917
  }
3387
- function rs(e) {
3918
+ function Ta(e) {
3388
3919
  const {
3389
3920
  defaultValue: n = "",
3390
3921
  name: s,
3391
3922
  label: t,
3392
3923
  showAsterisk: o,
3393
3924
  errorMessage: c,
3394
- value: r,
3395
- onChange: i,
3396
- size: l = "md",
3397
- className: d = "",
3398
- ...u
3399
- } = e, [_, m] = N(n), { fieldErrors: f } = te();
3400
- function g(x) {
3401
- m(x), i && i(x);
3402
- }
3403
- const k = c || (f == null ? void 0 : f[s]), h = !!k, v = `arkynRadioGroup ${l} ${d}`;
3404
- return /* @__PURE__ */ y(se, { children: [
3405
- t && /* @__PURE__ */ a(Y, { showAsterisk: o, children: t }),
3406
- /* @__PURE__ */ y(
3407
- Tn,
3925
+ value: i,
3926
+ onChange: _,
3927
+ size: u = "md",
3928
+ className: r = "",
3929
+ ...l
3930
+ } = e, [d, m] = F(n), { fieldErrors: g } = J();
3931
+ function f(x) {
3932
+ m(x), _ && _(x);
3933
+ }
3934
+ const k = c || (g == null ? void 0 : g[s]), y = !!k, v = `arkynRadioGroup ${u} ${r}`;
3935
+ return /* @__PURE__ */ h(q, { children: [
3936
+ t && /* @__PURE__ */ a(K, { showAsterisk: o, children: t }),
3937
+ /* @__PURE__ */ h(
3938
+ Xn,
3408
3939
  {
3409
- isError: h,
3410
- size: l,
3411
- value: r || _,
3412
- handleChange: g,
3940
+ isError: y,
3941
+ size: u,
3942
+ value: i || d,
3943
+ handleChange: f,
3413
3944
  children: [
3414
3945
  /* @__PURE__ */ a(
3415
3946
  "input",
@@ -3418,250 +3949,345 @@ function rs(e) {
3418
3949
  type: "text",
3419
3950
  readOnly: !0,
3420
3951
  name: s,
3421
- value: r || _
3952
+ value: i || d
3422
3953
  }
3423
3954
  ),
3424
- /* @__PURE__ */ a("div", { className: v.trim(), ...u })
3955
+ /* @__PURE__ */ a("div", { className: v.trim(), ...l })
3425
3956
  ]
3426
3957
  }
3427
3958
  ),
3428
- k && /* @__PURE__ */ a(ie, { children: k })
3959
+ k && /* @__PURE__ */ a(ne, { children: k })
3429
3960
  ] });
3430
3961
  }
3431
- function is(e) {
3962
+ function wa(e) {
3432
3963
  const {
3433
3964
  label: n,
3434
3965
  size: s = "lg",
3435
3966
  defaultChecked: t = !1,
3436
3967
  checked: o = null,
3437
3968
  value: c,
3438
- unCheckedValue: r = "",
3439
- name: i,
3440
- className: l = "",
3441
- onCheck: d,
3442
- id: u,
3443
- ..._
3444
- } = e, m = V(null), f = u || ne(), [g, k] = N(t), h = typeof o == "boolean" ? o : g;
3969
+ unCheckedValue: i = "",
3970
+ name: _,
3971
+ className: u = "",
3972
+ onCheck: r,
3973
+ id: l,
3974
+ ...d
3975
+ } = e, m = V(null), g = l || ce(), [f, k] = F(t), y = typeof o == "boolean" ? o : f;
3445
3976
  function v() {
3446
- k(!g), d && d(h ? r : c || "checked");
3977
+ k(!f), r && r(y ? i : c || "checked");
3447
3978
  }
3448
- const p = `arkynSwitch ${h ? "checkedTrue" : "checkedFalse"} ${s} ${l}`;
3449
- return /* @__PURE__ */ y(se, { children: [
3450
- n && /* @__PURE__ */ a(Y, { children: n }),
3979
+ const p = `arkynSwitch ${y ? "checkedTrue" : "checkedFalse"} ${s} ${u}`;
3980
+ return /* @__PURE__ */ h(q, { children: [
3981
+ n && /* @__PURE__ */ a(K, { children: n }),
3451
3982
  /* @__PURE__ */ a(
3452
3983
  "button",
3453
3984
  {
3454
3985
  type: "button",
3455
3986
  onClick: v,
3456
3987
  className: p,
3457
- ..._,
3988
+ ...d,
3458
3989
  children: /* @__PURE__ */ a(
3459
3990
  "input",
3460
3991
  {
3461
- id: f,
3992
+ id: g,
3462
3993
  type: "hidden",
3463
- name: i,
3994
+ name: _,
3464
3995
  ref: m,
3465
3996
  onClick: v,
3466
- value: h ? c || "checked" : r
3997
+ value: y ? c || "checked" : i
3467
3998
  }
3468
3999
  )
3469
4000
  }
3470
4001
  )
3471
4002
  ] });
3472
4003
  }
3473
- const Oe = ce({});
3474
- function wn() {
3475
- return re(Oe);
4004
+ const Ke = te({});
4005
+ function Qn() {
4006
+ return oe(Ke);
3476
4007
  }
3477
- function Pn(e) {
3478
- return /* @__PURE__ */ a(Oe.Provider, { value: e, children: e.children });
4008
+ function ea(e) {
4009
+ return /* @__PURE__ */ a(Ke.Provider, { value: e, children: e.children });
3479
4010
  }
3480
- function ls(e) {
4011
+ function $a(e) {
3481
4012
  const {
3482
4013
  children: n,
3483
4014
  disabled: s = !1,
3484
4015
  className: t = "",
3485
4016
  onClick: o,
3486
4017
  value: c,
3487
- ...r
3488
- } = e, { disabled: i, currentTab: l, changeCurrentTab: d } = wn(), u = i || s, f = `arkynTabButton ${u ? "isDisabled" : ""} ${l === c && c ? "isActive" : ""} ${t}`;
3489
- function g(k) {
3490
- d(c), o && o(k);
4018
+ ...i
4019
+ } = e, { disabled: _, currentTab: u, changeCurrentTab: r } = Qn(), l = _ || s, g = `arkynTabButton ${l ? "isDisabled" : ""} ${u === c && c ? "isActive" : ""} ${t}`;
4020
+ function f(k) {
4021
+ r(c), o && o(k);
3491
4022
  }
3492
4023
  return /* @__PURE__ */ a(
3493
4024
  "button",
3494
4025
  {
3495
- onClick: g,
3496
- className: f.trim(),
3497
- ...r,
3498
- disabled: u,
4026
+ onClick: f,
4027
+ className: g.trim(),
4028
+ ...i,
4029
+ disabled: l,
3499
4030
  type: "button",
3500
4031
  children: n
3501
4032
  }
3502
4033
  );
3503
4034
  }
3504
- function _s(e) {
4035
+ function Aa(e) {
3505
4036
  const {
3506
4037
  children: n,
3507
4038
  onChange: s,
3508
4039
  defaultValue: t,
3509
4040
  disabled: o = !1,
3510
4041
  className: c,
3511
- ...r
3512
- } = e, [i, l] = N(t || ""), d = `arkynTabContainer ${c || ""}`;
3513
- function u(_) {
3514
- l(_), s && s(_);
4042
+ ...i
4043
+ } = e, [_, u] = F(t || ""), r = `arkynTabContainer ${c || ""}`;
4044
+ function l(d) {
4045
+ u(d), s && s(d);
3515
4046
  }
3516
4047
  return /* @__PURE__ */ a(
3517
- Pn,
4048
+ ea,
3518
4049
  {
3519
4050
  disabled: o,
3520
- currentTab: i,
3521
- changeCurrentTab: u,
3522
- children: /* @__PURE__ */ a("nav", { className: d.trim(), ...r, children: n })
4051
+ currentTab: _,
4052
+ changeCurrentTab: l,
4053
+ children: /* @__PURE__ */ a("nav", { className: r.trim(), ...i, children: n })
3523
4054
  }
3524
4055
  );
3525
4056
  }
3526
- function us(e) {
4057
+ function Pa(e) {
4058
+ const {
4059
+ emptyMessage: n = "Nenhum dado adicionado.",
4060
+ className: s,
4061
+ children: t,
4062
+ ...o
4063
+ } = e, c = `arkynTableBody ${s}`, i = Ye.count(t) === 0;
4064
+ return /* @__PURE__ */ a("tbody", { className: c.trim(), ...o, children: i ? /* @__PURE__ */ a("tr", { className: "arkynTableBodyEmptyLine", children: /* @__PURE__ */ a("td", { colSpan: 100, children: /* @__PURE__ */ a("div", { children: n }) }) }) : t });
4065
+ }
4066
+ function Ea(e) {
4067
+ const { className: n, children: s, ...t } = e, o = `arkynTableCaption ${n}`;
4068
+ return /* @__PURE__ */ a("caption", { className: o.trim(), ...t, children: /* @__PURE__ */ a("div", { className: "arkynTableCaptionContent", children: s }) });
4069
+ }
4070
+ function Ba(e) {
4071
+ const { children: n, className: s, ...t } = e, o = `arkynTableContainer ${s}`;
4072
+ return /* @__PURE__ */ a("div", { className: o.trim(), ...t, children: /* @__PURE__ */ a("table", { children: n }) });
4073
+ }
4074
+ function Da(e) {
4075
+ const { className: n, children: s, ...t } = e, o = `arkynTableFooter ${n}`;
4076
+ return /* @__PURE__ */ h("tfoot", { className: o.trim(), ...t, children: [
4077
+ /* @__PURE__ */ a("tr", { className: "spacingRow" }),
4078
+ /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("th", { colSpan: 100, children: /* @__PURE__ */ a("div", { className: "arkynTableFooterContent", children: s }) }) })
4079
+ ] });
4080
+ }
4081
+ function La(e) {
4082
+ const { className: n, children: s, ...t } = e, o = `arkynTableHeader ${n}`;
4083
+ return /* @__PURE__ */ h("thead", { className: o.trim(), ...t, children: [
4084
+ /* @__PURE__ */ a("tr", { children: s }),
4085
+ /* @__PURE__ */ a("tr", { className: "spacingRow" })
4086
+ ] });
4087
+ }
4088
+ function za(e) {
3527
4089
  const {
3528
4090
  variant: n = "solid",
3529
4091
  size: s = "md",
3530
4092
  className: t,
3531
4093
  errorMessage: o,
3532
4094
  disabled: c = !1,
3533
- readOnly: r = !1,
3534
- label: i,
3535
- showAsterisk: l,
3536
- name: d,
3537
- onFocus: u,
3538
- onBlur: _,
4095
+ readOnly: i = !1,
4096
+ label: _,
4097
+ showAsterisk: u,
4098
+ name: r,
4099
+ onFocus: l,
4100
+ onBlur: d,
3539
4101
  title: m,
3540
- style: f,
3541
- id: g,
4102
+ style: g,
4103
+ id: f,
3542
4104
  ...k
3543
- } = e, { fieldErrors: h } = te(), [v, x] = N(!1), p = V(null), B = g || ne(), R = o || (h == null ? void 0 : h[d]), C = `arkynTextarea ${n} ${s} ${c || r ? "opacityTrue" : "opacityFalse"} ${!!R ? "errorTrue" : "errorFalse"} ${v ? "focusedTrue" : "focusedFalse"} ${t}`;
3544
- function b() {
4105
+ } = e, { fieldErrors: y } = J(), [v, x] = F(!1), p = V(null), N = f || ce(), z = o || (y == null ? void 0 : y[r]), C = `arkynTextarea ${n} ${s} ${c || i ? "opacityTrue" : "opacityFalse"} ${!!z ? "errorTrue" : "errorFalse"} ${v ? "focusedTrue" : "focusedFalse"} ${t}`;
4106
+ function I() {
3545
4107
  c || !(p != null && p.current) || (x(!0), p.current.focus());
3546
4108
  }
3547
- function M(S) {
3548
- x(!0), u && u(S);
4109
+ function w(T) {
4110
+ x(!0), l && l(T);
3549
4111
  }
3550
- function A(S) {
3551
- x(!1), _ && _(S);
4112
+ function M(T) {
4113
+ x(!1), d && d(T);
3552
4114
  }
3553
- return /* @__PURE__ */ y(se, { children: [
3554
- i && /* @__PURE__ */ a(Y, { showAsterisk: l, children: i }),
4115
+ return /* @__PURE__ */ h(q, { children: [
4116
+ _ && /* @__PURE__ */ a(K, { showAsterisk: u, children: _ }),
3555
4117
  /* @__PURE__ */ a(
3556
4118
  "section",
3557
4119
  {
3558
4120
  title: m,
3559
- style: f,
3560
- onClick: b,
4121
+ style: g,
4122
+ onClick: I,
3561
4123
  className: C,
3562
4124
  children: /* @__PURE__ */ a(
3563
4125
  "textarea",
3564
4126
  {
3565
- id: B,
4127
+ id: N,
3566
4128
  disabled: c,
3567
- readOnly: r,
4129
+ readOnly: i,
3568
4130
  ref: p,
3569
- onFocus: M,
3570
- onBlur: A,
4131
+ onFocus: w,
4132
+ onBlur: M,
3571
4133
  ...k
3572
4134
  }
3573
4135
  )
3574
4136
  }
3575
4137
  ),
3576
- R && /* @__PURE__ */ a(Y, { children: R })
4138
+ z && /* @__PURE__ */ a(K, { children: z })
3577
4139
  ] });
3578
4140
  }
3579
- function ds(e) {
3580
- const {
3581
- text: n,
3582
- size: s = "lg",
3583
- children: t,
3584
- orientation: o = "top",
3585
- className: c = "",
3586
- ...r
3587
- } = e, i = ne(), l = V(null), [d, u] = N(o);
3588
- ae(() => {
3589
- const m = () => {
3590
- if (!l.current) return;
3591
- const k = document.getElementById(i);
3592
- k && (u(o), requestAnimationFrame(() => {
3593
- const h = k.getBoundingClientRect(), v = window.innerWidth, x = window.innerHeight;
3594
- let p = o;
3595
- o === "left" && h.left < 0 ? p = "right" : o === "right" && h.right > v ? p = "left" : o === "top" && h.top < 0 ? p = "bottom" : o === "bottom" && h.bottom > x && (p = "top"), p === "right" && h.right > v ? p = "left" : p === "left" && h.left < 0 ? p = "right" : p === "bottom" && h.bottom > x ? p = "top" : p === "top" && h.top < 0 && (p = "bottom"), u(p);
3596
- }));
3597
- }, f = l.current;
3598
- if (!f) return;
3599
- const g = () => {
3600
- setTimeout(m, 1);
3601
- };
3602
- return f.addEventListener("mouseenter", g), window.addEventListener("resize", m), () => {
3603
- f.removeEventListener("mouseenter", g), window.removeEventListener("resize", m);
3604
- };
3605
- }, [o, i]);
3606
- const _ = `arkynTooltip ${s} ${d} ${c}`;
3607
- return /* @__PURE__ */ y("div", { className: _.trim(), ...r, ref: l, children: [
3608
- t,
3609
- /* @__PURE__ */ a("div", { className: "arkynTooltipText", id: i, children: n })
3610
- ] });
4141
+ const We = te({});
4142
+ function Oa(e) {
4143
+ const { children: n = !1 } = e, [s, t] = F([]);
4144
+ function o(u) {
4145
+ return !!s.some((r) => r.key === u);
4146
+ }
4147
+ function c(u) {
4148
+ var r;
4149
+ return (r = s.find((l) => l.key === u)) == null ? void 0 : r.data;
4150
+ }
4151
+ function i(u, r) {
4152
+ const l = o(u);
4153
+ t(l ? (d) => [...d.filter((g) => g.key !== u), { key: u, data: r }] : [...s, { key: u, data: r }]);
4154
+ }
4155
+ function _(u) {
4156
+ t(s.filter((r) => r.key !== u));
4157
+ }
4158
+ return /* @__PURE__ */ a(
4159
+ We.Provider,
4160
+ {
4161
+ value: { drawerIsOpen: o, drawerData: c, openDrawer: i, closeDrawer: _ },
4162
+ children: n
4163
+ }
4164
+ );
4165
+ }
4166
+ function Ra(e) {
4167
+ const n = oe(We);
4168
+ if (Object.entries(n).length === 0)
4169
+ throw new Error("useDrawer must be used within a Provider");
4170
+ if (e) {
4171
+ const {
4172
+ drawerData: s,
4173
+ drawerIsOpen: t,
4174
+ openDrawer: o,
4175
+ closeDrawer: c
4176
+ } = n, i = t(e), _ = s(e);
4177
+ return { drawerIsOpen: i, drawerData: _, openDrawer: (l) => o(e, l), closeDrawer: () => c(e) };
4178
+ } else
4179
+ return n;
4180
+ }
4181
+ const je = te({});
4182
+ function Ga(e) {
4183
+ const { children: n = !1 } = e, [s, t] = F([]);
4184
+ function o(r) {
4185
+ return !!s.some((l) => l.key === r);
4186
+ }
4187
+ function c(r) {
4188
+ var l;
4189
+ return (l = s.find((d) => d.key === r)) == null ? void 0 : l.data;
4190
+ }
4191
+ function i(r, l) {
4192
+ const d = o(r);
4193
+ t(d ? (m) => [...m.filter((f) => f.key !== r), { key: r, data: l }] : [...s, { key: r, data: l }]);
4194
+ }
4195
+ function _(r) {
4196
+ t(s.filter((l) => l.key !== r));
4197
+ }
4198
+ function u() {
4199
+ t([]);
4200
+ }
4201
+ return /* @__PURE__ */ a(
4202
+ je.Provider,
4203
+ {
4204
+ value: { modalIsOpen: o, modalData: c, openModal: i, closeModal: _, closeAll: u },
4205
+ children: n
4206
+ }
4207
+ );
4208
+ }
4209
+ function Ha(e) {
4210
+ const n = oe(je);
4211
+ if (Object.entries(n).length === 0)
4212
+ throw new Error("useModal must be used within a Provider");
4213
+ if (e) {
4214
+ const {
4215
+ modalData: s,
4216
+ modalIsOpen: t,
4217
+ openModal: o,
4218
+ closeModal: c
4219
+ } = n, i = t(e), _ = s(e);
4220
+ return { modalIsOpen: i, modalData: _, openModal: (l) => o(e, l), closeModal: () => c(e) };
4221
+ } else
4222
+ return n;
3611
4223
  }
3612
- function ms(e, n = "") {
4224
+ function Ua(e, n = "") {
3613
4225
  const s = new URLSearchParams(e), t = n ? `${n}:` : "", o = (c) => {
3614
- Object.entries(c).forEach(([r, i]) => {
3615
- i === void 0 ? s.delete(`${t}${r}`) : s.set(`${t}${r}`, String(i));
4226
+ Object.entries(c).forEach(([i, _]) => {
4227
+ _ === void 0 ? s.delete(`${t}${i}`) : s.set(`${t}${i}`, String(_));
3616
4228
  });
3617
4229
  };
3618
4230
  return {
3619
4231
  getParam: (c) => s.get(`${t}${c}`),
3620
4232
  getScopedSearch: (c) => {
3621
4233
  o(c);
3622
- let r = s.toString();
3623
- return r && (r = "?" + r), r;
4234
+ let i = s.toString();
4235
+ return i && (i = "?" + i), i;
3624
4236
  }
3625
4237
  };
3626
4238
  }
3627
4239
  export {
3628
- Dn as AlertContainer,
3629
- On as AlertContent,
3630
- Gn as AlertDescription,
3631
- Vn as AlertIcon,
3632
- Ye as AlertTitle,
3633
- Hn as AudioPlayer,
3634
- Kn as Badge,
3635
- Un as Button,
3636
- Wn as CardTabButton,
3637
- jn as CardTabContainer,
3638
- Yn as Checkbox,
3639
- Xn as CurrencyInput,
3640
- tn as Divider,
3641
- Jn as DrawerContainer,
3642
- qn as DrawerHeader,
3643
- ie as FieldError,
3644
- Y as FieldLabel,
3645
- se as FieldWrapper,
3646
- Zn as FormProvider,
3647
- Qn as IconButton,
3648
- rn as Input,
3649
- es as MaskedInput,
3650
- ns as ModalContainer,
3651
- ss as ModalFooter,
3652
- as as ModalHeader,
3653
- ts as MultiSelect,
3654
- os as PhoneInput,
3655
- cs as RadioBox,
3656
- rs as RadioGroup,
3657
- qe as Slider,
3658
- is as Switch,
3659
- ls as TabButton,
3660
- _s as TabContainer,
3661
- us as Textarea,
3662
- ds as Tooltip,
3663
- te as useForm,
3664
- ms as useScopedParams,
3665
- fe as useScrollLock,
3666
- Je as useSlider
4240
+ ca as AlertContainer,
4241
+ ra as AlertContent,
4242
+ ia as AlertDescription,
4243
+ la as AlertIcon,
4244
+ ln as AlertTitle,
4245
+ mn as AudioPlayer,
4246
+ ua as AudioUpload,
4247
+ da as Badge,
4248
+ ue as Button,
4249
+ ma as CardTabButton,
4250
+ fa as CardTabContainer,
4251
+ ga as Checkbox,
4252
+ ka as ClientOnly,
4253
+ ha as CurrencyInput,
4254
+ Ne as Divider,
4255
+ pa as DrawerContainer,
4256
+ Ca as DrawerHeader,
4257
+ Oa as DrawerProvider,
4258
+ ne as FieldError,
4259
+ K as FieldLabel,
4260
+ q as FieldWrapper,
4261
+ ya as FileUpload,
4262
+ _a as FormProvider,
4263
+ Se as IconButton,
4264
+ va as ImageUpload,
4265
+ Tn as Input,
4266
+ Fa as MaskedInput,
4267
+ xa as ModalContainer,
4268
+ ba as ModalFooter,
4269
+ Na as ModalHeader,
4270
+ Ga as ModalProvider,
4271
+ Sa as MultiSelect,
4272
+ Ia as PhoneInput,
4273
+ Ma as RadioBox,
4274
+ Ta as RadioGroup,
4275
+ dn as Slider,
4276
+ wa as Switch,
4277
+ $a as TabButton,
4278
+ Aa as TabContainer,
4279
+ Pa as TableBody,
4280
+ Ea as TableCaption,
4281
+ Ba as TableContainer,
4282
+ Da as TableFooter,
4283
+ La as TableHeader,
4284
+ za as Textarea,
4285
+ Ie as Tooltip,
4286
+ Ra as useDrawer,
4287
+ J as useForm,
4288
+ Cn as useHydrated,
4289
+ Ha as useModal,
4290
+ Ua as useScopedParams,
4291
+ ke as useScrollLock,
4292
+ un as useSlider
3667
4293
  };