@formatica/vue 0.1.2 → 0.2.3

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