@object-ui/fields 3.1.2 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,69 +1,69 @@
1
- import k, { useId as vt, useState as B, useRef as xe, useCallback as te, useEffect as ze } from "react";
2
- import { ComponentRegistry as g } from "@object-ui/core";
3
- import { Textarea as Z, Input as w, Checkbox as Ee, Label as E, Switch as _t, Select as wt, SelectTrigger as Ft, SelectValue as St, SelectContent as Ct, SelectItem as Pt, Badge as M, Dialog as Tt, DialogTrigger as Ot, Button as P, DialogContent as Rt, DialogHeader as kt, DialogTitle as At, Slider as De, Avatar as L, AvatarFallback as I, cn as z, AvatarImage as ve } from "@object-ui/components";
4
- import { X as W, Search as $t, EyeOff as zt, Eye as Et, Upload as Me, ImageIcon as Dt, File as Mt, Image as Lt, Star as _e, MapPin as we, Crosshair as It, Eraser as Ut, QrCode as Fe, Copy as pe, ExternalLink as Se, Plus as Vt, Check as he, Phone as Bt } from "lucide-react";
5
- var re = { exports: {} }, H = {};
6
- var Ce;
7
- function Yt() {
8
- if (Ce) return H;
9
- Ce = 1;
1
+ import E, { useId as Pt, useState as I, useRef as fe, useContext as Rt, useMemo as kt, useEffect as le, useCallback as W } from "react";
2
+ import { ComponentRegistry as y } from "@object-ui/core";
3
+ import { Textarea as xe, Input as T, Checkbox as Be, Label as G, Switch as At, Select as $t, SelectTrigger as zt, SelectValue as Et, SelectContent as Dt, SelectItem as Mt, Badge as Z, Dialog as Lt, DialogTrigger as It, Button as P, DialogContent as Ut, DialogHeader as Vt, DialogTitle as Bt, Slider as Ye, Avatar as ee, AvatarFallback as te, cn as B, AvatarImage as Te } from "@object-ui/components";
4
+ import { X as ie, Search as Oe, Loader2 as Pe, AlertCircle as Yt, Plus as je, EyeOff as qt, Eye as Jt, Upload as qe, ImageIcon as Wt, File as Gt, Image as Qt, Star as Re, MapPin as ke, Crosshair as Ht, Eraser as Xt, QrCode as Ae, Copy as Se, ExternalLink as $e, Check as Fe, Phone as Kt } from "lucide-react";
5
+ var pe = { exports: {} }, ue = {};
6
+ var ze;
7
+ function Zt() {
8
+ if (ze) return ue;
9
+ ze = 1;
10
10
  var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), r = /* @__PURE__ */ Symbol.for("react.fragment");
11
- function n(a, s, i) {
12
- var l = null;
13
- if (i !== void 0 && (l = "" + i), s.key !== void 0 && (l = "" + s.key), "key" in s) {
14
- i = {};
15
- for (var o in s)
16
- o !== "key" && (i[o] = s[o]);
17
- } else i = s;
18
- return s = i.ref, {
11
+ function s(l, n, a) {
12
+ var i = null;
13
+ if (a !== void 0 && (i = "" + a), n.key !== void 0 && (i = "" + n.key), "key" in n) {
14
+ a = {};
15
+ for (var o in n)
16
+ o !== "key" && (a[o] = n[o]);
17
+ } else a = n;
18
+ return n = a.ref, {
19
19
  $$typeof: e,
20
- type: a,
21
- key: l,
22
- ref: s !== void 0 ? s : null,
23
- props: i
20
+ type: l,
21
+ key: i,
22
+ ref: n !== void 0 ? n : null,
23
+ props: a
24
24
  };
25
25
  }
26
- return H.Fragment = r, H.jsx = n, H.jsxs = n, H;
26
+ return ue.Fragment = r, ue.jsx = s, ue.jsxs = s, ue;
27
27
  }
28
- var X = {};
29
- var Pe;
30
- function qt() {
31
- return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && (function() {
28
+ var me = {};
29
+ var Ee;
30
+ function er() {
31
+ return Ee || (Ee = 1, process.env.NODE_ENV !== "production" && (function() {
32
32
  function e(d) {
33
33
  if (d == null) return null;
34
34
  if (typeof d == "function")
35
- return d.$$typeof === Y ? null : d.displayName || d.name || null;
35
+ return d.$$typeof === q ? null : d.displayName || d.name || null;
36
36
  if (typeof d == "string") return d;
37
37
  switch (d) {
38
- case R:
38
+ case k:
39
39
  return "Fragment";
40
- case T:
40
+ case M:
41
41
  return "Profiler";
42
- case N:
42
+ case D:
43
43
  return "StrictMode";
44
44
  case b:
45
45
  return "Suspense";
46
- case F:
46
+ case w:
47
47
  return "SuspenseList";
48
- case O:
48
+ case C:
49
49
  return "Activity";
50
50
  }
51
51
  if (typeof d == "object")
52
52
  switch (typeof d.tag == "number" && console.error(
53
53
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
54
54
  ), d.$$typeof) {
55
- case v:
55
+ case _:
56
56
  return "Portal";
57
- case Q:
57
+ case re:
58
58
  return d.displayName || "Context";
59
- case U:
59
+ case Q:
60
60
  return (d._context.displayName || "Context") + ".Consumer";
61
- case K:
61
+ case U:
62
62
  var j = d.render;
63
63
  return d = d.displayName, d || (d = j.displayName || j.name || "", d = d !== "" ? "ForwardRef(" + d + ")" : "ForwardRef"), d;
64
64
  case A:
65
65
  return j = d.displayName || null, j !== null ? j : e(d.type) || "Memo";
66
- case $:
66
+ case R:
67
67
  j = d._payload, d = d._init;
68
68
  try {
69
69
  return e(d(j));
@@ -75,7 +75,7 @@ function qt() {
75
75
  function r(d) {
76
76
  return "" + d;
77
77
  }
78
- function n(d) {
78
+ function s(d) {
79
79
  try {
80
80
  r(d);
81
81
  var j = !1;
@@ -84,17 +84,17 @@ function qt() {
84
84
  }
85
85
  if (j) {
86
86
  j = console;
87
- var _ = j.error, S = typeof Symbol == "function" && Symbol.toStringTag && d[Symbol.toStringTag] || d.constructor.name || "Object";
88
- return _.call(
87
+ var F = j.error, S = typeof Symbol == "function" && Symbol.toStringTag && d[Symbol.toStringTag] || d.constructor.name || "Object";
88
+ return F.call(
89
89
  j,
90
90
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
91
91
  S
92
92
  ), r(d);
93
93
  }
94
94
  }
95
- function a(d) {
96
- if (d === R) return "<>";
97
- if (typeof d == "object" && d !== null && d.$$typeof === $)
95
+ function l(d) {
96
+ if (d === k) return "<>";
97
+ if (typeof d == "object" && d !== null && d.$$typeof === R)
98
98
  return "<...>";
99
99
  try {
100
100
  var j = e(d);
@@ -103,47 +103,47 @@ function qt() {
103
103
  return "<...>";
104
104
  }
105
105
  }
106
- function s() {
107
- var d = q.A;
106
+ function n() {
107
+ var d = J.A;
108
108
  return d === null ? null : d.getOwner();
109
109
  }
110
- function i() {
110
+ function a() {
111
111
  return Error("react-stack-top-frame");
112
112
  }
113
- function l(d) {
114
- if (V.call(d, "key")) {
113
+ function i(d) {
114
+ if (L.call(d, "key")) {
115
115
  var j = Object.getOwnPropertyDescriptor(d, "key").get;
116
116
  if (j && j.isReactWarning) return !1;
117
117
  }
118
118
  return d.key !== void 0;
119
119
  }
120
120
  function o(d, j) {
121
- function _() {
122
- ge || (ge = !0, console.error(
121
+ function F() {
122
+ H || (H = !0, console.error(
123
123
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
124
124
  j
125
125
  ));
126
126
  }
127
- _.isReactWarning = !0, Object.defineProperty(d, "key", {
128
- get: _,
127
+ F.isReactWarning = !0, Object.defineProperty(d, "key", {
128
+ get: F,
129
129
  configurable: !0
130
130
  });
131
131
  }
132
132
  function c() {
133
133
  var d = e(this.type);
134
- return be[d] || (be[d] = !0, console.error(
134
+ return V[d] || (V[d] = !0, console.error(
135
135
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
136
136
  )), d = this.props.ref, d !== void 0 ? d : null;
137
137
  }
138
- function m(d, j, _, S, ee, ie) {
139
- var C = _.ref;
138
+ function m(d, j, F, S, X, de) {
139
+ var O = F.ref;
140
140
  return d = {
141
- $$typeof: h,
141
+ $$typeof: g,
142
142
  type: d,
143
143
  key: j,
144
- props: _,
144
+ props: F,
145
145
  _owner: S
146
- }, (C !== void 0 ? C : null) !== null ? Object.defineProperty(d, "ref", {
146
+ }, (O !== void 0 ? O : null) !== null ? Object.defineProperty(d, "ref", {
147
147
  enumerable: !1,
148
148
  get: c
149
149
  }) : Object.defineProperty(d, "ref", { enumerable: !1, value: null }), d._store = {}, Object.defineProperty(d._store, "validated", {
@@ -160,33 +160,33 @@ function qt() {
160
160
  configurable: !1,
161
161
  enumerable: !1,
162
162
  writable: !0,
163
- value: ee
163
+ value: X
164
164
  }), Object.defineProperty(d, "_debugTask", {
165
165
  configurable: !1,
166
166
  enumerable: !1,
167
167
  writable: !0,
168
- value: ie
168
+ value: de
169
169
  }), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
170
170
  }
171
- function p(d, j, _, S, ee, ie) {
172
- var C = j.children;
173
- if (C !== void 0)
171
+ function p(d, j, F, S, X, de) {
172
+ var O = j.children;
173
+ if (O !== void 0)
174
174
  if (S)
175
- if (yt(C)) {
176
- for (S = 0; S < C.length; S++)
177
- f(C[S]);
178
- Object.freeze && Object.freeze(C);
175
+ if (Ce(O)) {
176
+ for (S = 0; S < O.length; S++)
177
+ f(O[S]);
178
+ Object.freeze && Object.freeze(O);
179
179
  } else
180
180
  console.error(
181
181
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
182
182
  );
183
- else f(C);
184
- if (V.call(j, "key")) {
185
- C = e(d);
186
- var J = Object.keys(j).filter(function(Nt) {
187
- return Nt !== "key";
183
+ else f(O);
184
+ if (L.call(j, "key")) {
185
+ O = e(d);
186
+ var h = Object.keys(j).filter(function($) {
187
+ return $ !== "key";
188
188
  });
189
- S = 0 < J.length ? "{key: someKey, " + J.join(": ..., ") + ": ...}" : "{key: someKey}", Ne[C + S] || (J = 0 < J.length ? "{" + J.join(": ..., ") + ": ...}" : "{}", console.error(
189
+ S = 0 < h.length ? "{key: someKey, " + h.join(": ..., ") + ": ...}" : "{key: someKey}", z[O + S] || (h = 0 < h.length ? "{" + h.join(": ..., ") + ": ...}" : "{}", console.error(
190
190
  `A props object containing a "key" prop is being spread into JSX:
191
191
  let props = %s;
192
192
  <%s {...props} />
@@ -194,35 +194,35 @@ React keys must be passed directly to JSX without using spread:
194
194
  let props = %s;
195
195
  <%s key={someKey} {...props} />`,
196
196
  S,
197
- C,
198
- J,
199
- C
200
- ), Ne[C + S] = !0);
197
+ O,
198
+ h,
199
+ O
200
+ ), z[O + S] = !0);
201
201
  }
202
- if (C = null, _ !== void 0 && (n(_), C = "" + _), l(j) && (n(j.key), C = "" + j.key), "key" in j) {
203
- _ = {};
204
- for (var oe in j)
205
- oe !== "key" && (_[oe] = j[oe]);
206
- } else _ = j;
207
- return C && o(
208
- _,
202
+ if (O = null, F !== void 0 && (s(F), O = "" + F), i(j) && (s(j.key), O = "" + j.key), "key" in j) {
203
+ F = {};
204
+ for (var N in j)
205
+ N !== "key" && (F[N] = j[N]);
206
+ } else F = j;
207
+ return O && o(
208
+ F,
209
209
  typeof d == "function" ? d.displayName || d.name || "Unknown" : d
210
210
  ), m(
211
211
  d,
212
- C,
213
- _,
214
- s(),
215
- ee,
216
- ie
212
+ O,
213
+ F,
214
+ n(),
215
+ X,
216
+ de
217
217
  );
218
218
  }
219
219
  function f(d) {
220
- u(d) ? d._store && (d._store.validated = 1) : typeof d == "object" && d !== null && d.$$typeof === $ && (d._payload.status === "fulfilled" ? u(d._payload.value) && d._payload.value._store && (d._payload.value._store.validated = 1) : d._store && (d._store.validated = 1));
220
+ u(d) ? d._store && (d._store.validated = 1) : typeof d == "object" && d !== null && d.$$typeof === R && (d._payload.status === "fulfilled" ? u(d._payload.value) && d._payload.value._store && (d._payload.value._store.validated = 1) : d._store && (d._store.validated = 1));
221
221
  }
222
222
  function u(d) {
223
- return typeof d == "object" && d !== null && d.$$typeof === h;
223
+ return typeof d == "object" && d !== null && d.$$typeof === g;
224
224
  }
225
- var x = k, h = /* @__PURE__ */ Symbol.for("react.transitional.element"), v = /* @__PURE__ */ Symbol.for("react.portal"), R = /* @__PURE__ */ Symbol.for("react.fragment"), N = /* @__PURE__ */ Symbol.for("react.strict_mode"), T = /* @__PURE__ */ Symbol.for("react.profiler"), U = /* @__PURE__ */ Symbol.for("react.consumer"), Q = /* @__PURE__ */ Symbol.for("react.context"), K = /* @__PURE__ */ Symbol.for("react.forward_ref"), b = /* @__PURE__ */ Symbol.for("react.suspense"), F = /* @__PURE__ */ Symbol.for("react.suspense_list"), A = /* @__PURE__ */ Symbol.for("react.memo"), $ = /* @__PURE__ */ Symbol.for("react.lazy"), O = /* @__PURE__ */ Symbol.for("react.activity"), Y = /* @__PURE__ */ Symbol.for("react.client.reference"), q = x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, yt = Array.isArray, le = console.createTask ? console.createTask : function() {
225
+ var x = E, g = /* @__PURE__ */ Symbol.for("react.transitional.element"), _ = /* @__PURE__ */ Symbol.for("react.portal"), k = /* @__PURE__ */ Symbol.for("react.fragment"), D = /* @__PURE__ */ Symbol.for("react.strict_mode"), M = /* @__PURE__ */ Symbol.for("react.profiler"), Q = /* @__PURE__ */ Symbol.for("react.consumer"), re = /* @__PURE__ */ Symbol.for("react.context"), U = /* @__PURE__ */ Symbol.for("react.forward_ref"), b = /* @__PURE__ */ Symbol.for("react.suspense"), w = /* @__PURE__ */ Symbol.for("react.suspense_list"), A = /* @__PURE__ */ Symbol.for("react.memo"), R = /* @__PURE__ */ Symbol.for("react.lazy"), C = /* @__PURE__ */ Symbol.for("react.activity"), q = /* @__PURE__ */ Symbol.for("react.client.reference"), J = x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, L = Object.prototype.hasOwnProperty, Ce = Array.isArray, ce = console.createTask ? console.createTask : function() {
226
226
  return null;
227
227
  };
228
228
  x = {
@@ -230,74 +230,74 @@ React keys must be passed directly to JSX without using spread:
230
230
  return d();
231
231
  }
232
232
  };
233
- var ge, be = {}, je = x.react_stack_bottom_frame.bind(
233
+ var H, V = {}, se = x.react_stack_bottom_frame.bind(
234
234
  x,
235
- i
236
- )(), ye = le(a(i)), Ne = {};
237
- X.Fragment = R, X.jsx = function(d, j, _) {
238
- var S = 1e4 > q.recentlyCreatedOwnerStacks++;
235
+ a
236
+ )(), ne = ce(l(a)), z = {};
237
+ me.Fragment = k, me.jsx = function(d, j, F) {
238
+ var S = 1e4 > J.recentlyCreatedOwnerStacks++;
239
239
  return p(
240
240
  d,
241
241
  j,
242
- _,
242
+ F,
243
243
  !1,
244
- S ? Error("react-stack-top-frame") : je,
245
- S ? le(a(d)) : ye
244
+ S ? Error("react-stack-top-frame") : se,
245
+ S ? ce(l(d)) : ne
246
246
  );
247
- }, X.jsxs = function(d, j, _) {
248
- var S = 1e4 > q.recentlyCreatedOwnerStacks++;
247
+ }, me.jsxs = function(d, j, F) {
248
+ var S = 1e4 > J.recentlyCreatedOwnerStacks++;
249
249
  return p(
250
250
  d,
251
251
  j,
252
- _,
252
+ F,
253
253
  !0,
254
- S ? Error("react-stack-top-frame") : je,
255
- S ? le(a(d)) : ye
254
+ S ? Error("react-stack-top-frame") : se,
255
+ S ? ce(l(d)) : ne
256
256
  );
257
257
  };
258
- })()), X;
258
+ })()), me;
259
259
  }
260
- var Te;
261
- function Jt() {
262
- return Te || (Te = 1, process.env.NODE_ENV === "production" ? re.exports = Yt() : re.exports = qt()), re.exports;
260
+ var De;
261
+ function tr() {
262
+ return De || (De = 1, process.env.NODE_ENV === "production" ? pe.exports = Zt() : pe.exports = er()), pe.exports;
263
263
  }
264
- var t = Jt();
265
- function Le({ value: e, onChange: r, field: n, readonly: a, ...s }) {
266
- const i = n || s.schema;
267
- if (a)
264
+ var t = tr();
265
+ function Je({ value: e, onChange: r, field: s, readonly: l, ...n }) {
266
+ const a = s || n.schema;
267
+ if (l)
268
268
  return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: e || "-" });
269
- const l = i?.rows, { inputType: o, ...c } = s;
270
- return l && l > 1 ? /* @__PURE__ */ t.jsx(
271
- Z,
269
+ const i = a?.rows, { inputType: o, ...c } = n;
270
+ return i && i > 1 ? /* @__PURE__ */ t.jsx(
271
+ xe,
272
272
  {
273
273
  ...c,
274
274
  value: e || "",
275
275
  onChange: (m) => r(m.target.value),
276
- placeholder: i?.placeholder,
277
- disabled: a || c.disabled
276
+ placeholder: a?.placeholder,
277
+ disabled: l || c.disabled
278
278
  }
279
279
  ) : /* @__PURE__ */ t.jsx(
280
- w,
280
+ T,
281
281
  {
282
282
  ...c,
283
- type: i?.type === "password" ? "password" : "text",
283
+ type: a?.type === "password" ? "password" : "text",
284
284
  value: e || "",
285
285
  onChange: (m) => r(m.target.value),
286
- placeholder: i?.placeholder,
287
- disabled: a || c.disabled
286
+ placeholder: a?.placeholder,
287
+ disabled: l || c.disabled
288
288
  }
289
289
  );
290
290
  }
291
- const Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
291
+ const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
292
292
  __proto__: null,
293
- TextField: Le
293
+ TextField: Je
294
294
  }, Symbol.toStringTag, { value: "Module" }));
295
- function Ie({ value: e, onChange: r, field: n, readonly: a, ...s }) {
296
- if (a)
295
+ function We({ value: e, onChange: r, field: s, readonly: l, ...n }) {
296
+ if (l)
297
297
  return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: e ?? "-" });
298
- const i = n || s.schema, l = i?.precision, { inputType: o, ...c } = s;
298
+ const a = s || n.schema, i = a?.precision, { inputType: o, ...c } = n;
299
299
  return /* @__PURE__ */ t.jsx(
300
- w,
300
+ T,
301
301
  {
302
302
  ...c,
303
303
  type: "number",
@@ -306,97 +306,97 @@ function Ie({ value: e, onChange: r, field: n, readonly: a, ...s }) {
306
306
  const p = m.target.value;
307
307
  r(p === "" ? null : Number(p));
308
308
  },
309
- placeholder: i?.placeholder,
310
- disabled: a || c.disabled,
311
- step: l ? Math.pow(10, -l) : "any"
309
+ placeholder: a?.placeholder,
310
+ disabled: l || c.disabled,
311
+ step: i ? Math.pow(10, -i) : "any"
312
312
  }
313
313
  );
314
314
  }
315
- const Gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
315
+ const sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
316
316
  __proto__: null,
317
- NumberField: Ie
317
+ NumberField: We
318
318
  }, Symbol.toStringTag, { value: "Module" }));
319
- function Ue({ value: e, onChange: r, field: n, readonly: a, ...s }) {
320
- const i = n || s.schema, l = i?.widget, o = vt(), c = i?.name || o, m = i?.label || "Checkbox";
321
- if (a)
319
+ function Ge({ value: e, onChange: r, field: s, readonly: l, ...n }) {
320
+ const a = s || n.schema, i = a?.widget, o = Pt(), c = a?.name || o, m = a?.label || "Checkbox";
321
+ if (l)
322
322
  return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: e ? "Yes" : "No" });
323
- const { inputType: p, ...f } = s;
324
- return l === "checkbox" ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-2", children: [
323
+ const { inputType: p, ...f } = n;
324
+ return i === "checkbox" ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-2", children: [
325
325
  /* @__PURE__ */ t.jsx(
326
- Ee,
326
+ Be,
327
327
  {
328
328
  ...f,
329
329
  id: c,
330
330
  checked: !!e,
331
331
  onCheckedChange: (u) => r(!!u),
332
- disabled: a || f.disabled
332
+ disabled: l || f.disabled
333
333
  }
334
334
  ),
335
- /* @__PURE__ */ t.jsx(E, { htmlFor: c, children: m })
335
+ /* @__PURE__ */ t.jsx(G, { htmlFor: c, children: m })
336
336
  ] }) : /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-2", children: [
337
337
  /* @__PURE__ */ t.jsx(
338
- _t,
338
+ At,
339
339
  {
340
340
  ...f,
341
341
  id: c,
342
342
  checked: !!e,
343
343
  onCheckedChange: r,
344
- disabled: a || f.disabled
344
+ disabled: l || f.disabled
345
345
  }
346
346
  ),
347
- /* @__PURE__ */ t.jsx(E, { htmlFor: c, children: m })
347
+ /* @__PURE__ */ t.jsx(G, { htmlFor: c, children: m })
348
348
  ] });
349
349
  }
350
- const Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
350
+ const nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
351
351
  __proto__: null,
352
- BooleanField: Ue
352
+ BooleanField: Ge
353
353
  }, Symbol.toStringTag, { value: "Module" }));
354
- function Ve({ value: e, onChange: r, field: n, readonly: a, ...s }) {
355
- const i = n || s.schema, l = i?.options || [];
356
- if (a) {
357
- const o = l.find((c) => c.value === e);
354
+ function Qe({ value: e, onChange: r, field: s, readonly: l, ...n }) {
355
+ const a = s || n.schema, i = a?.options || [];
356
+ if (l) {
357
+ const o = i.find((c) => c.value === e);
358
358
  return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: o?.label || e || "-" });
359
359
  }
360
360
  return /* @__PURE__ */ t.jsxs(
361
- wt,
361
+ $t,
362
362
  {
363
- ...s,
363
+ ...n,
364
364
  value: e,
365
365
  onValueChange: r,
366
- disabled: a || s.disabled,
366
+ disabled: l || n.disabled,
367
367
  children: [
368
- /* @__PURE__ */ t.jsx(Ft, { className: s.className, id: s.id, children: /* @__PURE__ */ t.jsx(St, { placeholder: i?.placeholder || "Select an option" }) }),
369
- /* @__PURE__ */ t.jsx(Ct, { position: "popper", children: l.map((o) => /* @__PURE__ */ t.jsx(Pt, { value: o.value, children: o.label }, o.value)) })
368
+ /* @__PURE__ */ t.jsx(zt, { className: n.className, id: n.id, children: /* @__PURE__ */ t.jsx(Et, { placeholder: a?.placeholder || "Select an option" }) }),
369
+ /* @__PURE__ */ t.jsx(Dt, { position: "popper", children: i.map((o) => /* @__PURE__ */ t.jsx(Mt, { value: o.value, children: o.label }, o.value)) })
370
370
  ]
371
371
  }
372
372
  );
373
373
  }
374
- const Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
374
+ const ar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
375
375
  __proto__: null,
376
- SelectField: Ve
376
+ SelectField: Qe
377
377
  }, Symbol.toStringTag, { value: "Module" }));
378
- function Be({ value: e, onChange: r, field: n, readonly: a, ...s }) {
379
- if (a)
378
+ function He({ value: e, onChange: r, field: s, readonly: l, ...n }) {
379
+ if (l)
380
380
  return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: e ? new Date(e).toLocaleDateString() : "-" });
381
- const { inputType: i, ...l } = s;
381
+ const { inputType: a, ...i } = n;
382
382
  return /* @__PURE__ */ t.jsx(
383
- w,
383
+ T,
384
384
  {
385
- ...l,
385
+ ...i,
386
386
  type: "date",
387
387
  value: e || "",
388
388
  onChange: (o) => r(o.target.value),
389
- disabled: a || l.disabled
389
+ disabled: l || i.disabled
390
390
  }
391
391
  );
392
392
  }
393
- const Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
393
+ const lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
394
394
  __proto__: null,
395
- DateField: Be
395
+ DateField: He
396
396
  }, Symbol.toStringTag, { value: "Module" }));
397
- function Ye({ value: e, onChange: r, field: n, readonly: a, errorMessage: s, ...i }) {
398
- const l = n || i.schema;
399
- if (a)
397
+ function Xe({ value: e, onChange: r, field: s, readonly: l, errorMessage: n, ...a }) {
398
+ const i = s || a.schema;
399
+ if (l)
400
400
  return e ? /* @__PURE__ */ t.jsx(
401
401
  "a",
402
402
  {
@@ -405,27 +405,27 @@ function Ye({ value: e, onChange: r, field: n, readonly: a, errorMessage: s, ...
405
405
  children: e
406
406
  }
407
407
  ) : /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" });
408
- const { inputType: o, ...c } = i;
408
+ const { inputType: o, ...c } = a;
409
409
  return /* @__PURE__ */ t.jsx(
410
- w,
410
+ T,
411
411
  {
412
412
  ...c,
413
413
  type: "email",
414
414
  value: e || "",
415
415
  onChange: (m) => r(m.target.value),
416
- placeholder: l?.placeholder || "email@example.com",
417
- disabled: a || c.disabled,
418
- "aria-invalid": !!s
416
+ placeholder: i?.placeholder || "email@example.com",
417
+ disabled: l || c.disabled,
418
+ "aria-invalid": !!n
419
419
  }
420
420
  );
421
421
  }
422
- const Zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
422
+ const ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
423
423
  __proto__: null,
424
- EmailField: Ye
424
+ EmailField: Xe
425
425
  }, Symbol.toStringTag, { value: "Module" }));
426
- function qe({ value: e, onChange: r, field: n, readonly: a, errorMessage: s, ...i }) {
427
- const l = n || i.schema;
428
- if (a)
426
+ function Ke({ value: e, onChange: r, field: s, readonly: l, errorMessage: n, ...a }) {
427
+ const i = s || a.schema;
428
+ if (l)
429
429
  return e ? /* @__PURE__ */ t.jsx(
430
430
  "a",
431
431
  {
@@ -434,27 +434,27 @@ function qe({ value: e, onChange: r, field: n, readonly: a, errorMessage: s, ...
434
434
  children: e
435
435
  }
436
436
  ) : /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" });
437
- const { inputType: o, ...c } = i;
437
+ const { inputType: o, ...c } = a;
438
438
  return /* @__PURE__ */ t.jsx(
439
- w,
439
+ T,
440
440
  {
441
441
  ...c,
442
442
  type: "tel",
443
443
  value: e || "",
444
444
  onChange: (m) => r(m.target.value),
445
- placeholder: l?.placeholder || "(555) 123-4567",
446
- disabled: a || c.disabled,
447
- "aria-invalid": !!s
445
+ placeholder: i?.placeholder || "(555) 123-4567",
446
+ disabled: l || c.disabled,
447
+ "aria-invalid": !!n
448
448
  }
449
449
  );
450
450
  }
451
- const Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
451
+ const or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
452
452
  __proto__: null,
453
- PhoneField: qe
453
+ PhoneField: Ke
454
454
  }, Symbol.toStringTag, { value: "Module" }));
455
- function Je({ value: e, onChange: r, field: n, readonly: a, errorMessage: s, ...i }) {
456
- const l = n || i.schema;
457
- if (a)
455
+ function Ze({ value: e, onChange: r, field: s, readonly: l, errorMessage: n, ...a }) {
456
+ const i = s || a.schema;
457
+ if (l)
458
458
  return e ? e.startsWith("http://") || e.startsWith("https://") ? /* @__PURE__ */ t.jsx(
459
459
  "a",
460
460
  {
@@ -465,25 +465,25 @@ function Je({ value: e, onChange: r, field: n, readonly: a, errorMessage: s, ...
465
465
  children: e
466
466
  }
467
467
  ) : /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: e }) : /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" });
468
- const { inputType: o, ...c } = i;
468
+ const { inputType: o, ...c } = a;
469
469
  return /* @__PURE__ */ t.jsx(
470
- w,
470
+ T,
471
471
  {
472
472
  ...c,
473
473
  type: "url",
474
474
  value: e || "",
475
475
  onChange: (m) => r(m.target.value),
476
- placeholder: l?.placeholder || "https://example.com",
477
- disabled: a || c.disabled,
478
- "aria-invalid": !!s
476
+ placeholder: i?.placeholder || "https://example.com",
477
+ disabled: l || c.disabled,
478
+ "aria-invalid": !!n
479
479
  }
480
480
  );
481
481
  }
482
- const er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
482
+ const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
483
483
  __proto__: null,
484
- UrlField: Je
484
+ UrlField: Ze
485
485
  }, Symbol.toStringTag, { value: "Module" }));
486
- function tr(e, r = "USD") {
486
+ function dr(e, r = "USD") {
487
487
  try {
488
488
  return new Intl.NumberFormat("en-US", {
489
489
  style: "currency",
@@ -493,10 +493,10 @@ function tr(e, r = "USD") {
493
493
  return `${r} ${e.toFixed(2)}`;
494
494
  }
495
495
  }
496
- function We({ value: e, onChange: r, field: n, readonly: a, errorMessage: s, className: i, ...l }) {
497
- const o = n || l.schema, c = o?.currency || "USD", m = o?.precision ?? 2;
498
- if (a)
499
- return e == null ? /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" }) : /* @__PURE__ */ t.jsx("span", { className: "text-sm font-medium tabular-nums", children: tr(Number(e), c) });
496
+ function et({ value: e, onChange: r, field: s, readonly: l, errorMessage: n, className: a, ...i }) {
497
+ const o = s || i.schema, c = o?.currency || "USD", m = o?.precision ?? 2;
498
+ if (l)
499
+ return e == null ? /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" }) : /* @__PURE__ */ t.jsx("span", { className: "text-sm font-medium tabular-nums", children: dr(Number(e), c) });
500
500
  const p = (f) => {
501
501
  const u = parseFloat(f.target.value);
502
502
  isNaN(u) || r(parseFloat(u.toFixed(m)));
@@ -504,9 +504,9 @@ function We({ value: e, onChange: r, field: n, readonly: a, errorMessage: s, cla
504
504
  return /* @__PURE__ */ t.jsxs("div", { className: "relative", children: [
505
505
  /* @__PURE__ */ t.jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500", children: c === "USD" ? "$" : c }),
506
506
  /* @__PURE__ */ t.jsx(
507
- w,
507
+ T,
508
508
  {
509
- ...l,
509
+ ...i,
510
510
  type: "number",
511
511
  value: e ?? "",
512
512
  onChange: (f) => {
@@ -515,34 +515,34 @@ function We({ value: e, onChange: r, field: n, readonly: a, errorMessage: s, cla
515
515
  },
516
516
  onBlur: p,
517
517
  placeholder: o?.placeholder || "0.00",
518
- disabled: a || l.disabled,
519
- className: `pl-8 ${i || ""}`,
518
+ disabled: l || i.disabled,
519
+ className: `pl-8 ${a || ""}`,
520
520
  step: Math.pow(10, -m).toFixed(m),
521
- "aria-invalid": !!s
521
+ "aria-invalid": !!n
522
522
  }
523
523
  )
524
524
  ] });
525
525
  }
526
- const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
526
+ const ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
527
527
  __proto__: null,
528
- CurrencyField: We
528
+ CurrencyField: et
529
529
  }, Symbol.toStringTag, { value: "Module" }));
530
- function Ge({ value: e, onChange: r, field: n, readonly: a, errorMessage: s, ...i }) {
531
- if (a)
530
+ function tt({ value: e, onChange: r, field: s, readonly: l, errorMessage: n, ...a }) {
531
+ if (l)
532
532
  return /* @__PURE__ */ t.jsx("div", { className: "text-sm whitespace-pre-wrap", children: e || "-" });
533
- const l = n || i.schema, o = l?.rows || 4, c = l?.max_length, { inputType: m, ...p } = i;
533
+ const i = s || a.schema, o = i?.rows || 4, c = i?.max_length, { inputType: m, ...p } = a;
534
534
  return /* @__PURE__ */ t.jsxs("div", { className: "relative", children: [
535
535
  /* @__PURE__ */ t.jsx(
536
- Z,
536
+ xe,
537
537
  {
538
538
  ...p,
539
539
  value: e || "",
540
540
  onChange: (f) => r(f.target.value),
541
- placeholder: l?.placeholder,
542
- disabled: a || p.disabled,
541
+ placeholder: i?.placeholder,
542
+ disabled: l || p.disabled,
543
543
  rows: o,
544
544
  maxLength: c,
545
- "aria-invalid": !!s
545
+ "aria-invalid": !!n
546
546
  }
547
547
  ),
548
548
  c && /* @__PURE__ */ t.jsxs(
@@ -560,12 +560,12 @@ function Ge({ value: e, onChange: r, field: n, readonly: a, errorMessage: s, ...
560
560
  )
561
561
  ] });
562
562
  }
563
- const sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
563
+ const mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
564
564
  __proto__: null,
565
- TextAreaField: Ge
565
+ TextAreaField: tt
566
566
  }, Symbol.toStringTag, { value: "Module" }));
567
- function ce({ value: e, onChange: r, field: n, readonly: a, errorMessage: s, ...i }) {
568
- if (a)
567
+ function ye({ value: e, onChange: r, field: s, readonly: l, errorMessage: n, ...a }) {
568
+ if (l)
569
569
  return /* @__PURE__ */ t.jsx(
570
570
  "div",
571
571
  {
@@ -573,7 +573,7 @@ function ce({ value: e, onChange: r, field: n, readonly: a, errorMessage: s, ...
573
573
  children: e || "-"
574
574
  }
575
575
  );
576
- const l = n || i.schema, o = l?.rows || 8, c = l?.format || "markdown";
576
+ const i = s || a.schema, o = i?.rows || 8, c = i?.format || "markdown";
577
577
  return /* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
578
578
  /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between text-xs text-gray-500", children: [
579
579
  /* @__PURE__ */ t.jsxs("span", { children: [
@@ -583,119 +583,262 @@ function ce({ value: e, onChange: r, field: n, readonly: a, errorMessage: s, ...
583
583
  /* @__PURE__ */ t.jsx("span", { className: "italic", children: "Rich text editor (basic)" })
584
584
  ] }),
585
585
  /* @__PURE__ */ t.jsx(
586
- Z,
586
+ xe,
587
587
  {
588
588
  value: e || "",
589
589
  onChange: (m) => r(m.target.value),
590
- placeholder: l?.placeholder || "Enter text...",
591
- disabled: a || i.disabled,
590
+ placeholder: i?.placeholder || "Enter text...",
591
+ disabled: l || a.disabled,
592
592
  rows: o,
593
- className: `font-mono text-sm ${i.className || ""}`,
594
- "aria-invalid": !!s
593
+ className: `font-mono text-sm ${a.className || ""}`,
594
+ "aria-invalid": !!n
595
595
  }
596
596
  )
597
597
  ] });
598
598
  }
599
- const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
599
+ const Me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
600
600
  __proto__: null,
601
- RichTextField: ce
602
- }, Symbol.toStringTag, { value: "Module" }));
603
- function Qe({ value: e, onChange: r, field: n, readonly: a, ...s }) {
604
- const [i, l] = B(!1), [o, c] = B(""), m = n || s.schema, p = m?.options || [], f = m.multiple || !1, u = m.display_field || "label", x = p.filter(
605
- (N) => N.label.toLowerCase().includes(o.toLowerCase())
606
- ), h = f ? (Array.isArray(e) ? e : []).map(
607
- (N) => p.find((T) => T.value === N)
608
- ).filter(Boolean) : e ? [p.find((N) => N.value === e)].filter(Boolean) : [], v = (N) => {
609
- if (f) {
610
- const T = Array.isArray(e) ? e : [], U = T.includes(N.value);
611
- r(U ? T.filter((Q) => Q !== N.value) : [...T, N.value]);
612
- } else
613
- r(N.value), l(!1);
614
- }, R = (N) => {
615
- if (f) {
616
- const T = Array.isArray(e) ? e : [];
617
- r(T.filter((U) => U !== N));
601
+ RichTextField: ye
602
+ }, Symbol.toStringTag, { value: "Module" })), fr = 50, xr = E.createContext(null);
603
+ let rt = xr;
604
+ try {
605
+ const e = require("@object-ui/react");
606
+ e.SchemaRendererContext && (rt = e.SchemaRendererContext);
607
+ } catch {
608
+ }
609
+ function pr(e, r, s, l) {
610
+ const n = e[s] ?? e.id ?? e._id, a = e[r] ?? e.label ?? e.name ?? String(n), i = l ? e[l] : void 0;
611
+ return { value: n, label: String(a), description: i, ...e };
612
+ }
613
+ function st({ value: e, onChange: r, field: s, readonly: l, ...n }) {
614
+ const [a, i] = I(!1), [o, c] = I(""), [m, p] = I([]), [f, u] = I(!1), [x, g] = I(null), [_, k] = I(0), D = fe(null), [M, Q] = I(-1), re = fe(null), U = s || n.schema, b = U?.field, w = b && typeof b == "object" && ("reference_to" in b || "reference" in b || "type" in b) ? b : U, A = w?.options || [], R = w?.multiple || !1, C = w?.display_field || w?.reference_field || "name", q = w?.description_field, J = w?.id_field || "id", L = w?.reference_to || w?.reference, ce = Rt(rt)?.dataSource ?? null, H = n.dataSource ?? U?.dataSource ?? w?.dataSource ?? ce, V = H != null && typeof H.find == "function" && !!L, se = n.onCreateNew ?? U?.onCreateNew, ne = V ? m : A, z = kt(() => {
615
+ if (V || !o) return ne;
616
+ const h = o.toLowerCase();
617
+ return ne.filter(
618
+ (N) => N.label.toLowerCase().includes(h) || N.description && N.description.toLowerCase().includes(h)
619
+ );
620
+ }, [V, ne, o]);
621
+ le(() => {
622
+ Q(-1);
623
+ }, [z.length]);
624
+ const d = W(
625
+ async (h) => {
626
+ if (!(!H || !L)) {
627
+ u(!0), g(null);
628
+ try {
629
+ const N = {
630
+ $top: fr
631
+ };
632
+ h && h.trim() && (N.$search = h.trim());
633
+ const $ = await H.find(L, N), ae = $?.data ?? $ ?? [], Tt = ae.map((Ot) => pr(Ot, C, J, q));
634
+ p(Tt), k($?.total ?? ae.length);
635
+ } catch (N) {
636
+ const $ = N instanceof Error ? N.message : String(N);
637
+ g($), p([]);
638
+ } finally {
639
+ u(!1);
640
+ }
641
+ }
642
+ },
643
+ [H, L, C, J, q]
644
+ );
645
+ le(() => {
646
+ a && V && d(o || void 0), a || (c(""), g(null), Q(-1));
647
+ }, [a]);
648
+ const j = W(
649
+ (h) => {
650
+ c(h), V && (D.current && clearTimeout(D.current), D.current = setTimeout(() => {
651
+ d(h || void 0);
652
+ }, 300));
653
+ },
654
+ [V, d]
655
+ );
656
+ le(() => () => {
657
+ D.current && clearTimeout(D.current);
658
+ }, []);
659
+ const F = W(
660
+ (h) => A.find((N) => N.value === h) ?? m.find((N) => N.value === h),
661
+ [A, m]
662
+ ), S = R ? (Array.isArray(e) ? e : []).map(F).filter(Boolean) : e ? [F(e)].filter(Boolean) : [], X = W(
663
+ (h) => {
664
+ if (R) {
665
+ const N = Array.isArray(e) ? e : [], $ = N.includes(h.value);
666
+ r($ ? N.filter((ae) => ae !== h.value) : [...N, h.value]);
667
+ } else
668
+ r(h.value), i(!1);
669
+ },
670
+ [R, e, r]
671
+ ), de = (h) => {
672
+ if (R) {
673
+ const N = Array.isArray(e) ? e : [];
674
+ r(N.filter(($) => $ !== h));
618
675
  } else
619
676
  r(null);
620
- };
621
- return a ? h.length ? f ? /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-1", children: h.map((N, T) => /* @__PURE__ */ t.jsx(M, { variant: "outline", children: N?.[u] || N?.label }, T)) }) : /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: h[0]?.[u] || h[0]?.label }) : /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" }) : /* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
622
- h.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-1", children: h.map((N, T) => /* @__PURE__ */ t.jsxs(
623
- M,
677
+ }, O = W(
678
+ (h) => {
679
+ h.key === "ArrowDown" ? (h.preventDefault(), Q(
680
+ (N) => N < z.length - 1 ? N + 1 : N
681
+ )) : h.key === "ArrowUp" ? (h.preventDefault(), Q((N) => N > 0 ? N - 1 : 0)) : h.key === "Enter" && (h.preventDefault(), M >= 0 && M < z.length && X(z[M]));
682
+ },
683
+ [z, M, X]
684
+ );
685
+ return le(() => {
686
+ M >= 0 && re.current && re.current.querySelector(`[data-lookup-index="${M}"]`)?.scrollIntoView({ block: "nearest" });
687
+ }, [M]), l ? S.length ? R ? /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-1", children: S.map((h, N) => /* @__PURE__ */ t.jsx(Z, { variant: "outline", children: h?.[C] || h?.label }, N)) }) : /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: S[0]?.[C] || S[0]?.label }) : /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" }) : /* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
688
+ S.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-1", children: S.map((h, N) => /* @__PURE__ */ t.jsxs(
689
+ Z,
624
690
  {
625
691
  variant: "outline",
626
692
  className: "gap-1",
627
693
  children: [
628
- N?.[u] || N?.label,
694
+ h?.[C] || h?.label,
629
695
  /* @__PURE__ */ t.jsx(
630
696
  "button",
631
697
  {
632
- onClick: () => R(N?.value),
698
+ onClick: () => de(h?.value),
633
699
  className: "ml-1 hover:text-destructive",
634
700
  type: "button",
635
- "aria-label": `Remove ${N?.[u] || N?.label}`,
636
- children: /* @__PURE__ */ t.jsx(W, { className: "size-3" })
701
+ "aria-label": `Remove ${h?.[C] || h?.label}`,
702
+ children: /* @__PURE__ */ t.jsx(ie, { className: "size-3" })
637
703
  }
638
704
  )
639
705
  ]
640
706
  },
641
- T
707
+ N
642
708
  )) }),
643
- /* @__PURE__ */ t.jsxs(Tt, { open: i, onOpenChange: l, children: [
644
- /* @__PURE__ */ t.jsx(Ot, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
709
+ /* @__PURE__ */ t.jsxs(Lt, { open: a, onOpenChange: i, children: [
710
+ /* @__PURE__ */ t.jsx(It, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
645
711
  P,
646
712
  {
647
713
  variant: "outline",
648
714
  className: "w-full justify-start text-left font-normal",
649
715
  type: "button",
650
716
  children: [
651
- /* @__PURE__ */ t.jsx($t, { className: "mr-2 size-4" }),
652
- h.length === 0 ? m?.placeholder || "Select..." : f ? `${h.length} selected` : "Change selection"
717
+ /* @__PURE__ */ t.jsx(Oe, { className: "mr-2 size-4" }),
718
+ S.length === 0 ? U?.placeholder || "Select..." : R ? `${S.length} selected` : "Change selection"
653
719
  ]
654
720
  }
655
721
  ) }),
656
- /* @__PURE__ */ t.jsxs(Rt, { className: "max-w-md", children: [
657
- /* @__PURE__ */ t.jsx(kt, { children: /* @__PURE__ */ t.jsxs(At, { children: [
658
- m?.label || "Select",
722
+ /* @__PURE__ */ t.jsxs(Ut, { className: "max-w-md", children: [
723
+ /* @__PURE__ */ t.jsx(Vt, { children: /* @__PURE__ */ t.jsxs(Bt, { children: [
724
+ U?.label || "Select",
659
725
  " ",
660
- f && "(multiple)"
726
+ R && "(multiple)"
661
727
  ] }) }),
662
728
  /* @__PURE__ */ t.jsxs("div", { className: "space-y-4", children: [
663
- /* @__PURE__ */ t.jsx(
664
- w,
665
- {
666
- placeholder: "Search...",
667
- value: o,
668
- onChange: (N) => c(N.target.value),
669
- className: "w-full"
670
- }
671
- ),
672
- /* @__PURE__ */ t.jsx("div", { className: "max-h-64 overflow-y-auto space-y-1", children: x.length === 0 ? /* @__PURE__ */ t.jsx("p", { className: "text-sm text-gray-500 text-center py-4", children: "No options found" }) : x.map((N) => {
673
- const T = f ? (Array.isArray(e) ? e : []).includes(N.value) : e === N.value;
674
- return /* @__PURE__ */ t.jsxs(
729
+ /* @__PURE__ */ t.jsxs("div", { className: "relative", children: [
730
+ /* @__PURE__ */ t.jsx(Oe, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }),
731
+ /* @__PURE__ */ t.jsx(
732
+ T,
733
+ {
734
+ placeholder: "Search...",
735
+ value: o,
736
+ onChange: (h) => j(h.target.value),
737
+ onKeyDown: O,
738
+ className: "w-full pl-9"
739
+ }
740
+ ),
741
+ f && /* @__PURE__ */ t.jsx(
742
+ Pe,
743
+ {
744
+ className: "absolute right-3 top-1/2 -translate-y-1/2 size-4 animate-spin text-muted-foreground",
745
+ "data-testid": "lookup-loading"
746
+ }
747
+ )
748
+ ] }),
749
+ x && /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col items-center gap-2 py-4", role: "alert", children: [
750
+ /* @__PURE__ */ t.jsx(Yt, { className: "size-5 text-destructive" }),
751
+ /* @__PURE__ */ t.jsx("p", { className: "text-sm text-destructive", children: x }),
752
+ /* @__PURE__ */ t.jsx(
753
+ P,
754
+ {
755
+ variant: "outline",
756
+ size: "sm",
757
+ onClick: () => d(o || void 0),
758
+ type: "button",
759
+ children: "Retry"
760
+ }
761
+ )
762
+ ] }),
763
+ f && z.length === 0 && !x && /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col items-center gap-2 py-6", role: "status", "aria-live": "polite", children: [
764
+ /* @__PURE__ */ t.jsx(Pe, { className: "size-6 animate-spin text-muted-foreground" }),
765
+ /* @__PURE__ */ t.jsx("p", { className: "text-sm text-muted-foreground", children: "Loading…" })
766
+ ] }),
767
+ !x && !(f && z.length === 0) && /* @__PURE__ */ t.jsx("div", { ref: re, className: "max-h-64 overflow-y-auto space-y-1", role: "listbox", children: z.length === 0 ? /* @__PURE__ */ t.jsxs("div", { className: "py-4 text-center", children: [
768
+ /* @__PURE__ */ t.jsx("p", { className: "text-sm text-muted-foreground", children: "No options found" }),
769
+ se && /* @__PURE__ */ t.jsxs(
770
+ P,
771
+ {
772
+ variant: "ghost",
773
+ size: "sm",
774
+ className: "mt-2 gap-1",
775
+ type: "button",
776
+ onClick: () => {
777
+ se(o), i(!1);
778
+ },
779
+ children: [
780
+ /* @__PURE__ */ t.jsx(je, { className: "size-4" }),
781
+ "Create new"
782
+ ]
783
+ }
784
+ )
785
+ ] }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
786
+ z.map((h, N) => {
787
+ const $ = R ? (Array.isArray(e) ? e : []).includes(h.value) : e === h.value, ae = N === M;
788
+ return /* @__PURE__ */ t.jsxs(
789
+ "button",
790
+ {
791
+ "data-lookup-index": N,
792
+ role: "option",
793
+ "aria-selected": $,
794
+ onClick: () => X(h),
795
+ className: `w-full text-left px-3 py-2 rounded-md text-sm hover:bg-accent flex items-center justify-between ${ae ? "bg-accent text-accent-foreground" : $ ? "bg-accent/50 text-accent-foreground" : ""}`,
796
+ type: "button",
797
+ children: [
798
+ /* @__PURE__ */ t.jsxs("div", { className: "min-w-0 flex-1", children: [
799
+ /* @__PURE__ */ t.jsx("span", { className: "block truncate", children: h.label }),
800
+ h.description && /* @__PURE__ */ t.jsx("span", { className: "block truncate text-xs text-muted-foreground", children: h.description })
801
+ ] }),
802
+ $ && /* @__PURE__ */ t.jsx(Z, { variant: "default", className: "ml-2 shrink-0", children: "Selected" })
803
+ ]
804
+ },
805
+ h.value
806
+ );
807
+ }),
808
+ V && _ > z.length && /* @__PURE__ */ t.jsxs("p", { className: "text-xs text-muted-foreground text-center py-2", children: [
809
+ "Showing ",
810
+ z.length,
811
+ " of ",
812
+ _,
813
+ " results. Refine your search to find more."
814
+ ] }),
815
+ se && /* @__PURE__ */ t.jsxs(
675
816
  "button",
676
817
  {
677
- onClick: () => v(N),
678
- className: `w-full text-left px-3 py-2 rounded-md text-sm hover:bg-gray-100 flex items-center justify-between ${T ? "bg-blue-50 text-blue-700" : ""}`,
679
818
  type: "button",
819
+ 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",
820
+ onClick: () => {
821
+ se(o), i(!1);
822
+ },
680
823
  children: [
681
- /* @__PURE__ */ t.jsx("span", { children: N.label }),
682
- T && /* @__PURE__ */ t.jsx(M, { variant: "default", className: "ml-2", children: "Selected" })
824
+ /* @__PURE__ */ t.jsx(je, { className: "size-3.5" }),
825
+ "Create new",
826
+ o ? ` "${o}"` : ""
683
827
  ]
684
- },
685
- N.value
686
- );
687
- }) })
828
+ }
829
+ )
830
+ ] }) })
688
831
  ] })
689
832
  ] })
690
833
  ] })
691
834
  ] });
692
835
  }
693
- const nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
836
+ const hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
694
837
  __proto__: null,
695
- LookupField: Qe
838
+ LookupField: st
696
839
  }, Symbol.toStringTag, { value: "Module" }));
