@object-ui/plugin-detail 4.4.0 → 4.5.0

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,14 +1,14 @@
1
1
  import { ComponentRegistry as e, buildExpandFields as t } from "@object-ui/core";
2
2
  import * as n from "react";
3
3
  import r from "react";
4
- import { AlertDialog as i, AlertDialogAction as a, AlertDialogCancel as o, AlertDialogContent as s, AlertDialogDescription as c, AlertDialogFooter as l, AlertDialogHeader as u, AlertDialogTitle as d, Badge as f, Button as p, Card as m, CardContent as h, CardHeader as g, CardTitle as _, Collapsible as v, CollapsibleContent as y, CollapsibleTrigger as b, Input as x, Sheet as S, SheetContent as C, SheetHeader as w, SheetTitle as T, Skeleton as E, Tabs as D, TabsContent as O, TabsList as k, TabsTrigger as A, Tooltip as j, TooltipContent as M, TooltipProvider as ee, TooltipTrigger as N, cn as P, useIsMobile as F } from "@object-ui/components";
5
- import { Activity as I, ArrowLeft as te, ArrowRight as L, ArrowRightLeft as ne, ArrowUpDown as R, AtSign as z, Bell as B, BellOff as V, Bold as H, Calendar as re, Check as ie, CheckSquare as U, ChevronDown as ae, ChevronLeft as oe, ChevronRight as se, ChevronsLeft as ce, ChevronsRight as le, Code as ue, Columns2 as de, Copy as fe, Edit as W, ExternalLink as pe, Eye as me, EyeOff as G, File as he, FileArchive as ge, FileText as _e, History as K, Image as ve, Inbox as ye, Italic as be, Link as q, List as xe, Loader2 as Se, Mail as Ce, MessageSquare as J, Network as we, PanelRightClose as Te, PanelRightOpen as Ee, Paperclip as De, Phone as Oe, Pin as ke, Plus as Ae, PlusCircle as je, RotateCcw as Me, Rows3 as Ne, Search as Pe, Send as Y, SmilePlus as Fe, Star as Ie, Trash2 as Le, Upload as Re, X as ze, Zap as Be, icons as Ve } from "lucide-react";
6
- import { SchemaRenderer as He, useActionEngine as Ue, useObjectTranslation as We, useRecordContext as Ge, useSafeFieldLabel as Ke } from "@object-ui/react";
7
- import { BooleanField as qe, SelectField as Je, getCellRenderer as Ye, resolveCellRendererType as Xe } from "@object-ui/fields";
4
+ import { AlertDialog as i, AlertDialogAction as a, AlertDialogCancel as o, AlertDialogContent as s, AlertDialogDescription as c, AlertDialogFooter as l, AlertDialogHeader as u, AlertDialogTitle as d, Avatar as f, AvatarFallback as p, AvatarImage as m, Badge as h, Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, Collapsible as x, CollapsibleContent as S, CollapsibleTrigger as C, Input as w, Sheet as T, SheetContent as E, SheetHeader as D, SheetTitle as O, Skeleton as k, Tabs as A, TabsContent as j, TabsList as ee, TabsTrigger as M, Tooltip as N, TooltipContent as P, TooltipProvider as F, TooltipTrigger as I, cn as L, useIsMobile as R } from "@object-ui/components";
5
+ import { Activity as z, ArrowLeft as B, ArrowRight as te, ArrowRightLeft as V, ArrowUpDown as H, AtSign as U, Bell as ne, BellOff as re, Bold as W, Calendar as ie, Check as ae, CheckSquare as oe, ChevronDown as se, ChevronLeft as ce, ChevronRight as G, ChevronsLeft as le, ChevronsRight as ue, Code as de, Columns2 as K, Copy as fe, Edit as pe, ExternalLink as me, Eye as q, EyeOff as he, File as J, FileArchive as ge, FileText as _e, History as ve, Image as Y, Inbox as ye, Italic as be, Link as xe, List as Se, Loader2 as Ce, Mail as we, MessageSquare as Te, Network as Ee, PanelRightClose as De, PanelRightOpen as Oe, Paperclip as ke, Phone as Ae, Pin as je, Plus as Me, PlusCircle as Ne, RotateCcw as Pe, Rows3 as Fe, Search as Ie, Send as Le, SmilePlus as Re, Star as ze, Trash2 as Be, Upload as Ve, X as He, Zap as Ue, icons as We } from "lucide-react";
6
+ import { SchemaRenderer as Ge, useActionEngine as Ke, useObjectTranslation as qe, useRecordContext as Je, useSafeFieldLabel as Ye } from "@object-ui/react";
7
+ import { BooleanField as Xe, SelectField as Ze, getCellRenderer as Qe, resolveCellRendererType as $e } from "@object-ui/fields";
8
8
  import { Fragment as X, jsx as Z, jsxs as Q } from "react/jsx-runtime";
9
- import { useFieldPermissions as Ze, usePermissions as Qe } from "@object-ui/permissions";
9
+ import { useFieldPermissions as et, usePermissions as tt } from "@object-ui/permissions";
10
10
  //#region src/autoLayout.ts
