@formatica/vue 0.1.2 → 0.2.1

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 (95) hide show
  1. package/dist/components/BaseField.d.ts +28 -0
  2. package/dist/components/BaseField.d.ts.map +1 -0
  3. package/dist/components/FormBuilder.d.ts +25 -0
  4. package/dist/components/FormBuilder.d.ts.map +1 -0
  5. package/dist/components/FormField.d.ts +6 -0
  6. package/dist/components/FormField.d.ts.map +1 -0
  7. package/dist/components/inputs/CheckboxGroupInput.d.ts +21 -0
  8. package/dist/components/inputs/CheckboxGroupInput.d.ts.map +1 -0
  9. package/dist/components/inputs/CheckboxInput.d.ts +16 -0
  10. package/dist/components/inputs/CheckboxInput.d.ts.map +1 -0
  11. package/dist/components/inputs/DateInput.d.ts +22 -0
  12. package/dist/components/inputs/DateInput.d.ts.map +1 -0
  13. package/dist/components/inputs/FileInput.d.ts +22 -0
  14. package/dist/components/inputs/FileInput.d.ts.map +1 -0
  15. package/dist/components/inputs/NumberInput.d.ts +26 -0
  16. package/dist/components/inputs/NumberInput.d.ts.map +1 -0
  17. package/dist/components/inputs/PhoneInput.d.ts +23 -0
  18. package/dist/components/inputs/PhoneInput.d.ts.map +1 -0
  19. package/dist/components/inputs/RadioInput.d.ts +19 -0
  20. package/dist/components/inputs/RadioInput.d.ts.map +1 -0
  21. package/dist/components/inputs/SelectInput.d.ts +29 -0
  22. package/dist/components/inputs/SelectInput.d.ts.map +1 -0
  23. package/dist/components/inputs/SliderInput.d.ts +23 -0
  24. package/dist/components/inputs/SliderInput.d.ts.map +1 -0
  25. package/dist/components/inputs/SwitchInput.d.ts +17 -0
  26. package/dist/components/inputs/SwitchInput.d.ts.map +1 -0
  27. package/dist/components/inputs/TagsInput.d.ts +24 -0
  28. package/dist/components/inputs/TagsInput.d.ts.map +1 -0
  29. package/dist/components/inputs/TextInput.d.ts +27 -0
  30. package/dist/components/inputs/TextInput.d.ts.map +1 -0
  31. package/dist/components/inputs/TextareaInput.d.ts +28 -0
  32. package/dist/components/inputs/TextareaInput.d.ts.map +1 -0
  33. package/dist/components/layout/FormDivider.d.ts +7 -0
  34. package/dist/components/layout/FormDivider.d.ts.map +1 -0
  35. package/dist/components/layout/FormGroup.d.ts +15 -0
  36. package/dist/components/layout/FormGroup.d.ts.map +1 -0
  37. package/dist/components/layout/FormHtml.d.ts +7 -0
  38. package/dist/components/layout/FormHtml.d.ts.map +1 -0
  39. package/dist/components/layout/FormRow.d.ts +12 -0
  40. package/dist/components/layout/FormRow.d.ts.map +1 -0
  41. package/dist/components/layout/FormSteps.d.ts +11 -0
  42. package/dist/components/layout/FormSteps.d.ts.map +1 -0
  43. package/dist/components/layout/FormTabs.d.ts +8 -0
  44. package/dist/components/layout/FormTabs.d.ts.map +1 -0
  45. package/dist/components/layout/LayoutRenderer.d.ts +8 -0
  46. package/dist/components/layout/LayoutRenderer.d.ts.map +1 -0
  47. package/dist/core/eventBus.d.ts +9 -0
  48. package/dist/core/eventBus.d.ts.map +1 -0
  49. package/dist/core/fieldRegistry.d.ts +24 -0
  50. package/dist/core/fieldRegistry.d.ts.map +1 -0
  51. package/dist/core/ruleRegistry.d.ts +2 -0
  52. package/dist/core/ruleRegistry.d.ts.map +1 -0
  53. package/dist/core/schemaParser.d.ts +4 -0
  54. package/dist/core/schemaParser.d.ts.map +1 -0
  55. package/dist/core/useConditions.d.ts +2 -0
  56. package/dist/core/useConditions.d.ts.map +1 -0
  57. package/dist/core/useForm.d.ts +10 -0
  58. package/dist/core/useForm.d.ts.map +1 -0
  59. package/dist/core/useFormI18n.d.ts +22 -0
  60. package/dist/core/useFormI18n.d.ts.map +1 -0
  61. package/dist/core/useTheme.d.ts +28 -0
  62. package/dist/core/useTheme.d.ts.map +1 -0
  63. package/dist/core/useValidation.d.ts +17 -0
  64. package/dist/core/useValidation.d.ts.map +1 -0
  65. package/dist/formatica.es.js +974 -966
  66. package/dist/formatica.es.js.map +1 -1
  67. package/dist/formatica.umd.cjs +1 -1
  68. package/dist/formatica.umd.cjs.map +1 -1
  69. package/dist/index.d.ts +12 -0
  70. package/dist/index.d.ts.map +1 -0
  71. package/dist/plugin.d.ts +11 -0
  72. package/dist/plugin.d.ts.map +1 -0
  73. package/dist/types/form.d.ts +92 -0
  74. package/dist/types/form.d.ts.map +1 -0
  75. package/dist/types/i18n.d.ts +18 -0
  76. package/dist/types/i18n.d.ts.map +1 -0
  77. package/dist/types/index.d.ts +7 -0
  78. package/dist/types/index.d.ts.map +1 -0
  79. package/dist/types/layout.d.ts +76 -0
  80. package/dist/types/layout.d.ts.map +1 -0
  81. package/dist/types/schema.d.ts +251 -0
  82. package/dist/types/schema.d.ts.map +1 -0
  83. package/dist/types/theme.d.ts +69 -0
  84. package/dist/types/theme.d.ts.map +1 -0
  85. package/dist/types/validation.d.ts +26 -0
  86. package/dist/types/validation.d.ts.map +1 -0
  87. package/dist/utils/deepMerge.d.ts +2 -0
  88. package/dist/utils/deepMerge.d.ts.map +1 -0
  89. package/dist/utils/extractFields.d.ts +2 -0
  90. package/dist/utils/extractFields.d.ts.map +1 -0
  91. package/dist/utils/sanitize.d.ts +2 -0
  92. package/dist/utils/sanitize.d.ts.map +1 -0
  93. package/dist/utils/titleCase.d.ts +2 -0
  94. package/dist/utils/titleCase.d.ts.map +1 -0
  95. package/package.json +4 -2
@@ -1,40 +1,50 @@
1
- import { titleCase as Fe, evaluateCondition as se, getRule as Te, extractFields as P, sanitizeHtml as Ie, isFieldNode as Ce } from "@formatica/core";
1
+ import { titleCase as Ie, evaluateCondition as se, getRule as Le, extractFields as P, sanitizeHtml as Ae, isFieldNode as Ce } from "@formatica/core";
2
2
  export * from "@formatica/core";