697
- function He({ value: e, onChange: r, field: n, readonly: a, ...s }) {
698
- if (a) {
840
+ function nt({ value: e, onChange: r, field: s, readonly: l, ...n }) {
841
+ if (l) {
699
842
  if (!e) return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" });
700
843
  const o = new Date(e);
701
844
  return /* @__PURE__ */ t.jsxs("span", { className: "text-sm", children: [
@@ -704,91 +847,91 @@ function He({ value: e, onChange: r, field: n, readonly: a, ...s }) {
704
847
  o.toLocaleTimeString()
705
848
  ] });
706
849
  }
707
- const { inputType: i, ...l } = s;
850
+ const { inputType: a, ...i } = n;
708
851
  return /* @__PURE__ */ t.jsx(
709
- w,
852
+ T,
710
853
  {
711
- ...l,
854
+ ...i,
712
855
  type: "datetime-local",
713
856
  value: e || "",
714
857
  onChange: (o) => r(o.target.value),
715
- disabled: a || l.disabled
858
+ disabled: l || i.disabled
716
859
  }
717
860
  );
718
861
  }
719
- const ar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
862
+ const gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
720
863
  __proto__: null,
721
- DateTimeField: He
864
+ DateTimeField: nt
722
865
  }, Symbol.toStringTag, { value: "Module" }));
