@object-ui/fields 4.0.5 → 4.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,34 +1,34 @@
1
1
  import e, { Suspense as t, lazy as n, useCallback as r, useContext as i, useEffect as a, useId as o, useMemo as s, useRef as c, useState as l } from "react";
2
2
  import { ComponentRegistry as u } from "@object-ui/core";
3
- import { Avatar as d, AvatarFallback as f, AvatarImage as p, Badge as m, Button as h, Checkbox as g, Dialog as _, DialogContent as v, DialogDescription as y, DialogFooter as b, DialogHeader as ee, DialogTitle as x, EmptyValue as S, Input as C, Label as w, Popover as te, PopoverContent as T, PopoverTrigger as ne, Select as E, SelectContent as re, SelectItem as ie, SelectTrigger as ae, SelectValue as oe, Skeleton as D, Slider as O, Switch as se, Table as ce, TableBody as le, TableCell as k, TableHead as ue, TableHeader as A, TableRow as j, Textarea as M, cn as N } from "@object-ui/components";
4
- import { AlertCircle as de, ArrowDown as fe, ArrowUp as pe, ArrowUpDown as me, Camera as P, Check as F, ChevronLeft as he, ChevronRight as ge, Copy as I, Crop as _e, Crosshair as L, Eraser as R, ExternalLink as z, Eye as B, EyeOff as ve, File as ye, Image as be, ImageIcon as V, Loader2 as xe, MapPin as H, Maximize2 as U, Phone as Se, Plus as Ce, QrCode as W, RotateCw as G, Search as we, SlidersHorizontal as Te, Star as Ee, TableProperties as De, Upload as Oe, X as ke } from "lucide-react";
5
- import { Fragment as Ae, jsx as K, jsxs as q } from "react/jsx-runtime";
6
- import { createSafeTranslation as J } from "@object-ui/i18n";
7
- import { SchemaRendererContext as je } from "@object-ui/react";
8
- import { useUpload as Me } from "@object-ui/providers";
3
+ import { Avatar as d, AvatarFallback as f, AvatarImage as p, Badge as m, Button as h, Checkbox as g, Dialog as _, DialogContent as v, DialogDescription as y, DialogFooter as b, DialogHeader as ee, DialogTitle as x, EmptyValue as S, Input as C, Label as w, Popover as T, PopoverContent as E, PopoverTrigger as te, Select as D, SelectContent as ne, SelectItem as re, SelectTrigger as ie, SelectValue as ae, Skeleton as O, Slider as k, Switch as oe, Table as se, TableBody as ce, TableCell as A, TableHead as le, TableHeader as j, TableRow as M, Textarea as N, cn as P } from "@object-ui/components";
4
+ import { AlertCircle as ue, ArrowDown as de, ArrowUp as fe, ArrowUpDown as pe, Camera as F, Check as I, ChevronLeft as me, ChevronRight as he, Copy as L, Crop as ge, Crosshair as R, Eraser as z, ExternalLink as B, Eye as V, EyeOff as _e, File as ve, Image as ye, ImageIcon as H, Loader2 as be, MapPin as U, Maximize2 as W, Phone as xe, Plus as Se, QrCode as G, RotateCw as K, Search as Ce, SlidersHorizontal as we, Star as Te, TableProperties as Ee, Upload as De, X as Oe } from "lucide-react";
5
+ import { Fragment as ke, jsx as q, jsxs as J } from "react/jsx-runtime";
6
+ import { createSafeTranslation as Y } from "@object-ui/i18n";
7
+ import { SchemaRendererContext as Ae } from "@object-ui/react";
8
+ import { useUpload as je } from "@object-ui/providers";
9
9
  //#region \0rolldown/runtime.js