11
- var $e = new Set([
11
+ var nt = new Set([
12
12
  "textarea",
13
13
  "markdown",
14
14
  "html",
@@ -20,10 +20,10 @@ var $e = new Set([
20
20
  "field:grid",
21
21
  "field:rich-text"
22
22
  ]);
23
- function et(e) {
24
- return $e.has(e);
23
+ function rt(e) {
24
+ return nt.has(e);
25
25
  }
26
- function tt(e, t) {
26
+ function it(e, t) {
27
27
  let n;
28
28
  if (n = e <= 3 ? 1 : e <= 10 ? 2 : 3, t !== void 0) {
29
29
  if (t < 640) return Math.min(n, 1);
@@ -31,29 +31,29 @@ function tt(e, t) {
31
31
  }
32
32
  return n;
33
33
  }
34
- function nt(e, t) {
35
- return t <= 1 ? e : e.map((e) => e.span === void 0 && e.type && et(e.type) ? {
34
+ function at(e, t) {
35
+ return t <= 1 ? e : e.map((e) => e.span === void 0 && e.type && rt(e.type) ? {
36
36
  ...e,
37
37
  span: t
38
38
  } : e);
39
39
  }
40
- function rt(e, t, n) {
40
+ function ot(e, t, n) {
41
41
  if (t !== void 0) return {
42
- fields: nt(e, t),
42
+ fields: at(e, t),
43
43
  columns: t
44
44
  };
45
- let r = tt(e.length, n);
45
+ let r = it(e.length, n);
46
46
  return {
47
- fields: nt(e, r),
47
+ fields: at(e, r),
48
48
  columns: r
49
49
  };
50
50
  }
51
51
  //#endregion
52
52
  //#region src/useDetailTranslation.ts
53
- function it(e, t) {
53
+ function st(e, t) {
54
54
  return function() {
55
55
  try {
56
- let n = We();
56
+ let n = qe();
57
57
  return n.t(t) === t ? { t: (t, n) => {
58
58
  let r = e[t] || t;
59
59
  if (n) for (let [e, t] of Object.entries(n)) r = r.replace(`{{${e}}}`, String(t));
@@ -68,7 +68,7 @@ function it(e, t) {
68
68
  }
69
69
  };
70
70
  }
71
- var at = {
71
+ var ct = {
72
72
  "detail.back": "Back",
73
73
  "detail.edit": "Edit",
74
74
  "detail.editInline": "Edit",
@@ -181,33 +181,33 @@ var at = {
181
181
  "detail.subscribeAriaLabel": "Subscribe to notifications",
182
182
  "detail.unsubscribeAriaLabel": "Unsubscribe from notifications",
183
183
  "detail.clearSearch": "Clear search"
184
- }, $ = it(at, "detail.back");
184
+ }, $ = st(ct, "detail.back");
185
185
  //#endregion
186
186
  //#region src/DetailSection.tsx
187
- function ot(e, t) {
187
+ function lt(e, t) {
188
188
  return !e || e <= 1 || t <= 1 ? "" : t === 2 ? e >= 2 ? "md:col-span-2" : "" : e === 2 ? "md:col-span-2" : e >= 3 ? "md:col-span-2 lg:col-span-3" : "";
189
189
  }
190
- var st = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, isEditing: o = !1, onFieldChange: s, virtualScroll: c }) => {
191
- let [l, u] = n.useState(e.defaultCollapsed ?? !1), [d, x] = n.useState(null), [S, C] = n.useState(void 0), [w, T] = n.useState(!1), { t: E } = $(), { fieldLabel: D, translateOptions: O } = Ke(), k = n.useCallback((e, t) => {
190
+ var ut = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, isEditing: o = !1, onFieldChange: s, virtualScroll: c }) => {
191
+ let [l, u] = n.useState(e.defaultCollapsed ?? !1), [d, f] = n.useState(null), [p, m] = n.useState(void 0), [w, T] = n.useState(!1), { t: E } = $(), { fieldLabel: D, translateOptions: O } = Ye(), k = n.useCallback((e, t) => {
192
192
  let n = t == null ? "" : String(t);
193
193
  navigator.clipboard.writeText(n).then(() => {
194
- x(e), setTimeout(() => x(null), 2e3);
194
+ f(e), setTimeout(() => f(null), 2e3);
195
195
  });
196
196
  }, []), A = n.useCallback((e) => {
197
197
  let n = t?.[e.name] ?? e.value;
198
198
  return n == null || n === "";
199
- }, [t]), I = n.useMemo(() => e.fields.filter(A).length, [e.fields, A]), te = F(), L = te ? 3 : 6, ne = te ? .2 : .5, R = e.fields.length - I, z = !e.hideEmpty && !o && e.fields.length >= L && I / e.fields.length >= ne && R > 0, B = !w && (e.hideEmpty || z) ? e.fields.filter((e) => !A(e)) : e.fields;
200
- if (B.length === 0 && I === e.fields.length) return null;
201
- let { fields: V, columns: H } = rt(B, e.columns), re = (e) => {
199
+ }, [t]), j = n.useMemo(() => e.fields.filter(A).length, [e.fields, A]), ee = R(), M = ee ? 3 : 6, z = ee ? .2 : .5, B = e.fields.length - j, te = !e.hideEmpty && !o && e.fields.length >= M && j / e.fields.length >= z && B > 0, V = !w && (e.hideEmpty || te) ? e.fields.filter((e) => !A(e)) : e.fields;
200
+ if (V.length === 0 && j === e.fields.length) return null;
201
+ let { fields: H, columns: U } = ot(V, e.columns), ne = (e) => {
202
202
  let n = t?.[e.name] ?? e.value;
203
- if (e.render) return /* @__PURE__ */ Z(He, {
203
+ if (e.render) return /* @__PURE__ */ Z(Ge, {
204
204
  schema: e.render,
205
205
  data: {
206
206
  ...t,
207
207
  value: n
208
208
  }
209
209
  });
210
- let r = ot(e.span, H), c = i?.fields?.[e.name], l = { ...e };
210
+ let r = lt(e.span, U), c = i?.fields?.[e.name], l = { ...e };
211
211
  if (c) {
212
212
  !e.type && c.type && (l.type = c.type), c.options && !l.options && (l.options = c.options), c.currency && !l.currency && (l.currency = c.currency), c.precision !== void 0 && l.precision === void 0 && (l.precision = c.precision), c.format && !l.format && (l.format = c.format);
213
213
  let t = c.reference_to || c.reference;
@@ -219,18 +219,18 @@ var st = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
219
219
  className: "text-muted-foreground/50 text-xs italic",
220
220
  children: "—"
221
221
  });
222
- let t = Xe(l) || e.type;
222
+ let t = $e(l) || e.type;
223
223
  if (t) {
224
- let e = Ye(t);
224
+ let e = Qe(t);
225
225
  if (e) return /* @__PURE__ */ Z(e, {
226
226
  value: n,
227
227
  field: l
228
228
  });
229
229
  }
230
230
  return String(n);
231
- })(), f = n != null && n !== "", m = d === e.name;
231
+ })(), f = n != null && n !== "", p = d === e.name;
232
232
  return /* @__PURE__ */ Q("div", {
233
- className: P("space-y-1.5 group", r),
233
+ className: L("space-y-1.5 group", r),
234
234
  children: [/* @__PURE__ */ Z("div", {
235
235
  className: "text-xs font-medium text-muted-foreground uppercase tracking-wide",
236
236
  children: D(a || "", e.name, e.label || e.name)
@@ -238,12 +238,12 @@ var st = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
238
238
  className: "min-h-[44px] sm:min-h-0",
239
239
  children: (() => {
240
240
  let t = l.type || e.type;
241
- if (t === "select" && Array.isArray(l.options) && l.options.length > 0) return /* @__PURE__ */ Z(Je, {
241
+ if (t === "select" && Array.isArray(l.options) && l.options.length > 0) return /* @__PURE__ */ Z(Ze, {
242
242
  field: l,
243
243
  value: n == null ? "" : String(n),
244
244
  onChange: (t) => s?.(e.name, t)
245
245
  });
246
- if (t === "boolean") return /* @__PURE__ */ Z(qe, {
246
+ if (t === "boolean") return /* @__PURE__ */ Z(Xe, {
247
247
  field: l,
248
248
  value: !!n,
249
249
  onChange: (t) => s?.(e.name, t)
@@ -268,7 +268,7 @@ var st = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
268
268
  });
269
269
  })()
270
270
  }) : /* @__PURE__ */ Q("div", {
271
- className: P("flex items-start justify-between gap-2 min-h-[44px] sm:min-h-0 rounded-md", f && "cursor-pointer active:bg-muted/60 transition-colors"),
271
+ className: L("flex items-start justify-between gap-2 min-h-[44px] sm:min-h-0 rounded-md", f && "cursor-pointer active:bg-muted/60 transition-colors"),
272
272
  onClick: f ? () => k(e.name, n) : void 0,
273
273
  onKeyDown: f ? (t) => {
274
274
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), k(e.name, n));
@@ -278,67 +278,67 @@ var st = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
278
278
  children: [/* @__PURE__ */ Z("div", {
279
279
  className: "text-sm flex-1 break-words py-1",
280
280
  children: u
281
- }), f && /* @__PURE__ */ Z(ee, { children: /* @__PURE__ */ Q(j, { children: [/* @__PURE__ */ Z(N, {
281
+ }), f && /* @__PURE__ */ Z(F, { children: /* @__PURE__ */ Q(N, { children: [/* @__PURE__ */ Z(I, {
282
282
  asChild: !0,
283
- children: /* @__PURE__ */ Z(p, {
283
+ children: /* @__PURE__ */ Z(g, {
284
284
  variant: "ghost",
285
285
  size: "icon",
286
286
  className: "h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",
287
287
  onClick: (t) => {
288
288
  t.stopPropagation(), k(e.name, n);
289
289
  },
290
- children: m ? /* @__PURE__ */ Z(ie, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ Z(fe, { className: "h-3 w-3" })
290
+ children: p ? /* @__PURE__ */ Z(ae, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ Z(fe, { className: "h-3 w-3" })
291
291
  })
292
- }), /* @__PURE__ */ Z(M, { children: E(m ? "detail.copied" : "detail.copyToClipboard") })] }) })]
292
+ }), /* @__PURE__ */ Z(P, { children: E(p ? "detail.copied" : "detail.copyToClipboard") })] }) })]
293
293
  })]
294
294
  }, e.name);
295
- }, U = c?.enabled === !0, oe = c?.batchSize ?? 20;
295
+ }, re = c?.enabled === !0, W = c?.batchSize ?? 20;
296
296
  n.useEffect(() => {
297
- if (!U) {
298
- C(void 0);
297
+ if (!re) {
298
+ m(void 0);
299
299
  return;
300
300
  }
301
- if (V.length <= oe) {
302
- C(void 0);
301
+ if (H.length <= W) {
302
+ m(void 0);
303
303
  return;
304
304
  }
305
- C(oe);
306
- let e = setTimeout(() => C(void 0), 100);
305
+ m(W);
306
+ let e = setTimeout(() => m(void 0), 100);
307
307
  return () => clearTimeout(e);
308
308
  }, [
309
- U,
310
- V.length,
311
- oe
309
+ re,
310
+ H.length,
311
+ W
312
312
  ]);
313
- let ce = S === void 0 ? V : V.slice(0, S), le = I > 0 && (e.hideEmpty || z), ue = /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z("div", {
314
- className: P("grid gap-3 sm:gap-4", H === 1 ? "grid-cols-1" : H === 2 ? "grid-cols-1 md:grid-cols-2" : "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"),
315
- children: ce.map(re)
316
- }), le && /* @__PURE__ */ Z("div", {
313
+ let ie = p === void 0 ? H : H.slice(0, p), oe = j > 0 && (e.hideEmpty || te), ce = /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z("div", {
314
+ className: L("grid gap-3 sm:gap-4", U === 1 ? "grid-cols-1" : U === 2 ? "grid-cols-1 md:grid-cols-2" : "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"),
315
+ children: ie.map(ne)
316
+ }), oe && /* @__PURE__ */ Z("div", {
317
317
  className: "mt-3 -ml-2",
318
- children: /* @__PURE__ */ Q(p, {
318
+ children: /* @__PURE__ */ Q(g, {
319
319
  type: "button",
320
320
  variant: "ghost",
321
321
  size: "sm",
322
322
  onClick: () => T((e) => !e),
323
323
  className: "h-7 px-2 text-xs text-muted-foreground hover:text-foreground",
324
- children: [Z(w ? G : me, { className: "h-3.5 w-3.5 mr-1.5" }), w ? E("detail.hideEmptyFields", { defaultValue: "Hide empty fields" }) : E("detail.showEmptyFields", {
325
- count: I,
326
- defaultValue: `Show ${I} empty field${I === 1 ? "" : "s"}`
324
+ children: [Z(w ? he : q, { className: "h-3.5 w-3.5 mr-1.5" }), w ? E("detail.hideEmptyFields", { defaultValue: "Hide empty fields" }) : E("detail.showEmptyFields", {
325
+ count: j,
326
+ defaultValue: `Show ${j} empty field${j === 1 ? "" : "s"}`
327
327
  })]
328
328
  })
329
329
  })] });
330
330
  return !e.title && !e.collapsible && e.showBorder === !1 ? /* @__PURE__ */ Z("div", {
331
- className: P(r),
332
- children: ue
333
- }) : e.collapsible ? /* @__PURE__ */ Z(v, {
331
+ className: L(r),
332
+ children: ce
333
+ }) : e.collapsible ? /* @__PURE__ */ Z(x, {
334
334
  open: !l,
335
335
  onOpenChange: (e) => u(!e),
336
336
  className: r,
337
- children: /* @__PURE__ */ Q(m, { children: [/* @__PURE__ */ Z(b, {
337
+ children: /* @__PURE__ */ Q(_, { children: [/* @__PURE__ */ Z(C, {
338
338
  asChild: !0,
339
- children: /* @__PURE__ */ Q(g, {
340
- className: P("cursor-pointer hover:bg-muted/50 transition-colors", e.headerColor && `bg-${e.headerColor}`),
341
- children: [/* @__PURE__ */ Q(_, {
339
+ children: /* @__PURE__ */ Q(y, {
340
+ className: L("cursor-pointer hover:bg-muted/50 transition-colors", e.headerColor && `bg-${e.headerColor}`),
341
+ children: [/* @__PURE__ */ Q(b, {
342
342
  className: "flex items-center justify-between",
343
343
  children: [/* @__PURE__ */ Q("div", {
344
344
  className: "flex items-center gap-2",
@@ -348,7 +348,7 @@ var st = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
348
348
  children: e.icon
349
349
  }),
350
350
  /* @__PURE__ */ Z("span", { children: e.title }),
351
- e.fields && /* @__PURE__ */ Z(f, {
351
+ e.fields && /* @__PURE__ */ Z(h, {
352
352
  variant: "secondary",
353
353
  className: "ml-2 text-xs",
354
354
  children: e.fields.length
@@ -356,22 +356,22 @@ var st = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
356
356
  ]
357
357
  }), /* @__PURE__ */ Z("div", {
358
358
  className: "flex items-center gap-2",
359
- children: Z(l ? se : ae, { className: "h-4 w-4 text-muted-foreground" })
359
+ children: Z(l ? G : se, { className: "h-4 w-4 text-muted-foreground" })
360
360
  })]
361
361
  }), e.description && !l && /* @__PURE__ */ Z("p", {
362
362
  className: "text-sm text-muted-foreground mt-1.5",
363
363
  children: e.description
364
364
  })]
365
365
  })
366
- }), /* @__PURE__ */ Z(y, { children: /* @__PURE__ */ Z(h, {
366
+ }), /* @__PURE__ */ Z(S, { children: /* @__PURE__ */ Z(v, {
367
367
  className: "pt-4 sm:pt-6 px-3 sm:px-6",
368
- children: ue
368
+ children: ce
369
369
  }) })] })
370
- }) : /* @__PURE__ */ Q(m, {
371
- className: P(e.showBorder === !1 ? "border-none shadow-none" : "", r),
372
- children: [e.title && /* @__PURE__ */ Q(g, {
373
- className: P(e.headerColor && `bg-${e.headerColor}`),
374
- children: [/* @__PURE__ */ Z(_, {
370
+ }) : /* @__PURE__ */ Q(_, {
371
+ className: L(e.showBorder === !1 ? "border-none shadow-none" : "", r),
372
+ children: [e.title && /* @__PURE__ */ Q(y, {
373
+ className: L(e.headerColor && `bg-${e.headerColor}`),
374
+ children: [/* @__PURE__ */ Z(b, {
375
375
  className: "flex items-center justify-between",
376
376
  children: /* @__PURE__ */ Q("div", {
377
377
  className: "flex items-center gap-2",
@@ -384,20 +384,20 @@ var st = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
384
384
  className: "text-sm text-muted-foreground mt-1.5",
385
385
  children: e.description
386
386
  })]
387
- }), /* @__PURE__ */ Z(h, {
387
+ }), /* @__PURE__ */ Z(v, {
388
388
  className: "pt-4 sm:pt-6 px-3 sm:px-6",
389
- children: ue
389
+ children: ce
390
390
  })]
391
391
  });
392
- }, ct = ({ tabs: e, data: t, className: r }) => {
392
+ }, dt = ({ tabs: e, data: t, className: r }) => {
393
393
  let [i, a] = n.useState(e[0]?.key), o = e.filter((e) => typeof e.visible == "boolean" ? e.visible : (e.visible, !0));
394
- return /* @__PURE__ */ Q(D, {
394
+ return /* @__PURE__ */ Q(A, {
395
395
  value: i,
396
396
  onValueChange: a,
397
397
  className: r,
398
- children: [/* @__PURE__ */ Z(k, {
398
+ children: [/* @__PURE__ */ Z(ee, {
399
399
  className: "w-full justify-start border-b rounded-none bg-transparent p-0",
400
- children: o.map((e) => /* @__PURE__ */ Z(A, {
400
+ children: o.map((e) => /* @__PURE__ */ Z(M, {
401
401
  value: e.key,
402
402
  className: "relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",
403
403
  children: /* @__PURE__ */ Q("div", {
@@ -405,7 +405,7 @@ var st = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
405
405
  children: [
406
406
  e.icon && /* @__PURE__ */ Z("span", { children: e.icon }),
407
407
  /* @__PURE__ */ Z("span", { children: e.label }),
408
- e.badge && /* @__PURE__ */ Z(f, {
408
+ e.badge && /* @__PURE__ */ Z(h, {
409
409
  variant: "secondary",
410
410
  className: "ml-1",
411
411
  children: e.badge
@@ -413,18 +413,18 @@ var st = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
413
413
  ]
414
414
  })
415
415
  }, e.key))
416
- }), o.map((e) => /* @__PURE__ */ Z(O, {
416
+ }), o.map((e) => /* @__PURE__ */ Z(j, {
417
417
  value: e.key,
418
418
  className: "mt-4",
419
419
  children: /* @__PURE__ */ Z(n.Suspense, {
420
420
  fallback: null,
421
421
  children: Array.isArray(e.content) ? /* @__PURE__ */ Z("div", {
422
422
  className: "space-y-4",
423
- children: e.content.map((e, n) => /* @__PURE__ */ Z(He, {
423
+ children: e.content.map((e, n) => /* @__PURE__ */ Z(Ge, {
424
424
  schema: e,
425
425
  data: t
426
426
  }, n))
427
- }) : /* @__PURE__ */ Z(He, {
427
+ }) : /* @__PURE__ */ Z(Ge, {
428
428
  schema: e.content,
429
429
  data: t
430
430
  })
@@ -434,48 +434,48 @@ var st = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
434
434
  };
435
435
  //#endregion
436
436
  //#region src/RelatedList.tsx
437
- function lt(e) {
438
- return e && Ve[e.split(/[-_\s]/).filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] || ye;
437
+ function ft(e) {
438
+ return e && We[e.split(/[-_\s]/).filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] || ye;
439
439
  }
440
- var ut = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className: S, dataSource: C, objectName: w, onNew: T, onViewAll: E, onRowEdit: D, onRowDelete: O, onRowClick: k, maxColumns: A = 6, pageSize: j, sortable: M = !1, filterable: ee = !1, collapsible: N = !1, defaultCollapsed: F = !1, referenceField: I, icon: te }) => {
441
- let L = v !== void 0, ne = v ?? [], [z, B] = n.useState(ne), [V, H] = n.useState(!1), [re, ie] = n.useState(0), [U, ce] = n.useState(null), [le, ue] = n.useState("asc"), [de, fe] = n.useState(""), [W, me] = n.useState(null), [G, he] = n.useState(F), [ge, _e] = n.useState({}), { t: K } = $(), { fieldLabel: ve } = Ke();
440
+ var pt = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className: x, dataSource: S, objectName: C, onNew: T, onViewAll: E, onRowEdit: D, onRowDelete: O, onRowClick: k, maxColumns: A = 6, pageSize: j, sortable: ee = !1, filterable: M = !1, collapsible: N = !1, defaultCollapsed: P = !1, referenceField: F, icon: I }) => {
441
+ let R = f !== void 0, z = f ?? [], [B, te] = n.useState(z), [V, U] = n.useState(!1), [ne, re] = n.useState(0), [W, ie] = n.useState(null), [ae, oe] = n.useState("asc"), [le, ue] = n.useState(""), [de, K] = n.useState(null), [fe, pe] = n.useState(P), [q, he] = n.useState({}), { t: J } = $(), { fieldLabel: ge } = Ye();
442
442
  n.useEffect(() => {
443
- L && B(v ?? []);
444
- }, [v, L]), n.useEffect(() => {
445
- r && C?.getObjectSchema && !b?.length && C.getObjectSchema(r).then(me).catch((e) => {
443
+ R && te(f ?? []);
444
+ }, [f, R]), n.useEffect(() => {
445
+ r && S?.getObjectSchema && !m?.length && S.getObjectSchema(r).then(K).catch((e) => {
446
446
  console.warn(`[RelatedList] Failed to fetch schema for ${r}:`, e);
447
447
  });
448
448
  }, [
449
449
  r,
450
- C,
451
- b
450
+ S,
451
+ m
452
452
  ]), n.useEffect(() => {
453
- r && !L && (H(!0), C && typeof C.find == "function" ? C.find(r).then((e) => {
454
- B(Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []), H(!1);
453
+ r && !R && (U(!0), S && typeof S.find == "function" ? S.find(r).then((e) => {
454
+ te(Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []), U(!1);
455
455
  }).catch((e) => {
456
- console.error("Failed to fetch related data:", e), H(!1);
456
+ console.error("Failed to fetch related data:", e), U(!1);
457
457
  }) : fetch(r).then((e) => e.json()).then((e) => {
458
- B(Array.isArray(e) ? e : e?.data || []);
458
+ te(Array.isArray(e) ? e : e?.data || []);
459
459
  }).catch((e) => {
460
460
  console.error("Failed to fetch related data:", e);
461
- }).finally(() => H(!1)));
461
+ }).finally(() => U(!1)));
462
462
  }, [
463
463
  r,
464
- L,
465
- C
464
+ R,
465
+ S
466
466
  ]), n.useEffect(() => {
467
- if (!C?.find || !W?.fields || !z.length) return;
468
- let e = W.fields, t = [];
467
+ if (!S?.find || !de?.fields || !B.length) return;
468
+ let e = de.fields, t = [];
469
469
  for (let [n, r] of Object.entries(e)) {
470
470
  if (!r || r.type !== "lookup" && r.type !== "master_detail") continue;
471
471
  let e = r.reference_to || r.reference;
472
472
  if (!e) continue;
473
473
  let i = /* @__PURE__ */ new Set();
474
- for (let e of z) {
474
+ for (let e of B) {
475
475
  let t = e?.[n];
476
476
  t != null && (typeof t == "string" && t ? i.add(t) : typeof t == "number" && i.add(String(t)));
477
477
  }
478
- let a = ge[n] || {}, o = Array.from(i).filter((e) => !(e in a));
478
+ let a = q[n] || {}, o = Array.from(i).filter((e) => !(e in a));
479
479
  o.length > 0 && t.push({
480
480
  fieldName: n,
481
481
  target: e,
@@ -484,7 +484,7 @@ var ut = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
484
484
  }
485
485
  if (t.length === 0) return;
486
486
  let n = !1;
487
- return Promise.all(t.map(({ fieldName: e, target: t, ids: n }) => C.find(t, {
487
+ return Promise.all(t.map(({ fieldName: e, target: t, ids: n }) => S.find(t, {
488
488
  $filter: { id: { $in: n } },
489
489
  $top: n.length
490
490
  }).then((t) => {
@@ -501,7 +501,7 @@ var ut = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
501
501
  fieldName: e,
502
502
  map: {}
503
503
  })))).then((e) => {
504
- n || _e((t) => {
504
+ n || he((t) => {
505
505
  let n = { ...t };
506
506
  for (let { fieldName: t, map: r } of e) n[t] = {
507
507
  ...n[t] || {},
@@ -513,49 +513,49 @@ var ut = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
513
513
  n = !0;
514
514
  };
515
515
  }, [
516
- C,
517
- W,
518
- z
516
+ S,
517
+ de,
518
+ B
519
519
  ]);
520
- let ye = n.useMemo(() => {
521
- if (!de) return z;
522
- let e = de.toLowerCase();
523
- return z.filter((t) => Object.values(t).some((t) => t != null && String(t).toLowerCase().includes(e)));
524
- }, [z, de]), be = n.useMemo(() => U ? [...ye].sort((e, t) => {
525
- let n = e[U], r = t[U];
520
+ let _e = n.useMemo(() => {
521
+ if (!le) return B;
522
+ let e = le.toLowerCase();
523
+ return B.filter((t) => Object.values(t).some((t) => t != null && String(t).toLowerCase().includes(e)));
524
+ }, [B, le]), ve = n.useMemo(() => W ? [..._e].sort((e, t) => {
525
+ let n = e[W], r = t[W];
526
526
  if (n == null && r == null) return 0;
527
527
  if (n == null) return 1;
528
528
  if (r == null) return -1;
529
529
  let i = String(n).localeCompare(String(r), void 0, { numeric: !0 });
530
- return le === "asc" ? i : -i;
531
- }) : ye, [
532
- ye,
533
- U,
534
- le
535
- ]), q = j && j > 0 ? j : 0, xe = q ? Math.max(1, Math.ceil(be.length / q)) : 1, Se = q ? be.slice(re * q, (re + 1) * q) : be;
530
+ return ae === "asc" ? i : -i;
531
+ }) : _e, [
532
+ _e,
533
+ W,
534
+ ae
535
+ ]), Y = j && j > 0 ? j : 0, ye = Y ? Math.max(1, Math.ceil(ve.length / Y)) : 1, be = Y ? ve.slice(ne * Y, (ne + 1) * Y) : ve;
536
536
  n.useEffect(() => {
537
- ie(0);
537
+ re(0);
538
538
  }, [
539
- de,
540
- U,
541
- le
539
+ le,
540
+ W,
541
+ ae
542
542
  ]);
543
- let Ce = n.useCallback((e) => {
544
- U === e ? ue((e) => e === "asc" ? "desc" : "asc") : (ce(e), ue("asc"));
545
- }, [U]), [J, we] = n.useState(null), Te = n.useCallback((e) => {
546
- we(e);
547
- }, []), Ee = n.useCallback(() => {
548
- J && O?.(J), we(null);
549
- }, [J, O]), De = Qe(), Oe = n.useMemo(() => {
550
- let e = w || r || "", t = (t) => !De?.isLoaded || !e ? t : t.filter((t) => {
543
+ let xe = n.useCallback((e) => {
544
+ W === e ? oe((e) => e === "asc" ? "desc" : "asc") : (ie(e), oe("asc"));
545
+ }, [W]), [Se, Ce] = n.useState(null), we = n.useCallback((e) => {
546
+ Ce(e);
547
+ }, []), Te = n.useCallback(() => {
548
+ Se && O?.(Se), Ce(null);
549
+ }, [Se, O]), Ee = tt(), De = n.useMemo(() => {
550
+ let e = C || r || "", t = (t) => !Ee?.isLoaded || !e ? t : t.filter((t) => {
551
551
  let n = t?.accessorKey || t?.field || t?.name;
552
- return n ? De.checkField(e, String(n), "read") : !0;
553
- }), i = (e) => I ? e.filter((e) => (e?.accessorKey || e?.field || e?.name) !== I) : e, a = (e) => e == null || typeof e == "string" && e.trim() === "" || Array.isArray(e) && e.length === 0, o = (e) => z.length ? e.filter((e) => {
552
+ return n ? Ee.checkField(e, String(n), "read") : !0;
553
+ }), i = (e) => F ? e.filter((e) => (e?.accessorKey || e?.field || e?.name) !== F) : e, a = (e) => e == null || typeof e == "string" && e.trim() === "" || Array.isArray(e) && e.length === 0, o = (e) => B.length ? e.filter((e) => {
554
554
  let t = e?.accessorKey || e?.field || e?.name;
555
- return t ? z.some((e) => !a(e?.[t])) : !0;
555
+ return t ? B.some((e) => !a(e?.[t])) : !0;
556
556
  }) : e;
557
- if (b && b.length > 0) return o(t(i(b)));
558
- if (!W?.fields) return [];
557
+ if (m && m.length > 0) return o(t(i(m)));
558
+ if (!de?.fields) return [];
559
559
  let s = e, c = new Set([
560
560
  "image",
561
561
  "file",
@@ -572,7 +572,7 @@ var ut = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
572
572
  "label",
573
573
  "code",
574
574
  "number"
575
- ], u = Object.entries(W.fields).filter(([e, t]) => !(e.startsWith("_") || e === "id" || e === I || t?.hidden || t?.type && c.has(t.type) || De?.isLoaded && s && !De.checkField(s, e, "read")));
575
+ ], u = Object.entries(de.fields).filter(([e, t]) => !(e.startsWith("_") || e === "id" || e === F || t?.hidden || t?.type && c.has(t.type) || Ee?.isLoaded && s && !Ee.checkField(s, e, "read")));
576
576
  return u.sort(([e, t], [n, r]) => {
577
577
  let i = l.indexOf(e), a = l.indexOf(n), o = i >= 0 ? i : 100, s = a >= 0 ? a : 100;
578
578
  if (o !== s) return o - s;
@@ -581,15 +581,15 @@ var ut = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
581
581
  }), o(u.map(([e, t]) => {
582
582
  let r = {
583
583
  accessorKey: e,
584
- header: ve(s, e, t.label || e)
584
+ header: ge(s, e, t.label || e)
585
585
  };
586
586
  if (t.type) {
587
- let i = Ye(Xe({
587
+ let i = Qe($e({
588
588
  type: t.type,
589
589
  format: t.format
590
590
  }) || t.type);
591
591
  if (i) {
592
- let a = t.type === "lookup" || t.type === "master_detail" ? ge[e] : void 0, o = a && Object.keys(a).length > 0 ? Object.entries(a).map(([e, t]) => ({
592
+ let a = t.type === "lookup" || t.type === "master_detail" ? q[e] : void 0, o = a && Object.keys(a).length > 0 ? Object.entries(a).map(([e, t]) => ({
593
593
  value: e,
594
594
  label: t
595
595
  })) : void 0, s = {
@@ -612,36 +612,36 @@ var ut = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
612
612
  return r;
613
613
  })).slice(0, Math.max(1, A));
614
614
  }, [
615
- b,
616
- W,
617
- w,
615
+ m,
616
+ de,
617
+ C,
618
618
  r,
619
- ve,
620
- I,
621
- z,
622
- A,
623
619
  ge,
624
- De
625
- ]), ke = !!D || !!O, je = n.useMemo(() => {
626
- if (y) return y;
620
+ F,
621
+ B,
622
+ A,
623
+ q,
624
+ Ee
625
+ ]), Oe = !!D || !!O, ke = n.useMemo(() => {
626
+ if (p) return p;
627
627
  switch (t) {
628
628
  case "grid":
629
629
  case "table": return {
630
630
  type: "data-table",
631
- data: Se,
632
- columns: Oe,
631
+ data: be,
632
+ columns: De,
633
633
  pagination: !1,
634
- pageSize: q || 10,
634
+ pageSize: Y || 10,
635
635
  searchable: !1,
636
636
  exportable: !1,
637
- rowActions: ke,
637
+ rowActions: Oe,
638
638
  onRowEdit: D,
639
- onRowDelete: O ? Te : void 0,
639
+ onRowDelete: O ? we : void 0,
640
640
  onRowClick: k
641
641
  };
642
642
  case "list": return {
643
643
  type: "data-list",
644
- data: Se
644
+ data: be
645
645
  };
646
646
  default: return {
647
647
  type: "div",
@@ -650,29 +650,29 @@ var ut = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
650
650
  }
651
651
  }, [
652
652
  t,
653
- Se,
653
+ be,
654
+ De,
655
+ p,
656
+ Y,
654
657
  Oe,
655
- y,
656
- q,
657
- ke,
658
658
  D,
659
659
  O,
660
- Te,
660
+ we,
661
661
  k
662
- ]), Me = N ? "cursor-pointer select-none" : void 0, Ne = N ? () => he((e) => !e) : void 0, Pe = lt(te), Y = !V && z.length === 0, Fe = ee;
663
- return /* @__PURE__ */ Q(m, {
664
- className: P("shadow-none", Y && "bg-muted/20", S),
662
+ ]), Ae = N ? "cursor-pointer select-none" : void 0, je = N ? () => pe((e) => !e) : void 0, Ne = ft(I), Pe = !V && B.length === 0, Fe = M;
663
+ return /* @__PURE__ */ Q(_, {
664
+ className: L("shadow-none", Pe && "bg-muted/20", x),
665
665
  children: [
666
- /* @__PURE__ */ Z(g, {
667
- className: P("py-3 px-4", Me),
668
- onClick: Ne,
669
- children: /* @__PURE__ */ Q(_, {
666
+ /* @__PURE__ */ Z(y, {
667
+ className: L("py-3 px-4", Ae),
668
+ onClick: je,
669
+ children: /* @__PURE__ */ Q(b, {
670
670
  className: "flex items-center justify-between gap-2 text-sm font-semibold",
671
671
  children: [/* @__PURE__ */ Q("div", {
672
672
  className: "flex items-center gap-2 min-w-0",
673
673
  children: [
674
- N && Z(G ? se : ae, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }),
675
- /* @__PURE__ */ Z(Pe, {
674
+ N && Z(fe ? G : se, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }),
675
+ /* @__PURE__ */ Z(Ne, {
676
676
  className: "h-4 w-4 text-muted-foreground shrink-0",
677
677
  "aria-hidden": !0
678
678
  }),
@@ -680,110 +680,110 @@ var ut = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
680
680
  className: "truncate",
681
681
  children: e
682
682
  }),
683
- /* @__PURE__ */ Z(f, {
683
+ /* @__PURE__ */ Z(h, {
684
684
  variant: "secondary",
685
- className: P("text-xs font-normal h-5 px-1.5", z.length === 0 && "bg-muted text-muted-foreground"),
686
- "aria-label": `${z.length} records`,
687
- children: z.length
685
+ className: L("text-xs font-normal h-5 px-1.5", B.length === 0 && "bg-muted text-muted-foreground"),
686
+ "aria-label": `${B.length} records`,
687
+ children: B.length
688
688
  })
689
689
  ]
690
690
  }), /* @__PURE__ */ Z("div", {
691
691
  className: "flex items-center gap-1 shrink-0",
692
- children: T && /* @__PURE__ */ Q(p, {
692
+ children: T && /* @__PURE__ */ Q(g, {
693
693
  variant: "outline",
694
694
  size: "sm",
695
695
  onClick: (e) => {
696
696
  e.stopPropagation(), T();
697
697
  },
698
698
  className: "gap-1 h-7 text-xs shadow-none",
699
- children: [/* @__PURE__ */ Z(Ae, { className: "h-3.5 w-3.5" }), K("detail.new")]
699
+ children: [/* @__PURE__ */ Z(Me, { className: "h-3.5 w-3.5" }), J("detail.new")]
700
700
  })
701
701
  })]
702
702
  })
703
703
  }),
704
- !G && /* @__PURE__ */ Q(h, {
705
- className: P("pt-0", Y ? "pb-3 px-4" : "pb-4 px-4"),
704
+ !fe && /* @__PURE__ */ Q(v, {
705
+ className: L("pt-0", Pe ? "pb-3 px-4" : "pb-4 px-4"),
706
706
  children: [
707
707
  Fe && /* @__PURE__ */ Z("div", {
708
708
  className: "mb-3",
709
- children: /* @__PURE__ */ Z(x, {
710
- placeholder: K("detail.filterPlaceholder"),
711
- value: de,
712
- onChange: (e) => fe(e.target.value),
709
+ children: /* @__PURE__ */ Z(w, {
710
+ placeholder: J("detail.filterPlaceholder"),
711
+ value: le,
712
+ onChange: (e) => ue(e.target.value),
713
713
  className: "h-8 text-sm"
714
714
  })
715
715
  }),
716
- M && Oe && Oe.length > 0 && z.length > 0 && /* @__PURE__ */ Z("div", {
716
+ ee && De && De.length > 0 && B.length > 0 && /* @__PURE__ */ Z("div", {
717
717
  className: "flex flex-wrap gap-1 mb-3",
718
- children: Oe.map((e) => {
718
+ children: De.map((e) => {
719
719
  let t = e.accessorKey || e.field || e.name;
720
720
  if (!t) return null;
721
- let n = e.header || e.label || t, r = U === t;
722
- return /* @__PURE__ */ Q(p, {
721
+ let n = e.header || e.label || t, r = W === t;
722
+ return /* @__PURE__ */ Q(g, {
723
723
  variant: r ? "secondary" : "ghost",
724
724
  size: "sm",
725
725
  className: "gap-1 h-7 text-xs",
726
- onClick: () => Ce(t),
726
+ onClick: () => xe(t),
727
727
  children: [
728
- /* @__PURE__ */ Z(R, { className: "h-3 w-3" }),
728
+ /* @__PURE__ */ Z(H, { className: "h-3 w-3" }),
729
729
  n,
730
- r && (le === "asc" ? " ↑" : " ↓")
730
+ r && (ae === "asc" ? " ↑" : " ↓")
731
731
  ]
732
732
  }, t);
733
733
  })
734
734
  }),
735
735
  V ? /* @__PURE__ */ Z("div", {
736
736
  className: "flex items-center justify-center py-6 text-muted-foreground text-sm",
737
- children: K("detail.loading")
738
- }) : Y ? /* @__PURE__ */ Q("div", {
737
+ children: J("detail.loading")
738
+ }) : Pe ? /* @__PURE__ */ Q("div", {
739
739
  className: "flex flex-col items-center justify-center gap-2 py-6 text-sm",
740
740
  children: [
741
- /* @__PURE__ */ Z(Pe, {
741
+ /* @__PURE__ */ Z(Ne, {
742
742
  className: "h-8 w-8 text-muted-foreground/40",
743
743
  "aria-hidden": !0
744
744
  }),
745
745
  /* @__PURE__ */ Z("span", {
746
746
  className: "text-muted-foreground italic",
747
- children: K("detail.noRelatedRecords")
747
+ children: J("detail.noRelatedRecords")
748
748
  }),
749
- T && /* @__PURE__ */ Q(p, {
749
+ T && /* @__PURE__ */ Q(g, {
750
750
  variant: "outline",
751
751
  size: "sm",
752
752
  onClick: T,
753
753
  className: "gap-1 h-7 text-xs mt-1",
754
- children: [/* @__PURE__ */ Z(Ae, { className: "h-3.5 w-3.5" }), K("detail.new")]
754
+ children: [/* @__PURE__ */ Z(Me, { className: "h-3.5 w-3.5" }), J("detail.new")]
755
755
  })
756
756
  ]
757
- }) : /* @__PURE__ */ Z(He, { schema: je }),
758
- q > 0 && be.length > q && /* @__PURE__ */ Q("div", {
757
+ }) : /* @__PURE__ */ Z(Ge, { schema: ke }),
758
+ Y > 0 && ve.length > Y && /* @__PURE__ */ Q("div", {
759
759
  className: "flex items-center justify-between mt-3 pt-3 border-t",
760
760
  children: [
761
- /* @__PURE__ */ Q(p, {
761
+ /* @__PURE__ */ Q(g, {
762
762
  variant: "outline",
763
763
  size: "sm",
764
764
  className: "h-7 text-xs gap-1",
765
- disabled: re === 0,
766
- onClick: () => ie((e) => Math.max(0, e - 1)),
767
- children: [/* @__PURE__ */ Z(oe, { className: "h-3 w-3" }), K("detail.previousPage")]
765
+ disabled: ne === 0,
766
+ onClick: () => re((e) => Math.max(0, e - 1)),
767
+ children: [/* @__PURE__ */ Z(ce, { className: "h-3 w-3" }), J("detail.previousPage")]
768
768
  }),
769
769
  /* @__PURE__ */ Z("span", {
770
770
  className: "text-xs text-muted-foreground",
771
- children: K("detail.pageOf", {
772
- current: re + 1,
773
- total: xe
771
+ children: J("detail.pageOf", {
772
+ current: ne + 1,
773
+ total: ye
774
774
  })
775
775
  }),
776
- /* @__PURE__ */ Q(p, {
776
+ /* @__PURE__ */ Q(g, {
777
777
  variant: "outline",
778
778
  size: "sm",
779
779
  className: "h-7 text-xs gap-1",
780
- disabled: re >= xe - 1,
781
- onClick: () => ie((e) => Math.min(xe - 1, e + 1)),
782
- children: [K("detail.nextPage"), /* @__PURE__ */ Z(se, { className: "h-3 w-3" })]
780
+ disabled: ne >= ye - 1,
781
+ onClick: () => re((e) => Math.min(ye - 1, e + 1)),
782
+ children: [J("detail.nextPage"), /* @__PURE__ */ Z(G, { className: "h-3 w-3" })]
783
783
  })
784
784
  ]
785
785
  }),
786
- E && !Y && q > 0 && be.length > q && /* @__PURE__ */ Z("div", {
786
+ E && !Pe && Y > 0 && ve.length > Y && /* @__PURE__ */ Z("div", {
787
787
  className: "mt-3 pt-3 border-t flex justify-center",
788
788
  children: /* @__PURE__ */ Q("button", {
789
789
  type: "button",
@@ -791,28 +791,28 @@ var ut = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
791
791
  e.stopPropagation(), E();
792
792
  },
793
793
  className: "text-xs text-muted-foreground hover:text-foreground inline-flex items-center gap-1 transition-colors",
794
- children: [K("detail.viewAll"), /* @__PURE__ */ Z(pe, { className: "h-3 w-3" })]
794
+ children: [J("detail.viewAll"), /* @__PURE__ */ Z(me, { className: "h-3 w-3" })]
795
795
  })
796
796
  })
797
797
  ]
798
798
  }),
799
799
  /* @__PURE__ */ Z(i, {
800
- open: J !== null,
800
+ open: Se !== null,
801
801
  onOpenChange: (e) => {
802
- e || we(null);
802
+ e || Ce(null);
803
803
  },
804
- children: /* @__PURE__ */ Q(s, { children: [/* @__PURE__ */ Q(u, { children: [/* @__PURE__ */ Z(d, { children: K("detail.deleteRowTitle", { defaultValue: "Delete record" }) }), /* @__PURE__ */ Z(c, { children: K("detail.deleteRowConfirmation") })] }), /* @__PURE__ */ Q(l, { children: [/* @__PURE__ */ Z(o, { children: K("detail.cancel", { defaultValue: "Cancel" }) }), /* @__PURE__ */ Z(a, {
805
- onClick: Ee,
804
+ children: /* @__PURE__ */ Q(s, { children: [/* @__PURE__ */ Q(u, { children: [/* @__PURE__ */ Z(d, { children: J("detail.deleteRowTitle", { defaultValue: "Delete record" }) }), /* @__PURE__ */ Z(c, { children: J("detail.deleteRowConfirmation") })] }), /* @__PURE__ */ Q(l, { children: [/* @__PURE__ */ Z(o, { children: J("detail.cancel", { defaultValue: "Cancel" }) }), /* @__PURE__ */ Z(a, {
805
+ onClick: Te,
806
806
  className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
807
- children: K("detail.delete", { defaultValue: "Delete" })
807
+ children: J("detail.delete", { defaultValue: "Delete" })
808
808
  })] })] })
809
809
  })
810
810
  ]
811
811
  });
812
- }, dt = ({ group: e, data: t, className: r, objectSchema: i, objectName: a, isEditing: o = !1, onFieldChange: s }) => {
812
+ }, mt = ({ group: e, data: t, className: r, objectSchema: i, objectName: a, isEditing: o = !1, onFieldChange: s }) => {
813
813
  let c = e.collapsible ?? !0, [l, u] = n.useState(e.defaultCollapsed ?? !1), d = /* @__PURE__ */ Z("div", {
814
814
  className: "space-y-3 sm:space-y-4",
815
- children: e.sections.map((e, n) => /* @__PURE__ */ Z(st, {
815
+ children: e.sections.map((e, n) => /* @__PURE__ */ Z(ut, {
816
816
  section: e,
817
817
  data: t,
818
818
  objectSchema: i,
@@ -821,17 +821,17 @@ var ut = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
821
821
  onFieldChange: s
822
822
  }, n))
823
823
  });
824
- return c ? /* @__PURE__ */ Q(v, {
824
+ return c ? /* @__PURE__ */ Q(x, {
825
825
  open: !l,
826
826
  onOpenChange: (e) => u(!e),
827
827
  className: r,
828
828
  children: [
829
- /* @__PURE__ */ Z(b, {
829
+ /* @__PURE__ */ Z(C, {
830
830
  asChild: !0,
831
831
  children: /* @__PURE__ */ Q("div", {
832
832
  className: "flex items-center gap-2 pb-2 border-b cursor-pointer hover:bg-muted/50 transition-colors rounded-t-md px-2 py-1.5",
833
833
  children: [
834
- Z(l ? se : ae, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
834
+ Z(l ? G : se, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
835
835
  e.icon && /* @__PURE__ */ Z("span", {
836
836
  className: "text-muted-foreground",
837
837
  children: e.icon
@@ -847,13 +847,13 @@ var ut = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
847
847
  className: "text-sm text-muted-foreground mt-1",
848
848
  children: e.description
849
849
  }),
850
- /* @__PURE__ */ Z(y, { children: /* @__PURE__ */ Z("div", {
850
+ /* @__PURE__ */ Z(S, { children: /* @__PURE__ */ Z("div", {
851
851
  className: "mt-3",
852
852
  children: d
853
853
  }) })
854
854
  ]
855
855
  }) : /* @__PURE__ */ Q("div", {
856
- className: P("space-y-3", r),
856
+ className: L("space-y-3", r),
857
857
  children: [
858
858
  /* @__PURE__ */ Q("div", {
859
859
  className: "flex items-center gap-2 pb-2 border-b",
@@ -872,19 +872,19 @@ var ut = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
872
872
  d
873
873
  ]
874
874
  });
875
- }, ft = ({ fields: e, data: t, className: n, objectName: r, objectSchema: i }) => {
876
- let { fieldLabel: a } = Ke();
875
+ }, ht = ({ fields: e, data: t, className: n, objectName: r, objectSchema: i }) => {
876
+ let { fieldLabel: a } = Ye();
877
877
  if (!e.length || !t) return null;
878
878
  let o = e.filter((e) => {
879
879
  let n = t?.[e.name];
880
880
  return n != null && n !== "";
881
881
  });
882
- return o.length === 0 ? null : /* @__PURE__ */ Z(m, {
883
- className: P("bg-muted/30 border-dashed", n),
884
- children: /* @__PURE__ */ Z(h, {
882
+ return o.length === 0 ? null : /* @__PURE__ */ Z(_, {
883
+ className: L("bg-muted/30 border-dashed", n),
884
+ children: /* @__PURE__ */ Z(v, {
885
885
  className: "py-3 px-4",
886
886
  children: /* @__PURE__ */ Z("div", {
887
- className: P("grid gap-4", o.length === 1 ? "grid-cols-1" : o.length === 2 ? "grid-cols-2" : o.length === 3 ? "grid-cols-3" : "grid-cols-2 md:grid-cols-4"),
887
+ className: L("grid gap-4", o.length === 1 ? "grid-cols-1" : o.length === 2 ? "grid-cols-2" : o.length === 3 ? "grid-cols-3" : "grid-cols-2 md:grid-cols-4"),
888
888
  children: o.map((e) => {
889
889
  let n = t[e.name], o = i?.fields?.[e.name], s = e.type || o?.type, c = {
890
890
  name: e.name,
@@ -894,7 +894,7 @@ var ut = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
894
894
  ...o?.currency && { currency: o.currency },
895
895
  ...o?.precision !== void 0 && { precision: o.precision },
896
896
  ...o?.format && { format: o.format }
897
- }, l = Ye(Xe(c) || s || "text");
897
+ }, l = Qe($e(c) || s || "text");
898
898
  return /* @__PURE__ */ Q("div", {
899
899
  className: "flex flex-col gap-0.5",
900
900
  children: [/* @__PURE__ */ Q("span", {
@@ -918,7 +918,7 @@ var ut = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
918
918
  };
919
919
  //#endregion
920
920
  //#region src/RecordComments.tsx
921
- function pt(e) {
921
+ function gt(e) {
922
922
  try {
923
923
  let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
924
924
  if (r < 1) return "just now";
@@ -931,8 +931,8 @@ function pt(e) {
931
931
  return e;
932
932
  }
933
933
  }
934
- var mt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, className: a }) => {
935
- let { t: o } = $(), [s, c] = n.useState(""), [l, u] = n.useState(!1), [d, f] = n.useState(""), v = n.useCallback(async () => {
934
+ var _t = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, className: a }) => {
935
+ let { t: o } = $(), [s, c] = n.useState(""), [l, u] = n.useState(!1), [d, f] = n.useState(""), p = n.useCallback(async () => {
936
936
  let e = s.trim();
937
937
  if (!(!e || !t)) {
938
938
  u(!0);
@@ -942,18 +942,18 @@ var mt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, cl
942
942
  u(!1);
943
943
  }
944
944
  }
945
- }, [s, t]), y = n.useCallback((e) => {
946
- e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), v());
947
- }, [v]), b = n.useMemo(() => [...d.trim() ? e.filter((e) => {
945
+ }, [s, t]), m = n.useCallback((e) => {
946
+ e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), p());
947
+ }, [p]), h = n.useMemo(() => [...d.trim() ? e.filter((e) => {
948
948
  let t = d.trim().toLowerCase();
949
949
  return e.text.toLowerCase().includes(t) || e.author.toLowerCase().includes(t);
950
950
  }) : e].sort((e, t) => e.pinned && !t.pinned ? -1 : !e.pinned && t.pinned ? 1 : 0), [e, d]);
951
- return /* @__PURE__ */ Q(m, {
952
- className: P("", a),
953
- children: [/* @__PURE__ */ Z(g, { children: /* @__PURE__ */ Q(_, {
951
+ return /* @__PURE__ */ Q(_, {
952
+ className: L("", a),
953
+ children: [/* @__PURE__ */ Z(y, { children: /* @__PURE__ */ Q(b, {
954
954
  className: "flex items-center gap-2 text-base",
955
955
  children: [
956
- /* @__PURE__ */ Z(J, { className: "h-4 w-4" }),
956
+ /* @__PURE__ */ Z(Te, { className: "h-4 w-4" }),
957
957
  o("detail.comments"),
958
958
  /* @__PURE__ */ Q("span", {
959
959
  className: "text-sm font-normal text-muted-foreground",
@@ -964,7 +964,7 @@ var mt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, cl
964
964
  ]
965
965
  })
966
966
  ]
967
- }) }), /* @__PURE__ */ Q(h, {
967
+ }) }), /* @__PURE__ */ Q(v, {
968
968
  className: "space-y-4",
969
969
  children: [
970
970
  i && /* @__PURE__ */ Z("div", {
@@ -972,7 +972,7 @@ var mt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, cl
972
972
  children: /* @__PURE__ */ Q("div", {
973
973
  className: "relative flex-1",
974
974
  children: [
975
- /* @__PURE__ */ Z(Pe, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }),
975
+ /* @__PURE__ */ Z(Ie, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }),
976
976
  /* @__PURE__ */ Z("input", {
977
977
  className: "w-full rounded-md border border-input bg-background pl-8 pr-8 py-1.5 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
978
978
  placeholder: o("detail.searchComments"),
@@ -985,7 +985,7 @@ var mt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, cl
985
985
  onClick: () => f(""),
986
986
  "aria-label": o("detail.clearSearch"),
987
987
  type: "button",
988
- children: /* @__PURE__ */ Z(ze, { className: "h-3.5 w-3.5" })
988
+ children: /* @__PURE__ */ Z(He, { className: "h-3.5 w-3.5" })
989
989
  })
990
990
  ]
991
991
  })
@@ -997,24 +997,24 @@ var mt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, cl
997
997
  placeholder: o("detail.addCommentPlaceholder"),
998
998
  value: s,
999
999
  onChange: (e) => c(e.target.value),
1000
- onKeyDown: y,
1000
+ onKeyDown: m,
1001
1001
  disabled: l
1002
- }), /* @__PURE__ */ Z(p, {
1002
+ }), /* @__PURE__ */ Z(g, {
1003
1003
  size: "icon",
1004
1004
  variant: "default",
1005
- onClick: v,
1005
+ onClick: p,
1006
1006
  disabled: !s.trim() || l,
1007
1007
  className: "shrink-0 self-end",
1008
- children: /* @__PURE__ */ Z(Y, { className: "h-4 w-4" })
1008
+ children: /* @__PURE__ */ Z(Le, { className: "h-4 w-4" })
1009
1009
  })]
1010
1010
  }),
1011
- b.length === 0 ? /* @__PURE__ */ Z("p", {
1011
+ h.length === 0 ? /* @__PURE__ */ Z("p", {
1012
1012
  className: "text-sm text-muted-foreground text-center py-4",
1013
1013
  children: d.trim() ? o("detail.noMatchingComments") : o("detail.noCommentsYet")
1014
1014
  }) : /* @__PURE__ */ Z("div", {
1015
1015
  className: "space-y-3",
1016
- children: b.map((e) => /* @__PURE__ */ Q("div", {
1017
- className: P("flex gap-3", e.pinned && "bg-muted/40 rounded-md p-2 -mx-2"),
1016
+ children: h.map((e) => /* @__PURE__ */ Q("div", {
1017
+ className: L("flex gap-3", e.pinned && "bg-muted/40 rounded-md p-2 -mx-2"),
1018
1018
  children: [/* @__PURE__ */ Z("div", {
1019
1019
  className: "shrink-0",
1020
1020
  children: e.avatarUrl ? /* @__PURE__ */ Z("img", {
@@ -1037,11 +1037,11 @@ var mt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, cl
1037
1037
  }),
1038
1038
  /* @__PURE__ */ Z("span", {
1039
1039
  className: "text-xs text-muted-foreground",
1040
- children: pt(e.createdAt)
1040
+ children: gt(e.createdAt)
1041
1041
  }),
1042
1042
  e.pinned && /* @__PURE__ */ Q("span", {
1043
1043
  className: "text-xs text-amber-600 flex items-center gap-0.5",
1044
- children: [/* @__PURE__ */ Z(ke, { className: "h-3 w-3" }), o("detail.pinned")]
1044
+ children: [/* @__PURE__ */ Z(je, { className: "h-3 w-3" }), o("detail.pinned")]
1045
1045
  })
1046
1046
  ]
1047
1047
  }),
@@ -1054,7 +1054,7 @@ var mt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, cl
1054
1054
  className: "mt-1 text-xs text-muted-foreground hover:text-foreground flex items-center gap-1",
1055
1055
  onClick: () => r(e.id),
1056
1056
  "aria-label": e.pinned ? o("detail.unpin") : o("detail.pin"),
1057
- children: [/* @__PURE__ */ Z(ke, { className: "h-3 w-3" }), e.pinned ? o("detail.unpin") : o("detail.pin")]
1057
+ children: [/* @__PURE__ */ Z(je, { className: "h-3 w-3" }), e.pinned ? o("detail.unpin") : o("detail.pin")]
1058
1058
  })
1059
1059
  ]
1060
1060
  })]
@@ -1063,20 +1063,20 @@ var mt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, cl
1063
1063
  ]
1064
1064
  })]
1065
1065
  });
1066
- }, ht = {
1067
- field_change: W,
1068
- create: je,
1069
- delete: Le,
1070
- comment: J,
1071
- status_change: ne
1072
- }, gt = {
1066
+ }, vt = {
1067
+ field_change: pe,
1068
+ create: Ne,
1069
+ delete: Be,
1070
+ comment: Te,
1071
+ status_change: V
1072
+ }, yt = {
1073
1073
  field_change: "bg-blue-100 text-blue-600",
1074
1074
  create: "bg-green-100 text-green-600",
1075
1075
  delete: "bg-red-100 text-red-600",
1076
1076
  comment: "bg-purple-100 text-purple-600",
1077
1077
  status_change: "bg-amber-100 text-amber-600"
1078
1078
  };
1079
- function _t(e) {
1079
+ function bt(e) {
1080
1080
  try {
1081
1081
  let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
1082
1082
  if (r < 1) return "just now";
@@ -1089,24 +1089,24 @@ function _t(e) {
1089
1089
  return e;
1090
1090
  }
1091
1091
  }
1092
- function vt(e) {
1092
+ function xt(e) {
1093
1093
  return e.description ? e.description : e.type === "field_change" && e.field ? `Changed ${e.field.charAt(0).toUpperCase() + e.field.slice(1).replace(/_/g, " ")} from "${e.oldValue == null ? "(empty)" : String(e.oldValue)}" to "${e.newValue == null ? "(empty)" : String(e.newValue)}"` : e.type === "create" ? "Created this record" : e.type === "delete" ? "Deleted this record" : e.type === "status_change" && e.field ? `Changed status to "${e.newValue == null ? "(empty)" : String(e.newValue)}"` : "Updated record";
1094
1094
  }
1095
- var yt = {
1095
+ var St = {
1096
1096
  all: "All",
1097
1097
  field_change: "Field Changes",
1098
1098
  create: "Creates",
1099
1099
  delete: "Deletes",
1100
1100
  comment: "Comments",
1101
1101
  status_change: "Status Changes"
1102
- }, bt = ({ activities: e, filterable: t = !1, defaultFilter: r = "all", className: i }) => {
1102
+ }, Ct = ({ activities: e, filterable: t = !1, defaultFilter: r = "all", className: i }) => {
1103
1103
  let [a, o] = n.useState(r), s = n.useMemo(() => a === "all" ? e : e.filter((e) => e.type === a), [e, a]);
1104
- return /* @__PURE__ */ Q(m, {
1105
- className: P("", i),
1106
- children: [/* @__PURE__ */ Z(g, { children: /* @__PURE__ */ Q(_, {
1104
+ return /* @__PURE__ */ Q(_, {
1105
+ className: L("", i),
1106
+ children: [/* @__PURE__ */ Z(y, { children: /* @__PURE__ */ Q(b, {
1107
1107
  className: "flex items-center gap-2 text-base",
1108
1108
  children: [
1109
- /* @__PURE__ */ Z(I, { className: "h-4 w-4" }),
1109
+ /* @__PURE__ */ Z(z, { className: "h-4 w-4" }),
1110
1110
  "Activity",
1111
1111
  /* @__PURE__ */ Q("span", {
1112
1112
  className: "text-sm font-normal text-muted-foreground",
@@ -1117,16 +1117,16 @@ var yt = {
1117
1117
  ]
1118
1118
  })
1119
1119
  ]
1120
- }) }), /* @__PURE__ */ Q(h, { children: [t && /* @__PURE__ */ Z("div", {
1120
+ }) }), /* @__PURE__ */ Q(v, { children: [t && /* @__PURE__ */ Z("div", {
1121
1121
  className: "flex flex-wrap gap-1.5 mb-4",
1122
1122
  role: "group",
1123
1123
  "aria-label": "Activity type filter",
1124
- children: Object.keys(yt).map((e) => /* @__PURE__ */ Q("button", {
1124
+ children: Object.keys(St).map((e) => /* @__PURE__ */ Q("button", {
1125
1125
  type: "button",
1126
- className: P("inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors", a === e ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground hover:bg-muted/80"),
1126
+ className: L("inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors", a === e ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground hover:bg-muted/80"),
1127
1127
  onClick: () => o(e),
1128
1128
  "aria-pressed": a === e,
1129
- children: [e !== "all" && n.createElement(ht[e] || W, { className: "h-3 w-3" }), yt[e]]
1129
+ children: [e !== "all" && n.createElement(vt[e] || pe, { className: "h-3 w-3" }), St[e]]
1130
1130
  }, e))
1131
1131
  }), s.length === 0 ? /* @__PURE__ */ Z("p", {
1132
1132
  className: "text-sm text-muted-foreground text-center py-4",
@@ -1136,11 +1136,11 @@ var yt = {
1136
1136
  children: [/* @__PURE__ */ Z("div", { className: "absolute left-4 top-2 bottom-2 w-px bg-border" }), /* @__PURE__ */ Z("div", {
1137
1137
  className: "space-y-4",
1138
1138
  children: s.map((e) => {
1139
- let t = ht[e.type] || W;
1139
+ let t = vt[e.type] || pe;
1140
1140
  return /* @__PURE__ */ Q("div", {
1141
1141
  className: "flex gap-3 relative",
1142
1142
  children: [/* @__PURE__ */ Z("div", {
1143
- className: P("shrink-0 h-8 w-8 rounded-full flex items-center justify-center z-10", gt[e.type] || "bg-gray-100 text-gray-600"),
1143
+ className: L("shrink-0 h-8 w-8 rounded-full flex items-center justify-center z-10", yt[e.type] || "bg-gray-100 text-gray-600"),
1144
1144
  children: /* @__PURE__ */ Z(t, { className: "h-3.5 w-3.5" })
1145
1145
  }), /* @__PURE__ */ Q("div", {
1146
1146
  className: "flex-1 min-w-0 pt-1",
@@ -1154,12 +1154,12 @@ var yt = {
1154
1154
  " ",
1155
1155
  /* @__PURE__ */ Z("span", {
1156
1156
  className: "text-muted-foreground",
1157
- children: vt(e)
1157
+ children: xt(e)
1158
1158
  })
1159
1159
  ]
1160
1160
  }), /* @__PURE__ */ Z("p", {
1161
1161
  className: "text-xs text-muted-foreground mt-0.5",
1162
- children: _t(e.timestamp)
1162
+ children: bt(e.timestamp)
1163
1163
  })]
1164
1164
  })]
1165
1165
  }, e.id);
@@ -1167,7 +1167,7 @@ var yt = {
1167
1167
  })]
1168
1168
  })] })]
1169
1169
  });
1170
- }, xt = {
1170
+ }, wt = {
1171
1171
  create: "default",
1172
1172
  update: "secondary",
1173
1173
  delete: "destructive",
@@ -1179,68 +1179,147 @@ var yt = {
1179
1179
  export: "outline",
1180
1180
  import: "outline"
1181
1181
  };
1182
- function St(e) {
1182
+ function Tt(e) {
1183
1183
  if (!e) return "";
1184
1184
  let t = e instanceof Date ? e : new Date(e);
1185
1185
  return Number.isNaN(t.getTime()) ? String(e) : t.toLocaleString();
1186
1186
  }
1187
- function Ct({ entries: e, loading: t, emptyText: n, className: r }) {
1187
+ var Et = [
1188
+ [60, "second"],
1189
+ [60, "minute"],
1190
+ [24, "hour"],
1191
+ [7, "day"],
1192
+ [4.34524, "week"],
1193
+ [12, "month"],
1194
+ [Infinity, "year"]
1195
+ ];
1196
+ function Dt(e, t) {
1197
+ if (!e) return "";
1198
+ let n = e instanceof Date ? e : new Date(e);
1199
+ if (Number.isNaN(n.getTime())) return String(e);
1200
+ let r = (n.getTime() - Date.now()) / 1e3;
1201
+ for (let [n, i] of Et) {
1202
+ if (Math.abs(r) < n) try {
1203
+ return new Intl.RelativeTimeFormat(t, { numeric: "auto" }).format(Math.round(r), i);
1204
+ } catch {
1205
+ return Tt(e);
1206
+ }
1207
+ r /= n;
1208
+ }
1209
+ return Tt(e);
1210
+ }
1211
+ function Ot(e) {
1212
+ if (!e) return "?";
1213
+ let t = e.trim().split(/\s+/).filter(Boolean).slice(0, 2);
1214
+ return t.length === 0 ? "?" : t.map((e) => e.charAt(0).toUpperCase()).join("");
1215
+ }
1216
+ function kt(e) {
1217
+ if (e == null || e === "") return "—";
1218
+ if (typeof e == "string") return e;
1219
+ if (typeof e == "number" || typeof e == "boolean") return String(e);
1220
+ try {
1221
+ return JSON.stringify(e);
1222
+ } catch {
1223
+ return String(e);
1224
+ }
1225
+ }
1226
+ function At({ entries: e, loading: t, emptyText: n, className: r, locale: i }) {
1188
1227
  return t ? /* @__PURE__ */ Z("div", {
1189
- className: P("space-y-3", r),
1228
+ className: L("space-y-3", r),
1190
1229
  children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */ Q("div", {
1191
1230
  className: "flex items-start gap-3",
1192
- children: [/* @__PURE__ */ Z(E, { className: "h-2 w-2 mt-2 rounded-full" }), /* @__PURE__ */ Q("div", {
1231
+ children: [/* @__PURE__ */ Z(k, { className: "h-8 w-8 rounded-full" }), /* @__PURE__ */ Q("div", {
1193
1232
  className: "flex-1 space-y-2",
1194
- children: [/* @__PURE__ */ Z(E, { className: "h-4 w-1/3" }), /* @__PURE__ */ Z(E, { className: "h-3 w-1/2" })]
1233
+ children: [/* @__PURE__ */ Z(k, { className: "h-4 w-1/3" }), /* @__PURE__ */ Z(k, { className: "h-3 w-1/2" })]
1195
1234
  })]
1196
1235
  }, t))
1197
1236
  }) : !e || e.length === 0 ? /* @__PURE__ */ Z("div", {
1198
- className: P("flex items-center justify-center rounded-md border border-dashed py-10 text-sm text-muted-foreground", r),
1237
+ className: L("flex items-center justify-center rounded-md border border-dashed py-10 text-sm text-muted-foreground", r),
1199
1238
  children: n ?? "No history yet"
1200
- }) : /* @__PURE__ */ Z("ol", {
1201
- className: P("relative space-y-4 border-l border-border pl-5", r),
1202
- children: e.map((e, t) => {
1203
- let n = xt[(e.action ?? "").toLowerCase()] ?? "outline", r = e.user_name || e.user_id || "System", i = St(e.created_at);
1204
- return /* @__PURE__ */ Q("li", {
1205
- className: "relative",
1206
- children: [
1207
- /* @__PURE__ */ Z("span", { className: "absolute -left-[27px] top-1.5 h-2.5 w-2.5 rounded-full bg-primary ring-2 ring-background" }),
1208
- /* @__PURE__ */ Q("div", {
1209
- className: "flex flex-wrap items-baseline gap-2",
1239
+ }) : /* @__PURE__ */ Z(F, {
1240
+ delayDuration: 150,
1241
+ children: /* @__PURE__ */ Z("ol", {
1242
+ className: L("space-y-4", r),
1243
+ children: e.map((e, t) => {
1244
+ let n = wt[(e.action ?? "").toLowerCase()] ?? "outline", r = typeof e.user_name == "string" && e.user_name.trim() || "Unknown user", a = Tt(e.created_at), o = Dt(e.created_at, i), s = typeof e.user_avatar == "string" ? e.user_avatar : void 0;
1245
+ return /* @__PURE__ */ Q("li", {
1246
+ className: "flex items-start gap-3",
1247
+ children: [/* @__PURE__ */ Q(f, {
1248
+ className: "h-8 w-8 mt-0.5 shrink-0",
1249
+ children: [s ? /* @__PURE__ */ Z(m, {
1250
+ src: s,
1251
+ alt: r
1252
+ }) : null, /* @__PURE__ */ Z(p, {
1253
+ className: "text-[10px] font-medium",
1254
+ children: Ot(e.user_name)
1255
+ })]
1256
+ }), /* @__PURE__ */ Q("div", {
1257
+ className: "min-w-0 flex-1",
1210
1258
  children: [
1211
- e.action && /* @__PURE__ */ Z(f, {
1212
- variant: n,
1213
- className: "text-xs uppercase tracking-wide",
1214
- children: e.action
1259
+ /* @__PURE__ */ Q("div", {
1260
+ className: "flex flex-wrap items-baseline gap-x-2 gap-y-1",
1261
+ children: [
1262
+ /* @__PURE__ */ Z("span", {
1263
+ className: "text-sm font-medium text-foreground",
1264
+ children: r
1265
+ }),
1266
+ e.action && /* @__PURE__ */ Z(h, {
1267
+ variant: n,
1268
+ className: "text-[10px] uppercase tracking-wide",
1269
+ children: e.action
1270
+ }),
1271
+ a && /* @__PURE__ */ Q(N, { children: [/* @__PURE__ */ Z(I, {
1272
+ asChild: !0,
1273
+ children: /* @__PURE__ */ Z("span", {
1274
+ className: "text-xs text-muted-foreground cursor-help",
1275
+ "aria-label": a,
1276
+ children: o || a
1277
+ })
1278
+ }), /* @__PURE__ */ Z(P, { children: a })] })
1279
+ ]
1215
1280
  }),
1216
- /* @__PURE__ */ Z("span", {
1217
- className: "text-sm font-medium text-foreground",
1218
- children: r
1281
+ e.summary && /* @__PURE__ */ Z("p", {
1282
+ className: "mt-1 text-sm text-muted-foreground",
1283
+ children: e.summary
1219
1284
  }),
1220
- i && /* @__PURE__ */ Z("span", {
1221
- className: "text-xs text-muted-foreground",
1222
- children: i
1285
+ e.changes && e.changes.length > 0 && /* @__PURE__ */ Z("ul", {
1286
+ className: "mt-1.5 space-y-0.5 text-xs text-muted-foreground",
1287
+ children: e.changes.map((e) => /* @__PURE__ */ Q("li", {
1288
+ className: "leading-relaxed",
1289
+ children: [
1290
+ /* @__PURE__ */ Z("span", {
1291
+ className: "font-medium text-foreground",
1292
+ children: e.label || e.field
1293
+ }),
1294
+ ": ",
1295
+ /* @__PURE__ */ Z("span", {
1296
+ className: "line-through opacity-70",
1297
+ children: kt(e.from)
1298
+ }),
1299
+ " → ",
1300
+ /* @__PURE__ */ Z("span", {
1301
+ className: "text-foreground",
1302
+ children: kt(e.to)
1303
+ })
1304
+ ]
1305
+ }, e.field))
1223
1306
  })
1224
1307
  ]
1225
- }),
1226
- e.summary && /* @__PURE__ */ Z("p", {
1227
- className: "mt-1 text-sm text-muted-foreground",
1228
- children: e.summary
1229
- })
1230
- ]
1231
- }, e.id ?? t);
1308
+ })]
1309
+ }, e.id ?? t);
1310
+ })
1232
1311
  })
1233
1312
  });
1234
1313
  }
1235
1314
  //#endregion
1236
1315
  //#region src/RecordMetaFooter.tsx
1237
- var wt = {
1316
+ var jt = {
1238
1317
  createdAt: "created_at",
1239
1318
  createdBy: "created_by",
1240
1319
  updatedAt: "updated_at",
1241
1320
  updatedBy: "updated_by"
1242
1321
  };
1243
- function Tt(e) {
1322
+ function Mt(e) {
1244
1323
  if (!e) return null;
1245
1324
  if (e instanceof Date) return isNaN(e.getTime()) ? null : e;
1246
1325
  if (typeof e == "string" || typeof e == "number") {
@@ -1249,7 +1328,7 @@ function Tt(e) {
1249
1328
  }
1250
1329
  return null;
1251
1330
  }
1252
- function Et(e, t) {
1331
+ function Nt(e, t) {
1253
1332
  let n = Date.now() - e.getTime(), r = Math.max(0, Math.floor(n / 1e3));
1254
1333
  if (r < 60) return t("detail.justNow");
1255
1334
  let i = Math.floor(r / 60);
@@ -1257,7 +1336,7 @@ function Et(e, t) {
1257
1336
  let a = Math.floor(i / 60);
1258
1337
  return a < 24 ? t("detail.hoursAgo", { count: a }) : t("detail.daysAgo", { count: Math.floor(a / 24) });
1259
1338
  }
1260
- function Dt(e) {
1339
+ function Pt(e) {
1261
1340
  try {
1262
1341
  return new Intl.DateTimeFormat(void 0, {
1263
1342
  dateStyle: "medium",
@@ -1267,16 +1346,16 @@ function Dt(e) {
1267
1346
  return e.toISOString();
1268
1347
  }
1269
1348
  }
1270
- var Ot = ({ value: e, objectSchema: t, fieldName: n }) => {
1349
+ var Ft = ({ value: e, objectSchema: t, fieldName: n }) => {
1271
1350
  if (e == null || e === "") return null;
1272
1351
  let r = t?.fields?.[n], i = r?.reference_to || r?.reference, a = {
1273
1352
  name: n,
1274
1353
  type: r?.type || (i ? "lookup" : "text"),
1275
1354
  ...i && { reference_to: i },
1276
1355
  ...r?.reference_field && { reference_field: r.reference_field }
1277
- }, o = Xe(a) || a.type;
1356
+ }, o = $e(a) || a.type;
1278
1357
  if (o) {
1279
- let t = Ye(o);
1358
+ let t = Qe(o);
1280
1359
  if (t) return /* @__PURE__ */ Z("span", {
1281
1360
  className: "inline-flex items-center [&_a]:text-inherit [&_a]:hover:underline",
1282
1361
  children: /* @__PURE__ */ Z(t, {
@@ -1286,20 +1365,20 @@ var Ot = ({ value: e, objectSchema: t, fieldName: n }) => {
1286
1365
  });
1287
1366
  }
1288
1367
  return /* @__PURE__ */ Z("span", { children: String(e) });
1289
- }, kt = ({ label: e, user: t, date: n, objectSchema: r, userField: i, t: a }) => {
1368
+ }, It = ({ label: e, user: t, date: n, objectSchema: r, userField: i, t: a }) => {
1290
1369
  if (!t && !n) return null;
1291
- let o = n ? /* @__PURE__ */ Z(ee, {
1370
+ let o = n ? /* @__PURE__ */ Z(F, {
1292
1371
  delayDuration: 200,
1293
- children: /* @__PURE__ */ Q(j, { children: [/* @__PURE__ */ Z(N, {
1372
+ children: /* @__PURE__ */ Q(N, { children: [/* @__PURE__ */ Z(I, {
1294
1373
  asChild: !0,
1295
1374
  children: /* @__PURE__ */ Z("time", {
1296
1375
  dateTime: n.toISOString(),
1297
1376
  className: "cursor-default underline decoration-dotted decoration-muted-foreground/40 underline-offset-2",
1298
- children: Et(n, a)
1377
+ children: Nt(n, a)
1299
1378
  })
1300
- }), /* @__PURE__ */ Z(M, {
1379
+ }), /* @__PURE__ */ Z(P, {
1301
1380
  side: "top",
1302
- children: Dt(n)
1381
+ children: Pt(n)
1303
1382
  })] })
1304
1383
  }) : null;
1305
1384
  return /* @__PURE__ */ Q("span", {
@@ -1309,7 +1388,7 @@ var Ot = ({ value: e, objectSchema: t, fieldName: n }) => {
1309
1388
  className: "text-muted-foreground/70",
1310
1389
  children: e
1311
1390
  }),
1312
- t ? /* @__PURE__ */ Z(Ot, {
1391
+ t ? /* @__PURE__ */ Z(Ft, {
1313
1392
  value: t,
1314
1393
  objectSchema: r,
1315
1394
  fieldName: i
@@ -1321,31 +1400,31 @@ var Ot = ({ value: e, objectSchema: t, fieldName: n }) => {
1321
1400
  o
1322
1401
  ]
1323
1402
  });
1324
- }, At = ({ data: e, objectSchema: t, objectName: n, className: r }) => {
1403
+ }, Lt = ({ data: e, objectSchema: t, objectName: n, className: r }) => {
1325
1404
  let { t: i } = $();
1326
1405
  if (!e) return null;
1327
- let a = Tt(e[wt.createdAt]), o = Tt(e[wt.updatedAt]), s = e[wt.createdBy], c = e[wt.updatedBy], l = !!(a || s), u = a && o && Math.abs(o.getTime() - a.getTime()) < 2e3, d = !!(o || c) && !(u && (s != null && c != null && String(s) === String(c) || !c));
1406
+ let a = Mt(e[jt.createdAt]), o = Mt(e[jt.updatedAt]), s = e[jt.createdBy], c = e[jt.updatedBy], l = !!(a || s), u = a && o && Math.abs(o.getTime() - a.getTime()) < 2e3, d = !!(o || c) && !(u && (s != null && c != null && String(s) === String(c) || !c));
1328
1407
  return !l && !d ? null : /* @__PURE__ */ Q("div", {
1329
- className: P("mt-6 pt-3 border-t border-border/40", "flex flex-wrap items-center gap-x-4 gap-y-1", "text-xs text-muted-foreground", r),
1408
+ className: L("mt-6 pt-3 border-t border-border/40", "flex flex-wrap items-center gap-x-4 gap-y-1", "text-xs text-muted-foreground", r),
1330
1409
  "data-testid": "record-meta-footer",
1331
- children: [l && /* @__PURE__ */ Z(kt, {
1410
+ children: [l && /* @__PURE__ */ Z(It, {
1332
1411
  label: i("detail.createdBy"),
1333
1412
  user: s,
1334
1413
  date: a,
1335
1414
  objectSchema: t,
1336
- userField: wt.createdBy,
1415
+ userField: jt.createdBy,
1337
1416
  t: i
1338
- }), d && /* @__PURE__ */ Z(kt, {
1417
+ }), d && /* @__PURE__ */ Z(It, {
1339
1418
  label: i("detail.updatedBy"),
1340
1419
  user: c,
1341
1420
  date: o,
1342
1421
  objectSchema: t,
1343
- userField: wt.updatedBy,
1422
+ userField: jt.updatedBy,
1344
1423
  t: i
1345
1424
  })]
1346
1425
  });
1347
- }, jt = 5;
1348
- function Mt(e, t, n, r) {
1426
+ }, Rt = 5;
1427
+ function zt(e, t, n, r) {
1349
1428
  if (e && typeof e == "object") {
1350
1429
  if (t.primaryField) {
1351
1430
  let n = e[t.primaryField];
@@ -1359,7 +1438,15 @@ function Mt(e, t, n, r) {
1359
1438
  if (a == null) break;
1360
1439
  a = a[e];
1361
1440
  }
1362
- return a && typeof a == "object" && (a = a.name ?? a.label ?? a.display_name ?? a.title ?? null), a != null && a !== "" ? (n = !0, String(a)) : "\0";
1441
+ if (a && typeof a == "object") {
1442
+ let e = a, t = e.name ?? e.full_name ?? e.display_name ?? e.label ?? e.title ?? e.subject ?? null;
1443
+ (t == null || typeof t == "string" && !t.trim()) && (t = [
1444
+ e.salutation,
1445
+ e.first_name,
1446
+ e.last_name
1447
+ ].filter((e) => typeof e == "string" && e.trim()).map((e) => e.trim()).join(" ") || (typeof e.email == "string" && e.email.trim() ? e.email.trim() : null)), a = t;
1448
+ }
1449
+ return a != null && a !== "" ? (n = !0, String(a)) : "\0";
1363
1450
  });
1364
1451
  if (n) {
1365
1452
  let e = r.replace(RegExp(`\\s*${t}\\s*`, "g"), "").replace(RegExp(`\\s*${t}\\s*`, "g"), "").replace(RegExp("\0", "g"), "").replace(/\s+/g, " ").trim();
@@ -1384,10 +1471,10 @@ function Mt(e, t, n, r) {
1384
1471
  }
1385
1472
  return r;
1386
1473
  }
1387
- var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBack: s, inlineEdit: c = !1, onFieldSave: l, discussionSlot: u, rightRail: d, objectLabel: m, onDataLoaded: h }) => {
1388
- let [g, _] = n.useState(e.data), [v, y] = n.useState(!e.data && !!(e.api && e.resourceId || r && e.objectName && e.resourceId)), [b, x] = n.useState(!1), [S, C] = n.useState(!1), [w, T] = n.useState({}), [F, I] = n.useState(null), [L, ne] = n.useState(!1), { t: R } = $(), { fieldOptionLabel: z } = Ke(), B = Qe(), V = n.useMemo(() => {
1389
- if (!B?.isLoaded || !e.objectName) return e;
1390
- let t = (t) => B.checkField(e.objectName, t, "read"), n = (e) => e && e.filter((e) => {
1474
+ var Bt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBack: s, inlineEdit: c = !1, onFieldSave: l, discussionSlot: u, rightRail: d, objectLabel: f, onDataLoaded: p }) => {
1475
+ let [m, _] = n.useState(e.data), [v, y] = n.useState(!e.data && !!(e.api && e.resourceId || r && e.objectName && e.resourceId)), [b, x] = n.useState(!1), [S, C] = n.useState(!1), [w, T] = n.useState({}), [E, D] = n.useState(null), [O, R] = n.useState(!1), { t: z } = $(), { fieldOptionLabel: te } = Ye(), V = tt(), H = n.useMemo(() => {
1476
+ if (!V?.isLoaded || !e.objectName) return e;
1477
+ let t = (t) => V.checkField(e.objectName, t, "read"), n = (e) => e && e.filter((e) => {
1391
1478
  let n = typeof e == "string" ? e : e?.name;
1392
1479
  return !n || t(n);
1393
1480
  });
@@ -1400,20 +1487,20 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
1400
1487
  })),
1401
1488
  summaryFields: n(e.summaryFields)
1402
1489
  };
1403
- }, [e, B]);
1490
+ }, [e, V]);
1404
1491
  n.useEffect(() => {
1405
- g && h && h(g);
1406
- }, [g, h]);
1407
- let H = n.useMemo(() => {
1408
- if (V.summaryFields && V.summaryFields.length > 0) return [];
1409
- let e = [...V.sections?.flatMap((e) => e.fields) || [], ...V.fields || []], t = {};
1492
+ m && p && p(m);
1493
+ }, [m, p]);
1494
+ let U = n.useMemo(() => {
1495
+ if (H.summaryFields && H.summaryFields.length > 0) return [];
1496
+ let e = [...H.sections?.flatMap((e) => e.fields) || [], ...H.fields || []], t = {};
1410
1497
  for (let n of e) t[n.name] || (t[n.name] = n);
1411
- if (F?.fields) for (let [e, n] of Object.entries(F.fields)) t[e] = {
1498
+ if (E?.fields) for (let [e, n] of Object.entries(E.fields)) t[e] = {
1412
1499
  ...t[e] || {},
1413
1500
  ...n,
1414
1501
  name: e
1415
1502
  };
1416
- let n = (e) => g?.[e] !== void 0 && g?.[e] !== null && g?.[e] !== "", r = [], i = [
1503
+ let n = (e) => m?.[e] !== void 0 && m?.[e] !== null && m?.[e] !== "", r = [], i = [
1417
1504
  "status",
1418
1505
  "stage",
1419
1506
  "state",
@@ -1425,28 +1512,28 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
1425
1512
  let o = Object.keys(t).find((e) => (t[e]?.type === "date" || t[e]?.type === "datetime") && /close|due|start|end|expected/i.test(e) && n(e));
1426
1513
  return o && !r.includes(o) && r.push(o), r;
1427
1514
  }, [
1428
- V.summaryFields,
1429
- V.sections,
1430
- V.fields,
1431
- F,
1432
- g
1433
- ]), re = V.summaryFields && V.summaryFields.length > 0 ? V.summaryFields : H, U = n.useCallback(() => {
1434
- V.resourceId && navigator.clipboard.writeText(String(V.resourceId)).then(() => {
1435
- ne(!0), setTimeout(() => ne(!1), 1500);
1515
+ H.summaryFields,
1516
+ H.sections,
1517
+ H.fields,
1518
+ E,
1519
+ m
1520
+ ]), ne = H.summaryFields && H.summaryFields.length > 0 ? H.summaryFields : U, re = n.useCallback(() => {
1521
+ H.resourceId && navigator.clipboard.writeText(String(H.resourceId)).then(() => {
1522
+ R(!0), setTimeout(() => R(!1), 1500);
1436
1523
  });
1437
- }, [V.resourceId]);
1524
+ }, [H.resourceId]);
1438
1525
  n.useEffect(() => {
1439
1526
  let e = !0;
1440
- if (V.data) {
1441
- _(V.data), y(!1);
1527
+ if (H.data) {
1528
+ _(H.data), y(!1);
1442
1529
  return;
1443
1530
  }
1444
- if (r && V.objectName && V.resourceId) {
1445
- y(!0), I(null), _(null);
1446
- let n = V.objectName, i = V.resourceId, a = `${n}-`, o = [...V.sections?.flatMap((e) => e.fields) || [], ...V.fields || []];
1531
+ if (r && H.objectName && H.resourceId) {
1532
+ y(!0), D(null), _(null);
1533
+ let n = H.objectName, i = H.resourceId, a = `${n}-`, o = [...H.sections?.flatMap((e) => e.fields) || [], ...H.fields || []];
1447
1534
  (r.getObjectSchema ? r.getObjectSchema(n).catch(() => null) : Promise.resolve(null)).then((s) => {
1448
1535
  if (!e) return;
1449
- I(s);
1536
+ D(s);
1450
1537
  let c = t(s?.fields, o), l = c.length > 0 ? { $expand: c } : void 0, u = l ? r.findOne(n, i, l) : r.findOne(n, i), d = () => {
1451
1538
  let t = String(i), o = t.startsWith(a) ? t.slice(a.length) : `${a}${t}`;
1452
1539
  return (l ? r.findOne(n, o, l) : r.findOne(n, o)).then((t) => {
@@ -1467,7 +1554,7 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
1467
1554
  }).catch((t) => {
1468
1555
  e && (console.error("Failed to fetch detail data:", t), y(!1));
1469
1556
  });
1470
- } else V.api && V.resourceId && (y(!0), fetch(`${V.api}/${V.resourceId}`).then((e) => e.json()).then((t) => {
1557
+ } else H.api && H.resourceId && (y(!0), fetch(`${H.api}/${H.resourceId}`).then((e) => e.json()).then((t) => {
1471
1558
  e && _(t?.data || t);
1472
1559
  }).catch((e) => {
1473
1560
  console.error("Failed to fetch detail data:", e);
@@ -1478,40 +1565,40 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
1478
1565
  e = !1;
1479
1566
  };
1480
1567
  }, [
1481
- V.api,
1482
- V.resourceId,
1483
- V.objectName,
1568
+ H.api,
1569
+ H.resourceId,
1570
+ H.objectName,
1484
1571
  r,
1485
- V.sections,
1486
- V.fields
1572
+ H.sections,
1573
+ H.fields
1487
1574
  ]);
1488
- let ae = n.useCallback(() => {
1575
+ let W = n.useCallback(() => {
1489
1576
  if (s) s();
1490
- else if (V.onNavigate) {
1491
- let e = V.backUrl || (V.objectName ? `/${V.objectName}` : "/");
1492
- V.onNavigate(e, { replace: !0 });
1493
- } else V.backUrl ? window.location.href = V.backUrl : window.history.back();
1494
- }, [s, V]), ce = n.useCallback(() => {
1495
- a ? a() : V.onNavigate && V.editUrl ? V.onNavigate(V.editUrl) : V.onNavigate && V.objectName && V.resourceId ? V.onNavigate(`/${V.objectName}/${V.resourceId}/edit`) : V.editUrl && (window.location.href = V.editUrl);
1496
- }, [a, V]), le = n.useCallback(() => {
1497
- let e = V.deleteConfirmation || R("detail.deleteConfirmation");
1498
- window.confirm(e) && (o?.(), V.onNavigate && V.objectName && V.onNavigate(`/${V.objectName}`, { replace: !0 }));
1499
- }, [o, V]), ue = n.useCallback(() => {
1500
- navigator.share && V.objectName && V.resourceId ? navigator.share({
1501
- title: V.title || R("detail.details"),
1502
- text: `${V.objectName} #${V.resourceId}`,
1577
+ else if (H.onNavigate) {
1578
+ let e = H.backUrl || (H.objectName ? `/${H.objectName}` : "/");
1579
+ H.onNavigate(e, { replace: !0 });
1580
+ } else H.backUrl ? window.location.href = H.backUrl : window.history.back();
1581
+ }, [s, H]), ie = n.useCallback(() => {
1582
+ a ? a() : H.onNavigate && H.editUrl ? H.onNavigate(H.editUrl) : H.onNavigate && H.objectName && H.resourceId ? H.onNavigate(`/${H.objectName}/${H.resourceId}/edit`) : H.editUrl && (window.location.href = H.editUrl);
1583
+ }, [a, H]), oe = n.useCallback(() => {
1584
+ let e = H.deleteConfirmation || z("detail.deleteConfirmation");
1585
+ window.confirm(e) && (o?.(), H.onNavigate && H.objectName && H.onNavigate(`/${H.objectName}`, { replace: !0 }));
1586
+ }, [o, H]), se = n.useCallback(() => {
1587
+ navigator.share && H.objectName && H.resourceId ? navigator.share({
1588
+ title: H.title || z("detail.details"),
1589
+ text: `${H.objectName} #${H.resourceId}`,
1503
1590
  url: window.location.href
1504
1591
  }).catch((e) => console.log("Share failed:", e)) : navigator.clipboard.writeText(window.location.href).then(() => {
1505
1592
  console.log("Link copied to clipboard");
1506
1593
  });
1507
- }, [V]), de = n.useCallback(() => {
1594
+ }, [H]), le = n.useCallback(() => {
1508
1595
  x(!b);
1509
- }, [b]), pe = n.useCallback(() => {
1596
+ }, [b]), ue = n.useCallback(() => {
1510
1597
  if (S) {
1511
1598
  let e = Object.entries(w);
1512
1599
  if (e.length > 0) {
1513
1600
  let t = {
1514
- ...g,
1601
+ ...m,
1515
1602
  ...w
1516
1603
  };
1517
1604
  _(t), e.forEach(([e, n]) => {
@@ -1524,68 +1611,68 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
1524
1611
  }, [
1525
1612
  S,
1526
1613
  w,
1527
- g,
1614
+ m,
1528
1615
  l
1529
- ]), me = n.useCallback(() => {
1616
+ ]), de = n.useCallback(() => {
1530
1617
  T({}), C(!1);
1531
- }, []), G = n.useCallback((e, t) => {
1618
+ }, []), K = n.useCallback((e, t) => {
1532
1619
  T((n) => ({
1533
1620
  ...n,
1534
1621
  [e]: t
1535
1622
  }));
1536
1623
  }, []);
1537
1624
  n.useEffect(() => {
1538
- if (!V.recordNavigation) return;
1539
- let e = V.recordNavigation, t = (t) => {
1625
+ if (!H.recordNavigation) return;
1626
+ let e = H.recordNavigation, t = (t) => {
1540
1627
  let n = t.target?.tagName;
1541
1628
  n === "INPUT" || n === "TEXTAREA" || t.target?.isContentEditable || (t.key === "ArrowLeft" && e.currentIndex > 0 ? (t.preventDefault(), e.onNavigate(e.recordIds[e.currentIndex - 1])) : t.key === "ArrowRight" && e.currentIndex < e.recordIds.length - 1 && (t.preventDefault(), e.onNavigate(e.recordIds[e.currentIndex + 1])));
1542
1629
  };
1543
1630
  return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
1544
- }, [V.recordNavigation]);
1545
- let he = n.useMemo(() => V.related ?? [], [V.related]), ge = n.useMemo(() => {
1631
+ }, [H.recordNavigation]);
1632
+ let me = n.useMemo(() => H.related ?? [], [H.related]), q = n.useMemo(() => {
1546
1633
  let e = [];
1547
1634
  return e.push({
1548
1635
  name: "sys_share",
1549
- label: R("detail.share"),
1636
+ label: z("detail.share"),
1550
1637
  icon: "share-2",
1551
1638
  type: "script",
1552
- onClick: ue
1553
- }), V.showEdit && e.push({
1639
+ onClick: se
1640
+ }), H.showEdit && e.push({
1554
1641
  name: "sys_edit_mobile",
1555
- label: R("detail.edit"),
1642
+ label: z("detail.edit"),
1556
1643
  icon: "edit",
1557
1644
  type: "script",
1558
1645
  className: "sm:hidden",
1559
- onClick: ce
1646
+ onClick: ie
1560
1647
  }), c && e.push({
1561
1648
  name: "sys_toggle_inline_edit_mobile",
1562
- label: R(S ? "detail.save" : "detail.editInline"),
1649
+ label: z(S ? "detail.save" : "detail.editInline"),
1563
1650
  icon: "edit",
1564
1651
  type: "script",
1565
1652
  className: "sm:hidden",
1566
- onClick: pe
1567
- }), V.showDelete && e.push({
1653
+ onClick: ue
1654
+ }), H.showDelete && e.push({
1568
1655
  name: "sys_delete",
1569
- label: R("detail.delete"),
1656
+ label: z("detail.delete"),
1570
1657
  icon: "trash-2",
1571
1658
  type: "script",
1572
1659
  variant: "destructive",
1573
1660
  tags: ["separator-before"],
1574
- onClick: le
1661
+ onClick: oe
1575
1662
  }), e;
1576
1663
  }, [
1577
- R,
1578
- V.showEdit,
1579
- V.showDelete,
1664
+ z,
1665
+ H.showEdit,
1666
+ H.showDelete,
1580
1667
  c,
1581
1668
  S,
1669
+ se,
1670
+ ie,
1582
1671
  ue,
1583
- ce,
1584
- pe,
1585
- le
1586
- ]), _e = n.useMemo(() => {
1587
- let e = V.actions ?? [];
1588
- if (ge.length === 0) return e;
1672
+ oe
1673
+ ]), he = n.useMemo(() => {
1674
+ let e = H.actions ?? [];
1675
+ if (q.length === 0) return e;
1589
1676
  let t = !1, n = e.map((e) => {
1590
1677
  let n = e;
1591
1678
  if (n && typeof n == "object" && n.type === "action:bar" && (!n.location || n.location === "record_header")) {
@@ -1593,7 +1680,7 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
1593
1680
  let e = Array.isArray(n.systemActions) ? n.systemActions : [];
1594
1681
  return {
1595
1682
  ...n,
1596
- systemActions: [...e, ...ge]
1683
+ systemActions: [...e, ...q]
1597
1684
  };
1598
1685
  }
1599
1686
  return e;
@@ -1601,64 +1688,64 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
1601
1688
  return t || n.push({
1602
1689
  type: "action:bar",
1603
1690
  location: "record_header",
1604
- systemActions: ge
1691
+ systemActions: q
1605
1692
  }), n;
1606
- }, [V.actions, ge]);
1607
- return v || V.loading ? /* @__PURE__ */ Q("div", {
1608
- className: P("space-y-4", i),
1693
+ }, [H.actions, q]);
1694
+ return v || H.loading ? /* @__PURE__ */ Q("div", {
1695
+ className: L("space-y-4", i),
1609
1696
  children: [
1610
- /* @__PURE__ */ Z(E, { className: "h-10 w-full" }),
1611
- /* @__PURE__ */ Z(E, { className: "h-64 w-full" }),
1612
- /* @__PURE__ */ Z(E, { className: "h-48 w-full" })
1697
+ /* @__PURE__ */ Z(k, { className: "h-10 w-full" }),
1698
+ /* @__PURE__ */ Z(k, { className: "h-64 w-full" }),
1699
+ /* @__PURE__ */ Z(k, { className: "h-48 w-full" })
1613
1700
  ]
1614
- }) : !g && !V.data ? /* @__PURE__ */ Q("div", {
1615
- className: P("flex flex-col items-center justify-center py-16 text-center", i),
1701
+ }) : !m && !H.data ? /* @__PURE__ */ Q("div", {
1702
+ className: L("flex flex-col items-center justify-center py-16 text-center", i),
1616
1703
  children: [
1617
1704
  /* @__PURE__ */ Z("p", {
1618
1705
  className: "text-lg font-semibold",
1619
- children: R("detail.recordNotFound")
1706
+ children: z("detail.recordNotFound")
1620
1707
  }),
1621
1708
  /* @__PURE__ */ Z("p", {
1622
1709
  className: "text-sm text-muted-foreground mt-1",
1623
- children: R("detail.recordNotFoundDescription")
1710
+ children: z("detail.recordNotFoundDescription")
1624
1711
  }),
1625
- (V.showBack ?? !0) && /* @__PURE__ */ Q(p, {
1712
+ (H.showBack ?? !0) && /* @__PURE__ */ Q(g, {
1626
1713
  variant: "outline",
1627
1714
  size: "sm",
1628
- onClick: ae,
1715
+ onClick: W,
1629
1716
  className: "mt-4 gap-2",
1630
- children: [/* @__PURE__ */ Z(te, { className: "h-4 w-4" }), R("detail.goBack")]
1717
+ children: [/* @__PURE__ */ Z(B, { className: "h-4 w-4" }), z("detail.goBack")]
1631
1718
  })
1632
1719
  ]
1633
- }) : /* @__PURE__ */ Z(ee, { children: /* @__PURE__ */ Q("div", {
1634
- className: P("space-y-6", i),
1720
+ }) : /* @__PURE__ */ Z(F, { children: /* @__PURE__ */ Q("div", {
1721
+ className: L("space-y-6", i),
1635
1722
  children: [
1636
- V.showHeader !== !1 && /* @__PURE__ */ Q("div", {
1723
+ H.showHeader !== !1 && /* @__PURE__ */ Q("div", {
1637
1724
  className: "flex flex-col sm:flex-row items-start justify-between gap-3 sm:gap-4 pb-4 border-b",
1638
1725
  children: [/* @__PURE__ */ Q("div", {
1639
1726
  className: "flex items-start gap-2 sm:gap-3 flex-1 min-w-0",
1640
- children: [(V.showBack ?? !0) && /* @__PURE__ */ Q(j, { children: [/* @__PURE__ */ Z(N, {
1727
+ children: [(H.showBack ?? !0) && /* @__PURE__ */ Q(N, { children: [/* @__PURE__ */ Z(I, {
1641
1728
  asChild: !0,
1642
- children: /* @__PURE__ */ Z(p, {
1729
+ children: /* @__PURE__ */ Z(g, {
1643
1730
  variant: "ghost",
1644
1731
  size: "icon",
1645
- onClick: ae,
1732
+ onClick: W,
1646
1733
  className: "shrink-0 mt-1",
1647
- children: /* @__PURE__ */ Z(te, { className: "h-4 w-4" })
1734
+ children: /* @__PURE__ */ Z(B, { className: "h-4 w-4" })
1648
1735
  })
1649
- }), /* @__PURE__ */ Z(M, { children: R("detail.back") })] }), /* @__PURE__ */ Q("div", {
1736
+ }), /* @__PURE__ */ Z(P, { children: z("detail.back") })] }), /* @__PURE__ */ Q("div", {
1650
1737
  className: "flex-1 min-w-0",
1651
1738
  children: [/* @__PURE__ */ Q("div", {
1652
1739
  className: "flex items-center gap-2 flex-wrap",
1653
1740
  children: [
1654
1741
  /* @__PURE__ */ Z("h1", {
1655
1742
  className: "text-xl sm:text-2xl font-bold truncate",
1656
- children: Mt(g, V, F, R("detail.details"))
1743
+ children: zt(m, H, E, z("detail.details"))
1657
1744
  }),
1658
- re.map((e) => {
1659
- let t = g?.[e];
1745
+ ne.map((e) => {
1746
+ let t = m?.[e];
1660
1747
  if (t == null || t === "") return null;
1661
- let n = (V.sections || []).flatMap((e) => e.fields).concat(V.fields || []).find((t) => t.name === e), r = F?.fields?.[e], i = n?.type || r?.type, a = String(t), o = null;
1748
+ let n = (H.sections || []).flatMap((e) => e.fields).concat(H.fields || []).find((t) => t.name === e), r = E?.fields?.[e], i = n?.type || r?.type, a = String(t), o = null;
1662
1749
  try {
1663
1750
  if (i === "currency") {
1664
1751
  let e = Number(t);
@@ -1689,15 +1776,15 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
1689
1776
  let e = i[String(t)];
1690
1777
  e?.label && (o = e.label);
1691
1778
  }
1692
- a = V.objectName ? z(V.objectName, e, String(t), o) : o;
1779
+ a = H.objectName ? te(H.objectName, e, String(t), o) : o;
1693
1780
  }
1694
1781
  } catch {}
1695
- return o === null ? /* @__PURE__ */ Z(f, {
1782
+ return o === null ? /* @__PURE__ */ Z(h, {
1696
1783
  variant: "secondary",
1697
1784
  className: "text-xs bg-primary/10 text-primary border-transparent hover:bg-primary/15",
1698
1785
  "aria-label": `${e}: ${a}`,
1699
1786
  children: a
1700
- }, e) : /* @__PURE__ */ Q(f, {
1787
+ }, e) : /* @__PURE__ */ Q(h, {
1701
1788
  variant: "secondary",
1702
1789
  className: "text-xs bg-primary/10 text-primary border-transparent hover:bg-primary/15 gap-1.5 pl-2 pr-2",
1703
1790
  "aria-label": `${e}: ${a}`,
@@ -1711,251 +1798,251 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
1711
1798
  }), a]
1712
1799
  }, e);
1713
1800
  }),
1714
- /* @__PURE__ */ Q(j, { children: [/* @__PURE__ */ Z(N, {
1801
+ /* @__PURE__ */ Q(N, { children: [/* @__PURE__ */ Z(I, {
1715
1802
  asChild: !0,
1716
- children: /* @__PURE__ */ Z(p, {
1803
+ children: /* @__PURE__ */ Z(g, {
1717
1804
  variant: "ghost",
1718
1805
  size: "icon",
1719
1806
  className: "h-6 w-6 shrink-0",
1720
- onClick: de,
1721
- "aria-label": R(b ? "detail.removeFromFavorites" : "detail.addToFavorites"),
1722
- children: b ? /* @__PURE__ */ Z(Ie, { className: "h-4 w-4 fill-yellow-400 text-yellow-400" }) : /* @__PURE__ */ Z(Ie, { className: "h-4 w-4 text-muted-foreground" })
1807
+ onClick: le,
1808
+ "aria-label": z(b ? "detail.removeFromFavorites" : "detail.addToFavorites"),
1809
+ children: b ? /* @__PURE__ */ Z(ze, { className: "h-4 w-4 fill-yellow-400 text-yellow-400" }) : /* @__PURE__ */ Z(ze, { className: "h-4 w-4 text-muted-foreground" })
1723
1810
  })
1724
- }), /* @__PURE__ */ Z(M, { children: R(b ? "detail.removeFromFavorites" : "detail.addToFavorites") })] })
1811
+ }), /* @__PURE__ */ Z(P, { children: z(b ? "detail.removeFromFavorites" : "detail.addToFavorites") })] })
1725
1812
  ]
1726
- }), V.objectName && /* @__PURE__ */ Q("p", {
1813
+ }), H.objectName && /* @__PURE__ */ Q("p", {
1727
1814
  className: "text-sm text-muted-foreground mt-1 flex items-center gap-1",
1728
1815
  children: [/* @__PURE__ */ Z("span", {
1729
1816
  className: "font-medium",
1730
- children: m || V.objectName
1731
- }), V.resourceId && /* @__PURE__ */ Q(j, { children: [/* @__PURE__ */ Z(N, {
1817
+ children: f || H.objectName
1818
+ }), H.resourceId && /* @__PURE__ */ Q(N, { children: [/* @__PURE__ */ Z(I, {
1732
1819
  asChild: !0,
1733
- children: /* @__PURE__ */ Z(p, {
1820
+ children: /* @__PURE__ */ Z(g, {
1734
1821
  variant: "ghost",
1735
1822
  size: "icon",
1736
1823
  className: "h-5 w-5 shrink-0 text-muted-foreground/60 hover:text-foreground",
1737
- onClick: U,
1738
- "aria-label": R("detail.copyRecordId", { defaultValue: "Copy record ID" }),
1739
- children: L ? /* @__PURE__ */ Z(ie, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ Z(fe, { className: "h-3 w-3" })
1824
+ onClick: re,
1825
+ "aria-label": z("detail.copyRecordId", { defaultValue: "Copy record ID" }),
1826
+ children: O ? /* @__PURE__ */ Z(ae, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ Z(fe, { className: "h-3 w-3" })
1740
1827
  })
1741
- }), /* @__PURE__ */ Z(M, { children: L ? R("detail.copied", { defaultValue: "Copied" }) : R("detail.copyRecordId", { defaultValue: "Copy record ID" }) })] })]
1828
+ }), /* @__PURE__ */ Z(P, { children: O ? z("detail.copied", { defaultValue: "Copied" }) : z("detail.copyRecordId", { defaultValue: "Copy record ID" }) })] })]
1742
1829
  })]
1743
1830
  })]
1744
1831
  }), /* @__PURE__ */ Q("div", {
1745
1832
  className: "flex flex-wrap items-center gap-1.5 shrink-0 w-full sm:w-auto",
1746
1833
  children: [
1747
- V.recordNavigation && /* @__PURE__ */ Q("div", {
1834
+ H.recordNavigation && /* @__PURE__ */ Q("div", {
1748
1835
  className: "flex items-center gap-1 mr-2",
1749
1836
  children: [
1750
- /* @__PURE__ */ Q(j, { children: [/* @__PURE__ */ Z(N, {
1837
+ /* @__PURE__ */ Q(N, { children: [/* @__PURE__ */ Z(I, {
1751
1838
  asChild: !0,
1752
- children: /* @__PURE__ */ Z(p, {
1839
+ children: /* @__PURE__ */ Z(g, {
1753
1840
  variant: "outline",
1754
1841
  size: "icon",
1755
1842
  className: "h-8 w-8",
1756
- disabled: V.recordNavigation.currentIndex <= 0,
1843
+ disabled: H.recordNavigation.currentIndex <= 0,
1757
1844
  onClick: () => {
1758
- let e = V.recordNavigation;
1845
+ let e = H.recordNavigation;
1759
1846
  e.currentIndex > 0 && e.onNavigate(e.recordIds[e.currentIndex - 1]);
1760
1847
  },
1761
- children: /* @__PURE__ */ Z(oe, { className: "h-4 w-4" })
1848
+ children: /* @__PURE__ */ Z(ce, { className: "h-4 w-4" })
1762
1849
  })
1763
- }), /* @__PURE__ */ Z(M, { children: R("detail.previousRecord") })] }),
1850
+ }), /* @__PURE__ */ Z(P, { children: z("detail.previousRecord") })] }),
1764
1851
  /* @__PURE__ */ Z("span", {
1765
1852
  className: "text-xs text-muted-foreground whitespace-nowrap px-1",
1766
- children: R("detail.recordOf", {
1767
- current: V.recordNavigation.currentIndex + 1,
1768
- total: V.recordNavigation.recordIds.length
1853
+ children: z("detail.recordOf", {
1854
+ current: H.recordNavigation.currentIndex + 1,
1855
+ total: H.recordNavigation.recordIds.length
1769
1856
  })
1770
1857
  }),
1771
- /* @__PURE__ */ Q(j, { children: [/* @__PURE__ */ Z(N, {
1858
+ /* @__PURE__ */ Q(N, { children: [/* @__PURE__ */ Z(I, {
1772
1859
  asChild: !0,
1773
- children: /* @__PURE__ */ Z(p, {
1860
+ children: /* @__PURE__ */ Z(g, {
1774
1861
  variant: "outline",
1775
1862
  size: "icon",
1776
1863
  className: "h-8 w-8",
1777
- disabled: V.recordNavigation.currentIndex >= V.recordNavigation.recordIds.length - 1,
1864
+ disabled: H.recordNavigation.currentIndex >= H.recordNavigation.recordIds.length - 1,
1778
1865
  onClick: () => {
1779
- let e = V.recordNavigation;
1866
+ let e = H.recordNavigation;
1780
1867
  e.currentIndex < e.recordIds.length - 1 && e.onNavigate(e.recordIds[e.currentIndex + 1]);
1781
1868
  },
1782
- children: /* @__PURE__ */ Z(se, { className: "h-4 w-4" })
1869
+ children: /* @__PURE__ */ Z(G, { className: "h-4 w-4" })
1783
1870
  })
1784
- }), /* @__PURE__ */ Z(M, { children: R("detail.nextRecord") })] })
1871
+ }), /* @__PURE__ */ Z(P, { children: z("detail.nextRecord") })] })
1785
1872
  ]
1786
1873
  }),
1787
- c && /* @__PURE__ */ Q(X, { children: [S && /* @__PURE__ */ Q(j, { children: [/* @__PURE__ */ Z(N, {
1874
+ c && /* @__PURE__ */ Q(X, { children: [S && /* @__PURE__ */ Q(N, { children: [/* @__PURE__ */ Z(I, {
1788
1875
  asChild: !0,
1789
- children: /* @__PURE__ */ Q(p, {
1876
+ children: /* @__PURE__ */ Q(g, {
1790
1877
  variant: "ghost",
1791
1878
  size: "sm",
1792
- onClick: me,
1879
+ onClick: de,
1793
1880
  className: "gap-2 hidden sm:inline-flex",
1794
- children: [/* @__PURE__ */ Z(ze, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", {
1881
+ children: [/* @__PURE__ */ Z(He, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", {
1795
1882
  className: "hidden sm:inline",
1796
- children: R("detail.cancel")
1883
+ children: z("detail.cancel")
1797
1884
  })]
1798
1885
  })
1799
- }), /* @__PURE__ */ Z(M, { children: R("detail.cancelEdit") })] }), /* @__PURE__ */ Q(j, { children: [/* @__PURE__ */ Z(N, {
1886
+ }), /* @__PURE__ */ Z(P, { children: z("detail.cancelEdit") })] }), /* @__PURE__ */ Q(N, { children: [/* @__PURE__ */ Z(I, {
1800
1887
  asChild: !0,
1801
- children: /* @__PURE__ */ Z(p, {
1888
+ children: /* @__PURE__ */ Z(g, {
1802
1889
  variant: S ? "default" : "outline",
1803
1890
  size: "sm",
1804
- onClick: pe,
1891
+ onClick: ue,
1805
1892
  className: "gap-2 hidden sm:inline-flex",
1806
- children: S ? /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z(ie, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", {
1893
+ children: S ? /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z(ae, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", {
1807
1894
  className: "hidden sm:inline",
1808
- children: R("detail.save")
1809
- })] }) : /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z(W, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", {
1895
+ children: z("detail.save")
1896
+ })] }) : /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z(pe, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", {
1810
1897
  className: "hidden sm:inline",
1811
- children: R("detail.editInline")
1898
+ children: z("detail.editInline")
1812
1899
  })] })
1813
1900
  })
1814
- }), /* @__PURE__ */ Z(M, { children: R(S ? "detail.saveChanges" : "detail.editFieldsInline") })] })] }),
1815
- V.showEdit && /* @__PURE__ */ Q(j, { children: [/* @__PURE__ */ Z(N, {
1901
+ }), /* @__PURE__ */ Z(P, { children: z(S ? "detail.saveChanges" : "detail.editFieldsInline") })] })] }),
1902
+ H.showEdit && /* @__PURE__ */ Q(N, { children: [/* @__PURE__ */ Z(I, {
1816
1903
  asChild: !0,
1817
- children: /* @__PURE__ */ Q(p, {
1904
+ children: /* @__PURE__ */ Q(g, {
1818
1905
  variant: "default",
1819
- onClick: ce,
1906
+ onClick: ie,
1820
1907
  className: "gap-2 hidden sm:inline-flex",
1821
- children: [/* @__PURE__ */ Z(W, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", {
1908
+ children: [/* @__PURE__ */ Z(pe, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", {
1822
1909
  className: "hidden sm:inline",
1823
- children: R("detail.edit")
1910
+ children: z("detail.edit")
1824
1911
  })]
1825
1912
  })
1826
- }), /* @__PURE__ */ Z(M, { children: R("detail.editRecord") })] }),
1827
- _e.map((e, t) => /* @__PURE__ */ Z(He, {
1913
+ }), /* @__PURE__ */ Z(P, { children: z("detail.editRecord") })] }),
1914
+ he.map((e, t) => /* @__PURE__ */ Z(Ge, {
1828
1915
  schema: e,
1829
- data: g
1916
+ data: m
1830
1917
  }, `header-action-${t}`))
1831
1918
  ]
1832
1919
  })]
1833
1920
  }),
1834
- V.header && /* @__PURE__ */ Z("div", { children: /* @__PURE__ */ Z(He, {
1835
- schema: V.header,
1836
- data: g
1921
+ H.header && /* @__PURE__ */ Z("div", { children: /* @__PURE__ */ Z(Ge, {
1922
+ schema: H.header,
1923
+ data: m
1837
1924
  }) }),
1838
- V.highlightFields && V.highlightFields.length > 0 && /* @__PURE__ */ Z(ft, {
1839
- fields: V.highlightFields,
1840
- data: g,
1841
- objectName: V.objectName,
1842
- objectSchema: F
1925
+ H.highlightFields && H.highlightFields.length > 0 && /* @__PURE__ */ Z(ht, {
1926
+ fields: H.highlightFields,
1927
+ data: m,
1928
+ objectName: H.objectName,
1929
+ objectSchema: E
1843
1930
  }),
1844
- V.autoTabs && !V.tabs?.length ? (() => {
1845
- let e = he.length > 0, t = !!V.activities && V.activities.length > 0, n = !!u, i = !!V.history, a = /* @__PURE__ */ Q("div", {
1931
+ H.autoTabs && !H.tabs?.length ? (() => {
1932
+ let e = me.length > 0, t = !!H.activities && H.activities.length > 0, n = !!u, i = !!H.history, a = /* @__PURE__ */ Q("div", {
1846
1933
  className: "space-y-3 sm:space-y-4",
1847
1934
  children: [
1848
- V.sectionGroups && V.sectionGroups.length > 0 && V.sectionGroups.map((e, t) => /* @__PURE__ */ Z(dt, {
1935
+ H.sectionGroups && H.sectionGroups.length > 0 && H.sectionGroups.map((e, t) => /* @__PURE__ */ Z(mt, {
1849
1936
  group: e,
1850
1937
  data: {
1851
- ...g,
1938
+ ...m,
1852
1939
  ...w
1853
1940
  },
1854
- objectSchema: F,
1855
- objectName: V.objectName,
1941
+ objectSchema: E,
1942
+ objectName: H.objectName,
1856
1943
  isEditing: S,
1857
- onFieldChange: G
1944
+ onFieldChange: K
1858
1945
  }, t)),
1859
- V.sections && V.sections.length > 0 && V.sections.map((e, t) => /* @__PURE__ */ Z(st, {
1946
+ H.sections && H.sections.length > 0 && H.sections.map((e, t) => /* @__PURE__ */ Z(ut, {
1860
1947
  section: e,
1861
1948
  data: {
1862
- ...g,
1949
+ ...m,
1863
1950
  ...w
1864
1951
  },
1865
- objectSchema: F,
1866
- objectName: V.objectName,
1952
+ objectSchema: E,
1953
+ objectName: H.objectName,
1867
1954
  isEditing: S,
1868
- onFieldChange: G
1955
+ onFieldChange: K
1869
1956
  }, t)),
1870
- V.fields && V.fields.length > 0 && !V.sections?.length && /* @__PURE__ */ Z(st, {
1957
+ H.fields && H.fields.length > 0 && !H.sections?.length && /* @__PURE__ */ Z(ut, {
1871
1958
  section: {
1872
- fields: V.fields,
1873
- columns: V.columns
1959
+ fields: H.fields,
1960
+ columns: H.columns
1874
1961
  },
1875
1962
  data: {
1876
- ...g,
1963
+ ...m,
1877
1964
  ...w
1878
1965
  },
1879
- objectSchema: F,
1880
- objectName: V.objectName,
1966
+ objectSchema: E,
1967
+ objectName: H.objectName,
1881
1968
  isEditing: S,
1882
- onFieldChange: G
1969
+ onFieldChange: K
1883
1970
  }),
1884
- V.comments && /* @__PURE__ */ Z(mt, {
1885
- comments: V.comments,
1886
- onAddComment: V.onAddComment
1971
+ H.comments && /* @__PURE__ */ Z(_t, {
1972
+ comments: H.comments,
1973
+ onAddComment: H.onAddComment
1887
1974
  })
1888
1975
  ]
1889
1976
  });
1890
1977
  return !e && !t && !n && !i ? /* @__PURE__ */ Z("div", {
1891
1978
  className: "mt-2",
1892
1979
  children: a
1893
- }) : /* @__PURE__ */ Q(D, {
1980
+ }) : /* @__PURE__ */ Q(A, {
1894
1981
  defaultValue: "details",
1895
1982
  className: "w-full",
1896
1983
  children: [
1897
- /* @__PURE__ */ Q(k, {
1984
+ /* @__PURE__ */ Q(ee, {
1898
1985
  className: "w-full justify-start border-b rounded-none bg-transparent p-0",
1899
1986
  children: [
1900
- /* @__PURE__ */ Z(A, {
1987
+ /* @__PURE__ */ Z(M, {
1901
1988
  value: "details",
1902
1989
  className: "relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",
1903
- children: R("detail.details")
1990
+ children: z("detail.details")
1904
1991
  }),
1905
- e && /* @__PURE__ */ Z(A, {
1992
+ e && /* @__PURE__ */ Z(M, {
1906
1993
  value: "related",
1907
1994
  className: "relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",
1908
1995
  children: /* @__PURE__ */ Q("span", {
1909
1996
  className: "flex items-center gap-1.5",
1910
- children: [R("detail.related"), /* @__PURE__ */ Z(f, {
1997
+ children: [z("detail.related"), /* @__PURE__ */ Z(h, {
1911
1998
  variant: "secondary",
1912
1999
  className: "text-xs bg-primary/10 text-primary border-transparent",
1913
- children: he.length
2000
+ children: me.length
1914
2001
  })]
1915
2002
  })
1916
2003
  }),
1917
- t && /* @__PURE__ */ Z(A, {
2004
+ t && /* @__PURE__ */ Z(M, {
1918
2005
  value: "activity",
1919
2006
  className: "relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",
1920
2007
  children: /* @__PURE__ */ Q("span", {
1921
2008
  className: "flex items-center gap-1.5",
1922
- children: [R("detail.activity"), /* @__PURE__ */ Z(f, {
2009
+ children: [z("detail.activity"), /* @__PURE__ */ Z(h, {
1923
2010
  variant: "secondary",
1924
2011
  className: "text-xs bg-primary/10 text-primary border-transparent",
1925
- children: V.activities.length
2012
+ children: H.activities.length
1926
2013
  })]
1927
2014
  })
1928
2015
  }),
1929
- n && /* @__PURE__ */ Z(A, {
2016
+ n && /* @__PURE__ */ Z(M, {
1930
2017
  value: "discussion",
1931
2018
  className: "relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",
1932
- children: R("detail.discussion", { defaultValue: "Discussion" })
2019
+ children: z("detail.discussion", { defaultValue: "Discussion" })
1933
2020
  }),
1934
- i && /* @__PURE__ */ Z(A, {
2021
+ i && /* @__PURE__ */ Z(M, {
1935
2022
  value: "history",
1936
2023
  className: "relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",
1937
2024
  children: /* @__PURE__ */ Q("span", {
1938
2025
  className: "flex items-center gap-1.5",
1939
- children: [R("detail.history", { defaultValue: "History" }), !V.history.loading && V.history.entries.length > 0 && /* @__PURE__ */ Z(f, {
2026
+ children: [z("detail.history", { defaultValue: "History" }), !H.history.loading && H.history.entries.length > 0 && /* @__PURE__ */ Z(h, {
1940
2027
  variant: "secondary",
1941
2028
  className: "text-xs bg-primary/10 text-primary border-transparent",
1942
- children: V.history.entries.length
2029
+ children: H.history.entries.length
1943
2030
  })]
1944
2031
  })
1945
2032
  })
1946
2033
  ]
1947
2034
  }),
1948
- /* @__PURE__ */ Z(O, {
2035
+ /* @__PURE__ */ Z(j, {
1949
2036
  value: "details",
1950
2037
  className: "mt-4",
1951
2038
  children: a
1952
2039
  }),
1953
- e && /* @__PURE__ */ Z(O, {
2040
+ e && /* @__PURE__ */ Z(j, {
1954
2041
  value: "related",
1955
2042
  className: "mt-4",
1956
2043
  children: /* @__PURE__ */ Z("div", {
1957
2044
  className: "space-y-3",
1958
- children: he.map((e, t) => /* @__PURE__ */ Z(ut, {
2045
+ children: me.map((e, t) => /* @__PURE__ */ Z(pt, {
1959
2046
  title: e.title,
1960
2047
  type: e.type,
1961
2048
  api: e.api,
@@ -1971,84 +2058,84 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
1971
2058
  onRowEdit: e.onRowEdit,
1972
2059
  onRowDelete: e.onRowDelete,
1973
2060
  collapsible: !0,
1974
- pageSize: jt
2061
+ pageSize: Rt
1975
2062
  }, t))
1976
2063
  })
1977
2064
  }),
1978
- t && /* @__PURE__ */ Z(O, {
2065
+ t && /* @__PURE__ */ Z(j, {
1979
2066
  value: "activity",
1980
2067
  className: "mt-4",
1981
- children: /* @__PURE__ */ Z(bt, { activities: V.activities })
2068
+ children: /* @__PURE__ */ Z(Ct, { activities: H.activities })
1982
2069
  }),
1983
- n && /* @__PURE__ */ Z(O, {
2070
+ n && /* @__PURE__ */ Z(j, {
1984
2071
  value: "discussion",
1985
2072
  className: "mt-4",
1986
2073
  children: u
1987
2074
  }),
1988
- i && /* @__PURE__ */ Z(O, {
2075
+ i && /* @__PURE__ */ Z(j, {
1989
2076
  value: "history",
1990
2077
  className: "mt-4",
1991
- children: /* @__PURE__ */ Z(Ct, {
1992
- entries: V.history.entries,
1993
- loading: V.history.loading,
1994
- emptyText: V.history.emptyText ?? R("detail.historyEmpty", { defaultValue: "No history yet" })
2078
+ children: /* @__PURE__ */ Z(At, {
2079
+ entries: H.history.entries,
2080
+ loading: H.history.loading,
2081
+ emptyText: H.history.emptyText ?? z("detail.historyEmpty", { defaultValue: "No history yet" })
1995
2082
  })
1996
2083
  })
1997
2084
  ]
1998
2085
  });
1999
2086
  })() : /* @__PURE__ */ Q(X, { children: [
2000
- V.sectionGroups && V.sectionGroups.length > 0 && /* @__PURE__ */ Z("div", {
2087
+ H.sectionGroups && H.sectionGroups.length > 0 && /* @__PURE__ */ Z("div", {
2001
2088
  className: "space-y-3 sm:space-y-4",
2002
- children: V.sectionGroups.map((e, t) => /* @__PURE__ */ Z(dt, {
2089
+ children: H.sectionGroups.map((e, t) => /* @__PURE__ */ Z(mt, {
2003
2090
  group: e,
2004
2091
  data: {
2005
- ...g,
2092
+ ...m,
2006
2093
  ...w
2007
2094
  },
2008
- objectSchema: F,
2009
- objectName: V.objectName,
2095
+ objectSchema: E,
2096
+ objectName: H.objectName,
2010
2097
  isEditing: S,
2011
- onFieldChange: G
2098
+ onFieldChange: K
2012
2099
  }, t))
2013
2100
  }),
2014
- V.sections && V.sections.length > 0 && /* @__PURE__ */ Z("div", {
2101
+ H.sections && H.sections.length > 0 && /* @__PURE__ */ Z("div", {
2015
2102
  className: "space-y-3 sm:space-y-4",
2016
- children: V.sections.map((e, t) => /* @__PURE__ */ Z(st, {
2103
+ children: H.sections.map((e, t) => /* @__PURE__ */ Z(ut, {
2017
2104
  section: e,
2018
2105
  data: {
2019
- ...g,
2106
+ ...m,
2020
2107
  ...w
2021
2108
  },
2022
- objectSchema: F,
2023
- objectName: V.objectName,
2109
+ objectSchema: E,
2110
+ objectName: H.objectName,
2024
2111
  isEditing: S,
2025
- onFieldChange: G
2112
+ onFieldChange: K
2026
2113
  }, t))
2027
2114
  }),
2028
- V.fields && V.fields.length > 0 && !V.sections?.length && /* @__PURE__ */ Z(st, {
2115
+ H.fields && H.fields.length > 0 && !H.sections?.length && /* @__PURE__ */ Z(ut, {
2029
2116
  section: {
2030
- fields: V.fields,
2031
- columns: V.columns
2117
+ fields: H.fields,
2118
+ columns: H.columns
2032
2119
  },
2033
2120
  data: {
2034
- ...g,
2121
+ ...m,
2035
2122
  ...w
2036
2123
  },
2037
- objectSchema: F,
2038
- objectName: V.objectName,
2124
+ objectSchema: E,
2125
+ objectName: H.objectName,
2039
2126
  isEditing: S,
2040
- onFieldChange: G
2127
+ onFieldChange: K
2041
2128
  }),
2042
- V.tabs && V.tabs.length > 0 && /* @__PURE__ */ Z(ct, {
2043
- tabs: V.tabs,
2044
- data: g
2129
+ H.tabs && H.tabs.length > 0 && /* @__PURE__ */ Z(dt, {
2130
+ tabs: H.tabs,
2131
+ data: m
2045
2132
  }),
2046
- he.length > 0 && /* @__PURE__ */ Q("div", {
2133
+ me.length > 0 && /* @__PURE__ */ Q("div", {
2047
2134
  className: "space-y-3",
2048
2135
  children: [/* @__PURE__ */ Z("h2", {
2049
2136
  className: "text-lg font-semibold",
2050
- children: R("detail.related")
2051
- }), he.map((e, t) => /* @__PURE__ */ Z(ut, {
2137
+ children: z("detail.related")
2138
+ }), me.map((e, t) => /* @__PURE__ */ Z(pt, {
2052
2139
  title: e.title,
2053
2140
  type: e.type,
2054
2141
  api: e.api,
@@ -2064,30 +2151,30 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
2064
2151
  onRowEdit: e.onRowEdit,
2065
2152
  onRowDelete: e.onRowDelete,
2066
2153
  collapsible: !0,
2067
- pageSize: jt
2154
+ pageSize: Rt
2068
2155
  }, t))]
2069
2156
  }),
2070
- V.comments && /* @__PURE__ */ Z(mt, {
2071
- comments: V.comments,
2072
- onAddComment: V.onAddComment
2157
+ H.comments && /* @__PURE__ */ Z(_t, {
2158
+ comments: H.comments,
2159
+ onAddComment: H.onAddComment
2073
2160
  }),
2074
- V.activities && V.activities.length > 0 && /* @__PURE__ */ Z(bt, { activities: V.activities })
2161
+ H.activities && H.activities.length > 0 && /* @__PURE__ */ Z(Ct, { activities: H.activities })
2075
2162
  ] }),
2076
- /* @__PURE__ */ Z(At, {
2163
+ /* @__PURE__ */ Z(Lt, {
2077
2164
  data: {
2078
- ...g,
2165
+ ...m,
2079
2166
  ...w
2080
2167
  },
2081
- objectSchema: F,
2082
- objectName: V.objectName
2168
+ objectSchema: E,
2169
+ objectName: H.objectName
2083
2170
  }),
2084
- V.footer && /* @__PURE__ */ Z("div", { children: /* @__PURE__ */ Z(He, {
2085
- schema: V.footer,
2086
- data: g
2171
+ H.footer && /* @__PURE__ */ Z("div", { children: /* @__PURE__ */ Z(Ge, {
2172
+ schema: H.footer,
2173
+ data: m
2087
2174
  }) })
2088
2175
  ]
2089
2176
  }) });
2090
- }, Pt = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field || e.name) || null, Ft = (e) => {
2177
+ }, Vt = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field || e.name) || null, Ht = (e) => {
2091
2178
  let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
2092
2179
  return {
2093
2180
  designer: {
@@ -2097,8 +2184,8 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
2097
2184
  },
2098
2185
  rest: i
2099
2186
  };
2100
- }, It = ({ schema: e = {}, className: t, ...n }) => {
2101
- let r = Ge(), { designer: i } = Ft(n);
2187
+ }, Ut = ({ schema: e = {}, className: t, ...n }) => {
2188
+ let r = Je(), { designer: i } = Ht(n);
2102
2189
  if (!r) return /* @__PURE__ */ Z("div", {
2103
2190
  className: t,
2104
2191
  "data-record-details-placeholder": !0,
@@ -2108,7 +2195,7 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
2108
2195
  children: "record:details — bind a record to preview"
2109
2196
  })
2110
2197
  });
2111
- let a = e.layout === "inline" || e.layout === "compact" ? "horizontal" : "vertical", o = r.objectName || "", s = Qe(), { readableFields: c } = Ze(o), l = Array.isArray(e.requiredPermissions) ? e.requiredPermissions : [];
2198
+ let a = e.layout === "inline" || e.layout === "compact" ? "horizontal" : "vertical", o = r.objectName || "", s = tt(), { readableFields: c } = et(o), l = Array.isArray(e.requiredPermissions) ? e.requiredPermissions : [];
2112
2199
  if (l.length > 0 && o && !l.every((e) => s.can(o, e))) return /* @__PURE__ */ Z("div", {
2113
2200
  className: t,
2114
2201
  ...i,
@@ -2121,9 +2208,9 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
2121
2208
  });
2122
2209
  let u = e.enforceFieldSecurity === !0, d = Array.isArray(e.redactFields) ? e.redactFields : [], f = (e) => {
2123
2210
  if (!e || !u && d.length === 0) return e;
2124
- let t = e.map(Pt).filter((e) => !!e), n = new Set((u && o ? c(t) : t).filter((e) => !d.includes(e)));
2211
+ let t = e.map(Vt).filter((e) => !!e), n = new Set((u && o ? c(t) : t).filter((e) => !d.includes(e)));
2125
2212
  return e.filter((e) => {
2126
- let t = Pt(e);
2213
+ let t = Vt(e);
2127
2214
  return t ? n.has(t) : !0;
2128
2215
  });
2129
2216
  }, p = (e) => typeof e == "string" ? { name: e } : e && typeof e == "object" && !e.name && e.field ? {
@@ -2148,12 +2235,12 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
2148
2235
  return /* @__PURE__ */ Z("div", {
2149
2236
  className: t,
2150
2237
  ...i,
2151
- children: /* @__PURE__ */ Z(Nt, {
2238
+ children: /* @__PURE__ */ Z(Bt, {
2152
2239
  schema: _,
2153
2240
  dataSource: r.dataSource
2154
2241
  })
2155
2242
  });
2156
- }, Lt = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field || e.name || e.key) || null, Rt = (e) => {
2243
+ }, Wt = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field || e.name || e.key) || null, Gt = (e) => {
2157
2244
  let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
2158
2245
  return {
2159
2246
  designer: {
@@ -2163,8 +2250,8 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
2163
2250
  },
2164
2251
  rest: i
2165
2252
  };
2166
- }, zt = ({ schema: e = {}, className: t, ...n }) => {
2167
- let r = Ge(), { designer: i } = Rt(n), a = e.title || e.objectName || "Related", o = e.objectName;
2253
+ }, Kt = ({ schema: e = {}, className: t, ...n }) => {
2254
+ let r = Je(), { designer: i } = Gt(n), a = e.title || e.objectName || "Related", o = e.objectName;
2168
2255
  if (!o) return /* @__PURE__ */ Z("div", {
2169
2256
  className: t,
2170
2257
  ...i,
@@ -2173,7 +2260,7 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
2173
2260
  children: "record:related_list — missing objectName"
2174
2261
  })
2175
2262
  });
2176
- let s = Qe(), { readableFields: c } = Ze(o), l = Array.isArray(e.requiredPermissions) ? e.requiredPermissions : [];
2263
+ let s = tt(), { readableFields: c } = et(o), l = Array.isArray(e.requiredPermissions) ? e.requiredPermissions : [];
2177
2264
  if (l.length > 0 && !l.every((e) => s.can(o, e))) return /* @__PURE__ */ Z("div", {
2178
2265
  className: t,
2179
2266
  ...i,
@@ -2186,16 +2273,16 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
2186
2273
  });
2187
2274
  let u = e.enforceFieldSecurity === !0, d = Array.isArray(e.redactFields) ? e.redactFields : [], f = Array.isArray(e.columns) ? e.columns : [], p = f;
2188
2275
  if (u || d.length > 0) {
2189
- let e = f.map(Lt).filter((e) => !!e), t = new Set((u ? c(e) : e).filter((e) => !d.includes(e)));
2276
+ let e = f.map(Wt).filter((e) => !!e), t = new Set((u ? c(e) : e).filter((e) => !d.includes(e)));
2190
2277
  p = f.filter((e) => {
2191
- let n = Lt(e);
2278
+ let n = Wt(e);
2192
2279
  return n ? t.has(n) : !0;
2193
2280
  });
2194
2281
  }
2195
2282
  return /* @__PURE__ */ Z("div", {
2196
2283
  className: t,
2197
2284
  ...i,
2198
- children: /* @__PURE__ */ Z(ut, {
2285
+ children: /* @__PURE__ */ Z(pt, {
2199
2286
  title: a,
2200
2287
  type: "table",
2201
2288
  api: o,
@@ -2206,7 +2293,7 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
2206
2293
  dataSource: r?.dataSource
2207
2294
  })
2208
2295
  });
2209
- }, Bt = (e) => {
2296
+ }, qt = (e) => {
2210
2297
  let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
2211
2298
  return {
2212
2299
  designer: {
@@ -2216,8 +2303,8 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
2216
2303
  },
2217
2304
  rest: i
2218
2305
  };
2219
- }, Vt = ({ schema: e = {}, className: t, ...n }) => {
2220
- let r = Ge(), { designer: i } = Bt(n), a = r?.objectName || "", o = Qe(), { readableFields: s } = Ze(a), c = Array.isArray(e.requiredPermissions) ? e.requiredPermissions : [];
2306
+ }, Jt = ({ schema: e = {}, className: t, ...n }) => {
2307
+ let r = Je(), { designer: i } = qt(n), a = r?.objectName || "", o = tt(), { readableFields: s } = et(a), c = Array.isArray(e.requiredPermissions) ? e.requiredPermissions : [];
2221
2308
  if (c.length > 0 && a && !c.every((e) => o.can(a, e))) return /* @__PURE__ */ Z("div", {
2222
2309
  className: t,
2223
2310
  ...i,
@@ -2228,21 +2315,26 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
2228
2315
  children: "Insufficient permissions to view highlights."
2229
2316
  })
2230
2317
  });
2231
- let l = Array.isArray(e.fields) ? e.fields : [], u = e.enforceFieldSecurity === !0, d = Array.isArray(e.redactFields) ? e.redactFields : [], f = (u && a ? s(l).filter((e) => !d.includes(e)) : l.filter((e) => !d.includes(e))).map((e) => ({ name: e }));
2318
+ let l = (Array.isArray(e.fields) ? e.fields : []).map((e) => typeof e == "string" ? { name: e } : {
2319
+ name: e?.name,
2320
+ label: e?.label,
2321
+ icon: e?.icon,
2322
+ type: e?.type
2323
+ }).filter((e) => typeof e.name == "string" && e.name.length > 0), u = e.enforceFieldSecurity === !0, d = Array.isArray(e.redactFields) ? e.redactFields : [], f = u && a ? new Set(s(l.map((e) => e.name))) : null, p = l.filter((e) => !(d.includes(e.name) || f && !f.has(e.name)));
2232
2324
  return /* @__PURE__ */ Z("div", {
2233
2325
  className: t,
2234
2326
  ...i,
2235
- children: /* @__PURE__ */ Z(ft, {
2236
- fields: f,
2327
+ children: /* @__PURE__ */ Z(ht, {
2328
+ fields: p,
2237
2329
  data: r?.data,
2238
2330
  objectName: r?.objectName,
2239
2331
  objectSchema: r?.objectSchema
2240
2332
  })
2241
2333
  });
2242
- }, Ht = ({ change: e, className: t }) => {
2334
+ }, Yt = ({ change: e, className: t }) => {
2243
2335
  let n = e.fieldLabel ?? e.field.charAt(0).toUpperCase() + e.field.slice(1).replace(/_/g, " "), r = e.oldDisplayValue ?? (e.oldValue == null ? "(empty)" : String(e.oldValue)), i = e.newDisplayValue ?? (e.newValue == null ? "(empty)" : String(e.newValue));
2244
2336
  return /* @__PURE__ */ Q("div", {
2245
- className: P("flex items-center gap-1.5 text-sm flex-wrap", t),
2337
+ className: L("flex items-center gap-1.5 text-sm flex-wrap", t),
2246
2338
  children: [
2247
2339
  /* @__PURE__ */ Z("span", {
2248
2340
  className: "font-medium text-foreground",
@@ -2252,42 +2344,42 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
2252
2344
  className: "text-muted-foreground line-through",
2253
2345
  children: r
2254
2346
  }),
2255
- /* @__PURE__ */ Z(L, { className: "h-3 w-3 text-muted-foreground shrink-0" }),
2347
+ /* @__PURE__ */ Z(te, { className: "h-3 w-3 text-muted-foreground shrink-0" }),
2256
2348
  /* @__PURE__ */ Z("span", {
2257
2349
  className: "text-foreground",
2258
2350
  children: i
2259
2351
  })
2260
2352
  ]
2261
2353
  });
2262
- }, Ut = [
2354
+ }, Xt = [
2263
2355
  "👍",
2264
2356
  "❤️",
2265
2357
  "🎉",
2266
2358
  "😂",
2267
2359
  "😮",
2268
2360
  "😢"
2269
- ], Wt = ({ reactions: e, onToggleReaction: t, emojiOptions: r = Ut, className: i }) => {
2361
+ ], Zt = ({ reactions: e, onToggleReaction: t, emojiOptions: r = Xt, className: i }) => {
2270
2362
  let [a, o] = n.useState(!1), s = n.useCallback((e) => {
2271
2363
  t?.(e), o(!1);
2272
2364
  }, [t]);
2273
2365
  return /* @__PURE__ */ Q("div", {
2274
- className: P("flex items-center gap-1 flex-wrap", i),
2366
+ className: L("flex items-center gap-1 flex-wrap", i),
2275
2367
  children: [e.map((e) => /* @__PURE__ */ Q("button", {
2276
2368
  type: "button",
2277
- className: P("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs border transition-colors", e.reacted ? "bg-primary/10 border-primary/30 text-primary" : "bg-muted border-border text-muted-foreground hover:bg-muted/80"),
2369
+ className: L("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs border transition-colors", e.reacted ? "bg-primary/10 border-primary/30 text-primary" : "bg-muted border-border text-muted-foreground hover:bg-muted/80"),
2278
2370
  onClick: () => s(e.emoji),
2279
2371
  disabled: !t,
2280
2372
  "aria-label": `${e.emoji} ${e.count} reaction${e.count === 1 ? "" : "s"}`,
2281
2373
  children: [/* @__PURE__ */ Z("span", { children: e.emoji }), /* @__PURE__ */ Z("span", { children: e.count })]
2282
2374
  }, e.emoji)), t && /* @__PURE__ */ Q("div", {
2283
2375
  className: "relative",
2284
- children: [/* @__PURE__ */ Z(p, {
2376
+ children: [/* @__PURE__ */ Z(g, {
2285
2377
  variant: "ghost",
2286
2378
  size: "icon",
2287
2379
  className: "h-6 w-6",
2288
2380
  onClick: () => o(!a),
2289
2381
  "aria-label": "Add reaction",
2290
- children: /* @__PURE__ */ Z(Fe, { className: "h-3.5 w-3.5" })
2382
+ children: /* @__PURE__ */ Z(Re, { className: "h-3.5 w-3.5" })
2291
2383
  }), a && /* @__PURE__ */ Z("div", {
2292
2384
  className: "absolute bottom-full mb-1 left-0 bg-popover border rounded-md shadow-md z-50 p-1.5 flex gap-1",
2293
2385
  role: "listbox",
@@ -2306,7 +2398,7 @@ var Nt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
2306
2398
  };
2307
2399
  //#endregion
2308
2400
  //#region src/ThreadedReplies.tsx
2309
- function Gt(e) {
2401
+ function Qt(e) {
2310
2402
  try {
2311
2403
  let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
2312
2404
  if (r < 1) return "just now";
@@ -2319,8 +2411,8 @@ function Gt(e) {
2319
2411
  return e;
2320
2412
  }
2321
2413
  }
2322
- var Kt = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, className: a }) => {
2323
- let { t: o } = $(), [s, c] = n.useState(!1), [l, u] = n.useState(""), [d, f] = n.useState(!1), m = n.useCallback(async () => {
2414
+ var $t = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, className: a }) => {
2415
+ let { t: o } = $(), [s, c] = n.useState(!1), [l, u] = n.useState(""), [d, f] = n.useState(!1), p = n.useCallback(async () => {
2324
2416
  let t = l.trim();
2325
2417
  if (!(!t || !r)) {
2326
2418
  f(!0);
@@ -2334,11 +2426,11 @@ var Kt = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
2334
2426
  l,
2335
2427
  r,
2336
2428
  e.id
2337
- ]), h = n.useCallback((e) => {
2338
- e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), m());
2339
- }, [m]);
2429
+ ]), m = n.useCallback((e) => {
2430
+ e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), p());
2431
+ }, [p]);
2340
2432
  return t.length === 0 && !i ? null : /* @__PURE__ */ Q("div", {
2341
- className: P("ml-10 mt-1", a),
2433
+ className: L("ml-10 mt-1", a),
2342
2434
  children: [
2343
2435
  t.length > 0 && /* @__PURE__ */ Q("button", {
2344
2436
  type: "button",
@@ -2346,8 +2438,8 @@ var Kt = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
2346
2438
  onClick: () => c(!s),
2347
2439
  "aria-expanded": s,
2348
2440
  children: [
2349
- Z(s ? ae : se, { className: "h-3 w-3" }),
2350
- /* @__PURE__ */ Z(J, { className: "h-3 w-3" }),
2441
+ Z(s ? se : G, { className: "h-3 w-3" }),
2442
+ /* @__PURE__ */ Z(Te, { className: "h-3 w-3" }),
2351
2443
  /* @__PURE__ */ Z("span", { children: t.length === 1 ? o("detail.replyCount", { count: t.length }) : o("detail.replyCountPlural", { count: t.length }) })
2352
2444
  ]
2353
2445
  }),
@@ -2374,7 +2466,7 @@ var Kt = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
2374
2466
  children: e.actor
2375
2467
  }), /* @__PURE__ */ Z("span", {
2376
2468
  className: "text-[10px] text-muted-foreground",
2377
- children: Gt(e.createdAt)
2469
+ children: Qt(e.createdAt)
2378
2470
  })]
2379
2471
  }), /* @__PURE__ */ Z("p", {
2380
2472
  className: "text-xs whitespace-pre-wrap break-words",
@@ -2390,21 +2482,21 @@ var Kt = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
2390
2482
  placeholder: o("detail.replyPlaceholder"),
2391
2483
  value: l,
2392
2484
  onChange: (e) => u(e.target.value),
2393
- onKeyDown: h,
2485
+ onKeyDown: m,
2394
2486
  disabled: d
2395
- }), /* @__PURE__ */ Z(p, {
2487
+ }), /* @__PURE__ */ Z(g, {
2396
2488
  variant: "ghost",
2397
2489
  size: "icon",
2398
2490
  className: "h-6 w-6 shrink-0",
2399
- onClick: m,
2491
+ onClick: p,
2400
2492
  disabled: !l.trim() || d,
2401
2493
  "aria-label": "Send reply",
2402
- children: /* @__PURE__ */ Z(Y, { className: "h-3 w-3" })
2494
+ children: /* @__PURE__ */ Z(Le, { className: "h-3 w-3" })
2403
2495
  })]
2404
2496
  })
2405
2497
  ]
2406
2498
  });
2407
- }, qt = ({ subscription: e, onToggle: t, className: r }) => {
2499
+ }, en = ({ subscription: e, onToggle: t, className: r }) => {
2408
2500
  let { t: i } = $(), [a, o] = n.useState(!1), s = n.useCallback(async () => {
2409
2501
  if (t) {
2410
2502
  o(!0);
@@ -2415,25 +2507,25 @@ var Kt = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
2415
2507
  }
2416
2508
  }
2417
2509
  }, [t, e.subscribed]);
2418
- return /* @__PURE__ */ Z(p, {
2510
+ return /* @__PURE__ */ Z(g, {
2419
2511
  variant: "ghost",
2420
2512
  size: "icon",
2421
- className: P("h-8 w-8", r),
2513
+ className: L("h-8 w-8", r),
2422
2514
  onClick: s,
2423
2515
  disabled: a || !t,
2424
2516
  "aria-label": e.subscribed ? i("detail.unsubscribeAriaLabel") : i("detail.subscribeAriaLabel"),
2425
2517
  title: e.subscribed ? i("detail.subscribedTooltip") : i("detail.unsubscribedTooltip"),
2426
- children: e.subscribed ? /* @__PURE__ */ Z(B, { className: "h-4 w-4 text-primary" }) : /* @__PURE__ */ Z(V, { className: "h-4 w-4 text-muted-foreground" })
2518
+ children: e.subscribed ? /* @__PURE__ */ Z(ne, { className: "h-4 w-4 text-primary" }) : /* @__PURE__ */ Z(re, { className: "h-4 w-4 text-muted-foreground" })
2427
2519
  });
2428
- }, Jt = {
2429
- comment: J,
2430
- field_change: W,
2431
- task: U,
2432
- event: re,
2433
- system: Be,
2434
- email: Ce,
2435
- call: Oe
2436
- }, Yt = {
2520
+ }, tn = {
2521
+ comment: Te,
2522
+ field_change: pe,
2523
+ task: oe,
2524
+ event: ie,
2525
+ system: Ue,
2526
+ email: we,
2527
+ call: Ae
2528
+ }, nn = {
2437
2529
  comment: "bg-purple-100 text-purple-600",
2438
2530
  field_change: "bg-blue-100 text-blue-600",
2439
2531
  task: "bg-green-100 text-green-600",
@@ -2442,7 +2534,7 @@ var Kt = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
2442
2534
  email: "bg-indigo-100 text-indigo-600",
2443
2535
  call: "bg-teal-100 text-teal-600"
2444
2536
  };
2445
- function Xt(e) {
2537
+ function rn(e) {
2446
2538
  return [
2447
2539
  {
2448
2540
  value: "all",
@@ -2462,7 +2554,7 @@ function Xt(e) {
2462
2554
  }
2463
2555
  ];
2464
2556
  }
2465
- function Zt(e) {
2557
+ function an(e) {
2466
2558
  try {
2467
2559
  let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
2468
2560
  if (r < 1) return "just now";
@@ -2475,7 +2567,7 @@ function Zt(e) {
2475
2567
  return e;
2476
2568
  }
2477
2569
  }
2478
- function Qt(e, t) {
2570
+ function on(e, t) {
2479
2571
  switch (t) {
2480
2572
  case "comments_only": return e.filter((e) => e.type === "comment");
2481
2573
  case "changes_only": return e.filter((e) => e.type === "field_change");
@@ -2483,18 +2575,18 @@ function Qt(e, t) {
2483
2575
  default: return e;
2484
2576
  }
2485
2577
  }
2486
- var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a = !1, onLoadMore: o, loading: s = !1, onAddComment: c, onAddReply: l, onToggleReaction: u, subscription: d, onToggleSubscription: f, collapseWhenEmpty: v = !1, titleLabel: y, emptyLabel: b, className: x }) => {
2487
- let { t: S } = $(), [C, w] = n.useState("all"), [T, E] = n.useState(""), [D, O] = n.useState(!1), [k, A] = n.useState(!1), j = r ?? C, M = t?.showFilterToggle !== !1, ee = t?.showCommentInput !== !1 && !!c, N = t?.enableReactions ?? !1, F = t?.enableThreading ?? !1, te = t?.showSubscriptionToggle ?? !1, L = n.useMemo(() => Qt(e, j), [e, j]), ne = n.useMemo(() => F ? L.filter((e) => !e.parentId) : L, [L, F]), R = n.useMemo(() => {
2488
- if (!F) return /* @__PURE__ */ new Map();
2578
+ var sn = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a = !1, onLoadMore: o, loading: s = !1, onAddComment: c, onAddReply: l, onToggleReaction: u, subscription: d, onToggleSubscription: f, collapseWhenEmpty: p = !1, titleLabel: m, emptyLabel: h, className: x }) => {
2579
+ let { t: S } = $(), [C, w] = n.useState("all"), [T, E] = n.useState(""), [D, O] = n.useState(!1), [k, A] = n.useState(!1), j = r ?? C, ee = t?.showFilterToggle !== !1, M = t?.showCommentInput !== !1 && !!c, N = t?.enableReactions ?? !1, P = t?.enableThreading ?? !1, F = t?.showSubscriptionToggle ?? !1, I = n.useMemo(() => on(e, j), [e, j]), R = n.useMemo(() => P ? I.filter((e) => !e.parentId) : I, [I, P]), B = n.useMemo(() => {
2580
+ if (!P) return /* @__PURE__ */ new Map();
2489
2581
  let e = /* @__PURE__ */ new Map();
2490
- for (let t of L) if (t.parentId) {
2582
+ for (let t of I) if (t.parentId) {
2491
2583
  let n = e.get(t.parentId) ?? [];
2492
2584
  n.push(t), e.set(t.parentId, n);
2493
2585
  }
2494
2586
  return e;
2495
- }, [L, F]), z = n.useCallback((e) => {
2587
+ }, [I, P]), te = n.useCallback((e) => {
2496
2588
  i ? i(e) : w(e);
2497
- }, [i]), B = n.useCallback(async () => {
2589
+ }, [i]), V = n.useCallback(async () => {
2498
2590
  let e = T.trim();
2499
2591
  if (!(!e || !c)) {
2500
2592
  O(!0);
@@ -2504,9 +2596,9 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2504
2596
  O(!1);
2505
2597
  }
2506
2598
  }
2507
- }, [T, c]), V = n.useCallback((e) => {
2508
- e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), B());
2509
- }, [B]), H = n.useCallback(async () => {
2599
+ }, [T, c]), H = n.useCallback((e) => {
2600
+ e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), V());
2601
+ }, [V]), U = n.useCallback(async () => {
2510
2602
  if (o) {
2511
2603
  A(!0);
2512
2604
  try {
@@ -2516,79 +2608,79 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2516
2608
  }
2517
2609
  }
2518
2610
  }, [o]);
2519
- return /* @__PURE__ */ Q(m, {
2520
- className: P("", x),
2521
- children: [/* @__PURE__ */ Z(g, { children: /* @__PURE__ */ Q("div", {
2611
+ return /* @__PURE__ */ Q(_, {
2612
+ className: L("", x),
2613
+ children: [/* @__PURE__ */ Z(y, { children: /* @__PURE__ */ Q("div", {
2522
2614
  className: "flex items-center justify-between",
2523
- children: [/* @__PURE__ */ Q(_, {
2615
+ children: [/* @__PURE__ */ Q(b, {
2524
2616
  className: "flex items-center gap-2 text-base",
2525
2617
  children: [
2526
- /* @__PURE__ */ Z(I, { className: "h-4 w-4" }),
2527
- y ?? S("detail.activity"),
2618
+ /* @__PURE__ */ Z(z, { className: "h-4 w-4" }),
2619
+ m ?? S("detail.activity"),
2528
2620
  /* @__PURE__ */ Q("span", {
2529
2621
  className: "text-sm font-normal text-muted-foreground",
2530
2622
  children: [
2531
2623
  "(",
2532
- L.length,
2624
+ I.length,
2533
2625
  ")"
2534
2626
  ]
2535
2627
  })
2536
2628
  ]
2537
2629
  }), /* @__PURE__ */ Z("div", {
2538
2630
  className: "flex items-center gap-1",
2539
- children: te && d && /* @__PURE__ */ Z(qt, {
2631
+ children: F && d && /* @__PURE__ */ Z(en, {
2540
2632
  subscription: d,
2541
2633
  onToggle: f
2542
2634
  })
2543
2635
  })]
2544
- }) }), /* @__PURE__ */ Q(h, {
2636
+ }) }), /* @__PURE__ */ Q(v, {
2545
2637
  className: "space-y-4",
2546
2638
  children: [
2547
- M && /* @__PURE__ */ Z("div", {
2639
+ ee && /* @__PURE__ */ Z("div", {
2548
2640
  className: "flex items-center gap-2",
2549
2641
  children: /* @__PURE__ */ Z("select", {
2550
2642
  className: "rounded-md border border-input bg-background px-2.5 py-1.5 text-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
2551
2643
  value: j,
2552
- onChange: (e) => z(e.target.value),
2644
+ onChange: (e) => te(e.target.value),
2553
2645
  "aria-label": S("detail.filterActivity"),
2554
- children: Xt(S).map((e) => /* @__PURE__ */ Z("option", {
2646
+ children: rn(S).map((e) => /* @__PURE__ */ Z("option", {
2555
2647
  value: e.value,
2556
2648
  children: e.label
2557
2649
  }, e.value))
2558
2650
  })
2559
2651
  }),
2560
- ee && /* @__PURE__ */ Q("div", {
2652
+ M && /* @__PURE__ */ Q("div", {
2561
2653
  className: "flex gap-2",
2562
2654
  children: [/* @__PURE__ */ Z("textarea", {
2563
2655
  className: "flex-1 min-h-[60px] rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring resize-none",
2564
2656
  placeholder: S("detail.leaveCommentPlaceholder"),
2565
2657
  value: T,
2566
2658
  onChange: (e) => E(e.target.value),
2567
- onKeyDown: V,
2659
+ onKeyDown: H,
2568
2660
  disabled: D
2569
- }), /* @__PURE__ */ Q(p, {
2661
+ }), /* @__PURE__ */ Q(g, {
2570
2662
  variant: "default",
2571
- onClick: B,
2663
+ onClick: V,
2572
2664
  disabled: !T.trim() || D,
2573
2665
  className: "shrink-0 self-end gap-1.5",
2574
2666
  "aria-label": S("detail.submitComment"),
2575
2667
  title: S("detail.submitComment"),
2576
- children: [/* @__PURE__ */ Z(Y, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", { children: S("detail.sendComment") })]
2668
+ children: [/* @__PURE__ */ Z(Le, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", { children: S("detail.sendComment") })]
2577
2669
  })]
2578
2670
  }),
2579
- L.length === 0 ? v ? null : /* @__PURE__ */ Z("p", {
2671
+ I.length === 0 ? p ? null : /* @__PURE__ */ Z("p", {
2580
2672
  className: "text-sm text-muted-foreground text-center py-4",
2581
- children: b ?? S("detail.noActivity")
2673
+ children: h ?? S("detail.noActivity")
2582
2674
  }) : /* @__PURE__ */ Q("div", {
2583
2675
  className: "relative",
2584
2676
  children: [/* @__PURE__ */ Z("div", { className: "absolute left-4 top-2 bottom-2 w-px bg-border" }), /* @__PURE__ */ Z("div", {
2585
2677
  className: "space-y-4",
2586
- children: ne.map((e) => {
2587
- let t = Jt[e.type] || Be, n = Yt[e.type] || "bg-gray-100 text-gray-600", r = R.get(e.id) ?? [];
2678
+ children: R.map((e) => {
2679
+ let t = tn[e.type] || Ue, n = nn[e.type] || "bg-gray-100 text-gray-600", r = B.get(e.id) ?? [];
2588
2680
  return /* @__PURE__ */ Q("div", { children: [/* @__PURE__ */ Q("div", {
2589
2681
  className: "flex gap-3 relative",
2590
2682
  children: [/* @__PURE__ */ Z("div", {
2591
- className: P("shrink-0 h-8 w-8 rounded-full flex items-center justify-center z-10", n),
2683
+ className: L("shrink-0 h-8 w-8 rounded-full flex items-center justify-center z-10", n),
2592
2684
  children: e.actorAvatarUrl ? /* @__PURE__ */ Z("img", {
2593
2685
  src: e.actorAvatarUrl,
2594
2686
  alt: e.actor,
@@ -2610,7 +2702,7 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2610
2702
  }),
2611
2703
  /* @__PURE__ */ Z("span", {
2612
2704
  className: "text-xs text-muted-foreground",
2613
- children: Zt(e.createdAt)
2705
+ children: an(e.createdAt)
2614
2706
  }),
2615
2707
  e.edited && /* @__PURE__ */ Z("span", {
2616
2708
  className: "text-xs text-muted-foreground italic",
@@ -2628,25 +2720,25 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2628
2720
  }),
2629
2721
  e.type === "field_change" && e.fieldChanges && /* @__PURE__ */ Z("div", {
2630
2722
  className: "space-y-1 mt-1",
2631
- children: e.fieldChanges.map((e, t) => /* @__PURE__ */ Z(Ht, { change: e }, t))
2723
+ children: e.fieldChanges.map((e, t) => /* @__PURE__ */ Z(Yt, { change: e }, t))
2632
2724
  }),
2633
2725
  N && e.reactions && e.reactions.length > 0 && /* @__PURE__ */ Z("div", {
2634
2726
  className: "mt-1.5",
2635
- children: /* @__PURE__ */ Z(Wt, {
2727
+ children: /* @__PURE__ */ Z(Zt, {
2636
2728
  reactions: e.reactions,
2637
2729
  onToggleReaction: u ? (t) => u(e.id, t) : void 0
2638
2730
  })
2639
2731
  }),
2640
2732
  N && (!e.reactions || e.reactions.length === 0) && u && /* @__PURE__ */ Z("div", {
2641
2733
  className: "mt-1.5",
2642
- children: /* @__PURE__ */ Z(Wt, {
2734
+ children: /* @__PURE__ */ Z(Zt, {
2643
2735
  reactions: [],
2644
2736
  onToggleReaction: (t) => u(e.id, t)
2645
2737
  })
2646
2738
  })
2647
2739
  ]
2648
2740
  })]
2649
- }), F && (e.replyCount ?? 0) > 0 && /* @__PURE__ */ Z(Kt, {
2741
+ }), P && (e.replyCount ?? 0) > 0 && /* @__PURE__ */ Z($t, {
2650
2742
  parentItem: e,
2651
2743
  replies: r,
2652
2744
  onAddReply: l,
@@ -2657,19 +2749,19 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2657
2749
  }),
2658
2750
  a && /* @__PURE__ */ Z("div", {
2659
2751
  className: "text-center pt-2",
2660
- children: /* @__PURE__ */ Q(p, {
2752
+ children: /* @__PURE__ */ Q(g, {
2661
2753
  variant: "ghost",
2662
2754
  size: "sm",
2663
- onClick: H,
2755
+ onClick: U,
2664
2756
  disabled: k,
2665
2757
  "aria-label": S("detail.loadMore"),
2666
- children: [k ? /* @__PURE__ */ Z(Se, { className: "h-4 w-4 animate-spin mr-1" }) : /* @__PURE__ */ Z(ae, { className: "h-4 w-4 mr-1" }), S("detail.loadMore")]
2758
+ children: [k ? /* @__PURE__ */ Z(Ce, { className: "h-4 w-4 animate-spin mr-1" }) : /* @__PURE__ */ Z(se, { className: "h-4 w-4 mr-1" }), S("detail.loadMore")]
2667
2759
  })
2668
2760
  })
2669
2761
  ]
2670
2762
  })]
2671
2763
  });
2672
- }, en = (e) => {
2764
+ }, cn = (e) => {
2673
2765
  let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
2674
2766
  return {
2675
2767
  designer: {
@@ -2679,31 +2771,31 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2679
2771
  },
2680
2772
  rest: i
2681
2773
  };
2682
- }, tn = ({ schema: e = {}, className: t, ...n }) => {
2683
- Ge();
2684
- let { designer: r } = en(n);
2774
+ }, ln = ({ schema: e = {}, className: t, ...n }) => {
2775
+ Je();
2776
+ let { designer: r } = cn(n);
2685
2777
  return /* @__PURE__ */ Z("div", {
2686
2778
  className: t,
2687
2779
  ...r,
2688
- children: /* @__PURE__ */ Z($t, {
2780
+ children: /* @__PURE__ */ Z(sn, {
2689
2781
  items: [],
2690
2782
  config: e
2691
2783
  })
2692
2784
  });
2693
- }, nn = ({ config: e, items: t, hasMore: r, onLoadMore: i, loading: a, onAddComment: o, onAddReply: s, onToggleReaction: c, subscription: l, onToggleSubscription: u, filterMode: d, onFilterChange: f, collapseWhenEmpty: m = !1, className: h }) => {
2694
- let g = e?.position ?? "right", _ = e?.width ?? "360px", v = e?.collapsible ?? !0, y = m && t.length === 0 || (e?.defaultCollapsed ?? !1), { t: b } = $(), [x, S] = n.useState(y);
2695
- return g === "right" || g === "left" ? x && v ? /* @__PURE__ */ Z("div", {
2696
- className: P("flex items-start pt-4", g === "right" ? "border-l" : "border-r", h),
2697
- children: /* @__PURE__ */ Z(p, {
2785
+ }, un = ({ config: e, items: t, hasMore: r, onLoadMore: i, loading: a, onAddComment: o, onAddReply: s, onToggleReaction: c, subscription: l, onToggleSubscription: u, filterMode: d, onFilterChange: f, collapseWhenEmpty: p = !1, className: m }) => {
2786
+ let h = e?.position ?? "right", _ = e?.width ?? "360px", v = e?.collapsible ?? !0, y = p && t.length === 0 || (e?.defaultCollapsed ?? !1), { t: b } = $(), [x, S] = n.useState(y);
2787
+ return h === "right" || h === "left" ? x && v ? /* @__PURE__ */ Z("div", {
2788
+ className: L("flex items-start pt-4", h === "right" ? "border-l" : "border-r", m),
2789
+ children: /* @__PURE__ */ Z(g, {
2698
2790
  variant: "ghost",
2699
2791
  size: "icon",
2700
2792
  className: "h-8 w-8 mx-1",
2701
2793
  onClick: () => S(!1),
2702
2794
  "aria-label": b("detail.openDiscussion"),
2703
- children: /* @__PURE__ */ Z(Ee, { className: "h-4 w-4" })
2795
+ children: /* @__PURE__ */ Z(Oe, { className: "h-4 w-4" })
2704
2796
  })
2705
2797
  }) : /* @__PURE__ */ Q("div", {
2706
- className: P("flex flex-col overflow-hidden", g === "right" ? "border-l" : "border-r", h),
2798
+ className: L("flex flex-col overflow-hidden", h === "right" ? "border-l" : "border-r", m),
2707
2799
  style: {
2708
2800
  width: _,
2709
2801
  minWidth: _
@@ -2712,21 +2804,21 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2712
2804
  className: "flex items-center justify-between px-4 py-3 border-b",
2713
2805
  children: [/* @__PURE__ */ Q("div", {
2714
2806
  className: "flex items-center gap-2",
2715
- children: [/* @__PURE__ */ Z(J, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", {
2807
+ children: [/* @__PURE__ */ Z(Te, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", {
2716
2808
  className: "text-sm font-medium",
2717
2809
  children: b("detail.discussion")
2718
2810
  })]
2719
- }), v && /* @__PURE__ */ Z(p, {
2811
+ }), v && /* @__PURE__ */ Z(g, {
2720
2812
  variant: "ghost",
2721
2813
  size: "icon",
2722
2814
  className: "h-7 w-7",
2723
2815
  onClick: () => S(!0),
2724
2816
  "aria-label": b("detail.closeDiscussion"),
2725
- children: /* @__PURE__ */ Z(ze, { className: "h-3.5 w-3.5" })
2817
+ children: /* @__PURE__ */ Z(He, { className: "h-3.5 w-3.5" })
2726
2818
  })]
2727
2819
  }), /* @__PURE__ */ Z("div", {
2728
2820
  className: "flex-1 overflow-y-auto",
2729
- children: /* @__PURE__ */ Z($t, {
2821
+ children: /* @__PURE__ */ Z(sn, {
2730
2822
  items: t,
2731
2823
  config: e?.feed,
2732
2824
  hasMore: r,
@@ -2739,34 +2831,34 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2739
2831
  onToggleSubscription: u,
2740
2832
  filterMode: d,
2741
2833
  onFilterChange: f,
2742
- collapseWhenEmpty: m,
2834
+ collapseWhenEmpty: p,
2743
2835
  titleLabel: b("detail.discussion"),
2744
2836
  emptyLabel: b("detail.noCommentsYet"),
2745
2837
  className: "border-0 shadow-none"
2746
2838
  })
2747
2839
  })]
2748
2840
  }) : /* @__PURE__ */ Z("div", {
2749
- className: P("", h),
2750
- children: v && x ? /* @__PURE__ */ Q(p, {
2841
+ className: L("", m),
2842
+ children: v && x ? /* @__PURE__ */ Q(g, {
2751
2843
  variant: "ghost",
2752
2844
  className: "w-full justify-start gap-2 text-muted-foreground",
2753
2845
  onClick: () => S(!1),
2754
2846
  "aria-label": b("detail.showDiscussion", { count: t.length }),
2755
- children: [/* @__PURE__ */ Z(J, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", { children: b("detail.showDiscussion", { count: t.length }) })]
2847
+ children: [/* @__PURE__ */ Z(Te, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", { children: b("detail.showDiscussion", { count: t.length }) })]
2756
2848
  }) : /* @__PURE__ */ Q("div", { children: [v && /* @__PURE__ */ Q("div", {
2757
2849
  className: "flex items-center justify-between mb-2",
2758
2850
  children: [/* @__PURE__ */ Q("div", {
2759
2851
  className: "flex items-center gap-2 text-sm font-medium",
2760
- children: [/* @__PURE__ */ Z(J, { className: "h-4 w-4" }), b("detail.discussion")]
2761
- }), /* @__PURE__ */ Z(p, {
2852
+ children: [/* @__PURE__ */ Z(Te, { className: "h-4 w-4" }), b("detail.discussion")]
2853
+ }), /* @__PURE__ */ Z(g, {
2762
2854
  variant: "ghost",
2763
2855
  size: "icon",
2764
2856
  className: "h-7 w-7",
2765
2857
  onClick: () => S(!0),
2766
2858
  "aria-label": b("detail.hideDiscussion"),
2767
- children: /* @__PURE__ */ Z(Te, { className: "h-3.5 w-3.5" })
2859
+ children: /* @__PURE__ */ Z(De, { className: "h-3.5 w-3.5" })
2768
2860
  })]
2769
- }), /* @__PURE__ */ Z($t, {
2861
+ }), /* @__PURE__ */ Z(sn, {
2770
2862
  items: t,
2771
2863
  config: e?.feed,
2772
2864
  hasMore: r,
@@ -2779,12 +2871,12 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2779
2871
  onToggleSubscription: u,
2780
2872
  filterMode: d,
2781
2873
  onFilterChange: f,
2782
- collapseWhenEmpty: m,
2874
+ collapseWhenEmpty: p,
2783
2875
  titleLabel: b("detail.discussion"),
2784
2876
  emptyLabel: b("detail.noCommentsYet")
2785
2877
  })] })
2786
2878
  });
2787
- }, rn = (e) => {
2879
+ }, dn = (e) => {
2788
2880
  let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
2789
2881
  return {
2790
2882
  designer: {
@@ -2794,18 +2886,18 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2794
2886
  },
2795
2887
  rest: i
2796
2888
  };
2797
- }, an = ({ schema: e = {}, className: t, ...n }) => {
2798
- Ge();
2799
- let { designer: r } = rn(n);
2889
+ }, fn = ({ schema: e = {}, className: t, ...n }) => {
2890
+ Je();
2891
+ let { designer: r } = dn(n);
2800
2892
  return /* @__PURE__ */ Z("div", {
2801
2893
  className: t,
2802
2894
  ...r,
2803
- children: /* @__PURE__ */ Z(nn, {
2895
+ children: /* @__PURE__ */ Z(un, {
2804
2896
  items: [],
2805
2897
  config: e
2806
2898
  })
2807
2899
  });
2808
- }, on = (e) => {
2900
+ }, pn = (e) => {
2809
2901
  let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
2810
2902
  return {
2811
2903
  designer: {
@@ -2815,8 +2907,8 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2815
2907
  },
2816
2908
  rest: i
2817
2909
  };
2818
- }, sn = ({ schema: e = {}, className: t, ...n }) => {
2819
- let r = Ge(), { designer: i } = on(n), a = Array.isArray(e.stages) ? e.stages : [], o = e.statusField, s = o && r?.data ? r.data[o] : void 0, c = a.findIndex((e) => e.value === s);
2910
+ }, mn = ({ schema: e = {}, className: t, ...n }) => {
2911
+ let r = Je(), { designer: i } = pn(n), a = Array.isArray(e.stages) ? e.stages : [], o = e.statusField, s = o && r?.data ? r.data[o] : void 0, c = a.findIndex((e) => e.value === s);
2820
2912
  return c < 0 && (c = -1), a.length === 0 ? /* @__PURE__ */ Z("div", {
2821
2913
  className: t,
2822
2914
  ...i,
@@ -2825,7 +2917,7 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2825
2917
  children: "record:path — no stages configured"
2826
2918
  })
2827
2919
  }) : /* @__PURE__ */ Z("div", {
2828
- className: P("flex w-full items-stretch gap-1", t),
2920
+ className: L("flex w-full items-stretch gap-1", t),
2829
2921
  role: "list",
2830
2922
  "aria-label": e.aria?.label || "Record path",
2831
2923
  ...i,
@@ -2834,7 +2926,7 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2834
2926
  return /* @__PURE__ */ Z("div", {
2835
2927
  role: "listitem",
2836
2928
  "aria-current": r ? "step" : void 0,
2837
- className: P("relative flex-1 px-4 py-2 text-xs font-medium border text-center", "first:rounded-l-md last:rounded-r-md", r && "bg-primary text-primary-foreground border-primary", n && "bg-muted text-muted-foreground", !r && !n && "bg-background text-foreground/70"),
2929
+ className: L("relative flex-1 px-4 py-2 text-xs font-medium border text-center", "first:rounded-l-md last:rounded-r-md", r && "bg-primary text-primary-foreground border-primary", n && "bg-muted text-muted-foreground", !r && !n && "bg-background text-foreground/70"),
2838
2930
  children: /* @__PURE__ */ Q("span", {
2839
2931
  className: "inline-flex items-center gap-1.5",
2840
2932
  children: [n && /* @__PURE__ */ Z("span", {
@@ -2845,7 +2937,7 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2845
2937
  }, `${e.value}-${t}`);
2846
2938
  })
2847
2939
  });
2848
- }, cn = (e) => {
2940
+ }, hn = (e) => {
2849
2941
  let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
2850
2942
  return {
2851
2943
  designer: {
@@ -2855,8 +2947,8 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2855
2947
  },
2856
2948
  rest: i
2857
2949
  };
2858
- }, ln = ({ schema: e = {}, className: t, ...n }) => {
2859
- let r = Ge(), { designer: i } = cn(n), a = Qe(), o = Array.isArray(e.actions) ? e.actions : Array.isArray(e.properties?.actions) ? e.properties.actions : [], s = r?.objectName || "", c = Array.isArray(e.requiredPermissions) ? e.requiredPermissions : [];
2950
+ }, gn = ({ schema: e = {}, className: t, ...n }) => {
2951
+ let r = Je(), { designer: i } = hn(n), a = tt(), o = Array.isArray(e.actions) ? e.actions : Array.isArray(e.properties?.actions) ? e.properties.actions : [], s = r?.objectName || "", c = Array.isArray(e.requiredPermissions) ? e.requiredPermissions : [];
2860
2952
  if (c.length > 0 && s && !c.every((e) => a.can(s, e))) return /* @__PURE__ */ Z("div", {
2861
2953
  className: t,
2862
2954
  ...i,
@@ -2867,7 +2959,7 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2867
2959
  children: "Insufficient permissions to view quick actions."
2868
2960
  })
2869
2961
  });
2870
- let l = e.location || "record_header", { getActionsForLocation: u, executeAction: d } = Ue({
2962
+ let l = e.location || "record_header", { getActionsForLocation: u, executeAction: d } = Ke({
2871
2963
  actions: o,
2872
2964
  context: {
2873
2965
  record: r?.data,
@@ -2883,15 +2975,15 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2883
2975
  children: "record:quick_actions — no actions configured"
2884
2976
  })
2885
2977
  });
2886
- let m = e.align || "end", h = m === "start" ? "justify-start" : m === "center" ? "justify-center" : "justify-end";
2978
+ let p = e.align || "end", m = p === "start" ? "justify-start" : p === "center" ? "justify-center" : "justify-end";
2887
2979
  return /* @__PURE__ */ Z("div", {
2888
- className: P("flex flex-wrap items-center gap-2", l === "record_header" && !e.inline && "-mt-12 sm:-mt-14 mb-2 relative z-10", h, t),
2980
+ className: L("flex flex-wrap items-center gap-2", l === "record_header" && !e.inline && "-mt-12 sm:-mt-14 mb-2 relative z-10", m, t),
2889
2981
  role: "toolbar",
2890
2982
  "aria-label": e.aria?.label || "Quick actions",
2891
2983
  ...i,
2892
2984
  children: f.map((t, n) => {
2893
2985
  let r = t.label || t.name || `Action ${n + 1}`;
2894
- return /* @__PURE__ */ Z(p, {
2986
+ return /* @__PURE__ */ Z(g, {
2895
2987
  variant: t.variant || e.variant || "default",
2896
2988
  size: t.size || e.size || "sm",
2897
2989
  disabled: typeof t.disabled == "boolean" ? t.disabled : void 0,
@@ -2906,7 +2998,7 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2906
2998
  }, t.name || `qa-${n}`);
2907
2999
  })
2908
3000
  });
2909
- }, un = new Set([
3001
+ }, _n = new Set([
2910
3002
  "id",
2911
3003
  "_id",
2912
3004
  "__v",
@@ -2921,15 +3013,15 @@ var $t = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
2921
3013
  "owner_id",
2922
3014
  "deleted_at",
2923
3015
  "is_deleted"
2924
- ]), dn = 480, fn = 95;
2925
- function pn({ open: e, onClose: t, title: n, record: i, objectName: a, recordId: o, dataSource: s, objectSchema: c, width: l = "min(960px, 60vw)", columns: u = 2, systemFields: d = un, onFieldSave: f, onDelete: p, resizable: m = !0, fullPageHref: h }) {
3016
+ ]), vn = 480, yn = 95;
3017
+ function bn({ open: e, onClose: t, title: n, record: i, objectName: a, recordId: o, dataSource: s, objectSchema: c, width: l = "min(960px, 60vw)", columns: u = 2, systemFields: d = _n, onFieldSave: f, onDelete: p, resizable: m = !0, fullPageHref: h }) {
2926
3018
  let { t: g } = $(), _ = `objectui.drawerWidth.${a}`, [v, y] = r.useState(() => {
2927
3019
  if (typeof window > "u" || !m) return null;
2928
3020
  try {
2929
3021
  let e = window.localStorage.getItem(_);
2930
3022
  if (e) {
2931
3023
  let t = parseInt(e, 10);
2932
- if (Number.isFinite(t) && t >= dn) return t;
3024
+ if (Number.isFinite(t) && t >= vn) return t;
2933
3025
  }
2934
3026
  } catch {}
2935
3027
  return null;
@@ -2940,21 +3032,21 @@ function pn({ open: e, onClose: t, title: n, record: i, objectName: a, recordId:
2940
3032
  ]), x = b ? {
2941
3033
  width: b,
2942
3034
  maxWidth: b
2943
- } : void 0, E = r.useRef(null), D = r.useCallback((e) => {
3035
+ } : void 0, S = r.useRef(null), C = r.useCallback((e) => {
2944
3036
  if (!m) return;
2945
3037
  e.preventDefault();
2946
3038
  let t = v ?? (typeof window < "u" ? Math.min(window.innerWidth * .6, 960) : 720);
2947
- E.current = {
3039
+ S.current = {
2948
3040
  startX: e.clientX,
2949
3041
  startWidth: t
2950
3042
  };
2951
3043
  let n = (e) => {
2952
- let t = E.current;
3044
+ let t = S.current;
2953
3045
  if (!t) return;
2954
- let n = t.startX - e.clientX, r = typeof window < "u" ? window.innerWidth * fn / 100 : 1600, i = Math.min(r, Math.max(dn, t.startWidth + n));
3046
+ let n = t.startX - e.clientX, r = typeof window < "u" ? window.innerWidth * yn / 100 : 1600, i = Math.min(r, Math.max(vn, t.startWidth + n));
2955
3047
  y(Math.round(i));
2956
3048
  }, r = () => {
2957
- E.current, E.current = null, window.removeEventListener("pointermove", n), window.removeEventListener("pointerup", r), window.removeEventListener("pointercancel", r);
3049
+ S.current, S.current = null, window.removeEventListener("pointermove", n), window.removeEventListener("pointerup", r), window.removeEventListener("pointercancel", r);
2958
3050
  try {
2959
3051
  y((e) => (e != null && window.localStorage.setItem(_, String(e)), e));
2960
3052
  } catch {}
@@ -2964,8 +3056,8 @@ function pn({ open: e, onClose: t, title: n, record: i, objectName: a, recordId:
2964
3056
  m,
2965
3057
  v,
2966
3058
  _
2967
- ]), O = c?.fields ?? {}, k = (Object.keys(O).length ? Object.keys(O) : Object.keys(i)).filter((e) => !d.has(e) && !e.startsWith("__")).filter((e) => e in i).map((e) => {
2968
- let t = O[e] || {}, n = t.type === "lookup" || t.type === "master_detail" || t.type === "reference";
3059
+ ]), w = c?.fields ?? {}, k = (Object.keys(w).length ? Object.keys(w) : Object.keys(i)).filter((e) => !d.has(e) && !e.startsWith("__")).filter((e) => e in i).map((e) => {
3060
+ let t = w[e] || {}, n = t.type === "lookup" || t.type === "master_detail" || t.type === "reference";
2969
3061
  return {
2970
3062
  name: e,
2971
3063
  label: t.label,
@@ -2983,12 +3075,12 @@ function pn({ open: e, onClose: t, title: n, record: i, objectName: a, recordId:
2983
3075
  description: t.description
2984
3076
  };
2985
3077
  });
2986
- return /* @__PURE__ */ Z(S, {
3078
+ return /* @__PURE__ */ Z(T, {
2987
3079
  open: e,
2988
3080
  onOpenChange: (e) => {
2989
3081
  e || t();
2990
3082
  },
2991
- children: /* @__PURE__ */ Q(C, {
3083
+ children: /* @__PURE__ */ Q(E, {
2992
3084
  side: "right",
2993
3085
  className: "w-full overflow-y-auto p-0 sm:!max-w-none",
2994
3086
  style: x,
@@ -2998,16 +3090,16 @@ function pn({ open: e, onClose: t, title: n, record: i, objectName: a, recordId:
2998
3090
  role: "separator",
2999
3091
  "aria-orientation": "vertical",
3000
3092
  "aria-label": "Resize drawer",
3001
- onPointerDown: D,
3093
+ onPointerDown: C,
3002
3094
  className: "hidden sm:block absolute left-0 top-0 h-full w-1.5 cursor-col-resize select-none bg-transparent hover:bg-primary/30 active:bg-primary/50 transition-colors z-10"
3003
3095
  }),
3004
- /* @__PURE__ */ Z(w, {
3096
+ /* @__PURE__ */ Z(D, {
3005
3097
  className: "sr-only",
3006
- children: /* @__PURE__ */ Z(T, { children: n })
3098
+ children: /* @__PURE__ */ Z(O, { children: n })
3007
3099
  }),
3008
3100
  /* @__PURE__ */ Z("div", {
3009
3101
  className: "px-6 pt-6 pb-6",
3010
- children: /* @__PURE__ */ Z(Nt, {
3102
+ children: /* @__PURE__ */ Z(Bt, {
3011
3103
  dataSource: s,
3012
3104
  inlineEdit: !0,
3013
3105
  schema: {
@@ -3050,93 +3142,93 @@ function pn({ open: e, onClose: t, title: n, record: i, objectName: a, recordId:
3050
3142
  })
3051
3143
  });
3052
3144
  }
3053
- function mn(e, t) {
3145
+ function xn(e, t) {
3054
3146
  if (typeof window > "u") return null;
3055
3147
  let n = window.location.pathname, r = `/${e}`, i = n.indexOf(r);
3056
3148
  return `${i >= 0 ? n.slice(0, i) : n.replace(/\/$/, "")}/${e}/record/${encodeURIComponent(String(t))}`;
3057
3149
  }
3058
3150
  //#endregion
3059
3151
  //#region src/InlineCreateRelated.tsx
3060
- var hn = ({ objectName: e, relationshipField: t, fields: r, onCreateRecord: i, onLinkRecord: a, onSearch: o, existingRecords: s = [], className: c }) => {
3061
- let [l, u] = n.useState(!1), [d, f] = n.useState("create"), [v, y] = n.useState({}), [b, S] = n.useState(""), [C, w] = n.useState(s), [T, E] = n.useState(!1), [j, M] = n.useState(!1), ee = n.useMemo(() => {
3062
- if (!b.trim()) return C;
3063
- let e = b.toLowerCase();
3064
- return C.filter((t) => t.label.toLowerCase().includes(e) || t.description?.toLowerCase().includes(e));
3065
- }, [b, C]), N = n.useCallback(async (e) => {
3066
- if (S(e), o && e.trim().length >= 2) {
3067
- M(!0);
3152
+ var Sn = ({ objectName: e, relationshipField: t, fields: r, onCreateRecord: i, onLinkRecord: a, onSearch: o, existingRecords: s = [], className: c }) => {
3153
+ let [l, u] = n.useState(!1), [d, f] = n.useState("create"), [p, m] = n.useState({}), [h, x] = n.useState(""), [S, C] = n.useState(s), [T, E] = n.useState(!1), [D, O] = n.useState(!1), k = n.useMemo(() => {
3154
+ if (!h.trim()) return S;
3155
+ let e = h.toLowerCase();
3156
+ return S.filter((t) => t.label.toLowerCase().includes(e) || t.description?.toLowerCase().includes(e));
3157
+ }, [h, S]), N = n.useCallback(async (e) => {
3158
+ if (x(e), o && e.trim().length >= 2) {
3159
+ O(!0);
3068
3160
  try {
3069
- w(await o(e));
3161
+ C(await o(e));
3070
3162
  } finally {
3071
- M(!1);
3163
+ O(!1);
3072
3164
  }
3073
3165
  }
3074
- }, [o]), F = n.useCallback((e, t) => {
3075
- y((n) => ({
3166
+ }, [o]), P = n.useCallback((e, t) => {
3167
+ m((n) => ({
3076
3168
  ...n,
3077
3169
  [e]: t
3078
3170
  }));
3079
- }, []), I = n.useCallback(async () => {
3171
+ }, []), F = n.useCallback(async () => {
3080
3172
  if (i) {
3081
3173
  E(!0);
3082
3174
  try {
3083
3175
  await i({
3084
- ...v,
3176
+ ...p,
3085
3177
  [t]: !0
3086
- }), y({}), u(!1);
3178
+ }), m({}), u(!1);
3087
3179
  } finally {
3088
3180
  E(!1);
3089
3181
  }
3090
3182
  }
3091
3183
  }, [
3092
3184
  i,
3093
- v,
3185
+ p,
3094
3186
  t
3095
- ]), te = n.useCallback(async (e) => {
3187
+ ]), I = n.useCallback(async (e) => {
3096
3188
  if (a) {
3097
3189
  E(!0);
3098
3190
  try {
3099
- await a(e), S(""), u(!1);
3191
+ await a(e), x(""), u(!1);
3100
3192
  } finally {
3101
3193
  E(!1);
3102
3194
  }
3103
3195
  }
3104
- }, [a]), L = n.useMemo(() => r.filter((e) => e.required).every((e) => v[e.name]?.toString().trim()), [r, v]);
3105
- return l ? /* @__PURE__ */ Q(m, {
3106
- className: P("", c),
3107
- children: [/* @__PURE__ */ Z(g, {
3196
+ }, [a]), R = n.useMemo(() => r.filter((e) => e.required).every((e) => p[e.name]?.toString().trim()), [r, p]);
3197
+ return l ? /* @__PURE__ */ Q(_, {
3198
+ className: L("", c),
3199
+ children: [/* @__PURE__ */ Z(y, {
3108
3200
  className: "pb-3",
3109
- children: /* @__PURE__ */ Q(_, {
3201
+ children: /* @__PURE__ */ Q(b, {
3110
3202
  className: "flex items-center justify-between text-sm",
3111
3203
  children: [/* @__PURE__ */ Q("span", { children: [
3112
3204
  d === "create" ? "Create" : "Link",
3113
3205
  " ",
3114
3206
  e
3115
- ] }), /* @__PURE__ */ Z(p, {
3207
+ ] }), /* @__PURE__ */ Z(g, {
3116
3208
  variant: "ghost",
3117
3209
  size: "icon",
3118
3210
  className: "h-6 w-6",
3119
3211
  onClick: () => u(!1),
3120
- children: /* @__PURE__ */ Z(ze, { className: "h-3.5 w-3.5" })
3212
+ children: /* @__PURE__ */ Z(He, { className: "h-3.5 w-3.5" })
3121
3213
  })]
3122
3214
  })
3123
- }), /* @__PURE__ */ Z(h, { children: /* @__PURE__ */ Q(D, {
3215
+ }), /* @__PURE__ */ Z(v, { children: /* @__PURE__ */ Q(A, {
3124
3216
  value: d,
3125
3217
  onValueChange: f,
3126
3218
  children: [
3127
- /* @__PURE__ */ Q(k, {
3219
+ /* @__PURE__ */ Q(ee, {
3128
3220
  className: "mb-3 w-full",
3129
- children: [i && /* @__PURE__ */ Q(A, {
3221
+ children: [i && /* @__PURE__ */ Q(M, {
3130
3222
  value: "create",
3131
3223
  className: "flex-1 gap-1.5",
3132
- children: [/* @__PURE__ */ Z(Ae, { className: "h-3.5 w-3.5" }), "Create New"]
3133
- }), a && /* @__PURE__ */ Q(A, {
3224
+ children: [/* @__PURE__ */ Z(Me, { className: "h-3.5 w-3.5" }), "Create New"]
3225
+ }), a && /* @__PURE__ */ Q(M, {
3134
3226
  value: "link",
3135
3227
  className: "flex-1 gap-1.5",
3136
- children: [/* @__PURE__ */ Z(q, { className: "h-3.5 w-3.5" }), "Link Existing"]
3228
+ children: [/* @__PURE__ */ Z(xe, { className: "h-3.5 w-3.5" }), "Link Existing"]
3137
3229
  })]
3138
3230
  }),
3139
- i && /* @__PURE__ */ Q(O, {
3231
+ i && /* @__PURE__ */ Q(j, {
3140
3232
  value: "create",
3141
3233
  className: "space-y-3 mt-0",
3142
3234
  children: [r.map((e) => /* @__PURE__ */ Q("div", { children: [/* @__PURE__ */ Q("label", {
@@ -3145,51 +3237,51 @@ var hn = ({ objectName: e, relationshipField: t, fields: r, onCreateRecord: i, o
3145
3237
  className: "text-destructive ml-0.5",
3146
3238
  children: "*"
3147
3239
  })]
3148
- }), /* @__PURE__ */ Z(x, {
3240
+ }), /* @__PURE__ */ Z(w, {
3149
3241
  type: e.type === "number" ? "number" : e.type === "date" ? "date" : "text",
3150
3242
  placeholder: e.placeholder || `Enter ${e.label.toLowerCase()}`,
3151
- value: v[e.name] || "",
3152
- onChange: (t) => F(e.name, t.target.value),
3243
+ value: p[e.name] || "",
3244
+ onChange: (t) => P(e.name, t.target.value),
3153
3245
  className: "h-8 text-sm"
3154
3246
  })] }, e.name)), /* @__PURE__ */ Q("div", {
3155
3247
  className: "flex justify-end gap-2 pt-1",
3156
- children: [/* @__PURE__ */ Z(p, {
3248
+ children: [/* @__PURE__ */ Z(g, {
3157
3249
  variant: "ghost",
3158
3250
  size: "sm",
3159
3251
  onClick: () => u(!1),
3160
3252
  children: "Cancel"
3161
- }), /* @__PURE__ */ Q(p, {
3253
+ }), /* @__PURE__ */ Q(g, {
3162
3254
  size: "sm",
3163
- onClick: I,
3164
- disabled: !L || T,
3255
+ onClick: F,
3256
+ disabled: !R || T,
3165
3257
  className: "gap-1.5",
3166
- children: [T && /* @__PURE__ */ Z(Se, { className: "h-3.5 w-3.5 animate-spin" }), "Create"]
3258
+ children: [T && /* @__PURE__ */ Z(Ce, { className: "h-3.5 w-3.5 animate-spin" }), "Create"]
3167
3259
  })]
3168
3260
  })]
3169
3261
  }),
3170
- a && /* @__PURE__ */ Q(O, {
3262
+ a && /* @__PURE__ */ Q(j, {
3171
3263
  value: "link",
3172
3264
  className: "space-y-3 mt-0",
3173
3265
  children: [/* @__PURE__ */ Q("div", {
3174
3266
  className: "relative",
3175
- children: [/* @__PURE__ */ Z(Pe, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }), /* @__PURE__ */ Z(x, {
3267
+ children: [/* @__PURE__ */ Z(Ie, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }), /* @__PURE__ */ Z(w, {
3176
3268
  placeholder: `Search ${e}…`,
3177
- value: b,
3269
+ value: h,
3178
3270
  onChange: (e) => N(e.target.value),
3179
3271
  className: "h-8 text-sm pl-8"
3180
3272
  })]
3181
3273
  }), /* @__PURE__ */ Z("div", {
3182
3274
  className: "max-h-48 overflow-y-auto space-y-1",
3183
- children: j ? /* @__PURE__ */ Q("div", {
3275
+ children: D ? /* @__PURE__ */ Q("div", {
3184
3276
  className: "flex items-center justify-center py-4 text-sm text-muted-foreground",
3185
- children: [/* @__PURE__ */ Z(Se, { className: "h-4 w-4 animate-spin mr-2" }), "Searching…"]
3186
- }) : ee.length === 0 ? /* @__PURE__ */ Z("p", {
3277
+ children: [/* @__PURE__ */ Z(Ce, { className: "h-4 w-4 animate-spin mr-2" }), "Searching…"]
3278
+ }) : k.length === 0 ? /* @__PURE__ */ Z("p", {
3187
3279
  className: "text-sm text-muted-foreground text-center py-4",
3188
- children: b ? "No records found" : "Type to search records"
3189
- }) : ee.map((e) => /* @__PURE__ */ Q("button", {
3280
+ children: h ? "No records found" : "Type to search records"
3281
+ }) : k.map((e) => /* @__PURE__ */ Q("button", {
3190
3282
  type: "button",
3191
3283
  className: "w-full text-left px-3 py-2 rounded-md hover:bg-accent text-sm transition-colors",
3192
- onClick: () => te(e.id),
3284
+ onClick: () => I(e.id),
3193
3285
  disabled: T,
3194
3286
  children: [/* @__PURE__ */ Z("span", {
3195
3287
  className: "font-medium",
@@ -3204,8 +3296,8 @@ var hn = ({ objectName: e, relationshipField: t, fields: r, onCreateRecord: i, o
3204
3296
  ]
3205
3297
  }) })]
3206
3298
  }) : /* @__PURE__ */ Q("div", {
3207
- className: P("flex gap-2", c),
3208
- children: [i && /* @__PURE__ */ Q(p, {
3299
+ className: L("flex gap-2", c),
3300
+ children: [i && /* @__PURE__ */ Q(g, {
3209
3301
  variant: "outline",
3210
3302
  size: "sm",
3211
3303
  onClick: () => {
@@ -3213,33 +3305,33 @@ var hn = ({ objectName: e, relationshipField: t, fields: r, onCreateRecord: i, o
3213
3305
  },
3214
3306
  className: "gap-1.5",
3215
3307
  children: [
3216
- /* @__PURE__ */ Z(Ae, { className: "h-3.5 w-3.5" }),
3308
+ /* @__PURE__ */ Z(Me, { className: "h-3.5 w-3.5" }),
3217
3309
  "New ",
3218
3310
  e
3219
3311
  ]
3220
- }), a && /* @__PURE__ */ Q(p, {
3312
+ }), a && /* @__PURE__ */ Q(g, {
3221
3313
  variant: "outline",
3222
3314
  size: "sm",
3223
3315
  onClick: () => {
3224
3316
  f("link"), u(!0);
3225
3317
  },
3226
3318
  className: "gap-1.5",
3227
- children: [/* @__PURE__ */ Z(q, { className: "h-3.5 w-3.5" }), "Link Existing"]
3319
+ children: [/* @__PURE__ */ Z(xe, { className: "h-3.5 w-3.5" }), "Link Existing"]
3228
3320
  })]
3229
3321
  });
3230
3322
  };
3231
3323
  //#endregion
3232
3324
  //#region src/RichTextCommentInput.tsx
3233
- function gn(e) {
3325
+ function Cn(e) {
3234
3326
  let t = e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/```([\s\S]*?)```/g, "<pre class=\"bg-muted rounded p-2 text-xs font-mono my-1 overflow-x-auto\">$1</pre>").replace(/`([^`]+)`/g, "<code class=\"bg-muted rounded px-1 py-0.5 text-xs font-mono\">$1</code>").replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>").replace(/\*(.+?)\*/g, "<em>$1</em>").replace(/@(\w+)/g, "<span class=\"text-primary font-medium\">@$1</span>").replace(/^- (.+)$/gm, "<li class=\"ml-4 list-disc\">$1</li>").replace(/\n/g, "<br/>");
3235
3327
  return t = t.replace(/(<li[^>]*>.*?<\/li>(?:<br\/>)?)+/g, (e) => `<ul class="my-1">${e.replace(/<br\/>/g, "")}</ul>`), t;
3236
3328
  }
3237
- var _n = ({ value: e, onChange: t, onSubmit: r, mentionSuggestions: i = [], placeholder: a, className: o, disabled: s = !1 }) => {
3238
- let { t: c } = $(), [l, u] = n.useState(!1), [d, f] = n.useState(!1), [m, h] = n.useState(""), [g, _] = n.useState(0), v = n.useRef(null), y = n.useMemo(() => {
3239
- if (!m) return i;
3240
- let e = m.toLowerCase();
3329
+ var wn = ({ value: e, onChange: t, onSubmit: r, mentionSuggestions: i = [], placeholder: a, className: o, disabled: s = !1 }) => {
3330
+ let { t: c } = $(), [l, u] = n.useState(!1), [d, f] = n.useState(!1), [p, m] = n.useState(""), [h, _] = n.useState(0), v = n.useRef(null), y = n.useMemo(() => {
3331
+ if (!p) return i;
3332
+ let e = p.toLowerCase();
3241
3333
  return i.filter((t) => t.label.toLowerCase().includes(e));
3242
- }, [m, i]), b = n.useCallback((n, r = "") => {
3334
+ }, [p, i]), b = n.useCallback((n, r = "") => {
3243
3335
  let i = v.current;
3244
3336
  if (!i) return;
3245
3337
  let a = i.selectionStart, o = i.selectionEnd, s = e.slice(a, o);
@@ -3249,12 +3341,12 @@ var _n = ({ value: e, onChange: t, onSubmit: r, mentionSuggestions: i = [], plac
3249
3341
  i.setSelectionRange(e, e);
3250
3342
  });
3251
3343
  }, [e, t]), x = n.useCallback(() => b("**", "**"), [b]), S = n.useCallback(() => b("*", "*"), [b]), C = n.useCallback(() => b("\n- ", ""), [b]), w = n.useCallback(() => b("`", "`"), [b]), T = n.useCallback(() => {
3252
- b("@", ""), f(!0), h(""), _(0);
3344
+ b("@", ""), f(!0), m(""), _(0);
3253
3345
  }, [b]), E = n.useCallback((n) => {
3254
3346
  let r = v.current;
3255
3347
  if (!r) return;
3256
3348
  let i = r.selectionStart, a = e.slice(0, i).lastIndexOf("@");
3257
- a !== -1 && t(e.slice(0, a) + `@${n.label} ` + e.slice(i)), f(!1), h(""), requestAnimationFrame(() => r.focus());
3349
+ a !== -1 && t(e.slice(0, a) + `@${n.label} ` + e.slice(i)), f(!1), m(""), requestAnimationFrame(() => r.focus());
3258
3350
  }, [e, t]), D = n.useCallback((e) => {
3259
3351
  let n = e.target.value;
3260
3352
  t(n);
@@ -3262,7 +3354,7 @@ var _n = ({ value: e, onChange: t, onSubmit: r, mentionSuggestions: i = [], plac
3262
3354
  if (a !== -1) {
3263
3355
  let e = i.slice(a + 1), t = a > 0 ? i[a - 1] : " ";
3264
3356
  if (/\s/.test(t) && !/\s/.test(e)) {
3265
- f(!0), h(e), _(0);
3357
+ f(!0), m(e), _(0);
3266
3358
  return;
3267
3359
  }
3268
3360
  }
@@ -3278,7 +3370,7 @@ var _n = ({ value: e, onChange: t, onSubmit: r, mentionSuggestions: i = [], plac
3278
3370
  return;
3279
3371
  }
3280
3372
  if (e.key === "Enter" || e.key === "Tab") {
3281
- e.preventDefault(), E(y[g]);
3373
+ e.preventDefault(), E(y[h]);
3282
3374
  return;
3283
3375
  }
3284
3376
  if (e.key === "Escape") {
@@ -3290,25 +3382,25 @@ var _n = ({ value: e, onChange: t, onSubmit: r, mentionSuggestions: i = [], plac
3290
3382
  }, [
3291
3383
  d,
3292
3384
  y,
3293
- g,
3385
+ h,
3294
3386
  E,
3295
3387
  r
3296
3388
  ]);
3297
3389
  return /* @__PURE__ */ Q("div", {
3298
- className: P("border rounded-md", o),
3390
+ className: L("border rounded-md", o),
3299
3391
  children: [/* @__PURE__ */ Q("div", {
3300
3392
  className: "flex items-center gap-0.5 px-2 py-1.5 border-b bg-muted/30",
3301
3393
  children: [
3302
- /* @__PURE__ */ Z(p, {
3394
+ /* @__PURE__ */ Z(g, {
3303
3395
  variant: "ghost",
3304
3396
  size: "icon",
3305
3397
  className: "h-7 w-7",
3306
3398
  onClick: x,
3307
3399
  disabled: s || l,
3308
3400
  title: c("detail.bold"),
3309
- children: /* @__PURE__ */ Z(H, { className: "h-3.5 w-3.5" })
3401
+ children: /* @__PURE__ */ Z(W, { className: "h-3.5 w-3.5" })
3310
3402
  }),
3311
- /* @__PURE__ */ Z(p, {
3403
+ /* @__PURE__ */ Z(g, {
3312
3404
  variant: "ghost",
3313
3405
  size: "icon",
3314
3406
  className: "h-7 w-7",
@@ -3317,57 +3409,57 @@ var _n = ({ value: e, onChange: t, onSubmit: r, mentionSuggestions: i = [], plac
3317
3409
  title: c("detail.italic"),
3318
3410
  children: /* @__PURE__ */ Z(be, { className: "h-3.5 w-3.5" })
3319
3411
  }),
3320
- /* @__PURE__ */ Z(p, {
3412
+ /* @__PURE__ */ Z(g, {
3321
3413
  variant: "ghost",
3322
3414
  size: "icon",
3323
3415
  className: "h-7 w-7",
3324
3416
  onClick: C,
3325
3417
  disabled: s || l,
3326
3418
  title: c("detail.listFormat"),
3327
- children: /* @__PURE__ */ Z(xe, { className: "h-3.5 w-3.5" })
3419
+ children: /* @__PURE__ */ Z(Se, { className: "h-3.5 w-3.5" })
3328
3420
  }),
3329
- /* @__PURE__ */ Z(p, {
3421
+ /* @__PURE__ */ Z(g, {
3330
3422
  variant: "ghost",
3331
3423
  size: "icon",
3332
3424
  className: "h-7 w-7",
3333
3425
  onClick: w,
3334
3426
  disabled: s || l,
3335
3427
  title: c("detail.inlineCode"),
3336
- children: /* @__PURE__ */ Z(ue, { className: "h-3.5 w-3.5" })
3428
+ children: /* @__PURE__ */ Z(de, { className: "h-3.5 w-3.5" })
3337
3429
  }),
3338
- /* @__PURE__ */ Z(p, {
3430
+ /* @__PURE__ */ Z(g, {
3339
3431
  variant: "ghost",
3340
3432
  size: "icon",
3341
3433
  className: "h-7 w-7",
3342
3434
  onClick: T,
3343
3435
  disabled: s || l,
3344
3436
  title: c("detail.mentionSomeone"),
3345
- children: /* @__PURE__ */ Z(z, { className: "h-3.5 w-3.5" })
3437
+ children: /* @__PURE__ */ Z(U, { className: "h-3.5 w-3.5" })
3346
3438
  }),
3347
3439
  /* @__PURE__ */ Z("div", { className: "flex-1" }),
3348
- /* @__PURE__ */ Z(p, {
3440
+ /* @__PURE__ */ Z(g, {
3349
3441
  variant: "ghost",
3350
3442
  size: "icon",
3351
3443
  className: "h-7 w-7",
3352
3444
  onClick: () => u(!l),
3353
3445
  title: c(l ? "detail.edit" : "detail.preview"),
3354
- children: Z(l ? W : me, { className: "h-3.5 w-3.5" })
3446
+ children: Z(l ? pe : q, { className: "h-3.5 w-3.5" })
3355
3447
  }),
3356
- r && /* @__PURE__ */ Z(p, {
3448
+ r && /* @__PURE__ */ Z(g, {
3357
3449
  variant: "ghost",
3358
3450
  size: "icon",
3359
3451
  className: "h-7 w-7",
3360
3452
  onClick: r,
3361
3453
  disabled: s || !e.trim(),
3362
3454
  title: c("detail.submitComment"),
3363
- children: /* @__PURE__ */ Z(Y, { className: "h-3.5 w-3.5" })
3455
+ children: /* @__PURE__ */ Z(Le, { className: "h-3.5 w-3.5" })
3364
3456
  })
3365
3457
  ]
3366
3458
  }), /* @__PURE__ */ Z("div", {
3367
3459
  className: "relative",
3368
3460
  children: l ? /* @__PURE__ */ Z("div", {
3369
3461
  className: "min-h-[80px] px-3 py-2 text-sm prose prose-sm max-w-none",
3370
- dangerouslySetInnerHTML: { __html: gn(e) }
3462
+ dangerouslySetInnerHTML: { __html: Cn(e) }
3371
3463
  }) : /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z("textarea", {
3372
3464
  ref: v,
3373
3465
  className: "w-full min-h-[80px] px-3 py-2 text-sm bg-transparent resize-none focus:outline-none placeholder:text-muted-foreground",
@@ -3380,7 +3472,7 @@ var _n = ({ value: e, onChange: t, onSubmit: r, mentionSuggestions: i = [], plac
3380
3472
  className: "absolute left-2 bottom-full mb-1 w-56 bg-popover border rounded-md shadow-md z-50 max-h-40 overflow-y-auto",
3381
3473
  children: y.map((e, t) => /* @__PURE__ */ Q("button", {
3382
3474
  type: "button",
3383
- className: P("w-full text-left px-3 py-1.5 text-sm flex items-center gap-2 hover:bg-accent transition-colors", t === g && "bg-accent"),
3475
+ className: L("w-full text-left px-3 py-1.5 text-sm flex items-center gap-2 hover:bg-accent transition-colors", t === h && "bg-accent"),
3384
3476
  onMouseDown: (t) => {
3385
3477
  t.preventDefault(), E(e);
3386
3478
  },
@@ -3399,7 +3491,7 @@ var _n = ({ value: e, onChange: t, onSubmit: r, mentionSuggestions: i = [], plac
3399
3491
  };
3400
3492
  //#endregion
3401
3493
  //#region src/DiffView.tsx
3402
- function vn(e, t) {
3494
+ function Tn(e, t) {
3403
3495
  if (e == null) return ["(empty)"];
3404
3496
  switch (t) {
3405
3497
  case "json": try {
@@ -3418,7 +3510,7 @@ function vn(e, t) {
3418
3510
  default: return String(e).split("\n");
3419
3511
  }
3420
3512
  }
3421
- function yn(e, t) {
3513
+ function En(e, t) {
3422
3514
  let n = [], r = Math.max(e.length, t.length);
3423
3515
  for (let i = 0; i < r; i++) {
3424
3516
  let r = i < e.length ? e[i] : void 0, a = i < t.length ? t[i] : void 0;
@@ -3435,16 +3527,16 @@ function yn(e, t) {
3435
3527
  }
3436
3528
  return n;
3437
3529
  }
3438
- var bn = {
3530
+ var Dn = {
3439
3531
  added: "bg-green-50 text-green-800 dark:bg-green-950/30 dark:text-green-300",
3440
3532
  removed: "bg-red-50 text-red-800 dark:bg-red-950/30 dark:text-red-300",
3441
3533
  unchanged: "text-muted-foreground"
3442
- }, xn = {
3534
+ }, On = {
3443
3535
  added: "+",
3444
3536
  removed: "-",
3445
3537
  unchanged: " "
3446
- }, Sn = ({ oldValue: e, newValue: t, fieldName: r, fieldType: i = "string", mode: a = "unified", className: o }) => {
3447
- let { t: s } = $(), [c, l] = n.useState(a), u = n.useMemo(() => vn(e, i), [e, i]), d = n.useMemo(() => vn(t, i), [t, i]), f = n.useMemo(() => yn(u, d), [u, d]), v = f.some((e) => e.type !== "unchanged"), y = n.useMemo(() => {
3538
+ }, kn = ({ oldValue: e, newValue: t, fieldName: r, fieldType: i = "string", mode: a = "unified", className: o }) => {
3539
+ let { t: s } = $(), [c, l] = n.useState(a), u = n.useMemo(() => Tn(e, i), [e, i]), d = n.useMemo(() => Tn(t, i), [t, i]), f = n.useMemo(() => En(u, d), [u, d]), p = f.some((e) => e.type !== "unchanged"), m = n.useMemo(() => {
3448
3540
  if (c !== "side-by-side") return [];
3449
3541
  let e = [], t = 0;
3450
3542
  for (; t < f.length;) {
@@ -3469,43 +3561,43 @@ var bn = {
3469
3561
  }
3470
3562
  return e;
3471
3563
  }, [c, f]);
3472
- return /* @__PURE__ */ Q(m, {
3473
- className: P("overflow-hidden", o),
3474
- children: [/* @__PURE__ */ Z(g, {
3564
+ return /* @__PURE__ */ Q(_, {
3565
+ className: L("overflow-hidden", o),
3566
+ children: [/* @__PURE__ */ Z(y, {
3475
3567
  className: "pb-2",
3476
- children: /* @__PURE__ */ Q(_, {
3568
+ children: /* @__PURE__ */ Q(b, {
3477
3569
  className: "flex items-center justify-between text-sm",
3478
3570
  children: [/* @__PURE__ */ Z("span", {
3479
3571
  className: "font-medium",
3480
3572
  children: r
3481
3573
  }), /* @__PURE__ */ Q("div", {
3482
3574
  className: "flex items-center gap-1",
3483
- children: [/* @__PURE__ */ Z(p, {
3575
+ children: [/* @__PURE__ */ Z(g, {
3484
3576
  variant: c === "unified" ? "secondary" : "ghost",
3485
3577
  size: "icon",
3486
3578
  className: "h-7 w-7",
3487
3579
  onClick: () => l("unified"),
3488
3580
  title: s("detail.unifiedDiff"),
3489
- children: /* @__PURE__ */ Z(Ne, { className: "h-3.5 w-3.5" })
3490
- }), /* @__PURE__ */ Z(p, {
3581
+ children: /* @__PURE__ */ Z(Fe, { className: "h-3.5 w-3.5" })
3582
+ }), /* @__PURE__ */ Z(g, {
3491
3583
  variant: c === "side-by-side" ? "secondary" : "ghost",
3492
3584
  size: "icon",
3493
3585
  className: "h-7 w-7",
3494
3586
  onClick: () => l("side-by-side"),
3495
3587
  title: s("detail.sideBySideDiff"),
3496
- children: /* @__PURE__ */ Z(de, { className: "h-3.5 w-3.5" })
3588
+ children: /* @__PURE__ */ Z(K, { className: "h-3.5 w-3.5" })
3497
3589
  })]
3498
3590
  })]
3499
3591
  })
3500
- }), /* @__PURE__ */ Z(h, {
3592
+ }), /* @__PURE__ */ Z(v, {
3501
3593
  className: "p-0",
3502
- children: v ? c === "unified" ? /* @__PURE__ */ Z("div", {
3594
+ children: p ? c === "unified" ? /* @__PURE__ */ Z("div", {
3503
3595
  className: "font-mono text-xs overflow-x-auto",
3504
3596
  children: f.map((e, t) => /* @__PURE__ */ Q("div", {
3505
- className: P("px-4 py-0.5 whitespace-pre-wrap border-l-2", bn[e.type], e.type === "added" && "border-l-green-500", e.type === "removed" && "border-l-red-500", e.type === "unchanged" && "border-l-transparent"),
3597
+ className: L("px-4 py-0.5 whitespace-pre-wrap border-l-2", Dn[e.type], e.type === "added" && "border-l-green-500", e.type === "removed" && "border-l-red-500", e.type === "unchanged" && "border-l-transparent"),
3506
3598
  children: [/* @__PURE__ */ Z("span", {
3507
3599
  className: "select-none mr-2 inline-block w-3 text-center opacity-60",
3508
- children: xn[e.type]
3600
+ children: On[e.type]
3509
3601
  }), e.value]
3510
3602
  }, t))
3511
3603
  }) : /* @__PURE__ */ Z("div", {
@@ -3521,11 +3613,11 @@ var bn = {
3521
3613
  className: "px-3 py-1.5 text-xs font-medium text-muted-foreground bg-muted/50",
3522
3614
  children: s("detail.currentVersion")
3523
3615
  }),
3524
- y.map((e, t) => /* @__PURE__ */ Q(n.Fragment, { children: [/* @__PURE__ */ Z("div", {
3525
- className: P("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.left ? bn[e.left.type] : "bg-muted/20"),
3616
+ m.map((e, t) => /* @__PURE__ */ Q(n.Fragment, { children: [/* @__PURE__ */ Z("div", {
3617
+ className: L("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.left ? Dn[e.left.type] : "bg-muted/20"),
3526
3618
  children: e.left?.value ?? ""
3527
3619
  }), /* @__PURE__ */ Z("div", {
3528
- className: P("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.right ? bn[e.right.type] : "bg-muted/20"),
3620
+ className: L("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.right ? Dn[e.right.type] : "bg-muted/20"),
3529
3621
  children: e.right?.value ?? ""
3530
3622
  })] }, t))
3531
3623
  ]
@@ -3536,37 +3628,37 @@ var bn = {
3536
3628
  })
3537
3629
  })]
3538
3630
  });
3539
- }, Cn = ({ currentIndex: e, totalRecords: t, recordIds: r, onNavigate: i, onSearch: a, className: o }) => {
3540
- let { t: s } = $(), [c, l] = n.useState(""), [u, d] = n.useState(!1), f = n.useRef(null), m = e > 0, h = e > 0, g = e < t - 1, _ = e < t - 1, v = n.useCallback(() => {
3541
- m && i(r[0]);
3631
+ }, An = ({ currentIndex: e, totalRecords: t, recordIds: r, onNavigate: i, onSearch: a, className: o }) => {
3632
+ let { t: s } = $(), [c, l] = n.useState(""), [u, d] = n.useState(!1), f = n.useRef(null), p = e > 0, m = e > 0, h = e < t - 1, _ = e < t - 1, v = n.useCallback(() => {
3633
+ p && i(r[0]);
3542
3634
  }, [
3543
- m,
3635
+ p,
3544
3636
  i,
3545
3637
  r
3546
3638
  ]), y = n.useCallback(() => {
3547
- h && i(r[e - 1]);
3639
+ m && i(r[e - 1]);
3548
3640
  }, [
3549
- h,
3641
+ m,
3550
3642
  i,
3551
3643
  r,
3552
3644
  e
3553
3645
  ]), b = n.useCallback(() => {
3554
- g && i(r[e + 1]);
3646
+ h && i(r[e + 1]);
3555
3647
  }, [
3556
- g,
3648
+ h,
3557
3649
  i,
3558
3650
  r,
3559
3651
  e
3560
- ]), S = n.useCallback(() => {
3652
+ ]), x = n.useCallback(() => {
3561
3653
  _ && i(r[r.length - 1]);
3562
3654
  }, [
3563
3655
  _,
3564
3656
  i,
3565
3657
  r
3566
- ]), C = n.useCallback((e) => {
3658
+ ]), S = n.useCallback((e) => {
3567
3659
  let t = e.target.value;
3568
3660
  l(t), a?.(t);
3569
- }, [a]), w = n.useCallback(() => {
3661
+ }, [a]), C = n.useCallback(() => {
3570
3662
  d((e) => (e ? (l(""), a?.("")) : requestAnimationFrame(() => f.current?.focus()), !e));
3571
3663
  }, [a]);
3572
3664
  return n.useEffect(() => {
@@ -3579,16 +3671,16 @@ var bn = {
3579
3671
  }
3580
3672
  switch (t.key) {
3581
3673
  case "Home":
3582
- t.preventDefault(), m && i(r[0]);
3674
+ t.preventDefault(), p && i(r[0]);
3583
3675
  break;
3584
3676
  case "End":
3585
3677
  t.preventDefault(), _ && i(r[r.length - 1]);
3586
3678
  break;
3587
3679
  case "ArrowLeft":
3588
- t.preventDefault(), h && i(r[e - 1]);
3680
+ t.preventDefault(), m && i(r[e - 1]);
3589
3681
  break;
3590
3682
  case "ArrowRight":
3591
- t.preventDefault(), g && i(r[e + 1]);
3683
+ t.preventDefault(), h && i(r[e + 1]);
3592
3684
  break;
3593
3685
  }
3594
3686
  }
@@ -3597,32 +3689,32 @@ var bn = {
3597
3689
  }, [
3598
3690
  e,
3599
3691
  r,
3692
+ p,
3600
3693
  m,
3601
3694
  h,
3602
- g,
3603
3695
  _,
3604
3696
  i,
3605
3697
  a
3606
3698
  ]), /* @__PURE__ */ Q("div", {
3607
- className: P("flex items-center gap-1.5", o),
3699
+ className: L("flex items-center gap-1.5", o),
3608
3700
  children: [
3609
- /* @__PURE__ */ Z(p, {
3701
+ /* @__PURE__ */ Z(g, {
3610
3702
  variant: "outline",
3611
3703
  size: "icon",
3612
3704
  className: "h-8 w-8",
3613
- disabled: !m,
3705
+ disabled: !p,
3614
3706
  onClick: v,
3615
3707
  title: s("detail.firstRecord"),
3616
- children: /* @__PURE__ */ Z(ce, { className: "h-4 w-4" })
3708
+ children: /* @__PURE__ */ Z(le, { className: "h-4 w-4" })
3617
3709
  }),
3618
- /* @__PURE__ */ Z(p, {
3710
+ /* @__PURE__ */ Z(g, {
3619
3711
  variant: "outline",
3620
3712
  size: "icon",
3621
3713
  className: "h-8 w-8",
3622
- disabled: !h,
3714
+ disabled: !m,
3623
3715
  onClick: y,
3624
3716
  title: s("detail.previousRecordKey"),
3625
- children: /* @__PURE__ */ Z(oe, { className: "h-4 w-4" })
3717
+ children: /* @__PURE__ */ Z(ce, { className: "h-4 w-4" })
3626
3718
  }),
3627
3719
  /* @__PURE__ */ Z("span", {
3628
3720
  className: "text-xs text-muted-foreground whitespace-nowrap px-1.5 tabular-nums",
@@ -3631,56 +3723,56 @@ var bn = {
3631
3723
  total: t
3632
3724
  }) : s("detail.noRecords")
3633
3725
  }),
3634
- /* @__PURE__ */ Z(p, {
3726
+ /* @__PURE__ */ Z(g, {
3635
3727
  variant: "outline",
3636
3728
  size: "icon",
3637
3729
  className: "h-8 w-8",
3638
- disabled: !g,
3730
+ disabled: !h,
3639
3731
  onClick: b,
3640
3732
  title: s("detail.nextRecordKey"),
3641
- children: /* @__PURE__ */ Z(se, { className: "h-4 w-4" })
3733
+ children: /* @__PURE__ */ Z(G, { className: "h-4 w-4" })
3642
3734
  }),
3643
- /* @__PURE__ */ Z(p, {
3735
+ /* @__PURE__ */ Z(g, {
3644
3736
  variant: "outline",
3645
3737
  size: "icon",
3646
3738
  className: "h-8 w-8",
3647
3739
  disabled: !_,
3648
- onClick: S,
3740
+ onClick: x,
3649
3741
  title: s("detail.lastRecord"),
3650
- children: /* @__PURE__ */ Z(le, { className: "h-4 w-4" })
3742
+ children: /* @__PURE__ */ Z(ue, { className: "h-4 w-4" })
3651
3743
  }),
3652
- a && /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z(p, {
3744
+ a && /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z(g, {
3653
3745
  variant: u ? "secondary" : "ghost",
3654
3746
  size: "icon",
3655
3747
  className: "h-8 w-8",
3656
- onClick: w,
3748
+ onClick: C,
3657
3749
  title: s("detail.searchWhileNavigating"),
3658
- children: /* @__PURE__ */ Z(Pe, { className: "h-4 w-4" })
3750
+ children: /* @__PURE__ */ Z(Ie, { className: "h-4 w-4" })
3659
3751
  }), u && /* @__PURE__ */ Z("div", {
3660
3752
  className: "relative",
3661
- children: /* @__PURE__ */ Z(x, {
3753
+ children: /* @__PURE__ */ Z(w, {
3662
3754
  ref: f,
3663
3755
  type: "text",
3664
3756
  placeholder: s("detail.searchRecords"),
3665
3757
  value: c,
3666
- onChange: C,
3758
+ onChange: S,
3667
3759
  className: "h-8 w-48 text-sm"
3668
3760
  })
3669
3761
  })] })
3670
3762
  ]
3671
3763
  });
3672
- }, wn = 28, Tn = [
3764
+ }, jn = 28, Mn = [
3673
3765
  "fill-primary stroke-primary",
3674
3766
  "fill-blue-500 stroke-blue-500",
3675
3767
  "fill-emerald-500 stroke-emerald-500",
3676
3768
  "fill-amber-500 stroke-amber-500"
3677
- ], En = [
3769
+ ], Nn = [
3678
3770
  "fill-primary-foreground",
3679
3771
  "fill-white",
3680
3772
  "fill-white",
3681
3773
  "fill-white"
3682
3774
  ];
3683
- function Dn(e, t, n, r, i) {
3775
+ function Pn(e, t, n, r, i) {
3684
3776
  let a = [], o = [], s = /* @__PURE__ */ new Set(), c = r / 2, l = i / 2;
3685
3777
  a.push({
3686
3778
  id: e.id,
@@ -3744,10 +3836,10 @@ function Dn(e, t, n, r, i) {
3744
3836
  edges: o
3745
3837
  };
3746
3838
  }
3747
- function On(e, t = 6) {
3839
+ function Fn(e, t = 6) {
3748
3840
  return e.length <= t ? e : e.slice(0, t - 1) + "…";
3749
3841
  }
3750
- var kn = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, className: a }) => {
3842
+ var In = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, className: a }) => {
3751
3843
  let o = n.useRef(null), [s, c] = n.useState({
3752
3844
  width: 500,
3753
3845
  height: 400
@@ -3768,20 +3860,20 @@ var kn = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, classNa
3768
3860
  });
3769
3861
  return n.observe(t), () => n.disconnect();
3770
3862
  }, []);
3771
- let { nodes: d, edges: f } = n.useMemo(() => Dn(e, t, r, s.width, s.height), [
3863
+ let { nodes: d, edges: f } = n.useMemo(() => Pn(e, t, r, s.width, s.height), [
3772
3864
  e,
3773
3865
  t,
3774
3866
  r,
3775
3867
  s
3776
3868
  ]);
3777
- return /* @__PURE__ */ Q(m, {
3778
- className: P("overflow-hidden", a),
3779
- children: [/* @__PURE__ */ Z(g, {
3869
+ return /* @__PURE__ */ Q(_, {
3870
+ className: L("overflow-hidden", a),
3871
+ children: [/* @__PURE__ */ Z(y, {
3780
3872
  className: "pb-2",
3781
- children: /* @__PURE__ */ Q(_, {
3873
+ children: /* @__PURE__ */ Q(b, {
3782
3874
  className: "flex items-center gap-2 text-base",
3783
3875
  children: [
3784
- /* @__PURE__ */ Z(we, { className: "h-4 w-4" }),
3876
+ /* @__PURE__ */ Z(Ee, { className: "h-4 w-4" }),
3785
3877
  "Relationships",
3786
3878
  /* @__PURE__ */ Q("span", {
3787
3879
  className: "text-sm font-normal text-muted-foreground",
@@ -3793,7 +3885,7 @@ var kn = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, classNa
3793
3885
  })
3794
3886
  ]
3795
3887
  })
3796
- }), /* @__PURE__ */ Z(h, {
3888
+ }), /* @__PURE__ */ Z(v, {
3797
3889
  className: "p-0",
3798
3890
  children: /* @__PURE__ */ Q("svg", {
3799
3891
  ref: o,
@@ -3810,9 +3902,9 @@ var kn = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, classNa
3810
3902
  strokeWidth: 1.5,
3811
3903
  strokeOpacity: .5
3812
3904
  }, `edge-${t}`)), d.map((e) => {
3813
- let t = l === e.id, n = Tn[Math.min(e.level, Tn.length - 1)], r = En[Math.min(e.level, En.length - 1)], a = e.level === 0 ? wn + 6 : wn;
3905
+ let t = l === e.id, n = Mn[Math.min(e.level, Mn.length - 1)], r = Nn[Math.min(e.level, Nn.length - 1)], a = e.level === 0 ? jn + 6 : jn;
3814
3906
  return /* @__PURE__ */ Q("g", {
3815
- className: P("cursor-pointer transition-transform", i && "hover:opacity-80"),
3907
+ className: L("cursor-pointer transition-transform", i && "hover:opacity-80"),
3816
3908
  onClick: () => i?.(e.id),
3817
3909
  onMouseEnter: () => u(e.id),
3818
3910
  onMouseLeave: () => u(null),
@@ -3831,8 +3923,8 @@ var kn = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, classNa
3831
3923
  y: e.y,
3832
3924
  textAnchor: "middle",
3833
3925
  dominantBaseline: "central",
3834
- className: P("text-[10px] font-medium pointer-events-none", r),
3835
- children: On(e.label)
3926
+ className: L("text-[10px] font-medium pointer-events-none", r),
3927
+ children: Fn(e.label)
3836
3928
  }),
3837
3929
  e.type && /* @__PURE__ */ Z("text", {
3838
3930
  x: e.x,
@@ -3866,29 +3958,29 @@ var kn = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, classNa
3866
3958
  };
3867
3959
  //#endregion
3868
3960
  //#region src/CommentAttachment.tsx
3869
- function An(e) {
3961
+ function Ln(e) {
3870
3962
  return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
3871
3963
  }
3872
- function jn(e) {
3964
+ function Rn(e) {
3873
3965
  return e.startsWith("image/");
3874
3966
  }
3875
- function Mn(e) {
3876
- return jn(e) ? ve : e.includes("pdf") || e.includes("document") || e.includes("text") ? _e : e.includes("zip") || e.includes("archive") || e.includes("compressed") ? ge : he;
3967
+ function zn(e) {
3968
+ return Rn(e) ? Y : e.includes("pdf") || e.includes("document") || e.includes("text") ? _e : e.includes("zip") || e.includes("archive") || e.includes("compressed") ? ge : J;
3877
3969
  }
3878
- var Nn = ({ attachments: e, onUpload: t, onRemove: r, className: i, readOnly: a = !1 }) => {
3970
+ var Bn = ({ attachments: e, onUpload: t, onRemove: r, className: i, readOnly: a = !1 }) => {
3879
3971
  let { t: o } = $(), [s, c] = n.useState(!1), l = n.useRef(null), u = n.useCallback((e) => {
3880
3972
  e.preventDefault(), e.stopPropagation(), c(!0);
3881
3973
  }, []), d = n.useCallback((e) => {
3882
3974
  e.preventDefault(), e.stopPropagation(), c(!1);
3883
3975
  }, []), f = n.useCallback((e) => {
3884
3976
  e.preventDefault(), e.stopPropagation(), c(!1), t && e.dataTransfer.files.length > 0 && t(e.dataTransfer.files);
3885
- }, [t]), m = n.useCallback((e) => {
3977
+ }, [t]), p = n.useCallback((e) => {
3886
3978
  t && e.target.files && e.target.files.length > 0 && (t(e.target.files), e.target.value = "");
3887
3979
  }, [t]);
3888
3980
  return /* @__PURE__ */ Q("div", {
3889
- className: P("space-y-2", i),
3981
+ className: L("space-y-2", i),
3890
3982
  children: [t && !a && /* @__PURE__ */ Q("div", {
3891
- className: P("border-2 border-dashed rounded-md px-4 py-3 text-center transition-colors cursor-pointer", s ? "border-primary bg-primary/5" : "border-muted-foreground/25 hover:border-muted-foreground/40"),
3983
+ className: L("border-2 border-dashed rounded-md px-4 py-3 text-center transition-colors cursor-pointer", s ? "border-primary bg-primary/5" : "border-muted-foreground/25 hover:border-muted-foreground/40"),
3892
3984
  onDragOver: u,
3893
3985
  onDragLeave: d,
3894
3986
  onDrop: f,
@@ -3899,7 +3991,7 @@ var Nn = ({ attachments: e, onUpload: t, onRemove: r, className: i, readOnly: a
3899
3991
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), l.current?.click());
3900
3992
  },
3901
3993
  children: [
3902
- /* @__PURE__ */ Z(Re, { className: "h-5 w-5 mx-auto text-muted-foreground mb-1" }),
3994
+ /* @__PURE__ */ Z(Ve, { className: "h-5 w-5 mx-auto text-muted-foreground mb-1" }),
3903
3995
  /* @__PURE__ */ Z("p", {
3904
3996
  className: "text-xs text-muted-foreground",
3905
3997
  children: o("detail.dropFilesToUpload")
@@ -3909,18 +4001,18 @@ var Nn = ({ attachments: e, onUpload: t, onRemove: r, className: i, readOnly: a
3909
4001
  type: "file",
3910
4002
  multiple: !0,
3911
4003
  className: "hidden",
3912
- onChange: m
4004
+ onChange: p
3913
4005
  })
3914
4006
  ]
3915
4007
  }), e.length > 0 && /* @__PURE__ */ Q("div", {
3916
4008
  className: "space-y-1.5",
3917
4009
  children: [/* @__PURE__ */ Q("div", {
3918
4010
  className: "flex items-center gap-1.5 text-xs text-muted-foreground",
3919
- children: [/* @__PURE__ */ Z(De, { className: "h-3 w-3" }), /* @__PURE__ */ Z("span", { children: e.length === 1 ? o("detail.attachmentCount", { count: e.length }) : o("detail.attachmentCountPlural", { count: e.length }) })]
4011
+ children: [/* @__PURE__ */ Z(ke, { className: "h-3 w-3" }), /* @__PURE__ */ Z("span", { children: e.length === 1 ? o("detail.attachmentCount", { count: e.length }) : o("detail.attachmentCountPlural", { count: e.length }) })]
3920
4012
  }), /* @__PURE__ */ Z("div", {
3921
4013
  className: "grid grid-cols-1 sm:grid-cols-2 gap-2",
3922
4014
  children: e.map((e) => {
3923
- let t = jn(e.type), n = Mn(e.type);
4015
+ let t = Rn(e.type), n = zn(e.type);
3924
4016
  return /* @__PURE__ */ Q("div", {
3925
4017
  className: "flex items-center gap-2 rounded-md border px-2.5 py-2 bg-muted/30 group",
3926
4018
  children: [
@@ -3939,16 +4031,16 @@ var Nn = ({ attachments: e, onUpload: t, onRemove: r, className: i, readOnly: a
3939
4031
  children: e.name
3940
4032
  }), /* @__PURE__ */ Z("p", {
3941
4033
  className: "text-[10px] text-muted-foreground",
3942
- children: An(e.size)
4034
+ children: Ln(e.size)
3943
4035
  })]
3944
4036
  }),
3945
- r && !a && /* @__PURE__ */ Z(p, {
4037
+ r && !a && /* @__PURE__ */ Z(g, {
3946
4038
  variant: "ghost",
3947
4039
  size: "icon",
3948
4040
  className: "h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",
3949
4041
  onClick: () => r(e.id),
3950
4042
  title: o("detail.removeAttachment"),
3951
- children: /* @__PURE__ */ Z(ze, { className: "h-3.5 w-3.5" })
4043
+ children: /* @__PURE__ */ Z(He, { className: "h-3.5 w-3.5" })
3952
4044
  })
3953
4045
  ]
3954
4046
  }, e.id);
@@ -3959,7 +4051,7 @@ var Nn = ({ attachments: e, onUpload: t, onRemove: r, className: i, readOnly: a
3959
4051
  };
3960
4052
  //#endregion
3961
4053
  //#region src/PointInTimeRestore.tsx
3962
- function Pn(e) {
4054
+ function Vn(e) {
3963
4055
  try {
3964
4056
  let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
3965
4057
  if (r < 1) return "just now";
@@ -3970,7 +4062,7 @@ function Pn(e) {
3970
4062
  return e;
3971
4063
  }
3972
4064
  }
3973
- var Fn = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
4065
+ var Hn = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
3974
4066
  let [a, o] = n.useState(null), [s, c] = n.useState(!1), [l, u] = n.useState(!1), d = n.useMemo(() => t.find((e) => e.id === a) ?? null, [t, a]), f = n.useCallback(async () => {
3975
4067
  if (!(!d || !r)) {
3976
4068
  if (!s) {
@@ -3989,17 +4081,17 @@ var Fn = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
3989
4081
  d,
3990
4082
  r,
3991
4083
  s
3992
- ]), v = n.useCallback(() => {
4084
+ ]), p = n.useCallback(() => {
3993
4085
  c(!1);
3994
4086
  }, []);
3995
- return /* @__PURE__ */ Q(m, {
3996
- className: P("", i),
3997
- children: [/* @__PURE__ */ Z(g, {
4087
+ return /* @__PURE__ */ Q(_, {
4088
+ className: L("", i),
4089
+ children: [/* @__PURE__ */ Z(y, {
3998
4090
  className: "pb-3",
3999
- children: /* @__PURE__ */ Q(_, {
4091
+ children: /* @__PURE__ */ Q(b, {
4000
4092
  className: "flex items-center gap-2 text-base",
4001
4093
  children: [
4002
- /* @__PURE__ */ Z(K, { className: "h-4 w-4" }),
4094
+ /* @__PURE__ */ Z(ve, { className: "h-4 w-4" }),
4003
4095
  "Revision History",
4004
4096
  /* @__PURE__ */ Q("span", {
4005
4097
  className: "text-sm font-normal text-muted-foreground",
@@ -4011,7 +4103,7 @@ var Fn = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
4011
4103
  })
4012
4104
  ]
4013
4105
  })
4014
- }), /* @__PURE__ */ Z(h, { children: t.length === 0 ? /* @__PURE__ */ Z("p", {
4106
+ }), /* @__PURE__ */ Z(v, { children: t.length === 0 ? /* @__PURE__ */ Z("p", {
4015
4107
  className: "text-sm text-muted-foreground text-center py-4",
4016
4108
  children: "No revisions recorded"
4017
4109
  }) : /* @__PURE__ */ Q("div", {
@@ -4026,13 +4118,13 @@ var Fn = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
4026
4118
  let t = e.id === a;
4027
4119
  return /* @__PURE__ */ Q("button", {
4028
4120
  type: "button",
4029
- className: P("w-full text-left flex items-start gap-3 py-2 px-2 rounded-md transition-colors relative", t ? "bg-accent" : "hover:bg-accent/50"),
4121
+ className: L("w-full text-left flex items-start gap-3 py-2 px-2 rounded-md transition-colors relative", t ? "bg-accent" : "hover:bg-accent/50"),
4030
4122
  onClick: () => {
4031
4123
  o(e.id), c(!1);
4032
4124
  },
4033
4125
  children: [/* @__PURE__ */ Z("div", {
4034
- className: P("shrink-0 h-6 w-6 rounded-full border-2 flex items-center justify-center z-10 mt-0.5", t ? "border-primary bg-primary" : "border-border bg-background"),
4035
- children: t && /* @__PURE__ */ Z(se, { className: "h-3 w-3 text-primary-foreground" })
4126
+ className: L("shrink-0 h-6 w-6 rounded-full border-2 flex items-center justify-center z-10 mt-0.5", t ? "border-primary bg-primary" : "border-border bg-background"),
4127
+ children: t && /* @__PURE__ */ Z(G, { className: "h-3 w-3 text-primary-foreground" })
4036
4128
  }), /* @__PURE__ */ Q("div", {
4037
4129
  className: "flex-1 min-w-0",
4038
4130
  children: [/* @__PURE__ */ Q("div", {
@@ -4042,7 +4134,7 @@ var Fn = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
4042
4134
  children: e.user
4043
4135
  }), /* @__PURE__ */ Z("span", {
4044
4136
  className: "text-xs text-muted-foreground",
4045
- children: Pn(e.timestamp)
4137
+ children: Vn(e.timestamp)
4046
4138
  })]
4047
4139
  }), /* @__PURE__ */ Q("p", {
4048
4140
  className: "text-xs text-muted-foreground mt-0.5",
@@ -4064,7 +4156,7 @@ var Fn = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
4064
4156
  children: [
4065
4157
  /* @__PURE__ */ Q("div", {
4066
4158
  className: "flex items-center gap-2 text-sm font-medium",
4067
- children: [/* @__PURE__ */ Z(me, { className: "h-4 w-4 text-muted-foreground" }), "Revision Preview"]
4159
+ children: [/* @__PURE__ */ Z(q, { className: "h-4 w-4 text-muted-foreground" }), "Revision Preview"]
4068
4160
  }),
4069
4161
  /* @__PURE__ */ Z("div", {
4070
4162
  className: "space-y-2",
@@ -4080,7 +4172,7 @@ var Fn = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
4080
4172
  className: "line-through text-red-600 dark:text-red-400 truncate max-w-[120px]",
4081
4173
  children: e.oldValue == null ? "(empty)" : String(e.oldValue)
4082
4174
  }),
4083
- /* @__PURE__ */ Z(se, { className: "h-3 w-3 text-muted-foreground shrink-0" }),
4175
+ /* @__PURE__ */ Z(G, { className: "h-3 w-3 text-muted-foreground shrink-0" }),
4084
4176
  /* @__PURE__ */ Z("span", {
4085
4177
  className: "text-green-600 dark:text-green-400 truncate max-w-[120px]",
4086
4178
  children: e.newValue == null ? "(empty)" : String(e.newValue)
@@ -4115,38 +4207,38 @@ var Fn = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
4115
4207
  children: [
4116
4208
  "This will restore the record to its state at",
4117
4209
  " ",
4118
- Pn(d.timestamp),
4210
+ Vn(d.timestamp),
4119
4211
  ". Continue?"
4120
4212
  ]
4121
4213
  }), /* @__PURE__ */ Q("div", {
4122
4214
  className: "flex gap-2",
4123
- children: [/* @__PURE__ */ Q(p, {
4215
+ children: [/* @__PURE__ */ Q(g, {
4124
4216
  variant: "destructive",
4125
4217
  size: "sm",
4126
4218
  className: "gap-1.5 flex-1",
4127
4219
  onClick: f,
4128
4220
  disabled: l,
4129
- children: [/* @__PURE__ */ Z(Me, { className: "h-3.5 w-3.5" }), l ? "Restoring…" : "Confirm Restore"]
4130
- }), /* @__PURE__ */ Z(p, {
4221
+ children: [/* @__PURE__ */ Z(Pe, { className: "h-3.5 w-3.5" }), l ? "Restoring…" : "Confirm Restore"]
4222
+ }), /* @__PURE__ */ Z(g, {
4131
4223
  variant: "ghost",
4132
4224
  size: "sm",
4133
- onClick: v,
4225
+ onClick: p,
4134
4226
  disabled: l,
4135
4227
  children: "Cancel"
4136
4228
  })]
4137
- })] }) : /* @__PURE__ */ Q(p, {
4229
+ })] }) : /* @__PURE__ */ Q(g, {
4138
4230
  variant: "outline",
4139
4231
  size: "sm",
4140
4232
  className: "w-full gap-1.5",
4141
4233
  onClick: f,
4142
- children: [/* @__PURE__ */ Z(Me, { className: "h-3.5 w-3.5" }), "Restore to this point"]
4234
+ children: [/* @__PURE__ */ Z(Pe, { className: "h-3.5 w-3.5" }), "Restore to this point"]
4143
4235
  })
4144
4236
  })
4145
4237
  ]
4146
4238
  })]
4147
4239
  }) })]
4148
4240
  });
4149
- }, In = ({ onSubmit: e, placeholder: t = "Leave a comment…", disabled: r = !1, className: i }) => {
4241
+ }, Un = ({ onSubmit: e, placeholder: t = "Leave a comment…", disabled: r = !1, className: i }) => {
4150
4242
  let [a, o] = n.useState(""), [s, c] = n.useState(!1), l = n.useCallback(async () => {
4151
4243
  let t = a.trim();
4152
4244
  if (t) {
@@ -4161,7 +4253,7 @@ var Fn = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
4161
4253
  e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), l());
4162
4254
  }, [l]);
4163
4255
  return /* @__PURE__ */ Q("div", {
4164
- className: P("flex gap-2", i),
4256
+ className: L("flex gap-2", i),
4165
4257
  children: [/* @__PURE__ */ Z("textarea", {
4166
4258
  className: "flex-1 min-h-[60px] rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring resize-none",
4167
4259
  placeholder: t,
@@ -4169,31 +4261,31 @@ var Fn = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
4169
4261
  onChange: (e) => o(e.target.value),
4170
4262
  onKeyDown: u,
4171
4263
  disabled: r || s
4172
- }), /* @__PURE__ */ Z(p, {
4264
+ }), /* @__PURE__ */ Z(g, {
4173
4265
  size: "icon",
4174
4266
  variant: "default",
4175
4267
  onClick: l,
4176
4268
  disabled: !a.trim() || s || r,
4177
4269
  className: "shrink-0 self-end",
4178
4270
  "aria-label": "Submit comment",
4179
- children: /* @__PURE__ */ Z(Y, { className: "h-4 w-4" })
4271
+ children: /* @__PURE__ */ Z(Le, { className: "h-4 w-4" })
4180
4272
  })]
4181
4273
  });
4182
- }, Ln = ({ query: e, suggestions: t, onSelect: r, visible: i = !0, activeIndex: a = 0, className: o }) => {
4274
+ }, Wn = ({ query: e, suggestions: t, onSelect: r, visible: i = !0, activeIndex: a = 0, className: o }) => {
4183
4275
  let s = n.useMemo(() => {
4184
4276
  if (!e) return t;
4185
4277
  let n = e.toLowerCase();
4186
4278
  return t.filter((e) => e.name.toLowerCase().includes(n) || e.id.toLowerCase().includes(n));
4187
4279
  }, [e, t]);
4188
4280
  return !i || s.length === 0 ? null : /* @__PURE__ */ Z("div", {
4189
- className: P("bg-popover border rounded-md shadow-md z-50 max-h-48 overflow-y-auto w-56", o),
4281
+ className: L("bg-popover border rounded-md shadow-md z-50 max-h-48 overflow-y-auto w-56", o),
4190
4282
  role: "listbox",
4191
4283
  "aria-label": "Mention suggestions",
4192
4284
  children: s.map((e, t) => /* @__PURE__ */ Q("button", {
4193
4285
  type: "button",
4194
4286
  role: "option",
4195
4287
  "aria-selected": t === a,
4196
- className: P("w-full text-left px-3 py-1.5 text-sm flex items-center gap-2 hover:bg-accent transition-colors", t === a && "bg-accent"),
4288
+ className: L("w-full text-left px-3 py-1.5 text-sm flex items-center gap-2 hover:bg-accent transition-colors", t === a && "bg-accent"),
4197
4289
  onMouseDown: (t) => {
4198
4290
  t.preventDefault(), r(e);
4199
4291
  },
@@ -4221,7 +4313,7 @@ var Fn = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
4221
4313
  }, e.id))
4222
4314
  });
4223
4315
  };
4224
- function Rn(e, t, n) {
4316
+ function Gn(e, t, n) {
4225
4317
  return {
4226
4318
  type: e.type,
4227
4319
  id: e.id,
@@ -4230,7 +4322,7 @@ function Rn(e, t, n) {
4230
4322
  length: n
4231
4323
  };
4232
4324
  }
4233
- e.register("detail-view", Nt, {
4325
+ e.register("detail-view", Bt, {
4234
4326
  namespace: "plugin-detail",
4235
4327
  label: "Detail View",
4236
4328
  category: "Views",
@@ -4360,7 +4452,7 @@ e.register("detail-view", Nt, {
4360
4452
  tabs: [],
4361
4453
  related: []
4362
4454
  }
4363
- }), e.register("detail-section", st, {
4455
+ }), e.register("detail-section", ut, {
4364
4456
  namespace: "plugin-detail",
4365
4457
  label: "Detail Section",
4366
4458
  category: "Detail Components",
@@ -4411,7 +4503,7 @@ e.register("detail-view", Nt, {
4411
4503
  label: "Header Color"
4412
4504
  }
4413
4505
  ]
4414
- }), e.register("related-list", ut, {
4506
+ }), e.register("related-list", pt, {
4415
4507
  namespace: "plugin-detail",
4416
4508
  label: "Related List",
4417
4509
  category: "Detail Components",
@@ -4458,7 +4550,7 @@ e.register("detail-view", Nt, {
4458
4550
  label: "Columns"
4459
4551
  }
4460
4552
  ]
4461
- }), e.register("detail", Nt, {
4553
+ }), e.register("detail", Bt, {
4462
4554
  namespace: "view",
4463
4555
  category: "view",
4464
4556
  label: "Detail",
@@ -4481,41 +4573,41 @@ e.register("detail-view", Nt, {
4481
4573
  label: "Fields"
4482
4574
  }
4483
4575
  ]
4484
- }), e.register("record:details", It, {
4576
+ }), e.register("record:details", Ut, {
4485
4577
  namespace: "record",
4486
4578
  category: "record",
4487
4579
  label: "Record Details",
4488
4580
  icon: "FileText"
4489
- }), e.register("record:related_list", zt, {
4581
+ }), e.register("record:related_list", Kt, {
4490
4582
  namespace: "record",
4491
4583
  category: "record",
4492
4584
  label: "Related List",
4493
4585
  icon: "List"
4494
- }), e.register("record:highlights", Vt, {
4586
+ }), e.register("record:highlights", Jt, {
4495
4587
  namespace: "record",
4496
4588
  category: "record",
4497
4589
  label: "Highlights Panel",
4498
4590
  icon: "Star"
4499
- }), e.register("record:activity", tn, {
4591
+ }), e.register("record:activity", ln, {
4500
4592
  namespace: "record",
4501
4593
  category: "record",
4502
4594
  label: "Activity Timeline",
4503
4595
  icon: "Activity"
4504
- }), e.register("record:chatter", an, {
4596
+ }), e.register("record:chatter", fn, {
4505
4597
  namespace: "record",
4506
4598
  category: "record",
4507
4599
  label: "Chatter Feed",
4508
4600
  icon: "MessageSquare"
4509
- }), e.register("record:path", sn, {
4601
+ }), e.register("record:path", mn, {
4510
4602
  namespace: "record",
4511
4603
  category: "record",
4512
4604
  label: "Path / Stepper",
4513
4605
  icon: "GitBranch"
4514
- }), e.register("record:quick_actions", ln, {
4606
+ }), e.register("record:quick_actions", gn, {
4515
4607
  namespace: "record",
4516
4608
  category: "record",
4517
4609
  label: "Quick Actions",
4518
4610
  icon: "Zap"
4519
4611
  });
4520
4612
  //#endregion
4521
- export { bt as ActivityTimeline, Nn as CommentAttachment, In as CommentInput, at as DETAIL_DEFAULT_TRANSLATIONS, st as DetailSection, ct as DetailTabs, Nt as DetailView, Sn as DiffView, Ht as FieldChangeItem, ft as HeaderHighlight, Ct as HistoryTimeline, hn as InlineCreateRelated, Ln as MentionAutocomplete, Fn as PointInTimeRestore, Wt as ReactionPicker, tn as RecordActivityRenderer, $t as RecordActivityTimeline, nn as RecordChatterPanel, an as RecordChatterRenderer, mt as RecordComments, pn as RecordDetailDrawer, It as RecordDetailsRenderer, Vt as RecordHighlightsRenderer, At as RecordMetaFooter, Cn as RecordNavigationEnhanced, sn as RecordPathRenderer, ln as RecordQuickActionsRenderer, zt as RecordRelatedListRenderer, ut as RelatedList, kn as RelationshipGraph, _n as RichTextCommentInput, dt as SectionGroup, qt as SubscriptionToggle, Kt as ThreadedReplies, nt as applyAutoSpan, rt as applyDetailAutoLayout, Rn as createMentionFromSuggestion, it as createSafeTranslationHook, mn as deriveRecordPageHref, tt as inferDetailColumns, et as isWideFieldType, $ as useDetailTranslation };
4613
+ export { Ct as ActivityTimeline, Bn as CommentAttachment, Un as CommentInput, ct as DETAIL_DEFAULT_TRANSLATIONS, ut as DetailSection, dt as DetailTabs, Bt as DetailView, kn as DiffView, Yt as FieldChangeItem, ht as HeaderHighlight, At as HistoryTimeline, Sn as InlineCreateRelated, Wn as MentionAutocomplete, Hn as PointInTimeRestore, Zt as ReactionPicker, ln as RecordActivityRenderer, sn as RecordActivityTimeline, un as RecordChatterPanel, fn as RecordChatterRenderer, _t as RecordComments, bn as RecordDetailDrawer, Ut as RecordDetailsRenderer, Jt as RecordHighlightsRenderer, Lt as RecordMetaFooter, An as RecordNavigationEnhanced, mn as RecordPathRenderer, gn as RecordQuickActionsRenderer, Kt as RecordRelatedListRenderer, pt as RelatedList, In as RelationshipGraph, wn as RichTextCommentInput, mt as SectionGroup, en as SubscriptionToggle, $t as ThreadedReplies, at as applyAutoSpan, ot as applyDetailAutoLayout, Gn as createMentionFromSuggestion, st as createSafeTranslationHook, xn as deriveRecordPageHref, it as inferDetailColumns, rt as isWideFieldType, $ as useDetailTranslation };