723
- function Xe({ value: e, onChange: r, field: n, readonly: a, ...s }) {
724
- if (a)
866
+ function at({ value: e, onChange: r, field: s, readonly: l, ...n }) {
867
+ if (l)
725
868
  return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: e || "-" });
726
- const { inputType: i, ...l } = s;
869
+ const { inputType: a, ...i } = n;
727
870
  return /* @__PURE__ */ t.jsx(
728
- w,
871
+ T,
729
872
  {
730
- ...l,
873
+ ...i,
731
874
  type: "time",
732
875
  value: e || "",
733
876
  onChange: (o) => r(o.target.value),
734
- disabled: a || l.disabled
877
+ disabled: l || i.disabled
735
878
  }
736
879
  );
737
880
  }
738
- const lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
881
+ const br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
739
882
  __proto__: null,
740
- TimeField: Xe
883
+ TimeField: at
741
884
  }, Symbol.toStringTag, { value: "Module" }));
742
- function Ze({ value: e, onChange: r, field: n, readonly: a, errorMessage: s, className: i, ...l }) {
743
- const o = n || l.schema, c = o?.precision ?? 2;
744
- if (a)
885
+ function lt({ value: e, onChange: r, field: s, readonly: l, errorMessage: n, className: a, ...i }) {
886
+ const o = s || i.schema, c = o?.precision ?? 2;
887
+ if (l)
745
888
  return e == null ? /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" }) : /* @__PURE__ */ t.jsxs("span", { className: "text-sm font-medium tabular-nums", children: [
746
889
  (e * 100).toFixed(c),
747
890
  "%"
748
891
  ] });
749
- const m = e != null ? e * 100 : "", p = e != null ? e * 100 : 0, f = (h) => {
750
- if (h.target.value === "") {
892
+ const m = e != null ? e * 100 : "", p = e != null ? e * 100 : 0, f = (g) => {
893
+ if (g.target.value === "") {
751
894
  r(null);
752
895
  return;
753
896
  }
754
- const v = parseFloat(h.target.value), R = isNaN(v) ? null : v / 100;
755
- r(R);
756
- }, u = (h) => {
757
- if (a || l.disabled) return;
758
- if (!Array.isArray(h) || h.length === 0) {
897
+ const _ = parseFloat(g.target.value), k = isNaN(_) ? null : _ / 100;
898
+ r(k);
899
+ }, u = (g) => {
900
+ if (l || i.disabled) return;
901
+ if (!Array.isArray(g) || g.length === 0) {
759
902
  r(null);
760
903
  return;
761
904
  }
762
- const v = h[0], R = typeof v == "number" ? v / 100 : null;
763
- r(R);
905
+ const _ = g[0], k = typeof _ == "number" ? _ / 100 : null;
906
+ r(k);
764
907
  }, x = Math.pow(10, -c);
765
908
  return /* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
766
909
  /* @__PURE__ */ t.jsxs("div", { className: "relative", children: [
767
910
  /* @__PURE__ */ t.jsx(
768
- w,
911
+ T,
769
912
  {
770
- ...l,
913
+ ...i,
771
914
  type: "number",
772
915
  value: m,
773
916
  onChange: f,
774
917
  placeholder: o?.placeholder || "0",
775
- disabled: a || l.disabled,
776
- className: `pr-8 ${i || ""}`,
918
+ disabled: l || i.disabled,
919
+ className: `pr-8 ${a || ""}`,
777
920
  step: Math.pow(10, -c).toFixed(c),
778
- "aria-invalid": !!s
921
+ "aria-invalid": !!n
779
922
  }
780
923
  ),
781
924
  /* @__PURE__ */ t.jsx("span", { className: "absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500", children: "%" })
782
925
  ] }),
783
926
  /* @__PURE__ */ t.jsx(
784
- De,
927
+ Ye,
785
928
  {
786
929
  value: [p],
787
930
  onValueChange: u,
788
931
  min: 0,
789
932
  max: 100,
790
933
  step: x,
791
- disabled: a || l.disabled,
934
+ disabled: l || i.disabled,
792
935
  className: "w-full",
793
936
  "aria-label": "Percentage",
794
937
  "data-testid": "percent-slider"
@@ -796,26 +939,26 @@ function Ze({ value: e, onChange: r, field: n, readonly: a, errorMessage: s, cla
796
939
  )
797
940
  ] });
798
941
  }
799
- const ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
942
+ const jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
800
943
  __proto__: null,
801
- PercentField: Ze
944
+ PercentField: lt
802
945
  }, Symbol.toStringTag, { value: "Module" }));
803
- function Ke({ value: e, onChange: r, field: n, readonly: a, className: s, ...i }) {
804
- const [l, o] = B(!1), c = n || i.schema;
805
- if (a)
946
+ function it({ value: e, onChange: r, field: s, readonly: l, className: n, ...a }) {
947
+ const [i, o] = I(!1), c = s || a.schema;
948
+ if (l)
806
949
  return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "••••••••" });
807
- const { inputType: m, ...p } = i;
950
+ const { inputType: m, ...p } = a;
808
951
  return /* @__PURE__ */ t.jsxs("div", { className: "relative", children: [
809
952
  /* @__PURE__ */ t.jsx(
810
- w,
953
+ T,
811
954
  {
812
955
  ...p,
813
- type: l ? "text" : "password",
956
+ type: i ? "text" : "password",
814
957
  value: e || "",
815
958
  onChange: (f) => r(f.target.value),
816
959
  placeholder: c?.placeholder,
817
- disabled: a || p.disabled,
818
- className: `pr-10 ${s || ""}`
960
+ disabled: l || p.disabled,
961
+ className: `pr-10 ${n || ""}`
819
962
  }
820
963
  ),
821
964
  /* @__PURE__ */ t.jsx(
@@ -825,78 +968,78 @@ function Ke({ value: e, onChange: r, field: n, readonly: a, className: s, ...i }
825
968
  variant: "ghost",
826
969
  size: "sm",
827
970
  className: "absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",
828
- onClick: () => o(!l),
971
+ onClick: () => o(!i),
829
972
  tabIndex: -1,
830
- children: l ? /* @__PURE__ */ t.jsx(zt, { className: "size-4 text-gray-500" }) : /* @__PURE__ */ t.jsx(Et, { className: "size-4 text-gray-500" })
973
+ children: i ? /* @__PURE__ */ t.jsx(qt, { className: "size-4 text-gray-500" }) : /* @__PURE__ */ t.jsx(Jt, { className: "size-4 text-gray-500" })
831
974
  }
832
975
  )
833
976
  ] });
834
977
  }
835
- const or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
978
+ const yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
836
979
  __proto__: null,
837
- PasswordField: Ke
980
+ PasswordField: it
838
981
  }, Symbol.toStringTag, { value: "Module" }));