10
- var Ne = Object.defineProperty, Y = (e, t) => () => (e && (t = e(e = 0)), t), X = (e, t) => {
10
+ var Me = Object.defineProperty, X = (e, t) => () => (e && (t = e(e = 0)), t), Z = (e, t) => {
11
11
  let n = {};
12
- for (var r in e) Ne(n, r, {
12
+ for (var r in e) Me(n, r, {
13
13
  get: e[r],
14
14
  enumerable: !0
15
15
  });
16
- return t || Ne(n, Symbol.toStringTag, { value: "Module" }), n;
17
- }, Pe = /* @__PURE__ */ X({ TextField: () => Fe });
18
- function Fe({ value: e, onChange: t, field: n, readonly: r, ...i }) {
16
+ return t || Me(n, Symbol.toStringTag, { value: "Module" }), n;
17
+ }, Ne = /* @__PURE__ */ Z({ TextField: () => Pe });
18
+ function Pe({ value: e, onChange: t, field: n, readonly: r, ...i }) {
19
19
  let a = n || i.schema;
20
- if (r) return /* @__PURE__ */ K("span", {
20
+ if (r) return /* @__PURE__ */ q("span", {
21
21
  className: "text-sm",
22
- children: e || /* @__PURE__ */ K(S, {})
22
+ children: e || /* @__PURE__ */ q(S, {})
23
23
  });
24
24
  let o = a?.rows, { inputType: s, ...c } = i;
25
- return o && o > 1 ? /* @__PURE__ */ K(M, {
25
+ return o && o > 1 ? /* @__PURE__ */ q(N, {
26
26
  ...c,
27
27
  value: e || "",
28
28
  onChange: (e) => t(e.target.value),
29
29
  placeholder: a?.placeholder,
30
30
  disabled: r || c.disabled
31
- }) : /* @__PURE__ */ K(C, {
31
+ }) : /* @__PURE__ */ q(C, {
32
32
  ...c,
33
33
  type: a?.type === "password" ? "password" : "text",
34
34
  value: e || "",
@@ -37,14 +37,14 @@ function Fe({ value: e, onChange: t, field: n, readonly: r, ...i }) {
37
37
  disabled: r || c.disabled
38
38
  });
39
39
  }
40
- var Ie = Y((() => {})), Le = /* @__PURE__ */ X({ NumberField: () => Re });
41
- function Re({ value: e, onChange: t, field: n, readonly: r, ...i }) {
42
- if (r) return e == null ? /* @__PURE__ */ K(S, {}) : /* @__PURE__ */ K("span", {
40
+ var Fe = X((() => {})), Ie = /* @__PURE__ */ Z({ NumberField: () => Le });
41
+ function Le({ value: e, onChange: t, field: n, readonly: r, ...i }) {
42
+ if (r) return e == null ? /* @__PURE__ */ q(S, {}) : /* @__PURE__ */ q("span", {
43
43
  className: "text-sm",
44
44
  children: e
45
45
  });
46
46
  let a = n || i.schema, o = a?.precision, { inputType: s, ...c } = i;
47
- return /* @__PURE__ */ K(C, {
47
+ return /* @__PURE__ */ q(C, {
48
48
  ...c,
49
49
  type: "number",
50
50
  value: e ?? "",
@@ -57,85 +57,85 @@ function Re({ value: e, onChange: t, field: n, readonly: r, ...i }) {
57
57
  step: o ? 10 ** -o : "any"
58
58
  });
59
59
  }
60
- var ze = Y((() => {})), Be = /* @__PURE__ */ X({ BooleanField: () => Z });
61
- function Z({ value: e, onChange: t, field: n, readonly: r, ...i }) {
60
+ var Re = X((() => {})), ze = /* @__PURE__ */ Z({ BooleanField: () => Be });
61
+ function Be({ value: e, onChange: t, field: n, readonly: r, ...i }) {
62
62
  let a = n || i.schema, s = a?.widget, c = o(), l = a?.name || c, u = a?.label || "Checkbox";
63
- if (r) return /* @__PURE__ */ K("span", {
63
+ if (r) return /* @__PURE__ */ q("span", {
64
64
  className: "text-sm",
65
65
  children: e ? "Yes" : "No"
66
66
  });
67
67
  let { inputType: d, ...f } = i;
68
- return s === "checkbox" ? /* @__PURE__ */ q("div", {
68
+ return s === "checkbox" ? /* @__PURE__ */ J("div", {
69
69
  className: "flex items-center space-x-2",
70
- children: [/* @__PURE__ */ K(g, {
70
+ children: [/* @__PURE__ */ q(g, {
71
71
  ...f,
72
72
  id: l,
73
73
  checked: !!e,
74
74
  onCheckedChange: (e) => t(!!e),
75
75
  disabled: r || f.disabled
76
- }), /* @__PURE__ */ K(w, {
76
+ }), /* @__PURE__ */ q(w, {
77
77
  htmlFor: l,
78
78
  children: u
79
79
  })]
80
- }) : /* @__PURE__ */ q("div", {
80
+ }) : /* @__PURE__ */ J("div", {
81
81
  className: "flex items-center space-x-2",
82
- children: [/* @__PURE__ */ K(se, {
82
+ children: [/* @__PURE__ */ q(oe, {
83
83
  ...f,
84
84
  id: l,
85
85
  checked: !!e,
86
86
  onCheckedChange: t,
87
87
  disabled: r || f.disabled
88
- }), /* @__PURE__ */ K(w, {
88
+ }), /* @__PURE__ */ q(w, {
89
89
  htmlFor: l,
90
90
  children: u
91
91
  })]
92
92
  });
93
93
  }
94
- var Ve = Y((() => {})), He, Ue, We = Y((() => {
94
+ var Ve = X((() => {})), He, Ue, We = X((() => {
95
95
  He = {
96
96
  "common.selectOption": "Select an option",
97
97
  "common.select": "Select...",
98
98
  "common.search": "Search",
99
99
  "table.selected": "{{count}} selected"
100
- }, Ue = J(He, "common.selectOption");
101
- })), Ge = /* @__PURE__ */ X({ SelectField: () => Ke });
100
+ }, Ue = Y(He, "common.selectOption");
101
+ })), Ge = /* @__PURE__ */ Z({ SelectField: () => Ke });
102
102
  function Ke({ value: e, onChange: t, field: n, readonly: r, ...i }) {
103
103
  let a = n || i.schema, o = a?.options || [], { t: s } = Ue();
104
104
  if (r) {
105
105
  let t = o.find((t) => t.value === e)?.label || e;
106
- return t ? /* @__PURE__ */ K("span", {
106
+ return t ? /* @__PURE__ */ q("span", {
107
107
  className: "text-sm",
108
108
  children: t
109
- }) : /* @__PURE__ */ K(S, {});
109
+ }) : /* @__PURE__ */ q(S, {});
110
110
  }
111
- return /* @__PURE__ */ q(E, {
111
+ return /* @__PURE__ */ J(D, {
112
112
  ...i,
113
113
  value: e,
114
114
  onValueChange: t,
115
115
  disabled: r || i.disabled,
116
- children: [/* @__PURE__ */ K(ae, {
116
+ children: [/* @__PURE__ */ q(ie, {
117
117
  className: i.className,
118
118
  id: i.id,
119
- children: /* @__PURE__ */ K(oe, { placeholder: a?.placeholder || s("common.selectOption") })
120
- }), /* @__PURE__ */ K(re, {
119
+ children: /* @__PURE__ */ q(ae, { placeholder: a?.placeholder || s("common.selectOption") })
120
+ }), /* @__PURE__ */ q(ne, {
121
121
  position: "popper",
122
- children: o.map((e) => /* @__PURE__ */ K(ie, {
122
+ children: o.map((e) => /* @__PURE__ */ q(re, {
123
123
  value: e.value,
124
124
  children: e.label
125
125
  }, e.value))
126
126
  })]
127
127
  });
128
128
  }
129
- var qe = Y((() => {
129
+ var qe = X((() => {
130
130
  We();
131
- })), Je = /* @__PURE__ */ X({ DateField: () => Ye });
131
+ })), Je = /* @__PURE__ */ Z({ DateField: () => Ye });
132
132
  function Ye({ value: e, onChange: t, field: n, readonly: r, ...i }) {
133
- if (r) return e ? /* @__PURE__ */ K("span", {
133
+ if (r) return e ? /* @__PURE__ */ q("span", {
134
134
  className: "text-sm",
135
135
  children: new Date(e).toLocaleDateString()
136
- }) : /* @__PURE__ */ K(S, {});
136
+ }) : /* @__PURE__ */ q(S, {});
137
137
  let { inputType: a, ...o } = i;
138
- return /* @__PURE__ */ K(C, {
138
+ return /* @__PURE__ */ q(C, {
139
139
  ...o,
140
140
  type: "date",
141
141
  value: e || "",
@@ -143,16 +143,16 @@ function Ye({ value: e, onChange: t, field: n, readonly: r, ...i }) {
143
143
  disabled: r || o.disabled
144
144
  });
145
145
  }
146
- var Xe = Y((() => {})), Ze = /* @__PURE__ */ X({ EmailField: () => Qe });
146
+ var Xe = X((() => {})), Ze = /* @__PURE__ */ Z({ EmailField: () => Qe });
147
147
  function Qe({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...a }) {
148
148
  let o = n || a.schema;
149
- if (r) return e ? /* @__PURE__ */ K("a", {
149
+ if (r) return e ? /* @__PURE__ */ q("a", {
150
150
  href: `mailto:${e}`,
151
151
  className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
152
152
  children: e
153
- }) : /* @__PURE__ */ K(S, {});
153
+ }) : /* @__PURE__ */ q(S, {});
154
154
  let { inputType: s, ...c } = a;
155
- return /* @__PURE__ */ K(C, {
155
+ return /* @__PURE__ */ q(C, {
156
156
  ...c,
157
157
  type: "email",
158
158
  value: e || "",
@@ -162,16 +162,16 @@ function Qe({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...
162
162
  "aria-invalid": !!i
163
163
  });
164
164
  }
165
- var $e = Y((() => {})), et = /* @__PURE__ */ X({ PhoneField: () => tt });
165
+ var $e = X((() => {})), et = /* @__PURE__ */ Z({ PhoneField: () => tt });
166
166
  function tt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...a }) {
167
167
  let o = n || a.schema;
168
- if (r) return e ? /* @__PURE__ */ K("a", {
168
+ if (r) return e ? /* @__PURE__ */ q("a", {
169
169
  href: `tel:${e}`,
170
170
  className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
171
171
  children: e
172
- }) : /* @__PURE__ */ K(S, {});
172
+ }) : /* @__PURE__ */ q(S, {});
173
173
  let { inputType: s, ...c } = a;
174
- return /* @__PURE__ */ K(C, {
174
+ return /* @__PURE__ */ q(C, {
175
175
  ...c,
176
176
  type: "tel",
177
177
  value: e || "",
@@ -181,21 +181,21 @@ function tt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...
181
181
  "aria-invalid": !!i
182
182
  });
183
183
  }
184
- var nt = Y((() => {})), rt = /* @__PURE__ */ X({ UrlField: () => it });
184
+ var nt = X((() => {})), rt = /* @__PURE__ */ Z({ UrlField: () => it });
185
185
  function it({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...a }) {
186
186
  let o = n || a.schema;
187
- if (r) return e ? e.startsWith("http://") || e.startsWith("https://") ? /* @__PURE__ */ K("a", {
187
+ if (r) return e ? e.startsWith("http://") || e.startsWith("https://") ? /* @__PURE__ */ q("a", {
188
188
  href: e,
189
189
  target: "_blank",
190
190
  rel: "noopener noreferrer",
191
191
  className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
192
192
  children: e
193
- }) : /* @__PURE__ */ K("span", {
193
+ }) : /* @__PURE__ */ q("span", {
194
194
  className: "text-sm",
195
195
  children: e
196
- }) : /* @__PURE__ */ K(S, {});
196
+ }) : /* @__PURE__ */ q(S, {});
197
197
  let { inputType: s, ...c } = a;
198
- return /* @__PURE__ */ K(C, {
198
+ return /* @__PURE__ */ q(C, {
199
199
  ...c,
200
200
  type: "url",
201
201
  value: e || "",
@@ -205,7 +205,7 @@ function it({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...
205
205
  "aria-invalid": !!i
206
206
  });
207
207
  }
208
- var at = Y((() => {})), ot = /* @__PURE__ */ X({ CurrencyField: () => ct });
208
+ var at = X((() => {})), ot = /* @__PURE__ */ Z({ CurrencyField: () => ct });
209
209
  function st(e, t = "USD") {
210
210
  try {
211
211
  return new Intl.NumberFormat("en-US", {
@@ -218,7 +218,7 @@ function st(e, t = "USD") {
218
218
  }
219
219
  function ct({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, className: a, ...o }) {
220
220
  let s = n || o.schema, c = s?.currency || "USD", l = s?.precision ?? 2;
221
- if (r) return e == null ? /* @__PURE__ */ K(S, {}) : /* @__PURE__ */ K("span", {
221
+ if (r) return e == null ? /* @__PURE__ */ q(S, {}) : /* @__PURE__ */ q("span", {
222
222
  className: "text-sm font-medium tabular-nums",
223
223
  children: st(Number(e), c)
224
224
  });
@@ -226,12 +226,12 @@ function ct({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, cla
226
226
  let n = parseFloat(e.target.value);
227
227
  isNaN(n) || t(parseFloat(n.toFixed(l)));
228
228
  };
229
- return /* @__PURE__ */ q("div", {
229
+ return /* @__PURE__ */ J("div", {
230
230
  className: "relative",
231
- children: [/* @__PURE__ */ K("span", {
231
+ children: [/* @__PURE__ */ q("span", {
232
232
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",
233
233
  children: c === "USD" ? "$" : c
234
- }), /* @__PURE__ */ K(C, {
234
+ }), /* @__PURE__ */ q(C, {
235
235
  ...o,
236
236
  type: "number",
237
237
  value: e ?? "",
@@ -247,40 +247,40 @@ function ct({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, cla
247
247
  })]
248
248
  });
249
249
  }
250
- var lt = Y((() => {})), ut = /* @__PURE__ */ X({ TextAreaField: () => dt });
250
+ var lt = X((() => {})), ut = /* @__PURE__ */ Z({ TextAreaField: () => dt });
251
251
  function dt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...a }) {
252
- if (r) return /* @__PURE__ */ K("div", {
252
+ if (r) return /* @__PURE__ */ q("div", {
253
253
  className: "text-sm whitespace-pre-wrap",
254
- children: e || /* @__PURE__ */ K(S, {})
254
+ children: e || /* @__PURE__ */ q(S, {})
255
255
  });
256
256
  let o = n || a.schema, s = o?.rows || 4, c = o?.max_length, u = !!(a.mobileFullscreen ?? o?.mobile_fullscreen ?? a.mobile_fullscreen ?? a.schema?.mobile_fullscreen), [d, f] = l(!1), [p, m] = l(e ?? ""), g = () => {
257
257
  m(e ?? ""), f(!0);
258
258
  }, y = () => f(!1), C = () => {
259
259
  t(p), f(!1);
260
- }, { inputType: w, mobileFullscreen: te, ...T } = a;
261
- return /* @__PURE__ */ q("div", {
260
+ }, { inputType: w, mobileFullscreen: T, ...E } = a;
261
+ return /* @__PURE__ */ J("div", {
262
262
  className: "relative",
263
263
  children: [
264
- /* @__PURE__ */ K(M, {
265
- ...T,
264
+ /* @__PURE__ */ q(N, {
265
+ ...E,
266
266
  value: e || "",
267
267
  onChange: (e) => t(e.target.value),
268
268
  placeholder: o?.placeholder,
269
- disabled: r || T.disabled,
269
+ disabled: r || E.disabled,
270
270
  rows: s,
271
271
  maxLength: c,
272
272
  "aria-invalid": !!i,
273
- className: T.className
273
+ className: E.className
274
274
  }),
275
- u && /* @__PURE__ */ K("button", {
275
+ u && /* @__PURE__ */ q("button", {
276
276
  type: "button",
277
277
  onClick: g,
278
278
  className: "absolute top-1.5 right-1.5 inline-flex items-center justify-center size-7 rounded-md bg-background/80 text-muted-foreground hover:text-foreground hover:bg-background border shadow-sm transition-colors",
279
279
  "aria-label": `Edit ${o?.label ?? "text"} fullscreen`,
280
280
  "data-testid": "textarea-fullscreen-toggle",
281
- children: /* @__PURE__ */ K(U, { className: "size-3.5" })
281
+ children: /* @__PURE__ */ q(W, { className: "size-3.5" })
282
282
  }),
283
- c && /* @__PURE__ */ q("div", {
283
+ c && /* @__PURE__ */ J("div", {
284
284
  className: "absolute bottom-2 right-2 text-xs text-gray-400",
285
285
  "aria-live": "polite",
286
286
  "aria-label": `Character count: ${(e || "").length} of ${c}`,
@@ -290,23 +290,23 @@ function dt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...
290
290
  c
291
291
  ]
292
292
  }),
293
- u && /* @__PURE__ */ K(_, {
293
+ u && /* @__PURE__ */ q(_, {
294
294
  open: d,
295
295
  onOpenChange: f,
296
- children: /* @__PURE__ */ q(v, {
296
+ children: /* @__PURE__ */ J(v, {
297
297
  className: "sm:max-w-3xl h-[100dvh] sm:h-[80vh] max-h-[100dvh] sm:max-h-[80vh] flex flex-col p-0 gap-0",
298
298
  "data-testid": "textarea-fullscreen-dialog",
299
299
  children: [
300
- /* @__PURE__ */ K(ee, {
300
+ /* @__PURE__ */ q(ee, {
301
301
  className: "p-4 border-b",
302
- children: /* @__PURE__ */ K(x, {
302
+ children: /* @__PURE__ */ q(x, {
303
303
  className: "text-base",
304
304
  children: o?.label ?? "Edit text"
305
305
  })
306
306
  }),
307
- /* @__PURE__ */ K("div", {
307
+ /* @__PURE__ */ q("div", {
308
308
  className: "flex-1 min-h-0 p-4",
309
- children: /* @__PURE__ */ K(M, {
309
+ children: /* @__PURE__ */ q(N, {
310
310
  autoFocus: !0,
311
311
  value: p,
312
312
  onChange: (e) => m(e.target.value),
@@ -316,27 +316,27 @@ function dt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...
316
316
  "data-testid": "textarea-fullscreen-input"
317
317
  })
318
318
  }),
319
- /* @__PURE__ */ q(b, {
319
+ /* @__PURE__ */ J(b, {
320
320
  className: "p-3 border-t flex-row justify-between sm:justify-end gap-2",
321
- children: [c && /* @__PURE__ */ q("span", {
321
+ children: [c && /* @__PURE__ */ J("span", {
322
322
  className: "text-xs text-muted-foreground self-center",
323
323
  children: [
324
324
  p.length,
325
325
  "/",
326
326
  c
327
327
  ]
328
- }), /* @__PURE__ */ q("div", {
328
+ }), /* @__PURE__ */ J("div", {
329
329
  className: "flex gap-2 ml-auto",
330
- children: [/* @__PURE__ */ q(h, {
330
+ children: [/* @__PURE__ */ J(h, {
331
331
  type: "button",
332
332
  variant: "ghost",
333
333
  onClick: y,
334
- children: [/* @__PURE__ */ K(ke, { className: "size-4 mr-1" }), " Cancel"]
335
- }), /* @__PURE__ */ q(h, {
334
+ children: [/* @__PURE__ */ q(Oe, { className: "size-4 mr-1" }), " Cancel"]
335
+ }), /* @__PURE__ */ J(h, {
336
336
  type: "button",
337
337
  onClick: C,
338
338
  "data-testid": "textarea-fullscreen-save",
339
- children: [/* @__PURE__ */ K(F, { className: "size-4 mr-1" }), " Done"]
339
+ children: [/* @__PURE__ */ q(I, { className: "size-4 mr-1" }), " Done"]
340
340
  })]
341
341
  })]
342
342
  })
@@ -346,22 +346,22 @@ function dt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...
346
346
  ]
347
347
  });
348
348
  }
349
- var ft = Y((() => {})), pt = /* @__PURE__ */ X({ RichTextField: () => mt });
349
+ var ft = X((() => {})), pt = /* @__PURE__ */ Z({ RichTextField: () => mt });
350
350
  function mt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...a }) {
351
- if (r) return /* @__PURE__ */ K("div", {
351
+ if (r) return /* @__PURE__ */ q("div", {
352
352
  className: "text-sm prose prose-sm max-w-none",
353
- children: e || /* @__PURE__ */ K(S, {})
353
+ children: e || /* @__PURE__ */ q(S, {})
354
354
  });
355
355
  let o = n || a.schema, s = o?.rows || 8;
356
- return /* @__PURE__ */ q("div", {
356
+ return /* @__PURE__ */ J("div", {
357
357
  className: "space-y-2",
358
- children: [/* @__PURE__ */ q("div", {
358
+ children: [/* @__PURE__ */ J("div", {
359
359
  className: "flex items-center justify-between text-xs text-gray-500",
360
- children: [/* @__PURE__ */ q("span", { children: ["Format: ", o?.format || "markdown"] }), /* @__PURE__ */ K("span", {
360
+ children: [/* @__PURE__ */ J("span", { children: ["Format: ", o?.format || "markdown"] }), /* @__PURE__ */ q("span", {
361
361
  className: "italic",
362
362
  children: "Rich text editor (basic)"
363
363
  })]
364
- }), /* @__PURE__ */ K(M, {
364
+ }), /* @__PURE__ */ q(N, {
365
365
  value: e || "",
366
366
  onChange: (e) => t(e.target.value),
367
367
  placeholder: o?.placeholder || "Enter text...",
@@ -372,7 +372,7 @@ function mt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...
372
372
  })]
373
373
  });
374
374
  }
375
- var ht = Y((() => {}));
375
+ var ht = X((() => {}));
376
376
  //#endregion
377
377
  //#region src/widgets/RecordPickerDialog.tsx
378
378
  function gt(e) {
@@ -422,13 +422,13 @@ function yt(e, t) {
422
422
  }
423
423
  return n;
424
424
  }
425
- function bt({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i = !1, dataSource: o, objectName: u, columns: d, displayField: f = "name", idField: p = "id", pageSize: m = xt, value: y, onSelect: S, onSelectRecords: te, lookupFilters: T, cellRenderer: ne, filterColumns: O, renderFilterBar: se, renderGrid: M }) {
426
- let [P, I] = l([]), [_e, L] = l(!1), [R, z] = l(null), [B, ve] = l(0), [ye, be] = l(""), [V, H] = l(1), U = c(null), [Se, Ce] = l(null), [W, G] = l("asc"), [Ee, De] = l(/* @__PURE__ */ new Set()), Oe = c(/* @__PURE__ */ new Map()), [J, je] = l(-1), Me = c(null), [Ne, Y] = l(!1), [X, Pe] = l({}), [Fe, Ie] = l({}), Le = c(null), [Re, ze] = l(""), Be = s(() => d && d.length > 0 ? d.map(gt) : [{
425
+ function bt({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i = !1, dataSource: o, objectName: u, columns: d, displayField: f = "name", idField: p = "id", pageSize: m = xt, value: y, onSelect: S, onSelectRecords: T, lookupFilters: E, cellRenderer: te, filterColumns: k, renderFilterBar: oe, renderGrid: N }) {
426
+ let [F, L] = l([]), [ge, R] = l(!1), [z, B] = l(null), [V, _e] = l(0), [ve, ye] = l(""), [H, U] = l(1), W = c(null), [xe, Se] = l(null), [G, K] = l("asc"), [Te, Ee] = l(/* @__PURE__ */ new Set()), De = c(/* @__PURE__ */ new Map()), [Y, Ae] = l(-1), je = c(null), [Me, X] = l(!1), [Z, Ne] = l({}), [Pe, Fe] = l({}), Ie = c(null), [Le, Re] = l(""), ze = s(() => d && d.length > 0 ? d.map(gt) : [{
427
427
  field: f,
428
428
  label: _t(f)
429
- }], [d, f]), Z = s(() => {
430
- if (O && O.length > 0) return O;
431
- if (T && T.length > 0) return T.map((e) => {
429
+ }], [d, f]), Be = s(() => {
430
+ if (k && k.length > 0) return k;
431
+ if (E && E.length > 0) return E.map((e) => {
432
432
  let t = "text";
433
433
  return typeof e.value == "boolean" ? t = "boolean" : Array.isArray(e.value) ? t = "select" : typeof e.value == "number" || e.operator === "gt" || e.operator === "lt" || e.operator === "gte" || e.operator === "lte" ? t = "number" : (e.operator === "in" || e.operator === "notIn") && (t = "select"), {
434
434
  field: e.field,
@@ -449,19 +449,19 @@ function bt({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i
449
449
  }) } : {}
450
450
  };
451
451
  });
452
- }, [O, T]), Ve = s(() => {
453
- let e = T?.length ? vt(T) : {}, t = Z?.length ? yt(X, Z) : {}, n = {
452
+ }, [k, E]), Ve = s(() => {
453
+ let e = E?.length ? vt(E) : {}, t = Be?.length ? yt(Z, Be) : {}, n = {
454
454
  ...e,
455
455
  ...t
456
456
  };
457
457
  return Object.keys(n).length > 0 ? n : void 0;
458
458
  }, [
459
- T,
460
- Z,
461
- X
462
- ]), He = Math.max(1, Math.ceil(B / m)), Ue = r(async (e, t = 1, n, r) => {
459
+ E,
460
+ Be,
461
+ Z
462
+ ]), He = Math.max(1, Math.ceil(V / m)), Ue = r(async (e, t = 1, n, r) => {
463
463
  if (!(!o || !u)) {
464
- L(!0), z(null);
464
+ R(!0), B(null);
465
465
  try {
466
466
  let i = {
467
467
  $top: m,
@@ -471,11 +471,11 @@ function bt({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i
471
471
  let a = r === void 0 ? Ve : r;
472
472
  a && Object.keys(a).length > 0 && (i.$filter = a);
473
473
  let s = await o.find(u, i), c = s?.data ?? s ?? [];
474
- I(c), ve(s?.total ?? c.length), je(-1);
474
+ L(c), _e(s?.total ?? c.length), Ae(-1);
475
475
  } catch (e) {
476
- z(e instanceof Error ? e.message : String(e)), I([]);
476
+ B(e instanceof Error ? e.message : String(e)), L([]);
477
477
  } finally {
478
- L(!1);
478
+ R(!1);
479
479
  }
480
480
  }
481
481
  }, [
@@ -483,92 +483,92 @@ function bt({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i
483
483
  u,
484
484
  m,
485
485
  Ve
486
- ]), We = s(() => Se ? {
487
- field: Se,
488
- direction: W
489
- } : null, [Se, W]);
486
+ ]), We = s(() => xe ? {
487
+ field: xe,
488
+ direction: G
489
+ } : null, [xe, G]);
490
490
  a(() => {
491
- e || (be(""), H(1), z(null), I([]), Ce(null), G("asc"), je(-1), Y(!1), Pe({}), Ie({}), ze(""), De(new Set(i && Array.isArray(y) ? y : [])), Oe.current.clear());
491
+ e || (ye(""), U(1), B(null), L([]), Se(null), K("asc"), Ae(-1), X(!1), Ne({}), Fe({}), Re(""), Ee(new Set(i && Array.isArray(y) ? y : [])), De.current.clear());
492
492
  }, [e]), a(() => {
493
- e && Ue(ye || void 0, V, We);
493
+ e && Ue(ve || void 0, H, We);
494
494
  }, [
495
495
  e,
496
- V,
496
+ H,
497
497
  We,
498
498
  Ve
499
499
  ]), a(() => {
500
- e && i && De(new Set(Array.isArray(y) ? y : []));
500
+ e && i && Ee(new Set(Array.isArray(y) ? y : []));
501
501
  }, [
502
502
  e,
503
503
  i,
504
504
  y
505
505
  ]);
506
506
  let Ge = r((e) => {
507
- be(e), H(1), U.current && clearTimeout(U.current), U.current = setTimeout(() => {
507
+ ye(e), U(1), W.current && clearTimeout(W.current), W.current = setTimeout(() => {
508
508
  Ue(e || void 0, 1, We);
509
509
  }, 300);
510
510
  }, [Ue, We]);
511
511
  a(() => () => {
512
- U.current && clearTimeout(U.current);
512
+ W.current && clearTimeout(W.current);
513
513
  }, []);
514
514
  let Ke = r((e) => {
515
- Ce((t) => t === e ? (G((e) => e === "asc" ? "desc" : "asc"), e) : (G("asc"), e)), H(1);
515
+ Se((t) => t === e ? (K((e) => e === "asc" ? "desc" : "asc"), e) : (K("asc"), e)), U(1);
516
516
  }, []), qe = r((e) => e[p] ?? e.id ?? e._id, [p]), Je = r((e) => {
517
517
  let t = qe(e);
518
- return i ? Ee.has(t) : y === t;
518
+ return i ? Te.has(t) : y === t;
519
519
  }, [
520
520
  i,
521
521
  y,
522
- Ee,
522
+ Te,
523
523
  qe
524
524
  ]), Ye = r((e) => {
525
525
  let n = qe(e);
526
- i ? De((t) => {
526
+ i ? Ee((t) => {
527
527
  let r = new Set(t);
528
- return r.has(n) ? (r.delete(n), Oe.current.delete(n)) : (r.add(n), Oe.current.set(n, e)), r;
529
- }) : (S(n), te?.([e]), t(!1));
528
+ return r.has(n) ? (r.delete(n), De.current.delete(n)) : (r.add(n), De.current.set(n, e)), r;
529
+ }) : (S(n), T?.([e]), t(!1));
530
530
  }, [
531
531
  i,
532
532
  qe,
533
533
  S,
534
- te,
534
+ T,
535
535
  t
536
536
  ]), Xe = r(() => {
537
- let e = Array.from(Ee);
537
+ let e = Array.from(Te);
538
538
  S(e);
539
- let n = e.map((e) => Oe.current.get(e)).filter(Boolean);
540
- te?.(n), t(!1);
539
+ let n = e.map((e) => De.current.get(e)).filter(Boolean);
540
+ T?.(n), t(!1);
541
541
  }, [
542
- Ee,
542
+ Te,
543
543
  S,
544
- te,
544
+ T,
545
545
  t
546
546
  ]), Ze = r(() => {
547
- H((e) => Math.max(1, e - 1));
547
+ U((e) => Math.max(1, e - 1));
548
548
  }, []), Qe = r(() => {
549
- H((e) => Math.min(He, e + 1));
549
+ U((e) => Math.min(He, e + 1));
550
550
  }, [He]), $e = r((e) => {
551
551
  if (e.key !== "Enter") return;
552
- let t = parseInt(Re, 10);
553
- !isNaN(t) && t >= 1 && t <= He && H(t), ze("");
554
- }, [Re, He]), et = r((e) => {
555
- P.length !== 0 && (e.key === "ArrowDown" ? (e.preventDefault(), je((e) => Math.min(e + 1, P.length - 1))) : e.key === "ArrowUp" ? (e.preventDefault(), je((e) => Math.max(e - 1, 0))) : (e.key === "Enter" || e.key === " ") && (e.preventDefault(), J >= 0 && J < P.length && Ye(P[J])));
552
+ let t = parseInt(Le, 10);
553
+ !isNaN(t) && t >= 1 && t <= He && U(t), Re("");
554
+ }, [Le, He]), et = r((e) => {
555
+ F.length !== 0 && (e.key === "ArrowDown" ? (e.preventDefault(), Ae((e) => Math.min(e + 1, F.length - 1))) : e.key === "ArrowUp" ? (e.preventDefault(), Ae((e) => Math.max(e - 1, 0))) : (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Y >= 0 && Y < F.length && Ye(F[Y])));
556
556
  }, [
557
- P,
558
- J,
557
+ F,
558
+ Y,
559
559
  Ye
560
560
  ]);
561
561
  a(() => {
562
- if (J >= 0 && Me.current) {
563
- let e = Me.current.querySelector(`[data-row-index="${J}"]`);
562
+ if (Y >= 0 && je.current) {
563
+ let e = je.current.querySelector(`[data-row-index="${Y}"]`);
564
564
  e && typeof e.scrollIntoView == "function" && e.scrollIntoView({ block: "nearest" });
565
565
  }
566
- }, [J]);
566
+ }, [Y]);
567
567
  let tt = r((e, t) => {
568
568
  let n = e[t.field];
569
- if (t.type && ne) {
570
- let e = ne(t.type);
571
- if (e) return /* @__PURE__ */ K(e, {
569
+ if (t.type && te) {
570
+ let e = te(t.type);
571
+ if (e) return /* @__PURE__ */ q(e, {
572
572
  value: n,
573
573
  field: {
574
574
  name: t.field,
@@ -577,56 +577,56 @@ function bt({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i
577
577
  });
578
578
  }
579
579
  return n == null ? "" : typeof n == "object" ? n.$numberDecimal ? String(Number(n.$numberDecimal)) : n.$oid ? String(n.$oid) : n.$date ? new Date(n.$date).toLocaleDateString() : n.name || n.label ? String(n.name || n.label) : JSON.stringify(n) : typeof n == "boolean" ? n ? "Yes" : "No" : String(n);
580
- }, [ne]), nt = r((e) => Se === e ? K(W === "asc" ? pe : fe, { className: "ml-1 size-3" }) : /* @__PURE__ */ K(me, { className: "ml-1 size-3 opacity-40" }), [Se, W]), rt = r((e, t, n) => {
581
- e.preventDefault(), e.stopPropagation(), Le.current = {
580
+ }, [te]), nt = r((e) => xe === e ? q(G === "asc" ? fe : de, { className: "ml-1 size-3" }) : /* @__PURE__ */ q(pe, { className: "ml-1 size-3 opacity-40" }), [xe, G]), rt = r((e, t, n) => {
581
+ e.preventDefault(), e.stopPropagation(), Ie.current = {
582
582
  field: t,
583
583
  startX: e.clientX,
584
584
  startWidth: n
585
585
  };
586
586
  let r = (e) => {
587
- if (!Le.current) return;
588
- let t = e.clientX - Le.current.startX, n = Math.max(St, Le.current.startWidth + t);
589
- Ie((e) => ({
587
+ if (!Ie.current) return;
588
+ let t = e.clientX - Ie.current.startX, n = Math.max(St, Ie.current.startWidth + t);
589
+ Fe((e) => ({
590
590
  ...e,
591
- [Le.current.field]: n
591
+ [Ie.current.field]: n
592
592
  }));
593
593
  }, i = () => {
594
- Le.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
594
+ Ie.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
595
595
  };
596
596
  document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
597
597
  }, []), it = r((e, t) => {
598
- Pe((n) => ({
598
+ Ne((n) => ({
599
599
  ...n,
600
600
  [e]: t
601
- })), H(1);
601
+ })), U(1);
602
602
  }, []), at = r(() => {
603
- Pe({}), H(1);
604
- }, []), ot = s(() => Object.values(X).filter((e) => e != null && e !== "").length, [X]), st = r((e) => {
605
- let t = X[e.field], n = e.label || _t(e.field);
603
+ Ne({}), U(1);
604
+ }, []), ot = s(() => Object.values(Z).filter((e) => e != null && e !== "").length, [Z]), st = r((e) => {
605
+ let t = Z[e.field], n = e.label || _t(e.field);
606
606
  switch (e.type) {
607
- case "select": return /* @__PURE__ */ q("div", {
607
+ case "select": return /* @__PURE__ */ J("div", {
608
608
  className: "space-y-1",
609
- children: [/* @__PURE__ */ K(w, {
609
+ children: [/* @__PURE__ */ q(w, {
610
610
  className: "text-xs text-muted-foreground",
611
611
  children: n
612
- }), /* @__PURE__ */ q(E, {
612
+ }), /* @__PURE__ */ J(D, {
613
613
  value: t == null ? "" : String(t),
614
614
  onValueChange: (t) => it(e.field, t),
615
- children: [/* @__PURE__ */ K(ae, {
615
+ children: [/* @__PURE__ */ q(ie, {
616
616
  className: "h-8 text-xs",
617
- children: /* @__PURE__ */ K(oe, { placeholder: `Filter ${n}` })
618
- }), /* @__PURE__ */ K(re, { children: e.options?.map((e) => /* @__PURE__ */ K(ie, {
617
+ children: /* @__PURE__ */ q(ae, { placeholder: `Filter ${n}` })
618
+ }), /* @__PURE__ */ q(ne, { children: e.options?.map((e) => /* @__PURE__ */ q(re, {
619
619
  value: String(e.value),
620
620
  children: e.label
621
621
  }, String(e.value))) })]
622
622
  })]
623
623
  });
624
- case "number": return /* @__PURE__ */ q("div", {
624
+ case "number": return /* @__PURE__ */ J("div", {
625
625
  className: "space-y-1",
626
- children: [/* @__PURE__ */ K(w, {
626
+ children: [/* @__PURE__ */ q(w, {
627
627
  className: "text-xs text-muted-foreground",
628
628
  children: n
629
- }), /* @__PURE__ */ K(C, {
629
+ }), /* @__PURE__ */ q(C, {
630
630
  type: "number",
631
631
  className: "h-8 text-xs",
632
632
  value: t ?? "",
@@ -637,40 +637,40 @@ function bt({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i
637
637
  }
638
638
  })]
639
639
  });
640
- case "date": return /* @__PURE__ */ q("div", {
640
+ case "date": return /* @__PURE__ */ J("div", {
641
641
  className: "space-y-1",
642
- children: [/* @__PURE__ */ K(w, {
642
+ children: [/* @__PURE__ */ q(w, {
643
643
  className: "text-xs text-muted-foreground",
644
644
  children: n
645
- }), /* @__PURE__ */ K(C, {
645
+ }), /* @__PURE__ */ q(C, {
646
646
  type: "date",
647
647
  className: "h-8 text-xs",
648
648
  value: t ?? "",
649
649
  onChange: (t) => it(e.field, t.target.value)
650
650
  })]
651
651
  });
652
- case "boolean": return /* @__PURE__ */ q("div", {
652
+ case "boolean": return /* @__PURE__ */ J("div", {
653
653
  className: "space-y-1",
654
- children: [/* @__PURE__ */ K(w, {
654
+ children: [/* @__PURE__ */ q(w, {
655
655
  className: "text-xs text-muted-foreground",
656
656
  children: n
657
- }), /* @__PURE__ */ q("div", {
657
+ }), /* @__PURE__ */ J("div", {
658
658
  className: "flex items-center gap-2 h-8",
659
- children: [/* @__PURE__ */ K(g, {
659
+ children: [/* @__PURE__ */ q(g, {
660
660
  checked: !!t,
661
661
  onCheckedChange: (t) => it(e.field, !!t)
662
- }), /* @__PURE__ */ K("span", {
662
+ }), /* @__PURE__ */ q("span", {
663
663
  className: "text-xs text-muted-foreground",
664
664
  children: "Yes"
665
665
  })]
666
666
  })]
667
667
  });
668
- default: return /* @__PURE__ */ q("div", {
668
+ default: return /* @__PURE__ */ J("div", {
669
669
  className: "space-y-1",
670
- children: [/* @__PURE__ */ K(w, {
670
+ children: [/* @__PURE__ */ q(w, {
671
671
  className: "text-xs text-muted-foreground",
672
672
  children: n
673
- }), /* @__PURE__ */ K(C, {
673
+ }), /* @__PURE__ */ q(C, {
674
674
  className: "h-8 text-xs",
675
675
  value: t ?? "",
676
676
  placeholder: `Filter ${n}`,
@@ -678,165 +678,165 @@ function bt({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i
678
678
  })]
679
679
  });
680
680
  }
681
- }, [X, it]), ct = r((e, t) => e ? "bg-primary/5 hover:bg-primary/10" : t % 2 == 1 ? "bg-muted/20 hover:bg-accent/30" : "hover:bg-accent/30", []);
682
- return /* @__PURE__ */ K(_, {
681
+ }, [Z, it]), ct = r((e, t) => e ? "bg-primary/5 hover:bg-primary/10" : t % 2 == 1 ? "bg-muted/20 hover:bg-accent/30" : "hover:bg-accent/30", []);
682
+ return /* @__PURE__ */ q(_, {
683
683
  open: e,
684
684
  onOpenChange: t,
685
- children: /* @__PURE__ */ q(v, {
685
+ children: /* @__PURE__ */ J(v, {
686
686
  className: "w-[95vw] sm:max-w-3xl lg:max-w-5xl max-h-[85vh] sm:max-h-[80vh] flex flex-col gap-0",
687
687
  "data-testid": "record-picker-dialog",
688
688
  children: [
689
- /* @__PURE__ */ K(ee, { children: /* @__PURE__ */ q(x, { children: [n, i && /* @__PURE__ */ K("span", {
689
+ /* @__PURE__ */ q(ee, { children: /* @__PURE__ */ J(x, { children: [n, i && /* @__PURE__ */ q("span", {
690
690
  className: "sr-only",
691
691
  children: " (multiple selection)"
692
692
  })] }) }),
693
- /* @__PURE__ */ q("div", {
693
+ /* @__PURE__ */ J("div", {
694
694
  className: "relative rounded-md border bg-muted/30 mb-3",
695
695
  children: [
696
- /* @__PURE__ */ K(we, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }),
697
- /* @__PURE__ */ K(C, {
696
+ /* @__PURE__ */ q(Ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }),
697
+ /* @__PURE__ */ q(C, {
698
698
  placeholder: "Search...",
699
- value: ye,
699
+ value: ve,
700
700
  onChange: (e) => Ge(e.target.value),
701
701
  className: "pl-9 border-0 bg-transparent shadow-none focus-visible:ring-0",
702
702
  "data-testid": "record-picker-search"
703
703
  }),
704
- _e && /* @__PURE__ */ K(xe, {
704
+ ge && /* @__PURE__ */ q(be, {
705
705
  className: "absolute right-3 top-1/2 -translate-y-1/2 size-4 animate-spin text-muted-foreground",
706
706
  "data-testid": "record-picker-loading-indicator"
707
707
  })
708
708
  ]
709
709
  }),
710
- Z && Z.length > 0 && /* @__PURE__ */ K("div", {
710
+ Be && Be.length > 0 && /* @__PURE__ */ q("div", {
711
711
  className: "py-2",
712
- children: se ? /* @__PURE__ */ K("div", {
712
+ children: oe ? /* @__PURE__ */ q("div", {
713
713
  "data-testid": "record-picker-filter-bar",
714
- children: se({
715
- filterColumns: Z,
716
- values: X,
714
+ children: oe({
715
+ filterColumns: Be,
716
+ values: Z,
717
717
  onChange: it,
718
718
  onClear: at,
719
719
  activeCount: ot
720
720
  })
721
- }) : /* @__PURE__ */ q(Ae, { children: [/* @__PURE__ */ q("div", {
721
+ }) : /* @__PURE__ */ J(ke, { children: [/* @__PURE__ */ J("div", {
722
722
  className: "flex items-center gap-2",
723
723
  "data-testid": "record-picker-filter-bar",
724
- children: [/* @__PURE__ */ q(h, {
724
+ children: [/* @__PURE__ */ J(h, {
725
725
  type: "button",
726
726
  variant: ot > 0 ? "secondary" : "outline",
727
727
  size: "sm",
728
728
  className: "gap-1.5 shrink-0",
729
- onClick: () => Y((e) => !e),
729
+ onClick: () => X((e) => !e),
730
730
  children: [
731
- /* @__PURE__ */ K(Te, { className: "size-3.5" }),
731
+ /* @__PURE__ */ q(we, { className: "size-3.5" }),
732
732
  "Filters",
733
- ot > 0 && /* @__PURE__ */ K("span", {
733
+ ot > 0 && /* @__PURE__ */ q("span", {
734
734
  className: "inline-flex h-5 min-w-[20px] items-center justify-center rounded-full bg-primary/10 px-1 text-xs font-medium text-primary",
735
735
  children: ot
736
736
  })
737
737
  ]
738
- }), ot > 0 && /* @__PURE__ */ q(h, {
738
+ }), ot > 0 && /* @__PURE__ */ J(h, {
739
739
  type: "button",
740
740
  variant: "ghost",
741
741
  size: "sm",
742
742
  className: "gap-1 text-xs",
743
743
  onClick: at,
744
- children: [/* @__PURE__ */ K(ke, { className: "size-3" }), "Clear"]
744
+ children: [/* @__PURE__ */ q(Oe, { className: "size-3" }), "Clear"]
745
745
  })]
746
- }), Ne && /* @__PURE__ */ K("div", {
746
+ }), Me && /* @__PURE__ */ q("div", {
747
747
  className: "mt-2 grid gap-3 sm:grid-cols-2 lg:grid-cols-3 border rounded-md p-3 bg-muted/30",
748
748
  "data-testid": "record-picker-filter-panel",
749
- children: Z.map((e) => /* @__PURE__ */ K("div", { children: st(e) }, e.field))
749
+ children: Be.map((e) => /* @__PURE__ */ q("div", { children: st(e) }, e.field))
750
750
  })] })
751
751
  }),
752
- R && /* @__PURE__ */ q("div", {
752
+ z && /* @__PURE__ */ J("div", {
753
753
  className: "flex flex-col items-center gap-2 py-4",
754
754
  role: "alert",
755
755
  children: [
756
- /* @__PURE__ */ K(de, { className: "size-5 text-destructive" }),
757
- /* @__PURE__ */ K("p", {
756
+ /* @__PURE__ */ q(ue, { className: "size-5 text-destructive" }),
757
+ /* @__PURE__ */ q("p", {
758
758
  className: "text-sm text-destructive",
759
- children: R
759
+ children: z
760
760
  }),
761
- /* @__PURE__ */ K(h, {
761
+ /* @__PURE__ */ q(h, {
762
762
  variant: "outline",
763
763
  size: "sm",
764
- onClick: () => Ue(ye || void 0, V, We),
764
+ onClick: () => Ue(ve || void 0, H, We),
765
765
  type: "button",
766
766
  children: "Retry"
767
767
  })
768
768
  ]
769
769
  }),
770
- M ? /* @__PURE__ */ K("div", {
770
+ N ? /* @__PURE__ */ q("div", {
771
771
  className: "flex-1 min-h-0",
772
772
  "data-testid": "record-picker-grid-slot",
773
- children: M({
774
- columns: Be,
775
- records: P,
776
- loading: _e,
777
- totalCount: B,
778
- currentPage: V,
773
+ children: N({
774
+ columns: ze,
775
+ records: F,
776
+ loading: ge,
777
+ totalCount: V,
778
+ currentPage: H,
779
779
  pageSize: m,
780
- sortField: Se,
781
- sortDirection: W,
780
+ sortField: xe,
781
+ sortDirection: G,
782
782
  onSort: Ke,
783
- onPageChange: H,
783
+ onPageChange: U,
784
784
  onRowClick: Ye,
785
785
  isSelected: Je,
786
786
  multiple: i,
787
787
  idField: p,
788
- cellRenderer: ne
788
+ cellRenderer: te
789
789
  })
790
- }) : /* @__PURE__ */ q(Ae, { children: [
791
- _e && P.length === 0 && !R && /* @__PURE__ */ K("div", {
790
+ }) : /* @__PURE__ */ J(ke, { children: [
791
+ ge && F.length === 0 && !z && /* @__PURE__ */ q("div", {
792
792
  className: "flex-1 overflow-hidden min-h-0 border rounded-md",
793
793
  role: "status",
794
794
  "aria-live": "polite",
795
795
  "data-testid": "record-picker-skeleton",
796
- children: /* @__PURE__ */ q(ce, { children: [/* @__PURE__ */ K(A, { children: /* @__PURE__ */ q(j, {
796
+ children: /* @__PURE__ */ J(se, { children: [/* @__PURE__ */ q(j, { children: /* @__PURE__ */ J(M, {
797
797
  className: "bg-muted/40",
798
- children: [i && /* @__PURE__ */ K(ue, { className: "w-10" }), Be.map((e) => /* @__PURE__ */ K(ue, { children: /* @__PURE__ */ K(D, { className: "h-4 w-20" }) }, e.field))]
799
- }) }), /* @__PURE__ */ K(le, { children: Array.from({ length: Ct }, (e, t) => /* @__PURE__ */ q(j, { children: [i && /* @__PURE__ */ K(k, {
798
+ children: [i && /* @__PURE__ */ q(le, { className: "w-10" }), ze.map((e) => /* @__PURE__ */ q(le, { children: /* @__PURE__ */ q(O, { className: "h-4 w-20" }) }, e.field))]
799
+ }) }), /* @__PURE__ */ q(ce, { children: Array.from({ length: Ct }, (e, t) => /* @__PURE__ */ J(M, { children: [i && /* @__PURE__ */ q(A, {
800
800
  className: "w-10",
801
- children: /* @__PURE__ */ K(D, { className: "size-4 rounded" })
802
- }), Be.map((e) => /* @__PURE__ */ K(k, { children: /* @__PURE__ */ K(D, { className: "h-4 w-full" }) }, e.field))] }, t)) })] })
801
+ children: /* @__PURE__ */ q(O, { className: "size-4 rounded" })
802
+ }), ze.map((e) => /* @__PURE__ */ q(A, { children: /* @__PURE__ */ q(O, { className: "h-4 w-full" }) }, e.field))] }, t)) })] })
803
803
  }),
804
- !_e && !R && P.length === 0 && /* @__PURE__ */ K("div", {
804
+ !ge && !z && F.length === 0 && /* @__PURE__ */ q("div", {
805
805
  className: "py-8 text-center",
806
- children: /* @__PURE__ */ K("p", {
806
+ children: /* @__PURE__ */ q("p", {
807
807
  className: "text-sm text-muted-foreground",
808
808
  children: "No records found"
809
809
  })
810
810
  }),
811
- !R && P.length > 0 && /* @__PURE__ */ q("div", {
811
+ !z && F.length > 0 && /* @__PURE__ */ J("div", {
812
812
  className: "relative flex-1 overflow-auto min-h-0 border rounded-md",
813
813
  tabIndex: 0,
814
814
  onKeyDown: et,
815
815
  role: "grid",
816
816
  "aria-label": "Records",
817
- children: [_e && /* @__PURE__ */ K("div", {
817
+ children: [ge && /* @__PURE__ */ q("div", {
818
818
  className: "absolute inset-0 z-10 flex items-center justify-center bg-background/60",
819
819
  "data-testid": "record-picker-loading-overlay",
820
- children: /* @__PURE__ */ K(xe, { className: "size-6 animate-spin text-muted-foreground" })
821
- }), /* @__PURE__ */ q(ce, {
822
- style: Object.keys(Fe).length > 0 ? { tableLayout: "fixed" } : void 0,
823
- children: [/* @__PURE__ */ K(A, {
820
+ children: /* @__PURE__ */ q(be, { className: "size-6 animate-spin text-muted-foreground" })
821
+ }), /* @__PURE__ */ J(se, {
822
+ style: Object.keys(Pe).length > 0 ? { tableLayout: "fixed" } : void 0,
823
+ children: [/* @__PURE__ */ q(j, {
824
824
  className: "sticky top-0 z-[5] bg-muted/50 [&_tr]:border-b",
825
825
  "data-testid": "record-picker-sticky-header",
826
- children: /* @__PURE__ */ q(j, { children: [i && /* @__PURE__ */ K(ue, { className: "w-10" }), Be.map((e) => {
827
- let t = Fe[e.field];
828
- return /* @__PURE__ */ q(ue, {
826
+ children: /* @__PURE__ */ J(M, { children: [i && /* @__PURE__ */ q(le, { className: "w-10" }), ze.map((e) => {
827
+ let t = Pe[e.field];
828
+ return /* @__PURE__ */ J(le, {
829
829
  style: t ? {
830
830
  width: `${t}px`,
831
831
  minWidth: `${t}px`
832
832
  } : e.width ? { width: e.width } : void 0,
833
833
  className: "cursor-pointer select-none relative group text-xs font-semibold uppercase tracking-wider",
834
834
  onClick: () => Ke(e.field),
835
- "aria-sort": Se === e.field ? W === "asc" ? "ascending" : "descending" : "none",
836
- children: [/* @__PURE__ */ q("span", {
835
+ "aria-sort": xe === e.field ? G === "asc" ? "ascending" : "descending" : "none",
836
+ children: [/* @__PURE__ */ J("span", {
837
837
  className: "inline-flex items-center",
838
838
  children: [e.label || _t(e.field), nt(e.field)]
839
- }), /* @__PURE__ */ K("span", {
839
+ }), /* @__PURE__ */ q("span", {
840
840
  role: "separator",
841
841
  "aria-orientation": "vertical",
842
842
  className: "absolute right-0 top-0 bottom-0 w-1 cursor-col-resize opacity-0 group-hover:opacity-100 bg-border hover:bg-primary/50 transition-opacity",
@@ -849,20 +849,20 @@ function bt({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i
849
849
  })]
850
850
  }, e.field);
851
851
  })] })
852
- }), /* @__PURE__ */ K(le, {
853
- ref: Me,
854
- children: P.map((e, t) => {
855
- let n = qe(e), r = Je(e), a = t === J;
856
- return /* @__PURE__ */ q(j, {
852
+ }), /* @__PURE__ */ q(ce, {
853
+ ref: je,
854
+ children: F.map((e, t) => {
855
+ let n = qe(e), r = Je(e), a = t === Y;
856
+ return /* @__PURE__ */ J(M, {
857
857
  "data-row-index": t,
858
- className: N("cursor-pointer transition-colors", ct(r, t), a && "ring-2 ring-primary ring-inset"),
858
+ className: P("cursor-pointer transition-colors", ct(r, t), a && "ring-2 ring-primary ring-inset"),
859
859
  onClick: () => Ye(e),
860
860
  "data-testid": `record-row-${n}`,
861
861
  "aria-selected": r,
862
- children: [i && /* @__PURE__ */ K(k, {
862
+ children: [i && /* @__PURE__ */ q(A, {
863
863
  className: "w-10",
864
- children: r && /* @__PURE__ */ K(F, { className: "size-4 text-primary" })
865
- }), Be.map((t) => /* @__PURE__ */ K(k, {
864
+ children: r && /* @__PURE__ */ q(I, { className: "size-4 text-primary" })
865
+ }), ze.map((t) => /* @__PURE__ */ q(A, {
866
866
  className: "py-2.5",
867
867
  children: tt(e, t)
868
868
  }, t.field))]
@@ -871,63 +871,63 @@ function bt({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i
871
871
  })]
872
872
  })]
873
873
  }),
874
- !R && B > 0 && /* @__PURE__ */ q("div", {
874
+ !z && V > 0 && /* @__PURE__ */ J("div", {
875
875
  className: "flex items-center justify-between text-sm text-muted-foreground border-t pt-3 mt-2 px-1",
876
876
  "data-testid": "record-picker-pagination",
877
- children: [/* @__PURE__ */ q("span", { children: [
878
- B,
877
+ children: [/* @__PURE__ */ J("span", { children: [
878
+ V,
879
879
  " ",
880
- B === 1 ? "record" : "records",
881
- He > 1 && ` · Page ${V} of ${He}`
882
- ] }), He > 1 && /* @__PURE__ */ q("div", {
880
+ V === 1 ? "record" : "records",
881
+ He > 1 && ` · Page ${H} of ${He}`
882
+ ] }), He > 1 && /* @__PURE__ */ J("div", {
883
883
  className: "flex items-center gap-1.5",
884
884
  children: [
885
- /* @__PURE__ */ K(h, {
885
+ /* @__PURE__ */ q(h, {
886
886
  variant: "outline",
887
887
  size: "icon",
888
888
  className: "size-7",
889
889
  onClick: Ze,
890
- disabled: V <= 1,
890
+ disabled: H <= 1,
891
891
  type: "button",
892
892
  "aria-label": "Previous page",
893
- children: /* @__PURE__ */ K(he, { className: "size-4" })
893
+ children: /* @__PURE__ */ q(me, { className: "size-4" })
894
894
  }),
895
- /* @__PURE__ */ K(C, {
895
+ /* @__PURE__ */ q(C, {
896
896
  className: "h-7 w-12 text-center text-xs px-1",
897
- placeholder: String(V),
898
- value: Re,
899
- onChange: (e) => ze(e.target.value),
897
+ placeholder: String(H),
898
+ value: Le,
899
+ onChange: (e) => Re(e.target.value),
900
900
  onKeyDown: $e,
901
901
  "aria-label": "Jump to page",
902
902
  "data-testid": "record-picker-page-jump"
903
903
  }),
904
- /* @__PURE__ */ K(h, {
904
+ /* @__PURE__ */ q(h, {
905
905
  variant: "outline",
906
906
  size: "icon",
907
907
  className: "size-7",
908
908
  onClick: Qe,
909
- disabled: V >= He,
909
+ disabled: H >= He,
910
910
  type: "button",
911
911
  "aria-label": "Next page",
912
- children: /* @__PURE__ */ K(ge, { className: "size-4" })
912
+ children: /* @__PURE__ */ q(he, { className: "size-4" })
913
913
  })
914
914
  ]
915
915
  })]
916
916
  })
917
917
  ] }),
918
- i && /* @__PURE__ */ K(b, { children: /* @__PURE__ */ q("div", {
918
+ i && /* @__PURE__ */ q(b, { children: /* @__PURE__ */ J("div", {
919
919
  className: "flex items-center gap-2 w-full justify-between",
920
- children: [/* @__PURE__ */ q("span", {
920
+ children: [/* @__PURE__ */ J("span", {
921
921
  className: "text-sm text-muted-foreground",
922
- children: [Ee.size, " selected"]
923
- }), /* @__PURE__ */ q("div", {
922
+ children: [Te.size, " selected"]
923
+ }), /* @__PURE__ */ J("div", {
924
924
  className: "flex gap-2",
925
- children: [/* @__PURE__ */ K(h, {
925
+ children: [/* @__PURE__ */ q(h, {
926
926
  variant: "outline",
927
927
  type: "button",
928
928
  onClick: () => t(!1),
929
929
  children: "Cancel"
930
- }), /* @__PURE__ */ K(h, {
930
+ }), /* @__PURE__ */ q(h, {
931
931
  type: "button",
932
932
  onClick: Xe,
933
933
  children: "Confirm"
@@ -938,7 +938,7 @@ function bt({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i
938
938
  })
939
939
  });
940
940
  }
941
- var xt, St, Ct, wt = Y((() => {
941
+ var xt, St, Ct, wt = X((() => {
942
942
  xt = 10, St = 60, Ct = 5;
943
943
  }));
944
944
  //#endregion
@@ -949,7 +949,7 @@ function Tt(e) {
949
949
  function Et() {
950
950
  return Dt;
951
951
  }
952
- var Dt, Ot = Y((() => {})), kt = /* @__PURE__ */ X({ LookupField: () => Mt });
952
+ var Dt, Ot = X((() => {})), kt = /* @__PURE__ */ Z({ LookupField: () => Mt });
953
953
  function At(e, t, n, r) {
954
954
  let i = e[n] ?? e.id ?? e._id, a = e[t] ?? e.label ?? e.name ?? String(i), o = r ? e[r] : void 0;
955
955
  return {
@@ -973,8 +973,8 @@ function jt(e) {
973
973
  }[e];
974
974
  }
975
975
  function Mt({ value: e, onChange: t, field: n, readonly: o, ...u }) {
976
- let [d, f] = l(!1), [p, g] = l(""), { t: _ } = Ue(), [v, y] = l([]), [b, ee] = l(!1), [x, w] = l(null), [E, re] = l(0), ie = c(null), [ae, oe] = l([]), [D, O] = l(-1), se = c(null), ce = n || u.schema, le = ce?.field, k = le && typeof le == "object" && ("reference_to" in le || "reference" in le || "type" in le) ? le : ce, ue = k?.options || [], A = k?.multiple || !1, j = k?.display_field || k?.reference_field || "name", M = k?.description_field, N = k?.id_field || "id", fe = k?.reference_to || k?.reference, pe = k?.lookup_columns, me = k?.lookup_page_size, P = k?.lookup_filters, F = s(() => {
977
- let e = k?.depends_on ?? k?.dependsOn;
976
+ let [d, f] = l(!1), [p, g] = l(""), { t: _ } = Ue(), [v, y] = l([]), [b, ee] = l(!1), [x, w] = l(null), [D, ne] = l(0), re = c(null), [ie, ae] = l([]), [O, k] = l(-1), oe = c(null), se = n || u.schema, ce = se?.field, A = ce && typeof ce == "object" && ("reference_to" in ce || "reference" in ce || "type" in ce) ? ce : se, le = A?.options || [], j = A?.multiple || !1, M = A?.display_field || A?.reference_field || "name", N = A?.description_field, P = A?.id_field || "id", de = A?.reference_to || A?.reference, fe = A?.lookup_columns, pe = A?.lookup_page_size, F = A?.lookup_filters, I = s(() => {
977
+ let e = A?.depends_on ?? A?.dependsOn;
978
978
  return e && Array.isArray(e) ? e.map((e) => typeof e == "string" ? {
979
979
  field: e,
980
980
  param: e
@@ -982,10 +982,10 @@ function Mt({ value: e, onChange: t, field: n, readonly: o, ...u }) {
982
982
  field: e.field,
983
983
  param: e.param ?? e.field
984
984
  }) : [];
985
- }, [k?.depends_on, k?.dependsOn]), he = u.dependentValues, ge = s(() => {
986
- if (!pe) return;
985
+ }, [A?.depends_on, A?.dependsOn]), me = u.dependentValues, he = s(() => {
986
+ if (!fe) return;
987
987
  let e = [];
988
- for (let t of pe) if (typeof t == "object" && t.type) {
988
+ for (let t of fe) if (typeof t == "object" && t.type) {
989
989
  let n = jt(t.type);
990
990
  n && e.push({
991
991
  field: t.field,
@@ -994,44 +994,44 @@ function Mt({ value: e, onChange: t, field: n, readonly: o, ...u }) {
994
994
  });
995
995
  }
996
996
  return e.length > 0 ? e : void 0;
997
- }, [pe]), I = i(Pt), _e = I?.dataSource ?? null, L = u.dataSource ?? ce?.dataSource ?? k?.dataSource ?? _e, R = s(() => he || (I?.formValues ?? I?.data ?? {}), [
998
- he,
999
- I?.formValues,
1000
- I?.data
1001
- ]), z = s(() => F.length === 0 ? !1 : F.some(({ field: e }) => {
1002
- let t = R[e];
997
+ }, [fe]), L = i(Pt), ge = L?.dataSource ?? null, R = u.dataSource ?? se?.dataSource ?? A?.dataSource ?? ge, z = s(() => me || (L?.formValues ?? L?.data ?? {}), [
998
+ me,
999
+ L?.formValues,
1000
+ L?.data
1001
+ ]), B = s(() => I.length === 0 ? !1 : I.some(({ field: e }) => {
1002
+ let t = z[e];
1003
1003
  return t == null || t === "" || Array.isArray(t) && t.length === 0;
1004
- }), [F, R]), B = L != null && typeof L.find == "function" && !!fe, ve = u.onCreateNew ?? ce?.onCreateNew, [ye, be] = l(!1), V = B ? v : ue, H = s(() => {
1005
- if (B || !p) return V;
1004
+ }), [I, z]), V = R != null && typeof R.find == "function" && !!de, _e = u.onCreateNew ?? se?.onCreateNew, [ve, ye] = l(!1), H = V ? v : le, U = s(() => {
1005
+ if (V || !p) return H;
1006
1006
  let e = p.toLowerCase();
1007
- return V.filter((t) => t.label.toLowerCase().includes(e) || t.description && t.description.toLowerCase().includes(e));
1007
+ return H.filter((t) => t.label.toLowerCase().includes(e) || t.description && t.description.toLowerCase().includes(e));
1008
1008
  }, [
1009
- B,
1010
1009
  V,
1010
+ H,
1011
1011
  p
1012
1012
  ]);
1013
1013
  a(() => {
1014
- O(-1);
1015
- }, [H.length]);
1016
- let U = r(async (e) => {
1017
- if (!(!L || !fe)) {
1018
- if (z) {
1019
- y([]), re(0);
1014
+ k(-1);
1015
+ }, [U.length]);
1016
+ let W = r(async (e) => {
1017
+ if (!(!R || !de)) {
1018
+ if (B) {
1019
+ y([]), ne(0);
1020
1020
  return;
1021
1021
  }
1022
1022
  ee(!0), w(null);
1023
1023
  try {
1024
1024
  let t = { $top: Nt };
1025
- if (e && e.trim() && (t.$search = e.trim()), F.length > 0) {
1025
+ if (e && e.trim() && (t.$search = e.trim()), I.length > 0) {
1026
1026
  let e = {};
1027
- for (let { field: t, param: n } of F) {
1028
- let r = R[t];
1027
+ for (let { field: t, param: n } of I) {
1028
+ let r = z[t];
1029
1029
  r == null || r === "" || (e[n] = typeof r == "number" ? r : String(r));
1030
1030
  }
1031
1031
  Object.keys(e).length > 0 && (t.$filter = e);
1032
1032
  }
1033
- let n = await L.find(fe, t), r = n?.data ?? n ?? [];
1034
- y(r.map((e) => At(e, j, N, M))), re(n?.total ?? r.length);
1033
+ let n = await R.find(de, t), r = n?.data ?? n ?? [];
1034
+ y(r.map((e) => At(e, M, P, N))), ne(n?.total ?? r.length);
1035
1035
  } catch (e) {
1036
1036
  w(e instanceof Error ? e.message : String(e)), y([]);
1037
1037
  } finally {
@@ -1039,228 +1039,228 @@ function Mt({ value: e, onChange: t, field: n, readonly: o, ...u }) {
1039
1039
  }
1040
1040
  }
1041
1041
  }, [
1042
- L,
1043
- fe,
1044
- j,
1045
- N,
1042
+ R,
1043
+ de,
1046
1044
  M,
1047
- z,
1048
- F,
1049
- R
1045
+ P,
1046
+ N,
1047
+ B,
1048
+ I,
1049
+ z
1050
1050
  ]);
1051
1051
  a(() => {
1052
- d && B && F.length > 0 && U(p || void 0);
1053
- }, [s(() => F.map((e) => `${e.param}=${R[e.field] ?? ""}`).join("|"), [F, R])]), a(() => {
1054
- d && B && U(p || void 0), d || (g(""), w(null), O(-1));
1052
+ d && V && I.length > 0 && W(p || void 0);
1053
+ }, [s(() => I.map((e) => `${e.param}=${z[e.field] ?? ""}`).join("|"), [I, z])]), a(() => {
1054
+ d && V && W(p || void 0), d || (g(""), w(null), k(-1));
1055
1055
  }, [d]);
1056
- let Se = r((e) => {
1057
- g(e), B && (ie.current && clearTimeout(ie.current), ie.current = setTimeout(() => {
1058
- U(e || void 0);
1056
+ let xe = r((e) => {
1057
+ g(e), V && (re.current && clearTimeout(re.current), re.current = setTimeout(() => {
1058
+ W(e || void 0);
1059
1059
  }, 300));
1060
- }, [B, U]);
1060
+ }, [V, W]);
1061
1061
  a(() => () => {
1062
- ie.current && clearTimeout(ie.current);
1062
+ re.current && clearTimeout(re.current);
1063
1063
  }, []);
1064
- let W = r((e) => ue.find((t) => t.value === e) ?? v.find((t) => t.value === e) ?? ae.find((t) => t.value === e), [
1065
- ue,
1064
+ let G = r((e) => le.find((t) => t.value === e) ?? v.find((t) => t.value === e) ?? ie.find((t) => t.value === e), [
1065
+ le,
1066
1066
  v,
1067
- ae
1068
- ]), G = A ? (Array.isArray(e) ? e : []).map(W).filter(Boolean) : e ? [W(e)].filter(Boolean) : [], Te = r((n) => {
1069
- if (A) {
1067
+ ie
1068
+ ]), K = j ? (Array.isArray(e) ? e : []).map(G).filter(Boolean) : e ? [G(e)].filter(Boolean) : [], we = r((n) => {
1069
+ if (j) {
1070
1070
  let r = Array.isArray(e) ? e : [];
1071
1071
  r.includes(n.value) ? t(r.filter((e) => e !== n.value)) : t([...r, n.value]);
1072
1072
  } else t(n.value), f(!1);
1073
1073
  }, [
1074
- A,
1074
+ j,
1075
1075
  e,
1076
1076
  t
1077
- ]), Ee = (n) => {
1078
- t(A ? (Array.isArray(e) ? e : []).filter((e) => e !== n) : null);
1079
- }, Oe = r((e) => {
1080
- oe(e.map((e) => At(e, j, N, M)));
1077
+ ]), Te = (n) => {
1078
+ t(j ? (Array.isArray(e) ? e : []).filter((e) => e !== n) : null);
1079
+ }, De = r((e) => {
1080
+ ae(e.map((e) => At(e, M, P, N)));
1081
1081
  }, [
1082
- j,
1083
- N,
1084
- M
1085
- ]), J = r((e) => {
1086
- e.key === "ArrowDown" ? (e.preventDefault(), O((e) => e < H.length - 1 ? e + 1 : e)) : e.key === "ArrowUp" ? (e.preventDefault(), O((e) => e > 0 ? e - 1 : 0)) : e.key === "Enter" && (e.preventDefault(), D >= 0 && D < H.length && Te(H[D]));
1082
+ M,
1083
+ P,
1084
+ N
1085
+ ]), Y = r((e) => {
1086
+ e.key === "ArrowDown" ? (e.preventDefault(), k((e) => e < U.length - 1 ? e + 1 : e)) : e.key === "ArrowUp" ? (e.preventDefault(), k((e) => e > 0 ? e - 1 : 0)) : e.key === "Enter" && (e.preventDefault(), O >= 0 && O < U.length && we(U[O]));
1087
1087
  }, [
1088
- H,
1089
- D,
1090
- Te
1088
+ U,
1089
+ O,
1090
+ we
1091
1091
  ]);
1092
1092
  return a(() => {
1093
- D >= 0 && se.current && se.current.querySelector(`[data-lookup-index="${D}"]`)?.scrollIntoView({ block: "nearest" });
1094
- }, [D]), o ? G.length ? A ? /* @__PURE__ */ K("div", {
1093
+ O >= 0 && oe.current && oe.current.querySelector(`[data-lookup-index="${O}"]`)?.scrollIntoView({ block: "nearest" });
1094
+ }, [O]), o ? K.length ? j ? /* @__PURE__ */ q("div", {
1095
1095
  className: "flex flex-wrap gap-1",
1096
- children: G.map((e, t) => /* @__PURE__ */ K(m, {
1096
+ children: K.map((e, t) => /* @__PURE__ */ q(m, {
1097
1097
  variant: "outline",
1098
- children: e?.[j] || e?.label
1098
+ children: e?.[M] || e?.label
1099
1099
  }, t))
1100
- }) : /* @__PURE__ */ K("span", {
1100
+ }) : /* @__PURE__ */ q("span", {
1101
1101
  className: "text-sm",
1102
- children: G[0]?.[j] || G[0]?.label
1103
- }) : /* @__PURE__ */ K(S, {}) : /* @__PURE__ */ q("div", {
1102
+ children: K[0]?.[M] || K[0]?.label
1103
+ }) : /* @__PURE__ */ q(S, {}) : /* @__PURE__ */ J("div", {
1104
1104
  className: "space-y-2",
1105
1105
  children: [
1106
- G.length > 0 && /* @__PURE__ */ K("div", {
1106
+ K.length > 0 && /* @__PURE__ */ q("div", {
1107
1107
  className: "flex flex-wrap gap-1",
1108
- children: G.map((e, t) => /* @__PURE__ */ q(m, {
1108
+ children: K.map((e, t) => /* @__PURE__ */ J(m, {
1109
1109
  variant: "outline",
1110
1110
  className: "gap-1",
1111
- children: [e?.[j] || e?.label, /* @__PURE__ */ K("button", {
1112
- onClick: () => Ee(e?.value),
1111
+ children: [e?.[M] || e?.label, /* @__PURE__ */ q("button", {
1112
+ onClick: () => Te(e?.value),
1113
1113
  className: "ml-1 hover:text-destructive",
1114
1114
  type: "button",
1115
- "aria-label": `Remove ${e?.[j] || e?.label}`,
1116
- children: /* @__PURE__ */ K(ke, { className: "size-3" })
1115
+ "aria-label": `Remove ${e?.[M] || e?.label}`,
1116
+ children: /* @__PURE__ */ q(Oe, { className: "size-3" })
1117
1117
  })]
1118
1118
  }, t))
1119
1119
  }),
1120
- /* @__PURE__ */ q("div", {
1120
+ /* @__PURE__ */ J("div", {
1121
1121
  className: "flex items-center gap-1.5",
1122
- children: [/* @__PURE__ */ q(te, {
1122
+ children: [/* @__PURE__ */ J(T, {
1123
1123
  open: d,
1124
- onOpenChange: (e) => !z && f(e),
1125
- children: [/* @__PURE__ */ K(ne, {
1124
+ onOpenChange: (e) => !B && f(e),
1125
+ children: [/* @__PURE__ */ q(te, {
1126
1126
  asChild: !0,
1127
- children: /* @__PURE__ */ q(h, {
1127
+ children: /* @__PURE__ */ J(h, {
1128
1128
  variant: "outline",
1129
1129
  className: "min-w-0 flex-1 justify-start text-left font-normal",
1130
1130
  type: "button",
1131
- disabled: z || u.disabled,
1132
- "data-testid": z ? "lookup-trigger-gated" : void 0,
1133
- title: z ? `Select ${F.map((e) => e.field).join(", ")} first` : void 0,
1134
- children: [/* @__PURE__ */ K(we, { className: "mr-2 size-4" }), z ? `Select ${F.map((e) => e.field).join(", ")} first` : G.length === 0 ? ce?.placeholder || _("common.select") : A ? _("table.selected", { count: G.length }) : _("common.select")]
1131
+ disabled: B || u.disabled,
1132
+ "data-testid": B ? "lookup-trigger-gated" : void 0,
1133
+ title: B ? `Select ${I.map((e) => e.field).join(", ")} first` : void 0,
1134
+ children: [/* @__PURE__ */ q(Ce, { className: "mr-2 size-4" }), B ? `Select ${I.map((e) => e.field).join(", ")} first` : K.length === 0 ? se?.placeholder || _("common.select") : j ? _("table.selected", { count: K.length }) : _("common.select")]
1135
1135
  })
1136
- }), /* @__PURE__ */ q(T, {
1136
+ }), /* @__PURE__ */ J(E, {
1137
1137
  className: "w-[var(--radix-popover-trigger-width)] p-0",
1138
1138
  align: "start",
1139
1139
  children: [
1140
- /* @__PURE__ */ K("div", {
1140
+ /* @__PURE__ */ q("div", {
1141
1141
  className: "p-2",
1142
- children: /* @__PURE__ */ q("div", {
1142
+ children: /* @__PURE__ */ J("div", {
1143
1143
  className: "relative",
1144
1144
  children: [
1145
- /* @__PURE__ */ K(we, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }),
1146
- /* @__PURE__ */ K(C, {
1145
+ /* @__PURE__ */ q(Ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }),
1146
+ /* @__PURE__ */ q(C, {
1147
1147
  placeholder: _("common.search") + "...",
1148
1148
  value: p,
1149
- onChange: (e) => Se(e.target.value),
1150
- onKeyDown: J,
1149
+ onChange: (e) => xe(e.target.value),
1150
+ onKeyDown: Y,
1151
1151
  className: "w-full pl-9 h-8 text-sm"
1152
1152
  }),
1153
- b && /* @__PURE__ */ K(xe, {
1153
+ b && /* @__PURE__ */ q(be, {
1154
1154
  className: "absolute right-3 top-1/2 -translate-y-1/2 size-4 animate-spin text-muted-foreground",
1155
1155
  "data-testid": "lookup-loading"
1156
1156
  })
1157
1157
  ]
1158
1158
  })
1159
1159
  }),
1160
- x && /* @__PURE__ */ q("div", {
1160
+ x && /* @__PURE__ */ J("div", {
1161
1161
  className: "flex flex-col items-center gap-2 py-4 px-2",
1162
1162
  role: "alert",
1163
1163
  children: [
1164
- /* @__PURE__ */ K(de, { className: "size-5 text-destructive" }),
1165
- /* @__PURE__ */ K("p", {
1164
+ /* @__PURE__ */ q(ue, { className: "size-5 text-destructive" }),
1165
+ /* @__PURE__ */ q("p", {
1166
1166
  className: "text-sm text-destructive",
1167
1167
  children: x
1168
1168
  }),
1169
- /* @__PURE__ */ K(h, {
1169
+ /* @__PURE__ */ q(h, {
1170
1170
  variant: "outline",
1171
1171
  size: "sm",
1172
- onClick: () => U(p || void 0),
1172
+ onClick: () => W(p || void 0),
1173
1173
  type: "button",
1174
1174
  children: "Retry"
1175
1175
  })
1176
1176
  ]
1177
1177
  }),
1178
- b && H.length === 0 && !x && /* @__PURE__ */ q("div", {
1178
+ b && U.length === 0 && !x && /* @__PURE__ */ J("div", {
1179
1179
  className: "flex flex-col items-center gap-2 py-6",
1180
1180
  role: "status",
1181
1181
  "aria-live": "polite",
1182
- children: [/* @__PURE__ */ K(xe, { className: "size-6 animate-spin text-muted-foreground" }), /* @__PURE__ */ K("p", {
1182
+ children: [/* @__PURE__ */ q(be, { className: "size-6 animate-spin text-muted-foreground" }), /* @__PURE__ */ q("p", {
1183
1183
  className: "text-sm text-muted-foreground",
1184
1184
  children: "Loading…"
1185
1185
  })]
1186
1186
  }),
1187
- !x && !(b && H.length === 0) && /* @__PURE__ */ K("div", {
1188
- ref: se,
1187
+ !x && !(b && U.length === 0) && /* @__PURE__ */ q("div", {
1188
+ ref: oe,
1189
1189
  className: "max-h-64 overflow-y-auto px-1 pb-1",
1190
1190
  role: "listbox",
1191
- children: H.length === 0 ? /* @__PURE__ */ q("div", {
1191
+ children: U.length === 0 ? /* @__PURE__ */ J("div", {
1192
1192
  className: "py-4 text-center",
1193
- children: [/* @__PURE__ */ K("p", {
1193
+ children: [/* @__PURE__ */ q("p", {
1194
1194
  className: "text-sm text-muted-foreground",
1195
1195
  children: "No options found"
1196
- }), ve && /* @__PURE__ */ q(h, {
1196
+ }), _e && /* @__PURE__ */ J(h, {
1197
1197
  variant: "ghost",
1198
1198
  size: "sm",
1199
1199
  className: "mt-2 gap-1",
1200
1200
  type: "button",
1201
1201
  onClick: () => {
1202
- ve(p), f(!1);
1202
+ _e(p), f(!1);
1203
1203
  },
1204
- children: [/* @__PURE__ */ K(Ce, { className: "size-4" }), "Create new"]
1204
+ children: [/* @__PURE__ */ q(Se, { className: "size-4" }), "Create new"]
1205
1205
  })]
1206
- }) : /* @__PURE__ */ q(Ae, { children: [
1207
- H.map((t, n) => {
1208
- let r = A ? (Array.isArray(e) ? e : []).includes(t.value) : e === t.value;
1209
- return /* @__PURE__ */ q("button", {
1206
+ }) : /* @__PURE__ */ J(ke, { children: [
1207
+ U.map((t, n) => {
1208
+ let r = j ? (Array.isArray(e) ? e : []).includes(t.value) : e === t.value;
1209
+ return /* @__PURE__ */ J("button", {
1210
1210
  "data-lookup-index": n,
1211
1211
  role: "option",
1212
1212
  "aria-selected": r,
1213
- onClick: () => Te(t),
1214
- className: `w-full text-left px-3 py-2 rounded-md text-sm hover:bg-accent flex items-center justify-between ${n === D ? "bg-accent text-accent-foreground" : r ? "bg-accent/50 text-accent-foreground" : ""}`,
1213
+ onClick: () => we(t),
1214
+ className: `w-full text-left px-3 py-2 rounded-md text-sm hover:bg-accent flex items-center justify-between ${n === O ? "bg-accent text-accent-foreground" : r ? "bg-accent/50 text-accent-foreground" : ""}`,
1215
1215
  type: "button",
1216
- children: [/* @__PURE__ */ q("div", {
1216
+ children: [/* @__PURE__ */ J("div", {
1217
1217
  className: "min-w-0 flex-1",
1218
- children: [/* @__PURE__ */ K("span", {
1218
+ children: [/* @__PURE__ */ q("span", {
1219
1219
  className: "block truncate",
1220
1220
  children: t.label
1221
- }), t.description && /* @__PURE__ */ K("span", {
1221
+ }), t.description && /* @__PURE__ */ q("span", {
1222
1222
  className: "block truncate text-xs text-muted-foreground",
1223
1223
  children: t.description
1224
1224
  })]
1225
- }), r && /* @__PURE__ */ K(m, {
1225
+ }), r && /* @__PURE__ */ q(m, {
1226
1226
  variant: "default",
1227
1227
  className: "ml-2 shrink-0",
1228
1228
  children: "Selected"
1229
1229
  })]
1230
1230
  }, t.value);
1231
1231
  }),
1232
- B && E > H.length && /* @__PURE__ */ q("p", {
1232
+ V && D > U.length && /* @__PURE__ */ J("p", {
1233
1233
  className: "text-xs text-muted-foreground text-center py-2",
1234
1234
  children: [
1235
1235
  "Showing ",
1236
- H.length,
1236
+ U.length,
1237
1237
  " of ",
1238
- E,
1238
+ D,
1239
1239
  " results."
1240
1240
  ]
1241
1241
  }),
1242
- B && E > H.length && /* @__PURE__ */ q("button", {
1242
+ V && D > U.length && /* @__PURE__ */ J("button", {
1243
1243
  type: "button",
1244
1244
  className: "w-full text-center px-3 py-2 rounded-md text-sm font-medium text-primary hover:bg-accent flex items-center justify-center gap-1.5",
1245
1245
  onClick: () => {
1246
- f(!1), be(!0);
1246
+ f(!1), ye(!0);
1247
1247
  },
1248
1248
  "data-testid": "show-all-results",
1249
1249
  children: [
1250
- /* @__PURE__ */ K(De, { className: "size-3.5" }),
1250
+ /* @__PURE__ */ q(Ee, { className: "size-3.5" }),
1251
1251
  "Show All Results (",
1252
- E,
1252
+ D,
1253
1253
  ")"
1254
1254
  ]
1255
1255
  }),
1256
- ve && /* @__PURE__ */ q("button", {
1256
+ _e && /* @__PURE__ */ J("button", {
1257
1257
  type: "button",
1258
1258
  className: "w-full text-left px-3 py-2 rounded-md text-sm hover:bg-accent flex items-center gap-1.5 text-muted-foreground",
1259
1259
  onClick: () => {
1260
- ve(p), f(!1);
1260
+ _e(p), f(!1);
1261
1261
  },
1262
1262
  children: [
1263
- /* @__PURE__ */ K(Ce, { className: "size-3.5" }),
1263
+ /* @__PURE__ */ q(Se, { className: "size-3.5" }),
1264
1264
  "Create new",
1265
1265
  p ? ` "${p}"` : ""
1266
1266
  ]
@@ -1269,47 +1269,47 @@ function Mt({ value: e, onChange: t, field: n, readonly: o, ...u }) {
1269
1269
  })
1270
1270
  ]
1271
1271
  })]
1272
- }), B && /* @__PURE__ */ K(h, {
1272
+ }), V && /* @__PURE__ */ q(h, {
1273
1273
  variant: "outline",
1274
1274
  size: "icon",
1275
1275
  className: "shrink-0",
1276
1276
  type: "button",
1277
- onClick: () => be(!0),
1277
+ onClick: () => ye(!0),
1278
1278
  "aria-label": "Browse all records",
1279
1279
  title: "Browse all records",
1280
1280
  "data-testid": "browse-all-records",
1281
- children: /* @__PURE__ */ K(De, { className: "size-4" })
1281
+ children: /* @__PURE__ */ q(Ee, { className: "size-4" })
1282
1282
  })]
1283
1283
  }),
1284
- B && L && fe && /* @__PURE__ */ K(bt, {
1285
- open: ye,
1286
- onOpenChange: be,
1287
- title: ce?.label || "Select",
1288
- multiple: A,
1289
- dataSource: L,
1290
- objectName: fe,
1291
- columns: pe,
1292
- displayField: j,
1293
- idField: N,
1294
- pageSize: me,
1284
+ V && R && de && /* @__PURE__ */ q(bt, {
1285
+ open: ve,
1286
+ onOpenChange: ye,
1287
+ title: se?.label || "Select",
1288
+ multiple: j,
1289
+ dataSource: R,
1290
+ objectName: de,
1291
+ columns: fe,
1292
+ displayField: M,
1293
+ idField: P,
1294
+ pageSize: pe,
1295
1295
  value: e,
1296
1296
  onSelect: t,
1297
- onSelectRecords: Oe,
1298
- lookupFilters: P,
1297
+ onSelectRecords: De,
1298
+ lookupFilters: F,
1299
1299
  cellRenderer: Et(),
1300
- filterColumns: ge
1300
+ filterColumns: he
1301
1301
  })
1302
1302
  ]
1303
1303
  });
1304
1304
  }
1305
- var Nt, Pt, Ft = Y((() => {
1306
- wt(), Ot(), We(), Nt = 50, Pt = je;
1307
- })), It = /* @__PURE__ */ X({ DateTimeField: () => Lt });
1305
+ var Nt, Pt, Ft = X((() => {
1306
+ wt(), Ot(), We(), Nt = 50, Pt = Ae;
1307
+ })), It = /* @__PURE__ */ Z({ DateTimeField: () => Lt });
1308
1308
  function Lt({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1309
1309
  if (r) {
1310
- if (!e) return /* @__PURE__ */ K(S, {});
1310
+ if (!e) return /* @__PURE__ */ q(S, {});
1311
1311
  let t = new Date(e);
1312
- return /* @__PURE__ */ q("span", {
1312
+ return /* @__PURE__ */ J("span", {
1313
1313
  className: "text-sm",
1314
1314
  children: [
1315
1315
  t.toLocaleDateString(),
@@ -1319,7 +1319,7 @@ function Lt({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1319
1319
  });
1320
1320
  }
1321
1321
  let { inputType: a, ...o } = i;
1322
- return /* @__PURE__ */ K(C, {
1322
+ return /* @__PURE__ */ q(C, {
1323
1323
  ...o,
1324
1324
  type: "datetime-local",
1325
1325
  value: e || "",
@@ -1327,14 +1327,14 @@ function Lt({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1327
1327
  disabled: r || o.disabled
1328
1328
  });
1329
1329
  }
1330
- var Rt = Y((() => {})), zt = /* @__PURE__ */ X({ TimeField: () => Bt });
1330
+ var Rt = X((() => {})), zt = /* @__PURE__ */ Z({ TimeField: () => Bt });
1331
1331
  function Bt({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1332
- if (r) return /* @__PURE__ */ K("span", {
1332
+ if (r) return /* @__PURE__ */ q("span", {
1333
1333
  className: "text-sm",
1334
- children: e || /* @__PURE__ */ K(S, {})
1334
+ children: e || /* @__PURE__ */ q(S, {})
1335
1335
  });
1336
1336
  let { inputType: a, ...o } = i;
1337
- return /* @__PURE__ */ K(C, {
1337
+ return /* @__PURE__ */ q(C, {
1338
1338
  ...o,
1339
1339
  type: "time",
1340
1340
  value: e || "",
@@ -1342,10 +1342,10 @@ function Bt({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1342
1342
  disabled: r || o.disabled
1343
1343
  });
1344
1344
  }
1345
- var Vt = Y((() => {})), Ht = /* @__PURE__ */ X({ PercentField: () => Ut });
1345
+ var Vt = X((() => {})), Ht = /* @__PURE__ */ Z({ PercentField: () => Ut });
1346
1346
  function Ut({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, className: a, ...o }) {
1347
1347
  let s = n || o.schema, c = s?.precision ?? 2;
1348
- if (r) return e == null ? /* @__PURE__ */ K(S, {}) : /* @__PURE__ */ q("span", {
1348
+ if (r) return e == null ? /* @__PURE__ */ q(S, {}) : /* @__PURE__ */ J("span", {
1349
1349
  className: "text-sm font-medium tabular-nums",
1350
1350
  children: [(e * 100).toFixed(c), "%"]
1351
1351
  });
@@ -1365,11 +1365,11 @@ function Ut({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, cla
1365
1365
  let n = e[0];
1366
1366
  t(typeof n == "number" ? n / 100 : null);
1367
1367
  }, p = 10 ** -c;
1368
- return /* @__PURE__ */ q("div", {
1368
+ return /* @__PURE__ */ J("div", {
1369
1369
  className: "space-y-2",
1370
- children: [/* @__PURE__ */ q("div", {
1370
+ children: [/* @__PURE__ */ J("div", {
1371
1371
  className: "relative",
1372
- children: [/* @__PURE__ */ K(C, {
1372
+ children: [/* @__PURE__ */ q(C, {
1373
1373
  ...o,
1374
1374
  type: "number",
1375
1375
  value: l,
@@ -1379,11 +1379,11 @@ function Ut({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, cla
1379
1379
  className: `pr-8 ${a || ""}`,
1380
1380
  step: (10 ** -c).toFixed(c),
1381
1381
  "aria-invalid": !!i
1382
- }), /* @__PURE__ */ K("span", {
1382
+ }), /* @__PURE__ */ q("span", {
1383
1383
  className: "absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",
1384
1384
  children: "%"
1385
1385
  })]
1386
- }), /* @__PURE__ */ K(O, {
1386
+ }), /* @__PURE__ */ q(k, {
1387
1387
  value: [u],
1388
1388
  onValueChange: f,
1389
1389
  min: 0,
@@ -1396,17 +1396,17 @@ function Ut({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, cla
1396
1396
  })]
1397
1397
  });
1398
1398
  }
1399
- var Wt = Y((() => {})), Gt = /* @__PURE__ */ X({ PasswordField: () => Kt });
1399
+ var Wt = X((() => {})), Gt = /* @__PURE__ */ Z({ PasswordField: () => Kt });
1400
1400
  function Kt({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }) {
1401
1401
  let [o, s] = l(!1), c = n || a.schema;
1402
- if (r) return /* @__PURE__ */ K("span", {
1402
+ if (r) return /* @__PURE__ */ q("span", {
1403
1403
  className: "text-sm",
1404
1404
  children: "••••••••"
1405
1405
  });
1406
1406
  let { inputType: u, ...d } = a;
1407
- return /* @__PURE__ */ q("div", {
1407
+ return /* @__PURE__ */ J("div", {
1408
1408
  className: "relative",
1409
- children: [/* @__PURE__ */ K(C, {
1409
+ children: [/* @__PURE__ */ q(C, {
1410
1410
  ...d,
1411
1411
  type: o ? "text" : "password",
1412
1412
  value: e || "",
@@ -1414,20 +1414,20 @@ function Kt({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }
1414
1414
  placeholder: c?.placeholder,
1415
1415
  disabled: r || d.disabled,
1416
1416
  className: `pr-10 ${i || ""}`
1417
- }), /* @__PURE__ */ K(h, {
1417
+ }), /* @__PURE__ */ q(h, {
1418
1418
  type: "button",
1419
1419
  variant: "ghost",
1420
1420
  size: "sm",
1421
1421
  className: "absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",
1422
1422
  onClick: () => s(!o),
1423
1423
  tabIndex: -1,
1424
- children: K(o ? ve : B, { className: "size-4 text-gray-500" })
1424
+ children: q(o ? _e : V, { className: "size-4 text-gray-500" })
1425
1425
  })]
1426
1426
  });
1427
1427
  }
1428
- var qt = Y((() => {})), Jt = /* @__PURE__ */ X({ FileField: () => Yt });
1428
+ var qt = X((() => {})), Jt = /* @__PURE__ */ Z({ FileField: () => Yt });
1429
1429
  function Yt({ value: e, onChange: t, field: n, readonly: i, ...a }) {
1430
- let o = c(null), s = c(null), u = n || a.schema, d = u?.multiple || !1, f = u?.accept ? u.accept.join(",") : void 0, p = u?.maxSize, m = u?.capture ?? null, g = !f || f.split(",").some((e) => e.trim().startsWith("image/") || e.trim() === "image/*" || e.trim().startsWith(".jp") || e.trim().startsWith(".png") || e.trim().startsWith(".gif") || e.trim().startsWith(".webp")), _ = typeof navigator < "u" && (navigator.maxTouchPoints > 0 || /Mobi|Android/i.test(navigator.userAgent)), v = m === !1 ? !1 : m ?? (g && _ ? "environment" : null), [y, b] = l(!1), [ee, x] = l([]), { upload: C } = Me(), [w, te] = l({}), [T, ne] = l(!1), E = e ? Array.isArray(e) ? e : [e] : [], re = r(async (e) => {
1430
+ let o = c(null), s = c(null), u = n || a.schema, d = u?.multiple || !1, f = u?.accept ? u.accept.join(",") : void 0, p = u?.maxSize, m = u?.capture ?? null, g = !f || f.split(",").some((e) => e.trim().startsWith("image/") || e.trim() === "image/*" || e.trim().startsWith(".jp") || e.trim().startsWith(".png") || e.trim().startsWith(".gif") || e.trim().startsWith(".webp")), _ = typeof navigator < "u" && (navigator.maxTouchPoints > 0 || /Mobi|Android/i.test(navigator.userAgent)), v = m === !1 ? !1 : m ?? (g && _ ? "environment" : null), [y, b] = l(!1), [ee, x] = l([]), { upload: C } = je(), [w, T] = l({}), [E, te] = l(!1), D = e ? Array.isArray(e) ? e : [e] : [], ne = r(async (e) => {
1431
1431
  if (e.length === 0) return;
1432
1432
  let n = [], r = e.filter((e) => {
1433
1433
  if (p && e.size > p) {
@@ -1437,11 +1437,11 @@ function Yt({ value: e, onChange: t, field: n, readonly: i, ...a }) {
1437
1437
  return !0;
1438
1438
  });
1439
1439
  if (x(n), r.length !== 0) {
1440
- ne(!0);
1440
+ te(!0);
1441
1441
  try {
1442
1442
  let e = (await Promise.all(r.map(async (e) => {
1443
1443
  try {
1444
- let t = await C(e, { onProgress: (t) => te((n) => ({
1444
+ let t = await C(e, { onProgress: (t) => T((n) => ({
1445
1445
  ...n,
1446
1446
  [e.name]: t
1447
1447
  })) });
@@ -1457,75 +1457,75 @@ function Yt({ value: e, onChange: t, field: n, readonly: i, ...a }) {
1457
1457
  }
1458
1458
  }))).filter(Boolean);
1459
1459
  if (e.length === 0) return;
1460
- t(d ? [...E, ...e] : e[0]);
1460
+ t(d ? [...D, ...e] : e[0]);
1461
1461
  } finally {
1462
- ne(!1), te({});
1462
+ te(!1), T({});
1463
1463
  }
1464
1464
  }
1465
1465
  }, [
1466
- E,
1466
+ D,
1467
1467
  d,
1468
1468
  t,
1469
1469
  p,
1470
1470
  C
1471
- ]), ie = r((e) => {
1471
+ ]), re = r((e) => {
1472
1472
  e.preventDefault(), e.stopPropagation(), b(!0);
1473
- }, []), ae = r((e) => {
1473
+ }, []), ie = r((e) => {
1474
1474
  e.preventDefault(), e.stopPropagation(), b(!1);
1475
- }, []), oe = r((e) => {
1475
+ }, []), ae = r((e) => {
1476
1476
  e.preventDefault(), e.stopPropagation(), b(!1);
1477
1477
  let t = Array.from(e.dataTransfer.files);
1478
1478
  if (f) {
1479
1479
  let e = f.split(",").map((e) => e.trim().toLowerCase());
1480
- re(t.filter((t) => {
1480
+ ne(t.filter((t) => {
1481
1481
  let n = t.name.split("."), r = n.length > 1 ? "." + n.pop()?.toLowerCase() : "";
1482
1482
  return e.some((e) => e === t.type || r && e === r || e.endsWith("/*") && t.type.startsWith(e.replace("/*", "/")));
1483
1483
  }));
1484
- } else re(t);
1485
- }, [f, re]);
1486
- if (i) return e ? /* @__PURE__ */ K("div", {
1484
+ } else ne(t);
1485
+ }, [f, ne]);
1486
+ if (i) return e ? /* @__PURE__ */ q("div", {
1487
1487
  className: "flex flex-wrap gap-2",
1488
- children: (Array.isArray(e) ? e : [e]).map((e, t) => /* @__PURE__ */ K("span", {
1488
+ children: (Array.isArray(e) ? e : [e]).map((e, t) => /* @__PURE__ */ q("span", {
1489
1489
  className: "text-sm truncate max-w-xs",
1490
1490
  children: e.name || e.original_name || "File"
1491
1491
  }, t))
1492
- }) : /* @__PURE__ */ K(S, {});
1493
- let D = (e) => {
1494
- re(Array.from(e.target.files || []));
1495
- }, O = (e) => {
1492
+ }) : /* @__PURE__ */ q(S, {});
1493
+ let O = (e) => {
1494
+ ne(Array.from(e.target.files || []));
1495
+ }, k = (e) => {
1496
1496
  if (d) {
1497
- let n = E.filter((t, n) => n !== e);
1497
+ let n = D.filter((t, n) => n !== e);
1498
1498
  t(n.length > 0 ? n : null);
1499
1499
  } else t(null);
1500
- }, se = (e) => (e.mime_type || "").startsWith("image/");
1501
- return /* @__PURE__ */ q("div", {
1500
+ }, oe = (e) => (e.mime_type || "").startsWith("image/");
1501
+ return /* @__PURE__ */ J("div", {
1502
1502
  className: a.className,
1503
1503
  children: [
1504
- /* @__PURE__ */ K("input", {
1504
+ /* @__PURE__ */ q("input", {
1505
1505
  ref: o,
1506
1506
  type: "file",
1507
1507
  multiple: d,
1508
1508
  accept: f,
1509
- onChange: D,
1509
+ onChange: O,
1510
1510
  className: "hidden"
1511
1511
  }),
1512
- v && /* @__PURE__ */ K("input", {
1512
+ v && /* @__PURE__ */ q("input", {
1513
1513
  ref: s,
1514
1514
  type: "file",
1515
1515
  accept: "image/*",
1516
1516
  capture: v,
1517
- onChange: D,
1517
+ onChange: O,
1518
1518
  className: "hidden",
1519
1519
  "aria-label": "Camera capture",
1520
1520
  "data-testid": "file-field-camera-input"
1521
1521
  }),
1522
- /* @__PURE__ */ q("div", {
1522
+ /* @__PURE__ */ J("div", {
1523
1523
  className: "space-y-2",
1524
1524
  children: [
1525
- /* @__PURE__ */ q("div", {
1526
- onDragOver: ie,
1527
- onDragLeave: ae,
1528
- onDrop: oe,
1525
+ /* @__PURE__ */ J("div", {
1526
+ onDragOver: re,
1527
+ onDragLeave: ie,
1528
+ onDrop: ae,
1529
1529
  onClick: () => o.current?.click(),
1530
1530
  className: `
1531
1531
  flex flex-col items-center justify-center gap-2 p-6
@@ -1538,18 +1538,18 @@ function Yt({ value: e, onChange: t, field: n, readonly: i, ...a }) {
1538
1538
  onKeyDown: (e) => {
1539
1539
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), o.current?.click());
1540
1540
  },
1541
- children: [/* @__PURE__ */ K(Oe, { className: `size-8 ${y ? "text-primary" : "text-muted-foreground"}` }), /* @__PURE__ */ q("div", {
1541
+ children: [/* @__PURE__ */ q(De, { className: `size-8 ${y ? "text-primary" : "text-muted-foreground"}` }), /* @__PURE__ */ J("div", {
1542
1542
  className: "text-center",
1543
- children: [/* @__PURE__ */ K("p", {
1543
+ children: [/* @__PURE__ */ q("p", {
1544
1544
  className: "text-sm font-medium",
1545
1545
  children: y ? "Drop files here" : "Drag & drop files here"
1546
- }), /* @__PURE__ */ q("p", {
1546
+ }), /* @__PURE__ */ J("p", {
1547
1547
  className: "text-xs text-muted-foreground mt-1",
1548
1548
  children: ["or click to browse", v ? " • use the camera button below" : ""]
1549
1549
  })]
1550
1550
  })]
1551
1551
  }),
1552
- v && /* @__PURE__ */ q(h, {
1552
+ v && /* @__PURE__ */ J(h, {
1553
1553
  type: "button",
1554
1554
  variant: "outline",
1555
1555
  size: "sm",
@@ -1558,37 +1558,37 @@ function Yt({ value: e, onChange: t, field: n, readonly: i, ...a }) {
1558
1558
  e.stopPropagation(), s.current?.click();
1559
1559
  },
1560
1560
  "data-testid": "file-field-camera-button",
1561
- children: [/* @__PURE__ */ K(P, { className: "size-4 mr-2" }), v === "user" ? "Take selfie" : "Take photo"]
1561
+ children: [/* @__PURE__ */ q(F, { className: "size-4 mr-2" }), v === "user" ? "Take selfie" : "Take photo"]
1562
1562
  }),
1563
- T && /* @__PURE__ */ q("div", {
1563
+ E && /* @__PURE__ */ J("div", {
1564
1564
  className: "flex items-center gap-2 text-xs text-muted-foreground",
1565
1565
  "data-testid": "file-field-uploading",
1566
- children: [/* @__PURE__ */ K(xe, { className: "size-3 animate-spin" }), /* @__PURE__ */ q("span", { children: ["Uploading…", Object.keys(w).length > 0 && ` (${Math.round(Object.values(w).reduce((e, t) => e + t, 0) / Object.keys(w).length * 100)}%)`] })]
1566
+ children: [/* @__PURE__ */ q(be, { className: "size-3 animate-spin" }), /* @__PURE__ */ J("span", { children: ["Uploading…", Object.keys(w).length > 0 && ` (${Math.round(Object.values(w).reduce((e, t) => e + t, 0) / Object.keys(w).length * 100)}%)`] })]
1567
1567
  }),
1568
- ee.length > 0 && /* @__PURE__ */ K("div", {
1568
+ ee.length > 0 && /* @__PURE__ */ q("div", {
1569
1569
  className: "space-y-0.5",
1570
- children: ee.map((e, t) => /* @__PURE__ */ K("p", {
1570
+ children: ee.map((e, t) => /* @__PURE__ */ q("p", {
1571
1571
  className: "text-xs text-destructive",
1572
1572
  children: e
1573
1573
  }, t))
1574
1574
  }),
1575
- E.length > 0 && /* @__PURE__ */ K("div", {
1575
+ D.length > 0 && /* @__PURE__ */ q("div", {
1576
1576
  className: "space-y-1",
1577
- children: E.map((e, t) => /* @__PURE__ */ q("div", {
1577
+ children: D.map((e, t) => /* @__PURE__ */ J("div", {
1578
1578
  className: "flex items-center justify-between gap-2 p-2 bg-muted/50 rounded-md border",
1579
- children: [/* @__PURE__ */ q("div", {
1579
+ children: [/* @__PURE__ */ J("div", {
1580
1580
  className: "flex items-center gap-2 flex-1 min-w-0",
1581
1581
  children: [
1582
- se(e) && e.url ? /* @__PURE__ */ K("img", {
1582
+ oe(e) && e.url ? /* @__PURE__ */ q("img", {
1583
1583
  src: e.url,
1584
1584
  alt: e.name,
1585
- className: "size-8 object-cover rounded flex-shrink-0"
1586
- }) : se(e) ? /* @__PURE__ */ K(V, { className: "size-4 text-muted-foreground flex-shrink-0" }) : /* @__PURE__ */ K(ye, { className: "size-4 text-muted-foreground flex-shrink-0" }),
1587
- /* @__PURE__ */ K("span", {
1585
+ className: "size-8 object-cover rounded shrink-0"
1586
+ }) : oe(e) ? /* @__PURE__ */ q(H, { className: "size-4 text-muted-foreground shrink-0" }) : /* @__PURE__ */ q(ve, { className: "size-4 text-muted-foreground shrink-0" }),
1587
+ /* @__PURE__ */ q("span", {
1588
1588
  className: "text-sm truncate",
1589
1589
  children: e.name || e.original_name || "File"
1590
1590
  }),
1591
- e.size && /* @__PURE__ */ q("span", {
1591
+ e.size && /* @__PURE__ */ J("span", {
1592
1592
  className: "text-xs text-muted-foreground",
1593
1593
  children: [
1594
1594
  "(",
@@ -1597,15 +1597,15 @@ function Yt({ value: e, onChange: t, field: n, readonly: i, ...a }) {
1597
1597
  ]
1598
1598
  })
1599
1599
  ]
1600
- }), /* @__PURE__ */ K(h, {
1600
+ }), /* @__PURE__ */ q(h, {
1601
1601
  type: "button",
1602
1602
  variant: "ghost",
1603
1603
  size: "sm",
1604
1604
  onClick: (e) => {
1605
- e.stopPropagation(), O(t);
1605
+ e.stopPropagation(), k(t);
1606
1606
  },
1607
1607
  className: "h-6 w-6 p-0",
1608
- children: /* @__PURE__ */ K(ke, { className: "size-3" })
1608
+ children: /* @__PURE__ */ q(Oe, { className: "size-3" })
1609
1609
  })]
1610
1610
  }, t))
1611
1611
  })
@@ -1614,17 +1614,17 @@ function Yt({ value: e, onChange: t, field: n, readonly: i, ...a }) {
1614
1614
  ]
1615
1615
  });
1616
1616
  }
1617
- var Xt = Y((() => {})), Zt = /* @__PURE__ */ X({ ImageCropperDialog: () => Qt }), Qt, $t = Y((() => {
1617
+ var Xt = X((() => {})), Zt = /* @__PURE__ */ Z({ ImageCropperDialog: () => Qt }), Qt, $t = X((() => {
1618
1618
  Qt = ({ open: e, onOpenChange: t, src: n, outputType: i = "image/png", outputName: o = "cropped.png", onConfirm: s }) => {
1619
1619
  let u = c(null), d = c(null), [f, p] = l(0), [m, g] = l({
1620
1620
  x: 0,
1621
1621
  y: 0,
1622
1622
  width: 100,
1623
1623
  height: 100
1624
- }), [S, C] = l(null), [w, te] = l(!1);
1624
+ }), [S, C] = l(null), [w, T] = l(!1);
1625
1625
  a(() => {
1626
1626
  if (!e || !n) return;
1627
- te(!1);
1627
+ T(!1);
1628
1628
  let t = new Image();
1629
1629
  t.crossOrigin = "anonymous", t.onload = () => {
1630
1630
  d.current = t;
@@ -1634,8 +1634,8 @@ var Xt = Y((() => {})), Zt = /* @__PURE__ */ X({ ImageCropperDialog: () => Qt })
1634
1634
  y: (t.naturalHeight - n) / 2,
1635
1635
  width: e,
1636
1636
  height: n
1637
- }), p(0), te(!0);
1638
- }, t.onerror = () => te(!1), t.src = n;
1637
+ }), p(0), T(!0);
1638
+ }, t.onerror = () => T(!1), t.src = n;
1639
1639
  }, [e, n]), a(() => {
1640
1640
  if (!w || !d.current || !u.current) return;
1641
1641
  let e = d.current, t = u.current, n = t.getContext("2d");
@@ -1651,7 +1651,7 @@ var Xt = Y((() => {})), Zt = /* @__PURE__ */ X({ ImageCropperDialog: () => Qt })
1651
1651
  m,
1652
1652
  f
1653
1653
  ]);
1654
- let T = r((e) => {
1654
+ let E = r((e) => {
1655
1655
  if (!d.current || !u.current) return;
1656
1656
  let t = u.current.getBoundingClientRect(), n = d.current.naturalWidth / t.width;
1657
1657
  C({
@@ -1660,7 +1660,7 @@ var Xt = Y((() => {})), Zt = /* @__PURE__ */ X({ ImageCropperDialog: () => Qt })
1660
1660
  cx: m.x,
1661
1661
  cy: m.y
1662
1662
  }), e.target.setPointerCapture(e.pointerId);
1663
- }, [m]), ne = r((e) => {
1663
+ }, [m]), te = r((e) => {
1664
1664
  if (!S || !d.current || !u.current) return;
1665
1665
  let t = u.current.getBoundingClientRect(), n = d.current.naturalWidth / t.width, r = (e.clientX - t.left) * n - S.ox, i = (e.clientY - t.top) * n - S.oy, a = Math.max(0, Math.min(S.cx + r, d.current.naturalWidth - m.width)), o = Math.max(0, Math.min(S.cy + i, d.current.naturalHeight - m.height));
1666
1666
  g((e) => ({
@@ -1672,7 +1672,7 @@ var Xt = Y((() => {})), Zt = /* @__PURE__ */ X({ ImageCropperDialog: () => Qt })
1672
1672
  S,
1673
1673
  m.width,
1674
1674
  m.height
1675
- ]), E = r(() => C(null), []), re = r(() => p((e) => (e + 90) % 360), []), ie = r(async () => {
1675
+ ]), D = r(() => C(null), []), ne = r(() => p((e) => (e + 90) % 360), []), re = r(async () => {
1676
1676
  if (!d.current) return;
1677
1677
  let e = d.current, n = document.createElement("canvas"), r = m.width, a = m.height;
1678
1678
  n.width = f % 180 == 0 ? r : a, n.height = f % 180 == 0 ? a : r;
@@ -1689,64 +1689,64 @@ var Xt = Y((() => {})), Zt = /* @__PURE__ */ X({ ImageCropperDialog: () => Qt })
1689
1689
  s,
1690
1690
  t
1691
1691
  ]);
1692
- return /* @__PURE__ */ K(_, {
1692
+ return /* @__PURE__ */ q(_, {
1693
1693
  open: e,
1694
1694
  onOpenChange: t,
1695
- children: /* @__PURE__ */ q(v, {
1695
+ children: /* @__PURE__ */ J(v, {
1696
1696
  className: "max-w-xl",
1697
1697
  children: [
1698
- /* @__PURE__ */ q(ee, { children: [/* @__PURE__ */ K(x, { children: "Crop & rotate image" }), /* @__PURE__ */ K(y, { children: "Drag the highlighted box to reposition the crop. Use the rotate button to spin the image in 90° increments." })] }),
1699
- /* @__PURE__ */ q("div", {
1698
+ /* @__PURE__ */ J(ee, { children: [/* @__PURE__ */ q(x, { children: "Crop & rotate image" }), /* @__PURE__ */ q(y, { children: "Drag the highlighted box to reposition the crop. Use the rotate button to spin the image in 90° increments." })] }),
1699
+ /* @__PURE__ */ J("div", {
1700
1700
  className: "flex flex-col items-center gap-3",
1701
- children: [w ? /* @__PURE__ */ K("canvas", {
1701
+ children: [w ? /* @__PURE__ */ q("canvas", {
1702
1702
  ref: u,
1703
1703
  "data-testid": "image-cropper-canvas",
1704
1704
  role: "img",
1705
1705
  "aria-label": "Image crop preview",
1706
1706
  className: "border rounded-md cursor-move touch-none max-w-full",
1707
- onPointerDown: T,
1708
- onPointerMove: ne,
1709
- onPointerUp: E,
1710
- onPointerCancel: E
1711
- }) : /* @__PURE__ */ K("div", {
1707
+ onPointerDown: E,
1708
+ onPointerMove: te,
1709
+ onPointerUp: D,
1710
+ onPointerCancel: D
1711
+ }) : /* @__PURE__ */ q("div", {
1712
1712
  className: "flex h-[270px] w-full items-center justify-center text-sm text-muted-foreground",
1713
1713
  children: "Loading image…"
1714
- }), /* @__PURE__ */ q("div", {
1714
+ }), /* @__PURE__ */ J("div", {
1715
1715
  className: "flex w-full items-center justify-between text-xs text-muted-foreground",
1716
- children: [/* @__PURE__ */ q("span", { children: [
1716
+ children: [/* @__PURE__ */ J("span", { children: [
1717
1717
  "Crop: ",
1718
1718
  Math.round(m.width),
1719
1719
  " × ",
1720
1720
  Math.round(m.height),
1721
1721
  " px"
1722
- ] }), /* @__PURE__ */ q("span", { children: [
1722
+ ] }), /* @__PURE__ */ J("span", { children: [
1723
1723
  "Rotation: ",
1724
1724
  f,
1725
1725
  "°"
1726
1726
  ] })]
1727
1727
  })]
1728
1728
  }),
1729
- /* @__PURE__ */ q(b, {
1729
+ /* @__PURE__ */ J(b, {
1730
1730
  className: "flex justify-between sm:justify-between",
1731
- children: [/* @__PURE__ */ q(h, {
1731
+ children: [/* @__PURE__ */ J(h, {
1732
1732
  type: "button",
1733
1733
  variant: "outline",
1734
- onClick: re,
1734
+ onClick: ne,
1735
1735
  "data-testid": "image-cropper-rotate",
1736
- children: [/* @__PURE__ */ K(G, { className: "size-4 mr-2" }), "Rotate 90°"]
1737
- }), /* @__PURE__ */ q("div", {
1736
+ children: [/* @__PURE__ */ q(K, { className: "size-4 mr-2" }), "Rotate 90°"]
1737
+ }), /* @__PURE__ */ J("div", {
1738
1738
  className: "flex gap-2",
1739
- children: [/* @__PURE__ */ K(h, {
1739
+ children: [/* @__PURE__ */ q(h, {
1740
1740
  type: "button",
1741
1741
  variant: "ghost",
1742
1742
  onClick: () => t(!1),
1743
1743
  children: "Cancel"
1744
- }), /* @__PURE__ */ q(h, {
1744
+ }), /* @__PURE__ */ J(h, {
1745
1745
  type: "button",
1746
- onClick: ie,
1746
+ onClick: re,
1747
1747
  disabled: !w,
1748
1748
  "data-testid": "image-cropper-confirm",
1749
- children: [/* @__PURE__ */ K(_e, { className: "size-4 mr-2" }), "Apply crop"]
1749
+ children: [/* @__PURE__ */ q(ge, { className: "size-4 mr-2" }), "Apply crop"]
1750
1750
  })]
1751
1751
  })]
1752
1752
  })
@@ -1754,17 +1754,17 @@ var Xt = Y((() => {})), Zt = /* @__PURE__ */ X({ ImageCropperDialog: () => Qt })
1754
1754
  })
1755
1755
  });
1756
1756
  };
1757
- })), en = /* @__PURE__ */ X({ ImageField: () => tn });
1757
+ })), en = /* @__PURE__ */ Z({ ImageField: () => tn });
1758
1758
  function tn({ value: e, onChange: n, field: i, readonly: a, ...o }) {
1759
- let s = c(null), u = i || o.schema, d = u?.multiple || !1, f = u?.accept ? u.accept.join(",") : "image/*", p = u?.crop !== !1, [m, g] = l(null), { upload: _ } = Me(), [v, y] = l(!1);
1760
- if (a) return e ? /* @__PURE__ */ K("div", {
1759
+ let s = c(null), u = i || o.schema, d = u?.multiple || !1, f = u?.accept ? u.accept.join(",") : "image/*", p = u?.crop !== !1, [m, g] = l(null), { upload: _ } = je(), [v, y] = l(!1);
1760
+ if (a) return e ? /* @__PURE__ */ q("div", {
1761
1761
  className: "flex flex-wrap gap-2",
1762
- children: (Array.isArray(e) ? e : [e]).map((e, t) => /* @__PURE__ */ K("img", {
1762
+ children: (Array.isArray(e) ? e : [e]).map((e, t) => /* @__PURE__ */ q("img", {
1763
1763
  src: e.url || "",
1764
1764
  alt: e.name || `Image ${t + 1}`,
1765
1765
  className: "size-20 rounded-md object-cover border border-gray-200"
1766
1766
  }, t))
1767
- }) : /* @__PURE__ */ K(S, {});
1767
+ }) : /* @__PURE__ */ q(S, {});
1768
1768
  let b = e ? Array.isArray(e) ? e : [e] : [], ee = async (e) => {
1769
1769
  let t = Array.from(e.target.files || []);
1770
1770
  if (t.length !== 0) {
@@ -1823,10 +1823,10 @@ function tn({ value: e, onChange: n, field: i, readonly: a, ...o }) {
1823
1823
  name: t.name || `image-${e}.png`
1824
1824
  });
1825
1825
  }, [b]);
1826
- return /* @__PURE__ */ q("div", {
1826
+ return /* @__PURE__ */ J("div", {
1827
1827
  className: o.className,
1828
1828
  children: [
1829
- /* @__PURE__ */ K("input", {
1829
+ /* @__PURE__ */ q("input", {
1830
1830
  ref: s,
1831
1831
  type: "file",
1832
1832
  multiple: d,
@@ -1834,19 +1834,19 @@ function tn({ value: e, onChange: n, field: i, readonly: a, ...o }) {
1834
1834
  onChange: ee,
1835
1835
  className: "hidden"
1836
1836
  }),
1837
- /* @__PURE__ */ q("div", {
1837
+ /* @__PURE__ */ J("div", {
1838
1838
  className: "space-y-2",
1839
- children: [b.length > 0 && /* @__PURE__ */ K("div", {
1839
+ children: [b.length > 0 && /* @__PURE__ */ q("div", {
1840
1840
  className: "grid grid-cols-4 gap-2",
1841
- children: b.map((e, t) => /* @__PURE__ */ q("div", {
1841
+ children: b.map((e, t) => /* @__PURE__ */ J("div", {
1842
1842
  className: "relative group",
1843
- children: [/* @__PURE__ */ K("img", {
1843
+ children: [/* @__PURE__ */ q("img", {
1844
1844
  src: e.url || "",
1845
1845
  alt: e.name || `Image ${t + 1}`,
1846
1846
  className: "size-20 rounded-md object-cover border border-gray-200"
1847
- }), /* @__PURE__ */ q("div", {
1847
+ }), /* @__PURE__ */ J("div", {
1848
1848
  className: "absolute top-1 right-1 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",
1849
- children: [p && /* @__PURE__ */ K(h, {
1849
+ children: [p && /* @__PURE__ */ q(h, {
1850
1850
  type: "button",
1851
1851
  variant: "secondary",
1852
1852
  size: "sm",
@@ -1854,30 +1854,30 @@ function tn({ value: e, onChange: n, field: i, readonly: a, ...o }) {
1854
1854
  className: "h-6 w-6 p-0",
1855
1855
  "aria-label": `Crop image ${t + 1}`,
1856
1856
  "data-testid": `image-field-crop-${t}`,
1857
- children: /* @__PURE__ */ K(_e, { className: "size-3" })
1858
- }), /* @__PURE__ */ K(h, {
1857
+ children: /* @__PURE__ */ q(ge, { className: "size-3" })
1858
+ }), /* @__PURE__ */ q(h, {
1859
1859
  type: "button",
1860
1860
  variant: "destructive",
1861
1861
  size: "sm",
1862
1862
  onClick: () => x(t),
1863
1863
  className: "h-6 w-6 p-0",
1864
- children: /* @__PURE__ */ K(ke, { className: "size-3" })
1864
+ children: /* @__PURE__ */ q(Oe, { className: "size-3" })
1865
1865
  })]
1866
1866
  })]
1867
1867
  }, t))
1868
- }), /* @__PURE__ */ q(h, {
1868
+ }), /* @__PURE__ */ J(h, {
1869
1869
  type: "button",
1870
1870
  variant: "outline",
1871
1871
  onClick: () => s.current?.click(),
1872
1872
  className: "w-full",
1873
1873
  disabled: v,
1874
1874
  "data-testid": "image-field-upload-button",
1875
- children: [v ? /* @__PURE__ */ K(xe, { className: "size-4 mr-2 animate-spin" }) : /* @__PURE__ */ K(be, { className: "size-4 mr-2" }), v ? "Uploading…" : b.length > 0 ? "Add More Images" : "Upload Image"]
1875
+ children: [v ? /* @__PURE__ */ q(be, { className: "size-4 mr-2 animate-spin" }) : /* @__PURE__ */ q(ye, { className: "size-4 mr-2" }), v ? "Uploading…" : b.length > 0 ? "Add More Images" : "Upload Image"]
1876
1876
  })]
1877
1877
  }),
1878
- p && m && /* @__PURE__ */ K(t, {
1878
+ p && m && /* @__PURE__ */ q(t, {
1879
1879
  fallback: null,
1880
- children: /* @__PURE__ */ K(nn, {
1880
+ children: /* @__PURE__ */ q(nn, {
1881
1881
  open: !0,
1882
1882
  onOpenChange: (e) => !e && g(null),
1883
1883
  src: m.src,
@@ -1888,15 +1888,15 @@ function tn({ value: e, onChange: n, field: i, readonly: a, ...o }) {
1888
1888
  ]
1889
1889
  });
1890
1890
  }
1891
- var nn, rn = Y((() => {
1891
+ var nn, rn = X((() => {
1892
1892
  nn = n(() => Promise.resolve().then(() => ($t(), Zt)).then((e) => ({ default: e.ImageCropperDialog })));
1893
- })), an = /* @__PURE__ */ X({ LocationField: () => on });
1893
+ })), an = /* @__PURE__ */ Z({ LocationField: () => on });
1894
1894
  function on({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1895
1895
  let a = n || i.schema, o = e && typeof e == "object" ? `${e.latitude || 0}, ${e.longitude || 0}` : "";
1896
- return r ? /* @__PURE__ */ K("span", {
1896
+ return r ? /* @__PURE__ */ q("span", {
1897
1897
  className: "text-sm",
1898
- children: o || /* @__PURE__ */ K(S, {})
1899
- }) : /* @__PURE__ */ K(C, {
1898
+ children: o || /* @__PURE__ */ q(S, {})
1899
+ }) : /* @__PURE__ */ q(C, {
1900
1900
  type: "text",
1901
1901
  value: o,
1902
1902
  onChange: (e) => {
@@ -1919,59 +1919,59 @@ function on({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1919
1919
  className: i.className
1920
1920
  });
1921
1921
  }
1922
- var sn = Y((() => {})), cn = /* @__PURE__ */ X({ FormulaField: () => ln });
1922
+ var sn = X((() => {})), cn = /* @__PURE__ */ Z({ FormulaField: () => ln });
1923
1923
  function ln({ value: e, field: t, ...n }) {
1924
1924
  let r = (t || n.schema)?.return_type || "text";
1925
- if (e == null) return /* @__PURE__ */ K(S, { className: n.className });
1925
+ if (e == null) return /* @__PURE__ */ q(S, { className: n.className });
1926
1926
  let i;
1927
- return i = r === "number" || r === "currency" ? typeof e == "number" ? e.toFixed(2) : String(e) : r === "boolean" ? e ? "Yes" : "No" : r === "date" ? new Date(e).toLocaleDateString() : String(e), /* @__PURE__ */ K("span", {
1927
+ return i = r === "number" || r === "currency" ? typeof e == "number" ? e.toFixed(2) : String(e) : r === "boolean" ? e ? "Yes" : "No" : r === "date" ? new Date(e).toLocaleDateString() : String(e), /* @__PURE__ */ q("span", {
1928
1928
  className: `text-sm font-mono text-gray-700 ${n.className || ""}`,
1929
1929
  children: i
1930
1930
  });
1931
1931
  }
1932
- var un = Y((() => {})), dn = /* @__PURE__ */ X({ SummaryField: () => fn });
1932
+ var un = X((() => {})), dn = /* @__PURE__ */ Z({ SummaryField: () => fn });
1933
1933
  function fn({ value: e, field: t, ...n }) {
1934
1934
  let r = (t || n.schema)?.summary_type || "count";
1935
- if (e == null) return /* @__PURE__ */ K(S, { className: n.className });
1935
+ if (e == null) return /* @__PURE__ */ q(S, { className: n.className });
1936
1936
  let i;
1937
1937
  return i = r === "count" ? String(e) : [
1938
1938
  "sum",
1939
1939
  "avg",
1940
1940
  "min",
1941
1941
  "max"
1942
- ].includes(r) && typeof e == "number" ? e.toFixed(2) : String(e), /* @__PURE__ */ K("span", {
1942
+ ].includes(r) && typeof e == "number" ? e.toFixed(2) : String(e), /* @__PURE__ */ q("span", {
1943
1943
  className: `text-sm font-medium tabular-nums text-gray-700 ${n.className || ""}`,
1944
1944
  children: i
1945
1945
  });
1946
1946
  }
1947
- var pn = Y((() => {})), mn = /* @__PURE__ */ X({ AutoNumberField: () => hn });
1947
+ var pn = X((() => {})), mn = /* @__PURE__ */ Z({ AutoNumberField: () => hn });
1948
1948
  function hn({ value: e, field: t, ...n }) {
1949
- return e == null ? /* @__PURE__ */ K(S, { className: n.className }) : /* @__PURE__ */ K("span", {
1949
+ return e == null ? /* @__PURE__ */ q(S, { className: n.className }) : /* @__PURE__ */ q("span", {
1950
1950
  className: `text-sm font-mono text-gray-700 ${n.className || ""}`,
1951
1951
  children: String(e)
1952
1952
  });
1953
1953
  }
1954
- var gn = Y((() => {})), _n = /* @__PURE__ */ X({ UserField: () => vn });
1954
+ var gn = X((() => {})), _n = /* @__PURE__ */ Z({ UserField: () => vn });
1955
1955
  function vn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1956
1956
  let a = (n || i.schema)?.multiple || !1;
1957
1957
  if (r) {
1958
- if (!e) return /* @__PURE__ */ K(S, {});
1958
+ if (!e) return /* @__PURE__ */ q(S, {});
1959
1959
  let t = Array.isArray(e) ? e : [e];
1960
- return /* @__PURE__ */ q("div", {
1960
+ return /* @__PURE__ */ J("div", {
1961
1961
  className: "flex -space-x-2",
1962
1962
  children: [t.slice(0, 3).map((e, t) => {
1963
1963
  let n = e.name || e.username || "User";
1964
- return /* @__PURE__ */ K(d, {
1964
+ return /* @__PURE__ */ q(d, {
1965
1965
  className: "size-8 border-2 border-white",
1966
1966
  title: n,
1967
- children: /* @__PURE__ */ K(f, {
1967
+ children: /* @__PURE__ */ q(f, {
1968
1968
  className: "bg-blue-500 text-white text-xs",
1969
1969
  children: n.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2)
1970
1970
  })
1971
1971
  }, t);
1972
- }), t.length > 3 && /* @__PURE__ */ K(d, {
1972
+ }), t.length > 3 && /* @__PURE__ */ q(d, {
1973
1973
  className: "size-8 border-2 border-white",
1974
- children: /* @__PURE__ */ q(f, {
1974
+ children: /* @__PURE__ */ J(f, {
1975
1975
  className: "bg-gray-200 text-gray-600 text-xs",
1976
1976
  children: ["+", t.length - 3]
1977
1977
  })
@@ -1984,43 +1984,43 @@ function vn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1984
1984
  t(n.length > 0 ? n : null);
1985
1985
  } else t(null);
1986
1986
  };
1987
- return /* @__PURE__ */ q("div", {
1987
+ return /* @__PURE__ */ J("div", {
1988
1988
  className: i.className,
1989
- children: [o.length > 0 && /* @__PURE__ */ K("div", {
1989
+ children: [o.length > 0 && /* @__PURE__ */ q("div", {
1990
1990
  className: "flex flex-wrap gap-2 mb-2",
1991
1991
  children: o.map((e, t) => {
1992
1992
  let n = e.name || e.username || "User";
1993
- return /* @__PURE__ */ q(m, {
1993
+ return /* @__PURE__ */ J(m, {
1994
1994
  variant: "outline",
1995
1995
  className: "gap-2 pr-1",
1996
1996
  children: [
1997
- /* @__PURE__ */ K(d, {
1997
+ /* @__PURE__ */ q(d, {
1998
1998
  className: "size-5",
1999
- children: /* @__PURE__ */ K(f, {
1999
+ children: /* @__PURE__ */ q(f, {
2000
2000
  className: "bg-blue-500 text-white text-xs",
2001
2001
  children: n.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2)
2002
2002
  })
2003
2003
  }),
2004
- /* @__PURE__ */ K("span", {
2004
+ /* @__PURE__ */ q("span", {
2005
2005
  className: "text-sm",
2006
2006
  children: n
2007
2007
  }),
2008
- /* @__PURE__ */ K("button", {
2008
+ /* @__PURE__ */ q("button", {
2009
2009
  type: "button",
2010
2010
  onClick: () => s(t),
2011
2011
  className: "ml-1 rounded-full hover:bg-gray-200 p-0.5",
2012
- children: /* @__PURE__ */ K(ke, { className: "size-3" })
2012
+ children: /* @__PURE__ */ q(Oe, { className: "size-3" })
2013
2013
  })
2014
2014
  ]
2015
2015
  }, t);
2016
2016
  })
2017
- }), /* @__PURE__ */ K("div", {
2017
+ }), /* @__PURE__ */ q("div", {
2018
2018
  className: "text-sm text-gray-500 italic",
2019
2019
  children: "User selection component requires integration with user management system"
2020
2020
  })]
2021
2021
  });
2022
2022
  }
2023
- var yn = Y((() => {})), bn = /* @__PURE__ */ X({ ObjectField: () => xn });
2023
+ var yn = X((() => {})), bn = /* @__PURE__ */ Z({ ObjectField: () => xn });
2024
2024
  function xn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2025
2025
  let o = n || i.schema, [s, c] = l(() => e == null ? "" : JSON.stringify(e, null, 2)), [u, d] = l(null);
2026
2026
  return a(() => {
@@ -2034,12 +2034,12 @@ function xn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2034
2034
  } catch {
2035
2035
  c(JSON.stringify(e, null, 2));
2036
2036
  }
2037
- }, [e, s]), r ? e ? /* @__PURE__ */ K("pre", {
2038
- className: N("text-xs bg-gray-50 p-2 rounded border border-gray-200 overflow-auto max-h-40", i.className),
2037
+ }, [e, s]), r ? e ? /* @__PURE__ */ q("pre", {
2038
+ className: P("text-xs bg-gray-50 p-2 rounded border border-gray-200 overflow-auto max-h-40", i.className),
2039
2039
  children: JSON.stringify(e, null, 2)
2040
- }) : /* @__PURE__ */ K(S, {}) : /* @__PURE__ */ q("div", {
2040
+ }) : /* @__PURE__ */ q(S, {}) : /* @__PURE__ */ J("div", {
2041
2041
  className: "space-y-1",
2042
- children: [/* @__PURE__ */ K(M, {
2042
+ children: [/* @__PURE__ */ q(N, {
2043
2043
  value: s,
2044
2044
  onChange: (e) => {
2045
2045
  let n = e.target.value;
@@ -2055,32 +2055,32 @@ function xn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2055
2055
  },
2056
2056
  placeholder: o?.placeholder || "{\n \"key\": \"value\"\n}",
2057
2057
  disabled: r || i.disabled,
2058
- className: N("font-mono text-xs", u ? "border-red-500 focus-visible:ring-red-500" : "", i.className),
2058
+ className: P("font-mono text-xs", u ? "border-red-500 focus-visible:ring-red-500" : "", i.className),
2059
2059
  rows: 6
2060
- }), u && /* @__PURE__ */ K("p", {
2060
+ }), u && /* @__PURE__ */ q("p", {
2061
2061
  className: "text-xs text-red-500",
2062
2062
  children: u
2063
2063
  })]
2064
2064
  });
2065
2065
  }
2066
- var Sn = Y((() => {})), Cn = /* @__PURE__ */ X({ VectorField: () => wn });
2066
+ var Sn = X((() => {})), Cn = /* @__PURE__ */ Z({ VectorField: () => wn });
2067
2067
  function wn({ value: e, field: t, ...n }) {
2068
2068
  let r = (t || n.schema)?.dimensions || (Array.isArray(e) ? e.length : 0);
2069
- if (!e || !Array.isArray(e)) return /* @__PURE__ */ K(S, {});
2069
+ if (!e || !Array.isArray(e)) return /* @__PURE__ */ q(S, {});
2070
2070
  let i = e.slice(0, 3).map((e) => {
2071
2071
  let t = Number(e);
2072
2072
  return isNaN(t) ? "0" : t.toFixed(4);
2073
2073
  }).join(", ");
2074
- return /* @__PURE__ */ q("div", {
2074
+ return /* @__PURE__ */ J("div", {
2075
2075
  className: `text-sm ${n.className || ""}`,
2076
- children: [/* @__PURE__ */ q("span", {
2076
+ children: [/* @__PURE__ */ J("span", {
2077
2077
  className: "font-mono text-gray-700",
2078
2078
  children: [
2079
2079
  "[",
2080
2080
  i,
2081
2081
  "...]"
2082
2082
  ]
2083
- }), /* @__PURE__ */ q("span", {
2083
+ }), /* @__PURE__ */ J("span", {
2084
2084
  className: "text-gray-500 ml-2",
2085
2085
  children: [
2086
2086
  "(",
@@ -2090,39 +2090,39 @@ function wn({ value: e, field: t, ...n }) {
2090
2090
  })]
2091
2091
  });
2092
2092
  }
2093
- var Tn = Y((() => {})), En = /* @__PURE__ */ X({ GridField: () => Dn });
2093
+ var Tn = X((() => {})), En = /* @__PURE__ */ Z({ GridField: () => Dn });
2094
2094
  function Dn({ value: e, field: t, readonly: n, ...r }) {
2095
2095
  let i = (t || r.schema)?.columns || [];
2096
- return !e || !Array.isArray(e) ? /* @__PURE__ */ K(S, {}) : n ? /* @__PURE__ */ K("div", {
2097
- className: N("text-sm", r.className),
2098
- children: /* @__PURE__ */ q("span", {
2096
+ return !e || !Array.isArray(e) ? /* @__PURE__ */ q(S, {}) : n ? /* @__PURE__ */ q("div", {
2097
+ className: P("text-sm", r.className),
2098
+ children: /* @__PURE__ */ J("span", {
2099
2099
  className: "text-foreground",
2100
2100
  children: [e.length, " rows"]
2101
2101
  })
2102
- }) : /* @__PURE__ */ q("div", {
2103
- className: N("border border-border rounded-lg overflow-hidden", r.className),
2104
- children: [/* @__PURE__ */ K("div", {
2102
+ }) : /* @__PURE__ */ J("div", {
2103
+ className: P("border border-border rounded-lg overflow-hidden", r.className),
2104
+ children: [/* @__PURE__ */ q("div", {
2105
2105
  className: "overflow-auto max-h-60",
2106
- children: /* @__PURE__ */ q("table", {
2106
+ children: /* @__PURE__ */ J("table", {
2107
2107
  className: "w-full text-sm",
2108
- children: [/* @__PURE__ */ K("thead", {
2108
+ children: [/* @__PURE__ */ q("thead", {
2109
2109
  className: "bg-muted border-b border-border",
2110
- children: /* @__PURE__ */ K("tr", { children: i.map((e, t) => /* @__PURE__ */ K("th", {
2110
+ children: /* @__PURE__ */ q("tr", { children: i.map((e, t) => /* @__PURE__ */ q("th", {
2111
2111
  className: "px-3 py-2 text-left text-xs font-medium text-muted-foreground",
2112
2112
  children: e.label || e.name
2113
2113
  }, t)) })
2114
- }), /* @__PURE__ */ K("tbody", {
2114
+ }), /* @__PURE__ */ q("tbody", {
2115
2115
  className: "divide-y divide-border",
2116
- children: e.slice(0, 5).map((e, t) => /* @__PURE__ */ K("tr", {
2116
+ children: e.slice(0, 5).map((e, t) => /* @__PURE__ */ q("tr", {
2117
2117
  className: "hover:bg-muted/50 transition-colors",
2118
- children: i.map((t, n) => /* @__PURE__ */ K("td", {
2118
+ children: i.map((t, n) => /* @__PURE__ */ q("td", {
2119
2119
  className: "px-3 py-2 text-foreground",
2120
- children: e[t.name] == null ? /* @__PURE__ */ K(S, {}) : String(e[t.name])
2120
+ children: e[t.name] == null ? /* @__PURE__ */ q(S, {}) : String(e[t.name])
2121
2121
  }, n))
2122
2122
  }, t))
2123
2123
  })]
2124
2124
  })
2125
- }), e.length > 5 && /* @__PURE__ */ q("div", {
2125
+ }), e.length > 5 && /* @__PURE__ */ J("div", {
2126
2126
  className: "bg-muted px-3 py-2 text-xs text-muted-foreground border-t border-border",
2127
2127
  children: [
2128
2128
  "Showing 5 of ",
@@ -2132,27 +2132,27 @@ function Dn({ value: e, field: t, readonly: n, ...r }) {
2132
2132
  })]
2133
2133
  });
2134
2134
  }
2135
- var On = Y((() => {})), kn = /* @__PURE__ */ X({ ColorField: () => An });
2135
+ var On = X((() => {})), kn = /* @__PURE__ */ Z({ ColorField: () => An });
2136
2136
  function An({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2137
2137
  let a = n || i.schema;
2138
- return r ? /* @__PURE__ */ q("div", {
2138
+ return r ? /* @__PURE__ */ J("div", {
2139
2139
  className: "flex items-center gap-2",
2140
- children: [/* @__PURE__ */ K("div", {
2140
+ children: [/* @__PURE__ */ q("div", {
2141
2141
  className: "w-6 h-6 rounded border border-input",
2142
2142
  style: { backgroundColor: e || "#000000" }
2143
- }), /* @__PURE__ */ K("span", {
2143
+ }), /* @__PURE__ */ q("span", {
2144
2144
  className: "text-sm",
2145
- children: e || /* @__PURE__ */ K(S, {})
2145
+ children: e || /* @__PURE__ */ q(S, {})
2146
2146
  })]
2147
- }) : /* @__PURE__ */ q("div", {
2147
+ }) : /* @__PURE__ */ J("div", {
2148
2148
  className: "flex items-center gap-2",
2149
- children: [/* @__PURE__ */ K("input", {
2149
+ children: [/* @__PURE__ */ q("input", {
2150
2150
  type: "color",
2151
2151
  value: e || "#000000",
2152
2152
  onChange: (e) => t(e.target.value),
2153
2153
  disabled: r || i.disabled,
2154
2154
  className: "w-10 h-10 rounded border border-input cursor-pointer"
2155
- }), /* @__PURE__ */ K(C, {
2155
+ }), /* @__PURE__ */ q(C, {
2156
2156
  type: "text",
2157
2157
  value: e || "",
2158
2158
  onChange: (e) => t(e.target.value),
@@ -2163,21 +2163,21 @@ function An({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2163
2163
  })]
2164
2164
  });
2165
2165
  }
2166
- var jn = Y((() => {})), Mn = /* @__PURE__ */ X({ SliderField: () => Nn });
2166
+ var jn = X((() => {})), Mn = /* @__PURE__ */ Z({ SliderField: () => Nn });
2167
2167
  function Nn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2168
2168
  let a = n || i.schema, o = a?.min ?? 0, s = a?.max ?? 100, c = a?.step ?? 1;
2169
- return r ? /* @__PURE__ */ q("div", {
2169
+ return r ? /* @__PURE__ */ J("div", {
2170
2170
  className: "flex items-center gap-2",
2171
- children: [/* @__PURE__ */ K("span", {
2171
+ children: [/* @__PURE__ */ q("span", {
2172
2172
  className: "text-sm font-medium",
2173
2173
  children: e ?? o
2174
- }), /* @__PURE__ */ q("span", {
2174
+ }), /* @__PURE__ */ J("span", {
2175
2175
  className: "text-xs text-muted-foreground",
2176
2176
  children: ["/ ", s]
2177
2177
  })]
2178
- }) : /* @__PURE__ */ q("div", {
2178
+ }) : /* @__PURE__ */ J("div", {
2179
2179
  className: "flex items-center gap-4",
2180
- children: [/* @__PURE__ */ K(O, {
2180
+ children: [/* @__PURE__ */ q(k, {
2181
2181
  value: [e ?? o],
2182
2182
  onValueChange: (e) => t(e[0]),
2183
2183
  min: o,
@@ -2185,18 +2185,18 @@ function Nn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2185
2185
  step: c,
2186
2186
  disabled: r || i.disabled,
2187
2187
  className: i.className
2188
- }), /* @__PURE__ */ K("span", {
2188
+ }), /* @__PURE__ */ q("span", {
2189
2189
  className: "text-sm font-medium w-12 text-right",
2190
2190
  children: e ?? o
2191
2191
  })]
2192
2192
  });
2193
2193
  }
2194
- var Pn = Y((() => {})), Fn = /* @__PURE__ */ X({ RatingField: () => In });
2194
+ var Pn = X((() => {})), Fn = /* @__PURE__ */ Z({ RatingField: () => In });
2195
2195
  function In({ value: t, onChange: n, field: r, readonly: i, className: a, ...o }) {
2196
2196
  let s = (r || o.schema)?.max ?? 5, c = t ?? 0, [l, u] = e.useState(null), d = l === null ? c : l;
2197
- return i ? /* @__PURE__ */ q("div", {
2198
- className: N("flex items-center gap-1", a),
2199
- children: [Array.from({ length: s }, (e, t) => /* @__PURE__ */ K(Ee, { className: `w-5 h-5 ${t < c ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground"}` }, t)), /* @__PURE__ */ q("span", {
2197
+ return i ? /* @__PURE__ */ J("div", {
2198
+ className: P("flex items-center gap-1", a),
2199
+ children: [Array.from({ length: s }, (e, t) => /* @__PURE__ */ q(Te, { className: `w-5 h-5 ${t < c ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground"}` }, t)), /* @__PURE__ */ J("span", {
2200
2200
  className: "ml-2 text-sm text-muted-foreground",
2201
2201
  children: [
2202
2202
  c,
@@ -2204,17 +2204,17 @@ function In({ value: t, onChange: n, field: r, readonly: i, className: a, ...o }
2204
2204
  s
2205
2205
  ]
2206
2206
  })]
2207
- }) : /* @__PURE__ */ q("div", {
2208
- className: N("flex items-center gap-1", a),
2209
- children: [Array.from({ length: s }, (e, t) => /* @__PURE__ */ K("button", {
2207
+ }) : /* @__PURE__ */ J("div", {
2208
+ className: P("flex items-center gap-1", a),
2209
+ children: [Array.from({ length: s }, (e, t) => /* @__PURE__ */ q("button", {
2210
2210
  type: "button",
2211
2211
  onClick: () => n(t + 1),
2212
2212
  onMouseEnter: () => u(t + 1),
2213
2213
  onMouseLeave: () => u(null),
2214
2214
  className: "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 rounded",
2215
2215
  disabled: i || o.disabled,
2216
- children: /* @__PURE__ */ K(Ee, { className: `w-5 h-5 transition-colors ${t < d ? "fill-yellow-400 text-yellow-400 hover:fill-yellow-500 hover:text-yellow-500" : "text-muted-foreground hover:text-yellow-400"}` })
2217
- }, t)), /* @__PURE__ */ q("span", {
2216
+ children: /* @__PURE__ */ q(Te, { className: `w-5 h-5 transition-colors ${t < d ? "fill-yellow-400 text-yellow-400 hover:fill-yellow-500 hover:text-yellow-500" : "text-muted-foreground hover:text-yellow-400"}` })
2217
+ }, t)), /* @__PURE__ */ J("span", {
2218
2218
  className: "ml-2 text-sm text-muted-foreground",
2219
2219
  children: [
2220
2220
  c,
@@ -2224,23 +2224,23 @@ function In({ value: t, onChange: n, field: r, readonly: i, className: a, ...o }
2224
2224
  })]
2225
2225
  });
2226
2226
  }
2227
- var Ln = Y((() => {})), Rn = /* @__PURE__ */ X({ CodeField: () => zn });
2227
+ var Ln = X((() => {})), Rn = /* @__PURE__ */ Z({ CodeField: () => zn });
2228
2228
  function zn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2229
2229
  let a = n || i.schema, o = a?.language ?? "javascript";
2230
- return r ? /* @__PURE__ */ K("pre", {
2231
- className: N("text-sm bg-muted p-2 rounded overflow-x-auto border", i.className),
2232
- children: /* @__PURE__ */ K("code", { children: e || /* @__PURE__ */ K(S, {}) })
2233
- }) : /* @__PURE__ */ K(M, {
2230
+ return r ? /* @__PURE__ */ q("pre", {
2231
+ className: P("text-sm bg-muted p-2 rounded overflow-x-auto border", i.className),
2232
+ children: /* @__PURE__ */ q("code", { children: e || /* @__PURE__ */ q(S, {}) })
2233
+ }) : /* @__PURE__ */ q(N, {
2234
2234
  value: e || "",
2235
2235
  onChange: (e) => t(e.target.value),
2236
2236
  placeholder: a?.placeholder || `// Write ${o} code here...`,
2237
2237
  disabled: r || i.disabled,
2238
- className: N("font-mono text-sm", i.className),
2238
+ className: P("font-mono text-sm", i.className),
2239
2239
  rows: 12,
2240
2240
  spellCheck: !1
2241
2241
  });
2242
2242
  }
2243
- var Bn = Y((() => {})), Vn = /* @__PURE__ */ X({ AvatarField: () => Hn });
2243
+ var Bn = X((() => {})), Vn = /* @__PURE__ */ Z({ AvatarField: () => Hn });
2244
2244
  function Hn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2245
2245
  let [o, s] = e.useState(!1), c = e.useRef(null), l = r || a.schema, u = (e) => {
2246
2246
  let t = e.target.files?.[0];
@@ -2260,53 +2260,53 @@ function Hn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2260
2260
  }, m = () => {
2261
2261
  n("");
2262
2262
  }, g = () => (l?.defaultName || l?.label || "User").split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2);
2263
- return i ? /* @__PURE__ */ q(d, {
2263
+ return i ? /* @__PURE__ */ J(d, {
2264
2264
  className: "w-16 h-16",
2265
- children: [t && /* @__PURE__ */ K(p, {
2265
+ children: [t && /* @__PURE__ */ q(p, {
2266
2266
  src: t,
2267
2267
  alt: l?.label
2268
- }), /* @__PURE__ */ K(f, { children: g() })]
2269
- }) : /* @__PURE__ */ q("div", {
2268
+ }), /* @__PURE__ */ q(f, { children: g() })]
2269
+ }) : /* @__PURE__ */ J("div", {
2270
2270
  className: "flex items-center gap-4",
2271
- children: [/* @__PURE__ */ q("div", {
2271
+ children: [/* @__PURE__ */ J("div", {
2272
2272
  className: "relative",
2273
2273
  onMouseEnter: () => s(!0),
2274
2274
  onMouseLeave: () => s(!1),
2275
- children: [/* @__PURE__ */ q(d, {
2275
+ children: [/* @__PURE__ */ J(d, {
2276
2276
  className: "w-16 h-16",
2277
- children: [t && /* @__PURE__ */ K(p, {
2277
+ children: [t && /* @__PURE__ */ q(p, {
2278
2278
  src: t,
2279
2279
  alt: l?.label
2280
- }), /* @__PURE__ */ K(f, { children: g() })]
2281
- }), !i && o && t && /* @__PURE__ */ K("button", {
2280
+ }), /* @__PURE__ */ q(f, { children: g() })]
2281
+ }), !i && o && t && /* @__PURE__ */ q("button", {
2282
2282
  type: "button",
2283
2283
  onClick: m,
2284
2284
  className: "absolute -top-1 -right-1 bg-destructive text-destructive-foreground rounded-full p-1 hover:bg-destructive/90",
2285
- children: /* @__PURE__ */ K(ke, { className: "w-3 h-3" })
2285
+ children: /* @__PURE__ */ q(Oe, { className: "w-3 h-3" })
2286
2286
  })]
2287
- }), /* @__PURE__ */ q("div", {
2287
+ }), /* @__PURE__ */ J("div", {
2288
2288
  className: "flex flex-col gap-2",
2289
2289
  children: [
2290
- /* @__PURE__ */ K("input", {
2290
+ /* @__PURE__ */ q("input", {
2291
2291
  ref: c,
2292
2292
  type: "file",
2293
2293
  accept: "image/*",
2294
2294
  onChange: u,
2295
2295
  className: "hidden"
2296
2296
  }),
2297
- /* @__PURE__ */ q(h, {
2297
+ /* @__PURE__ */ J(h, {
2298
2298
  type: "button",
2299
2299
  variant: "outline",
2300
2300
  size: "sm",
2301
2301
  onClick: () => c.current?.click(),
2302
2302
  disabled: i || a.disabled,
2303
2303
  children: [
2304
- /* @__PURE__ */ K(Oe, { className: "w-4 h-4 mr-2" }),
2304
+ /* @__PURE__ */ q(De, { className: "w-4 h-4 mr-2" }),
2305
2305
  t ? "Change" : "Upload",
2306
2306
  " Avatar"
2307
2307
  ]
2308
2308
  }),
2309
- /* @__PURE__ */ K("p", {
2309
+ /* @__PURE__ */ q("p", {
2310
2310
  className: "text-xs text-muted-foreground",
2311
2311
  children: "PNG, JPG up to 5MB"
2312
2312
  })
@@ -2314,7 +2314,7 @@ function Hn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2314
2314
  })]
2315
2315
  });
2316
2316
  }
2317
- var Un = Y((() => {})), Wn = /* @__PURE__ */ X({ AddressField: () => Gn });
2317
+ var Un = X((() => {})), Wn = /* @__PURE__ */ Z({ AddressField: () => Gn });
2318
2318
  function Gn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2319
2319
  let a = e || {}, o = (e, n) => {
2320
2320
  t({
@@ -2329,19 +2329,19 @@ function Gn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2329
2329
  ].filter(Boolean).join(", ");
2330
2330
  if (r) {
2331
2331
  let e = s(a);
2332
- return e ? /* @__PURE__ */ K("span", {
2332
+ return e ? /* @__PURE__ */ q("span", {
2333
2333
  className: "text-sm",
2334
2334
  children: e
2335
- }) : /* @__PURE__ */ K(S, {});
2335
+ }) : /* @__PURE__ */ q(S, {});
2336
2336
  }
2337
- return /* @__PURE__ */ q("div", {
2337
+ return /* @__PURE__ */ J("div", {
2338
2338
  className: "space-y-3",
2339
2339
  children: [
2340
- /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K(w, {
2340
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q(w, {
2341
2341
  htmlFor: "street",
2342
2342
  className: "text-xs",
2343
2343
  children: "Street Address"
2344
- }), /* @__PURE__ */ K(C, {
2344
+ }), /* @__PURE__ */ q(C, {
2345
2345
  id: "street",
2346
2346
  type: "text",
2347
2347
  value: a.street || "",
@@ -2350,24 +2350,24 @@ function Gn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2350
2350
  disabled: r || i.disabled,
2351
2351
  className: i.className
2352
2352
  })] }),
2353
- /* @__PURE__ */ q("div", {
2353
+ /* @__PURE__ */ J("div", {
2354
2354
  className: "grid grid-cols-2 gap-3",
2355
- children: [/* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K(w, {
2355
+ children: [/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q(w, {
2356
2356
  htmlFor: "city",
2357
2357
  className: "text-xs",
2358
2358
  children: "City"
2359
- }), /* @__PURE__ */ K(C, {
2359
+ }), /* @__PURE__ */ q(C, {
2360
2360
  id: "city",
2361
2361
  type: "text",
2362
2362
  value: a.city || "",
2363
2363
  onChange: (e) => o("city", e.target.value),
2364
2364
  placeholder: "San Francisco",
2365
2365
  disabled: r || i.disabled
2366
- })] }), /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K(w, {
2366
+ })] }), /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q(w, {
2367
2367
  htmlFor: "state",
2368
2368
  className: "text-xs",
2369
2369
  children: "State / Province"
2370
- }), /* @__PURE__ */ K(C, {
2370
+ }), /* @__PURE__ */ q(C, {
2371
2371
  id: "state",
2372
2372
  type: "text",
2373
2373
  value: a.state || "",
@@ -2376,24 +2376,24 @@ function Gn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2376
2376
  disabled: r || i.disabled
2377
2377
  })] })]
2378
2378
  }),
2379
- /* @__PURE__ */ q("div", {
2379
+ /* @__PURE__ */ J("div", {
2380
2380
  className: "grid grid-cols-2 gap-3",
2381
- children: [/* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K(w, {
2381
+ children: [/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q(w, {
2382
2382
  htmlFor: "zipCode",
2383
2383
  className: "text-xs",
2384
2384
  children: "ZIP / Postal Code"
2385
- }), /* @__PURE__ */ K(C, {
2385
+ }), /* @__PURE__ */ q(C, {
2386
2386
  id: "zipCode",
2387
2387
  type: "text",
2388
2388
  value: a.zipCode || "",
2389
2389
  onChange: (e) => o("zipCode", e.target.value),
2390
2390
  placeholder: "94102",
2391
2391
  disabled: r || i.disabled
2392
- })] }), /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K(w, {
2392
+ })] }), /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q(w, {
2393
2393
  htmlFor: "country",
2394
2394
  className: "text-xs",
2395
2395
  children: "Country"
2396
- }), /* @__PURE__ */ K(C, {
2396
+ }), /* @__PURE__ */ q(C, {
2397
2397
  id: "country",
2398
2398
  type: "text",
2399
2399
  value: a.country || "",
@@ -2405,7 +2405,7 @@ function Gn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2405
2405
  ]
2406
2406
  });
2407
2407
  }
2408
- var Kn = Y((() => {})), qn = /* @__PURE__ */ X({ GeolocationField: () => Jn });
2408
+ var Kn = X((() => {})), qn = /* @__PURE__ */ Z({ GeolocationField: () => Jn });
2409
2409
  function Jn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2410
2410
  let [o, s] = e.useState(!1), c = t || {}, l = (e, t) => {
2411
2411
  n({
@@ -2437,15 +2437,15 @@ function Jn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2437
2437
  };
2438
2438
  if (i) {
2439
2439
  let e = d(c);
2440
- return /* @__PURE__ */ q("div", {
2440
+ return /* @__PURE__ */ J("div", {
2441
2441
  className: "flex items-center gap-2",
2442
2442
  children: [
2443
- /* @__PURE__ */ K(H, { className: "w-4 h-4 text-muted-foreground" }),
2444
- e ? /* @__PURE__ */ K("span", {
2443
+ /* @__PURE__ */ q(U, { className: "w-4 h-4 text-muted-foreground" }),
2444
+ e ? /* @__PURE__ */ q("span", {
2445
2445
  className: "text-sm",
2446
2446
  children: e
2447
- }) : /* @__PURE__ */ K(S, {}),
2448
- c.latitude && c.longitude && /* @__PURE__ */ K(h, {
2447
+ }) : /* @__PURE__ */ q(S, {}),
2448
+ c.latitude && c.longitude && /* @__PURE__ */ q(h, {
2449
2449
  type: "button",
2450
2450
  variant: "link",
2451
2451
  size: "sm",
@@ -2456,33 +2456,33 @@ function Jn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2456
2456
  ]
2457
2457
  });
2458
2458
  }
2459
- return /* @__PURE__ */ q("div", {
2459
+ return /* @__PURE__ */ J("div", {
2460
2460
  className: "space-y-3",
2461
2461
  children: [
2462
- /* @__PURE__ */ q("div", {
2462
+ /* @__PURE__ */ J("div", {
2463
2463
  className: "flex items-center gap-2",
2464
- children: [/* @__PURE__ */ q(h, {
2464
+ children: [/* @__PURE__ */ J(h, {
2465
2465
  type: "button",
2466
2466
  variant: "outline",
2467
2467
  size: "sm",
2468
2468
  onClick: u,
2469
2469
  disabled: i || o,
2470
- children: [/* @__PURE__ */ K(L, { className: "w-4 h-4 mr-2" }), o ? "Getting location..." : "Use Current Location"]
2471
- }), c.latitude && c.longitude && /* @__PURE__ */ q(h, {
2470
+ children: [/* @__PURE__ */ q(R, { className: "w-4 h-4 mr-2" }), o ? "Getting location..." : "Use Current Location"]
2471
+ }), c.latitude && c.longitude && /* @__PURE__ */ J(h, {
2472
2472
  type: "button",
2473
2473
  variant: "link",
2474
2474
  size: "sm",
2475
2475
  onClick: f,
2476
- children: [/* @__PURE__ */ K(H, { className: "w-4 h-4 mr-2" }), "View on map"]
2476
+ children: [/* @__PURE__ */ q(U, { className: "w-4 h-4 mr-2" }), "View on map"]
2477
2477
  })]
2478
2478
  }),
2479
- /* @__PURE__ */ q("div", {
2479
+ /* @__PURE__ */ J("div", {
2480
2480
  className: "grid grid-cols-2 gap-3",
2481
- children: [/* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K(w, {
2481
+ children: [/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q(w, {
2482
2482
  htmlFor: "latitude",
2483
2483
  className: "text-xs",
2484
2484
  children: "Latitude"
2485
- }), /* @__PURE__ */ K(C, {
2485
+ }), /* @__PURE__ */ q(C, {
2486
2486
  id: "latitude",
2487
2487
  type: "number",
2488
2488
  value: c.latitude ?? "",
@@ -2491,11 +2491,11 @@ function Jn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2491
2491
  disabled: i || a.disabled,
2492
2492
  step: "any",
2493
2493
  className: a.className
2494
- })] }), /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K(w, {
2494
+ })] }), /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q(w, {
2495
2495
  htmlFor: "longitude",
2496
2496
  className: "text-xs",
2497
2497
  children: "Longitude"
2498
- }), /* @__PURE__ */ K(C, {
2498
+ }), /* @__PURE__ */ q(C, {
2499
2499
  id: "longitude",
2500
2500
  type: "number",
2501
2501
  value: c.longitude ?? "",
@@ -2505,7 +2505,7 @@ function Jn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2505
2505
  step: "any"
2506
2506
  })] })]
2507
2507
  }),
2508
- c.accuracy && /* @__PURE__ */ q("p", {
2508
+ c.accuracy && /* @__PURE__ */ J("p", {
2509
2509
  className: "text-xs text-muted-foreground",
2510
2510
  children: [
2511
2511
  "Accuracy: ±",
@@ -2516,7 +2516,7 @@ function Jn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2516
2516
  ]
2517
2517
  });
2518
2518
  }
2519
- var Yn = Y((() => {})), Xn = /* @__PURE__ */ X({ SignatureField: () => Zn });
2519
+ var Yn = X((() => {})), Xn = /* @__PURE__ */ Z({ SignatureField: () => Zn });
2520
2520
  function Zn({ value: t, onChange: n, readonly: r }) {
2521
2521
  let i = c(null), [o, s] = e.useState(!1), [l, u] = e.useState(!t);
2522
2522
  a(() => {
@@ -2553,22 +2553,22 @@ function Zn({ value: t, onChange: n, readonly: r }) {
2553
2553
  let e = i.current;
2554
2554
  e && n(e.toDataURL("image/png"));
2555
2555
  };
2556
- return r && t ? /* @__PURE__ */ K("div", {
2556
+ return r && t ? /* @__PURE__ */ q("div", {
2557
2557
  className: "border rounded p-2 bg-white",
2558
- children: /* @__PURE__ */ K("img", {
2558
+ children: /* @__PURE__ */ q("img", {
2559
2559
  src: t,
2560
2560
  alt: "Signature",
2561
2561
  loading: "lazy",
2562
2562
  className: "max-w-full h-auto"
2563
2563
  })
2564
- }) : r && !t ? /* @__PURE__ */ K("span", {
2564
+ }) : r && !t ? /* @__PURE__ */ q("span", {
2565
2565
  className: "text-sm text-muted-foreground",
2566
2566
  children: "No signature"
2567
- }) : /* @__PURE__ */ q("div", {
2567
+ }) : /* @__PURE__ */ J("div", {
2568
2568
  className: "space-y-2",
2569
- children: [/* @__PURE__ */ K("div", {
2569
+ children: [/* @__PURE__ */ q("div", {
2570
2570
  className: "border rounded bg-white",
2571
- children: /* @__PURE__ */ K("canvas", {
2571
+ children: /* @__PURE__ */ q("canvas", {
2572
2572
  ref: i,
2573
2573
  width: 400,
2574
2574
  height: 200,
@@ -2581,12 +2581,12 @@ function Zn({ value: t, onChange: n, readonly: r }) {
2581
2581
  onTouchMove: f,
2582
2582
  onTouchEnd: p
2583
2583
  })
2584
- }), /* @__PURE__ */ q("div", {
2584
+ }), /* @__PURE__ */ J("div", {
2585
2585
  className: "flex justify-between items-center",
2586
- children: [/* @__PURE__ */ K("p", {
2586
+ children: [/* @__PURE__ */ q("p", {
2587
2587
  className: "text-xs text-muted-foreground",
2588
2588
  children: l ? "Sign above" : "Signature captured"
2589
- }), /* @__PURE__ */ q(h, {
2589
+ }), /* @__PURE__ */ J(h, {
2590
2590
  type: "button",
2591
2591
  variant: "outline",
2592
2592
  size: "sm",
@@ -2597,67 +2597,67 @@ function Zn({ value: t, onChange: n, readonly: r }) {
2597
2597
  t && (t.clearRect(0, 0, e.width, e.height), u(!0), n(""));
2598
2598
  },
2599
2599
  disabled: r || l,
2600
- children: [/* @__PURE__ */ K(R, { className: "w-4 h-4 mr-2" }), "Clear"]
2600
+ children: [/* @__PURE__ */ q(z, { className: "w-4 h-4 mr-2" }), "Clear"]
2601
2601
  })]
2602
2602
  })]
2603
2603
  });
2604
2604
  }
2605
- var Qn = Y((() => {})), $n = /* @__PURE__ */ X({ QRCodeField: () => er });
2605
+ var Qn = X((() => {})), $n = /* @__PURE__ */ Z({ QRCodeField: () => er });
2606
2606
  function er({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2607
2607
  let [o, s] = e.useState(!1), c = r || a.schema;
2608
- return i ? /* @__PURE__ */ q("div", {
2608
+ return i ? /* @__PURE__ */ J("div", {
2609
2609
  className: "flex items-center gap-3",
2610
- children: [/* @__PURE__ */ K("span", {
2610
+ children: [/* @__PURE__ */ q("span", {
2611
2611
  className: "text-sm flex-1 truncate",
2612
- children: t || /* @__PURE__ */ K(S, {})
2613
- }), t && /* @__PURE__ */ q(h, {
2612
+ children: t || /* @__PURE__ */ q(S, {})
2613
+ }), t && /* @__PURE__ */ J(h, {
2614
2614
  type: "button",
2615
2615
  variant: "outline",
2616
2616
  size: "sm",
2617
2617
  onClick: () => s(!o),
2618
2618
  children: [
2619
- /* @__PURE__ */ K(W, { className: "w-4 h-4 mr-2" }),
2619
+ /* @__PURE__ */ q(G, { className: "w-4 h-4 mr-2" }),
2620
2620
  o ? "Hide" : "Show",
2621
2621
  " QR"
2622
2622
  ]
2623
2623
  })]
2624
- }) : /* @__PURE__ */ q("div", {
2624
+ }) : /* @__PURE__ */ J("div", {
2625
2625
  className: "space-y-3",
2626
2626
  children: [
2627
- /* @__PURE__ */ q("div", {
2627
+ /* @__PURE__ */ J("div", {
2628
2628
  className: "flex items-center gap-2",
2629
- children: [/* @__PURE__ */ K(C, {
2629
+ children: [/* @__PURE__ */ q(C, {
2630
2630
  type: "text",
2631
2631
  value: t || "",
2632
2632
  onChange: (e) => n(e.target.value),
2633
2633
  placeholder: c?.placeholder || "Enter text for QR code",
2634
2634
  disabled: i || a.disabled,
2635
2635
  className: a.className
2636
- }), t && /* @__PURE__ */ q(Ae, { children: [/* @__PURE__ */ K(h, {
2636
+ }), t && /* @__PURE__ */ J(ke, { children: [/* @__PURE__ */ q(h, {
2637
2637
  type: "button",
2638
2638
  variant: "outline",
2639
2639
  size: "sm",
2640
2640
  onClick: () => {
2641
2641
  t && navigator.clipboard.writeText(t);
2642
2642
  },
2643
- children: /* @__PURE__ */ K(I, { className: "w-4 h-4" })
2644
- }), /* @__PURE__ */ K(h, {
2643
+ children: /* @__PURE__ */ q(L, { className: "w-4 h-4" })
2644
+ }), /* @__PURE__ */ q(h, {
2645
2645
  type: "button",
2646
2646
  variant: "outline",
2647
2647
  size: "sm",
2648
2648
  onClick: () => s(!o),
2649
- children: /* @__PURE__ */ K(W, { className: "w-4 h-4" })
2649
+ children: /* @__PURE__ */ q(G, { className: "w-4 h-4" })
2650
2650
  })] })]
2651
2651
  }),
2652
- o && t && /* @__PURE__ */ K("div", {
2652
+ o && t && /* @__PURE__ */ q("div", {
2653
2653
  className: "border rounded p-4 bg-white flex justify-center",
2654
- children: /* @__PURE__ */ K("img", {
2654
+ children: /* @__PURE__ */ q("img", {
2655
2655
  src: ((e) => `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(e)}`)(t),
2656
2656
  alt: "QR Code",
2657
2657
  className: "w-48 h-48"
2658
2658
  })
2659
2659
  }),
2660
- t && /* @__PURE__ */ q("p", {
2660
+ t && /* @__PURE__ */ J("p", {
2661
2661
  className: "text-xs text-muted-foreground",
2662
2662
  children: [
2663
2663
  "QR code contains: ",
@@ -2668,8 +2668,11 @@ function er({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2668
2668
  ]
2669
2669
  });
2670
2670
  }
2671
- var tr = Y((() => {})), nr = /* @__PURE__ */ X({ MasterDetailField: () => rr });
2672
- function rr({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }) {
2671
+ var tr = X((() => {}));
2672
+ //#endregion
2673
+ //#region src/widgets/MasterDetailField.tsx
2674
+ Fe(), Re(), Ve(), qe(), Xe(), $e(), nt(), at(), lt(), ft(), ht(), Ft(), Rt(), Vt(), Wt(), qt(), Xt(), rn(), sn(), un(), pn(), gn(), yn(), Sn(), Tn(), On(), jn(), Pn(), Ln(), Bn(), Un(), Kn(), Yn(), Qn(), tr(), $t();
2675
+ function nr({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }) {
2673
2676
  let o = e || [], s = n || a.schema, c = () => {
2674
2677
  let e = {
2675
2678
  id: `new-${Date.now()}`,
@@ -2681,24 +2684,24 @@ function rr({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }
2681
2684
  }, u = (e) => {
2682
2685
  console.log("View detail:", e);
2683
2686
  };
2684
- return r ? /* @__PURE__ */ q("div", {
2685
- className: N("space-y-2", i),
2686
- children: [o.length === 0 ? /* @__PURE__ */ K("span", {
2687
+ return r ? /* @__PURE__ */ J("div", {
2688
+ className: P("space-y-2", i),
2689
+ children: [o.length === 0 ? /* @__PURE__ */ q("span", {
2687
2690
  className: "text-sm text-muted-foreground",
2688
2691
  children: "No related records"
2689
- }) : o.map((e) => /* @__PURE__ */ q("div", {
2692
+ }) : o.map((e) => /* @__PURE__ */ J("div", {
2690
2693
  className: "flex items-center justify-between p-2 border rounded hover:bg-muted/50",
2691
- children: [/* @__PURE__ */ K("span", {
2694
+ children: [/* @__PURE__ */ q("span", {
2692
2695
  className: "text-sm",
2693
2696
  children: e.label
2694
- }), /* @__PURE__ */ K(h, {
2697
+ }), /* @__PURE__ */ q(h, {
2695
2698
  type: "button",
2696
2699
  variant: "ghost",
2697
2700
  size: "sm",
2698
2701
  onClick: () => u(e),
2699
- children: /* @__PURE__ */ K(z, { className: "w-4 h-4" })
2702
+ children: /* @__PURE__ */ q(B, { className: "w-4 h-4" })
2700
2703
  })]
2701
- }, e.id)), /* @__PURE__ */ q("p", {
2704
+ }, e.id)), /* @__PURE__ */ J("p", {
2702
2705
  className: "text-xs text-muted-foreground",
2703
2706
  children: [
2704
2707
  o.length,
@@ -2706,58 +2709,57 @@ function rr({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }
2706
2709
  o.length === 1 ? "record" : "records"
2707
2710
  ]
2708
2711
  })]
2709
- }) : /* @__PURE__ */ q("div", {
2710
- className: N("space-y-3", i),
2711
- children: [/* @__PURE__ */ q("div", {
2712
+ }) : /* @__PURE__ */ J("div", {
2713
+ className: P("space-y-3", i),
2714
+ children: [/* @__PURE__ */ J("div", {
2712
2715
  className: "space-y-2",
2713
- children: [o.map((e) => /* @__PURE__ */ q("div", {
2716
+ children: [o.map((e) => /* @__PURE__ */ J("div", {
2714
2717
  className: "flex items-center justify-between gap-2 p-2 border rounded hover:bg-muted/50",
2715
- children: [/* @__PURE__ */ q("div", {
2718
+ children: [/* @__PURE__ */ J("div", {
2716
2719
  className: "flex items-center gap-2 flex-1",
2717
- children: [/* @__PURE__ */ K(m, {
2720
+ children: [/* @__PURE__ */ q(m, {
2718
2721
  variant: "outline",
2719
2722
  children: e.id
2720
- }), /* @__PURE__ */ K("span", {
2723
+ }), /* @__PURE__ */ q("span", {
2721
2724
  className: "text-sm flex-1",
2722
2725
  children: e.label
2723
2726
  })]
2724
- }), /* @__PURE__ */ q("div", {
2727
+ }), /* @__PURE__ */ J("div", {
2725
2728
  className: "flex items-center gap-1",
2726
- children: [/* @__PURE__ */ K(h, {
2729
+ children: [/* @__PURE__ */ q(h, {
2727
2730
  type: "button",
2728
2731
  variant: "ghost",
2729
2732
  size: "sm",
2730
2733
  onClick: () => u(e),
2731
- children: /* @__PURE__ */ K(z, { className: "w-4 h-4" })
2732
- }), /* @__PURE__ */ K(h, {
2734
+ children: /* @__PURE__ */ q(B, { className: "w-4 h-4" })
2735
+ }), /* @__PURE__ */ q(h, {
2733
2736
  type: "button",
2734
2737
  variant: "ghost",
2735
2738
  size: "sm",
2736
2739
  onClick: () => l(e.id),
2737
2740
  disabled: a.disabled,
2738
- children: /* @__PURE__ */ K(ke, { className: "w-4 h-4" })
2741
+ children: /* @__PURE__ */ q(Oe, { className: "w-4 h-4" })
2739
2742
  })]
2740
2743
  })]
2741
- }, e.id)), o.length === 0 && /* @__PURE__ */ K("div", {
2744
+ }, e.id)), o.length === 0 && /* @__PURE__ */ q("div", {
2742
2745
  className: "text-sm text-muted-foreground text-center py-4 border border-dashed rounded bg-muted/20",
2743
2746
  children: "No related records"
2744
2747
  })]
2745
- }), /* @__PURE__ */ q(h, {
2748
+ }), /* @__PURE__ */ J(h, {
2746
2749
  type: "button",
2747
2750
  variant: "outline",
2748
2751
  className: "w-full",
2749
2752
  onClick: c,
2750
2753
  disabled: a.disabled,
2751
2754
  children: [
2752
- /* @__PURE__ */ K(Ce, { className: "w-4 h-4 mr-2" }),
2755
+ /* @__PURE__ */ q(Se, { className: "w-4 h-4 mr-2" }),
2753
2756
  "Add ",
2754
2757
  s?.label || "Record"
2755
2758
  ]
2756
2759
  })]
2757
2760
  });
2758
2761
  }
2759
- var ir = Y((() => {}));
2760
- Ie(), ze(), Ve(), qe(), Xe(), $e(), nt(), at(), lt(), ft(), ht(), Ft(), Rt(), Vt(), Wt(), qt(), Xt(), rn(), sn(), un(), pn(), gn(), yn(), Sn(), Tn(), On(), jn(), Pn(), Ln(), Bn(), Un(), Kn(), Yn(), Qn(), tr(), ir(), Ot(), Ie(), ze(), Ve(), qe(), Xe(), Rt(), Vt(), $e(), nt(), at(), lt(), Wt(), qt(), ft(), ht(), Ft(), wt(), Xt(), rn(), $t(), sn(), un(), pn(), gn(), yn(), Sn(), Tn(), On(), jn(), Pn(), Ln(), Bn(), Un(), Kn(), Yn(), Qn(), tr(), ir();
2762
+ Ot(), Fe(), Re(), Ve(), qe(), Xe(), Rt(), Vt(), $e(), nt(), at(), lt(), Wt(), qt(), ft(), ht(), Ft(), wt(), Xt(), rn(), sn(), un(), pn(), gn(), yn(), Sn(), Tn(), On(), jn(), Pn(), Ln(), Bn(), Un(), Kn(), Yn(), Qn(), tr();
2761
2763
  function Q(e) {
2762
2764
  if (e == null || typeof e == "string" || typeof e == "number" || typeof e == "boolean") return e;
2763
2765
  if (e instanceof Date) return e.toISOString();
@@ -2774,7 +2776,7 @@ function Q(e) {
2774
2776
  }
2775
2777
  return String(e);
2776
2778
  }
2777
- function ar(e, t = "USD") {
2779
+ function rr(e, t = "USD") {
2778
2780
  try {
2779
2781
  return new Intl.NumberFormat("en-US", {
2780
2782
  style: "currency",
@@ -2784,7 +2786,7 @@ function ar(e, t = "USD") {
2784
2786
  return `${t} ${e.toFixed(2)}`;
2785
2787
  }
2786
2788
  }
2787
- function or(e, t = "USD") {
2789
+ function ir(e, t = "USD") {
2788
2790
  try {
2789
2791
  return new Intl.NumberFormat("en-US", {
2790
2792
  style: "currency",
@@ -2796,13 +2798,13 @@ function or(e, t = "USD") {
2796
2798
  return `${t} ${e}`;
2797
2799
  }
2798
2800
  }
2799
- function sr(e, t = 0) {
2801
+ function ar(e, t = 0) {
2800
2802
  return `${(e > -1 && e < 1 ? e * 100 : e).toFixed(t)}%`;
2801
2803
  }
2802
- function cr(e) {
2804
+ function or(e) {
2803
2805
  return e.replace(/[_-]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
2804
2806
  }
2805
- function lr(e) {
2807
+ function sr(e) {
2806
2808
  if (!e) return "—";
2807
2809
  let t = typeof e == "string" ? new Date(e) : e;
2808
2810
  if (isNaN(t.getTime())) return "—";
@@ -2812,20 +2814,20 @@ function lr(e) {
2812
2814
  if (a === -1) return "Yesterday";
2813
2815
  if (a < -1) {
2814
2816
  let e = Math.abs(a);
2815
- return e <= 7 ? `Overdue ${e}d` : ur(t);
2817
+ return e <= 7 ? `Overdue ${e}d` : cr(t);
2816
2818
  }
2817
- return a > 1 && a <= 7 ? `In ${a} days` : ur(t);
2819
+ return a > 1 && a <= 7 ? `In ${a} days` : cr(t);
2818
2820
  }
2819
- function ur(e, t) {
2821
+ function cr(e, t) {
2820
2822
  if (!e) return "—";
2821
2823
  let n = typeof e == "string" ? new Date(e) : e;
2822
- return isNaN(n.getTime()) ? "—" : t === "short" ? `${n.toLocaleDateString("en-US", { month: "short" })} ${n.getDate()}, '${String(n.getFullYear()).slice(-2)}` : t === "relative" ? lr(n) : n.toLocaleDateString(void 0, {
2824
+ return isNaN(n.getTime()) ? "—" : t === "short" ? `${n.toLocaleDateString("en-US", { month: "short" })} ${n.getDate()}, '${String(n.getFullYear()).slice(-2)}` : t === "relative" ? sr(n) : n.toLocaleDateString(void 0, {
2823
2825
  year: "numeric",
2824
2826
  month: "short",
2825
2827
  day: "numeric"
2826
2828
  });
2827
2829
  }
2828
- function dr(e) {
2830
+ function lr(e) {
2829
2831
  if (!e) return "—";
2830
2832
  let t = typeof e == "string" ? new Date(e) : e;
2831
2833
  return isNaN(t.getTime()) ? "—" : t.toLocaleDateString(void 0, {
@@ -2836,17 +2838,17 @@ function dr(e) {
2836
2838
  minute: "2-digit"
2837
2839
  });
2838
2840
  }
2839
- function fr({ value: e }) {
2841
+ function ur({ value: e }) {
2840
2842
  let t = Q(e);
2841
- return t == null || t === "" ? /* @__PURE__ */ K(S, {}) : /* @__PURE__ */ K("span", {
2843
+ return t == null || t === "" ? /* @__PURE__ */ q(S, {}) : /* @__PURE__ */ q("span", {
2842
2844
  className: "truncate",
2843
2845
  children: String(t)
2844
2846
  });
2845
2847
  }
2846
- function pr({ value: e, field: t }) {
2847
- if (e == null) return /* @__PURE__ */ K(S, {});
2848
+ function dr({ value: e, field: t }) {
2849
+ if (e == null) return /* @__PURE__ */ q(S, {});
2848
2850
  let n = Q(e), r = t.precision ?? 0, i = Number(n);
2849
- return /* @__PURE__ */ K("span", {
2851
+ return /* @__PURE__ */ q("span", {
2850
2852
  className: "tabular-nums",
2851
2853
  children: isNaN(i) ? String(n) : new Intl.NumberFormat("en-US", {
2852
2854
  minimumFractionDigits: r,
@@ -2854,42 +2856,42 @@ function pr({ value: e, field: t }) {
2854
2856
  }).format(i)
2855
2857
  });
2856
2858
  }
2857
- function mr({ value: e, field: t }) {
2858
- if (e == null) return /* @__PURE__ */ K(S, {});
2859
+ function fr({ value: e, field: t }) {
2860
+ if (e == null) return /* @__PURE__ */ q(S, {});
2859
2861
  let n = Q(e), r = t.currency || "USD", i = Number(n);
2860
- return /* @__PURE__ */ K("span", {
2862
+ return /* @__PURE__ */ q("span", {
2861
2863
  className: "tabular-nums font-medium whitespace-nowrap",
2862
- children: isNaN(i) ? String(n) : ar(i, r)
2864
+ children: isNaN(i) ? String(n) : rr(i, r)
2863
2865
  });
2864
2866
  }
2865
- var hr = /progress|completion/;
2866
- function gr({ value: e, field: t }) {
2867
- if (e == null) return /* @__PURE__ */ K(S, {});
2867
+ var pr = /progress|completion/;
2868
+ function mr({ value: e, field: t }) {
2869
+ if (e == null) return /* @__PURE__ */ q(S, {});
2868
2870
  let n = Q(e), r = t.precision ?? 0, i = Number(n);
2869
- if (isNaN(i)) return /* @__PURE__ */ K("span", {
2871
+ if (isNaN(i)) return /* @__PURE__ */ q("span", {
2870
2872
  className: "tabular-nums whitespace-nowrap",
2871
2873
  children: String(n)
2872
2874
  });
2873
- let a = hr.test(t?.name?.toLowerCase() || ""), o = a ? i : i > -1 && i < 1 ? i * 100 : i, s = a ? `${i.toFixed(r)}%` : sr(i, r), c = Math.max(0, Math.min(100, o));
2874
- return /* @__PURE__ */ q("div", {
2875
+ let a = pr.test(t?.name?.toLowerCase() || ""), o = a ? i : i > -1 && i < 1 ? i * 100 : i, s = a ? `${i.toFixed(r)}%` : ar(i, r), c = Math.max(0, Math.min(100, o));
2876
+ return /* @__PURE__ */ J("div", {
2875
2877
  className: "flex items-center gap-2",
2876
- children: [/* @__PURE__ */ K("div", {
2877
- className: "h-1.5 w-16 rounded-full bg-muted overflow-hidden flex-shrink-0",
2878
+ children: [/* @__PURE__ */ q("div", {
2879
+ className: "h-1.5 w-16 rounded-full bg-muted overflow-hidden shrink-0",
2878
2880
  role: "progressbar",
2879
2881
  "aria-valuenow": c,
2880
2882
  "aria-valuemin": 0,
2881
2883
  "aria-valuemax": 100,
2882
- children: /* @__PURE__ */ K("div", {
2884
+ children: /* @__PURE__ */ q("div", {
2883
2885
  className: "h-full rounded-full bg-primary transition-all",
2884
2886
  style: { width: `${c}%` }
2885
2887
  })
2886
- }), /* @__PURE__ */ K("span", {
2888
+ }), /* @__PURE__ */ q("span", {
2887
2889
  className: "tabular-nums whitespace-nowrap",
2888
2890
  children: s
2889
2891
  })]
2890
2892
  });
2891
2893
  }
2892
- var _r = new Set([
2894
+ var hr = new Set([
2893
2895
  "active",
2894
2896
  "is_active",
2895
2897
  "enabled",
@@ -2897,55 +2899,55 @@ var _r = new Set([
2897
2899
  "verified",
2898
2900
  "is_verified"
2899
2901
  ]);
2900
- function vr({ value: e, field: t }) {
2901
- if (e == null) return /* @__PURE__ */ K("span", {
2902
+ function gr({ value: e, field: t }) {
2903
+ if (e == null) return /* @__PURE__ */ q("span", {
2902
2904
  className: "flex items-center justify-center",
2903
- children: /* @__PURE__ */ K(S, {})
2905
+ children: /* @__PURE__ */ q(S, {})
2904
2906
  });
2905
2907
  let n = t?.name?.toLowerCase() || "";
2906
- return n === "completed" || n === "is_completed" || n === "done" || n === "is_done" ? /* @__PURE__ */ K("div", {
2908
+ return n === "completed" || n === "is_completed" || n === "done" || n === "is_done" ? /* @__PURE__ */ q("div", {
2907
2909
  className: "flex items-center justify-center",
2908
- children: e ? /* @__PURE__ */ K("div", {
2910
+ children: e ? /* @__PURE__ */ q("div", {
2909
2911
  className: "size-5 rounded-full bg-green-500 flex items-center justify-center",
2910
2912
  role: "img",
2911
2913
  "aria-label": "Completed",
2912
2914
  "data-testid": "completion-indicator",
2913
- children: /* @__PURE__ */ K(F, { className: "size-3 text-white" })
2914
- }) : /* @__PURE__ */ K("div", {
2915
+ children: /* @__PURE__ */ q(I, { className: "size-3 text-white" })
2916
+ }) : /* @__PURE__ */ q("div", {
2915
2917
  className: "size-5 rounded-full border-2 border-muted-foreground/30",
2916
2918
  role: "img",
2917
2919
  "aria-label": "Not completed",
2918
2920
  "data-testid": "completion-indicator"
2919
2921
  })
2920
- }) : _r.has(n) && !e ? /* @__PURE__ */ q(m, {
2922
+ }) : hr.has(n) && !e ? /* @__PURE__ */ J(m, {
2921
2923
  variant: "destructive",
2922
2924
  className: "text-xs",
2923
2925
  "data-testid": "boolean-warning-badge",
2924
- children: [t?.label || cr(n), " — Off"]
2925
- }) : /* @__PURE__ */ K("div", {
2926
+ children: [t?.label || or(n), " — Off"]
2927
+ }) : /* @__PURE__ */ q("div", {
2926
2928
  className: "flex items-center justify-center",
2927
- children: /* @__PURE__ */ K(g, {
2929
+ children: /* @__PURE__ */ q(g, {
2928
2930
  checked: !!e,
2929
2931
  disabled: !0,
2930
2932
  className: "pointer-events-none"
2931
2933
  })
2932
2934
  });
2933
2935
  }
2934
- function yr({ value: e, field: t }) {
2935
- if (!e) return /* @__PURE__ */ K(S, {});
2936
- let n = Q(e), r = t, i = ur(n, r.format || "relative"), a = typeof n == "string" ? new Date(n) : n, o = a instanceof Date && !isNaN(a.getTime()), s = /* @__PURE__ */ new Date();
2936
+ function _r({ value: e, field: t }) {
2937
+ if (!e) return /* @__PURE__ */ q(S, {});
2938
+ let n = Q(e), r = t, i = cr(n, r.format || "relative"), a = typeof n == "string" ? new Date(n) : n, o = a instanceof Date && !isNaN(a.getTime()), s = /* @__PURE__ */ new Date();
2937
2939
  s.setHours(0, 0, 0, 0);
2938
2940
  let c = String(r?.name || r?.accessorKey || r?.key || "").toLowerCase(), l = (r?.dueLike === !0 || /(^|_)(due|deadline|expires?|expiry|expiration|expected_close|target_close|sla|return_by|renewal|next_action)(_|$)/.test(c)) && o && a < s, u = o ? a.toISOString() : String(n);
2939
- return /* @__PURE__ */ K("span", {
2941
+ return /* @__PURE__ */ q("span", {
2940
2942
  className: `tabular-nums${l ? " text-red-600" : ""}`,
2941
2943
  title: u,
2942
2944
  children: i
2943
2945
  });
2944
2946
  }
2945
- function br({ value: e }) {
2946
- if (!e) return /* @__PURE__ */ K(S, {});
2947
+ function vr({ value: e }) {
2948
+ if (!e) return /* @__PURE__ */ q(S, {});
2947
2949
  let t = Q(e), n = typeof t == "string" ? new Date(t) : t;
2948
- if (!(n instanceof Date) || isNaN(n.getTime())) return /* @__PURE__ */ K(S, {});
2950
+ if (!(n instanceof Date) || isNaN(n.getTime())) return /* @__PURE__ */ q(S, {});
2949
2951
  let r = n.toLocaleDateString(void 0, {
2950
2952
  month: "numeric",
2951
2953
  day: "numeric",
@@ -2955,15 +2957,15 @@ function br({ value: e }) {
2955
2957
  minute: "2-digit",
2956
2958
  hour12: !0
2957
2959
  }).toLowerCase();
2958
- return /* @__PURE__ */ q("span", {
2960
+ return /* @__PURE__ */ J("span", {
2959
2961
  className: "tabular-nums text-sm whitespace-nowrap",
2960
- children: [/* @__PURE__ */ K("span", { children: r }), /* @__PURE__ */ K("span", {
2962
+ children: [/* @__PURE__ */ q("span", { children: r }), /* @__PURE__ */ q("span", {
2961
2963
  className: "ml-2 text-muted-foreground",
2962
2964
  children: i
2963
2965
  })]
2964
2966
  });
2965
2967
  }
2966
- var xr = {
2968
+ var yr = {
2967
2969
  critical: "red",
2968
2970
  urgent: "red",
2969
2971
  high: "orange",
@@ -2995,7 +2997,7 @@ var xr = {
2995
2997
  overdue: "red",
2996
2998
  delivered: "purple",
2997
2999
  archived: "indigo"
2998
- }, Sr = {
3000
+ }, br = {
2999
3001
  gray: "bg-gray-50 text-gray-700 border-gray-200 dark:bg-gray-800/50 dark:text-gray-200 dark:border-gray-700/60",
3000
3002
  red: "bg-red-50 text-red-700 border-red-200 dark:bg-red-950/40 dark:text-red-300 dark:border-red-900/60",
3001
3003
  orange: "bg-orange-50 text-orange-700 border-orange-200 dark:bg-orange-950/40 dark:text-orange-300 dark:border-orange-900/60",
@@ -3005,7 +3007,7 @@ var xr = {
3005
3007
  indigo: "bg-indigo-50 text-indigo-700 border-indigo-200 dark:bg-indigo-950/40 dark:text-indigo-300 dark:border-indigo-900/60",
3006
3008
  purple: "bg-purple-50 text-purple-700 border-purple-200 dark:bg-purple-950/40 dark:text-purple-300 dark:border-purple-900/60",
3007
3009
  pink: "bg-pink-50 text-pink-700 border-pink-200 dark:bg-pink-950/40 dark:text-pink-300 dark:border-pink-900/60"
3008
- }, Cr = [
3010
+ }, xr = [
3009
3011
  "blue",
3010
3012
  "green",
3011
3013
  "purple",
@@ -3015,53 +3017,53 @@ var xr = {
3015
3017
  "yellow",
3016
3018
  "red"
3017
3019
  ];
3018
- function wr(e) {
3020
+ function Sr(e) {
3019
3021
  let t = 5381;
3020
3022
  for (let n = 0; n < e.length; n++) t = (t << 5) + t ^ e.charCodeAt(n);
3021
- return Cr[Math.abs(t) % Cr.length];
3023
+ return xr[Math.abs(t) % xr.length];
3022
3024
  }
3023
- function Tr(e, t) {
3024
- if (e && Sr[e]) return Sr[e];
3025
+ function Cr(e, t) {
3026
+ if (e && br[e]) return br[e];
3025
3027
  if (t == null || t === "") return "bg-muted text-muted-foreground border-border";
3026
- let n = String(t).toLowerCase().replace(/[\s-]/g, "_"), r = xr[n];
3027
- return r && Sr[r] ? Sr[r] : Sr[wr(n)];
3028
+ let n = String(t).toLowerCase().replace(/[\s-]/g, "_"), r = yr[n];
3029
+ return r && br[r] ? br[r] : br[Sr(n)];
3028
3030
  }
3029
- function Er({ value: e, field: t }) {
3031
+ function wr({ value: e, field: t }) {
3030
3032
  let n = t.options || [];
3031
- if (e == null || e === "") return /* @__PURE__ */ K(S, {});
3032
- if (Array.isArray(e)) return /* @__PURE__ */ K("div", {
3033
+ if (e == null || e === "") return /* @__PURE__ */ q(S, {});
3034
+ if (Array.isArray(e)) return /* @__PURE__ */ q("div", {
3033
3035
  className: "flex flex-wrap gap-1",
3034
3036
  children: e.map((e, t) => {
3035
- let r = n.find((t) => t.value === e), i = r?.label || cr(String(e));
3036
- return /* @__PURE__ */ K(m, {
3037
+ let r = n.find((t) => t.value === e), i = r?.label || or(String(e));
3038
+ return /* @__PURE__ */ q(m, {
3037
3039
  variant: "outline",
3038
- className: Tr(r?.color, e),
3040
+ className: Cr(r?.color, e),
3039
3041
  children: i
3040
3042
  }, t);
3041
3043
  })
3042
3044
  });
3043
- let r = n.find((t) => t.value === e), i = r?.label || cr(String(e));
3044
- return /* @__PURE__ */ K(m, {
3045
+ let r = n.find((t) => t.value === e), i = r?.label || or(String(e));
3046
+ return /* @__PURE__ */ q(m, {
3045
3047
  variant: "outline",
3046
- className: Tr(r?.color, e),
3048
+ className: Cr(r?.color, e),
3047
3049
  children: i
3048
3050
  });
3049
3051
  }
3050
- function Dr({ value: t }) {
3051
- if (!t) return /* @__PURE__ */ K(S, {});
3052
+ function Tr({ value: t }) {
3053
+ if (!t) return /* @__PURE__ */ q(S, {});
3052
3054
  let n = String(Q(t) ?? ""), [r, i] = e.useState(!1);
3053
- return /* @__PURE__ */ q("span", {
3055
+ return /* @__PURE__ */ J("span", {
3054
3056
  className: "inline-flex items-center gap-1 group/email",
3055
- children: [/* @__PURE__ */ K(h, {
3057
+ children: [/* @__PURE__ */ q(h, {
3056
3058
  variant: "link",
3057
3059
  className: "p-0 h-auto font-normal text-blue-600 hover:text-blue-800",
3058
3060
  asChild: !0,
3059
- children: /* @__PURE__ */ K("a", {
3061
+ children: /* @__PURE__ */ q("a", {
3060
3062
  href: `mailto:${n}`,
3061
3063
  onClick: (e) => e.stopPropagation(),
3062
3064
  children: n
3063
3065
  })
3064
- }), /* @__PURE__ */ K("button", {
3066
+ }), /* @__PURE__ */ q("button", {
3065
3067
  type: "button",
3066
3068
  className: "opacity-0 group-hover/email:opacity-100 transition-opacity p-0.5 rounded hover:bg-muted",
3067
3069
  onClick: (e) => {
@@ -3070,18 +3072,18 @@ function Dr({ value: t }) {
3070
3072
  }).catch(() => {});
3071
3073
  },
3072
3074
  "aria-label": "Copy email",
3073
- children: r ? /* @__PURE__ */ K(F, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ K(I, { className: "h-3 w-3 text-muted-foreground" })
3075
+ children: r ? /* @__PURE__ */ q(I, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ q(L, { className: "h-3 w-3 text-muted-foreground" })
3074
3076
  })]
3075
3077
  });
3076
3078
  }
3077
- function Or({ value: e }) {
3078
- if (!e) return /* @__PURE__ */ K(S, {});
3079
+ function Er({ value: e }) {
3080
+ if (!e) return /* @__PURE__ */ q(S, {});
3079
3081
  let t = String(Q(e) ?? "");
3080
- return /* @__PURE__ */ K(h, {
3082
+ return /* @__PURE__ */ q(h, {
3081
3083
  variant: "link",
3082
3084
  className: "p-0 h-auto font-normal text-blue-600 hover:text-blue-800",
3083
3085
  asChild: !0,
3084
- children: /* @__PURE__ */ K("a", {
3086
+ children: /* @__PURE__ */ q("a", {
3085
3087
  href: t,
3086
3088
  target: "_blank",
3087
3089
  rel: "noopener noreferrer",
@@ -3090,17 +3092,17 @@ function Or({ value: e }) {
3090
3092
  })
3091
3093
  });
3092
3094
  }
3093
- function kr({ value: t }) {
3094
- if (!t) return /* @__PURE__ */ K(S, {});
3095
+ function Dr({ value: t }) {
3096
+ if (!t) return /* @__PURE__ */ q(S, {});
3095
3097
  let n = String(Q(t) ?? ""), [r, i] = e.useState(!1);
3096
- return /* @__PURE__ */ q("span", {
3098
+ return /* @__PURE__ */ J("span", {
3097
3099
  className: "inline-flex items-center gap-1 group/phone",
3098
- children: [/* @__PURE__ */ q("a", {
3100
+ children: [/* @__PURE__ */ J("a", {
3099
3101
  href: `tel:${n}`,
3100
3102
  className: "inline-flex items-center gap-1 text-blue-600 hover:text-blue-800",
3101
3103
  onClick: (e) => e.stopPropagation(),
3102
- children: [/* @__PURE__ */ K(Se, { className: "h-3 w-3" }), n]
3103
- }), /* @__PURE__ */ K("button", {
3104
+ children: [/* @__PURE__ */ q(xe, { className: "h-3 w-3" }), n]
3105
+ }), /* @__PURE__ */ q("button", {
3104
3106
  type: "button",
3105
3107
  className: "opacity-0 group-hover/phone:opacity-100 transition-opacity p-0.5 rounded hover:bg-muted",
3106
3108
  onClick: (e) => {
@@ -3109,15 +3111,15 @@ function kr({ value: t }) {
3109
3111
  }).catch(() => {});
3110
3112
  },
3111
3113
  "aria-label": "Copy phone number",
3112
- children: r ? /* @__PURE__ */ K(F, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ K(I, { className: "h-3 w-3 text-muted-foreground" })
3114
+ children: r ? /* @__PURE__ */ q(I, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ q(L, { className: "h-3 w-3 text-muted-foreground" })
3113
3115
  })]
3114
3116
  });
3115
3117
  }
3116
- function Ar({ value: e, field: t }) {
3117
- if (!e) return /* @__PURE__ */ K(S, {});
3118
+ function Or({ value: e, field: t }) {
3119
+ if (!e) return /* @__PURE__ */ q(S, {});
3118
3120
  if (t.multiple, Array.isArray(e)) {
3119
3121
  let t = e.length;
3120
- return /* @__PURE__ */ q("span", {
3122
+ return /* @__PURE__ */ J("span", {
3121
3123
  className: "text-sm text-gray-600",
3122
3124
  children: [
3123
3125
  t,
@@ -3126,30 +3128,30 @@ function Ar({ value: e, field: t }) {
3126
3128
  ]
3127
3129
  });
3128
3130
  }
3129
- return /* @__PURE__ */ K("span", {
3131
+ return /* @__PURE__ */ q("span", {
3130
3132
  className: "text-sm truncate",
3131
3133
  children: e.name || e.original_name || "File"
3132
3134
  });
3133
3135
  }
3134
- function jr({ value: e }) {
3135
- return e ? Array.isArray(e) ? /* @__PURE__ */ q("div", {
3136
+ function kr({ value: e }) {
3137
+ return e ? Array.isArray(e) ? /* @__PURE__ */ J("div", {
3136
3138
  className: "flex -space-x-2",
3137
- children: [e.slice(0, 3).map((e, t) => /* @__PURE__ */ K("img", {
3139
+ children: [e.slice(0, 3).map((e, t) => /* @__PURE__ */ q("img", {
3138
3140
  src: e.url || "",
3139
3141
  alt: e.name || `Image ${t + 1}`,
3140
3142
  className: "size-8 rounded-md border-2 border-white object-cover"
3141
- }, t)), e.length > 3 && /* @__PURE__ */ q("div", {
3143
+ }, t)), e.length > 3 && /* @__PURE__ */ J("div", {
3142
3144
  className: "size-8 rounded-md border-2 border-white bg-gray-100 flex items-center justify-center text-xs font-medium text-gray-600",
3143
3145
  children: ["+", e.length - 3]
3144
3146
  })]
3145
- }) : /* @__PURE__ */ K("img", {
3147
+ }) : /* @__PURE__ */ q("img", {
3146
3148
  src: e.url || "",
3147
3149
  alt: e.name || "Image",
3148
3150
  className: "size-10 rounded-md object-cover"
3149
- }) : /* @__PURE__ */ K(S, {});
3151
+ }) : /* @__PURE__ */ q(S, {});
3150
3152
  }
3151
- function Mr({ value: e, field: t }) {
3152
- if (e == null || e === "") return /* @__PURE__ */ K(S, {});
3153
+ function Ar({ value: e, field: t }) {
3154
+ if (e == null || e === "") return /* @__PURE__ */ q(S, {});
3153
3155
  let n = t.options || [], r = (e) => {
3154
3156
  if (n.length > 0) {
3155
3157
  let t = n.find((t) => String(t.value) === String(e));
@@ -3157,124 +3159,124 @@ function Mr({ value: e, field: t }) {
3157
3159
  }
3158
3160
  return String(e);
3159
3161
  };
3160
- return Array.isArray(e) ? /* @__PURE__ */ K("div", {
3162
+ return Array.isArray(e) ? /* @__PURE__ */ q("div", {
3161
3163
  className: "flex flex-wrap gap-1",
3162
3164
  children: e.map((e, t) => {
3163
3165
  let n;
3164
- return n = typeof e == "object" && e ? e.name || e.label || e.id || e._id || String(e) : r(e), /* @__PURE__ */ K("span", {
3166
+ return n = typeof e == "object" && e ? e.name || e.label || e.id || e._id || String(e) : r(e), /* @__PURE__ */ q("span", {
3165
3167
  className: "inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-50 text-gray-700 dark:bg-gray-800/50 dark:text-gray-200",
3166
3168
  children: n
3167
3169
  }, t);
3168
3170
  })
3169
- }) : typeof e == "object" && e ? /* @__PURE__ */ K("span", {
3171
+ }) : typeof e == "object" && e ? /* @__PURE__ */ q("span", {
3170
3172
  className: "truncate",
3171
3173
  children: e.name || e.label || e.id || e._id || "[Object]"
3172
- }) : /* @__PURE__ */ K("span", {
3174
+ }) : /* @__PURE__ */ q("span", {
3173
3175
  className: "truncate",
3174
3176
  children: r(e)
3175
3177
  });
3176
3178
  }
3177
- function Nr({ value: e }) {
3179
+ function jr({ value: e }) {
3178
3180
  let t = Q(e);
3179
- return t == null || t === "" ? /* @__PURE__ */ K(S, {}) : /* @__PURE__ */ K("span", {
3181
+ return t == null || t === "" ? /* @__PURE__ */ q(S, {}) : /* @__PURE__ */ q("span", {
3180
3182
  className: "text-gray-700 font-mono text-sm",
3181
3183
  children: String(t)
3182
3184
  });
3183
3185
  }
3184
- function Pr({ value: e }) {
3185
- if (!e) return /* @__PURE__ */ K(S, {});
3186
- if (typeof e != "object") return /* @__PURE__ */ K("span", {
3186
+ function Mr({ value: e }) {
3187
+ if (!e) return /* @__PURE__ */ q(S, {});
3188
+ if (typeof e != "object") return /* @__PURE__ */ q("span", {
3187
3189
  className: "truncate",
3188
3190
  children: String(e)
3189
3191
  });
3190
- if (Array.isArray(e)) return /* @__PURE__ */ q("div", {
3192
+ if (Array.isArray(e)) return /* @__PURE__ */ J("div", {
3191
3193
  className: "flex -space-x-2",
3192
3194
  children: [e.slice(0, 3).map((e, t) => {
3193
- if (typeof e != "object" || !e) return /* @__PURE__ */ K("span", {
3195
+ if (typeof e != "object" || !e) return /* @__PURE__ */ q("span", {
3194
3196
  className: "truncate text-sm",
3195
3197
  children: String(e)
3196
3198
  }, t);
3197
3199
  let n = e.name || e.username || "User";
3198
- return /* @__PURE__ */ K(d, {
3200
+ return /* @__PURE__ */ q(d, {
3199
3201
  className: "size-8 border-2 border-white",
3200
3202
  title: n,
3201
- children: /* @__PURE__ */ K(f, {
3203
+ children: /* @__PURE__ */ q(f, {
3202
3204
  className: "bg-blue-500 text-white text-xs",
3203
3205
  children: n.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2)
3204
3206
  })
3205
3207
  }, t);
3206
- }), e.length > 3 && /* @__PURE__ */ K(d, {
3208
+ }), e.length > 3 && /* @__PURE__ */ q(d, {
3207
3209
  className: "size-8 border-2 border-white",
3208
- children: /* @__PURE__ */ q(f, {
3210
+ children: /* @__PURE__ */ J(f, {
3209
3211
  className: "bg-gray-200 text-gray-600 text-xs",
3210
3212
  children: ["+", e.length - 3]
3211
3213
  })
3212
3214
  })]
3213
3215
  });
3214
3216
  let t = e.name || e.username || "User";
3215
- return /* @__PURE__ */ q("div", {
3217
+ return /* @__PURE__ */ J("div", {
3216
3218
  className: "flex items-center gap-2",
3217
- children: [/* @__PURE__ */ K(d, {
3219
+ children: [/* @__PURE__ */ q(d, {
3218
3220
  className: "size-8",
3219
- children: /* @__PURE__ */ K(f, {
3221
+ children: /* @__PURE__ */ q(f, {
3220
3222
  className: "bg-blue-500 text-white text-xs",
3221
3223
  children: t.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2)
3222
3224
  })
3223
- }), /* @__PURE__ */ K("span", {
3225
+ }), /* @__PURE__ */ q("span", {
3224
3226
  className: "truncate",
3225
3227
  children: t
3226
3228
  })]
3227
3229
  });
3228
3230
  }
3229
- var Fr = /* @__PURE__ */ new Map();
3230
- function Ir(e, t) {
3231
- Fr.set(e, t);
3232
- }
3233
- function Lr(e) {
3234
- return Fr.has(e) ? Fr.get(e) : {
3235
- text: fr,
3236
- textarea: fr,
3237
- markdown: fr,
3238
- html: fr,
3239
- number: pr,
3240
- currency: mr,
3241
- percent: gr,
3242
- boolean: vr,
3243
- date: yr,
3244
- datetime: br,
3245
- time: fr,
3246
- select: Er,
3247
- status: Er,
3248
- lookup: Mr,
3249
- master_detail: Mr,
3250
- email: Dr,
3251
- url: Or,
3252
- phone: kr,
3253
- file: Ar,
3254
- image: jr,
3255
- formula: Nr,
3256
- summary: Nr,
3257
- auto_number: fr,
3258
- user: Pr,
3259
- owner: Pr,
3260
- password: () => /* @__PURE__ */ K("span", { children: "••••••" }),
3261
- location: fr,
3262
- object: () => /* @__PURE__ */ K("span", {
3231
+ var Nr = /* @__PURE__ */ new Map();
3232
+ function Pr(e, t) {
3233
+ Nr.set(e, t);
3234
+ }
3235
+ function Fr(e) {
3236
+ return Nr.has(e) ? Nr.get(e) : {
3237
+ text: ur,
3238
+ textarea: ur,
3239
+ markdown: ur,
3240
+ html: ur,
3241
+ number: dr,
3242
+ currency: fr,
3243
+ percent: mr,
3244
+ boolean: gr,
3245
+ date: _r,
3246
+ datetime: vr,
3247
+ time: ur,
3248
+ select: wr,
3249
+ status: wr,
3250
+ lookup: Ar,
3251
+ master_detail: Ar,
3252
+ email: Tr,
3253
+ url: Er,
3254
+ phone: Dr,
3255
+ file: Or,
3256
+ image: kr,
3257
+ formula: jr,
3258
+ summary: jr,
3259
+ auto_number: ur,
3260
+ user: Mr,
3261
+ owner: Mr,
3262
+ password: () => /* @__PURE__ */ q("span", { children: "••••••" }),
3263
+ location: ur,
3264
+ object: () => /* @__PURE__ */ q("span", {
3263
3265
  className: "text-gray-500 italic",
3264
3266
  children: "[Object]"
3265
3267
  }),
3266
- vector: () => /* @__PURE__ */ K("span", {
3268
+ vector: () => /* @__PURE__ */ q("span", {
3267
3269
  className: "text-gray-500 italic",
3268
3270
  children: "[Vector]"
3269
3271
  }),
3270
- grid: () => /* @__PURE__ */ K("span", {
3272
+ grid: () => /* @__PURE__ */ q("span", {
3271
3273
  className: "text-gray-500 italic",
3272
3274
  children: "[Grid]"
3273
3275
  })
3274
- }[e] || fr;
3276
+ }[e] || ur;
3275
3277
  }
3276
- Ir("lookup", Mr), Ir("master_detail", Mr), Ir("select", Er), Ir("status", Er), Ir("user", Pr), Ir("owner", Pr), Tt(Lr);
3277
- function Rr(e) {
3278
+ Pr("lookup", Ar), Pr("master_detail", Ar), Pr("select", wr), Pr("status", wr), Pr("user", Mr), Pr("owner", Mr), Tt(Fr);
3279
+ function Ir(e) {
3278
3280
  return {
3279
3281
  text: "field:text",
3280
3282
  textarea: "field:textarea",
@@ -3302,7 +3304,7 @@ function Rr(e) {
3302
3304
  auto_number: "field:auto_number"
3303
3305
  }[e] || "field:text";
3304
3306
  }
3305
- function zr(e) {
3307
+ function Lr(e) {
3306
3308
  if (e < 0 || !Number.isFinite(e) || e === 0) return "0 B";
3307
3309
  let t = [
3308
3310
  "B",
@@ -3314,7 +3316,7 @@ function zr(e) {
3314
3316
  for (; n >= 1024 && r < t.length - 1;) n /= 1024, r++;
3315
3317
  return `${n.toFixed(+(r > 0))} ${t[r]}`;
3316
3318
  }
3317
- function Br(e) {
3319
+ function Rr(e) {
3318
3320
  let t = {};
3319
3321
  return e.required && (t.required = typeof e.required_message == "string" ? e.required_message : `${e.label || e.name} is required`), e.min_length && (t.minLength = {
3320
3322
  value: e.min_length,
@@ -3339,7 +3341,7 @@ function Br(e) {
3339
3341
  message: "Please enter a valid URL"
3340
3342
  }), e.validate && (t.validate = e.validate), Object.keys(t).length > 0 ? t : void 0;
3341
3343
  }
3342
- function Vr(e, t) {
3344
+ function zr(e, t) {
3343
3345
  if (!e) return !0;
3344
3346
  if (e.field && e.value !== void 0) {
3345
3347
  let n = t[e.field];
@@ -3351,7 +3353,7 @@ function Vr(e, t) {
3351
3353
  if (e.operator === "<=") return n <= e.value;
3352
3354
  if (e.operator === "in") return Array.isArray(e.value) && e.value.includes(n);
3353
3355
  }
3354
- return e.and && Array.isArray(e.and) ? e.and.every((e) => Vr(e, t)) : e.or && Array.isArray(e.or) ? e.or.some((e) => Vr(e, t)) : !0;
3356
+ return e.and && Array.isArray(e.and) ? e.and.every((e) => zr(e, t)) : e.or && Array.isArray(e.or) ? e.or.some((e) => zr(e, t)) : !0;
3355
3357
  }
3356
3358
  function $(t) {
3357
3359
  let n = ({ schema: n, className: r, value: i, ...a }) => {
@@ -3369,24 +3371,24 @@ function $(t) {
3369
3371
  }, l = e.useCallback((e) => {
3370
3372
  s(e), a.onChange && a.onChange(e);
3371
3373
  }, [a]), u = n?.readonly || n?.readOnly || !1;
3372
- return /* @__PURE__ */ q("div", {
3374
+ return /* @__PURE__ */ J("div", {
3373
3375
  className: "grid w-full items-center gap-1.5",
3374
3376
  "data-obj-id": n?.id,
3375
3377
  "data-obj-type": n?.type,
3376
3378
  children: [
3377
- n?.label && /* @__PURE__ */ K("label", {
3379
+ n?.label && /* @__PURE__ */ q("label", {
3378
3380
  htmlFor: n.id,
3379
3381
  className: n.required ? "after:content-['*'] after:ml-0.5 after:text-red-500" : "",
3380
3382
  children: n.label
3381
3383
  }),
3382
- /* @__PURE__ */ K(t, {
3384
+ /* @__PURE__ */ q(t, {
3383
3385
  value: o,
3384
3386
  onChange: l,
3385
3387
  field: c,
3386
3388
  readonly: u,
3387
3389
  className: r
3388
3390
  }),
3389
- n?.description && /* @__PURE__ */ K("p", {
3391
+ n?.description && /* @__PURE__ */ q("p", {
3390
3392
  className: "text-sm text-gray-500",
3391
3393
  children: n.description
3392
3394
  })
@@ -3395,11 +3397,11 @@ function $(t) {
3395
3397
  };
3396
3398
  return n.displayName = `FieldRenderer(${t.displayName || t.name || "Component"})`, n;
3397
3399
  }
3398
- var Hr = {
3399
- text: () => Promise.resolve().then(() => (Ie(), Pe)).then((e) => ({ default: e.TextField })),
3400
+ var Br = {
3401
+ text: () => Promise.resolve().then(() => (Fe(), Ne)).then((e) => ({ default: e.TextField })),
3400
3402
  textarea: () => Promise.resolve().then(() => (ft(), ut)).then((e) => ({ default: e.TextAreaField })),
3401
- number: () => Promise.resolve().then(() => (ze(), Le)).then((e) => ({ default: e.NumberField })),
3402
- boolean: () => Promise.resolve().then(() => (Ve(), Be)).then((e) => ({ default: e.BooleanField })),
3403
+ number: () => Promise.resolve().then(() => (Re(), Ie)).then((e) => ({ default: e.NumberField })),
3404
+ boolean: () => Promise.resolve().then(() => (Ve(), ze)).then((e) => ({ default: e.BooleanField })),
3403
3405
  select: () => Promise.resolve().then(() => (qe(), Ge)).then((e) => ({ default: e.SelectField })),
3404
3406
  date: () => Promise.resolve().then(() => (Xe(), Je)).then((e) => ({ default: e.DateField })),
3405
3407
  datetime: () => Promise.resolve().then(() => (Rt(), It)).then((e) => ({ default: e.DateTimeField })),
@@ -3413,7 +3415,7 @@ var Hr = {
3413
3415
  markdown: () => Promise.resolve().then(() => (ht(), pt)).then((e) => ({ default: e.RichTextField })),
3414
3416
  html: () => Promise.resolve().then(() => (ht(), pt)).then((e) => ({ default: e.RichTextField })),
3415
3417
  lookup: () => Promise.resolve().then(() => (Ft(), kt)).then((e) => ({ default: e.LookupField })),
3416
- master_detail: () => Promise.resolve().then(() => (ir(), nr)).then((e) => ({ default: e.MasterDetailField })),
3418
+ master_detail: () => Promise.resolve().then(() => (Ft(), kt)).then((e) => ({ default: e.LookupField })),
3417
3419
  file: () => Promise.resolve().then(() => (Xt(), Jt)).then((e) => ({ default: e.FileField })),
3418
3420
  image: () => Promise.resolve().then(() => (rn(), en)).then((e) => ({ default: e.ImageField })),
3419
3421
  location: () => Promise.resolve().then(() => (sn(), an)).then((e) => ({ default: e.LocationField })),
@@ -3435,8 +3437,8 @@ var Hr = {
3435
3437
  signature: () => Promise.resolve().then(() => (Qn(), Xn)).then((e) => ({ default: e.SignatureField })),
3436
3438
  qrcode: () => Promise.resolve().then(() => (tr(), $n)).then((e) => ({ default: e.QRCodeField }))
3437
3439
  };
3438
- function Ur(t) {
3439
- let n = Hr[t];
3440
+ function Vr(t) {
3441
+ let n = Br[t];
3440
3442
  if (!n) {
3441
3443
  console.warn(`Unknown field type: ${t}`);
3442
3444
  return;
@@ -3444,14 +3446,14 @@ function Ur(t) {
3444
3446
  let r = e.lazy(n);
3445
3447
  u.register(t, r, { namespace: "field" });
3446
3448
  }
3447
- function Wr() {
3448
- Object.keys(Hr).forEach((e) => {
3449
- Ur(e);
3449
+ function Hr() {
3450
+ Object.keys(Br).forEach((e) => {
3451
+ Vr(e);
3450
3452
  });
3451
3453
  }
3452
- function Gr() {
3453
- u.register("text", $(Fe), { namespace: "field" }), u.register("textarea", $(dt), { namespace: "field" }), u.register("number", $(Re), { namespace: "field" }), u.register("boolean", $(Z), { namespace: "field" }), u.register("select", $(Ke), { namespace: "field" }), u.register("date", $(Ye), { namespace: "field" }), u.register("datetime", $(Lt), { namespace: "field" }), u.register("time", $(Bt), { namespace: "field" }), u.register("email", $(Qe), { namespace: "field" }), u.register("phone", $(tt), { namespace: "field" }), u.register("url", $(it), { namespace: "field" }), u.register("currency", $(ct), { namespace: "field" }), u.register("percent", $(Ut), { namespace: "field" }), u.register("password", $(Kt), { namespace: "field" }), u.register("markdown", $(mt), { namespace: "field" }), u.register("html", $(mt), { namespace: "field" }), u.register("lookup", $(Mt), { namespace: "field" }), u.register("master_detail", $(rr), { namespace: "field" }), u.register("file", $(Yt), { namespace: "field" }), u.register("image", $(tn), { namespace: "field" }), u.register("location", $(on), { namespace: "field" }), u.register("formula", $(ln), { namespace: "field" }), u.register("summary", $(fn), { namespace: "field" }), u.register("auto_number", $(hn), { namespace: "field" }), u.register("user", $(vn), { namespace: "field" }), u.register("owner", $(vn), { namespace: "field" }), u.register("object", $(xn), { namespace: "field" }), u.register("vector", $(wn), { namespace: "field" }), u.register("grid", $(Dn), { namespace: "field" }), u.register("color", $(An), { namespace: "field" }), u.register("slider", $(Nn), { namespace: "field" }), u.register("rating", $(In), { namespace: "field" }), u.register("code", $(zn), { namespace: "field" }), u.register("avatar", $(Hn), { namespace: "field" }), u.register("address", $(Gn), { namespace: "field" }), u.register("geolocation", $(Jn), { namespace: "field" }), u.register("signature", $(Zn), { namespace: "field" }), u.register("qrcode", $(er), { namespace: "field" });
3454
+ function Ur() {
3455
+ u.register("text", $(Pe), { namespace: "field" }), u.register("textarea", $(dt), { namespace: "field" }), u.register("number", $(Le), { namespace: "field" }), u.register("boolean", $(Be), { namespace: "field" }), u.register("select", $(Ke), { namespace: "field" }), u.register("date", $(Ye), { namespace: "field" }), u.register("datetime", $(Lt), { namespace: "field" }), u.register("time", $(Bt), { namespace: "field" }), u.register("email", $(Qe), { namespace: "field" }), u.register("phone", $(tt), { namespace: "field" }), u.register("url", $(it), { namespace: "field" }), u.register("currency", $(ct), { namespace: "field" }), u.register("percent", $(Ut), { namespace: "field" }), u.register("password", $(Kt), { namespace: "field" }), u.register("markdown", $(mt), { namespace: "field" }), u.register("html", $(mt), { namespace: "field" }), u.register("lookup", $(Mt), { namespace: "field" }), u.register("master_detail", $(Mt), { namespace: "field" }), u.register("file", $(Yt), { namespace: "field" }), u.register("image", $(tn), { namespace: "field" }), u.register("location", $(on), { namespace: "field" }), u.register("formula", $(ln), { namespace: "field" }), u.register("summary", $(fn), { namespace: "field" }), u.register("auto_number", $(hn), { namespace: "field" }), u.register("user", $(vn), { namespace: "field" }), u.register("owner", $(vn), { namespace: "field" }), u.register("object", $(xn), { namespace: "field" }), u.register("vector", $(wn), { namespace: "field" }), u.register("grid", $(Dn), { namespace: "field" }), u.register("color", $(An), { namespace: "field" }), u.register("slider", $(Nn), { namespace: "field" }), u.register("rating", $(In), { namespace: "field" }), u.register("code", $(zn), { namespace: "field" }), u.register("avatar", $(Hn), { namespace: "field" }), u.register("address", $(Gn), { namespace: "field" }), u.register("geolocation", $(Jn), { namespace: "field" }), u.register("signature", $(Zn), { namespace: "field" }), u.register("qrcode", $(er), { namespace: "field" });
3454
3456
  }
3455
- Wr();
3457
+ Hr();
3456
3458
  //#endregion
3457
- export { Gn as AddressField, hn as AutoNumberField, Hn as AvatarField, vr as BooleanCellRenderer, Z as BooleanField, zn as CodeField, An as ColorField, mr as CurrencyCellRenderer, ct as CurrencyField, yr as DateCellRenderer, Ye as DateField, br as DateTimeCellRenderer, Lt as DateTimeField, Dr as EmailCellRenderer, Qe as EmailField, Ar as FileCellRenderer, Yt as FileField, Nr as FormulaCellRenderer, ln as FormulaField, Jn as GeolocationField, Dn as GridField, jr as ImageCellRenderer, Qt as ImageCropperDialog, tn as ImageField, on as LocationField, Mr as LookupCellRenderer, Mt as LookupField, rr as MasterDetailField, pr as NumberCellRenderer, Re as NumberField, xn as ObjectField, Kt as PasswordField, gr as PercentCellRenderer, Ut as PercentField, kr as PhoneCellRenderer, tt as PhoneField, er as QRCodeField, In as RatingField, bt as RecordPickerDialog, mt as RichTextField, Er as SelectCellRenderer, Ke as SelectField, Zn as SignatureField, Nn as SliderField, fn as SummaryField, dt as TextAreaField, fr as TextCellRenderer, Fe as TextField, Bt as TimeField, Or as UrlCellRenderer, it as UrlField, Pr as UserCellRenderer, vn as UserField, wn as VectorField, Br as buildValidationRules, Q as coerceToSafeValue, Vr as evaluateCondition, or as formatCompactCurrency, ar as formatCurrency, ur as formatDate, dr as formatDateTime, zr as formatFileSize, sr as formatPercent, lr as formatRelativeDate, Lr as getCellRenderer, cr as humanizeLabel, Rr as mapFieldTypeToFormType, Wr as registerAllFields, Ur as registerField, Ir as registerFieldRenderer, Gr as registerFields };
3459
+ export { Gn as AddressField, hn as AutoNumberField, Hn as AvatarField, gr as BooleanCellRenderer, Be as BooleanField, zn as CodeField, An as ColorField, fr as CurrencyCellRenderer, ct as CurrencyField, _r as DateCellRenderer, Ye as DateField, vr as DateTimeCellRenderer, Lt as DateTimeField, Tr as EmailCellRenderer, Qe as EmailField, Or as FileCellRenderer, Yt as FileField, jr as FormulaCellRenderer, ln as FormulaField, Jn as GeolocationField, Dn as GridField, kr as ImageCellRenderer, Qt as ImageCropperDialog, tn as ImageField, on as LocationField, Ar as LookupCellRenderer, Mt as LookupField, nr as MasterDetailField, dr as NumberCellRenderer, Le as NumberField, xn as ObjectField, Kt as PasswordField, mr as PercentCellRenderer, Ut as PercentField, Dr as PhoneCellRenderer, tt as PhoneField, er as QRCodeField, In as RatingField, bt as RecordPickerDialog, mt as RichTextField, wr as SelectCellRenderer, Ke as SelectField, Zn as SignatureField, Nn as SliderField, fn as SummaryField, dt as TextAreaField, ur as TextCellRenderer, Pe as TextField, Bt as TimeField, Er as UrlCellRenderer, it as UrlField, Mr as UserCellRenderer, vn as UserField, wn as VectorField, Rr as buildValidationRules, Q as coerceToSafeValue, zr as evaluateCondition, ir as formatCompactCurrency, rr as formatCurrency, cr as formatDate, lr as formatDateTime, Lr as formatFileSize, ar as formatPercent, sr as formatRelativeDate, Fr as getCellRenderer, or as humanizeLabel, Ir as mapFieldTypeToFormType, Hr as registerAllFields, Vr as registerField, Pr as registerFieldRenderer, Ur as registerFields };