3
- import { inject as J, provide as ie, ref as D, reactive as re, computed as h, watch as Y, isRef as Le, defineComponent as j, openBlock as c, createElementBlock as f, normalizeClass as S, Fragment as z, renderList as G, createElementVNode as p, normalizeStyle as O, createCommentVNode as T, toDisplayString as L, withKeys as he, withModifiers as q, createTextVNode as _, onMounted as ue, withDirectives as de, vModelText as ve, nextTick as te, onBeforeUnmount as Ve, unref as H, createVNode as Z, Transition as ae, withCtx as W, renderSlot as Ae, TransitionGroup as Ne, createBlock as U, resolveDynamicComponent as Se, mergeProps as De, vShow as Me, resolveComponent as Ee, toRef as Re } from "vue";
4
- import { getCountries as xe, getCountryCallingCode as ke, parsePhoneNumber as je, AsYouType as Oe } from "libphonenumber-js";
5
- const Be = Symbol("FormaticaComponents"), le = /* @__PURE__ */ new Map();
6
- function ze(e, i) {
7
- le.set(e, i);
3
+ import { reactive as te, inject as q, provide as ie, ref as D, computed as x, watch as J, isRef as Ne, defineComponent as j, openBlock as c, createElementBlock as f, normalizeClass as F, Fragment as O, renderList as G, createElementVNode as p, normalizeStyle as z, createCommentVNode as T, toDisplayString as L, withKeys as he, withModifiers as Y, createTextVNode as _, onMounted as ue, withDirectives as de, vModelText as ve, nextTick as ae, onBeforeUnmount as Ve, unref as H, createVNode as Z, Transition as le, withCtx as W, renderSlot as De, TransitionGroup as Me, createBlock as U, resolveDynamicComponent as Se, mergeProps as Ee, vShow as Re, resolveComponent as je } from "vue";
4
+ import { getCountries as xe, getCountryCallingCode as ke, parsePhoneNumber as ze, AsYouType as Oe } from "libphonenumber-js";
5
+ const Be = Symbol("FormaticaComponents"), ne = /* @__PURE__ */ new Map();
6
+ function Fe(e, u) {
7
+ ne.set(e, u);
8
8
  }
9
9
  function Bl(e) {
10
- le.delete(e);
10
+ ne.delete(e);
11
11
  }
12
12
  function Ke(e) {
13
- return le.get(e);
13
+ return ne.get(e);
14
14
  }
15
15
  function Pe(e) {
16
- return le.has(e);
16
+ return ne.has(e);
17
17
  }
18
18
  function Fl() {
19
- return Array.from(le.keys());
19
+ return Array.from(ne.keys());
20
+ }
21
+ const Te = Symbol("Formatica");
22
+ function Tl(e = {}) {
23
+ return {
24
+ install(u) {
25
+ if (u.provide(Te, te(e)), e.components)
26
+ for (const [t, a] of Object.entries(e.components))
27
+ Fe(t, a);
28
+ }
29
+ };
20
30
  }
21
31
  function Ue() {
22
32
  const e = /* @__PURE__ */ new Map();
23
- function i(a, r) {
33
+ function u(a, s) {
24
34
  e.has(a) || e.set(a, /* @__PURE__ */ new Set());
25
- const u = e.get(a);
26
- return u ? (u.add(r), () => {
27
- u.delete(r);
35
+ const o = e.get(a);
36
+ return o ? (o.add(s), () => {
37
+ o.delete(s);
28
38
  }) : () => {
29
39
  };
30
40
  }
31
- function t(a, r) {
32
- const u = e.get(a);
33
- if (u)
34
- for (const d of u)
35
- d(r);
41
+ function t(a, s) {
42
+ const o = e.get(a);
43
+ if (o)
44
+ for (const d of o)
45
+ d(s);
36
46
  }
37
- return { on: i, emit: t };
47
+ return { on: u, emit: t };
38
48
  }
39
49
  const ye = Symbol("FormaticaI18n"), He = {
40
50
  required: "This field is required",
@@ -55,174 +65,174 @@ const ye = Symbol("FormaticaI18n"), He = {
55
65
  };
56
66
  function Ge(e) {
57
67
  const {
58
- locale: i,
68
+ locale: u,
59
69
  fallbackLocale: t = "en",
60
70
  fieldTranslations: a = {},
61
- formTranslations: r = {}
71
+ formTranslations: s = {}
62
72
  } = e;
63
- function u(o, s) {
64
- const g = a[o];
65
- if (g) {
66
- const $ = g[i.value];
67
- if ($) {
68
- const b = $[s];
69
- if (typeof b == "string") return b;
73
+ function o(r, i) {
74
+ const k = a[r];
75
+ if (k) {
76
+ const g = k[u.value];
77
+ if (g) {
78
+ const m = g[i];
79
+ if (typeof m == "string") return m;
70
80
  }
71
- const V = g[t];
72
- if (V) {
73
- const b = V[s];
74
- if (typeof b == "string") return b;
81
+ const $ = k[t];
82
+ if ($) {
83
+ const m = $[i];
84
+ if (typeof m == "string") return m;
75
85
  }
76
86
  }
77
- return s === "label" ? Fe(o) : "";
87
+ return i === "label" ? Ie(r) : "";
78
88
  }
79
- function d(o, s) {
80
- var $, V;
81
- const g = a[o];
82
- if (g) {
83
- const b = g[i.value];
84
- if (($ = b == null ? void 0 : b.options) != null && $[s]) return b.options[s];
85
- const v = g[t];
86
- if ((V = v == null ? void 0 : v.options) != null && V[s]) return v.options[s];
87
- }
88
- return s;
89
+ function d(r, i) {
90
+ var g, $;
91
+ const k = a[r];
92
+ if (k) {
93
+ const m = k[u.value];
94
+ if ((g = m == null ? void 0 : m.options) != null && g[i]) return m.options[i];
95
+ const C = k[t];
96
+ if (($ = C == null ? void 0 : C.options) != null && $[i]) return C.options[i];
97
+ }
98
+ return i;
89
99
  }
90
- function l(o, s) {
91
- var b, v;
92
- const g = (b = r[i.value]) == null ? void 0 : b.messages;
93
- if (g != null && g[o])
94
- return fe(g[o], s ?? {});
95
- const $ = (v = r[t]) == null ? void 0 : v.messages;
96
- if ($ != null && $[o])
97
- return fe($[o], s ?? {});
98
- const V = He[o];
99
- return V ? fe(V, s ?? {}) : `Validation failed: ${o}`;
100
+ function l(r, i) {
101
+ var m, C;
102
+ const k = (m = s[u.value]) == null ? void 0 : m.messages;
103
+ if (k != null && k[r])
104
+ return fe(k[r], i ?? {});
105
+ const g = (C = s[t]) == null ? void 0 : C.messages;
106
+ if (g != null && g[r])
107
+ return fe(g[r], i ?? {});
108
+ const $ = He[r];
109
+ return $ ? fe($, i ?? {}) : `Validation failed: ${r}`;
100
110
  }
101
111
  const n = {
102
- locale: i,
112
+ locale: u,
103
113
  fallbackLocale: t,
104
- t: u,
114
+ t: o,
105
115
  tOption: d,
106
116
  tValidation: l
107
117
  };
108
118
  return ie(ye, n), n;
109
119
  }
110
120
  function Ze() {
111
- return J(ye);
121
+ return q(ye);
112
122
  }
113
- function fe(e, i) {
114
- return e.replace(/\{(\w+)\}/g, (t, a) => i[a] !== void 0 ? String(i[a]) : `{${a}}`);
123
+ function fe(e, u) {
124
+ return e.replace(/\{(\w+)\}/g, (t, a) => u[a] !== void 0 ? String(u[a]) : `{${a}}`);
115
125
  }
116
126
  function we(e) {
117
- return e.split("|").map((i) => {
118
- const [t, ...a] = i.split(":"), r = {};
127
+ return e.split("|").map((u) => {
128
+ const [t, ...a] = u.split(":"), s = {};
119
129
  if (a.length > 0) {
120
130
  const d = a.join(":").split(",");
121
- t === "between" && d.length === 2 ? (r.min = d[0], r.max = d[1]) : d.length === 1 ? r[t] = d[0] : r.values = d;
131
+ t === "between" && d.length === 2 ? (s.min = d[0], s.max = d[1]) : d.length === 1 ? s[t] = d[0] : s.values = d;
122
132
  }
123
- return { name: t, params: r };
133
+ return { name: t, params: s };
124
134
  });
125
135
  }
126
136
  function qe(e) {
127
- const i = e.rules;
128
- if (!i) {
137
+ const u = e.rules;
138
+ if (!u) {
129
139
  const a = [];
130
140
  return e.required && a.push({ name: "required" }), a;
131
141
  }
132
- if (typeof i == "string")
133
- return we(i);
134
- if (Array.isArray(i))
135
- return i.flatMap((a) => typeof a == "string" ? we(a) : []);
142
+ if (typeof u == "string")
143
+ return we(u);
144
+ if (Array.isArray(u))
145
+ return u.flatMap((a) => typeof a == "string" ? we(a) : []);
136
146
  const t = [];
137
- for (const [a, r] of Object.entries(i)) {
138
- if (r === !1) continue;
139
- const u = {};
140
- typeof r == "object" && r !== null && !Array.isArray(r) ? Object.assign(u, r) : r !== !0 && (u[a] = r), t.push({ name: a, params: u });
147
+ for (const [a, s] of Object.entries(u)) {
148
+ if (s === !1) continue;
149
+ const o = {};
150
+ typeof s == "object" && s !== null && !Array.isArray(s) ? Object.assign(o, s) : s !== !0 && (o[a] = s), t.push({ name: a, params: o });
141
151
  }
142
152
  return t;
143
153
  }
144
- function Ye(e, i) {
154
+ function Ye(e, u) {
145
155
  let t = null, a = null;
146
- return (...r) => new Promise((u) => {
147
- t !== null && (clearTimeout(t), a && a([])), a = u, t = setTimeout(async () => {
156
+ return (...s) => new Promise((o) => {
157
+ t !== null && (clearTimeout(t), a && a([])), a = o, t = setTimeout(async () => {
148
158
  t = null;
149
- const d = await e(...r);
150
- u(d), a = null;
151
- }, i);
159
+ const d = await e(...s);
160
+ o(d), a = null;
161
+ }, u);
152
162
  });
153
163
  }
154
164
  function Je(e) {
155
- const { fields: i, values: t, settings: a } = e, r = D({}), u = /* @__PURE__ */ new Map();
156
- function d($, V) {
157
- const b = `${$}:${V}`;
158
- u.has(b) || u.set(
159
- b,
160
- Ye(async (...m) => l(m[0], m[1]), V)
165
+ const { fields: u, values: t, settings: a } = e, s = D({}), o = /* @__PURE__ */ new Map();
166
+ function d(g, $) {
167
+ const m = `${g}:${$}`;
168
+ o.has(m) || o.set(
169
+ m,
170
+ Ye(async (...h) => l(h[0], h[1]), $)
161
171
  );
162
- const v = u.get(b);
163
- if (!v) throw new Error(`Debounced validator not found for ${b}`);
164
- return v;
172
+ const C = o.get(m);
173
+ if (!C) throw new Error(`Debounced validator not found for ${m}`);
174
+ return C;
165
175
  }
166
- async function l($, V) {
167
- var F;
168
- const b = i.value.find((k) => k.name === $);
169
- if (!b) return [];
170
- const v = qe(b), m = t.value[$], y = [];
171
- for (const k of v) {
172
- if ((F = k.params) != null && F.when) {
173
- const w = k.params.when;
174
- if (("field" in w || "and" in w || "or" in w) && !se(
175
- w,
176
+ async function l(g, $) {
177
+ var A;
178
+ const m = u.value.find((V) => V.name === g);
179
+ if (!m) return [];
180
+ const C = qe(m), h = t.value[g], y = [];
181
+ for (const V of C) {
182
+ if ((A = V.params) != null && A.when) {
183
+ const v = V.params.when;
184
+ if (("field" in v || "and" in v || "or" in v) && !se(
185
+ v,
176
186
  t.value
177
187
  ))
178
188
  continue;
179
189
  }
180
- if (k.optional && We(m)) continue;
181
- let C;
182
- if (k.validator)
183
- C = await k.validator(m, k.params ?? {}, V);
190
+ if (V.optional && We(h)) continue;
191
+ let b;
192
+ if (V.validator)
193
+ b = await V.validator(h, V.params ?? {}, $);
184
194
  else {
185
- const w = Te(k.name);
186
- if (!w) continue;
187
- C = await w(m, k.params ?? {}, V);
195
+ const v = Le(V.name);
196
+ if (!v) continue;
197
+ b = await v(h, V.params ?? {}, $);
188
198
  }
189
- if (C !== !0) {
190
- const w = k.message ? _e(k.message, k.params ?? {}) : typeof C == "string" ? C : `Validation failed for rule: ${k.name}`;
191
- if (y.push(w), k.bail) break;
199
+ if (b !== !0) {
200
+ const v = V.message ? _e(V.message, V.params ?? {}) : typeof b == "string" ? b : `Validation failed for rule: ${V.name}`;
201
+ if (y.push(v), V.bail) break;
192
202
  }
193
203
  }
194
- return r.value[$] = y, y;
204
+ return s.value[g] = y, y;
195
205
  }
196
- async function n($, V) {
197
- const b = a == null ? void 0 : a.debounce;
198
- return b && b > 0 ? d($, b)($, V) : l($, V);
206
+ async function n(g, $) {
207
+ const m = a == null ? void 0 : a.debounce;
208
+ return m && m > 0 ? d(g, m)(g, $) : l(g, $);
199
209
  }
200
- async function o($) {
201
- const V = {}, b = i.value.map(async (v) => {
202
- const m = await l(v.name, $);
203
- m.length > 0 && (V[v.name] = m);
210
+ async function r(g) {
211
+ const $ = {}, m = u.value.map(async (C) => {
212
+ const h = await l(C.name, g);
213
+ h.length > 0 && ($[C.name] = h);
204
214
  });
205
- return await Promise.all(b), r.value = { ...V }, V;
215
+ return await Promise.all(m), s.value = { ...$ }, $;
206
216
  }
207
- function s($) {
208
- delete r.value[$];
217
+ function i(g) {
218
+ delete s.value[g];
209
219
  }
210
- function g() {
211
- r.value = {};
220
+ function k() {
221
+ s.value = {};
212
222
  }
213
223
  return {
214
- errors: r,
224
+ errors: s,
215
225
  validateField: n,
216
- validateAll: o,
217
- clearFieldErrors: s,
218
- clearAllErrors: g
226
+ validateAll: r,
227
+ clearFieldErrors: i,
228
+ clearAllErrors: k
219
229
  };
220
230
  }
221
231
  function We(e) {
222
232
  return !!(e == null || e === "" || Array.isArray(e) && e.length === 0);
223
233
  }
224
- function _e(e, i) {
225
- return e.replace(/\{(\w+)\}/g, (t, a) => i[a] !== void 0 ? String(i[a]) : `{${a}}`);
234
+ function _e(e, u) {
235
+ return e.replace(/\{(\w+)\}/g, (t, a) => u[a] !== void 0 ? String(u[a]) : `{${a}}`);
226
236
  }
227
237
  const ce = Symbol("FormaticaContext");
228
238
  function Qe(e) {
@@ -245,27 +255,27 @@ function Qe(e) {
245
255
  }
246
256
  }
247
257
  function me(e) {
248
- const i = {};
258
+ const u = {};
249
259
  for (const t of e)
250
- i[t.name] = t.defaultValue ?? Qe(t);
251
- return i;
260
+ u[t.name] = t.defaultValue ?? Qe(t);
261
+ return u;
252
262
  }
253
263
  function Xe(e) {
254
- const i = {};
264
+ const u = {};
255
265
  for (const t of e)
256
- t.translations && (i[t.name] = t.translations);
257
- return i;
266
+ t.translations && (u[t.name] = t.translations);
267
+ return u;
258
268
  }
259
- function et(e, i) {
260
- const t = D((i == null ? void 0 : i.locale) ?? "en"), a = (i == null ? void 0 : i.fallbackLocale) ?? "en";
261
- let r = e;
262
- const u = D(P(e.fields)), d = re(me(P(e.fields))), l = re({}), n = re({}), o = re({}), s = D(!1), g = D(0), $ = h(() => Object.values(l).every((x) => x.length === 0)), V = h(() => Object.values(o).some(Boolean)), b = Ue();
263
- function v() {
264
- return { values: { ...d }, getFieldValue: (x) => d[x] };
269
+ function et(e, u) {
270
+ const t = D((u == null ? void 0 : u.locale) ?? "en"), a = (u == null ? void 0 : u.fallbackLocale) ?? "en";
271
+ let s = e;
272
+ const o = D(P(e.fields)), d = te(me(P(e.fields))), l = te({}), n = te({}), r = te({}), i = D(!1), k = D(0), g = x(() => Object.values(l).every((w) => w.length === 0)), $ = x(() => Object.values(r).some(Boolean)), m = Ue();
273
+ function C() {
274
+ return { values: { ...d }, getFieldValue: (w) => d[w] };
265
275
  }
266
- const m = h(() => ({ ...d })), y = Je({
267
- fields: u,
268
- values: m,
276
+ const h = x(() => ({ ...d })), y = Je({
277
+ fields: o,
278
+ values: h,
269
279
  settings: e.settings
270
280
  });
271
281
  Ge({
@@ -274,165 +284,165 @@ function et(e, i) {
274
284
  fieldTranslations: Xe(P(e.fields)),
275
285
  formTranslations: e.translations
276
286
  });
277
- let F = me(P(e.fields));
278
- Y(
287
+ let A = me(P(e.fields));
288
+ J(
279
289
  () => ({ ...d }),
280
- (x, I) => {
290
+ (w, I) => {
281
291
  var M;
282
292
  if (I) {
283
- for (const E of Object.keys(x))
284
- x[E] !== I[E] && (o[E] = !0, b.emit("field:change", {
293
+ for (const E of Object.keys(w))
294
+ w[E] !== I[E] && (r[E] = !0, m.emit("field:change", {
285
295
  field: E,
286
- value: x[E],
296
+ value: w[E],
287
297
  previousValue: I[E]
288
- }), (M = e.settings) != null && M.validateOnChange && N(E));
289
- b.emit("change", { values: x });
298
+ }), (M = e.settings) != null && M.validateOnChange && B(E));
299
+ m.emit("change", { values: w });
290
300
  }
291
301
  },
292
302
  { deep: !0 }
293
303
  );
294
- const k = /* @__PURE__ */ new Map();
295
- function C(x) {
296
- const I = x.name;
304
+ const V = /* @__PURE__ */ new Map();
305
+ function b(w) {
306
+ const I = w.name;
297
307
  return {
298
308
  name: I,
299
- value: h({
309
+ value: x({
300
310
  get: () => d[I],
301
311
  set: (M) => {
302
312
  d[I] = M;
303
313
  }
304
314
  }),
305
- errors: h(() => l[I] ?? []),
306
- touched: h({
315
+ errors: x(() => l[I] ?? []),
316
+ touched: x({
307
317
  get: () => n[I] ?? !1,
308
318
  set: (M) => {
309
319
  n[I] = M;
310
320
  }
311
321
  }),
312
- dirty: h({
313
- get: () => o[I] ?? !1,
322
+ dirty: x({
323
+ get: () => r[I] ?? !1,
314
324
  set: (M) => {
315
- o[I] = M;
325
+ r[I] = M;
316
326
  }
317
327
  }),
318
- disabled: h(
319
- () => typeof x.disabled == "function" ? x.disabled(v()) : x.disabled ?? !1
328
+ disabled: x(
329
+ () => typeof w.disabled == "function" ? w.disabled(C()) : w.disabled ?? !1
320
330
  ),
321
- visible: h(() => x.condition ? se(x.condition, d) : typeof x.visible == "function" ? x.visible(v()) : x.visible ?? !0),
322
- schema: x,
323
- validate: () => N(I),
331
+ visible: x(() => w.condition ? se(w.condition, d) : typeof w.visible == "function" ? w.visible(C()) : w.visible ?? !0),
332
+ schema: w,
333
+ validate: () => B(I),
324
334
  reset: () => {
325
- d[I] = F[I] ?? null, delete l[I], n[I] = !1, o[I] = !1;
335
+ d[I] = A[I] ?? null, delete l[I], n[I] = !1, r[I] = !1;
326
336
  },
327
337
  clear: () => {
328
338
  d[I] = null, delete l[I];
329
339
  }
330
340
  };
331
341
  }
332
- function w() {
333
- k.clear();
334
- for (const x of P(r.fields))
335
- k.set(x.name, C(x));
342
+ function v() {
343
+ V.clear();
344
+ for (const w of P(s.fields))
345
+ V.set(w.name, b(w));
336
346
  }
337
- w();
338
- async function N(x) {
339
- const I = await y.validateField(x, v());
340
- return l[x] = I, b.emit("validate:field", {
341
- field: x,
347
+ v();
348
+ async function B(w) {
349
+ const I = await y.validateField(w, C());
350
+ return l[w] = I, m.emit("validate:field", {
351
+ field: w,
342
352
  valid: I.length === 0,
343
353
  errors: I
344
354
  }), I;
345
355
  }
346
- async function B() {
347
- const x = await y.validateAll(v());
356
+ async function S() {
357
+ const w = await y.validateAll(C());
348
358
  for (const M of Object.keys(l))
349
- M in x || delete l[M];
350
- for (const [M, E] of Object.entries(x))
359
+ M in w || delete l[M];
360
+ for (const [M, E] of Object.entries(w))
351
361
  l[M] = E;
352
- const I = Object.values(x).every((M) => M.length === 0);
353
- return b.emit("validate", { valid: I, errors: { ...x } }), I;
362
+ const I = Object.values(w).every((M) => M.length === 0);
363
+ return m.emit("validate", { valid: I, errors: { ...w } }), I;
354
364
  }
355
- async function A(x) {
356
- s.value = !0, g.value += 1;
365
+ async function N(w) {
366
+ i.value = !0, k.value += 1;
357
367
  try {
358
- for (const M of P(r.fields)) n[M.name] = !0;
359
- if (!await B()) {
360
- b.emit("submit:error", {
368
+ for (const M of P(s.fields)) n[M.name] = !0;
369
+ if (!await S()) {
370
+ m.emit("submit:error", {
361
371
  values: { ...d },
362
372
  error: new Error("Validation failed")
363
373
  });
364
374
  return;
365
375
  }
366
- b.emit("submit", { values: { ...d } }), x && await x({ ...d }, v()), b.emit("submit:success", { values: { ...d }, result: void 0 });
376
+ m.emit("submit", { values: { ...d } }), w && await w({ ...d }, C()), m.emit("submit:success", { values: { ...d }, result: void 0 });
367
377
  } catch (I) {
368
- throw b.emit("submit:error", { values: { ...d }, error: I }), I;
378
+ throw m.emit("submit:error", { values: { ...d }, error: I }), I;
369
379
  } finally {
370
- s.value = !1;
380
+ i.value = !1;
371
381
  }
372
382
  }
373
383
  function R() {
374
- for (const x of P(r.fields))
375
- d[x.name] = F[x.name] ?? null, delete l[x.name], n[x.name] = !1, o[x.name] = !1;
376
- y.clearAllErrors(), b.emit("reset", void 0);
384
+ for (const w of P(s.fields))
385
+ d[w.name] = A[w.name] ?? null, delete l[w.name], n[w.name] = !1, r[w.name] = !1;
386
+ y.clearAllErrors(), m.emit("reset", void 0);
377
387
  }
378
388
  function Q() {
379
- for (const x of P(r.fields))
380
- d[x.name] = null, delete l[x.name];
389
+ for (const w of P(s.fields))
390
+ d[w.name] = null, delete l[w.name];
381
391
  y.clearAllErrors();
382
392
  }
383
- function ee(x) {
384
- r = x;
385
- const I = P(x.fields);
386
- u.value = I, F = me(I);
393
+ function ee(w) {
394
+ s = w;
395
+ const I = P(w.fields);
396
+ o.value = I, A = me(I);
387
397
  for (const E of I)
388
398
  E.name in d || (d[E.name] = E.defaultValue ?? null);
389
399
  const M = new Set(I.map((E) => E.name));
390
400
  for (const E of Object.keys(d))
391
- M.has(E) || (delete d[E], delete l[E], delete n[E], delete o[E]);
392
- w();
401
+ M.has(E) || (delete d[E], delete l[E], delete n[E], delete r[E]);
402
+ v();
393
403
  }
394
404
  const ge = {
395
405
  values: d,
396
406
  errors: l,
397
407
  touched: n,
398
- dirty: o,
399
- isValid: $,
400
- isDirty: V,
401
- isSubmitting: s,
402
- submitCount: g,
403
- validate: B,
404
- validateField: N,
405
- submit: A,
408
+ dirty: r,
409
+ isValid: g,
410
+ isDirty: $,
411
+ isSubmitting: i,
412
+ submitCount: k,
413
+ validate: S,
414
+ validateField: B,
415
+ submit: N,
406
416
  reset: R,
407
417
  clear: Q,
408
- setError: (x, I) => {
409
- l[x] = I;
418
+ setError: (w, I) => {
419
+ l[w] = I;
410
420
  },
411
- clearError: (x) => {
412
- delete l[x], y.clearFieldErrors(x);
421
+ clearError: (w) => {
422
+ delete l[w], y.clearFieldErrors(w);
413
423
  },
414
424
  clearErrors: () => {
415
- for (const x of Object.keys(l)) delete l[x];
425
+ for (const w of Object.keys(l)) delete l[w];
416
426
  y.clearAllErrors();
417
427
  },
418
- getField: (x) => k.get(x),
419
- setFieldValue: (x, I) => {
420
- d[x] = I;
428
+ getField: (w) => V.get(w),
429
+ setFieldValue: (w, I) => {
430
+ d[w] = I;
421
431
  },
422
- setFieldDisabled: (x, I) => {
423
- const M = P(r.fields).find((E) => E.name === x);
432
+ setFieldDisabled: (w, I) => {
433
+ const M = P(s.fields).find((E) => E.name === w);
424
434
  M && (M.disabled = I);
425
435
  },
426
- setFieldVisible: (x, I) => {
427
- const M = P(r.fields).find((E) => E.name === x);
436
+ setFieldVisible: (w, I) => {
437
+ const M = P(s.fields).find((E) => E.name === w);
428
438
  M && (M.visible = I);
429
439
  },
430
- on: b.on,
440
+ on: m.on,
431
441
  locale: t,
432
- setLocale: (x) => {
433
- t.value = x;
442
+ setLocale: (w) => {
443
+ t.value = w;
434
444
  },
435
- schema: r,
445
+ schema: s,
436
446
  updateSchema: ee
437
447
  };
438
448
  return ie(ce, ge), ge;
@@ -490,55 +500,55 @@ const pe = Symbol("FormaticaTheme"), be = {
490
500
  }
491
501
  };
492
502
  function tt(e) {
493
- const i = Le(e) ? h(() => e.value ?? be) : D(e ?? be), t = h(() => {
494
- const u = i.value.components ?? {};
503
+ const u = Ne(e) ? x(() => e.value ?? be) : D(e ?? be), t = x(() => {
504
+ const o = u.value.components ?? {};
495
505
  return {
496
- form: u.form ?? "fc-form",
497
- field: u.field ?? "fc-field",
498
- label: u.label ?? "fc-label",
499
- input: u.input ?? "fc-input",
500
- error: u.error ?? "fc-error",
501
- helpText: u.helpText ?? "fc-help-text",
502
- group: u.group ?? "fc-group",
503
- row: u.row ?? "fc-row",
504
- steps: u.steps ?? "fc-steps",
505
- tabs: u.tabs ?? "fc-tabs",
506
- button: u.button ?? "fc-button"
506
+ form: o.form ?? "fc-form",
507
+ field: o.field ?? "fc-field",
508
+ label: o.label ?? "fc-label",
509
+ input: o.input ?? "fc-input",
510
+ error: o.error ?? "fc-error",
511
+ helpText: o.helpText ?? "fc-help-text",
512
+ group: o.group ?? "fc-group",
513
+ row: o.row ?? "fc-row",
514
+ steps: o.steps ?? "fc-steps",
515
+ tabs: o.tabs ?? "fc-tabs",
516
+ button: o.button ?? "fc-button"
507
517
  };
508
- }), a = h(() => {
509
- const u = i.value, d = {};
510
- if (u.colors)
511
- for (const [l, n] of Object.entries(u.colors))
518
+ }), a = x(() => {
519
+ const o = u.value, d = {};
520
+ if (o.colors)
521
+ for (const [l, n] of Object.entries(o.colors))
512
522
  n && (d[`--fc-color-${X(l)}`] = n);
513
- if (u.typography)
514
- for (const [l, n] of Object.entries(u.typography))
523
+ if (o.typography)
524
+ for (const [l, n] of Object.entries(o.typography))
515
525
  n && (d[`--fc-${X(l)}`] = n);
516
- if (u.spacing)
517
- for (const [l, n] of Object.entries(u.spacing))
526
+ if (o.spacing)
527
+ for (const [l, n] of Object.entries(o.spacing))
518
528
  n && (d[`--fc-${X(l)}`] = n);
519
- if (u.borders)
520
- for (const [l, n] of Object.entries(u.borders))
529
+ if (o.borders)
530
+ for (const [l, n] of Object.entries(o.borders))
521
531
  n && (d[`--fc-border-${X(l)}`] = n);
522
- if (u.shadows)
523
- for (const [l, n] of Object.entries(u.shadows))
532
+ if (o.shadows)
533
+ for (const [l, n] of Object.entries(o.shadows))
524
534
  n && (d[`--fc-shadow-${X(l)}`] = n);
525
- if (u.transitions)
526
- for (const [l, n] of Object.entries(u.transitions))
535
+ if (o.transitions)
536
+ for (const [l, n] of Object.entries(o.transitions))
527
537
  n && (d[`--fc-transition-${X(l)}`] = n);
528
- return u.cssVars && Object.assign(d, u.cssVars), d;
529
- }), r = {
530
- config: i.value,
538
+ return o.cssVars && Object.assign(d, o.cssVars), d;
539
+ }), s = {
540
+ config: u.value,
531
541
  classes: t,
532
542
  cssVars: a
533
543
  };
534
- return ie(pe, r), r;
544
+ return ie(pe, s), s;
535
545
  }
536
546
  function K() {
537
- const e = J(pe);
547
+ const e = q(pe);
538
548
  return e || at();
539
549
  }
540
550
  function at() {
541
- const e = h(() => ({
551
+ const e = x(() => ({
542
552
  form: "fc-form",
543
553
  field: "fc-field",
544
554
  label: "fc-label",
@@ -550,8 +560,8 @@ function at() {
550
560
  steps: "fc-steps",
551
561
  tabs: "fc-tabs",
552
562
  button: "fc-button"
553
- })), i = h(() => ({}));
554
- return { config: be, classes: e, cssVars: i };
563
+ })), u = x(() => ({}));
564
+ return { config: be, classes: e, cssVars: u };
555
565
  }
556
566
  function X(e) {
557
567
  return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
@@ -575,61 +585,61 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
575
585
  maxSelect: {}
576
586
  },
577
587
  emits: ["update:modelValue", "blur"],
578
- setup(e, { emit: i }) {
579
- const t = e, a = i;
588
+ setup(e, { emit: u }) {
589
+ const t = e, a = u;
580
590
  K();
581
- function r(n) {
591
+ function s(n) {
582
592
  return t.modelValue.includes(n);
583
593
  }
584
- function u(n) {
585
- return !!(t.disabled || n.disabled || t.maxSelect && !r(n.value) && t.modelValue.length >= t.maxSelect);
594
+ function o(n) {
595
+ return !!(t.disabled || n.disabled || t.maxSelect && !s(n.value) && t.modelValue.length >= t.maxSelect);
586
596
  }
587
597
  function d(n) {
588
- if (u(n)) return;
589
- const o = [...t.modelValue], s = o.indexOf(n.value);
590
- if (s >= 0) {
591
- if (t.minSelect && o.length <= t.minSelect) return;
592
- o.splice(s, 1);
598
+ if (o(n)) return;
599
+ const r = [...t.modelValue], i = r.indexOf(n.value);
600
+ if (i >= 0) {
601
+ if (t.minSelect && r.length <= t.minSelect) return;
602
+ r.splice(i, 1);
593
603
  } else
594
- o.push(n.value);
595
- a("update:modelValue", o);
604
+ r.push(n.value);
605
+ a("update:modelValue", r);
596
606
  }
597
- function l(n, o) {
598
- (n.key === " " || n.key === "Enter") && (n.preventDefault(), d(o));
607
+ function l(n, r) {
608
+ (n.key === " " || n.key === "Enter") && (n.preventDefault(), d(r));
599
609
  }
600
- return (n, o) => (c(), f("div", {
610
+ return (n, r) => (c(), f("div", {
601
611
  role: "group",
602
- class: S(e.inline ? "flex flex-wrap gap-4" : "flex flex-col gap-2")
612
+ class: F(e.inline ? "flex flex-wrap gap-4" : "flex flex-col gap-2")
603
613
  }, [
604
- (c(!0), f(z, null, G(e.options, (s) => (c(), f("label", {
605
- key: String(s.value),
606
- class: S([
614
+ (c(!0), f(O, null, G(e.options, (i) => (c(), f("label", {
615
+ key: String(i.value),
616
+ class: F([
607
617
  "inline-flex items-center gap-2 select-none",
608
- u(s) ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
618
+ o(i) ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
609
619
  ])
610
620
  }, [
611
621
  p("input", {
612
622
  type: "checkbox",
613
- checked: r(s.value),
614
- disabled: u(s),
623
+ checked: s(i.value),
624
+ disabled: o(i),
615
625
  class: "sr-only",
616
- onChange: (g) => d(s),
617
- onBlur: o[0] || (o[0] = (g) => a("blur", g))
626
+ onChange: (k) => d(i),
627
+ onBlur: r[0] || (r[0] = (k) => a("blur", k))
618
628
  }, null, 40, lt),
619
629
  p("div", {
620
630
  role: "checkbox",
621
- "aria-checked": r(s.value),
622
- "aria-disabled": u(s) || void 0,
631
+ "aria-checked": s(i.value),
632
+ "aria-disabled": o(i) || void 0,
623
633
  tabindex: "0",
624
- class: S([
634
+ class: F([
625
635
  "flex h-5 w-5 shrink-0 items-center justify-center rounded border-2 transition-colors duration-200",
626
- r(s.value) ? "text-white" : "border-gray-300 bg-white"
636
+ s(i.value) ? "text-white" : "border-gray-300 bg-white"
627
637
  ]),
628
- style: O(r(s.value) ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
629
- onClick: (g) => d(s),
630
- onKeydown: (g) => l(g, s)
638
+ style: z(s(i.value) ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
639
+ onClick: (k) => d(i),
640
+ onKeydown: (k) => l(k, i)
631
641
  }, [
632
- r(s.value) ? (c(), f("svg", ot, [...o[1] || (o[1] = [
642
+ s(i.value) ? (c(), f("svg", ot, [...r[1] || (r[1] = [
633
643
  p("path", {
634
644
  d: "M2 6l3 3 5-5",
635
645
  "stroke-linecap": "round",
@@ -637,7 +647,7 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
637
647
  }, null, -1)
638
648
  ])])) : T("", !0)
639
649
  ], 46, nt),
640
- p("span", rt, L(s.label), 1)
650
+ p("span", rt, L(i.label), 1)
641
651
  ], 2))), 128))
642
652
  ], 2));
643
653
  }
@@ -660,41 +670,41 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
660
670
  disabled: { type: Boolean, default: !1 }
661
671
  },
662
672
  emits: ["update:modelValue", "blur"],
663
- setup(e, { emit: i }) {
664
- const t = e, a = i;
673
+ setup(e, { emit: u }) {
674
+ const t = e, a = u;
665
675
  K();
666
- const r = h(() => [
676
+ const s = x(() => [
667
677
  "inline-flex items-center gap-2 select-none",
668
678
  t.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
669
679
  ]);
670
- function u() {
680
+ function o() {
671
681
  t.disabled || a("update:modelValue", !t.modelValue);
672
682
  }
673
683
  function d(l) {
674
- (l.key === " " || l.key === "Enter") && (l.preventDefault(), u());
684
+ (l.key === " " || l.key === "Enter") && (l.preventDefault(), o());
675
685
  }
676
686
  return (l, n) => (c(), f("label", {
677
- class: S(r.value)
687
+ class: F(s.value)
678
688
  }, [
679
689
  p("input", {
680
690
  type: "checkbox",
681
691
  checked: e.modelValue,
682
692
  disabled: e.disabled,
683
693
  class: "sr-only",
684
- onChange: u,
685
- onBlur: n[0] || (n[0] = (o) => a("blur", o))
694
+ onChange: o,
695
+ onBlur: n[0] || (n[0] = (r) => a("blur", r))
686
696
  }, null, 40, it),
687
697
  p("div", {
688
698
  role: "checkbox",
689
699
  "aria-checked": e.modelValue,
690
700
  "aria-disabled": e.disabled || void 0,
691
701
  tabindex: "0",
692
- class: S([
702
+ class: F([
693
703
  "flex h-5 w-5 shrink-0 items-center justify-center rounded border-2 transition-colors duration-200",
694
704
  e.modelValue ? "text-white" : "border-gray-300 bg-white"
695
705
  ]),
696
- style: O(e.modelValue ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
697
- onClick: u,
706
+ style: z(e.modelValue ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
707
+ onClick: o,
698
708
  onKeydown: d
699
709
  }, [
700
710
  e.modelValue ? (c(), f("svg", dt, [...n[1] || (n[1] = [
@@ -719,14 +729,14 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
719
729
  disabled: { type: Boolean, default: !1 }
720
730
  },
721
731
  emits: ["update:modelValue", "blur", "focus"],
722
- setup(e, { emit: i }) {
723
- const t = e, a = i, r = K(), u = h(
732
+ setup(e, { emit: u }) {
733
+ const t = e, a = u, s = K(), o = x(
724
734
  () => [
725
735
  "w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm",
726
736
  "focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-date-input",
727
737
  "transition-colors duration-200",
728
738
  t.disabled ? "opacity-50 cursor-not-allowed bg-gray-100" : "",
729
- r.classes.value.input
739
+ s.classes.value.input
730
740
  ].filter(Boolean).join(" ")
731
741
  );
732
742
  function d(l) {
@@ -740,19 +750,19 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
740
750
  max: e.maxDate,
741
751
  placeholder: e.placeholder,
742
752
  disabled: e.disabled,
743
- class: S(u.value),
753
+ class: F(o.value),
744
754
  "aria-disabled": e.disabled || void 0,
745
755
  onInput: d,
746
- onBlur: n[0] || (n[0] = (o) => a("blur", o)),
747
- onFocus: n[1] || (n[1] = (o) => a("focus", o))
756
+ onBlur: n[0] || (n[0] = (r) => a("blur", r)),
757
+ onFocus: n[1] || (n[1] = (r) => a("focus", r))
748
758
  }, null, 42, mt));
749
759
  }
750
- }), ne = (e, i) => {
760
+ }), oe = (e, u) => {
751
761
  const t = e.__vccOpts || e;
752
- for (const [a, r] of i)
753
- t[a] = r;
762
+ for (const [a, s] of u)
763
+ t[a] = s;
754
764
  return t;
755
- }, vt = /* @__PURE__ */ ne(bt, [["__scopeId", "data-v-7d4bc9b7"]]), yt = ["aria-disabled", "onKeydown"], pt = {
765
+ }, vt = /* @__PURE__ */ oe(bt, [["__scopeId", "data-v-7d4bc9b7"]]), yt = ["aria-disabled", "onKeydown"], pt = {
756
766
  key: 0,
757
767
  class: "mt-1 text-xs text-gray-400"
758
768
  }, gt = ["accept", "multiple"], ht = {
@@ -769,74 +779,74 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
769
779
  disabled: { type: Boolean, default: !1 }
770
780
  },
771
781
  emits: ["update:modelValue", "blur"],
772
- setup(e, { emit: i }) {
773
- const t = e, a = i;
782
+ setup(e, { emit: u }) {
783
+ const t = e, a = u;
774
784
  K();
775
- const r = D(null), u = D(!1), d = h(() => t.modelValue ? Array.isArray(t.modelValue) ? t.modelValue : [t.modelValue] : []);
776
- function l(m) {
777
- return m < 1024 ? `${m} B` : m < 1024 * 1024 ? `${(m / 1024).toFixed(1)} KB` : `${(m / (1024 * 1024)).toFixed(1)} MB`;
785
+ const s = D(null), o = D(!1), d = x(() => t.modelValue ? Array.isArray(t.modelValue) ? t.modelValue : [t.modelValue] : []);
786
+ function l(h) {
787
+ return h < 1024 ? `${h} B` : h < 1024 * 1024 ? `${(h / 1024).toFixed(1)} KB` : `${(h / (1024 * 1024)).toFixed(1)} MB`;
778
788
  }
779
- function n(m) {
780
- let y = m;
789
+ function n(h) {
790
+ let y = h;
781
791
  if (t.maxSize) {
782
- const F = t.maxSize;
783
- y = y.filter((k) => k.size <= F);
792
+ const A = t.maxSize;
793
+ y = y.filter((V) => V.size <= A);
784
794
  }
785
795
  if (t.multiple && t.maxFiles) {
786
- const F = t.maxFiles - d.value.length;
787
- y = y.slice(0, Math.max(0, F));
796
+ const A = t.maxFiles - d.value.length;
797
+ y = y.slice(0, Math.max(0, A));
788
798
  }
789
799
  return y;
790
800
  }
791
- function o(m) {
792
- const y = n(m);
801
+ function r(h) {
802
+ const y = n(h);
793
803
  y.length !== 0 && (t.multiple ? a("update:modelValue", [...d.value, ...y]) : a("update:modelValue", y[0]));
794
804
  }
795
- function s(m) {
796
- const y = m.target;
797
- y.files && (o(Array.from(y.files)), y.value = "");
805
+ function i(h) {
806
+ const y = h.target;
807
+ y.files && (r(Array.from(y.files)), y.value = "");
798
808
  }
799
- function g(m) {
809
+ function k(h) {
800
810
  if (t.disabled) return;
801
- const y = d.value.filter((F, k) => k !== m);
811
+ const y = d.value.filter((A, V) => V !== h);
802
812
  t.multiple ? a("update:modelValue", y.length ? y : []) : a("update:modelValue", null);
803
813
  }
804
- function $(m) {
805
- m.preventDefault(), t.disabled || (u.value = !0);
814
+ function g(h) {
815
+ h.preventDefault(), t.disabled || (o.value = !0);
806
816
  }
807
- function V() {
808
- u.value = !1;
817
+ function $() {
818
+ o.value = !1;
809
819
  }
810
- function b(m) {
820
+ function m(h) {
811
821
  var y;
812
- m.preventDefault(), u.value = !1, !(t.disabled || !((y = m.dataTransfer) != null && y.files)) && o(Array.from(m.dataTransfer.files));
822
+ h.preventDefault(), o.value = !1, !(t.disabled || !((y = h.dataTransfer) != null && y.files)) && r(Array.from(h.dataTransfer.files));
813
823
  }
814
- function v() {
815
- var m;
816
- t.disabled || (m = r.value) == null || m.click();
824
+ function C() {
825
+ var h;
826
+ t.disabled || (h = s.value) == null || h.click();
817
827
  }
818
- return (m, y) => (c(), f("div", {
819
- class: S(e.disabled ? "opacity-50 cursor-not-allowed" : "")
828
+ return (h, y) => (c(), f("div", {
829
+ class: F(e.disabled ? "opacity-50 cursor-not-allowed" : "")
820
830
  }, [
821
831
  p("div", {
822
832
  role: "button",
823
833
  tabindex: "0",
824
834
  "aria-disabled": e.disabled || void 0,
825
- class: S([
835
+ class: F([
826
836
  "flex flex-col items-center justify-center rounded-lg border-2 border-dashed p-6 text-center transition-colors duration-200",
827
- u.value ? "" : "border-gray-300 bg-gray-50",
837
+ o.value ? "" : "border-gray-300 bg-gray-50",
828
838
  e.disabled ? "pointer-events-none" : "cursor-pointer hover:border-gray-400"
829
839
  ]),
830
- style: O(u.value ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)" } : {}),
831
- onClick: v,
840
+ style: z(o.value ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)" } : {}),
841
+ onClick: C,
832
842
  onKeydown: [
833
- he(v, ["enter"]),
834
- he(q(v, ["prevent"]), ["space"])
843
+ he(C, ["enter"]),
844
+ he(Y(C, ["prevent"]), ["space"])
835
845
  ],
836
- onDragover: $,
837
- onDragleave: V,
838
- onDrop: b,
839
- onBlur: y[0] || (y[0] = (F) => a("blur", F))
846
+ onDragover: g,
847
+ onDragleave: $,
848
+ onDrop: m,
849
+ onBlur: y[0] || (y[0] = (A) => a("blur", A))
840
850
  }, [
841
851
  y[1] || (y[1] = p("svg", {
842
852
  class: "mb-2 h-8 w-8 text-gray-400",
@@ -863,16 +873,16 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
863
873
  ], 46, yt),
864
874
  p("input", {
865
875
  ref_key: "fileInputRef",
866
- ref: r,
876
+ ref: s,
867
877
  type: "file",
868
878
  accept: e.accept,
869
879
  multiple: e.multiple,
870
880
  class: "hidden",
871
- onChange: s
881
+ onChange: i
872
882
  }, null, 40, gt),
873
883
  d.value.length > 0 ? (c(), f("ul", ht, [
874
- (c(!0), f(z, null, G(d.value, (F, k) => (c(), f("li", {
875
- key: `${F.name}-${k}`,
884
+ (c(!0), f(O, null, G(d.value, (A, V) => (c(), f("li", {
885
+ key: `${A.name}-${V}`,
876
886
  class: "flex items-center justify-between rounded-md border border-gray-200 bg-white px-3 py-2 text-sm"
877
887
  }, [
878
888
  p("div", xt, [
@@ -890,15 +900,15 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
890
900
  d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
891
901
  })
892
902
  ], -1)),
893
- p("span", kt, L(F.name), 1),
894
- p("span", wt, "(" + L(l(F.size)) + ")", 1)
903
+ p("span", kt, L(A.name), 1),
904
+ p("span", wt, "(" + L(l(A.size)) + ")", 1)
895
905
  ]),
896
906
  e.disabled ? T("", !0) : (c(), f("button", {
897
907
  key: 0,
898
908
  type: "button",
899
909
  class: "ml-2 shrink-0 text-gray-400 hover:text-red-500 transition-colors duration-200",
900
910
  "aria-label": "Remove file",
901
- onClick: q((C) => g(k), ["stop"])
911
+ onClick: Y((b) => k(V), ["stop"])
902
912
  }, " × ", 8, $t))
903
913
  ]))), 128))
904
914
  ])) : T("", !0)
@@ -927,8 +937,8 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
927
937
  readonly: { type: Boolean, default: !1 }
928
938
  },
929
939
  emits: ["update:modelValue", "blur", "focus"],
930
- setup(e, { emit: i }) {
931
- const t = e, a = i, r = K(), u = h(() => !!t.prefix || !!t.suffix), d = h(
940
+ setup(e, { emit: u }) {
941
+ const t = e, a = u, s = K(), o = x(() => !!t.prefix || !!t.suffix), d = x(
932
942
  () => [
933
943
  "w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm",
934
944
  "placeholder:text-gray-400",
@@ -937,19 +947,19 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
937
947
  t.disabled ? "opacity-50 cursor-not-allowed bg-gray-100" : "",
938
948
  t.prefix ? "rounded-l-none" : "",
939
949
  t.suffix ? "rounded-r-none" : "",
940
- r.classes.value.input
950
+ s.classes.value.input
941
951
  ].filter(Boolean).join(" ")
942
952
  );
943
953
  function l(n) {
944
- const s = n.target.value;
945
- if (s === "") {
954
+ const i = n.target.value;
955
+ if (i === "") {
946
956
  a("update:modelValue", null);
947
957
  return;
948
958
  }
949
- let g = parseFloat(s);
950
- Number.isNaN(g) || (t.precision !== void 0 && (g = parseFloat(g.toFixed(t.precision))), a("update:modelValue", g));
959
+ let k = parseFloat(i);
960
+ Number.isNaN(k) || (t.precision !== void 0 && (k = parseFloat(k.toFixed(t.precision))), a("update:modelValue", k));
951
961
  }
952
- return (n, o) => u.value ? (c(), f("div", Vt, [
962
+ return (n, r) => o.value ? (c(), f("div", Vt, [
953
963
  e.prefix ? (c(), f("span", St, L(e.prefix), 1)) : T("", !0),
954
964
  p("input", {
955
965
  type: "number",
@@ -959,12 +969,12 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
959
969
  step: e.step,
960
970
  disabled: e.disabled,
961
971
  readonly: e.readonly,
962
- class: S(d.value),
972
+ class: F(d.value),
963
973
  "aria-disabled": e.disabled || void 0,
964
974
  "aria-readonly": e.readonly || void 0,
965
975
  onInput: l,
966
- onBlur: o[0] || (o[0] = (s) => a("blur", s)),
967
- onFocus: o[1] || (o[1] = (s) => a("focus", s))
976
+ onBlur: r[0] || (r[0] = (i) => a("blur", i)),
977
+ onFocus: r[1] || (r[1] = (i) => a("focus", i))
968
978
  }, null, 42, Bt),
969
979
  e.suffix ? (c(), f("span", Ft, L(e.suffix), 1)) : T("", !0)
970
980
  ])) : (c(), f("input", {
@@ -976,18 +986,18 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
976
986
  step: e.step,
977
987
  disabled: e.disabled,
978
988
  readonly: e.readonly,
979
- class: S(d.value),
989
+ class: F(d.value),
980
990
  "aria-disabled": e.disabled || void 0,
981
991
  "aria-readonly": e.readonly || void 0,
982
992
  onInput: l,
983
- onBlur: o[2] || (o[2] = (s) => a("blur", s)),
984
- onFocus: o[3] || (o[3] = (s) => a("focus", s))
993
+ onBlur: r[2] || (r[2] = (i) => a("blur", i)),
994
+ onFocus: r[3] || (r[3] = (i) => a("focus", i))
985
995
  }, null, 42, Tt));
986
996
  }
987
- }), Lt = /* @__PURE__ */ ne(It, [["__scopeId", "data-v-4e51299b"]]), At = { class: "relative" }, Nt = ["disabled"], Dt = { class: "text-lg leading-none" }, Mt = { class: "text-xs text-gray-500 dark:text-gray-400 font-medium" }, Et = ["value", "placeholder", "disabled"], Rt = {
997
+ }), Lt = /* @__PURE__ */ oe(It, [["__scopeId", "data-v-4e51299b"]]), At = { class: "relative" }, Nt = ["disabled"], Dt = { class: "text-lg leading-none" }, Mt = { class: "text-xs text-gray-500 dark:text-gray-400 font-medium" }, Et = ["value", "placeholder", "disabled"], Rt = {
988
998
  key: 1,
989
999
  class: "absolute left-0 top-full z-50 mt-1 w-72 rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-xl overflow-hidden"
990
- }, jt = { class: "border-b border-gray-200 dark:border-gray-700 p-2" }, Ot = { class: "max-h-48 overflow-y-auto" }, zt = ["onMousedown"], Kt = { class: "text-lg leading-none" }, Pt = { class: "flex-1 truncate text-xs" }, Ut = { class: "text-[11px] text-gray-400 dark:text-gray-500 font-mono" }, Ht = {
1000
+ }, jt = { class: "border-b border-gray-200 dark:border-gray-700 p-2" }, zt = { class: "max-h-48 overflow-y-auto" }, Ot = ["onMousedown"], Kt = { class: "text-lg leading-none" }, Pt = { class: "flex-1 truncate text-xs" }, Ut = { class: "text-[11px] text-gray-400 dark:text-gray-500 font-mono" }, Ht = {
991
1001
  key: 0,
992
1002
  class: "px-3 py-4 text-center text-xs text-gray-400 dark:text-gray-500"
993
1003
  }, Gt = /* @__PURE__ */ j({
@@ -1001,8 +1011,8 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1001
1011
  disabled: { type: Boolean, default: !1 }
1002
1012
  },
1003
1013
  emits: ["update:modelValue", "blur"],
1004
- setup(e, { emit: i }) {
1005
- const t = e, a = i, r = {
1014
+ setup(e, { emit: u }) {
1015
+ const t = e, a = u, s = {
1006
1016
  AF: "Afghanistan",
1007
1017
  AL: "Albania",
1008
1018
  DZ: "Algeria",
@@ -1122,77 +1132,77 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1122
1132
  VN: "Vietnam",
1123
1133
  ZW: "Zimbabwe"
1124
1134
  };
1125
- function u(C) {
1126
- return C.toUpperCase().split("").map((w) => String.fromCodePoint(127462 + w.charCodeAt(0) - 65)).join("");
1127
- }
1128
- const d = h(() => {
1129
- var w;
1130
- return ((w = t.countries) != null && w.length ? t.countries.filter(
1131
- (N) => xe().includes(N)
1132
- ) : xe()).map((N) => ({
1133
- code: N,
1134
- name: r[N] ?? N,
1135
- dialCode: `+${ke(N)}`,
1136
- flag: u(N)
1137
- })).sort((N, B) => N.name.localeCompare(B.name));
1138
- }), l = D(t.defaultCountry), n = D(""), o = D(!1), s = D(""), g = D(null), $ = h(() => {
1139
- const C = s.value.toLowerCase();
1140
- return C ? d.value.filter(
1141
- (w) => w.name.toLowerCase().includes(C) || w.code.toLowerCase().includes(C) || w.dialCode.includes(C)
1135
+ function o(b) {
1136
+ return b.toUpperCase().split("").map((v) => String.fromCodePoint(127462 + v.charCodeAt(0) - 65)).join("");
1137
+ }
1138
+ const d = x(() => {
1139
+ var v;
1140
+ return ((v = t.countries) != null && v.length ? t.countries.filter(
1141
+ (B) => xe().includes(B)
1142
+ ) : xe()).map((B) => ({
1143
+ code: B,
1144
+ name: s[B] ?? B,
1145
+ dialCode: `+${ke(B)}`,
1146
+ flag: o(B)
1147
+ })).sort((B, S) => B.name.localeCompare(S.name));
1148
+ }), l = D(t.defaultCountry), n = D(""), r = D(!1), i = D(""), k = D(null), g = x(() => {
1149
+ const b = i.value.toLowerCase();
1150
+ return b ? d.value.filter(
1151
+ (v) => v.name.toLowerCase().includes(b) || v.code.toLowerCase().includes(b) || v.dialCode.includes(b)
1142
1152
  ) : d.value;
1143
- }), V = h(
1144
- () => d.value.find((C) => C.code === l.value) ?? d.value[0]
1153
+ }), $ = x(
1154
+ () => d.value.find((b) => b.code === l.value) ?? d.value[0]
1145
1155
  );
1146
1156
  ue(() => {
1147
- t.modelValue && b(t.modelValue);
1148
- }), Y(
1157
+ t.modelValue && m(t.modelValue);
1158
+ }), J(
1149
1159
  () => t.modelValue,
1150
- (C) => {
1151
- C && b(C);
1160
+ (b) => {
1161
+ b && m(b);
1152
1162
  }
1153
1163
  );
1154
- function b(C) {
1164
+ function m(b) {
1155
1165
  try {
1156
- const w = je(C);
1157
- if (w != null && w.country) {
1158
- l.value = w.country, n.value = w.nationalNumber;
1166
+ const v = ze(b);
1167
+ if (v != null && v.country) {
1168
+ l.value = v.country, n.value = v.nationalNumber;
1159
1169
  return;
1160
1170
  }
1161
1171
  } catch {
1162
1172
  }
1163
- n.value = C.replace(/^\+\d+\s*/, "");
1173
+ n.value = b.replace(/^\+\d+\s*/, "");
1164
1174
  }
1165
- function v() {
1175
+ function C() {
1166
1176
  if (!n.value.trim()) {
1167
1177
  a("update:modelValue", "");
1168
1178
  return;
1169
1179
  }
1170
- const C = new Oe(l.value);
1171
- C.input(`+${ke(l.value)}${n.value}`);
1172
- const w = C.getNumber();
1173
- a("update:modelValue", (w == null ? void 0 : w.format("E.164")) ?? n.value);
1174
- }
1175
- function m(C) {
1176
- const w = C.target;
1177
- n.value = w.value, v();
1178
- }
1179
- function y(C) {
1180
- l.value = C, o.value = !1, s.value = "", v();
1181
- }
1182
- function F() {
1183
- t.disabled || (o.value = !0, s.value = "", te(() => {
1184
- var C;
1185
- return (C = g.value) == null ? void 0 : C.focus();
1180
+ const b = new Oe(l.value);
1181
+ b.input(`+${ke(l.value)}${n.value}`);
1182
+ const v = b.getNumber();
1183
+ a("update:modelValue", (v == null ? void 0 : v.format("E.164")) ?? n.value);
1184
+ }
1185
+ function h(b) {
1186
+ const v = b.target;
1187
+ n.value = v.value, C();
1188
+ }
1189
+ function y(b) {
1190
+ l.value = b, r.value = !1, i.value = "", C();
1191
+ }
1192
+ function A() {
1193
+ t.disabled || (r.value = !0, i.value = "", ae(() => {
1194
+ var b;
1195
+ return (b = k.value) == null ? void 0 : b.focus();
1186
1196
  }));
1187
1197
  }
1188
- function k() {
1189
- o.value = !1, s.value = "";
1198
+ function V() {
1199
+ r.value = !1, i.value = "";
1190
1200
  }
1191
- return (C, w) => {
1192
- var N, B;
1201
+ return (b, v) => {
1202
+ var B, S;
1193
1203
  return c(), f("div", At, [
1194
1204
  p("div", {
1195
- class: S([
1205
+ class: F([
1196
1206
  "flex items-stretch rounded-lg border transition-colors",
1197
1207
  e.disabled ? "opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-800 border-gray-200 dark:border-gray-700" : "border-gray-300 dark:border-gray-600 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20"
1198
1208
  ])
@@ -1202,19 +1212,19 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1202
1212
  type: "button",
1203
1213
  disabled: e.disabled,
1204
1214
  class: "flex items-center gap-1.5 px-3 border-r border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 rounded-l-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors shrink-0",
1205
- onMousedown: w[0] || (w[0] = q((A) => o.value ? k() : F(), ["prevent"]))
1215
+ onMousedown: v[0] || (v[0] = Y((N) => r.value ? V() : A(), ["prevent"]))
1206
1216
  }, [
1207
- p("span", Dt, L((N = V.value) == null ? void 0 : N.flag), 1),
1208
- p("span", Mt, L((B = V.value) == null ? void 0 : B.dialCode), 1),
1217
+ p("span", Dt, L((B = $.value) == null ? void 0 : B.flag), 1),
1218
+ p("span", Mt, L((S = $.value) == null ? void 0 : S.dialCode), 1),
1209
1219
  (c(), f("svg", {
1210
- class: S(["h-3 w-3 text-gray-400 transition-transform", o.value ? "rotate-180" : ""]),
1220
+ class: F(["h-3 w-3 text-gray-400 transition-transform", r.value ? "rotate-180" : ""]),
1211
1221
  viewBox: "0 0 24 24",
1212
1222
  fill: "none",
1213
1223
  stroke: "currentColor",
1214
1224
  "stroke-width": "2",
1215
1225
  "stroke-linecap": "round",
1216
1226
  "stroke-linejoin": "round"
1217
- }, [...w[3] || (w[3] = [
1227
+ }, [...v[3] || (v[3] = [
1218
1228
  p("polyline", { points: "6 9 12 15 18 9" }, null, -1)
1219
1229
  ])], 2))
1220
1230
  ], 40, Nt)) : T("", !0),
@@ -1224,44 +1234,44 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1224
1234
  placeholder: e.placeholder || "Phone number",
1225
1235
  disabled: e.disabled,
1226
1236
  autocomplete: "tel-national",
1227
- class: S(["flex-1 bg-transparent px-3 py-2 text-sm text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 outline-none min-w-0", e.showDialCode ? "rounded-r-lg" : "rounded-lg"]),
1228
- onInput: m,
1229
- onBlur: w[1] || (w[1] = (A) => a("blur", A))
1237
+ class: F(["flex-1 bg-transparent px-3 py-2 text-sm text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 outline-none min-w-0", e.showDialCode ? "rounded-r-lg" : "rounded-lg"]),
1238
+ onInput: h,
1239
+ onBlur: v[1] || (v[1] = (N) => a("blur", N))
1230
1240
  }, null, 42, Et)
1231
1241
  ], 2),
1232
- o.value ? (c(), f("div", {
1242
+ r.value ? (c(), f("div", {
1233
1243
  key: 0,
1234
1244
  class: "fixed inset-0 z-40",
1235
- onMousedown: k
1245
+ onMousedown: V
1236
1246
  }, null, 32)) : T("", !0),
1237
- o.value ? (c(), f("div", Rt, [
1247
+ r.value ? (c(), f("div", Rt, [
1238
1248
  p("div", jt, [
1239
1249
  de(p("input", {
1240
1250
  ref_key: "searchInputRef",
1241
- ref: g,
1242
- "onUpdate:modelValue": w[2] || (w[2] = (A) => s.value = A),
1251
+ ref: k,
1252
+ "onUpdate:modelValue": v[2] || (v[2] = (N) => i.value = N),
1243
1253
  type: "text",
1244
1254
  placeholder: "Search country...",
1245
1255
  class: "w-full rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 px-3 py-1.5 text-xs text-gray-900 dark:text-white placeholder-gray-400 outline-none focus:border-primary-500"
1246
1256
  }, null, 512), [
1247
- [ve, s.value]
1257
+ [ve, i.value]
1248
1258
  ])
1249
1259
  ]),
1250
- p("div", Ot, [
1251
- (c(!0), f(z, null, G($.value, (A) => (c(), f("button", {
1252
- key: A.code,
1260
+ p("div", zt, [
1261
+ (c(!0), f(O, null, G(g.value, (N) => (c(), f("button", {
1262
+ key: N.code,
1253
1263
  type: "button",
1254
- class: S([
1264
+ class: F([
1255
1265
  "flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition-colors hover:bg-gray-50 dark:hover:bg-gray-800",
1256
- A.code === l.value ? "bg-primary-50 dark:bg-primary-950/30 text-primary-700 dark:text-primary-300" : "text-gray-700 dark:text-gray-300"
1266
+ N.code === l.value ? "bg-primary-50 dark:bg-primary-950/30 text-primary-700 dark:text-primary-300" : "text-gray-700 dark:text-gray-300"
1257
1267
  ]),
1258
- onMousedown: q((R) => y(A.code), ["prevent"])
1268
+ onMousedown: Y((R) => y(N.code), ["prevent"])
1259
1269
  }, [
1260
- p("span", Kt, L(A.flag), 1),
1261
- p("span", Pt, L(A.name), 1),
1262
- p("span", Ut, L(A.dialCode), 1)
1263
- ], 42, zt))), 128)),
1264
- $.value.length === 0 ? (c(), f("p", Ht, " No countries found ")) : T("", !0)
1270
+ p("span", Kt, L(N.flag), 1),
1271
+ p("span", Pt, L(N.name), 1),
1272
+ p("span", Ut, L(N.dialCode), 1)
1273
+ ], 42, Ot))), 128)),
1274
+ g.value.length === 0 ? (c(), f("p", Ht, " No countries found ")) : T("", !0)
1265
1275
  ])
1266
1276
  ])) : T("", !0)
1267
1277
  ]);
@@ -1280,56 +1290,56 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1280
1290
  disabled: { type: Boolean, default: !1 }
1281
1291
  },
1282
1292
  emits: ["update:modelValue", "blur"],
1283
- setup(e, { emit: i }) {
1284
- const t = e, a = i;
1293
+ setup(e, { emit: u }) {
1294
+ const t = e, a = u;
1285
1295
  K();
1286
- function r(n) {
1296
+ function s(n) {
1287
1297
  return t.modelValue === n;
1288
1298
  }
1289
- function u(n) {
1299
+ function o(n) {
1290
1300
  return t.disabled || !!n.disabled;
1291
1301
  }
1292
1302
  function d(n) {
1293
- u(n) || a("update:modelValue", n.value);
1303
+ o(n) || a("update:modelValue", n.value);
1294
1304
  }
1295
- function l(n, o) {
1296
- (n.key === " " || n.key === "Enter") && (n.preventDefault(), d(o));
1305
+ function l(n, r) {
1306
+ (n.key === " " || n.key === "Enter") && (n.preventDefault(), d(r));
1297
1307
  }
1298
- return (n, o) => (c(), f("div", {
1308
+ return (n, r) => (c(), f("div", {
1299
1309
  role: "radiogroup",
1300
- class: S(e.inline ? "flex flex-wrap gap-4" : "flex flex-col gap-2")
1310
+ class: F(e.inline ? "flex flex-wrap gap-4" : "flex flex-col gap-2")
1301
1311
  }, [
1302
- (c(!0), f(z, null, G(e.options, (s) => (c(), f("label", {
1303
- key: String(s.value),
1304
- class: S([
1312
+ (c(!0), f(O, null, G(e.options, (i) => (c(), f("label", {
1313
+ key: String(i.value),
1314
+ class: F([
1305
1315
  "inline-flex items-center gap-2 select-none",
1306
- u(s) ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
1316
+ o(i) ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
1307
1317
  ])
1308
1318
  }, [
1309
1319
  p("input", {
1310
1320
  type: "radio",
1311
- checked: r(s.value),
1312
- disabled: u(s),
1321
+ checked: s(i.value),
1322
+ disabled: o(i),
1313
1323
  class: "sr-only",
1314
- onChange: (g) => d(s),
1315
- onBlur: o[0] || (o[0] = (g) => a("blur", g))
1324
+ onChange: (k) => d(i),
1325
+ onBlur: r[0] || (r[0] = (k) => a("blur", k))
1316
1326
  }, null, 40, Zt),
1317
1327
  p("div", {
1318
1328
  role: "radio",
1319
- "aria-checked": r(s.value),
1320
- "aria-disabled": u(s) || void 0,
1329
+ "aria-checked": s(i.value),
1330
+ "aria-disabled": o(i) || void 0,
1321
1331
  tabindex: "0",
1322
- class: S([
1332
+ class: F([
1323
1333
  "flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-200",
1324
- r(s.value) ? "" : "border-gray-300"
1334
+ s(i.value) ? "" : "border-gray-300"
1325
1335
  ]),
1326
- style: O(r(s.value) ? { borderColor: "var(--fc-color-primary, #3b82f6)" } : {}),
1327
- onClick: (g) => d(s),
1328
- onKeydown: (g) => l(g, s)
1336
+ style: z(s(i.value) ? { borderColor: "var(--fc-color-primary, #3b82f6)" } : {}),
1337
+ onClick: (k) => d(i),
1338
+ onKeydown: (k) => l(k, i)
1329
1339
  }, [
1330
- r(s.value) ? (c(), f("div", Yt)) : T("", !0)
1340
+ s(i.value) ? (c(), f("div", Yt)) : T("", !0)
1331
1341
  ], 46, qt),
1332
- p("span", Jt, L(s.label), 1)
1342
+ p("span", Jt, L(i.label), 1)
1333
1343
  ], 2))), 128))
1334
1344
  ], 2));
1335
1345
  }
@@ -1363,132 +1373,132 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1363
1373
  disabled: { type: Boolean, default: !1 }
1364
1374
  },
1365
1375
  emits: ["update:modelValue", "blur"],
1366
- setup(e, { emit: i }) {
1367
- const t = e, a = i, r = K(), u = D(!1), d = D(""), l = D(-1), n = D(null), o = D(null), s = h(() => t.modelValue === null || t.modelValue === void 0 ? [] : Array.isArray(t.modelValue) ? t.modelValue : [t.modelValue]), g = h(() => {
1368
- if (s.value.length === 0 || t.multiple) return "";
1369
- const B = t.options.find((A) => A.value === s.value[0]);
1370
- return (B == null ? void 0 : B.label) ?? String(s.value[0]);
1371
- }), $ = h(() => {
1376
+ setup(e, { emit: u }) {
1377
+ const t = e, a = u, s = K(), o = D(!1), d = D(""), l = D(-1), n = D(null), r = D(null), i = x(() => t.modelValue === null || t.modelValue === void 0 ? [] : Array.isArray(t.modelValue) ? t.modelValue : [t.modelValue]), k = x(() => {
1378
+ if (i.value.length === 0 || t.multiple) return "";
1379
+ const S = t.options.find((N) => N.value === i.value[0]);
1380
+ return (S == null ? void 0 : S.label) ?? String(i.value[0]);
1381
+ }), g = x(() => {
1372
1382
  if (!d.value) return t.options;
1373
- const B = d.value.toLowerCase();
1374
- return t.options.filter((A) => A.label.toLowerCase().includes(B));
1383
+ const S = d.value.toLowerCase();
1384
+ return t.options.filter((N) => N.label.toLowerCase().includes(S));
1375
1385
  });
1376
- function V(B) {
1377
- return s.value.includes(B);
1386
+ function $(S) {
1387
+ return i.value.includes(S);
1378
1388
  }
1379
- function b() {
1380
- t.disabled || (u.value ? m() : v());
1389
+ function m() {
1390
+ t.disabled || (o.value ? h() : C());
1381
1391
  }
1382
- function v() {
1383
- u.value = !0, l.value = -1, d.value = "", te(() => {
1384
- var B;
1385
- return (B = o.value) == null ? void 0 : B.focus();
1392
+ function C() {
1393
+ o.value = !0, l.value = -1, d.value = "", ae(() => {
1394
+ var S;
1395
+ return (S = r.value) == null ? void 0 : S.focus();
1386
1396
  });
1387
1397
  }
1388
- function m() {
1389
- u.value = !1, d.value = "";
1398
+ function h() {
1399
+ o.value = !1, d.value = "";
1390
1400
  }
1391
- function y(B) {
1392
- if (!B.disabled)
1401
+ function y(S) {
1402
+ if (!S.disabled)
1393
1403
  if (t.multiple) {
1394
- const A = [...s.value], R = A.indexOf(B.value);
1395
- R >= 0 ? A.splice(R, 1) : A.push(B.value), a("update:modelValue", A);
1404
+ const N = [...i.value], R = N.indexOf(S.value);
1405
+ R >= 0 ? N.splice(R, 1) : N.push(S.value), a("update:modelValue", N);
1396
1406
  } else
1397
- a("update:modelValue", B.value), m();
1407
+ a("update:modelValue", S.value), h();
1398
1408
  }
1399
- function F(B) {
1409
+ function A(S) {
1400
1410
  if (t.disabled) return;
1401
- const A = s.value.filter((R) => R !== B);
1402
- a("update:modelValue", A.length ? A : t.multiple ? [] : null);
1411
+ const N = i.value.filter((R) => R !== S);
1412
+ a("update:modelValue", N.length ? N : t.multiple ? [] : null);
1403
1413
  }
1404
- function k(B) {
1405
- B.stopPropagation(), a("update:modelValue", t.multiple ? [] : null);
1414
+ function V(S) {
1415
+ S.stopPropagation(), a("update:modelValue", t.multiple ? [] : null);
1406
1416
  }
1407
- function C(B) {
1408
- if (!u.value) {
1409
- (B.key === "Enter" || B.key === " " || B.key === "ArrowDown") && (B.preventDefault(), v());
1417
+ function b(S) {
1418
+ if (!o.value) {
1419
+ (S.key === "Enter" || S.key === " " || S.key === "ArrowDown") && (S.preventDefault(), C());
1410
1420
  return;
1411
1421
  }
1412
- switch (B.key) {
1422
+ switch (S.key) {
1413
1423
  case "ArrowDown":
1414
- B.preventDefault(), l.value = Math.min(
1424
+ S.preventDefault(), l.value = Math.min(
1415
1425
  l.value + 1,
1416
- $.value.length - 1
1426
+ g.value.length - 1
1417
1427
  );
1418
1428
  break;
1419
1429
  case "ArrowUp":
1420
- B.preventDefault(), l.value = Math.max(l.value - 1, 0);
1430
+ S.preventDefault(), l.value = Math.max(l.value - 1, 0);
1421
1431
  break;
1422
1432
  case "Enter":
1423
- B.preventDefault(), l.value >= 0 && $.value[l.value] && y($.value[l.value]);
1433
+ S.preventDefault(), l.value >= 0 && g.value[l.value] && y(g.value[l.value]);
1424
1434
  break;
1425
1435
  case "Escape":
1426
- B.preventDefault(), m();
1436
+ S.preventDefault(), h();
1427
1437
  break;
1428
1438
  }
1429
1439
  }
1430
- function w(B) {
1431
- n.value && !n.value.contains(B.target) && m();
1440
+ function v(S) {
1441
+ n.value && !n.value.contains(S.target) && h();
1432
1442
  }
1433
- function N(B) {
1434
- const A = t.options.find((R) => R.value === B);
1435
- return (A == null ? void 0 : A.label) ?? String(B);
1443
+ function B(S) {
1444
+ const N = t.options.find((R) => R.value === S);
1445
+ return (N == null ? void 0 : N.label) ?? String(S);
1436
1446
  }
1437
- return ue(() => document.addEventListener("mousedown", w)), Ve(() => document.removeEventListener("mousedown", w)), Y(u, (B) => {
1438
- B || a("blur", new FocusEvent("blur"));
1439
- }), (B, A) => (c(), f("div", {
1447
+ return ue(() => document.addEventListener("mousedown", v)), Ve(() => document.removeEventListener("mousedown", v)), J(o, (S) => {
1448
+ S || a("blur", new FocusEvent("blur"));
1449
+ }), (S, N) => (c(), f("div", {
1440
1450
  ref_key: "containerRef",
1441
1451
  ref: n,
1442
- class: S([
1452
+ class: F([
1443
1453
  "relative w-full",
1444
- H(r).classes.value.input,
1454
+ H(s).classes.value.input,
1445
1455
  e.disabled ? "opacity-50 cursor-not-allowed" : ""
1446
1456
  ])
1447
1457
  }, [
1448
1458
  p("div", {
1449
1459
  role: "combobox",
1450
- "aria-expanded": u.value,
1460
+ "aria-expanded": o.value,
1451
1461
  "aria-haspopup": "listbox",
1452
1462
  tabindex: "0",
1453
- class: S([
1463
+ class: F([
1454
1464
  "flex min-h-[38px] w-full cursor-pointer items-center rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm",
1455
1465
  "transition-colors duration-200",
1456
- u.value ? "ring-2 ring-blue-500/20" : "",
1466
+ o.value ? "ring-2 ring-blue-500/20" : "",
1457
1467
  e.disabled ? "pointer-events-none bg-gray-100" : ""
1458
1468
  ]),
1459
- style: O(u.value ? { borderColor: "var(--fc-color-primary, #3b82f6)" } : {}),
1460
- onClick: b,
1461
- onKeydown: C
1469
+ style: z(o.value ? { borderColor: "var(--fc-color-primary, #3b82f6)" } : {}),
1470
+ onClick: m,
1471
+ onKeydown: b
1462
1472
  }, [
1463
1473
  p("div", Qt, [
1464
- e.multiple ? (c(!0), f(z, { key: 0 }, G(s.value, (R) => (c(), f("span", {
1474
+ e.multiple ? (c(!0), f(O, { key: 0 }, G(i.value, (R) => (c(), f("span", {
1465
1475
  key: String(R),
1466
1476
  class: "inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs",
1467
1477
  style: { backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 15%, white)", color: "var(--fc-color-primary, #3b82f6)" }
1468
1478
  }, [
1469
- _(L(N(R)) + " ", 1),
1479
+ _(L(B(R)) + " ", 1),
1470
1480
  p("button", {
1471
1481
  type: "button",
1472
1482
  class: "ml-0.5",
1473
1483
  style: { color: "var(--fc-color-primary, #3b82f6)" },
1474
1484
  "aria-label": "Remove",
1475
- onClick: q((Q) => F(R), ["stop"])
1485
+ onClick: Y((Q) => A(R), ["stop"])
1476
1486
  }, " × ", 8, Xt)
1477
- ]))), 128)) : g.value ? (c(), f("span", ea, L(g.value), 1)) : (c(), f("span", ta, L(e.placeholder), 1))
1487
+ ]))), 128)) : k.value ? (c(), f("span", ea, L(k.value), 1)) : (c(), f("span", ta, L(e.placeholder), 1))
1478
1488
  ]),
1479
- e.clearable && s.value.length > 0 && !e.disabled ? (c(), f("button", {
1489
+ e.clearable && i.value.length > 0 && !e.disabled ? (c(), f("button", {
1480
1490
  key: 0,
1481
1491
  type: "button",
1482
1492
  class: "ml-1 shrink-0 text-gray-400 hover:text-gray-600 transition-colors duration-200",
1483
1493
  "aria-label": "Clear selection",
1484
- onClick: k
1494
+ onClick: V
1485
1495
  }, " × ")) : T("", !0),
1486
1496
  (c(), f("svg", {
1487
- class: S(["ml-1 h-4 w-4 shrink-0 text-gray-400 transition-transform duration-200", u.value ? "rotate-180" : ""]),
1497
+ class: F(["ml-1 h-4 w-4 shrink-0 text-gray-400 transition-transform duration-200", o.value ? "rotate-180" : ""]),
1488
1498
  viewBox: "0 0 20 20",
1489
1499
  fill: "currentColor",
1490
1500
  "aria-hidden": "true"
1491
- }, [...A[1] || (A[1] = [
1501
+ }, [...N[1] || (N[1] = [
1492
1502
  p("path", {
1493
1503
  "fill-rule": "evenodd",
1494
1504
  d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",
@@ -1496,41 +1506,41 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1496
1506
  }, null, -1)
1497
1507
  ])], 2))
1498
1508
  ], 46, _t),
1499
- u.value ? (c(), f("div", aa, [
1509
+ o.value ? (c(), f("div", aa, [
1500
1510
  e.searchable ? (c(), f("div", la, [
1501
1511
  de(p("input", {
1502
1512
  ref_key: "searchInputRef",
1503
- ref: o,
1504
- "onUpdate:modelValue": A[0] || (A[0] = (R) => d.value = R),
1513
+ ref: r,
1514
+ "onUpdate:modelValue": N[0] || (N[0] = (R) => d.value = R),
1505
1515
  type: "text",
1506
1516
  class: "w-full rounded border border-gray-300 px-2 py-1 text-sm focus:outline-none fc-select-search",
1507
1517
  placeholder: "Search...",
1508
- onKeydown: C
1518
+ onKeydown: b
1509
1519
  }, null, 544), [
1510
1520
  [ve, d.value]
1511
1521
  ])
1512
1522
  ])) : T("", !0),
1513
1523
  p("ul", na, [
1514
- (c(!0), f(z, null, G($.value, (R, Q) => (c(), f("li", {
1524
+ (c(!0), f(O, null, G(g.value, (R, Q) => (c(), f("li", {
1515
1525
  key: String(R.value),
1516
1526
  role: "option",
1517
- "aria-selected": V(R.value),
1518
- class: S([
1527
+ "aria-selected": $(R.value),
1528
+ class: F([
1519
1529
  "cursor-pointer px-3 py-2 text-sm transition-colors duration-200",
1520
- V(R.value) ? "" : "text-gray-900",
1530
+ $(R.value) ? "" : "text-gray-900",
1521
1531
  l.value === Q ? "bg-gray-100" : "",
1522
1532
  R.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-gray-50"
1523
1533
  ]),
1524
- style: O(V(R.value) ? { backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)", color: "var(--fc-color-primary, #3b82f6)" } : {}),
1534
+ style: z($(R.value) ? { backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)", color: "var(--fc-color-primary, #3b82f6)" } : {}),
1525
1535
  onClick: (ee) => y(R),
1526
1536
  onMouseenter: (ee) => l.value = Q
1527
1537
  }, L(R.label), 47, oa))), 128)),
1528
- $.value.length === 0 ? (c(), f("li", ra, " No options found ")) : T("", !0)
1538
+ g.value.length === 0 ? (c(), f("li", ra, " No options found ")) : T("", !0)
1529
1539
  ])
1530
1540
  ])) : T("", !0)
1531
1541
  ], 2));
1532
1542
  }
1533
- }), ia = /* @__PURE__ */ ne(sa, [["__scopeId", "data-v-b34f2a7d"]]), ua = ["value", "min", "max", "step", "disabled", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-disabled"], da = { class: "mt-1 flex justify-between text-xs text-gray-400" }, ca = /* @__PURE__ */ j({
1543
+ }), ia = /* @__PURE__ */ oe(sa, [["__scopeId", "data-v-b34f2a7d"]]), ua = ["value", "min", "max", "step", "disabled", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-disabled"], da = { class: "mt-1 flex justify-between text-xs text-gray-400" }, ca = /* @__PURE__ */ j({
1534
1544
  __name: "SliderInput",
1535
1545
  props: {
1536
1546
  modelValue: {},
@@ -1541,10 +1551,10 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1541
1551
  disabled: { type: Boolean, default: !1 }
1542
1552
  },
1543
1553
  emits: ["update:modelValue", "blur"],
1544
- setup(e, { emit: i }) {
1545
- const t = e, a = i;
1554
+ setup(e, { emit: u }) {
1555
+ const t = e, a = u;
1546
1556
  K();
1547
- const r = D(!1), u = h(() => {
1557
+ const s = D(!1), o = x(() => {
1548
1558
  const l = t.max - t.min;
1549
1559
  return l === 0 ? 0 : (t.modelValue - t.min) / l * 100;
1550
1560
  });
@@ -1553,15 +1563,15 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1553
1563
  a("update:modelValue", parseFloat(n.value));
1554
1564
  }
1555
1565
  return (l, n) => (c(), f("div", {
1556
- class: S([
1566
+ class: F([
1557
1567
  "relative w-full py-2",
1558
1568
  e.disabled ? "opacity-50 cursor-not-allowed" : ""
1559
1569
  ])
1560
1570
  }, [
1561
- e.showTooltip && r.value ? (c(), f("div", {
1571
+ e.showTooltip && s.value ? (c(), f("div", {
1562
1572
  key: 0,
1563
1573
  class: "absolute -top-8 rounded bg-gray-800 px-2 py-1 text-xs text-white shadow-sm transition-opacity duration-200",
1564
- style: O({ left: `calc(${u.value}% - 16px)` })
1574
+ style: z({ left: `calc(${o.value}% - 16px)` })
1565
1575
  }, L(e.modelValue), 5)) : T("", !0),
1566
1576
  p("input", {
1567
1577
  type: "range",
@@ -1577,13 +1587,13 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1577
1587
  class: "h-2 w-full cursor-pointer appearance-none rounded-full bg-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500/20 disabled:pointer-events-none",
1578
1588
  style: { accentColor: "var(--fc-color-primary, #3b82f6)" },
1579
1589
  onInput: d,
1580
- onMousedown: n[0] || (n[0] = (o) => r.value = !0),
1581
- onMouseup: n[1] || (n[1] = (o) => r.value = !1),
1582
- onTouchstart: n[2] || (n[2] = (o) => r.value = !0),
1583
- onTouchend: n[3] || (n[3] = (o) => r.value = !1),
1584
- onFocus: n[4] || (n[4] = (o) => r.value = !0),
1585
- onBlur: n[5] || (n[5] = (o) => {
1586
- r.value = !1, a("blur", o);
1590
+ onMousedown: n[0] || (n[0] = (r) => s.value = !0),
1591
+ onMouseup: n[1] || (n[1] = (r) => s.value = !1),
1592
+ onTouchstart: n[2] || (n[2] = (r) => s.value = !0),
1593
+ onTouchend: n[3] || (n[3] = (r) => s.value = !1),
1594
+ onFocus: n[4] || (n[4] = (r) => s.value = !0),
1595
+ onBlur: n[5] || (n[5] = (r) => {
1596
+ s.value = !1, a("blur", r);
1587
1597
  })
1588
1598
  }, null, 40, ua),
1589
1599
  p("div", da, [
@@ -1607,21 +1617,21 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1607
1617
  disabled: { type: Boolean, default: !1 }
1608
1618
  },
1609
1619
  emits: ["update:modelValue", "blur"],
1610
- setup(e, { emit: i }) {
1611
- const t = e, a = i;
1620
+ setup(e, { emit: u }) {
1621
+ const t = e, a = u;
1612
1622
  K();
1613
- const r = h(() => [
1623
+ const s = x(() => [
1614
1624
  "inline-flex items-center gap-2 select-none",
1615
1625
  t.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
1616
1626
  ]);
1617
- function u() {
1627
+ function o() {
1618
1628
  t.disabled || a("update:modelValue", !t.modelValue);
1619
1629
  }
1620
1630
  function d(l) {
1621
- (l.key === " " || l.key === "Enter") && (l.preventDefault(), u());
1631
+ (l.key === " " || l.key === "Enter") && (l.preventDefault(), o());
1622
1632
  }
1623
1633
  return (l, n) => (c(), f("label", {
1624
- class: S(r.value)
1634
+ class: F(s.value)
1625
1635
  }, [
1626
1636
  e.inactiveLabel ? (c(), f("span", fa, L(e.inactiveLabel), 1)) : T("", !0),
1627
1637
  p("input", {
@@ -1629,8 +1639,8 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1629
1639
  checked: e.modelValue,
1630
1640
  disabled: e.disabled,
1631
1641
  class: "sr-only",
1632
- onChange: u,
1633
- onBlur: n[0] || (n[0] = (o) => a("blur", o))
1642
+ onChange: o,
1643
+ onBlur: n[0] || (n[0] = (r) => a("blur", r))
1634
1644
  }, null, 40, ma),
1635
1645
  p("button", {
1636
1646
  type: "button",
@@ -1638,17 +1648,17 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1638
1648
  "aria-checked": e.modelValue,
1639
1649
  "aria-disabled": e.disabled || void 0,
1640
1650
  tabindex: "0",
1641
- class: S([
1651
+ class: F([
1642
1652
  "relative inline-flex h-6 w-11 shrink-0 rounded-full border-2 border-transparent transition-colors duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]",
1643
1653
  e.modelValue ? "" : "bg-gray-300",
1644
1654
  e.disabled ? "pointer-events-none" : "focus:outline-none focus:ring-2 focus:ring-blue-500/20"
1645
1655
  ]),
1646
- style: O(e.modelValue ? { backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
1647
- onClick: u,
1656
+ style: z(e.modelValue ? { backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
1657
+ onClick: o,
1648
1658
  onKeydown: d
1649
1659
  }, [
1650
1660
  p("span", {
1651
- class: S([
1661
+ class: F([
1652
1662
  "pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow-sm transition-transform duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]",
1653
1663
  e.modelValue ? "translate-x-5" : "translate-x-0"
1654
1664
  ]),
@@ -1672,118 +1682,118 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1672
1682
  disabled: { type: Boolean, default: !1 }
1673
1683
  },
1674
1684
  emits: ["update:modelValue", "blur"],
1675
- setup(e, { emit: i }) {
1676
- const t = e, a = h(() => Array.isArray(t.modelValue) ? t.modelValue : []), r = i, u = K(), d = D(""), l = D(!1), n = D(!1), o = D(-1), s = D(null), g = D(null), $ = h(() => !t.maxTags || a.value.length < t.maxTags), V = h(() => {
1685
+ setup(e, { emit: u }) {
1686
+ const t = e, a = x(() => Array.isArray(t.modelValue) ? t.modelValue : []), s = u, o = K(), d = D(""), l = D(!1), n = D(!1), r = D(-1), i = D(null), k = D(null), g = x(() => !t.maxTags || a.value.length < t.maxTags), $ = x(() => {
1677
1687
  if (!d.value || t.suggestions.length === 0) return [];
1678
- const k = d.value.toLowerCase();
1688
+ const V = d.value.toLowerCase();
1679
1689
  return t.suggestions.filter(
1680
- (C) => C.toLowerCase().includes(k) && !a.value.includes(C)
1690
+ (b) => b.toLowerCase().includes(V) && !a.value.includes(b)
1681
1691
  );
1682
1692
  });
1683
- function b(k) {
1684
- const C = k.trim();
1685
- !C || !$.value || a.value.includes(C) || (r("update:modelValue", [...a.value, C]), d.value = "", n.value = !1, o.value = -1);
1693
+ function m(V) {
1694
+ const b = V.trim();
1695
+ !b || !g.value || a.value.includes(b) || (s("update:modelValue", [...a.value, b]), d.value = "", n.value = !1, r.value = -1);
1686
1696
  }
1687
- function v(k) {
1697
+ function C(V) {
1688
1698
  if (t.disabled) return;
1689
- const C = a.value.filter((w, N) => N !== k);
1690
- r("update:modelValue", C);
1699
+ const b = a.value.filter((v, B) => B !== V);
1700
+ s("update:modelValue", b);
1691
1701
  }
1692
- function m(k) {
1693
- if (k.key === "Enter" || k.key === ",") {
1694
- k.preventDefault(), o.value >= 0 && V.value[o.value] ? b(V.value[o.value]) : b(d.value);
1702
+ function h(V) {
1703
+ if (V.key === "Enter" || V.key === ",") {
1704
+ V.preventDefault(), r.value >= 0 && $.value[r.value] ? m($.value[r.value]) : m(d.value);
1695
1705
  return;
1696
1706
  }
1697
- if (k.key === "Backspace" && d.value === "" && a.value.length > 0) {
1698
- v(a.value.length - 1);
1707
+ if (V.key === "Backspace" && d.value === "" && a.value.length > 0) {
1708
+ C(a.value.length - 1);
1699
1709
  return;
1700
1710
  }
1701
- if (k.key === "ArrowDown" && n.value) {
1702
- k.preventDefault(), o.value = Math.min(
1703
- o.value + 1,
1704
- V.value.length - 1
1711
+ if (V.key === "ArrowDown" && n.value) {
1712
+ V.preventDefault(), r.value = Math.min(
1713
+ r.value + 1,
1714
+ $.value.length - 1
1705
1715
  );
1706
1716
  return;
1707
1717
  }
1708
- if (k.key === "ArrowUp" && n.value) {
1709
- k.preventDefault(), o.value = Math.max(o.value - 1, 0);
1718
+ if (V.key === "ArrowUp" && n.value) {
1719
+ V.preventDefault(), r.value = Math.max(r.value - 1, 0);
1710
1720
  return;
1711
1721
  }
1712
- k.key === "Escape" && (n.value = !1, o.value = -1);
1722
+ V.key === "Escape" && (n.value = !1, r.value = -1);
1713
1723
  }
1714
1724
  function y() {
1715
- n.value = d.value.length > 0 && V.value.length > 0, o.value = -1;
1725
+ n.value = d.value.length > 0 && $.value.length > 0, r.value = -1;
1716
1726
  }
1717
- function F(k) {
1718
- s.value && !s.value.contains(k.target) && (n.value = !1);
1727
+ function A(V) {
1728
+ i.value && !i.value.contains(V.target) && (n.value = !1);
1719
1729
  }
1720
- return ue(() => document.addEventListener("mousedown", F)), Ve(() => document.removeEventListener("mousedown", F)), Y(d, () => {
1721
- te(y);
1722
- }), (k, C) => (c(), f("div", {
1730
+ return ue(() => document.addEventListener("mousedown", A)), Ve(() => document.removeEventListener("mousedown", A)), J(d, () => {
1731
+ ae(y);
1732
+ }), (V, b) => (c(), f("div", {
1723
1733
  ref_key: "containerRef",
1724
- ref: s,
1725
- class: S([
1734
+ ref: i,
1735
+ class: F([
1726
1736
  "relative w-full",
1727
1737
  e.disabled ? "opacity-50 cursor-not-allowed" : ""
1728
1738
  ])
1729
1739
  }, [
1730
1740
  p("div", {
1731
- class: S([
1741
+ class: F([
1732
1742
  "flex flex-wrap items-center gap-1.5 rounded-md border bg-white px-2 py-1.5 text-sm transition-colors duration-200",
1733
1743
  l.value ? "ring-2 ring-blue-500/20" : "border-gray-300",
1734
- H(u).classes.value.input
1744
+ H(o).classes.value.input
1735
1745
  ]),
1736
- style: O(l.value ? { borderColor: "var(--fc-color-primary, #3b82f6)" } : {}),
1737
- onClick: C[3] || (C[3] = (w) => {
1738
- var N;
1739
- return (N = g.value) == null ? void 0 : N.focus();
1746
+ style: z(l.value ? { borderColor: "var(--fc-color-primary, #3b82f6)" } : {}),
1747
+ onClick: b[3] || (b[3] = (v) => {
1748
+ var B;
1749
+ return (B = k.value) == null ? void 0 : B.focus();
1740
1750
  })
1741
1751
  }, [
1742
- (c(!0), f(z, null, G(a.value, (w, N) => (c(), f("span", {
1743
- key: w,
1752
+ (c(!0), f(O, null, G(a.value, (v, B) => (c(), f("span", {
1753
+ key: v,
1744
1754
  class: "inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs",
1745
1755
  style: { backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 15%, white)", color: "var(--fc-color-primary, #3b82f6)" }
1746
1756
  }, [
1747
- _(L(w) + " ", 1),
1757
+ _(L(v) + " ", 1),
1748
1758
  e.disabled ? T("", !0) : (c(), f("button", {
1749
1759
  key: 0,
1750
1760
  type: "button",
1751
1761
  class: "ml-0.5 transition-colors duration-200",
1752
1762
  style: { color: "var(--fc-color-primary, #3b82f6)" },
1753
1763
  "aria-label": "Remove tag",
1754
- onClick: q((B) => v(N), ["stop"])
1764
+ onClick: Y((S) => C(B), ["stop"])
1755
1765
  }, " × ", 8, pa))
1756
1766
  ]))), 128)),
1757
1767
  de(p("input", {
1758
1768
  ref_key: "inputRef",
1759
- ref: g,
1760
- "onUpdate:modelValue": C[0] || (C[0] = (w) => d.value = w),
1769
+ ref: k,
1770
+ "onUpdate:modelValue": b[0] || (b[0] = (v) => d.value = v),
1761
1771
  type: "text",
1762
1772
  placeholder: a.value.length === 0 ? e.placeholder : "",
1763
1773
  disabled: e.disabled,
1764
1774
  class: "min-w-[80px] flex-1 border-0 bg-transparent p-0 text-sm outline-none placeholder:text-gray-400",
1765
- onKeydown: m,
1766
- onFocus: C[1] || (C[1] = (w) => l.value = !0),
1767
- onBlur: C[2] || (C[2] = (w) => {
1768
- l.value = !1, r("blur", w);
1775
+ onKeydown: h,
1776
+ onFocus: b[1] || (b[1] = (v) => l.value = !0),
1777
+ onBlur: b[2] || (b[2] = (v) => {
1778
+ l.value = !1, s("blur", v);
1769
1779
  })
1770
1780
  }, null, 40, ga), [
1771
1781
  [ve, d.value]
1772
1782
  ])
1773
1783
  ], 6),
1774
- n.value && V.value.length > 0 ? (c(), f("ul", ha, [
1775
- (c(!0), f(z, null, G(V.value, (w, N) => (c(), f("li", {
1776
- key: w,
1784
+ n.value && $.value.length > 0 ? (c(), f("ul", ha, [
1785
+ (c(!0), f(O, null, G($.value, (v, B) => (c(), f("li", {
1786
+ key: v,
1777
1787
  role: "option",
1778
- "aria-selected": o.value === N,
1779
- class: S([
1788
+ "aria-selected": r.value === B,
1789
+ class: F([
1780
1790
  "cursor-pointer px-3 py-2 text-sm transition-colors duration-200",
1781
- o.value !== N ? "text-gray-900 hover:bg-gray-50" : ""
1791
+ r.value !== B ? "text-gray-900 hover:bg-gray-50" : ""
1782
1792
  ]),
1783
- style: O(o.value === N ? { backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)", color: "var(--fc-color-primary, #3b82f6)" } : {}),
1784
- onMousedown: q((B) => b(w), ["prevent"]),
1785
- onMouseenter: (B) => o.value = N
1786
- }, L(w), 47, xa))), 128))
1793
+ style: z(r.value === B ? { backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)", color: "var(--fc-color-primary, #3b82f6)" } : {}),
1794
+ onMousedown: Y((S) => m(v), ["prevent"]),
1795
+ onMouseenter: (S) => r.value = B
1796
+ }, L(v), 47, xa))), 128))
1787
1797
  ])) : T("", !0)
1788
1798
  ], 2));
1789
1799
  }
@@ -1799,8 +1809,8 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1799
1809
  readonly: { type: Boolean, default: !1 }
1800
1810
  },
1801
1811
  emits: ["update:modelValue", "blur", "focus"],
1802
- setup(e, { emit: i }) {
1803
- const t = e, a = i, r = K(), u = D(null), d = h(
1812
+ setup(e, { emit: u }) {
1813
+ const t = e, a = u, s = K(), o = D(null), d = x(
1804
1814
  () => [
1805
1815
  "w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm",
1806
1816
  "placeholder:text-gray-400 resize-y",
@@ -1808,43 +1818,43 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1808
1818
  "transition-colors duration-200",
1809
1819
  t.disabled ? "opacity-50 cursor-not-allowed bg-gray-100" : "",
1810
1820
  t.autoResize ? "resize-none overflow-hidden" : "",
1811
- r.classes.value.input
1821
+ s.classes.value.input
1812
1822
  ].filter(Boolean).join(" ")
1813
1823
  );
1814
1824
  function l() {
1815
- if (!t.autoResize || !u.value) return;
1816
- const o = u.value;
1817
- o.style.height = "auto", o.style.height = `${o.scrollHeight}px`;
1825
+ if (!t.autoResize || !o.value) return;
1826
+ const r = o.value;
1827
+ r.style.height = "auto", r.style.height = `${r.scrollHeight}px`;
1818
1828
  }
1819
- function n(o) {
1820
- const s = o.target;
1821
- a("update:modelValue", s.value), t.autoResize && te(l);
1829
+ function n(r) {
1830
+ const i = r.target;
1831
+ a("update:modelValue", i.value), t.autoResize && ae(l);
1822
1832
  }
1823
- return Y(
1833
+ return J(
1824
1834
  () => t.modelValue,
1825
1835
  () => {
1826
- t.autoResize && te(l);
1836
+ t.autoResize && ae(l);
1827
1837
  }
1828
1838
  ), ue(() => {
1829
1839
  t.autoResize && l();
1830
- }), (o, s) => (c(), f("textarea", {
1840
+ }), (r, i) => (c(), f("textarea", {
1831
1841
  ref_key: "textareaRef",
1832
- ref: u,
1842
+ ref: o,
1833
1843
  value: e.modelValue,
1834
1844
  rows: e.rows,
1835
1845
  maxlength: e.maxLength,
1836
1846
  placeholder: e.placeholder,
1837
1847
  disabled: e.disabled,
1838
1848
  readonly: e.readonly,
1839
- class: S(d.value),
1849
+ class: F(d.value),
1840
1850
  "aria-disabled": e.disabled || void 0,
1841
1851
  "aria-readonly": e.readonly || void 0,
1842
1852
  onInput: n,
1843
- onBlur: s[0] || (s[0] = (g) => a("blur", g)),
1844
- onFocus: s[1] || (s[1] = (g) => a("focus", g))
1853
+ onBlur: i[0] || (i[0] = (k) => a("blur", k)),
1854
+ onFocus: i[1] || (i[1] = (k) => a("focus", k))
1845
1855
  }, null, 42, wa));
1846
1856
  }
1847
- }), Ca = /* @__PURE__ */ ne($a, [["__scopeId", "data-v-67f80d90"]]), Va = {
1857
+ }), Ca = /* @__PURE__ */ oe($a, [["__scopeId", "data-v-67f80d90"]]), Va = {
1848
1858
  key: 0,
1849
1859
  class: "flex items-stretch"
1850
1860
  }, Sa = {
@@ -1867,8 +1877,8 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1867
1877
  mask: {}
1868
1878
  },
1869
1879
  emits: ["update:modelValue", "blur", "focus"],
1870
- setup(e, { emit: i }) {
1871
- const t = e, a = i, r = K(), u = h(() => !!t.prefix || !!t.suffix), d = h(
1880
+ setup(e, { emit: u }) {
1881
+ const t = e, a = u, s = K(), o = x(() => !!t.prefix || !!t.suffix), d = x(
1872
1882
  () => [
1873
1883
  "w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm",
1874
1884
  "placeholder:text-gray-400",
@@ -1877,14 +1887,14 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1877
1887
  t.disabled ? "opacity-50 cursor-not-allowed bg-gray-100" : "",
1878
1888
  t.prefix ? "rounded-l-none" : "",
1879
1889
  t.suffix ? "rounded-r-none" : "",
1880
- r.classes.value.input
1890
+ s.classes.value.input
1881
1891
  ].filter(Boolean).join(" ")
1882
1892
  );
1883
1893
  function l(n) {
1884
- const o = n.target;
1885
- a("update:modelValue", o.value);
1894
+ const r = n.target;
1895
+ a("update:modelValue", r.value);
1886
1896
  }
1887
- return (n, o) => u.value ? (c(), f("div", Va, [
1897
+ return (n, r) => o.value ? (c(), f("div", Va, [
1888
1898
  e.prefix ? (c(), f("span", Sa, L(e.prefix), 1)) : T("", !0),
1889
1899
  p("input", {
1890
1900
  type: e.inputType,
@@ -1893,12 +1903,12 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1893
1903
  maxlength: e.maxLength,
1894
1904
  disabled: e.disabled,
1895
1905
  readonly: e.readonly,
1896
- class: S(d.value),
1906
+ class: F(d.value),
1897
1907
  "aria-disabled": e.disabled || void 0,
1898
1908
  "aria-readonly": e.readonly || void 0,
1899
1909
  onInput: l,
1900
- onBlur: o[0] || (o[0] = (s) => a("blur", s)),
1901
- onFocus: o[1] || (o[1] = (s) => a("focus", s))
1910
+ onBlur: r[0] || (r[0] = (i) => a("blur", i)),
1911
+ onFocus: r[1] || (r[1] = (i) => a("focus", i))
1902
1912
  }, null, 42, Ba),
1903
1913
  e.suffix ? (c(), f("span", Fa, L(e.suffix), 1)) : T("", !0)
1904
1914
  ])) : (c(), f("input", {
@@ -1909,15 +1919,15 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1909
1919
  maxlength: e.maxLength,
1910
1920
  disabled: e.disabled,
1911
1921
  readonly: e.readonly,
1912
- class: S(d.value),
1922
+ class: F(d.value),
1913
1923
  "aria-disabled": e.disabled || void 0,
1914
1924
  "aria-readonly": e.readonly || void 0,
1915
1925
  onInput: l,
1916
- onBlur: o[2] || (o[2] = (s) => a("blur", s)),
1917
- onFocus: o[3] || (o[3] = (s) => a("focus", s))
1926
+ onBlur: r[2] || (r[2] = (i) => a("blur", i)),
1927
+ onFocus: r[3] || (r[3] = (i) => a("focus", i))
1918
1928
  }, null, 42, Ta));
1919
1929
  }
1920
- }), La = /* @__PURE__ */ ne(Ia, [["__scopeId", "data-v-a42b4343"]]), Aa = {
1930
+ }), La = /* @__PURE__ */ oe(Ia, [["__scopeId", "data-v-a42b4343"]]), Aa = {
1921
1931
  key: 0,
1922
1932
  class: "mb-1.5 flex items-center gap-1"
1923
1933
  }, Na = ["for"], Da = {
@@ -1928,7 +1938,7 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1928
1938
  key: 0,
1929
1939
  role: "tooltip",
1930
1940
  class: "absolute bottom-full left-1/2 z-10 mb-2 -translate-x-1/2 rounded-md bg-gray-900 px-3 py-1.5 text-xs text-white shadow-lg whitespace-nowrap"
1931
- }, Ra = ["id"], ja = ["id"], Oa = /* @__PURE__ */ j({
1941
+ }, Ra = ["id"], ja = ["id"], za = /* @__PURE__ */ j({
1932
1942
  __name: "BaseField",
1933
1943
  props: {
1934
1944
  fieldSchema: {},
@@ -1937,51 +1947,51 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1937
1947
  touched: { type: Boolean, default: !1 }
1938
1948
  },
1939
1949
  setup(e) {
1940
- const i = e, t = J(ye), a = J(pe), r = D(!1), u = h(() => {
1950
+ const u = e, t = q(ye), a = q(pe), s = D(!1), o = x(() => {
1941
1951
  if (t) {
1942
- const $ = t.t(i.fieldName, "label");
1943
- if ($) return $;
1952
+ const g = t.t(u.fieldName, "label");
1953
+ if (g) return g;
1944
1954
  }
1945
- return i.fieldSchema.label ?? i.fieldName;
1946
- }), d = h(() => {
1955
+ return u.fieldSchema.label ?? u.fieldName;
1956
+ }), d = x(() => {
1947
1957
  if (t) {
1948
- const $ = t.t(i.fieldName, "helpText");
1949
- if ($) return $;
1958
+ const g = t.t(u.fieldName, "helpText");
1959
+ if (g) return g;
1950
1960
  }
1951
- return i.fieldSchema.helpText ?? "";
1952
- }), l = h(() => {
1961
+ return u.fieldSchema.helpText ?? "";
1962
+ }), l = x(() => {
1953
1963
  if (t) {
1954
- const $ = t.t(i.fieldName, "tooltip");
1955
- if ($) return $;
1964
+ const g = t.t(u.fieldName, "tooltip");
1965
+ if (g) return g;
1956
1966
  }
1957
- return i.fieldSchema.tooltip ?? "";
1958
- }), n = h(() => i.touched && i.errors.length > 0), o = h(() => [
1967
+ return u.fieldSchema.tooltip ?? "";
1968
+ }), n = x(() => u.touched && u.errors.length > 0), r = x(() => [
1959
1969
  (a == null ? void 0 : a.classes.value.field) ?? "fc-field",
1960
- i.fieldSchema.className ?? "",
1961
- i.fieldSchema.disabled ? "opacity-50 cursor-not-allowed" : "",
1962
- i.fieldSchema.readOnly ? "fc-readonly" : ""
1963
- ]), s = h(() => `fc-field-${i.fieldName}`), g = h(() => `fc-error-${i.fieldName}`);
1964
- return ($, V) => {
1965
- var b, v;
1970
+ u.fieldSchema.className ?? "",
1971
+ u.fieldSchema.disabled ? "opacity-50 cursor-not-allowed" : "",
1972
+ u.fieldSchema.readOnly ? "fc-readonly" : ""
1973
+ ]), i = x(() => `fc-field-${u.fieldName}`), k = x(() => `fc-error-${u.fieldName}`);
1974
+ return (g, $) => {
1975
+ var m, C;
1966
1976
  return c(), f("div", {
1967
- class: S([o.value, "relative mb-4"]),
1968
- style: O(e.fieldSchema.style)
1977
+ class: F([r.value, "relative mb-4"]),
1978
+ style: z(e.fieldSchema.style)
1969
1979
  }, [
1970
1980
  e.fieldSchema.type !== "hidden" ? (c(), f("div", Aa, [
1971
1981
  p("label", {
1972
- for: s.value,
1973
- class: S([((b = H(a)) == null ? void 0 : b.classes.value.label) ?? "fc-label", "block text-sm font-medium text-gray-700"])
1982
+ for: i.value,
1983
+ class: F([((m = H(a)) == null ? void 0 : m.classes.value.label) ?? "fc-label", "block text-sm font-medium text-gray-700"])
1974
1984
  }, [
1975
- _(L(u.value) + " ", 1),
1985
+ _(L(o.value) + " ", 1),
1976
1986
  e.fieldSchema.required ? (c(), f("span", Da, "*")) : T("", !0)
1977
1987
  ], 10, Na),
1978
1988
  l.value ? (c(), f("span", {
1979
1989
  key: 0,
1980
1990
  class: "relative inline-flex",
1981
- onMouseenter: V[0] || (V[0] = (m) => r.value = !0),
1982
- onMouseleave: V[1] || (V[1] = (m) => r.value = !1),
1983
- onFocusin: V[2] || (V[2] = (m) => r.value = !0),
1984
- onFocusout: V[3] || (V[3] = (m) => r.value = !1)
1991
+ onMouseenter: $[0] || ($[0] = (h) => s.value = !0),
1992
+ onMouseleave: $[1] || ($[1] = (h) => s.value = !1),
1993
+ onFocusin: $[2] || ($[2] = (h) => s.value = !0),
1994
+ onFocusout: $[3] || ($[3] = (h) => s.value = !1)
1985
1995
  }, [
1986
1996
  p("button", {
1987
1997
  type: "button",
@@ -1989,7 +1999,7 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1989
1999
  "aria-label": `Info: ${l.value}`,
1990
2000
  tabindex: "0"
1991
2001
  }, " i ", 8, Ma),
1992
- Z(ae, {
2002
+ Z(le, {
1993
2003
  "enter-active-class": "motion-safe:transition motion-safe:duration-200 motion-safe:ease-out",
1994
2004
  "enter-from-class": "opacity-0 scale-95",
1995
2005
  "enter-to-class": "opacity-100 scale-100",
@@ -1998,19 +2008,19 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1998
2008
  "leave-to-class": "opacity-0 scale-95"
1999
2009
  }, {
2000
2010
  default: W(() => [
2001
- r.value ? (c(), f("div", Ea, [
2011
+ s.value ? (c(), f("div", Ea, [
2002
2012
  _(L(l.value) + " ", 1),
2003
- V[4] || (V[4] = p("div", { class: "absolute left-1/2 top-full -translate-x-1/2 border-4 border-transparent border-t-gray-900" }, null, -1))
2013
+ $[4] || ($[4] = p("div", { class: "absolute left-1/2 top-full -translate-x-1/2 border-4 border-transparent border-t-gray-900" }, null, -1))
2004
2014
  ])) : T("", !0)
2005
2015
  ]),
2006
2016
  _: 1
2007
2017
  })
2008
2018
  ], 32)) : T("", !0)
2009
2019
  ])) : T("", !0),
2010
- p("div", { id: s.value }, [
2011
- Ae($.$slots, "default")
2020
+ p("div", { id: i.value }, [
2021
+ De(g.$slots, "default")
2012
2022
  ], 8, Ra),
2013
- Z(Ne, {
2023
+ Z(Me, {
2014
2024
  tag: "div",
2015
2025
  "enter-active-class": "motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out",
2016
2026
  "enter-from-class": "opacity-0 -translate-y-1 max-h-0",
@@ -2021,26 +2031,26 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2021
2031
  class: ""
2022
2032
  }, {
2023
2033
  default: W(() => [
2024
- (c(!0), f(z, null, G(n.value ? e.errors : [], (m, y) => {
2025
- var F;
2034
+ (c(!0), f(O, null, G(n.value ? e.errors : [], (h, y) => {
2035
+ var A;
2026
2036
  return c(), f("p", {
2027
- key: m + y,
2028
- id: y === 0 ? g.value : void 0,
2029
- class: S([((F = H(a)) == null ? void 0 : F.classes.value.error) ?? "fc-error", "mt-1 text-xs text-red-500"]),
2037
+ key: h + y,
2038
+ id: y === 0 ? k.value : void 0,
2039
+ class: F([((A = H(a)) == null ? void 0 : A.classes.value.error) ?? "fc-error", "mt-1 text-xs text-red-500"]),
2030
2040
  role: "alert"
2031
- }, L(m), 11, ja);
2041
+ }, L(h), 11, ja);
2032
2042
  }), 128))
2033
2043
  ]),
2034
2044
  _: 1
2035
2045
  }),
2036
2046
  d.value && !n.value ? (c(), f("p", {
2037
2047
  key: 1,
2038
- class: S([((v = H(a)) == null ? void 0 : v.classes.value.helpText) ?? "fc-help-text", "mt-1 text-xs text-gray-400"])
2048
+ class: F([((C = H(a)) == null ? void 0 : C.classes.value.helpText) ?? "fc-help-text", "mt-1 text-xs text-gray-400"])
2039
2049
  }, L(d.value), 3)) : T("", !0)
2040
2050
  ], 6);
2041
2051
  };
2042
2052
  }
2043
- }), za = {
2053
+ }), Oa = {
2044
2054
  key: 1,
2045
2055
  class: "rounded-md border border-dashed border-amber-400 bg-amber-50 px-3 py-2 text-xs text-amber-700"
2046
2056
  }, $e = /* @__PURE__ */ j({
@@ -2049,68 +2059,68 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2049
2059
  name: {}
2050
2060
  },
2051
2061
  setup(e) {
2052
- const i = e, t = J(ce);
2062
+ const u = e, t = q(ce);
2053
2063
  if (!t)
2054
2064
  throw new Error(
2055
2065
  "FormField must be used inside a FormBuilder (FormContextKey not provided)"
2056
2066
  );
2057
- const a = J(
2067
+ const a = q(
2058
2068
  Be,
2059
2069
  null
2060
- ), r = h(
2061
- () => P(t.schema.fields).find((b) => b.name === i.name)
2062
- ), u = h(() => {
2063
- var m;
2064
- const b = r.value;
2065
- if (!b) return;
2066
- const v = (m = a == null ? void 0 : a.value) == null ? void 0 : m[b.type];
2067
- return v || Ke(b.type);
2068
- }), d = h(() => t.values[i.name]), l = h(() => t.errors[i.name] ?? []), n = h(() => t.touched[i.name] ?? !1), o = h(() => {
2069
- const b = r.value;
2070
- return b ? b.condition ? se(b.condition, t.values) : typeof b.visible == "function" ? b.visible({
2070
+ ), s = x(
2071
+ () => P(t.schema.fields).find((m) => m.name === u.name)
2072
+ ), o = x(() => {
2073
+ var h;
2074
+ const m = s.value;
2075
+ if (!m) return;
2076
+ const C = (h = a == null ? void 0 : a.value) == null ? void 0 : h[m.type];
2077
+ return C || Ke(m.type);
2078
+ }), d = x(() => t.values[u.name]), l = x(() => t.errors[u.name] ?? []), n = x(() => t.touched[u.name] ?? !1), r = x(() => {
2079
+ const m = s.value;
2080
+ return m ? m.condition ? se(m.condition, t.values) : typeof m.visible == "function" ? m.visible({
2071
2081
  values: { ...t.values },
2072
- getFieldValue: (v) => t.values[v]
2073
- }) : b.visible ?? !0 : !1;
2074
- }), s = h(() => {
2075
- const b = r.value;
2076
- return b ? typeof b.disabled == "function" ? b.disabled({
2082
+ getFieldValue: (C) => t.values[C]
2083
+ }) : m.visible ?? !0 : !1;
2084
+ }), i = x(() => {
2085
+ const m = s.value;
2086
+ return m ? typeof m.disabled == "function" ? m.disabled({
2077
2087
  values: { ...t.values },
2078
- getFieldValue: (v) => t.values[v]
2079
- }) : b.disabled ?? !1 : !1;
2080
- }), g = h(() => {
2081
- const b = r.value;
2082
- if (!b) return {};
2088
+ getFieldValue: (C) => t.values[C]
2089
+ }) : m.disabled ?? !1 : !1;
2090
+ }), k = x(() => {
2091
+ const m = s.value;
2092
+ if (!m) return {};
2083
2093
  const {
2084
- name: v,
2085
- label: m,
2094
+ name: C,
2095
+ label: h,
2086
2096
  helpText: y,
2087
- tooltip: F,
2088
- condition: k,
2089
- translations: C,
2090
- meta: w,
2091
- rules: N,
2092
- visible: B,
2093
- className: A,
2097
+ tooltip: A,
2098
+ condition: V,
2099
+ translations: b,
2100
+ meta: v,
2101
+ rules: B,
2102
+ visible: S,
2103
+ className: N,
2094
2104
  style: R,
2095
2105
  defaultValue: Q,
2096
2106
  ...ee
2097
- } = b;
2107
+ } = m;
2098
2108
  return {
2099
2109
  ...ee,
2100
2110
  modelValue: d.value,
2101
- disabled: s.value,
2102
- readonly: b.readOnly ?? !1,
2103
- placeholder: b.placeholder ?? ""
2111
+ disabled: i.value,
2112
+ readonly: m.readOnly ?? !1,
2113
+ placeholder: m.placeholder ?? ""
2104
2114
  };
2105
2115
  });
2106
- function $(b) {
2107
- t.setFieldValue(i.name, b);
2116
+ function g(m) {
2117
+ t.setFieldValue(u.name, m);
2108
2118
  }
2109
- function V() {
2110
- var b;
2111
- t.touched[i.name] = !0, ((b = t.schema.settings) == null ? void 0 : b.validateOnBlur) !== !1 && t.validateField(i.name);
2119
+ function $() {
2120
+ var m;
2121
+ t.touched[u.name] = !0, ((m = t.schema.settings) == null ? void 0 : m.validateOnBlur) !== !1 && t.validateField(u.name);
2112
2122
  }
2113
- return (b, v) => (c(), U(ae, {
2123
+ return (m, C) => (c(), U(le, {
2114
2124
  "enter-active-class": "motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",
2115
2125
  "enter-from-class": "opacity-0 max-h-0",
2116
2126
  "enter-to-class": "opacity-100 max-h-96",
@@ -2119,20 +2129,20 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2119
2129
  "leave-to-class": "opacity-0 max-h-0"
2120
2130
  }, {
2121
2131
  default: W(() => [
2122
- o.value && r.value ? (c(), U(Oa, {
2132
+ r.value && s.value ? (c(), U(za, {
2123
2133
  key: 0,
2124
- "field-schema": r.value,
2134
+ "field-schema": s.value,
2125
2135
  "field-name": e.name,
2126
2136
  errors: l.value,
2127
2137
  touched: n.value
2128
2138
  }, {
2129
2139
  default: W(() => [
2130
- u.value ? (c(), U(Se(u.value), De({ key: 0 }, g.value, {
2140
+ o.value ? (c(), U(Se(o.value), Ee({ key: 0 }, k.value, {
2131
2141
  "aria-invalid": n.value && l.value.length > 0 ? !0 : void 0,
2132
2142
  "aria-describedby": n.value && l.value.length > 0 ? `fc-error-${e.name}` : void 0,
2133
- "onUpdate:modelValue": $,
2134
- onBlur: V
2135
- }), null, 16, ["aria-invalid", "aria-describedby"])) : (c(), f("div", za, ' No component registered for field type "' + L(r.value.type) + '" ', 1))
2143
+ "onUpdate:modelValue": g,
2144
+ onBlur: $
2145
+ }), null, 16, ["aria-invalid", "aria-describedby"])) : (c(), f("div", Oa, ' No component registered for field type "' + L(s.value.type) + '" ', 1))
2136
2146
  ]),
2137
2147
  _: 1
2138
2148
  }, 8, ["field-schema", "field-name", "errors", "touched"])) : T("", !0)
@@ -2150,8 +2160,8 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2150
2160
  className: {}
2151
2161
  },
2152
2162
  setup(e) {
2153
- return (i, t) => (c(), f("div", {
2154
- class: S([e.className ?? "", "relative my-4"]),
2163
+ return (u, t) => (c(), f("div", {
2164
+ class: F([e.className ?? "", "relative my-4"]),
2155
2165
  role: "separator"
2156
2166
  }, [
2157
2167
  t[0] || (t[0] = p("div", {
@@ -2182,37 +2192,37 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2182
2192
  className: {}
2183
2193
  },
2184
2194
  setup(e) {
2185
- const i = e, t = D(i.collapsed);
2195
+ const u = e, t = D(u.collapsed);
2186
2196
  function a() {
2187
- i.collapsible && (t.value = !t.value);
2197
+ u.collapsible && (t.value = !t.value);
2188
2198
  }
2189
- const r = h(
2190
- () => i.title ? `fc-group-${i.title.toLowerCase().replace(/\s+/g, "-")}` : void 0
2199
+ const s = x(
2200
+ () => u.title ? `fc-group-${u.title.toLowerCase().replace(/\s+/g, "-")}` : void 0
2191
2201
  );
2192
- return (u, d) => (c(), f("fieldset", {
2193
- class: S([[e.className ?? ""], "rounded-lg border border-gray-200 bg-white"]),
2194
- "aria-labelledby": r.value
2202
+ return (o, d) => (c(), f("fieldset", {
2203
+ class: F([[e.className ?? ""], "rounded-lg border border-gray-200 bg-white"]),
2204
+ "aria-labelledby": s.value
2195
2205
  }, [
2196
2206
  e.title || e.description ? (c(), f("div", Ga, [
2197
2207
  (c(), U(Se(e.collapsible ? "button" : "div"), {
2198
2208
  type: e.collapsible ? "button" : void 0,
2199
- class: S(["flex w-full items-center justify-between text-left", e.collapsible ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-blue-500/40 rounded" : ""]),
2209
+ class: F(["flex w-full items-center justify-between text-left", e.collapsible ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-blue-500/40 rounded" : ""]),
2200
2210
  "aria-expanded": e.collapsible ? !t.value : void 0,
2201
- "aria-controls": e.collapsible ? `fc-group-body-${r.value}` : void 0,
2211
+ "aria-controls": e.collapsible ? `fc-group-body-${s.value}` : void 0,
2202
2212
  onClick: a
2203
2213
  }, {
2204
2214
  default: W(() => [
2205
2215
  p("div", null, [
2206
2216
  e.title ? (c(), f("legend", {
2207
2217
  key: 0,
2208
- id: r.value,
2218
+ id: s.value,
2209
2219
  class: "text-sm font-semibold text-gray-800"
2210
2220
  }, L(e.title), 9, Za)) : T("", !0),
2211
2221
  e.description ? (c(), f("p", qa, L(e.description), 1)) : T("", !0)
2212
2222
  ]),
2213
2223
  e.collapsible ? (c(), f("svg", {
2214
2224
  key: 0,
2215
- class: S(["h-4 w-4 shrink-0 text-gray-400 motion-safe:transition-transform motion-safe:duration-200", t.value ? "" : "rotate-180"]),
2225
+ class: F(["h-4 w-4 shrink-0 text-gray-400 motion-safe:transition-transform motion-safe:duration-200", t.value ? "" : "rotate-180"]),
2216
2226
  xmlns: "http://www.w3.org/2000/svg",
2217
2227
  viewBox: "0 0 20 20",
2218
2228
  fill: "currentColor",
@@ -2228,7 +2238,7 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2228
2238
  _: 1
2229
2239
  }, 8, ["type", "class", "aria-expanded", "aria-controls"]))
2230
2240
  ])) : T("", !0),
2231
- Z(ae, {
2241
+ Z(le, {
2232
2242
  "enter-active-class": "motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",
2233
2243
  "enter-from-class": "max-h-0 opacity-0 overflow-hidden",
2234
2244
  "enter-to-class": "max-h-[2000px] opacity-100 overflow-hidden",
@@ -2238,12 +2248,12 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2238
2248
  }, {
2239
2249
  default: W(() => [
2240
2250
  de(p("div", {
2241
- id: e.collapsible ? `fc-group-body-${r.value}` : void 0,
2251
+ id: e.collapsible ? `fc-group-body-${s.value}` : void 0,
2242
2252
  class: "p-4"
2243
2253
  }, [
2244
- Z(oe, { nodes: e.children }, null, 8, ["nodes"])
2254
+ Z(re, { nodes: e.children }, null, 8, ["nodes"])
2245
2255
  ], 8, Ya), [
2246
- [Me, !t.value]
2256
+ [Re, !t.value]
2247
2257
  ])
2248
2258
  ]),
2249
2259
  _: 1
@@ -2257,9 +2267,9 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2257
2267
  className: {}
2258
2268
  },
2259
2269
  setup(e) {
2260
- const i = e, t = h(() => Ie(i.content));
2261
- return (a, r) => (c(), f("div", {
2262
- class: S([e.className ?? "", "fc-html prose prose-sm max-w-none text-gray-700"]),
2270
+ const u = e, t = x(() => Ae(u.content));
2271
+ return (a, s) => (c(), f("div", {
2272
+ class: F([e.className ?? "", "fc-html prose prose-sm max-w-none text-gray-700"]),
2263
2273
  innerHTML: t.value
2264
2274
  }, null, 10, Wa));
2265
2275
  }
@@ -2272,18 +2282,18 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2272
2282
  className: {}
2273
2283
  },
2274
2284
  setup(e) {
2275
- const i = e, t = h(() => ({
2285
+ const u = e, t = x(() => ({
2276
2286
  start: "items-start",
2277
2287
  center: "items-center",
2278
2288
  end: "items-end",
2279
2289
  stretch: "items-stretch"
2280
- })[i.align] ?? "items-stretch"), a = h(() => i.gap ? typeof i.gap == "number" ? `${i.gap}px` : i.gap : "");
2281
- return (r, u) => (c(), f("div", {
2282
- class: S(["grid grid-cols-12", [t.value, e.className ?? ""]]),
2283
- style: O(a.value ? { gap: a.value } : { gap: "1rem" }),
2290
+ })[u.align] ?? "items-stretch"), a = x(() => u.gap ? typeof u.gap == "number" ? `${u.gap}px` : u.gap : "");
2291
+ return (s, o) => (c(), f("div", {
2292
+ class: F(["grid grid-cols-12", [t.value, e.className ?? ""]]),
2293
+ style: z(a.value ? { gap: a.value } : { gap: "1rem" }),
2284
2294
  role: "group"
2285
2295
  }, [
2286
- Z(oe, { nodes: e.children }, null, 8, ["nodes"])
2296
+ Z(re, { nodes: e.children }, null, 8, ["nodes"])
2287
2297
  ], 6));
2288
2298
  }
2289
2299
  }), Xa = {
@@ -2313,49 +2323,49 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2313
2323
  className: {}
2314
2324
  },
2315
2325
  setup(e) {
2316
- const i = e, t = J(ce), a = D(0), r = D(/* @__PURE__ */ new Set()), u = h(() => i.steps), d = h(() => u.value.length), l = h(() => a.value === 0), n = h(() => a.value === d.value - 1);
2317
- function o(b) {
2318
- const v = [];
2319
- function m(y) {
2320
- for (const F of y)
2321
- if (Ce(F))
2322
- v.push(F.name);
2323
- else if (F.type === "row" || F.type === "group")
2324
- m(F.children);
2325
- else if (F.type === "steps")
2326
- for (const k of F.steps) m(k.children);
2327
- else if (F.type === "tabs")
2328
- for (const k of F.tabs) m(k.children);
2326
+ const u = e, t = q(ce), a = D(0), s = D(/* @__PURE__ */ new Set()), o = x(() => u.steps), d = x(() => o.value.length), l = x(() => a.value === 0), n = x(() => a.value === d.value - 1);
2327
+ function r(m) {
2328
+ const C = [];
2329
+ function h(y) {
2330
+ for (const A of y)
2331
+ if (Ce(A))
2332
+ C.push(A.name);
2333
+ else if (A.type === "row" || A.type === "group")
2334
+ h(A.children);
2335
+ else if (A.type === "steps")
2336
+ for (const V of A.steps) h(V.children);
2337
+ else if (A.type === "tabs")
2338
+ for (const V of A.tabs) h(V.children);
2329
2339
  }
2330
- return m(b.children), v;
2331
- }
2332
- async function s() {
2333
- if (!t || !i.linear) return !0;
2334
- const b = u.value[a.value];
2335
- if (!b) return !0;
2336
- const v = o(b);
2337
- let m = !0;
2338
- for (const y of v) {
2339
- const F = await t.validateField(y);
2340
- t.touched[y] = !0, F.length > 0 && (m = !1);
2340
+ return h(m.children), C;
2341
+ }
2342
+ async function i() {
2343
+ if (!t || !u.linear) return !0;
2344
+ const m = o.value[a.value];
2345
+ if (!m) return !0;
2346
+ const C = r(m);
2347
+ let h = !0;
2348
+ for (const y of C) {
2349
+ const A = await t.validateField(y);
2350
+ t.touched[y] = !0, A.length > 0 && (h = !1);
2341
2351
  }
2342
- return m;
2352
+ return h;
2343
2353
  }
2344
- async function g() {
2345
- n.value || i.linear && !await s() || (r.value.add(a.value), a.value++);
2354
+ async function k() {
2355
+ n.value || u.linear && !await i() || (s.value.add(a.value), a.value++);
2346
2356
  }
2347
- function $() {
2357
+ function g() {
2348
2358
  l.value || a.value--;
2349
2359
  }
2350
- function V(b) {
2351
- i.linear && b > a.value || (a.value = b);
2360
+ function $(m) {
2361
+ u.linear && m > a.value || (a.value = m);
2352
2362
  }
2353
- return (b, v) => (c(), f("div", {
2354
- class: S([e.className ?? "", "space-y-6"])
2363
+ return (m, C) => (c(), f("div", {
2364
+ class: F([e.className ?? "", "space-y-6"])
2355
2365
  }, [
2356
2366
  p("nav", Xa, [
2357
2367
  p("ol", el, [
2358
- (c(!0), f(z, null, G(u.value, (m, y) => (c(), f("li", {
2368
+ (c(!0), f(O, null, G(o.value, (h, y) => (c(), f("li", {
2359
2369
  key: y,
2360
2370
  class: "flex items-center"
2361
2371
  }, [
@@ -2363,15 +2373,15 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2363
2373
  type: "button",
2364
2374
  disabled: e.linear && y > a.value,
2365
2375
  "aria-current": y === a.value ? "step" : void 0,
2366
- "aria-label": `Step ${y + 1}: ${m.title}`,
2367
- class: S(["relative flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 text-xs font-semibold motion-safe:transition-all motion-safe:duration-300 focus:outline-none focus:ring-2 focus:ring-blue-500/40", [
2368
- r.value.has(y) && y !== a.value ? "border-green-500 bg-green-500 text-white" : y !== a.value ? "border-gray-300 bg-white text-gray-500" : "text-white",
2376
+ "aria-label": `Step ${y + 1}: ${h.title}`,
2377
+ class: F(["relative flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 text-xs font-semibold motion-safe:transition-all motion-safe:duration-300 focus:outline-none focus:ring-2 focus:ring-blue-500/40", [
2378
+ s.value.has(y) && y !== a.value ? "border-green-500 bg-green-500 text-white" : y !== a.value ? "border-gray-300 bg-white text-gray-500" : "text-white",
2369
2379
  e.linear && y > a.value ? "cursor-not-allowed" : "cursor-pointer hover:shadow-md"
2370
2380
  ]]),
2371
- style: O(y === a.value ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
2372
- onClick: (F) => V(y)
2381
+ style: z(y === a.value ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
2382
+ onClick: (A) => $(y)
2373
2383
  }, [
2374
- r.value.has(y) && y !== a.value ? (c(), f("svg", al, [...v[0] || (v[0] = [
2384
+ s.value.has(y) && y !== a.value ? (c(), f("svg", al, [...C[0] || (C[0] = [
2375
2385
  p("path", {
2376
2386
  "fill-rule": "evenodd",
2377
2387
  d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",
@@ -2379,18 +2389,18 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2379
2389
  }, null, -1)
2380
2390
  ])])) : (c(), f("span", ll, L(y + 1), 1))
2381
2391
  ], 14, tl),
2382
- y < u.value.length - 1 ? (c(), f("div", {
2392
+ y < o.value.length - 1 ? (c(), f("div", {
2383
2393
  key: 0,
2384
- class: S(["mx-1 h-0.5 w-8 motion-safe:transition-colors motion-safe:duration-300 sm:w-12", r.value.has(y) ? "bg-green-500" : "bg-gray-200"])
2394
+ class: F(["mx-1 h-0.5 w-8 motion-safe:transition-colors motion-safe:duration-300 sm:w-12", s.value.has(y) ? "bg-green-500" : "bg-gray-200"])
2385
2395
  }, null, 2)) : T("", !0)
2386
2396
  ]))), 128))
2387
2397
  ])
2388
2398
  ]),
2389
- u.value[a.value] ? (c(), f("div", nl, [
2390
- p("h3", ol, L(u.value[a.value].title), 1),
2391
- u.value[a.value].description ? (c(), f("p", rl, L(u.value[a.value].description), 1)) : T("", !0)
2399
+ o.value[a.value] ? (c(), f("div", nl, [
2400
+ p("h3", ol, L(o.value[a.value].title), 1),
2401
+ o.value[a.value].description ? (c(), f("p", rl, L(o.value[a.value].description), 1)) : T("", !0)
2392
2402
  ])) : T("", !0),
2393
- Z(ae, {
2403
+ Z(le, {
2394
2404
  mode: "out-in",
2395
2405
  "enter-active-class": "motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out",
2396
2406
  "enter-from-class": "opacity-0 translate-x-2",
@@ -2400,9 +2410,9 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2400
2410
  "leave-to-class": "opacity-0 -translate-x-2"
2401
2411
  }, {
2402
2412
  default: W(() => [
2403
- u.value[a.value] ? (c(), f("div", { key: a.value }, [
2404
- Z(oe, {
2405
- nodes: u.value[a.value].children
2413
+ o.value[a.value] ? (c(), f("div", { key: a.value }, [
2414
+ Z(re, {
2415
+ nodes: o.value[a.value].children
2406
2416
  }, null, 8, ["nodes"])
2407
2417
  ])) : T("", !0)
2408
2418
  ]),
@@ -2413,7 +2423,7 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2413
2423
  type: "button",
2414
2424
  disabled: l.value,
2415
2425
  class: "rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 motion-safe:transition-colors motion-safe:duration-150 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50 fc-steps-prev-btn",
2416
- onClick: $
2426
+ onClick: g
2417
2427
  }, " Previous ", 8, il),
2418
2428
  p("span", ul, L(a.value + 1) + " / " + L(d.value), 1),
2419
2429
  n.value ? (c(), f("div", dl)) : (c(), f("button", {
@@ -2421,7 +2431,7 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2421
2431
  type: "button",
2422
2432
  class: "rounded-md px-4 py-2 text-sm font-medium text-white motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500/40 fc-steps-next-btn",
2423
2433
  style: { backgroundColor: "var(--fc-color-primary, #3b82f6)" },
2424
- onClick: g
2434
+ onClick: k
2425
2435
  }, " Next "))
2426
2436
  ])
2427
2437
  ], 2));
@@ -2441,57 +2451,57 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2441
2451
  className: {}
2442
2452
  },
2443
2453
  setup(e) {
2444
- const i = e, t = D(0), a = h(() => i.tabs);
2445
- function r(l) {
2454
+ const u = e, t = D(0), a = x(() => u.tabs);
2455
+ function s(l) {
2446
2456
  const n = a.value[l];
2447
2457
  n != null && n.disabled || (t.value = l);
2448
2458
  }
2449
- function u(l, n) {
2450
- var $;
2451
- const o = a.value.length;
2452
- let s = n;
2459
+ function o(l, n) {
2460
+ var g;
2461
+ const r = a.value.length;
2462
+ let i = n;
2453
2463
  if (l.key === "ArrowRight" || l.key === "ArrowDown")
2454
- l.preventDefault(), s = (n + 1) % o;
2464
+ l.preventDefault(), i = (n + 1) % r;
2455
2465
  else if (l.key === "ArrowLeft" || l.key === "ArrowUp")
2456
- l.preventDefault(), s = (n - 1 + o) % o;
2466
+ l.preventDefault(), i = (n - 1 + r) % r;
2457
2467
  else if (l.key === "Home")
2458
- l.preventDefault(), s = 0;
2468
+ l.preventDefault(), i = 0;
2459
2469
  else if (l.key === "End")
2460
- l.preventDefault(), s = o - 1;
2470
+ l.preventDefault(), i = r - 1;
2461
2471
  else
2462
2472
  return;
2463
- for (; ($ = a.value[s]) != null && $.disabled && s !== n; )
2464
- l.key === "ArrowLeft" || l.key === "ArrowUp" ? s = (s - 1 + o) % o : s = (s + 1) % o;
2465
- r(s);
2466
- const g = document.getElementById(`fc-tab-${s}`);
2467
- g == null || g.focus();
2473
+ for (; (g = a.value[i]) != null && g.disabled && i !== n; )
2474
+ l.key === "ArrowLeft" || l.key === "ArrowUp" ? i = (i - 1 + r) % r : i = (i + 1) % r;
2475
+ s(i);
2476
+ const k = document.getElementById(`fc-tab-${i}`);
2477
+ k == null || k.focus();
2468
2478
  }
2469
- const d = h(() => `fc-tabpanel-${t.value}`);
2479
+ const d = x(() => `fc-tabpanel-${t.value}`);
2470
2480
  return (l, n) => (c(), f("div", {
2471
- class: S(e.className ?? "")
2481
+ class: F(e.className ?? "")
2472
2482
  }, [
2473
2483
  p("div", fl, [
2474
- (c(!0), f(z, null, G(a.value, (o, s) => (c(), f("button", {
2475
- key: s,
2476
- id: `fc-tab-${s}`,
2484
+ (c(!0), f(O, null, G(a.value, (r, i) => (c(), f("button", {
2485
+ key: i,
2486
+ id: `fc-tab-${i}`,
2477
2487
  type: "button",
2478
2488
  role: "tab",
2479
- "aria-selected": s === t.value,
2489
+ "aria-selected": i === t.value,
2480
2490
  "aria-controls": d.value,
2481
- "aria-disabled": o.disabled || void 0,
2482
- tabindex: s === t.value ? 0 : -1,
2483
- class: S(["relative px-4 py-2.5 text-sm font-medium motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500/40", [
2484
- s !== t.value ? o.disabled ? "cursor-not-allowed text-gray-300" : "text-gray-500 hover:text-gray-700" : ""
2491
+ "aria-disabled": r.disabled || void 0,
2492
+ tabindex: i === t.value ? 0 : -1,
2493
+ class: F(["relative px-4 py-2.5 text-sm font-medium motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500/40", [
2494
+ i !== t.value ? r.disabled ? "cursor-not-allowed text-gray-300" : "text-gray-500 hover:text-gray-700" : ""
2485
2495
  ]]),
2486
- style: O(s === t.value ? { color: "var(--fc-color-primary, #3b82f6)" } : {}),
2487
- onClick: (g) => r(s),
2488
- onKeydown: (g) => u(g, s)
2496
+ style: z(i === t.value ? { color: "var(--fc-color-primary, #3b82f6)" } : {}),
2497
+ onClick: (k) => s(i),
2498
+ onKeydown: (k) => o(k, i)
2489
2499
  }, [
2490
- _(L(o.title) + " ", 1),
2491
- s === t.value ? (c(), f("span", bl)) : T("", !0)
2500
+ _(L(r.title) + " ", 1),
2501
+ i === t.value ? (c(), f("span", bl)) : T("", !0)
2492
2502
  ], 46, ml))), 128))
2493
2503
  ]),
2494
- Z(ae, {
2504
+ Z(le, {
2495
2505
  mode: "out-in",
2496
2506
  "enter-active-class": "motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out",
2497
2507
  "enter-from-class": "opacity-0 translate-y-1",
@@ -2509,7 +2519,7 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2509
2519
  tabindex: "0",
2510
2520
  class: "pt-4"
2511
2521
  }, [
2512
- Z(oe, {
2522
+ Z(re, {
2513
2523
  nodes: a.value[t.value].children
2514
2524
  }, null, 8, ["nodes"])
2515
2525
  ], 8, vl)) : T("", !0)
@@ -2518,36 +2528,36 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2518
2528
  })
2519
2529
  ], 2));
2520
2530
  }
2521
- }), oe = /* @__PURE__ */ j({
2531
+ }), re = /* @__PURE__ */ j({
2522
2532
  __name: "LayoutRenderer",
2523
2533
  props: {
2524
2534
  nodes: {}
2525
2535
  },
2526
2536
  setup(e) {
2527
- const i = J(ce);
2528
- function t(r) {
2529
- return i ? se(r.condition, i.values) : !0;
2530
- }
2531
- function a(r) {
2532
- return r === "full" ? { gridColumn: "1 / -1" } : r === "auto" ? { gridColumn: "auto" } : typeof r == "number" ? { gridColumn: `span ${r} / span ${r}` } : { gridColumn: "span 12 / span 12" };
2533
- }
2534
- return (r, u) => {
2535
- const d = Ee("LayoutRenderer", !0);
2536
- return c(!0), f(z, null, G(e.nodes, (l, n) => {
2537
- var o;
2538
- return c(), f(z, { key: n }, [
2537
+ const u = q(ce);
2538
+ function t(s) {
2539
+ return u ? se(s.condition, u.values) : !0;
2540
+ }
2541
+ function a(s) {
2542
+ return s === "full" ? { gridColumn: "1 / -1" } : s === "auto" ? { gridColumn: "auto" } : typeof s == "number" ? { gridColumn: `span ${s} / span ${s}` } : { gridColumn: "span 12 / span 12" };
2543
+ }
2544
+ return (s, o) => {
2545
+ const d = je("LayoutRenderer", !0);
2546
+ return c(!0), f(O, null, G(e.nodes, (l, n) => {
2547
+ var r;
2548
+ return c(), f(O, { key: n }, [
2539
2549
  H(Ce)(l) ? (c(), f("div", {
2540
2550
  key: 0,
2541
- class: S(l.className ?? ""),
2542
- style: O(a(l.span))
2551
+ class: F(l.className ?? ""),
2552
+ style: z(a(l.span))
2543
2553
  }, [
2544
2554
  Z($e, {
2545
2555
  name: l.name
2546
2556
  }, null, 8, ["name"])
2547
2557
  ], 6)) : l.type === "field" ? (c(), f("div", {
2548
2558
  key: 1,
2549
- class: S(l.className ?? ""),
2550
- style: O(a(l.span))
2559
+ class: F(l.className ?? ""),
2560
+ style: z(a(l.span))
2551
2561
  }, [
2552
2562
  Z($e, {
2553
2563
  name: l.name
@@ -2583,11 +2593,11 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2583
2593
  key: 7,
2584
2594
  content: l.content,
2585
2595
  "class-name": l.className
2586
- }, null, 8, ["content", "class-name"])) : l.type === "conditional" ? (c(), f(z, { key: 8 }, [
2596
+ }, null, 8, ["content", "class-name"])) : l.type === "conditional" ? (c(), f(O, { key: 8 }, [
2587
2597
  t(l) ? (c(), U(d, {
2588
2598
  key: 0,
2589
2599
  nodes: l.children
2590
- }, null, 8, ["nodes"])) : (o = l.elseChildren) != null && o.length ? (c(), U(d, {
2600
+ }, null, 8, ["nodes"])) : (r = l.elseChildren) != null && r.length ? (c(), U(d, {
2591
2601
  key: 1,
2592
2602
  nodes: l.elseChildren
2593
2603
  }, null, 8, ["nodes"])) : T("", !0)
@@ -2609,20 +2619,22 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2609
2619
  key: 0,
2610
2620
  class: "mr-2 inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-white border-t-transparent",
2611
2621
  "aria-hidden": "true"
2612
- }, $l = ["disabled"], Tl = /* @__PURE__ */ j({
2622
+ }, $l = ["disabled"], Il = /* @__PURE__ */ j({
2613
2623
  __name: "FormBuilder",
2614
2624
  props: {
2615
2625
  schema: {},
2616
2626
  layout: {},
2617
- locale: { default: "en" },
2618
- fallbackLocale: { default: "en" },
2627
+ locale: {},
2628
+ fallbackLocale: {},
2619
2629
  modelValue: {},
2620
2630
  theme: {},
2621
2631
  components: {}
2622
2632
  },
2623
2633
  emits: ["submit", "error", "update:modelValue"],
2624
- setup(e, { expose: i, emit: t }) {
2625
- const a = e, r = t, u = [
2634
+ setup(e, { expose: u, emit: t }) {
2635
+ const a = e, s = t, o = q(Te, void 0), d = x(() => a.theme ?? (o == null ? void 0 : o.theme)), l = x(() => a.locale ?? (o == null ? void 0 : o.locale) ?? "en"), n = x(
2636
+ () => a.fallbackLocale ?? (o == null ? void 0 : o.fallbackLocale) ?? "en"
2637
+ ), r = x(() => a.components ?? (o == null ? void 0 : o.components) ?? {}), i = [
2626
2638
  ["text", La],
2627
2639
  ["number", Lt],
2628
2640
  ["textarea", Ca],
@@ -2637,125 +2649,121 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2637
2649
  ["tags", ka],
2638
2650
  ["phone", Gt]
2639
2651
  ];
2640
- for (const [v, m] of u)
2641
- Pe(v) || ze(v, m);
2642
- ie(
2643
- Be,
2644
- h(() => a.components ?? {})
2645
- ), tt(Re(a, "theme"));
2646
- const d = K(), l = et(a.schema, {
2647
- locale: a.locale,
2648
- fallbackLocale: a.fallbackLocale
2652
+ for (const [b, v] of i)
2653
+ Pe(b) || Fe(b, v);
2654
+ ie(Be, r), tt(d);
2655
+ const k = K(), g = et(a.schema, {
2656
+ locale: l.value,
2657
+ fallbackLocale: n.value
2649
2658
  });
2650
2659
  if (a.modelValue)
2651
- for (const [v, m] of Object.entries(a.modelValue))
2652
- l.setFieldValue(v, m);
2653
- Y(
2660
+ for (const [b, v] of Object.entries(a.modelValue))
2661
+ g.setFieldValue(b, v);
2662
+ J(
2654
2663
  () => a.modelValue,
2655
- (v) => {
2656
- if (v)
2657
- for (const [m, y] of Object.entries(v))
2658
- l.values[m] !== y && l.setFieldValue(m, y);
2664
+ (b) => {
2665
+ if (b)
2666
+ for (const [v, B] of Object.entries(b))
2667
+ g.values[v] !== B && g.setFieldValue(v, B);
2659
2668
  },
2660
2669
  { deep: !0 }
2661
- ), Y(
2662
- () => ({ ...l.values }),
2663
- (v) => {
2664
- r("update:modelValue", v);
2670
+ ), J(
2671
+ () => ({ ...g.values }),
2672
+ (b) => {
2673
+ s("update:modelValue", b);
2665
2674
  },
2666
2675
  { deep: !0 }
2667
- ), Y(
2668
- () => a.locale,
2669
- (v) => {
2670
- v && l.setLocale(v);
2671
- }
2672
- ), Ze();
2673
- const n = h(() => {
2674
- var F, k;
2675
- const v = a.schema.translations;
2676
- if (!v) return "";
2677
- const m = v[a.locale];
2678
- if ((F = m == null ? void 0 : m.messages) != null && F.title) return m.messages.title;
2679
- const y = v[a.fallbackLocale];
2680
- return ((k = y == null ? void 0 : y.messages) == null ? void 0 : k.title) ?? "";
2681
- }), o = h(() => {
2682
- var F, k;
2683
- const v = a.schema.translations;
2684
- if (!v) return "";
2685
- const m = v[a.locale];
2686
- if ((F = m == null ? void 0 : m.messages) != null && F.description) return m.messages.description;
2687
- const y = v[a.fallbackLocale];
2688
- return ((k = y == null ? void 0 : y.messages) == null ? void 0 : k.description) ?? "";
2689
- }), s = h(() => {
2690
- const v = a.schema.translations;
2691
- if (!v) return "Submit";
2692
- const m = v[a.locale];
2693
- if (m != null && m.submit) return m.submit;
2694
- const y = v[a.fallbackLocale];
2695
- return (y == null ? void 0 : y.submit) ?? "Submit";
2696
- }), g = h(() => {
2697
- const v = a.schema.translations;
2698
- if (!v) return "Reset";
2699
- const m = v[a.locale];
2700
- if (m != null && m.reset) return m.reset;
2701
- const y = v[a.fallbackLocale];
2702
- return (y == null ? void 0 : y.reset) ?? "Reset";
2703
- }), $ = h(() => {
2704
- var v, m;
2705
- return (m = (v = a.layout) == null ? void 0 : v.nodes) != null && m.length ? a.layout.nodes : a.schema.fields;
2676
+ ), J(l, (b) => {
2677
+ b && g.setLocale(b);
2678
+ }), Ze();
2679
+ const $ = x(() => {
2680
+ var S, N;
2681
+ const b = a.schema.translations;
2682
+ if (!b) return "";
2683
+ const v = b[l.value];
2684
+ if ((S = v == null ? void 0 : v.messages) != null && S.title) return v.messages.title;
2685
+ const B = b[n.value];
2686
+ return ((N = B == null ? void 0 : B.messages) == null ? void 0 : N.title) ?? "";
2687
+ }), m = x(() => {
2688
+ var S, N;
2689
+ const b = a.schema.translations;
2690
+ if (!b) return "";
2691
+ const v = b[l.value];
2692
+ if ((S = v == null ? void 0 : v.messages) != null && S.description) return v.messages.description;
2693
+ const B = b[n.value];
2694
+ return ((N = B == null ? void 0 : B.messages) == null ? void 0 : N.description) ?? "";
2695
+ }), C = x(() => {
2696
+ const b = a.schema.translations;
2697
+ if (!b) return "Submit";
2698
+ const v = b[l.value];
2699
+ if (v != null && v.submit) return v.submit;
2700
+ const B = b[n.value];
2701
+ return (B == null ? void 0 : B.submit) ?? "Submit";
2702
+ }), h = x(() => {
2703
+ const b = a.schema.translations;
2704
+ if (!b) return "Reset";
2705
+ const v = b[l.value];
2706
+ if (v != null && v.reset) return v.reset;
2707
+ const B = b[n.value];
2708
+ return (B == null ? void 0 : B.reset) ?? "Reset";
2709
+ }), y = x(() => {
2710
+ var b, v;
2711
+ return (v = (b = a.layout) == null ? void 0 : b.nodes) != null && v.length ? a.layout.nodes : a.schema.fields;
2706
2712
  });
2707
- async function V() {
2713
+ async function A() {
2708
2714
  try {
2709
- await l.submit(async (v) => {
2710
- r("submit", v);
2715
+ await g.submit(async (b) => {
2716
+ s("submit", b);
2711
2717
  });
2712
- } catch (v) {
2713
- r("error", v);
2718
+ } catch (b) {
2719
+ s("error", b);
2714
2720
  }
2715
2721
  }
2716
- function b() {
2717
- l.reset();
2722
+ function V() {
2723
+ g.reset();
2718
2724
  }
2719
- return i({ form: l }), (v, m) => (c(), f("form", {
2720
- class: S([H(d).classes.value.form, "fc-form-builder"]),
2721
- style: O(H(d).cssVars.value),
2725
+ return u({ form: g }), (b, v) => (c(), f("form", {
2726
+ class: F([H(k).classes.value.form, "fc-form-builder"]),
2727
+ style: z(H(k).cssVars.value),
2722
2728
  novalidate: "",
2723
- onSubmit: q(V, ["prevent"]),
2724
- onReset: q(b, ["prevent"])
2729
+ onSubmit: Y(A, ["prevent"]),
2730
+ onReset: Y(V, ["prevent"])
2725
2731
  }, [
2726
- n.value || o.value ? (c(), f("div", pl, [
2727
- n.value ? (c(), f("h2", gl, L(n.value), 1)) : T("", !0),
2728
- o.value ? (c(), f("p", hl, L(o.value), 1)) : T("", !0)
2732
+ $.value || m.value ? (c(), f("div", pl, [
2733
+ $.value ? (c(), f("h2", gl, L($.value), 1)) : T("", !0),
2734
+ m.value ? (c(), f("p", hl, L(m.value), 1)) : T("", !0)
2729
2735
  ])) : T("", !0),
2730
- Z(oe, { nodes: $.value }, null, 8, ["nodes"]),
2736
+ Z(re, { nodes: y.value }, null, 8, ["nodes"]),
2731
2737
  p("div", xl, [
2732
2738
  p("button", {
2733
2739
  type: "submit",
2734
- disabled: H(l).isSubmitting.value,
2735
- class: S([H(d).classes.value.button, "fc-submit-btn rounded-md px-4 py-2 text-sm font-medium text-white motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50"]),
2740
+ disabled: H(g).isSubmitting.value,
2741
+ class: F([H(k).classes.value.button, "fc-submit-btn rounded-md px-4 py-2 text-sm font-medium text-white motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50"]),
2736
2742
  style: { "background-color": "var(--fc-color-primary, #3b82f6)" }
2737
2743
  }, [
2738
- H(l).isSubmitting.value ? (c(), f("span", wl)) : T("", !0),
2739
- _(" " + L(s.value), 1)
2744
+ H(g).isSubmitting.value ? (c(), f("span", wl)) : T("", !0),
2745
+ _(" " + L(C.value), 1)
2740
2746
  ], 10, kl),
2741
2747
  p("button", {
2742
2748
  type: "reset",
2743
- disabled: H(l).isSubmitting.value,
2749
+ disabled: H(g).isSubmitting.value,
2744
2750
  class: "rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 motion-safe:transition-colors motion-safe:duration-150 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50"
2745
- }, L(g.value), 9, $l)
2751
+ }, L(h.value), 9, $l)
2746
2752
  ])
2747
2753
  ], 38));
2748
2754
  }
2749
2755
  });
2750
2756
  export {
2751
- Tl as FormBuilder,
2757
+ Il as FormBuilder,
2752
2758
  Be as FormComponentsKey,
2753
2759
  ce as FormContextKey,
2754
2760
  ye as FormI18nKey,
2761
+ Te as FormaticaKey,
2762
+ Tl as createFormatica,
2755
2763
  Ke as getFieldComponent,
2756
2764
  Fl as getRegisteredFieldTypes,
2757
2765
  Pe as hasFieldType,
2758
- ze as registerFieldType,
2766
+ Fe as registerFieldType,
2759
2767
  Bl as unregisterFieldType,
2760
2768
  et as useForm,
2761
2769
  Ge as useFormI18n,