839
- function et({ value: e, onChange: r, field: n, readonly: a, ...s }) {
840
- const i = xe(null), l = n || s.schema, o = l?.multiple || !1, c = l?.accept ? l.accept.join(",") : void 0, m = l?.maxSize, [p, f] = B(!1), [u, x] = B([]), h = e ? Array.isArray(e) ? e : [e] : [], v = te((b) => {
982
+ function ot({ value: e, onChange: r, field: s, readonly: l, ...n }) {
983
+ const a = fe(null), i = s || n.schema, o = i?.multiple || !1, c = i?.accept ? i.accept.join(",") : void 0, m = i?.maxSize, [p, f] = I(!1), [u, x] = I([]), g = e ? Array.isArray(e) ? e : [e] : [], _ = W((b) => {
841
984
  if (b.length === 0) return;
842
- const F = [], A = b.filter((O) => {
843
- if (m && O.size > m) {
844
- const Y = (m / 1048576).toFixed(1);
845
- return F.push(`"${O.name}" exceeds max size (${Y} MB)`), !1;
985
+ const w = [], A = b.filter((C) => {
986
+ if (m && C.size > m) {
987
+ const q = (m / 1048576).toFixed(1);
988
+ return w.push(`"${C.name}" exceeds max size (${q} MB)`), !1;
846
989
  }
847
990
  return !0;
848
991
  });
849
- if (x(F), A.length === 0) return;
850
- const $ = A.map((O) => ({
851
- name: O.name,
852
- original_name: O.name,
853
- size: O.size,
854
- mime_type: O.type,
992
+ if (x(w), A.length === 0) return;
993
+ const R = A.map((C) => ({
994
+ name: C.name,
995
+ original_name: C.name,
996
+ size: C.size,
997
+ mime_type: C.type,
855
998
  // In a real implementation, this would upload the file and return a URL
856
- url: URL.createObjectURL(O)
999
+ url: URL.createObjectURL(C)
857
1000
  }));
858
- r(o ? [...h, ...$] : $[0]);
859
- }, [h, o, r, m]), R = te((b) => {
1001
+ r(o ? [...g, ...R] : R[0]);
1002
+ }, [g, o, r, m]), k = W((b) => {
860
1003
  b.preventDefault(), b.stopPropagation(), f(!0);
861
- }, []), N = te((b) => {
1004
+ }, []), D = W((b) => {
862
1005
  b.preventDefault(), b.stopPropagation(), f(!1);
863
- }, []), T = te((b) => {
1006
+ }, []), M = W((b) => {
864
1007
  b.preventDefault(), b.stopPropagation(), f(!1);
865
- const F = Array.from(b.dataTransfer.files);
1008
+ const w = Array.from(b.dataTransfer.files);
866
1009
  if (c) {
867
- const A = c.split(",").map((O) => O.trim().toLowerCase()), $ = F.filter((O) => {
868
- const Y = O.name.split("."), q = Y.length > 1 ? "." + Y.pop()?.toLowerCase() : "";
1010
+ const A = c.split(",").map((C) => C.trim().toLowerCase()), R = w.filter((C) => {
1011
+ const q = C.name.split("."), J = q.length > 1 ? "." + q.pop()?.toLowerCase() : "";
869
1012
  return A.some(
870
- (V) => V === O.type || q && V === q || V.endsWith("/*") && O.type.startsWith(V.replace("/*", "/"))
1013
+ (L) => L === C.type || J && L === J || L.endsWith("/*") && C.type.startsWith(L.replace("/*", "/"))
871
1014
  );
872
1015
  });
873
- v($);
1016
+ _(R);
874
1017
  } else
875
- v(F);
876
- }, [c, v]);
877
- if (a) {
1018
+ _(w);
1019
+ }, [c, _]);
1020
+ if (l) {
878
1021
  if (!e) return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" });
879
1022
  const b = Array.isArray(e) ? e : [e];
880
- return /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-2", children: b.map((F, A) => /* @__PURE__ */ t.jsx("span", { className: "text-sm truncate max-w-xs", children: F.name || F.original_name || "File" }, A)) });
1023
+ return /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-2", children: b.map((w, A) => /* @__PURE__ */ t.jsx("span", { className: "text-sm truncate max-w-xs", children: w.name || w.original_name || "File" }, A)) });
881
1024
  }
882
- const U = (b) => {
883
- v(Array.from(b.target.files || []));
884
- }, Q = (b) => {
1025
+ const Q = (b) => {
1026
+ _(Array.from(b.target.files || []));
1027
+ }, re = (b) => {
885
1028
  if (o) {
886
- const F = h.filter((A, $) => $ !== b);
887
- r(F.length > 0 ? F : null);
1029
+ const w = g.filter((A, R) => R !== b);
1030
+ r(w.length > 0 ? w : null);
888
1031
  } else
889
1032
  r(null);
890
- }, K = (b) => (b.mime_type || "").startsWith("image/");
891
- return /* @__PURE__ */ t.jsxs("div", { className: s.className, children: [
1033
+ }, U = (b) => (b.mime_type || "").startsWith("image/");
1034
+ return /* @__PURE__ */ t.jsxs("div", { className: n.className, children: [
892
1035
  /* @__PURE__ */ t.jsx(
893
1036
  "input",
894
1037
  {
895
- ref: i,
1038
+ ref: a,
896
1039
  type: "file",
897
1040
  multiple: o,
898
1041
  accept: c,
899
- onChange: U,
1042
+ onChange: Q,
900
1043
  className: "hidden"
901
1044
  }
902
1045
  ),
@@ -904,10 +1047,10 @@ function et({ value: e, onChange: r, field: n, readonly: a, ...s }) {
904
1047
  /* @__PURE__ */ t.jsxs(
905
1048
  "div",
906
1049
  {
907
- onDragOver: R,
908
- onDragLeave: N,
909
- onDrop: T,
910
- onClick: () => i.current?.click(),
1050
+ onDragOver: k,
1051
+ onDragLeave: D,
1052
+ onDrop: M,
1053
+ onClick: () => a.current?.click(),
911
1054
  className: `
912
1055
  flex flex-col items-center justify-center gap-2 p-6
913
1056
  border-2 border-dashed rounded-lg cursor-pointer
@@ -917,10 +1060,10 @@ function et({ value: e, onChange: r, field: n, readonly: a, ...s }) {
917
1060
  role: "button",
918
1061
  tabIndex: 0,
919
1062
  onKeyDown: (b) => {
920
- (b.key === "Enter" || b.key === " ") && (b.preventDefault(), i.current?.click());
1063
+ (b.key === "Enter" || b.key === " ") && (b.preventDefault(), a.current?.click());
921
1064
  },
922
1065
  children: [
923
- /* @__PURE__ */ t.jsx(Me, { className: `size-8 ${p ? "text-primary" : "text-muted-foreground"}` }),
1066
+ /* @__PURE__ */ t.jsx(qe, { className: `size-8 ${p ? "text-primary" : "text-muted-foreground"}` }),
924
1067
  /* @__PURE__ */ t.jsxs("div", { className: "text-center", children: [
925
1068
  /* @__PURE__ */ t.jsx("p", { className: "text-sm font-medium", children: p ? "Drop files here" : "Drag & drop files here" }),
926
1069
  /* @__PURE__ */ t.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "or click to browse" })
@@ -928,14 +1071,14 @@ function et({ value: e, onChange: r, field: n, readonly: a, ...s }) {
928
1071
  ]
929
1072
  }
930
1073
  ),
931
- u.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "space-y-0.5", children: u.map((b, F) => /* @__PURE__ */ t.jsx("p", { className: "text-xs text-destructive", children: b }, F)) }),
932
- h.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "space-y-1", children: h.map((b, F) => /* @__PURE__ */ t.jsxs(
1074
+ u.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "space-y-0.5", children: u.map((b, w) => /* @__PURE__ */ t.jsx("p", { className: "text-xs text-destructive", children: b }, w)) }),
1075
+ g.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "space-y-1", children: g.map((b, w) => /* @__PURE__ */ t.jsxs(
933
1076
  "div",
934
1077
  {
935
1078
  className: "flex items-center justify-between gap-2 p-2 bg-muted/50 rounded-md border",
936
1079
  children: [
937
1080
  /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
938
- K(b) && b.url ? /* @__PURE__ */ t.jsx("img", { src: b.url, alt: b.name, className: "size-8 object-cover rounded flex-shrink-0" }) : K(b) ? /* @__PURE__ */ t.jsx(Dt, { className: "size-4 text-muted-foreground flex-shrink-0" }) : /* @__PURE__ */ t.jsx(Mt, { className: "size-4 text-muted-foreground flex-shrink-0" }),
1081
+ U(b) && b.url ? /* @__PURE__ */ t.jsx("img", { src: b.url, alt: b.name, className: "size-8 object-cover rounded flex-shrink-0" }) : U(b) ? /* @__PURE__ */ t.jsx(Wt, { className: "size-4 text-muted-foreground flex-shrink-0" }) : /* @__PURE__ */ t.jsx(Gt, { className: "size-4 text-muted-foreground flex-shrink-0" }),
939
1082
  /* @__PURE__ */ t.jsx("span", { className: "text-sm truncate", children: b.name || b.original_name || "File" }),
940
1083
  b.size && /* @__PURE__ */ t.jsxs("span", { className: "text-xs text-muted-foreground", children: [
941
1084
  "(",
@@ -950,62 +1093,62 @@ function et({ value: e, onChange: r, field: n, readonly: a, ...s }) {
950
1093
  variant: "ghost",
951
1094
  size: "sm",
952
1095
  onClick: (A) => {
953
- A.stopPropagation(), Q(F);
1096
+ A.stopPropagation(), re(w);
954
1097
  },
955
1098
  className: "h-6 w-6 p-0",
956
- children: /* @__PURE__ */ t.jsx(W, { className: "size-3" })
1099
+ children: /* @__PURE__ */ t.jsx(ie, { className: "size-3" })
957
1100
  }
958
1101
  )
959
1102
  ]
960
1103
  },
961
- F
1104
+ w
962
1105
  )) })
963
1106
  ] })
964
1107
  ] });
965
1108
  }
966
- const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1109
+ const Nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
967
1110
  __proto__: null,
968
- FileField: et
1111
+ FileField: ot
969
1112
  }, Symbol.toStringTag, { value: "Module" }));
970
- function tt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
971
- const i = xe(null), l = n || s.schema, o = l?.multiple || !1, c = l?.accept ? l.accept.join(",") : "image/*";
972
- if (a) {
1113
+ function ct({ value: e, onChange: r, field: s, readonly: l, ...n }) {
1114
+ const a = fe(null), i = s || n.schema, o = i?.multiple || !1, c = i?.accept ? i.accept.join(",") : "image/*";
1115
+ if (l) {
973
1116
  if (!e) return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" });
974
1117
  const u = Array.isArray(e) ? e : [e];
975
- return /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-2", children: u.map((x, h) => /* @__PURE__ */ t.jsx(
1118
+ return /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-2", children: u.map((x, g) => /* @__PURE__ */ t.jsx(
976
1119
  "img",
977
1120
  {
978
1121
  src: x.url || "",
979
- alt: x.name || `Image ${h + 1}`,
1122
+ alt: x.name || `Image ${g + 1}`,
980
1123
  className: "size-20 rounded-md object-cover border border-gray-200"
981
1124
  },
982
- h
1125
+ g
983
1126
  )) });
984
1127
  }
985
1128
  const m = e ? Array.isArray(e) ? e : [e] : [], p = (u) => {
986
1129
  const x = Array.from(u.target.files || []);
987
1130
  if (x.length === 0) return;
988
- const h = x.map((v) => ({
989
- name: v.name,
990
- original_name: v.name,
991
- size: v.size,
992
- mime_type: v.type,
1131
+ const g = x.map((_) => ({
1132
+ name: _.name,
1133
+ original_name: _.name,
1134
+ size: _.size,
1135
+ mime_type: _.type,
993
1136
  // In a real implementation, this would upload the image and return a URL
994
- url: URL.createObjectURL(v)
1137
+ url: URL.createObjectURL(_)
995
1138
  }));
996
- r(o ? [...m, ...h] : h[0]);
1139
+ r(o ? [...m, ...g] : g[0]);
997
1140
  }, f = (u) => {
998
1141
  if (o) {
999
- const x = m.filter((h, v) => v !== u);
1142
+ const x = m.filter((g, _) => _ !== u);
1000
1143
  r(x.length > 0 ? x : null);
1001
1144
  } else
1002
1145
  r(null);
1003
1146
  };
1004
- return /* @__PURE__ */ t.jsxs("div", { className: s.className, children: [
1147
+ return /* @__PURE__ */ t.jsxs("div", { className: n.className, children: [
1005
1148
  /* @__PURE__ */ t.jsx(
1006
1149
  "input",
1007
1150
  {
1008
- ref: i,
1151
+ ref: a,
1009
1152
  type: "file",
1010
1153
  multiple: o,
1011
1154
  accept: c,
@@ -1031,7 +1174,7 @@ function tt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1031
1174
  size: "sm",
1032
1175
  onClick: () => f(x),
1033
1176
  className: "absolute top-1 right-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity",
1034
- children: /* @__PURE__ */ t.jsx(W, { className: "size-3" })
1177
+ children: /* @__PURE__ */ t.jsx(ie, { className: "size-3" })
1035
1178
  }
1036
1179
  )
1037
1180
  ] }, x)) }),
@@ -1040,10 +1183,10 @@ function tt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1040
1183
  {
1041
1184
  type: "button",
1042
1185
  variant: "outline",
1043
- onClick: () => i.current?.click(),
1186
+ onClick: () => a.current?.click(),
1044
1187
  className: "w-full",
1045
1188
  children: [
1046
- /* @__PURE__ */ t.jsx(Lt, { className: "size-4 mr-2" }),
1189
+ /* @__PURE__ */ t.jsx(Qt, { className: "size-4 mr-2" }),
1047
1190
  m.length > 0 ? "Add More Images" : "Upload Image"
1048
1191
  ]
1049
1192
  }
@@ -1051,14 +1194,14 @@ function tt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1051
1194
  ] })
1052
1195
  ] });
1053
1196
  }
1054
- const dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1197
+ const vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1055
1198
  __proto__: null,
1056
- ImageField: tt
1199
+ ImageField: ct
1057
1200
  }, Symbol.toStringTag, { value: "Module" }));
1058
- function rt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1059
- const i = n || s.schema, l = e && typeof e == "object" ? `${e.latitude || 0}, ${e.longitude || 0}` : "";
1060
- if (a)
1061
- return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: l || "-" });
1201
+ function dt({ value: e, onChange: r, field: s, readonly: l, ...n }) {
1202
+ const a = s || n.schema, i = e && typeof e == "object" ? `${e.latitude || 0}, ${e.longitude || 0}` : "";
1203
+ if (l)
1204
+ return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: i || "-" });
1062
1205
  const o = (c) => {
1063
1206
  const m = c.target.value;
1064
1207
  if (!m.trim()) {
@@ -1072,75 +1215,75 @@ function rt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1072
1215
  }
1073
1216
  };
1074
1217
  return /* @__PURE__ */ t.jsx(
1075
- w,
1218
+ T,
1076
1219
  {
1077
1220
  type: "text",
1078
- value: l,
1221
+ value: i,
1079
1222
  onChange: o,
1080
- placeholder: i?.placeholder || "latitude, longitude",
1081
- disabled: a || s.disabled,
1082
- className: s.className
1223
+ placeholder: a?.placeholder || "latitude, longitude",
1224
+ disabled: l || n.disabled,
1225
+ className: n.className
1083
1226
  }
1084
1227
  );
1085
1228
  }
1086
- const ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1229
+ const _r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1087
1230
  __proto__: null,
1088
- LocationField: rt
1231
+ LocationField: dt
1089
1232
  }, Symbol.toStringTag, { value: "Module" }));
1090
- function st({ value: e, field: r, ...n }) {
1091
- const s = (r || n.schema)?.return_type || "text";
1092
- let i = "-";
1093
- return e != null && (s === "number" || s === "currency" ? i = typeof e == "number" ? e.toFixed(2) : String(e) : s === "boolean" ? i = e ? "Yes" : "No" : s === "date" ? i = new Date(e).toLocaleDateString() : i = String(e)), /* @__PURE__ */ t.jsx("span", { className: `text-sm font-mono text-gray-700 ${n.className || ""}`, children: i });
1233
+ function ut({ value: e, field: r, ...s }) {
1234
+ const n = (r || s.schema)?.return_type || "text";
1235
+ let a = "-";
1236
+ return e != null && (n === "number" || n === "currency" ? a = typeof e == "number" ? e.toFixed(2) : String(e) : n === "boolean" ? a = e ? "Yes" : "No" : n === "date" ? a = new Date(e).toLocaleDateString() : a = String(e)), /* @__PURE__ */ t.jsx("span", { className: `text-sm font-mono text-gray-700 ${s.className || ""}`, children: a });
1094
1237
  }
1095
- const mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1238
+ const wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1096
1239
  __proto__: null,
1097
- FormulaField: st
1240
+ FormulaField: ut
1098
1241
  }, Symbol.toStringTag, { value: "Module" }));
1099
- function nt({ value: e, field: r, ...n }) {
1100
- const s = (r || n.schema)?.summary_type || "count";
1101
- let i = "-";
1102
- return e != null && (s === "count" ? i = String(e) : ["sum", "avg", "min", "max"].includes(s) ? i = typeof e == "number" ? e.toFixed(2) : String(e) : i = String(e)), /* @__PURE__ */ t.jsx("span", { className: `text-sm font-medium tabular-nums text-gray-700 ${n.className || ""}`, children: i });
1242
+ function mt({ value: e, field: r, ...s }) {
1243
+ const n = (r || s.schema)?.summary_type || "count";
1244
+ let a = "-";
1245
+ return e != null && (n === "count" ? a = String(e) : ["sum", "avg", "min", "max"].includes(n) ? a = typeof e == "number" ? e.toFixed(2) : String(e) : a = String(e)), /* @__PURE__ */ t.jsx("span", { className: `text-sm font-medium tabular-nums text-gray-700 ${s.className || ""}`, children: a });
1103
1246
  }
1104
- const fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1247
+ const Sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1105
1248
  __proto__: null,
1106
- SummaryField: nt
1249
+ SummaryField: mt
1107
1250
  }, Symbol.toStringTag, { value: "Module" }));
1108
- function at({ value: e, field: r, ...n }) {
1109
- const a = e != null ? String(e) : "-";
1110
- return /* @__PURE__ */ t.jsx("span", { className: `text-sm font-mono text-gray-700 ${n.className || ""}`, children: a });
1251
+ function ft({ value: e, field: r, ...s }) {
1252
+ const l = e != null ? String(e) : "-";
1253
+ return /* @__PURE__ */ t.jsx("span", { className: `text-sm font-mono text-gray-700 ${s.className || ""}`, children: l });
1111
1254
  }
1112
- const xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1255
+ const Fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1113
1256
  __proto__: null,
1114
- AutoNumberField: at
1257
+ AutoNumberField: ft
1115
1258
  }, Symbol.toStringTag, { value: "Module" }));
1116
- function de({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1117
- const l = (n || s.schema)?.multiple || !1;
1118
- if (a) {
1259
+ function Ne({ value: e, onChange: r, field: s, readonly: l, ...n }) {
1260
+ const i = (s || n.schema)?.multiple || !1;
1261
+ if (l) {
1119
1262
  if (!e) return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" });
1120
1263
  const m = Array.isArray(e) ? e : [e];
1121
1264
  return /* @__PURE__ */ t.jsxs("div", { className: "flex -space-x-2", children: [
1122
1265
  m.slice(0, 3).map((p, f) => {
1123
- const u = p.name || p.username || "User", x = u.split(" ").map((h) => h[0]).join("").toUpperCase().slice(0, 2);
1124
- return /* @__PURE__ */ t.jsx(L, { className: "size-8 border-2 border-white", title: u, children: /* @__PURE__ */ t.jsx(I, { className: "bg-blue-500 text-white text-xs", children: x }) }, f);
1266
+ const u = p.name || p.username || "User", x = u.split(" ").map((g) => g[0]).join("").toUpperCase().slice(0, 2);
1267
+ return /* @__PURE__ */ t.jsx(ee, { className: "size-8 border-2 border-white", title: u, children: /* @__PURE__ */ t.jsx(te, { className: "bg-blue-500 text-white text-xs", children: x }) }, f);
1125
1268
  }),
1126
- m.length > 3 && /* @__PURE__ */ t.jsx(L, { className: "size-8 border-2 border-white", children: /* @__PURE__ */ t.jsxs(I, { className: "bg-gray-200 text-gray-600 text-xs", children: [
1269
+ m.length > 3 && /* @__PURE__ */ t.jsx(ee, { className: "size-8 border-2 border-white", children: /* @__PURE__ */ t.jsxs(te, { className: "bg-gray-200 text-gray-600 text-xs", children: [
1127
1270
  "+",
1128
1271
  m.length - 3
1129
1272
  ] }) })
1130
1273
  ] });
1131
1274
  }
1132
1275
  const o = e ? Array.isArray(e) ? e : [e] : [], c = (m) => {
1133
- if (l) {
1276
+ if (i) {
1134
1277
  const p = o.filter((f, u) => u !== m);
1135
1278
  r(p.length > 0 ? p : null);
1136
1279
  } else
1137
1280
  r(null);
1138
1281
  };
1139
- return /* @__PURE__ */ t.jsxs("div", { className: s.className, children: [
1282
+ return /* @__PURE__ */ t.jsxs("div", { className: n.className, children: [
1140
1283
  o.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-2 mb-2", children: o.map((m, p) => {
1141
1284
  const f = m.name || m.username || "User", u = f.split(" ").map((x) => x[0]).join("").toUpperCase().slice(0, 2);
1142
- return /* @__PURE__ */ t.jsxs(M, { variant: "outline", className: "gap-2 pr-1", children: [
1143
- /* @__PURE__ */ t.jsx(L, { className: "size-5", children: /* @__PURE__ */ t.jsx(I, { className: "bg-blue-500 text-white text-xs", children: u }) }),
1285
+ return /* @__PURE__ */ t.jsxs(Z, { variant: "outline", className: "gap-2 pr-1", children: [
1286
+ /* @__PURE__ */ t.jsx(ee, { className: "size-5", children: /* @__PURE__ */ t.jsx(te, { className: "bg-blue-500 text-white text-xs", children: u }) }),
1144
1287
  /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: f }),
1145
1288
  /* @__PURE__ */ t.jsx(
1146
1289
  "button",
@@ -1148,7 +1291,7 @@ function de({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1148
1291
  type: "button",
1149
1292
  onClick: () => c(p),
1150
1293
  className: "ml-1 rounded-full hover:bg-gray-200 p-0.5",
1151
- children: /* @__PURE__ */ t.jsx(W, { className: "size-3" })
1294
+ children: /* @__PURE__ */ t.jsx(ie, { className: "size-3" })
1152
1295
  }
1153
1296
  )
1154
1297
  ] }, p);
@@ -1156,13 +1299,13 @@ function de({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1156
1299
  /* @__PURE__ */ t.jsx("div", { className: "text-sm text-gray-500 italic", children: "User selection component requires integration with user management system" })
1157
1300
  ] });
1158
1301
  }
1159
- const Re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1302
+ const Le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1160
1303
  __proto__: null,
1161
- UserField: de
1304
+ UserField: Ne
1162
1305
  }, Symbol.toStringTag, { value: "Module" }));
1163
- function lt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1164
- const i = n || s.schema, l = () => e == null ? "" : JSON.stringify(e, null, 2), [o, c] = B(l), [m, p] = B(null);
1165
- if (ze(() => {
1306
+ function xt({ value: e, onChange: r, field: s, readonly: l, ...n }) {
1307
+ const a = s || n.schema, i = () => e == null ? "" : JSON.stringify(e, null, 2), [o, c] = I(i), [m, p] = I(null);
1308
+ if (le(() => {
1166
1309
  try {
1167
1310
  if (e == null) {
1168
1311
  c("");
@@ -1173,8 +1316,8 @@ function lt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1173
1316
  } catch {
1174
1317
  c(JSON.stringify(e, null, 2));
1175
1318
  }
1176
- }, [e, o]), a)
1177
- return e ? /* @__PURE__ */ t.jsx("pre", { className: z("text-xs bg-gray-50 p-2 rounded border border-gray-200 overflow-auto max-h-40", s.className), children: JSON.stringify(e, null, 2) }) : /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" });
1319
+ }, [e, o]), l)
1320
+ return e ? /* @__PURE__ */ t.jsx("pre", { className: B("text-xs bg-gray-50 p-2 rounded border border-gray-200 overflow-auto max-h-40", n.className), children: JSON.stringify(e, null, 2) }) : /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" });
1178
1321
  const f = (u) => {
1179
1322
  const x = u.target.value;
1180
1323
  if (c(x), p(null), !x.trim()) {
@@ -1182,74 +1325,74 @@ function lt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1182
1325
  return;
1183
1326
  }
1184
1327
  try {
1185
- const h = JSON.parse(x);
1186
- r(h);
1328
+ const g = JSON.parse(x);
1329
+ r(g);
1187
1330
  } catch {
1188
1331
  p("Invalid JSON");
1189
1332
  }
1190
1333
  };
1191
1334
  return /* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
1192
1335
  /* @__PURE__ */ t.jsx(
1193
- Z,
1336
+ xe,
1194
1337
  {
1195
1338
  value: o,
1196
1339
  onChange: f,
1197
- placeholder: i?.placeholder || `{
1340
+ placeholder: a?.placeholder || `{
1198
1341
  "key": "value"
1199
1342
  }`,
1200
- disabled: a || s.disabled,
1201
- className: z("font-mono text-xs", m ? "border-red-500 focus-visible:ring-red-500" : "", s.className),
1343
+ disabled: l || n.disabled,
1344
+ className: B("font-mono text-xs", m ? "border-red-500 focus-visible:ring-red-500" : "", n.className),
1202
1345
  rows: 6
1203
1346
  }
1204
1347
  ),
1205
1348
  m && /* @__PURE__ */ t.jsx("p", { className: "text-xs text-red-500", children: m })
1206
1349
  ] });
1207
1350
  }
1208
- const pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1351
+ const Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1209
1352
  __proto__: null,
1210
- ObjectField: lt
1353
+ ObjectField: xt
1211
1354
  }, Symbol.toStringTag, { value: "Module" }));
1212
- function it({ value: e, field: r, ...n }) {
1213
- const s = (r || n.schema)?.dimensions || (Array.isArray(e) ? e.length : 0);
1355
+ function pt({ value: e, field: r, ...s }) {
1356
+ const n = (r || s.schema)?.dimensions || (Array.isArray(e) ? e.length : 0);
1214
1357
  if (!e || !Array.isArray(e))
1215
1358
  return /* @__PURE__ */ t.jsx("span", { className: "text-sm text-gray-500", children: "-" });
1216
- const i = e.slice(0, 3).map((l) => {
1217
- const o = Number(l);
1359
+ const a = e.slice(0, 3).map((i) => {
1360
+ const o = Number(i);
1218
1361
  return isNaN(o) ? "0" : o.toFixed(4);
1219
1362
  }).join(", ");
1220
- return /* @__PURE__ */ t.jsxs("div", { className: `text-sm ${n.className || ""}`, children: [
1363
+ return /* @__PURE__ */ t.jsxs("div", { className: `text-sm ${s.className || ""}`, children: [
1221
1364
  /* @__PURE__ */ t.jsxs("span", { className: "font-mono text-gray-700", children: [
1222
1365
  "[",
1223
- i,
1366
+ a,
1224
1367
  "...]"
1225
1368
  ] }),
1226
1369
  /* @__PURE__ */ t.jsxs("span", { className: "text-gray-500 ml-2", children: [
1227
1370
  "(",
1228
- s,
1371
+ n,
1229
1372
  "D)"
1230
1373
  ] })
1231
1374
  ] });
1232
1375
  }
1233
- const hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1376
+ const Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1234
1377
  __proto__: null,
1235
- VectorField: it
1378
+ VectorField: pt
1236
1379
  }, Symbol.toStringTag, { value: "Module" }));
1237
- function ot({ value: e, field: r, readonly: n, ...a }) {
1238
- const i = (r || a.schema)?.columns || [];
1239
- return !e || !Array.isArray(e) ? /* @__PURE__ */ t.jsx("span", { className: "text-sm text-muted-foreground", children: "-" }) : n ? /* @__PURE__ */ t.jsx("div", { className: z("text-sm", a.className), children: /* @__PURE__ */ t.jsxs("span", { className: "text-foreground", children: [
1380
+ function ht({ value: e, field: r, readonly: s, ...l }) {
1381
+ const a = (r || l.schema)?.columns || [];
1382
+ return !e || !Array.isArray(e) ? /* @__PURE__ */ t.jsx("span", { className: "text-sm text-muted-foreground", children: "-" }) : s ? /* @__PURE__ */ t.jsx("div", { className: B("text-sm", l.className), children: /* @__PURE__ */ t.jsxs("span", { className: "text-foreground", children: [
1240
1383
  e.length,
1241
1384
  " rows"
1242
- ] }) }) : /* @__PURE__ */ t.jsxs("div", { className: z("border border-border rounded-lg overflow-hidden", a.className), children: [
1385
+ ] }) }) : /* @__PURE__ */ t.jsxs("div", { className: B("border border-border rounded-lg overflow-hidden", l.className), children: [
1243
1386
  /* @__PURE__ */ t.jsx("div", { className: "overflow-auto max-h-60", children: /* @__PURE__ */ t.jsxs("table", { className: "w-full text-sm", children: [
1244
- /* @__PURE__ */ t.jsx("thead", { className: "bg-muted border-b border-border", children: /* @__PURE__ */ t.jsx("tr", { children: i.map((l, o) => /* @__PURE__ */ t.jsx(
1387
+ /* @__PURE__ */ t.jsx("thead", { className: "bg-muted border-b border-border", children: /* @__PURE__ */ t.jsx("tr", { children: a.map((i, o) => /* @__PURE__ */ t.jsx(
1245
1388
  "th",
1246
1389
  {
1247
1390
  className: "px-3 py-2 text-left text-xs font-medium text-muted-foreground",
1248
- children: l.label || l.name
1391
+ children: i.label || i.name
1249
1392
  },
1250
1393
  o
1251
1394
  )) }) }),
1252
- /* @__PURE__ */ t.jsx("tbody", { className: "divide-y divide-border", children: e.slice(0, 5).map((l, o) => /* @__PURE__ */ t.jsx("tr", { className: "hover:bg-muted/50 transition-colors", children: i.map((c, m) => /* @__PURE__ */ t.jsx("td", { className: "px-3 py-2 text-foreground", children: l[c.name] != null ? String(l[c.name]) : "-" }, m)) }, o)) })
1395
+ /* @__PURE__ */ t.jsx("tbody", { className: "divide-y divide-border", children: e.slice(0, 5).map((i, o) => /* @__PURE__ */ t.jsx("tr", { className: "hover:bg-muted/50 transition-colors", children: a.map((c, m) => /* @__PURE__ */ t.jsx("td", { className: "px-3 py-2 text-foreground", children: i[c.name] != null ? String(i[c.name]) : "-" }, m)) }, o)) })
1253
1396
  ] }) }),
1254
1397
  e.length > 5 && /* @__PURE__ */ t.jsxs("div", { className: "bg-muted px-3 py-2 text-xs text-muted-foreground border-t border-border", children: [
1255
1398
  "Showing 5 of ",
@@ -1258,13 +1401,13 @@ function ot({ value: e, field: r, readonly: n, ...a }) {
1258
1401
  ] })
1259
1402
  ] });
1260
1403
  }
1261
- const gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1404
+ const Or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1262
1405
  __proto__: null,
1263
- GridField: ot
1406
+ GridField: ht
1264
1407
  }, Symbol.toStringTag, { value: "Module" }));
1265
- function ct({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1266
- const i = n || s.schema;
1267
- return a ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
1408
+ function gt({ value: e, onChange: r, field: s, readonly: l, ...n }) {
1409
+ const a = s || n.schema;
1410
+ return l ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
1268
1411
  /* @__PURE__ */ t.jsx(
1269
1412
  "div",
1270
1413
  {
@@ -1279,62 +1422,62 @@ function ct({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1279
1422
  {
1280
1423
  type: "color",
1281
1424
  value: e || "#000000",
1282
- onChange: (l) => r(l.target.value),
1283
- disabled: a || s.disabled,
1425
+ onChange: (i) => r(i.target.value),
1426
+ disabled: l || n.disabled,
1284
1427
  className: "w-10 h-10 rounded border border-input cursor-pointer"
1285
1428
  }
1286
1429
  ),
1287
1430
  /* @__PURE__ */ t.jsx(
1288
- w,
1431
+ T,
1289
1432
  {
1290
1433
  type: "text",
1291
1434
  value: e || "",
1292
- onChange: (l) => r(l.target.value),
1293
- placeholder: i?.placeholder || "#000000",
1294
- disabled: a || s.disabled,
1295
- className: s.className,
1435
+ onChange: (i) => r(i.target.value),
1436
+ placeholder: a?.placeholder || "#000000",
1437
+ disabled: l || n.disabled,
1438
+ className: n.className,
1296
1439
  pattern: "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"
1297
1440
  }
1298
1441
  )
1299
1442
  ] });
1300
1443
  }
1301
- const br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1444
+ const Pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1302
1445
  __proto__: null,
1303
- ColorField: ct
1446
+ ColorField: gt
1304
1447
  }, Symbol.toStringTag, { value: "Module" }));
1305
- function dt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1306
- const i = n || s.schema, l = i?.min ?? 0, o = i?.max ?? 100, c = i?.step ?? 1;
1307
- return a ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
1308
- /* @__PURE__ */ t.jsx("span", { className: "text-sm font-medium", children: e ?? l }),
1448
+ function bt({ value: e, onChange: r, field: s, readonly: l, ...n }) {
1449
+ const a = s || n.schema, i = a?.min ?? 0, o = a?.max ?? 100, c = a?.step ?? 1;
1450
+ return l ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
1451
+ /* @__PURE__ */ t.jsx("span", { className: "text-sm font-medium", children: e ?? i }),
1309
1452
  /* @__PURE__ */ t.jsxs("span", { className: "text-xs text-muted-foreground", children: [
1310
1453
  "/ ",
1311
1454
  o
1312
1455
  ] })
1313
1456
  ] }) : /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-4", children: [
1314
1457
  /* @__PURE__ */ t.jsx(
1315
- De,
1458
+ Ye,
1316
1459
  {
1317
- value: [e ?? l],
1460
+ value: [e ?? i],
1318
1461
  onValueChange: (m) => r(m[0]),
1319
- min: l,
1462
+ min: i,
1320
1463
  max: o,
1321
1464
  step: c,
1322
- disabled: a || s.disabled,
1323
- className: s.className
1465
+ disabled: l || n.disabled,
1466
+ className: n.className
1324
1467
  }
1325
1468
  ),
1326
- /* @__PURE__ */ t.jsx("span", { className: "text-sm font-medium w-12 text-right", children: e ?? l })
1469
+ /* @__PURE__ */ t.jsx("span", { className: "text-sm font-medium w-12 text-right", children: e ?? i })
1327
1470
  ] });
1328
1471
  }
1329
- const jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1472
+ const Rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1330
1473
  __proto__: null,
1331
- SliderField: dt
1474
+ SliderField: bt
1332
1475
  }, Symbol.toStringTag, { value: "Module" }));
1333
- function ut({ value: e, onChange: r, field: n, readonly: a, className: s, ...i }) {
1334
- const o = (n || i.schema)?.max ?? 5, c = e ?? 0, [m, p] = k.useState(null), f = m !== null ? m : c;
1335
- return a ? /* @__PURE__ */ t.jsxs("div", { className: z("flex items-center gap-1", s), children: [
1476
+ function jt({ value: e, onChange: r, field: s, readonly: l, className: n, ...a }) {
1477
+ const o = (s || a.schema)?.max ?? 5, c = e ?? 0, [m, p] = E.useState(null), f = m !== null ? m : c;
1478
+ return l ? /* @__PURE__ */ t.jsxs("div", { className: B("flex items-center gap-1", n), children: [
1336
1479
  Array.from({ length: o }, (u, x) => /* @__PURE__ */ t.jsx(
1337
- _e,
1480
+ Re,
1338
1481
  {
1339
1482
  className: `w-5 h-5 ${x < c ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground"}`
1340
1483
  },
@@ -1345,7 +1488,7 @@ function ut({ value: e, onChange: r, field: n, readonly: a, className: s, ...i }
1345
1488
  " / ",
1346
1489
  o
1347
1490
  ] })
1348
- ] }) : /* @__PURE__ */ t.jsxs("div", { className: z("flex items-center gap-1", s), children: [
1491
+ ] }) : /* @__PURE__ */ t.jsxs("div", { className: B("flex items-center gap-1", n), children: [
1349
1492
  Array.from({ length: o }, (u, x) => /* @__PURE__ */ t.jsx(
1350
1493
  "button",
1351
1494
  {
@@ -1354,9 +1497,9 @@ function ut({ value: e, onChange: r, field: n, readonly: a, className: s, ...i }
1354
1497
  onMouseEnter: () => p(x + 1),
1355
1498
  onMouseLeave: () => p(null),
1356
1499
  className: "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 rounded",
1357
- disabled: a || i.disabled,
1500
+ disabled: l || a.disabled,
1358
1501
  children: /* @__PURE__ */ t.jsx(
1359
- _e,
1502
+ Re,
1360
1503
  {
1361
1504
  className: `w-5 h-5 transition-colors ${x < f ? "fill-yellow-400 text-yellow-400 hover:fill-yellow-500 hover:text-yellow-500" : "text-muted-foreground hover:text-yellow-400"}`
1362
1505
  }
@@ -1371,31 +1514,31 @@ function ut({ value: e, onChange: r, field: n, readonly: a, className: s, ...i }
1371
1514
  ] })
1372
1515
  ] });
1373
1516
  }
1374
- const yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1517
+ const kr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1375
1518
  __proto__: null,
1376
- RatingField: ut
1519
+ RatingField: jt
1377
1520
  }, Symbol.toStringTag, { value: "Module" }));
1378
- function mt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1379
- const i = n || s.schema, l = i?.language ?? "javascript";
1380
- return a ? /* @__PURE__ */ t.jsx("pre", { className: z("text-sm bg-muted p-2 rounded overflow-x-auto border", s.className), children: /* @__PURE__ */ t.jsx("code", { children: e || "-" }) }) : /* @__PURE__ */ t.jsx(
1381
- Z,
1521
+ function yt({ value: e, onChange: r, field: s, readonly: l, ...n }) {
1522
+ const a = s || n.schema, i = a?.language ?? "javascript";
1523
+ return l ? /* @__PURE__ */ t.jsx("pre", { className: B("text-sm bg-muted p-2 rounded overflow-x-auto border", n.className), children: /* @__PURE__ */ t.jsx("code", { children: e || "-" }) }) : /* @__PURE__ */ t.jsx(
1524
+ xe,
1382
1525
  {
1383
1526
  value: e || "",
1384
1527
  onChange: (o) => r(o.target.value),
1385
- placeholder: i?.placeholder || `// Write ${l} code here...`,
1386
- disabled: a || s.disabled,
1387
- className: z("font-mono text-sm", s.className),
1528
+ placeholder: a?.placeholder || `// Write ${i} code here...`,
1529
+ disabled: l || n.disabled,
1530
+ className: B("font-mono text-sm", n.className),
1388
1531
  rows: 12,
1389
1532
  spellCheck: !1
1390
1533
  }
1391
1534
  );
1392
1535
  }
1393
- const Nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1536
+ const Ar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1394
1537
  __proto__: null,
1395
- CodeField: mt
1538
+ CodeField: yt
1396
1539
  }, Symbol.toStringTag, { value: "Module" }));
1397
- function ft({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1398
- const [i, l] = k.useState(!1), o = k.useRef(null), c = n || s.schema, m = (u) => {
1540
+ function Nt({ value: e, onChange: r, field: s, readonly: l, ...n }) {
1541
+ const [a, i] = E.useState(!1), o = E.useRef(null), c = s || n.schema, m = (u) => {
1399
1542
  const x = u.target.files?.[0];
1400
1543
  if (!x) return;
1401
1544
  if (!x.type.startsWith("image/")) {
@@ -1406,35 +1549,35 @@ function ft({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1406
1549
  console.error("File size must be less than 5MB");
1407
1550
  return;
1408
1551
  }
1409
- const h = new FileReader();
1410
- h.onloadend = () => {
1411
- r(h.result);
1412
- }, h.readAsDataURL(x);
1552
+ const g = new FileReader();
1553
+ g.onloadend = () => {
1554
+ r(g.result);
1555
+ }, g.readAsDataURL(x);
1413
1556
  }, p = () => {
1414
1557
  r("");
1415
1558
  }, f = () => (c?.defaultName || c?.label || "User").split(" ").map((x) => x[0]).join("").toUpperCase().slice(0, 2);
1416
- return a ? /* @__PURE__ */ t.jsxs(L, { className: "w-16 h-16", children: [
1417
- e && /* @__PURE__ */ t.jsx(ve, { src: e, alt: c?.label }),
1418
- /* @__PURE__ */ t.jsx(I, { children: f() })
1559
+ return l ? /* @__PURE__ */ t.jsxs(ee, { className: "w-16 h-16", children: [
1560
+ e && /* @__PURE__ */ t.jsx(Te, { src: e, alt: c?.label }),
1561
+ /* @__PURE__ */ t.jsx(te, { children: f() })
1419
1562
  ] }) : /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-4", children: [
1420
1563
  /* @__PURE__ */ t.jsxs(
1421
1564
  "div",
1422
1565
  {
1423
1566
  className: "relative",
1424
- onMouseEnter: () => l(!0),
1425
- onMouseLeave: () => l(!1),
1567
+ onMouseEnter: () => i(!0),
1568
+ onMouseLeave: () => i(!1),
1426
1569
  children: [
1427
- /* @__PURE__ */ t.jsxs(L, { className: "w-16 h-16", children: [
1428
- e && /* @__PURE__ */ t.jsx(ve, { src: e, alt: c?.label }),
1429
- /* @__PURE__ */ t.jsx(I, { children: f() })
1570
+ /* @__PURE__ */ t.jsxs(ee, { className: "w-16 h-16", children: [
1571
+ e && /* @__PURE__ */ t.jsx(Te, { src: e, alt: c?.label }),
1572
+ /* @__PURE__ */ t.jsx(te, { children: f() })
1430
1573
  ] }),
1431
- !a && i && e && /* @__PURE__ */ t.jsx(
1574
+ !l && a && e && /* @__PURE__ */ t.jsx(
1432
1575
  "button",
1433
1576
  {
1434
1577
  type: "button",
1435
1578
  onClick: p,
1436
1579
  className: "absolute -top-1 -right-1 bg-destructive text-destructive-foreground rounded-full p-1 hover:bg-destructive/90",
1437
- children: /* @__PURE__ */ t.jsx(W, { className: "w-3 h-3" })
1580
+ children: /* @__PURE__ */ t.jsx(ie, { className: "w-3 h-3" })
1438
1581
  }
1439
1582
  )
1440
1583
  ]
@@ -1458,9 +1601,9 @@ function ft({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1458
1601
  variant: "outline",
1459
1602
  size: "sm",
1460
1603
  onClick: () => o.current?.click(),
1461
- disabled: a || s.disabled,
1604
+ disabled: l || n.disabled,
1462
1605
  children: [
1463
- /* @__PURE__ */ t.jsx(Me, { className: "w-4 h-4 mr-2" }),
1606
+ /* @__PURE__ */ t.jsx(qe, { className: "w-4 h-4 mr-2" }),
1464
1607
  e ? "Change" : "Upload",
1465
1608
  " Avatar"
1466
1609
  ]
@@ -1470,14 +1613,14 @@ function ft({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1470
1613
  ] })
1471
1614
  ] });
1472
1615
  }
1473
- const vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1616
+ const $r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1474
1617
  __proto__: null,
1475
- AvatarField: ft
1618
+ AvatarField: Nt
1476
1619
  }, Symbol.toStringTag, { value: "Module" }));
1477
- function xt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1478
- const i = e || {}, l = (c, m) => {
1620
+ function vt({ value: e, onChange: r, field: s, readonly: l, ...n }) {
1621
+ const a = e || {}, i = (c, m) => {
1479
1622
  r({
1480
- ...i,
1623
+ ...a,
1481
1624
  [c]: m
1482
1625
  });
1483
1626
  }, o = (c) => [
@@ -1486,90 +1629,90 @@ function xt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1486
1629
  [c.state, c.zipCode].filter(Boolean).join(" "),
1487
1630
  c.country
1488
1631
  ].filter(Boolean).join(", ") || "-";
1489
- return a ? /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: o(i) }) : /* @__PURE__ */ t.jsxs("div", { className: "space-y-3", children: [
1632
+ return l ? /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: o(a) }) : /* @__PURE__ */ t.jsxs("div", { className: "space-y-3", children: [
1490
1633
  /* @__PURE__ */ t.jsxs("div", { children: [
1491
- /* @__PURE__ */ t.jsx(E, { htmlFor: "street", className: "text-xs", children: "Street Address" }),
1634
+ /* @__PURE__ */ t.jsx(G, { htmlFor: "street", className: "text-xs", children: "Street Address" }),
1492
1635
  /* @__PURE__ */ t.jsx(
1493
- w,
1636
+ T,
1494
1637
  {
1495
1638
  id: "street",
1496
1639
  type: "text",
1497
- value: i.street || "",
1498
- onChange: (c) => l("street", c.target.value),
1640
+ value: a.street || "",
1641
+ onChange: (c) => i("street", c.target.value),
1499
1642
  placeholder: "123 Main St",
1500
- disabled: a || s.disabled,
1501
- className: s.className
1643
+ disabled: l || n.disabled,
1644
+ className: n.className
1502
1645
  }
1503
1646
  )
1504
1647
  ] }),
1505
1648
  /* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
1506
1649
  /* @__PURE__ */ t.jsxs("div", { children: [
1507
- /* @__PURE__ */ t.jsx(E, { htmlFor: "city", className: "text-xs", children: "City" }),
1650
+ /* @__PURE__ */ t.jsx(G, { htmlFor: "city", className: "text-xs", children: "City" }),
1508
1651
  /* @__PURE__ */ t.jsx(
1509
- w,
1652
+ T,
1510
1653
  {
1511
1654
  id: "city",
1512
1655
  type: "text",
1513
- value: i.city || "",
1514
- onChange: (c) => l("city", c.target.value),
1656
+ value: a.city || "",
1657
+ onChange: (c) => i("city", c.target.value),
1515
1658
  placeholder: "San Francisco",
1516
- disabled: a || s.disabled
1659
+ disabled: l || n.disabled
1517
1660
  }
1518
1661
  )
1519
1662
  ] }),
1520
1663
  /* @__PURE__ */ t.jsxs("div", { children: [
1521
- /* @__PURE__ */ t.jsx(E, { htmlFor: "state", className: "text-xs", children: "State / Province" }),
1664
+ /* @__PURE__ */ t.jsx(G, { htmlFor: "state", className: "text-xs", children: "State / Province" }),
1522
1665
  /* @__PURE__ */ t.jsx(
1523
- w,
1666
+ T,
1524
1667
  {
1525
1668
  id: "state",
1526
1669
  type: "text",
1527
- value: i.state || "",
1528
- onChange: (c) => l("state", c.target.value),
1670
+ value: a.state || "",
1671
+ onChange: (c) => i("state", c.target.value),
1529
1672
  placeholder: "CA",
1530
- disabled: a || s.disabled
1673
+ disabled: l || n.disabled
1531
1674
  }
1532
1675
  )
1533
1676
  ] })
1534
1677
  ] }),
1535
1678
  /* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
1536
1679
  /* @__PURE__ */ t.jsxs("div", { children: [
1537
- /* @__PURE__ */ t.jsx(E, { htmlFor: "zipCode", className: "text-xs", children: "ZIP / Postal Code" }),
1680
+ /* @__PURE__ */ t.jsx(G, { htmlFor: "zipCode", className: "text-xs", children: "ZIP / Postal Code" }),
1538
1681
  /* @__PURE__ */ t.jsx(
1539
- w,
1682
+ T,
1540
1683
  {
1541
1684
  id: "zipCode",
1542
1685
  type: "text",
1543
- value: i.zipCode || "",
1544
- onChange: (c) => l("zipCode", c.target.value),
1686
+ value: a.zipCode || "",
1687
+ onChange: (c) => i("zipCode", c.target.value),
1545
1688
  placeholder: "94102",
1546
- disabled: a || s.disabled
1689
+ disabled: l || n.disabled
1547
1690
  }
1548
1691
  )
1549
1692
  ] }),
1550
1693
  /* @__PURE__ */ t.jsxs("div", { children: [
1551
- /* @__PURE__ */ t.jsx(E, { htmlFor: "country", className: "text-xs", children: "Country" }),
1694
+ /* @__PURE__ */ t.jsx(G, { htmlFor: "country", className: "text-xs", children: "Country" }),
1552
1695
  /* @__PURE__ */ t.jsx(
1553
- w,
1696
+ T,
1554
1697
  {
1555
1698
  id: "country",
1556
1699
  type: "text",
1557
- value: i.country || "",
1558
- onChange: (c) => l("country", c.target.value),
1700
+ value: a.country || "",
1701
+ onChange: (c) => i("country", c.target.value),
1559
1702
  placeholder: "United States",
1560
- disabled: a || s.disabled
1703
+ disabled: l || n.disabled
1561
1704
  }
1562
1705
  )
1563
1706
  ] })
1564
1707
  ] })
1565
1708
  ] });
1566
1709
  }
1567
- const _r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1710
+ const zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1568
1711
  __proto__: null,
1569
- AddressField: xt
1712
+ AddressField: vt
1570
1713
  }, Symbol.toStringTag, { value: "Module" }));
1571
- function pt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1572
- const [i, l] = k.useState(!1), o = e || {}, c = (u, x) => {
1714
+ function _t({ value: e, onChange: r, field: s, readonly: l, ...n }) {
1715
+ const [a, i] = E.useState(!1), o = e || {}, c = (u, x) => {
1573
1716
  r({
1574
1717
  ...o,
1575
1718
  [u]: x ? Number(x) : void 0
@@ -1579,16 +1722,16 @@ function pt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1579
1722
  console.error("Geolocation is not supported by this browser");
1580
1723
  return;
1581
1724
  }
1582
- l(!0), navigator.geolocation.getCurrentPosition(
1725
+ i(!0), navigator.geolocation.getCurrentPosition(
1583
1726
  (u) => {
1584
1727
  r({
1585
1728
  latitude: u.coords.latitude,
1586
1729
  longitude: u.coords.longitude,
1587
1730
  accuracy: u.coords.accuracy
1588
- }), l(!1);
1731
+ }), i(!1);
1589
1732
  },
1590
1733
  (u) => {
1591
- console.error("Error getting location:", u.message), l(!1);
1734
+ console.error("Error getting location:", u.message), i(!1);
1592
1735
  },
1593
1736
  {
1594
1737
  enableHighAccuracy: !0,
@@ -1601,8 +1744,8 @@ function pt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1601
1744
  const u = `https://www.google.com/maps?q=${o.latitude},${o.longitude}`;
1602
1745
  window.open(u, "_blank");
1603
1746
  };
1604
- return a ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
1605
- /* @__PURE__ */ t.jsx(we, { className: "w-4 h-4 text-muted-foreground" }),
1747
+ return l ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
1748
+ /* @__PURE__ */ t.jsx(ke, { className: "w-4 h-4 text-muted-foreground" }),
1606
1749
  /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: p(o) }),
1607
1750
  o.latitude && o.longitude && /* @__PURE__ */ t.jsx(
1608
1751
  P,
@@ -1624,10 +1767,10 @@ function pt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1624
1767
  variant: "outline",
1625
1768
  size: "sm",
1626
1769
  onClick: m,
1627
- disabled: a || i,
1770
+ disabled: l || a,
1628
1771
  children: [
1629
- /* @__PURE__ */ t.jsx(It, { className: "w-4 h-4 mr-2" }),
1630
- i ? "Getting location..." : "Use Current Location"
1772
+ /* @__PURE__ */ t.jsx(Ht, { className: "w-4 h-4 mr-2" }),
1773
+ a ? "Getting location..." : "Use Current Location"
1631
1774
  ]
1632
1775
  }
1633
1776
  ),
@@ -1639,7 +1782,7 @@ function pt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1639
1782
  size: "sm",
1640
1783
  onClick: f,
1641
1784
  children: [
1642
- /* @__PURE__ */ t.jsx(we, { className: "w-4 h-4 mr-2" }),
1785
+ /* @__PURE__ */ t.jsx(ke, { className: "w-4 h-4 mr-2" }),
1643
1786
  "View on map"
1644
1787
  ]
1645
1788
  }
@@ -1647,32 +1790,32 @@ function pt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1647
1790
  ] }),
1648
1791
  /* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
1649
1792
  /* @__PURE__ */ t.jsxs("div", { children: [
1650
- /* @__PURE__ */ t.jsx(E, { htmlFor: "latitude", className: "text-xs", children: "Latitude" }),
1793
+ /* @__PURE__ */ t.jsx(G, { htmlFor: "latitude", className: "text-xs", children: "Latitude" }),
1651
1794
  /* @__PURE__ */ t.jsx(
1652
- w,
1795
+ T,
1653
1796
  {
1654
1797
  id: "latitude",
1655
1798
  type: "number",
1656
1799
  value: o.latitude ?? "",
1657
1800
  onChange: (u) => c("latitude", u.target.value),
1658
1801
  placeholder: "37.7749",
1659
- disabled: a || s.disabled,
1802
+ disabled: l || n.disabled,
1660
1803
  step: "any",
1661
- className: s.className
1804
+ className: n.className
1662
1805
  }
1663
1806
  )
1664
1807
  ] }),
1665
1808
  /* @__PURE__ */ t.jsxs("div", { children: [
1666
- /* @__PURE__ */ t.jsx(E, { htmlFor: "longitude", className: "text-xs", children: "Longitude" }),
1809
+ /* @__PURE__ */ t.jsx(G, { htmlFor: "longitude", className: "text-xs", children: "Longitude" }),
1667
1810
  /* @__PURE__ */ t.jsx(
1668
- w,
1811
+ T,
1669
1812
  {
1670
1813
  id: "longitude",
1671
1814
  type: "number",
1672
1815
  value: o.longitude ?? "",
1673
1816
  onChange: (u) => c("longitude", u.target.value),
1674
1817
  placeholder: "-122.4194",
1675
- disabled: a || s.disabled,
1818
+ disabled: l || n.disabled,
1676
1819
  step: "any"
1677
1820
  }
1678
1821
  )
@@ -1685,58 +1828,58 @@ function pt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1685
1828
  ] })
1686
1829
  ] });
1687
1830
  }
1688
- const wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1831
+ const Er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1689
1832
  __proto__: null,
1690
- GeolocationField: pt
1833
+ GeolocationField: _t
1691
1834
  }, Symbol.toStringTag, { value: "Module" }));
1692
- function ht({ value: e, onChange: r, readonly: n }) {
1693
- const a = xe(null), [s, i] = k.useState(!1), [l, o] = k.useState(!e);
1694
- ze(() => {
1695
- if (e && a.current) {
1696
- const x = a.current.getContext("2d");
1835
+ function wt({ value: e, onChange: r, readonly: s }) {
1836
+ const l = fe(null), [n, a] = E.useState(!1), [i, o] = E.useState(!e);
1837
+ le(() => {
1838
+ if (e && l.current) {
1839
+ const x = l.current.getContext("2d");
1697
1840
  if (x) {
1698
- const h = new Image();
1699
- h.onload = () => {
1700
- x.drawImage(h, 0, 0), o(!1);
1701
- }, h.src = e;
1841
+ const g = new Image();
1842
+ g.onload = () => {
1843
+ x.drawImage(g, 0, 0), o(!1);
1844
+ }, g.src = e;
1702
1845
  }
1703
1846
  }
1704
1847
  }, [e]);
1705
1848
  const c = (u) => {
1706
- if (n) return;
1707
- i(!0), o(!1);
1708
- const x = a.current;
1849
+ if (s) return;
1850
+ a(!0), o(!1);
1851
+ const x = l.current;
1709
1852
  if (!x) return;
1710
- const h = x.getContext("2d");
1711
- if (!h) return;
1712
- const v = x.getBoundingClientRect(), R = "touches" in u ? u.touches[0].clientX - v.left : u.clientX - v.left, N = "touches" in u ? u.touches[0].clientY - v.top : u.clientY - v.top;
1713
- h.beginPath(), h.moveTo(R, N);
1853
+ const g = x.getContext("2d");
1854
+ if (!g) return;
1855
+ const _ = x.getBoundingClientRect(), k = "touches" in u ? u.touches[0].clientX - _.left : u.clientX - _.left, D = "touches" in u ? u.touches[0].clientY - _.top : u.clientY - _.top;
1856
+ g.beginPath(), g.moveTo(k, D);
1714
1857
  }, m = (u) => {
1715
- if (!s || n) return;
1716
- const x = a.current;
1858
+ if (!n || s) return;
1859
+ const x = l.current;
1717
1860
  if (!x) return;
1718
- const h = x.getContext("2d");
1719
- if (!h) return;
1720
- const v = x.getBoundingClientRect(), R = "touches" in u ? u.touches[0].clientX - v.left : u.clientX - v.left, N = "touches" in u ? u.touches[0].clientY - v.top : u.clientY - v.top;
1721
- h.lineTo(R, N), h.strokeStyle = "#000", h.lineWidth = 2, h.lineCap = "round", h.lineJoin = "round", h.stroke();
1861
+ const g = x.getContext("2d");
1862
+ if (!g) return;
1863
+ const _ = x.getBoundingClientRect(), k = "touches" in u ? u.touches[0].clientX - _.left : u.clientX - _.left, D = "touches" in u ? u.touches[0].clientY - _.top : u.clientY - _.top;
1864
+ g.lineTo(k, D), g.strokeStyle = "#000", g.lineWidth = 2, g.lineCap = "round", g.lineJoin = "round", g.stroke();
1722
1865
  }, p = () => {
1723
- if (!s) return;
1724
- i(!1);
1725
- const u = a.current;
1866
+ if (!n) return;
1867
+ a(!1);
1868
+ const u = l.current;
1726
1869
  if (!u) return;
1727
1870
  const x = u.toDataURL("image/png");
1728
1871
  r(x);
1729
1872
  }, f = () => {
1730
- const u = a.current;
1873
+ const u = l.current;
1731
1874
  if (!u) return;
1732
1875
  const x = u.getContext("2d");
1733
1876
  x && (x.clearRect(0, 0, u.width, u.height), o(!0), r(""));
1734
1877
  };
1735
- return n && e ? /* @__PURE__ */ t.jsx("div", { className: "border rounded p-2 bg-white", children: /* @__PURE__ */ t.jsx("img", { src: e, alt: "Signature", loading: "lazy", className: "max-w-full h-auto" }) }) : n && !e ? /* @__PURE__ */ t.jsx("span", { className: "text-sm text-muted-foreground", children: "No signature" }) : /* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
1878
+ return s && e ? /* @__PURE__ */ t.jsx("div", { className: "border rounded p-2 bg-white", children: /* @__PURE__ */ t.jsx("img", { src: e, alt: "Signature", loading: "lazy", className: "max-w-full h-auto" }) }) : s && !e ? /* @__PURE__ */ t.jsx("span", { className: "text-sm text-muted-foreground", children: "No signature" }) : /* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
1736
1879
  /* @__PURE__ */ t.jsx("div", { className: "border rounded bg-white", children: /* @__PURE__ */ t.jsx(
1737
1880
  "canvas",
1738
1881
  {
1739
- ref: a,
1882
+ ref: l,
1740
1883
  width: 400,
1741
1884
  height: 200,
1742
1885
  className: "w-full touch-none cursor-crosshair",
@@ -1750,7 +1893,7 @@ function ht({ value: e, onChange: r, readonly: n }) {
1750
1893
  }
1751
1894
  ) }),
1752
1895
  /* @__PURE__ */ t.jsxs("div", { className: "flex justify-between items-center", children: [
1753
- /* @__PURE__ */ t.jsx("p", { className: "text-xs text-muted-foreground", children: l ? "Sign above" : "Signature captured" }),
1896
+ /* @__PURE__ */ t.jsx("p", { className: "text-xs text-muted-foreground", children: i ? "Sign above" : "Signature captured" }),
1754
1897
  /* @__PURE__ */ t.jsxs(
1755
1898
  P,
1756
1899
  {
@@ -1758,9 +1901,9 @@ function ht({ value: e, onChange: r, readonly: n }) {
1758
1901
  variant: "outline",
1759
1902
  size: "sm",
1760
1903
  onClick: f,
1761
- disabled: n || l,
1904
+ disabled: s || i,
1762
1905
  children: [
1763
- /* @__PURE__ */ t.jsx(Ut, { className: "w-4 h-4 mr-2" }),
1906
+ /* @__PURE__ */ t.jsx(Xt, { className: "w-4 h-4 mr-2" }),
1764
1907
  "Clear"
1765
1908
  ]
1766
1909
  }
@@ -1768,15 +1911,15 @@ function ht({ value: e, onChange: r, readonly: n }) {
1768
1911
  ] })
1769
1912
  ] });
1770
1913
  }
1771
- const Fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1914
+ const Dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1772
1915
  __proto__: null,
1773
- SignatureField: ht
1916
+ SignatureField: wt
1774
1917
  }, Symbol.toStringTag, { value: "Module" }));
1775
- function gt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1776
- const [i, l] = k.useState(!1), o = n || s.schema, c = (p) => `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(p)}`, m = () => {
1918
+ function St({ value: e, onChange: r, field: s, readonly: l, ...n }) {
1919
+ const [a, i] = E.useState(!1), o = s || n.schema, c = (p) => `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(p)}`, m = () => {
1777
1920
  e && navigator.clipboard.writeText(e);
1778
1921
  };
1779
- return a ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-3", children: [
1922
+ return l ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-3", children: [
1780
1923
  /* @__PURE__ */ t.jsx("span", { className: "text-sm flex-1 truncate", children: e || "-" }),
1781
1924
  e && /* @__PURE__ */ t.jsxs(
1782
1925
  P,
@@ -1784,10 +1927,10 @@ function gt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1784
1927
  type: "button",
1785
1928
  variant: "outline",
1786
1929
  size: "sm",
1787
- onClick: () => l(!i),
1930
+ onClick: () => i(!a),
1788
1931
  children: [
1789
- /* @__PURE__ */ t.jsx(Fe, { className: "w-4 h-4 mr-2" }),
1790
- i ? "Hide" : "Show",
1932
+ /* @__PURE__ */ t.jsx(Ae, { className: "w-4 h-4 mr-2" }),
1933
+ a ? "Hide" : "Show",
1791
1934
  " QR"
1792
1935
  ]
1793
1936
  }
@@ -1795,14 +1938,14 @@ function gt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1795
1938
  ] }) : /* @__PURE__ */ t.jsxs("div", { className: "space-y-3", children: [
1796
1939
  /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
1797
1940
  /* @__PURE__ */ t.jsx(
1798
- w,
1941
+ T,
1799
1942
  {
1800
1943
  type: "text",
1801
1944
  value: e || "",
1802
1945
  onChange: (p) => r(p.target.value),
1803
1946
  placeholder: o?.placeholder || "Enter text for QR code",
1804
- disabled: a || s.disabled,
1805
- className: s.className
1947
+ disabled: l || n.disabled,
1948
+ className: n.className
1806
1949
  }
1807
1950
  ),
1808
1951
  e && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
@@ -1813,7 +1956,7 @@ function gt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1813
1956
  variant: "outline",
1814
1957
  size: "sm",
1815
1958
  onClick: m,
1816
- children: /* @__PURE__ */ t.jsx(pe, { className: "w-4 h-4" })
1959
+ children: /* @__PURE__ */ t.jsx(Se, { className: "w-4 h-4" })
1817
1960
  }
1818
1961
  ),
1819
1962
  /* @__PURE__ */ t.jsx(
@@ -1822,13 +1965,13 @@ function gt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1822
1965
  type: "button",
1823
1966
  variant: "outline",
1824
1967
  size: "sm",
1825
- onClick: () => l(!i),
1826
- children: /* @__PURE__ */ t.jsx(Fe, { className: "w-4 h-4" })
1968
+ onClick: () => i(!a),
1969
+ children: /* @__PURE__ */ t.jsx(Ae, { className: "w-4 h-4" })
1827
1970
  }
1828
1971
  )
1829
1972
  ] })
1830
1973
  ] }),
1831
- i && e && /* @__PURE__ */ t.jsx("div", { className: "border rounded p-4 bg-white flex justify-center", children: /* @__PURE__ */ t.jsx(
1974
+ a && e && /* @__PURE__ */ t.jsx("div", { className: "border rounded p-4 bg-white flex justify-center", children: /* @__PURE__ */ t.jsx(
1832
1975
  "img",
1833
1976
  {
1834
1977
  src: c(e),
@@ -1843,31 +1986,31 @@ function gt({ value: e, onChange: r, field: n, readonly: a, ...s }) {
1843
1986
  ] })
1844
1987
  ] });
1845
1988
  }
1846
- const Sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1989
+ const Mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1847
1990
  __proto__: null,
1848
- QRCodeField: gt
1991
+ QRCodeField: St
1849
1992
  }, Symbol.toStringTag, { value: "Module" }));
1850
- function bt({
1993
+ function Ft({
1851
1994
  value: e,
1852
1995
  onChange: r,
1853
- field: n,
1854
- readonly: a,
1855
- className: s,
1856
- ...i
1996
+ field: s,
1997
+ readonly: l,
1998
+ className: n,
1999
+ ...a
1857
2000
  }) {
1858
- const l = e || [], o = n || i.schema, c = () => {
2001
+ const i = e || [], o = s || a.schema, c = () => {
1859
2002
  const f = {
1860
2003
  id: `new-${Date.now()}`,
1861
2004
  label: "New Related Record"
1862
2005
  };
1863
- r([...l, f]);
2006
+ r([...i, f]);
1864
2007
  }, m = (f) => {
1865
- r(l.filter((u) => u.id !== f));
2008
+ r(i.filter((u) => u.id !== f));
1866
2009
  }, p = (f) => {
1867
2010
  console.log("View detail:", f);
1868
2011
  };
1869
- return a ? /* @__PURE__ */ t.jsxs("div", { className: z("space-y-2", s), children: [
1870
- l.length === 0 ? /* @__PURE__ */ t.jsx("span", { className: "text-sm text-muted-foreground", children: "No related records" }) : l.map((f) => /* @__PURE__ */ t.jsxs(
2012
+ return l ? /* @__PURE__ */ t.jsxs("div", { className: B("space-y-2", n), children: [
2013
+ i.length === 0 ? /* @__PURE__ */ t.jsx("span", { className: "text-sm text-muted-foreground", children: "No related records" }) : i.map((f) => /* @__PURE__ */ t.jsxs(
1871
2014
  "div",
1872
2015
  {
1873
2016
  className: "flex items-center justify-between p-2 border rounded hover:bg-muted/50",
@@ -1880,7 +2023,7 @@ function bt({
1880
2023
  variant: "ghost",
1881
2024
  size: "sm",
1882
2025
  onClick: () => p(f),
1883
- children: /* @__PURE__ */ t.jsx(Se, { className: "w-4 h-4" })
2026
+ children: /* @__PURE__ */ t.jsx($e, { className: "w-4 h-4" })
1884
2027
  }
1885
2028
  )
1886
2029
  ]
@@ -1888,19 +2031,19 @@ function bt({
1888
2031
  f.id
1889
2032
  )),
1890
2033
  /* @__PURE__ */ t.jsxs("p", { className: "text-xs text-muted-foreground", children: [
1891
- l.length,
2034
+ i.length,
1892
2035
  " ",
1893
- l.length === 1 ? "record" : "records"
2036
+ i.length === 1 ? "record" : "records"
1894
2037
  ] })
1895
- ] }) : /* @__PURE__ */ t.jsxs("div", { className: z("space-y-3", s), children: [
2038
+ ] }) : /* @__PURE__ */ t.jsxs("div", { className: B("space-y-3", n), children: [
1896
2039
  /* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
1897
- l.map((f) => /* @__PURE__ */ t.jsxs(
2040
+ i.map((f) => /* @__PURE__ */ t.jsxs(
1898
2041
  "div",
1899
2042
  {
1900
2043
  className: "flex items-center justify-between gap-2 p-2 border rounded hover:bg-muted/50",
1901
2044
  children: [
1902
2045
  /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2 flex-1", children: [
1903
- /* @__PURE__ */ t.jsx(M, { variant: "outline", children: f.id }),
2046
+ /* @__PURE__ */ t.jsx(Z, { variant: "outline", children: f.id }),
1904
2047
  /* @__PURE__ */ t.jsx("span", { className: "text-sm flex-1", children: f.label })
1905
2048
  ] }),
1906
2049
  /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
@@ -1911,7 +2054,7 @@ function bt({
1911
2054
  variant: "ghost",
1912
2055
  size: "sm",
1913
2056
  onClick: () => p(f),
1914
- children: /* @__PURE__ */ t.jsx(Se, { className: "w-4 h-4" })
2057
+ children: /* @__PURE__ */ t.jsx($e, { className: "w-4 h-4" })
1915
2058
  }
1916
2059
  ),
1917
2060
  /* @__PURE__ */ t.jsx(
@@ -1921,8 +2064,8 @@ function bt({
1921
2064
  variant: "ghost",
1922
2065
  size: "sm",
1923
2066
  onClick: () => m(f.id),
1924
- disabled: i.disabled,
1925
- children: /* @__PURE__ */ t.jsx(W, { className: "w-4 h-4" })
2067
+ disabled: a.disabled,
2068
+ children: /* @__PURE__ */ t.jsx(ie, { className: "w-4 h-4" })
1926
2069
  }
1927
2070
  )
1928
2071
  ] })
@@ -1930,7 +2073,7 @@ function bt({
1930
2073
  },
1931
2074
  f.id
1932
2075
  )),
1933
- l.length === 0 && /* @__PURE__ */ t.jsx("div", { className: "text-sm text-muted-foreground text-center py-4 border border-dashed rounded bg-muted/20", children: "No related records" })
2076
+ i.length === 0 && /* @__PURE__ */ t.jsx("div", { className: "text-sm text-muted-foreground text-center py-4 border border-dashed rounded bg-muted/20", children: "No related records" })
1934
2077
  ] }),
1935
2078
  /* @__PURE__ */ t.jsxs(
1936
2079
  P,
@@ -1939,9 +2082,9 @@ function bt({
1939
2082
  variant: "outline",
1940
2083
  className: "w-full",
1941
2084
  onClick: c,
1942
- disabled: i.disabled,
2085
+ disabled: a.disabled,
1943
2086
  children: [
1944
- /* @__PURE__ */ t.jsx(Vt, { className: "w-4 h-4 mr-2" }),
2087
+ /* @__PURE__ */ t.jsx(je, { className: "w-4 h-4 mr-2" }),
1945
2088
  "Add ",
1946
2089
  o?.label || "Record"
1947
2090
  ]
@@ -1949,11 +2092,28 @@ function bt({
1949
2092
  )
1950
2093
  ] });
1951
2094
  }
1952
- const Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2095
+ const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1953
2096
  __proto__: null,
1954
- MasterDetailField: bt
2097
+ MasterDetailField: Ft
1955
2098
  }, Symbol.toStringTag, { value: "Module" }));
1956
- function Pr(e, r = "USD") {
2099
+ function Y(e) {
2100
+ if (e == null || typeof e == "string" || typeof e == "number" || typeof e == "boolean") return e;
2101
+ if (e instanceof Date) return e.toISOString();
2102
+ if (Array.isArray(e))
2103
+ return e.map((r) => {
2104
+ if (r != null && typeof r == "object") {
2105
+ const s = r;
2106
+ return String(s.name || s.label || s.id || s._id || "[Object]");
2107
+ }
2108
+ return String(r);
2109
+ }).join(", ");
2110
+ if (typeof e == "object") {
2111
+ const r = e;
2112
+ return "$numberDecimal" in r ? Number(r.$numberDecimal) : "$oid" in r ? String(r.$oid) : "$date" in r ? String(r.$date) : String(r.name || r.label || r.id || r._id || "[Object]");
2113
+ }
2114
+ return String(e);
2115
+ }
2116
+ function Ir(e, r = "USD") {
1957
2117
  try {
1958
2118
  return new Intl.NumberFormat("en-US", {
1959
2119
  style: "currency",
@@ -1963,7 +2123,7 @@ function Pr(e, r = "USD") {
1963
2123
  return `${r} ${e.toFixed(2)}`;
1964
2124
  }
1965
2125
  }
1966
- function Zr(e, r = "USD") {
2126
+ function ds(e, r = "USD") {
1967
2127
  try {
1968
2128
  return new Intl.NumberFormat("en-US", {
1969
2129
  style: "currency",
@@ -1975,41 +2135,41 @@ function Zr(e, r = "USD") {
1975
2135
  return `${r} ${e}`;
1976
2136
  }
1977
2137
  }
1978
- function Tr(e, r = 0) {
2138
+ function Ur(e, r = 0) {
1979
2139
  return `${(e > -1 && e < 1 ? e * 100 : e).toFixed(r)}%`;
1980
2140
  }
1981
- function ue(e) {
2141
+ function ve(e) {
1982
2142
  return e.replace(/[_-]/g, " ").replace(/\b\w/g, (r) => r.toUpperCase());
1983
2143
  }
1984
- function Or(e) {
2144
+ function Vr(e) {
1985
2145
  if (!e) return "-";
1986
2146
  const r = typeof e == "string" ? new Date(e) : e;
1987
2147
  if (isNaN(r.getTime())) return "-";
1988
- const n = /* @__PURE__ */ new Date(), a = new Date(n.getFullYear(), n.getMonth(), n.getDate()), i = new Date(r.getFullYear(), r.getMonth(), r.getDate()).getTime() - a.getTime(), l = Math.round(i / (1e3 * 60 * 60 * 24));
1989
- if (l === 0) return "Today";
1990
- if (l === 1) return "Tomorrow";
1991
- if (l === -1) return "Yesterday";
1992
- if (l < -1) {
1993
- const o = Math.abs(l);
1994
- return o <= 7 ? `Overdue ${o}d` : me(r);
2148
+ const s = /* @__PURE__ */ new Date(), l = new Date(s.getFullYear(), s.getMonth(), s.getDate()), a = new Date(r.getFullYear(), r.getMonth(), r.getDate()).getTime() - l.getTime(), i = Math.round(a / (1e3 * 60 * 60 * 24));
2149
+ if (i === 0) return "Today";
2150
+ if (i === 1) return "Tomorrow";
2151
+ if (i === -1) return "Yesterday";
2152
+ if (i < -1) {
2153
+ const o = Math.abs(i);
2154
+ return o <= 7 ? `Overdue ${o}d` : _e(r);
1995
2155
  }
1996
- return l > 1 && l <= 7 ? `In ${l} days` : me(r);
2156
+ return i > 1 && i <= 7 ? `In ${i} days` : _e(r);
1997
2157
  }
1998
- function me(e, r) {
2158
+ function _e(e, r) {
1999
2159
  if (!e) return "-";
2000
- const n = typeof e == "string" ? new Date(e) : e;
2001
- if (isNaN(n.getTime())) return "-";
2160
+ const s = typeof e == "string" ? new Date(e) : e;
2161
+ if (isNaN(s.getTime())) return "-";
2002
2162
  if (r === "short") {
2003
- const a = n.toLocaleDateString("en-US", { month: "short" }), s = n.getDate(), i = String(n.getFullYear()).slice(-2);
2004
- return `${a} ${s}, '${i}`;
2163
+ const l = s.toLocaleDateString("en-US", { month: "short" }), n = s.getDate(), a = String(s.getFullYear()).slice(-2);
2164
+ return `${l} ${n}, '${a}`;
2005
2165
  }
2006
- return r === "relative" ? Or(n) : n.toLocaleDateString(void 0, {
2166
+ return r === "relative" ? Vr(s) : s.toLocaleDateString(void 0, {
2007
2167
  year: "numeric",
2008
2168
  month: "short",
2009
2169
  day: "numeric"
2010
2170
  });
2011
2171
  }
2012
- function Kr(e) {
2172
+ function us(e) {
2013
2173
  if (!e) return "-";
2014
2174
  const r = typeof e == "string" ? new Date(e) : e;
2015
2175
  return isNaN(r.getTime()) ? "-" : r.toLocaleDateString(void 0, {
@@ -2020,45 +2180,49 @@ function Kr(e) {
2020
2180
  minute: "2-digit"
2021
2181
  });
2022
2182
  }
2023
- function D({ value: e }) {
2024
- return /* @__PURE__ */ t.jsx("span", { className: "truncate", children: e != null && e !== "" ? String(e) : "-" });
2183
+ function K({ value: e }) {
2184
+ const r = Y(e);
2185
+ return /* @__PURE__ */ t.jsx("span", { className: "truncate", children: r != null && r !== "" ? String(r) : "-" });
2025
2186
  }
2026
- function Rr({ value: e, field: r }) {
2187
+ function Br({ value: e, field: r }) {
2027
2188
  if (e == null) return /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "-" });
2028
- const a = r.precision ?? 0, s = typeof e == "number" ? new Intl.NumberFormat("en-US", { minimumFractionDigits: a, maximumFractionDigits: a }).format(e) : e;
2029
- return /* @__PURE__ */ t.jsx("span", { className: "tabular-nums", children: s });
2189
+ const s = Y(e), n = r.precision ?? 0, a = Number(s), i = isNaN(a) ? String(s) : new Intl.NumberFormat("en-US", { minimumFractionDigits: n, maximumFractionDigits: n }).format(a);
2190
+ return /* @__PURE__ */ t.jsx("span", { className: "tabular-nums", children: i });
2030
2191
  }
2031
- function kr({ value: e, field: r }) {
2192
+ function Yr({ value: e, field: r }) {
2032
2193
  if (e == null) return /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "-" });
2033
- const a = r.currency || "USD", s = Pr(Number(e), a);
2034
- return /* @__PURE__ */ t.jsx("span", { className: "tabular-nums font-medium whitespace-nowrap", children: s });
2194
+ const s = Y(e), n = r.currency || "USD", a = Number(s), i = isNaN(a) ? String(s) : Ir(a, n);
2195
+ return /* @__PURE__ */ t.jsx("span", { className: "tabular-nums font-medium whitespace-nowrap", children: i });
2035
2196
  }
2036
- const Ar = /progress|completion/;
2037
- function $r({ value: e, field: r }) {
2197
+ const qr = /progress|completion/;
2198
+ function Jr({ value: e, field: r }) {
2038
2199
  if (e == null) return /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "-" });
2039
- const a = r.precision ?? 0, s = Number(e), i = Ar.test(r?.name?.toLowerCase() || ""), l = i ? s : s > -1 && s < 1 ? s * 100 : s, o = i ? `${s.toFixed(a)}%` : Tr(s, a), c = Math.max(0, Math.min(100, l));
2200
+ const s = Y(e), n = r.precision ?? 0, a = Number(s);
2201
+ if (isNaN(a))
2202
+ return /* @__PURE__ */ t.jsx("span", { className: "tabular-nums whitespace-nowrap", children: String(s) });
2203
+ const i = qr.test(r?.name?.toLowerCase() || ""), o = i ? a : a > -1 && a < 1 ? a * 100 : a, c = i ? `${a.toFixed(n)}%` : Ur(a, n), m = Math.max(0, Math.min(100, o));
2040
2204
  return /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
2041
2205
  /* @__PURE__ */ t.jsx(
2042
2206
  "div",
2043
2207
  {
2044
2208
  className: "h-1.5 w-16 rounded-full bg-muted overflow-hidden flex-shrink-0",
2045
2209
  role: "progressbar",
2046
- "aria-valuenow": c,
2210
+ "aria-valuenow": m,
2047
2211
  "aria-valuemin": 0,
2048
2212
  "aria-valuemax": 100,
2049
2213
  children: /* @__PURE__ */ t.jsx(
2050
2214
  "div",
2051
2215
  {
2052
2216
  className: "h-full rounded-full bg-primary transition-all",
2053
- style: { width: `${c}%` }
2217
+ style: { width: `${m}%` }
2054
2218
  }
2055
2219
  )
2056
2220
  }
2057
2221
  ),
2058
- /* @__PURE__ */ t.jsx("span", { className: "tabular-nums whitespace-nowrap", children: o })
2222
+ /* @__PURE__ */ t.jsx("span", { className: "tabular-nums whitespace-nowrap", children: c })
2059
2223
  ] });
2060
2224
  }
2061
- const zr = /* @__PURE__ */ new Set([
2225
+ const Wr = /* @__PURE__ */ new Set([
2062
2226
  "active",
2063
2227
  "is_active",
2064
2228
  "enabled",
@@ -2066,48 +2230,48 @@ const zr = /* @__PURE__ */ new Set([
2066
2230
  "verified",
2067
2231
  "is_verified"
2068
2232
  ]);
2069
- function Er({ value: e, field: r }) {
2233
+ function Gr({ value: e, field: r }) {
2070
2234
  if (e == null)
2071
2235
  return /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground/50 text-xs italic flex items-center justify-center", children: "—" });
2072
- const n = r?.name?.toLowerCase() || "";
2073
- return n === "completed" || n === "is_completed" || n === "done" || n === "is_done" ? /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-center", children: e ? /* @__PURE__ */ t.jsx("div", { className: "size-5 rounded-full bg-green-500 flex items-center justify-center", role: "img", "aria-label": "Completed", "data-testid": "completion-indicator", children: /* @__PURE__ */ t.jsx(he, { className: "size-3 text-white" }) }) : /* @__PURE__ */ t.jsx("div", { className: "size-5 rounded-full border-2 border-muted-foreground/30", role: "img", "aria-label": "Not completed", "data-testid": "completion-indicator" }) }) : zr.has(n) && !e ? /* @__PURE__ */ t.jsxs(M, { variant: "destructive", className: "text-xs", "data-testid": "boolean-warning-badge", children: [
2074
- r?.label || ue(n),
2236
+ const s = r?.name?.toLowerCase() || "";
2237
+ return s === "completed" || s === "is_completed" || s === "done" || s === "is_done" ? /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-center", children: e ? /* @__PURE__ */ t.jsx("div", { className: "size-5 rounded-full bg-green-500 flex items-center justify-center", role: "img", "aria-label": "Completed", "data-testid": "completion-indicator", children: /* @__PURE__ */ t.jsx(Fe, { className: "size-3 text-white" }) }) : /* @__PURE__ */ t.jsx("div", { className: "size-5 rounded-full border-2 border-muted-foreground/30", role: "img", "aria-label": "Not completed", "data-testid": "completion-indicator" }) }) : Wr.has(s) && !e ? /* @__PURE__ */ t.jsxs(Z, { variant: "destructive", className: "text-xs", "data-testid": "boolean-warning-badge", children: [
2238
+ r?.label || ve(s),
2075
2239
  " — Off"
2076
- ] }) : /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ t.jsx(Ee, { checked: !!e, disabled: !0, className: "pointer-events-none" }) });
2240
+ ] }) : /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ t.jsx(Be, { checked: !!e, disabled: !0, className: "pointer-events-none" }) });
2077
2241
  }
2078
- function Dr({ value: e, field: r }) {
2242
+ function Qr({ value: e, field: r }) {
2079
2243
  if (!e) return /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "-" });
2080
- const a = r.format || "relative", s = me(e, a), i = typeof e == "string" ? new Date(e) : e, l = i instanceof Date && !isNaN(i.getTime()), o = /* @__PURE__ */ new Date();
2081
- o.setHours(0, 0, 0, 0);
2082
- const c = l && i < o, m = l ? i.toISOString() : String(e);
2244
+ const s = Y(e), n = r.format || "relative", a = _e(s, n), i = typeof s == "string" ? new Date(s) : s, o = i instanceof Date && !isNaN(i.getTime()), c = /* @__PURE__ */ new Date();
2245
+ c.setHours(0, 0, 0, 0);
2246
+ const m = o && i < c, p = o ? i.toISOString() : String(s);
2083
2247
  return /* @__PURE__ */ t.jsx(
2084
2248
  "span",
2085
2249
  {
2086
- className: `tabular-nums${c ? " text-red-600" : ""}`,
2087
- title: m,
2088
- children: s
2250
+ className: `tabular-nums${m ? " text-red-600" : ""}`,
2251
+ title: p,
2252
+ children: a
2089
2253
  }
2090
2254
  );
2091
2255
  }
2092
- function Mr({ value: e }) {
2256
+ function Hr({ value: e }) {
2093
2257
  if (!e) return /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "-" });
2094
- const r = typeof e == "string" ? new Date(e) : e;
2095
- if (isNaN(r.getTime())) return /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "-" });
2096
- const n = r.toLocaleDateString(void 0, {
2258
+ const r = Y(e), s = typeof r == "string" ? new Date(r) : r;
2259
+ if (!(s instanceof Date) || isNaN(s.getTime())) return /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "-" });
2260
+ const l = s.toLocaleDateString(void 0, {
2097
2261
  month: "numeric",
2098
2262
  day: "numeric",
2099
2263
  year: "numeric"
2100
- }), a = r.toLocaleTimeString(void 0, {
2264
+ }), n = s.toLocaleTimeString(void 0, {
2101
2265
  hour: "numeric",
2102
2266
  minute: "2-digit",
2103
2267
  hour12: !0
2104
2268
  }).toLowerCase();
2105
2269
  return /* @__PURE__ */ t.jsxs("span", { className: "tabular-nums text-sm whitespace-nowrap", children: [
2106
- /* @__PURE__ */ t.jsx("span", { children: n }),
2107
- /* @__PURE__ */ t.jsx("span", { className: "ml-2 text-muted-foreground", children: a })
2270
+ /* @__PURE__ */ t.jsx("span", { children: l }),
2271
+ /* @__PURE__ */ t.jsx("span", { className: "ml-2 text-muted-foreground", children: n })
2108
2272
  ] });
2109
2273
  }
2110
- const Lr = {
2274
+ const Xr = {
2111
2275
  // Priority values
2112
2276
  critical: "red",
2113
2277
  urgent: "red",
@@ -2141,7 +2305,7 @@ const Lr = {
2141
2305
  overdue: "red",
2142
2306
  delivered: "purple",
2143
2307
  archived: "indigo"
2144
- }, Ir = {
2308
+ }, Kr = {
2145
2309
  gray: "bg-gray-100 text-gray-800 border-gray-300",
2146
2310
  red: "bg-red-100 text-red-800 border-red-300",
2147
2311
  orange: "bg-orange-100 text-orange-800 border-orange-300",
@@ -2152,18 +2316,18 @@ const Lr = {
2152
2316
  purple: "bg-purple-100 text-purple-800 border-purple-300",
2153
2317
  pink: "bg-pink-100 text-pink-800 border-pink-300"
2154
2318
  };
2155
- function ke(e, r) {
2156
- const n = e || (r ? Lr[String(r).toLowerCase().replace(/[\s-]/g, "_")] : void 0);
2157
- return Ir[n || ""] || "bg-muted text-muted-foreground border-border";
2319
+ function Ie(e, r) {
2320
+ const s = e || (r ? Xr[String(r).toLowerCase().replace(/[\s-]/g, "_")] : void 0);
2321
+ return Kr[s || ""] || "bg-muted text-muted-foreground border-border";
2158
2322
  }
2159
- function se({ value: e, field: r }) {
2160
- const a = r.options || [];
2323
+ function he({ value: e, field: r }) {
2324
+ const l = r.options || [];
2161
2325
  if (!e) return /* @__PURE__ */ t.jsx("span", { children: "-" });
2162
2326
  if (Array.isArray(e))
2163
2327
  return /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-1", children: e.map((o, c) => {
2164
- const m = a.find((u) => u.value === o), p = m?.label || ue(String(o)), f = ke(m?.color, o);
2328
+ const m = l.find((u) => u.value === o), p = m?.label || ve(String(o)), f = Ie(m?.color, o);
2165
2329
  return /* @__PURE__ */ t.jsx(
2166
- M,
2330
+ Z,
2167
2331
  {
2168
2332
  variant: "outline",
2169
2333
  className: f,
@@ -2172,21 +2336,21 @@ function se({ value: e, field: r }) {
2172
2336
  c
2173
2337
  );
2174
2338
  }) });
2175
- const s = a.find((o) => o.value === e), i = s?.label || ue(String(e)), l = ke(s?.color, e);
2339
+ const n = l.find((o) => o.value === e), a = n?.label || ve(String(e)), i = Ie(n?.color, e);
2176
2340
  return /* @__PURE__ */ t.jsx(
2177
- M,
2341
+ Z,
2178
2342
  {
2179
2343
  variant: "outline",
2180
- className: l,
2181
- children: i
2344
+ className: i,
2345
+ children: a
2182
2346
  }
2183
2347
  );
2184
2348
  }
2185
- function Ur({ value: e }) {
2349
+ function Zr({ value: e }) {
2186
2350
  if (!e) return /* @__PURE__ */ t.jsx("span", { children: "-" });
2187
- const [r, n] = k.useState(!1), a = (s) => {
2188
- s.stopPropagation(), s.preventDefault(), navigator.clipboard.writeText(String(e)).then(() => {
2189
- n(!0), setTimeout(() => n(!1), 2e3);
2351
+ const r = String(Y(e) ?? ""), [s, l] = E.useState(!1), n = (a) => {
2352
+ a.stopPropagation(), a.preventDefault(), navigator.clipboard.writeText(r).then(() => {
2353
+ l(!0), setTimeout(() => l(!1), 2e3);
2190
2354
  }).catch(() => {
2191
2355
  });
2192
2356
  };
@@ -2200,9 +2364,9 @@ function Ur({ value: e }) {
2200
2364
  children: /* @__PURE__ */ t.jsx(
2201
2365
  "a",
2202
2366
  {
2203
- href: `mailto:${e}`,
2204
- onClick: (s) => s.stopPropagation(),
2205
- children: e
2367
+ href: `mailto:${r}`,
2368
+ onClick: (a) => a.stopPropagation(),
2369
+ children: r
2206
2370
  }
2207
2371
  )
2208
2372
  }
@@ -2212,15 +2376,17 @@ function Ur({ value: e }) {
2212
2376
  {
2213
2377
  type: "button",
2214
2378
  className: "opacity-0 group-hover/email:opacity-100 transition-opacity p-0.5 rounded hover:bg-muted",
2215
- onClick: a,
2379
+ onClick: n,
2216
2380
  "aria-label": "Copy email",
2217
- children: r ? /* @__PURE__ */ t.jsx(he, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ t.jsx(pe, { className: "h-3 w-3 text-muted-foreground" })
2381
+ children: s ? /* @__PURE__ */ t.jsx(Fe, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ t.jsx(Se, { className: "h-3 w-3 text-muted-foreground" })
2218
2382
  }
2219
2383
  )
2220
2384
  ] });
2221
2385
  }
2222
- function Vr({ value: e }) {
2223
- return e ? /* @__PURE__ */ t.jsx(
2386
+ function es({ value: e }) {
2387
+ if (!e) return /* @__PURE__ */ t.jsx("span", { children: "-" });
2388
+ const r = String(Y(e) ?? "");
2389
+ return /* @__PURE__ */ t.jsx(
2224
2390
  P,
2225
2391
  {
2226
2392
  variant: "link",
@@ -2229,21 +2395,21 @@ function Vr({ value: e }) {
2229
2395
  children: /* @__PURE__ */ t.jsx(
2230
2396
  "a",
2231
2397
  {
2232
- href: e,
2398
+ href: r,
2233
2399
  target: "_blank",
2234
2400
  rel: "noopener noreferrer",
2235
- onClick: (r) => r.stopPropagation(),
2236
- children: e
2401
+ onClick: (s) => s.stopPropagation(),
2402
+ children: r
2237
2403
  }
2238
2404
  )
2239
2405
  }
2240
- ) : /* @__PURE__ */ t.jsx("span", { children: "-" });
2406
+ );
2241
2407
  }
2242
- function Br({ value: e }) {
2408
+ function ts({ value: e }) {
2243
2409
  if (!e) return /* @__PURE__ */ t.jsx("span", { children: "-" });
2244
- const [r, n] = k.useState(!1), a = (s) => {
2245
- s.stopPropagation(), s.preventDefault(), navigator.clipboard.writeText(String(e)).then(() => {
2246
- n(!0), setTimeout(() => n(!1), 2e3);
2410
+ const r = String(Y(e) ?? ""), [s, l] = E.useState(!1), n = (a) => {
2411
+ a.stopPropagation(), a.preventDefault(), navigator.clipboard.writeText(r).then(() => {
2412
+ l(!0), setTimeout(() => l(!1), 2e3);
2247
2413
  }).catch(() => {
2248
2414
  });
2249
2415
  };
@@ -2251,12 +2417,12 @@ function Br({ value: e }) {
2251
2417
  /* @__PURE__ */ t.jsxs(
2252
2418
  "a",
2253
2419
  {
2254
- href: `tel:${e}`,
2420
+ href: `tel:${r}`,
2255
2421
  className: "inline-flex items-center gap-1 text-blue-600 hover:text-blue-800",
2256
- onClick: (s) => s.stopPropagation(),
2422
+ onClick: (a) => a.stopPropagation(),
2257
2423
  children: [
2258
- /* @__PURE__ */ t.jsx(Bt, { className: "h-3 w-3" }),
2259
- e
2424
+ /* @__PURE__ */ t.jsx(Kt, { className: "h-3 w-3" }),
2425
+ r
2260
2426
  ]
2261
2427
  }
2262
2428
  ),
@@ -2265,36 +2431,36 @@ function Br({ value: e }) {
2265
2431
  {
2266
2432
  type: "button",
2267
2433
  className: "opacity-0 group-hover/phone:opacity-100 transition-opacity p-0.5 rounded hover:bg-muted",
2268
- onClick: a,
2434
+ onClick: n,
2269
2435
  "aria-label": "Copy phone number",
2270
- children: r ? /* @__PURE__ */ t.jsx(he, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ t.jsx(pe, { className: "h-3 w-3 text-muted-foreground" })
2436
+ children: s ? /* @__PURE__ */ t.jsx(Fe, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ t.jsx(Se, { className: "h-3 w-3 text-muted-foreground" })
2271
2437
  }
2272
2438
  )
2273
2439
  ] });
2274
2440
  }
2275
- function Yr({ value: e, field: r }) {
2441
+ function rs({ value: e, field: r }) {
2276
2442
  if (!e) return /* @__PURE__ */ t.jsx("span", { children: "-" });
2277
2443
  if (r.multiple, Array.isArray(e)) {
2278
- const s = e.length;
2444
+ const n = e.length;
2279
2445
  return /* @__PURE__ */ t.jsxs("span", { className: "text-sm text-gray-600", children: [
2280
- s,
2446
+ n,
2281
2447
  " ",
2282
- s === 1 ? "file" : "files"
2448
+ n === 1 ? "file" : "files"
2283
2449
  ] });
2284
2450
  }
2285
- const a = e.name || e.original_name || "File";
2286
- return /* @__PURE__ */ t.jsx("span", { className: "text-sm truncate", children: a });
2451
+ const l = e.name || e.original_name || "File";
2452
+ return /* @__PURE__ */ t.jsx("span", { className: "text-sm truncate", children: l });
2287
2453
  }
2288
- function qr({ value: e }) {
2454
+ function ss({ value: e }) {
2289
2455
  return e ? Array.isArray(e) ? /* @__PURE__ */ t.jsxs("div", { className: "flex -space-x-2", children: [
2290
- e.slice(0, 3).map((r, n) => /* @__PURE__ */ t.jsx(
2456
+ e.slice(0, 3).map((r, s) => /* @__PURE__ */ t.jsx(
2291
2457
  "img",
2292
2458
  {
2293
2459
  src: r.url || "",
2294
- alt: r.name || `Image ${n + 1}`,
2460
+ alt: r.name || `Image ${s + 1}`,
2295
2461
  className: "size-8 rounded-md border-2 border-white object-cover"
2296
2462
  },
2297
- n
2463
+ s
2298
2464
  )),
2299
2465
  e.length > 3 && /* @__PURE__ */ t.jsxs("div", { className: "size-8 rounded-md border-2 border-white bg-gray-100 flex items-center justify-center text-xs font-medium text-gray-600", children: [
2300
2466
  "+",
@@ -2309,113 +2475,114 @@ function qr({ value: e }) {
2309
2475
  }
2310
2476
  ) : /* @__PURE__ */ t.jsx("span", { children: "-" });
2311
2477
  }
2312
- function ne({ value: e, field: r }) {
2478
+ function ge({ value: e, field: r }) {
2313
2479
  if (e == null || e === "") return /* @__PURE__ */ t.jsx("span", { children: "-" });
2314
- const n = r.options || [], a = (s) => {
2315
- if (n.length > 0) {
2316
- const i = n.find((l) => String(l.value) === String(s));
2317
- if (i) return i.label;
2480
+ const s = r.options || [], l = (n) => {
2481
+ if (s.length > 0) {
2482
+ const a = s.find((i) => String(i.value) === String(n));
2483
+ if (a) return a.label;
2318
2484
  }
2319
- return String(s);
2485
+ return String(n);
2320
2486
  };
2321
2487
  if (Array.isArray(e))
2322
- return /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-1", children: e.map((s, i) => {
2323
- let l;
2324
- return s != null && typeof s == "object" ? l = s.name || s.label || s._id || String(s) : l = a(s), /* @__PURE__ */ t.jsx(
2488
+ return /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-1", children: e.map((n, a) => {
2489
+ let i;
2490
+ return n != null && typeof n == "object" ? i = n.name || n.label || n.id || n._id || String(n) : i = l(n), /* @__PURE__ */ t.jsx(
2325
2491
  "span",
2326
2492
  {
2327
2493
  className: "inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-800",
2328
- children: l
2494
+ children: i
2329
2495
  },
2330
- i
2496
+ a
2331
2497
  );
2332
2498
  }) });
2333
2499
  if (typeof e == "object" && e !== null) {
2334
- const s = e.name || e.label || e._id || "[Object]";
2335
- return /* @__PURE__ */ t.jsx("span", { className: "truncate", children: s });
2500
+ const n = e.name || e.label || e.id || e._id || "[Object]";
2501
+ return /* @__PURE__ */ t.jsx("span", { className: "truncate", children: n });
2336
2502
  }
2337
- return /* @__PURE__ */ t.jsx("span", { className: "truncate", children: a(e) });
2503
+ return /* @__PURE__ */ t.jsx("span", { className: "truncate", children: l(e) });
2338
2504
  }
2339
- function Ae({ value: e }) {
2340
- return /* @__PURE__ */ t.jsx("span", { className: "text-gray-700 font-mono text-sm", children: e != null ? String(e) : "-" });
2505
+ function Ue({ value: e }) {
2506
+ const r = Y(e);
2507
+ return /* @__PURE__ */ t.jsx("span", { className: "text-gray-700 font-mono text-sm", children: r != null ? String(r) : "-" });
2341
2508
  }
2342
- function ae({ value: e }) {
2509
+ function be({ value: e }) {
2343
2510
  if (!e) return /* @__PURE__ */ t.jsx("span", { children: "-" });
2344
2511
  if (typeof e != "object")
2345
2512
  return /* @__PURE__ */ t.jsx("span", { className: "truncate", children: String(e) });
2346
2513
  if (Array.isArray(e))
2347
2514
  return /* @__PURE__ */ t.jsxs("div", { className: "flex -space-x-2", children: [
2348
- e.slice(0, 3).map((a, s) => {
2349
- if (typeof a != "object" || a === null)
2350
- return /* @__PURE__ */ t.jsx("span", { className: "truncate text-sm", children: String(a) }, s);
2351
- const i = a.name || a.username || "User", l = i.split(" ").map((o) => o[0]).join("").toUpperCase().slice(0, 2);
2515
+ e.slice(0, 3).map((l, n) => {
2516
+ if (typeof l != "object" || l === null)
2517
+ return /* @__PURE__ */ t.jsx("span", { className: "truncate text-sm", children: String(l) }, n);
2518
+ const a = l.name || l.username || "User", i = a.split(" ").map((o) => o[0]).join("").toUpperCase().slice(0, 2);
2352
2519
  return /* @__PURE__ */ t.jsx(
2353
- L,
2520
+ ee,
2354
2521
  {
2355
2522
  className: "size-8 border-2 border-white",
2356
- title: i,
2357
- children: /* @__PURE__ */ t.jsx(I, { className: "bg-blue-500 text-white text-xs", children: l })
2523
+ title: a,
2524
+ children: /* @__PURE__ */ t.jsx(te, { className: "bg-blue-500 text-white text-xs", children: i })
2358
2525
  },
2359
- s
2526
+ n
2360
2527
  );
2361
2528
  }),
2362
- e.length > 3 && /* @__PURE__ */ t.jsx(L, { className: "size-8 border-2 border-white", children: /* @__PURE__ */ t.jsxs(I, { className: "bg-gray-200 text-gray-600 text-xs", children: [
2529
+ e.length > 3 && /* @__PURE__ */ t.jsx(ee, { className: "size-8 border-2 border-white", children: /* @__PURE__ */ t.jsxs(te, { className: "bg-gray-200 text-gray-600 text-xs", children: [
2363
2530
  "+",
2364
2531
  e.length - 3
2365
2532
  ] }) })
2366
2533
  ] });
2367
- const r = e.name || e.username || "User", n = r.split(" ").map((a) => a[0]).join("").toUpperCase().slice(0, 2);
2534
+ const r = e.name || e.username || "User", s = r.split(" ").map((l) => l[0]).join("").toUpperCase().slice(0, 2);
2368
2535
  return /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
2369
- /* @__PURE__ */ t.jsx(L, { className: "size-8", children: /* @__PURE__ */ t.jsx(I, { className: "bg-blue-500 text-white text-xs", children: n }) }),
2536
+ /* @__PURE__ */ t.jsx(ee, { className: "size-8", children: /* @__PURE__ */ t.jsx(te, { className: "bg-blue-500 text-white text-xs", children: s }) }),
2370
2537
  /* @__PURE__ */ t.jsx("span", { className: "truncate", children: r })
2371
2538
  ] });
2372
2539
  }
2373
- const fe = /* @__PURE__ */ new Map();
2374
- function G(e, r) {
2375
- fe.set(e, r);
2376
- }
2377
- function es(e) {
2378
- return fe.has(e) ? fe.get(e) : {
2379
- text: D,
2380
- textarea: D,
2381
- markdown: D,
2382
- html: D,
2383
- number: Rr,
2384
- currency: kr,
2385
- percent: $r,
2386
- boolean: Er,
2387
- date: Dr,
2388
- datetime: Mr,
2389
- time: D,
2390
- select: se,
2391
- status: se,
2392
- lookup: ne,
2393
- master_detail: ne,
2394
- email: Ur,
2395
- url: Vr,
2396
- phone: Br,
2397
- file: Yr,
2398
- image: qr,
2399
- formula: Ae,
2400
- summary: Ae,
2401
- auto_number: D,
2402
- user: ae,
2403
- owner: ae,
2540
+ const we = /* @__PURE__ */ new Map();
2541
+ function oe(e, r) {
2542
+ we.set(e, r);
2543
+ }
2544
+ function ms(e) {
2545
+ return we.has(e) ? we.get(e) : {
2546
+ text: K,
2547
+ textarea: K,
2548
+ markdown: K,
2549
+ html: K,
2550
+ number: Br,
2551
+ currency: Yr,
2552
+ percent: Jr,
2553
+ boolean: Gr,
2554
+ date: Qr,
2555
+ datetime: Hr,
2556
+ time: K,
2557
+ select: he,
2558
+ status: he,
2559
+ lookup: ge,
2560
+ master_detail: ge,
2561
+ email: Zr,
2562
+ url: es,
2563
+ phone: ts,
2564
+ file: rs,
2565
+ image: ss,
2566
+ formula: Ue,
2567
+ summary: Ue,
2568
+ auto_number: K,
2569
+ user: be,
2570
+ owner: be,
2404
2571
  password: () => /* @__PURE__ */ t.jsx("span", { children: "••••••" }),
2405
- location: D,
2572
+ location: K,
2406
2573
  // Default fallback
2407
2574
  object: () => /* @__PURE__ */ t.jsx("span", { className: "text-gray-500 italic", children: "[Object]" }),
2408
2575
  vector: () => /* @__PURE__ */ t.jsx("span", { className: "text-gray-500 italic", children: "[Vector]" }),
2409
2576
  grid: () => /* @__PURE__ */ t.jsx("span", { className: "text-gray-500 italic", children: "[Grid]" })
2410
- }[e] || D;
2411
- }
2412
- G("lookup", ne);
2413
- G("master_detail", ne);
2414
- G("select", se);
2415
- G("status", se);
2416
- G("user", ae);
2417
- G("owner", ae);
2418
- function ts(e) {
2577
+ }[e] || K;
2578
+ }
2579
+ oe("lookup", ge);
2580
+ oe("master_detail", ge);
2581
+ oe("select", he);
2582
+ oe("status", he);
2583
+ oe("user", be);
2584
+ oe("owner", be);
2585
+ function fs(e) {
2419
2586
  return {
2420
2587
  // Text-based fields
2421
2588
  text: "field:text",
@@ -2455,16 +2622,16 @@ function ts(e) {
2455
2622
  auto_number: "field:auto_number"
2456
2623
  }[e] || "field:text";
2457
2624
  }
2458
- function rs(e) {
2625
+ function xs(e) {
2459
2626
  if (e < 0 || !Number.isFinite(e) || e === 0)
2460
2627
  return "0 B";
2461
2628
  const r = ["B", "KB", "MB", "GB", "TB"];
2462
- let n = e, a = 0;
2463
- for (; n >= 1024 && a < r.length - 1; )
2464
- n /= 1024, a++;
2465
- return `${n.toFixed(a > 0 ? 1 : 0)} ${r[a]}`;
2629
+ let s = e, l = 0;
2630
+ for (; s >= 1024 && l < r.length - 1; )
2631
+ s /= 1024, l++;
2632
+ return `${s.toFixed(l > 0 ? 1 : 0)} ${r[l]}`;
2466
2633
  }
2467
- function ss(e) {
2634
+ function ps(e) {
2468
2635
  const r = {};
2469
2636
  return e.required && (r.required = typeof e.required_message == "string" ? e.required_message : `${e.label || e.name} is required`), e.min_length && (r.minLength = {
2470
2637
  value: e.min_length,
@@ -2489,202 +2656,203 @@ function ss(e) {
2489
2656
  message: "Please enter a valid URL"
2490
2657
  }), e.validate && (r.validate = e.validate), Object.keys(r).length > 0 ? r : void 0;
2491
2658
  }
2492
- function $e(e, r) {
2659
+ function Ve(e, r) {
2493
2660
  if (!e) return !0;
2494
2661
  if (e.field && e.value !== void 0) {
2495
- const n = r[e.field];
2662
+ const s = r[e.field];
2496
2663
  if (e.operator === "=" || e.operator === "==")
2497
- return n === e.value;
2664
+ return s === e.value;
2498
2665
  if (e.operator === "!=")
2499
- return n !== e.value;
2666
+ return s !== e.value;
2500
2667
  if (e.operator === ">")
2501
- return n > e.value;
2668
+ return s > e.value;
2502
2669
  if (e.operator === ">=")
2503
- return n >= e.value;
2670
+ return s >= e.value;
2504
2671
  if (e.operator === "<")
2505
- return n < e.value;
2672
+ return s < e.value;
2506
2673
  if (e.operator === "<=")
2507
- return n <= e.value;
2674
+ return s <= e.value;
2508
2675
  if (e.operator === "in")
2509
- return Array.isArray(e.value) && e.value.includes(n);
2676
+ return Array.isArray(e.value) && e.value.includes(s);
2510
2677
  }
2511
- return e.and && Array.isArray(e.and) ? e.and.every((n) => $e(n, r)) : e.or && Array.isArray(e.or) ? e.or.some((n) => $e(n, r)) : !0;
2512
- }
2513
- function y(e) {
2514
- const r = ({ schema: n, className: a, value: s, ...i }) => {
2515
- const [l, o] = k.useState(s ?? n?.value ?? ""), c = {
2516
- name: n?.name || "field",
2517
- label: n?.label,
2518
- type: n?.type,
2519
- placeholder: n?.placeholder,
2520
- required: n?.required,
2521
- readonly: n?.readonly || n?.readOnly,
2522
- help: n?.help,
2523
- description: n?.description,
2524
- defaultValue: n?.defaultValue || n?.value,
2525
- ...n
2526
- }, m = k.useCallback((f) => {
2527
- o(f), i.onChange && i.onChange(f);
2528
- }, [i]), p = n?.readonly || n?.readOnly || !1;
2678
+ return e.and && Array.isArray(e.and) ? e.and.every((s) => Ve(s, r)) : e.or && Array.isArray(e.or) ? e.or.some((s) => Ve(s, r)) : !0;
2679
+ }
2680
+ function v(e) {
2681
+ const r = ({ schema: s, className: l, value: n, ...a }) => {
2682
+ const [i, o] = E.useState(n ?? s?.value ?? ""), c = {
2683
+ name: s?.name || "field",
2684
+ label: s?.label,
2685
+ type: s?.type,
2686
+ placeholder: s?.placeholder,
2687
+ required: s?.required,
2688
+ readonly: s?.readonly || s?.readOnly,
2689
+ help: s?.help,
2690
+ description: s?.description,
2691
+ defaultValue: s?.defaultValue || s?.value,
2692
+ ...s
2693
+ }, m = E.useCallback((f) => {
2694
+ o(f), a.onChange && a.onChange(f);
2695
+ }, [a]), p = s?.readonly || s?.readOnly || !1;
2529
2696
  return /* @__PURE__ */ t.jsxs(
2530
2697
  "div",
2531
2698
  {
2532
2699
  className: "grid w-full items-center gap-1.5",
2533
- "data-obj-id": n?.id,
2534
- "data-obj-type": n?.type,
2700
+ "data-obj-id": s?.id,
2701
+ "data-obj-type": s?.type,
2535
2702
  children: [
2536
- n?.label && /* @__PURE__ */ t.jsx("label", { htmlFor: n.id, className: n.required ? "after:content-['*'] after:ml-0.5 after:text-red-500" : "", children: n.label }),
2703
+ s?.label && /* @__PURE__ */ t.jsx("label", { htmlFor: s.id, className: s.required ? "after:content-['*'] after:ml-0.5 after:text-red-500" : "", children: s.label }),
2537
2704
  /* @__PURE__ */ t.jsx(
2538
2705
  e,
2539
2706
  {
2540
- value: l,
2707
+ value: i,
2541
2708
  onChange: m,
2542
2709
  field: c,
2543
2710
  readonly: p,
2544
- className: a
2711
+ className: l
2545
2712
  }
2546
2713
  ),
2547
- n?.description && /* @__PURE__ */ t.jsx("p", { className: "text-sm text-gray-500", children: n.description })
2714
+ s?.description && /* @__PURE__ */ t.jsx("p", { className: "text-sm text-gray-500", children: s.description })
2548
2715
  ]
2549
2716
  }
2550
2717
  );
2551
2718
  };
2552
2719
  return r.displayName = `FieldRenderer(${e.displayName || e.name || "Component"})`, r;
2553
2720
  }
2554
- const jt = {
2721
+ const Ct = {
2555
2722
  // Basic fields
2556
- text: () => Promise.resolve().then(() => Wt).then((e) => ({ default: e.TextField })),
2557
- textarea: () => Promise.resolve().then(() => sr).then((e) => ({ default: e.TextAreaField })),
2558
- number: () => Promise.resolve().then(() => Gt).then((e) => ({ default: e.NumberField })),
2559
- boolean: () => Promise.resolve().then(() => Qt).then((e) => ({ default: e.BooleanField })),
2560
- select: () => Promise.resolve().then(() => Ht).then((e) => ({ default: e.SelectField })),
2561
- date: () => Promise.resolve().then(() => Xt).then((e) => ({ default: e.DateField })),
2562
- datetime: () => Promise.resolve().then(() => ar).then((e) => ({ default: e.DateTimeField })),
2563
- time: () => Promise.resolve().then(() => lr).then((e) => ({ default: e.TimeField })),
2723
+ text: () => Promise.resolve().then(() => rr).then((e) => ({ default: e.TextField })),
2724
+ textarea: () => Promise.resolve().then(() => mr).then((e) => ({ default: e.TextAreaField })),
2725
+ number: () => Promise.resolve().then(() => sr).then((e) => ({ default: e.NumberField })),
2726
+ boolean: () => Promise.resolve().then(() => nr).then((e) => ({ default: e.BooleanField })),
2727
+ select: () => Promise.resolve().then(() => ar).then((e) => ({ default: e.SelectField })),
2728
+ date: () => Promise.resolve().then(() => lr).then((e) => ({ default: e.DateField })),
2729
+ datetime: () => Promise.resolve().then(() => gr).then((e) => ({ default: e.DateTimeField })),
2730
+ time: () => Promise.resolve().then(() => br).then((e) => ({ default: e.TimeField })),
2564
2731
  // Contact fields
2565
- email: () => Promise.resolve().then(() => Zt).then((e) => ({ default: e.EmailField })),
2566
- phone: () => Promise.resolve().then(() => Kt).then((e) => ({ default: e.PhoneField })),
2567
- url: () => Promise.resolve().then(() => er).then((e) => ({ default: e.UrlField })),
2732
+ email: () => Promise.resolve().then(() => ir).then((e) => ({ default: e.EmailField })),
2733
+ phone: () => Promise.resolve().then(() => or).then((e) => ({ default: e.PhoneField })),
2734
+ url: () => Promise.resolve().then(() => cr).then((e) => ({ default: e.UrlField })),
2568
2735
  // Specialized fields
2569
- currency: () => Promise.resolve().then(() => rr).then((e) => ({ default: e.CurrencyField })),
2570
- percent: () => Promise.resolve().then(() => ir).then((e) => ({ default: e.PercentField })),
2571
- password: () => Promise.resolve().then(() => or).then((e) => ({ default: e.PasswordField })),
2572
- markdown: () => Promise.resolve().then(() => Oe).then((e) => ({ default: e.RichTextField })),
2573
- html: () => Promise.resolve().then(() => Oe).then((e) => ({ default: e.RichTextField })),
2574
- lookup: () => Promise.resolve().then(() => nr).then((e) => ({ default: e.LookupField })),
2575
- master_detail: () => Promise.resolve().then(() => Cr).then((e) => ({ default: e.MasterDetailField })),
2736
+ currency: () => Promise.resolve().then(() => ur).then((e) => ({ default: e.CurrencyField })),
2737
+ percent: () => Promise.resolve().then(() => jr).then((e) => ({ default: e.PercentField })),
2738
+ password: () => Promise.resolve().then(() => yr).then((e) => ({ default: e.PasswordField })),
2739
+ markdown: () => Promise.resolve().then(() => Me).then((e) => ({ default: e.RichTextField })),
2740
+ html: () => Promise.resolve().then(() => Me).then((e) => ({ default: e.RichTextField })),
2741
+ lookup: () => Promise.resolve().then(() => hr).then((e) => ({ default: e.LookupField })),
2742
+ master_detail: () => Promise.resolve().then(() => Lr).then((e) => ({ default: e.MasterDetailField })),
2576
2743
  // File fields
2577
- file: () => Promise.resolve().then(() => cr).then((e) => ({ default: e.FileField })),
2578
- image: () => Promise.resolve().then(() => dr).then((e) => ({ default: e.ImageField })),
2744
+ file: () => Promise.resolve().then(() => Nr).then((e) => ({ default: e.FileField })),
2745
+ image: () => Promise.resolve().then(() => vr).then((e) => ({ default: e.ImageField })),
2579
2746
  // Location field
2580
- location: () => Promise.resolve().then(() => ur).then((e) => ({ default: e.LocationField })),
2747
+ location: () => Promise.resolve().then(() => _r).then((e) => ({ default: e.LocationField })),
2581
2748
  // Computed/Read-only fields
2582
- formula: () => Promise.resolve().then(() => mr).then((e) => ({ default: e.FormulaField })),
2583
- summary: () => Promise.resolve().then(() => fr).then((e) => ({ default: e.SummaryField })),
2584
- auto_number: () => Promise.resolve().then(() => xr).then((e) => ({ default: e.AutoNumberField })),
2749
+ formula: () => Promise.resolve().then(() => wr).then((e) => ({ default: e.FormulaField })),
2750
+ summary: () => Promise.resolve().then(() => Sr).then((e) => ({ default: e.SummaryField })),
2751
+ auto_number: () => Promise.resolve().then(() => Fr).then((e) => ({ default: e.AutoNumberField })),
2585
2752
  // User fields
2586
- user: () => Promise.resolve().then(() => Re).then((e) => ({ default: e.UserField })),
2587
- owner: () => Promise.resolve().then(() => Re).then((e) => ({ default: e.UserField })),
2753
+ user: () => Promise.resolve().then(() => Le).then((e) => ({ default: e.UserField })),
2754
+ owner: () => Promise.resolve().then(() => Le).then((e) => ({ default: e.UserField })),
2588
2755
  // Complex data types
2589
- object: () => Promise.resolve().then(() => pr).then((e) => ({ default: e.ObjectField })),
2590
- vector: () => Promise.resolve().then(() => hr).then((e) => ({ default: e.VectorField })),
2591
- grid: () => Promise.resolve().then(() => gr).then((e) => ({ default: e.GridField })),
2756
+ object: () => Promise.resolve().then(() => Cr).then((e) => ({ default: e.ObjectField })),
2757
+ vector: () => Promise.resolve().then(() => Tr).then((e) => ({ default: e.VectorField })),
2758
+ grid: () => Promise.resolve().then(() => Or).then((e) => ({ default: e.GridField })),
2592
2759
  // Additional field types from @objectstack/spec
2593
- color: () => Promise.resolve().then(() => br).then((e) => ({ default: e.ColorField })),
2594
- slider: () => Promise.resolve().then(() => jr).then((e) => ({ default: e.SliderField })),
2595
- rating: () => Promise.resolve().then(() => yr).then((e) => ({ default: e.RatingField })),
2596
- code: () => Promise.resolve().then(() => Nr).then((e) => ({ default: e.CodeField })),
2597
- avatar: () => Promise.resolve().then(() => vr).then((e) => ({ default: e.AvatarField })),
2598
- address: () => Promise.resolve().then(() => _r).then((e) => ({ default: e.AddressField })),
2599
- geolocation: () => Promise.resolve().then(() => wr).then((e) => ({ default: e.GeolocationField })),
2600
- signature: () => Promise.resolve().then(() => Fr).then((e) => ({ default: e.SignatureField })),
2601
- qrcode: () => Promise.resolve().then(() => Sr).then((e) => ({ default: e.QRCodeField }))
2760
+ color: () => Promise.resolve().then(() => Pr).then((e) => ({ default: e.ColorField })),
2761
+ slider: () => Promise.resolve().then(() => Rr).then((e) => ({ default: e.SliderField })),
2762
+ rating: () => Promise.resolve().then(() => kr).then((e) => ({ default: e.RatingField })),
2763
+ code: () => Promise.resolve().then(() => Ar).then((e) => ({ default: e.CodeField })),
2764
+ avatar: () => Promise.resolve().then(() => $r).then((e) => ({ default: e.AvatarField })),
2765
+ address: () => Promise.resolve().then(() => zr).then((e) => ({ default: e.AddressField })),
2766
+ geolocation: () => Promise.resolve().then(() => Er).then((e) => ({ default: e.GeolocationField })),
2767
+ signature: () => Promise.resolve().then(() => Dr).then((e) => ({ default: e.SignatureField })),
2768
+ qrcode: () => Promise.resolve().then(() => Mr).then((e) => ({ default: e.QRCodeField }))
2602
2769
  };
2603
- function Jr(e) {
2604
- const r = jt[e];
2770
+ function ns(e) {
2771
+ const r = Ct[e];
2605
2772
  if (!r) {
2606
2773
  console.warn(`Unknown field type: ${e}`);
2607
2774
  return;
2608
2775
  }
2609
- const n = k.lazy(r);
2610
- g.register(e, n, { namespace: "field" });
2776
+ const s = E.lazy(r);
2777
+ y.register(e, s, { namespace: "field" });
2611
2778
  }
2612
- function Wr() {
2613
- Object.keys(jt).forEach((e) => {
2614
- Jr(e);
2779
+ function as() {
2780
+ Object.keys(Ct).forEach((e) => {
2781
+ ns(e);
2615
2782
  });
2616
2783
  }
2617
- function ns() {
2618
- g.register("text", y(Le), { namespace: "field" }), g.register("textarea", y(Ge), { namespace: "field" }), g.register("number", y(Ie), { namespace: "field" }), g.register("boolean", y(Ue), { namespace: "field" }), g.register("select", y(Ve), { namespace: "field" }), g.register("date", y(Be), { namespace: "field" }), g.register("datetime", y(He), { namespace: "field" }), g.register("time", y(Xe), { namespace: "field" }), g.register("email", y(Ye), { namespace: "field" }), g.register("phone", y(qe), { namespace: "field" }), g.register("url", y(Je), { namespace: "field" }), g.register("currency", y(We), { namespace: "field" }), g.register("percent", y(Ze), { namespace: "field" }), g.register("password", y(Ke), { namespace: "field" }), g.register("markdown", y(ce), { namespace: "field" }), g.register("html", y(ce), { namespace: "field" }), g.register("lookup", y(Qe), { namespace: "field" }), g.register("master_detail", y(bt), { namespace: "field" }), g.register("file", y(et), { namespace: "field" }), g.register("image", y(tt), { namespace: "field" }), g.register("location", y(rt), { namespace: "field" }), g.register("formula", y(st), { namespace: "field" }), g.register("summary", y(nt), { namespace: "field" }), g.register("auto_number", y(at), { namespace: "field" }), g.register("user", y(de), { namespace: "field" }), g.register("owner", y(de), { namespace: "field" }), g.register("object", y(lt), { namespace: "field" }), g.register("vector", y(it), { namespace: "field" }), g.register("grid", y(ot), { namespace: "field" }), g.register("color", y(ct), { namespace: "field" }), g.register("slider", y(dt), { namespace: "field" }), g.register("rating", y(ut), { namespace: "field" }), g.register("code", y(mt), { namespace: "field" }), g.register("avatar", y(ft), { namespace: "field" }), g.register("address", y(xt), { namespace: "field" }), g.register("geolocation", y(pt), { namespace: "field" }), g.register("signature", y(ht), { namespace: "field" }), g.register("qrcode", y(gt), { namespace: "field" });
2784
+ function hs() {
2785
+ y.register("text", v(Je), { namespace: "field" }), y.register("textarea", v(tt), { namespace: "field" }), y.register("number", v(We), { namespace: "field" }), y.register("boolean", v(Ge), { namespace: "field" }), y.register("select", v(Qe), { namespace: "field" }), y.register("date", v(He), { namespace: "field" }), y.register("datetime", v(nt), { namespace: "field" }), y.register("time", v(at), { namespace: "field" }), y.register("email", v(Xe), { namespace: "field" }), y.register("phone", v(Ke), { namespace: "field" }), y.register("url", v(Ze), { namespace: "field" }), y.register("currency", v(et), { namespace: "field" }), y.register("percent", v(lt), { namespace: "field" }), y.register("password", v(it), { namespace: "field" }), y.register("markdown", v(ye), { namespace: "field" }), y.register("html", v(ye), { namespace: "field" }), y.register("lookup", v(st), { namespace: "field" }), y.register("master_detail", v(Ft), { namespace: "field" }), y.register("file", v(ot), { namespace: "field" }), y.register("image", v(ct), { namespace: "field" }), y.register("location", v(dt), { namespace: "field" }), y.register("formula", v(ut), { namespace: "field" }), y.register("summary", v(mt), { namespace: "field" }), y.register("auto_number", v(ft), { namespace: "field" }), y.register("user", v(Ne), { namespace: "field" }), y.register("owner", v(Ne), { namespace: "field" }), y.register("object", v(xt), { namespace: "field" }), y.register("vector", v(pt), { namespace: "field" }), y.register("grid", v(ht), { namespace: "field" }), y.register("color", v(gt), { namespace: "field" }), y.register("slider", v(bt), { namespace: "field" }), y.register("rating", v(jt), { namespace: "field" }), y.register("code", v(yt), { namespace: "field" }), y.register("avatar", v(Nt), { namespace: "field" }), y.register("address", v(vt), { namespace: "field" }), y.register("geolocation", v(_t), { namespace: "field" }), y.register("signature", v(wt), { namespace: "field" }), y.register("qrcode", v(St), { namespace: "field" });
2619
2786
  }
2620
- Wr();
2787
+ as();
2621
2788
  export {
2622
- xt as AddressField,
2623
- at as AutoNumberField,
2624
- ft as AvatarField,
2625
- Er as BooleanCellRenderer,
2626
- Ue as BooleanField,
2627
- mt as CodeField,
2628
- ct as ColorField,
2629
- kr as CurrencyCellRenderer,
2630
- We as CurrencyField,
2631
- Dr as DateCellRenderer,
2632
- Be as DateField,
2633
- Mr as DateTimeCellRenderer,
2634
- He as DateTimeField,
2635
- Ur as EmailCellRenderer,
2636
- Ye as EmailField,
2637
- Yr as FileCellRenderer,
2638
- et as FileField,
2639
- Ae as FormulaCellRenderer,
2640
- st as FormulaField,
2641
- pt as GeolocationField,
2642
- ot as GridField,
2643
- qr as ImageCellRenderer,
2644
- tt as ImageField,
2645
- rt as LocationField,
2646
- ne as LookupCellRenderer,
2647
- Qe as LookupField,
2648
- bt as MasterDetailField,
2649
- Rr as NumberCellRenderer,
2650
- Ie as NumberField,
2651
- lt as ObjectField,
2652
- Ke as PasswordField,
2653
- $r as PercentCellRenderer,
2654
- Ze as PercentField,
2655
- Br as PhoneCellRenderer,
2656
- qe as PhoneField,
2657
- gt as QRCodeField,
2658
- ut as RatingField,
2659
- ce as RichTextField,
2660
- se as SelectCellRenderer,
2661
- Ve as SelectField,
2662
- ht as SignatureField,
2663
- dt as SliderField,
2664
- nt as SummaryField,
2665
- Ge as TextAreaField,
2666
- D as TextCellRenderer,
2667
- Le as TextField,
2668
- Xe as TimeField,
2669
- Vr as UrlCellRenderer,
2670
- Je as UrlField,
2671
- ae as UserCellRenderer,
2672
- de as UserField,
2673
- it as VectorField,
2674
- ss as buildValidationRules,
2675
- $e as evaluateCondition,
2676
- Zr as formatCompactCurrency,
2677
- Pr as formatCurrency,
2678
- me as formatDate,
2679
- Kr as formatDateTime,
2680
- rs as formatFileSize,
2681
- Tr as formatPercent,
2682
- Or as formatRelativeDate,
2683
- es as getCellRenderer,
2684
- ue as humanizeLabel,
2685
- ts as mapFieldTypeToFormType,
2686
- Wr as registerAllFields,
2687
- Jr as registerField,
2688
- G as registerFieldRenderer,
2689
- ns as registerFields
2789
+ vt as AddressField,
2790
+ ft as AutoNumberField,
2791
+ Nt as AvatarField,
2792
+ Gr as BooleanCellRenderer,
2793
+ Ge as BooleanField,
2794
+ yt as CodeField,
2795
+ gt as ColorField,
2796
+ Yr as CurrencyCellRenderer,
2797
+ et as CurrencyField,
2798
+ Qr as DateCellRenderer,
2799
+ He as DateField,
2800
+ Hr as DateTimeCellRenderer,
2801
+ nt as DateTimeField,
2802
+ Zr as EmailCellRenderer,
2803
+ Xe as EmailField,
2804
+ rs as FileCellRenderer,
2805
+ ot as FileField,
2806
+ Ue as FormulaCellRenderer,
2807
+ ut as FormulaField,
2808
+ _t as GeolocationField,
2809
+ ht as GridField,
2810
+ ss as ImageCellRenderer,
2811
+ ct as ImageField,
2812
+ dt as LocationField,
2813
+ ge as LookupCellRenderer,
2814
+ st as LookupField,
2815
+ Ft as MasterDetailField,
2816
+ Br as NumberCellRenderer,
2817
+ We as NumberField,
2818
+ xt as ObjectField,
2819
+ it as PasswordField,
2820
+ Jr as PercentCellRenderer,
2821
+ lt as PercentField,
2822
+ ts as PhoneCellRenderer,
2823
+ Ke as PhoneField,
2824
+ St as QRCodeField,
2825
+ jt as RatingField,
2826
+ ye as RichTextField,
2827
+ he as SelectCellRenderer,
2828
+ Qe as SelectField,
2829
+ wt as SignatureField,
2830
+ bt as SliderField,
2831
+ mt as SummaryField,
2832
+ tt as TextAreaField,
2833
+ K as TextCellRenderer,
2834
+ Je as TextField,
2835
+ at as TimeField,
2836
+ es as UrlCellRenderer,
2837
+ Ze as UrlField,
2838
+ be as UserCellRenderer,
2839
+ Ne as UserField,
2840
+ pt as VectorField,
2841
+ ps as buildValidationRules,
2842
+ Y as coerceToSafeValue,
2843
+ Ve as evaluateCondition,
2844
+ ds as formatCompactCurrency,
2845
+ Ir as formatCurrency,
2846
+ _e as formatDate,
2847
+ us as formatDateTime,
2848
+ xs as formatFileSize,
2849
+ Ur as formatPercent,
2850
+ Vr as formatRelativeDate,
2851
+ ms as getCellRenderer,
2852
+ ve as humanizeLabel,
2853
+ fs as mapFieldTypeToFormType,
2854
+ as as registerAllFields,
2855
+ ns as registerField,
2856
+ oe as registerFieldRenderer,
2857
+ hs as registerFields
2690
2858
  };