@nivaro/react 0.3.56 → 0.3.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +9 -2
  4. package/dist/shared/components/CollectionBrowserView.js +2827 -2750
  5. package/dist/shared/components/DataTable.js +247 -236
  6. package/dist/shared/components/ItemEditForm.js +1693 -1668
  7. package/dist/shared/components/ProfileView.js +716 -715
  8. package/dist/shared/components/RecordReadView.js +367 -364
  9. package/dist/shared/components/ReportView.js +64 -39
  10. package/dist/shared/components/alerts/AlertManagerView.js +284 -271
  11. package/dist/shared/components/cbv/row-focus.js +19 -0
  12. package/dist/shared/components/help-videos/HelpVideoPlayer.js +152 -147
  13. package/dist/shared/components/integrations/console/SignalCard.js +59 -59
  14. package/dist/shared/components/integrations/console/tone.js +52 -30
  15. package/dist/shared/components/item-edit/CatalogPickerField.js +525 -505
  16. package/dist/shared/components/item-edit/FieldRow.js +175 -173
  17. package/dist/shared/components/item-edit/InlineTableField.js +407 -402
  18. package/dist/shared/components/item-edit/M2MCombobox.js +313 -291
  19. package/dist/shared/components/item-edit/MidairCollisionDialog.js +1 -1
  20. package/dist/shared/components/item-edit/PlanGrid.js +826 -803
  21. package/dist/shared/components/item-edit/QuickCreateButton.js +115 -79
  22. package/dist/shared/components/item-edit/RecordLiveSync.js +77 -75
  23. package/dist/shared/components/item-edit/RelationCombobox.js +412 -328
  24. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +147 -125
  25. package/dist/shared/components/item-edit/SummaryPanel.js +406 -392
  26. package/dist/shared/components/item-edit/option-disambiguate.js +44 -32
  27. package/dist/shared/components/item-edit/related-missing.js +45 -0
  28. package/dist/shared/components/item-edit/save-outcome.js +5 -5
  29. package/dist/shared/components/notifications/NotificationRulesEditor.js +130 -123
  30. package/dist/shared/components/panels/AccessDeniedPanel.js +52 -48
  31. package/dist/shared/components/panels/ItemLockBanner.js +2 -3
  32. package/dist/shared/components/panels/PipelinePanel.js +1027 -978
  33. package/dist/shared/components/panels/RevisionsPanel.js +4 -1
  34. package/dist/shared/components/panels/TaskPanel.js +265 -249
  35. package/dist/shared/components/panels/landing-state.js +27 -0
  36. package/dist/shared/components/pipeline/PipelineEditorView.js +86 -78
  37. package/dist/shared/components/profile/AiMemoryCard.js +12 -10
  38. package/dist/shared/components/queue/OwnerAvatars.js +80 -41
  39. package/dist/shared/components/queue/QueueItemSheet.js +111 -111
  40. package/dist/shared/components/queue/QueueQuickFilters.js +48 -48
  41. package/dist/shared/components/queue/QueueWorklist.js +975 -964
  42. package/dist/shared/components/queue/group-sums.js +27 -0
  43. package/dist/shared/components/queue/live-state-aspect.js +7 -3
  44. package/dist/shared/components/queue/path-label.js +14 -0
  45. package/dist/shared/components/widgets/ReviewListWidget.js +186 -168
  46. package/dist/shared/lib/back-closes.js +25 -0
  47. package/dist/shared/lib/cbv-page-warm.js +36 -0
  48. package/dist/shared/lib/form-usage-beacon.js +7 -7
  49. package/dist/shared/lib/list-page-memory.js +41 -0
  50. package/dist/shared/lib/live.js +44 -44
  51. package/dist/shared/lib/own-writes.js +76 -28
  52. package/dist/shared/lib/record-ref.js +78 -53
  53. package/dist/shared/lib/request-gate.js +110 -109
  54. package/dist/shared/lib/validation-rules.js +34 -19
  55. package/package.json +1 -1
@@ -1,131 +1,121 @@
1
- import { jsx as n, jsxs as c } from "react/jsx-runtime";
2
- import { useQuery as w } from "@tanstack/react-query";
3
- import { ChevronDown as te, Loader2 as ae, AlertTriangle as ce, X as oe, Check as de } from "lucide-react";
4
- import { useState as ne, useRef as me, useEffect as ue } from "react";
5
- import { useNivaroClient as fe, useItemEditAuth as pe, useDrilldown as Ie } from "../../context.js";
6
- import { parseAllowedCollections as Ae } from "../../lib/allowed-collections.js";
7
- import { get as q } from "../../lib/commands.js";
8
- import { compareByMatch as he } from "../../lib/picker-rank.js";
9
- import { useRecordReader as Ke } from "../../lib/record-loader.js";
10
- import { useOnlineUsers as be } from "../../lib/use-online-users.js";
11
- import { cn as Q, userOptionFilter as ye } from "../../lib/utils.js";
12
- import { UserAvatar as xe } from "../UserAvatar.js";
13
- import { Command as ve, CommandInput as ge, CommandList as ke, CommandEmpty as we, CommandGroup as Ne, CommandItem as Se } from "../ui/command.js";
14
- import { Popover as _e, PopoverTrigger as qe, PopoverContent as Ce } from "../ui/popover.js";
15
- import { applyDisplayTemplate as Le } from "./helpers.js";
16
- import { useM2MStaging as je } from "./M2MStagingContext.js";
17
- import { useStaleTip as Je, RelatedItemLabel as ie } from "./RelationCombobox.js";
18
- function Fe(s) {
19
- return s.replace(/\(.*$/, "").trim().split(/\s+/).map((o) => o[0]).filter(Boolean).slice(0, 2).join("").toUpperCase() || "?";
1
+ import { jsx as l, jsxs as c } from "react/jsx-runtime";
2
+ import { useQuery as L } from "@tanstack/react-query";
3
+ import { ChevronDown as le, Loader2 as oe, AlertTriangle as de, X as ce, Check as ue } from "lucide-react";
4
+ import { useState as re, useRef as me, useEffect as fe } from "react";
5
+ import { useNivaroClient as pe, useItemEditAuth as he, useDrilldown as Je } from "../../context.js";
6
+ import { parseAllowedCollections as Pe } from "../../lib/allowed-collections.js";
7
+ import { get as U } from "../../lib/commands.js";
8
+ import { compareByMatch as be } from "../../lib/picker-rank.js";
9
+ import { useRecordReader as De } from "../../lib/record-loader.js";
10
+ import { useOnlineUsers as ye } from "../../lib/use-online-users.js";
11
+ import { cn as Q, userOptionFilter as xe, matchesAllTokens as Ee } from "../../lib/utils.js";
12
+ import { UserAvatar as ge } from "../UserAvatar.js";
13
+ import { Command as ve, CommandInput as ke, CommandList as Se, CommandEmpty as Ne, CommandGroup as we, CommandItem as _e } from "../ui/command.js";
14
+ import { Popover as Le, PopoverTrigger as qe, PopoverContent as Ce } from "../ui/popover.js";
15
+ import { applyDisplayTemplate as Oe } from "./helpers.js";
16
+ import { useM2MStaging as Fe } from "./M2MStagingContext.js";
17
+ import { useStaleTip as Re, RelatedItemLabel as ae } from "./RelationCombobox.js";
18
+ function je(n) {
19
+ return n.replace(/\(.*$/, "").trim().split(/\s+/).map((i) => i[0]).filter(Boolean).slice(0, 2).join("").toUpperCase() || "?";
20
20
  }
21
- function Te(s) {
22
- return Ae(s == null ? void 0 : s.one_allowed_collections);
21
+ function Te(n) {
22
+ return Pe(n == null ? void 0 : n.one_allowed_collections);
23
23
  }
24
- function Oe(s) {
25
- if (!s) return null;
26
- if (s.one_collection) return s.one_collection;
27
- const o = Te(s);
28
- return o.length === 0 ? null : o.some((N) => N === "directus_users" || N === "nivaro_users") ? "nivaro_users" : o[0];
24
+ function Ie(n) {
25
+ if (!n) return null;
26
+ if (n.one_collection) return n.one_collection;
27
+ const i = Te(n);
28
+ return i.length === 0 ? null : i.some((p) => p === "directus_users" || p === "nivaro_users") ? "nivaro_users" : i[0];
29
29
  }
30
- function nt(s) {
31
- if (!s || s.one_collection) return null;
32
- const o = Te(s);
33
- if (o.length === 0) return null;
34
- const N = o.includes("directus_users") ? "directus_users" : o.includes("nivaro_users") ? "nivaro_users" : o[0];
35
- return { field: s.one_collection_field ?? "collection", value: N };
30
+ function at(n) {
31
+ if (!n || n.one_collection) return null;
32
+ const i = Te(n);
33
+ if (i.length === 0) return null;
34
+ const p = i.includes("directus_users") ? "directus_users" : i.includes("nivaro_users") ? "nivaro_users" : i[0];
35
+ return { field: n.one_collection_field ?? "collection", value: p };
36
36
  }
37
- function lt({
38
- relation: s,
39
- parentId: o,
40
- allRelations: N,
41
- extraFilter: h,
42
- optionSort: b,
43
- requiredParent: K,
44
- onCountChange: J,
45
- drilldown: D
37
+ function ot({
38
+ relation: n,
39
+ parentId: i,
40
+ allRelations: p,
41
+ extraFilter: d,
42
+ optionSort: h,
43
+ requiredParent: S,
44
+ onCountChange: N,
45
+ drilldown: q
46
46
  }) {
47
- const y = fe(), W = Ie(), t = je(), [P, C] = ne(!1), [x, T] = ne(""), le = N.find(
48
- (e) => e.many_collection === s.many_collection && e.many_field === s.junction_field && e.id !== s.id
49
- ), r = Oe(le), v = s.junction_field ?? "", R = s.many_field ?? "", d = s.one_field ?? `${s.many_collection}.${v}`, { data: a } = w({
50
- queryKey: ["col-meta", r],
51
- queryFn: () => y.request(q(`/collections/${r}`)).then((e) => e.data),
52
- enabled: !!r,
47
+ const x = pe(), F = Je(), t = Fe(), [j, v] = re(!1), [y, C] = re(""), T = p.find(
48
+ (e) => e.many_collection === n.many_collection && e.many_field === n.junction_field && e.id !== n.id
49
+ ), s = Ie(T), w = n.junction_field ?? "", P = n.many_field ?? "", u = n.one_field ?? `${n.many_collection}.${w}`, { data: o } = L({
50
+ queryKey: ["col-meta", s],
51
+ queryFn: () => x.request(U(`/collections/${s}`)).then((e) => e.data),
52
+ enabled: !!s,
53
53
  staleTime: 3e5,
54
54
  retry: !1
55
- }), { data: X = [] } = w({
56
- queryKey: ["m2m-items", s.many_collection, R, o],
57
- queryFn: () => y.request(
58
- q(`/items/${s.many_collection}`, {
59
- filter: JSON.stringify({ [R]: { _eq: o } }),
55
+ }), { data: W = [] } = L({
56
+ queryKey: ["m2m-items", n.many_collection, P, i],
57
+ queryFn: () => x.request(
58
+ U(`/items/${n.many_collection}`, {
59
+ filter: JSON.stringify({ [P]: { _eq: i } }),
60
60
  limit: 200,
61
- fields: `id,${v}`
61
+ fields: `id,${w}`
62
62
  })
63
63
  ).then((e) => e.data ?? []),
64
64
  staleTime: 3e4,
65
- enabled: !!o && o !== "new"
66
- }), re = pe().isAdmin, z = r === "nivaro_users" ? ye(re) : null, E = be(r === "nivaro_users"), H = h ? z ? { _and: [h, z] } : h : z, L = H ? JSON.stringify(H) : void 0, g = b && !/^-?label$/.test(b) ? b : void 0, S = (() => {
67
- const e = a == null ? void 0 : a.display_template;
65
+ enabled: !!i && i !== "new"
66
+ }), ie = he().isAdmin, D = s === "nivaro_users" ? xe(ie) : null, E = ye(s === "nivaro_users"), X = d ? D ? { _and: [d, D] } : d : D, R = X ? JSON.stringify(X) : void 0, z = h && !/^-?label$/.test(h) ? h : void 0, H = (() => {
67
+ const e = o == null ? void 0 : o.display_template;
68
68
  if (!e || !e.includes(".")) return null;
69
- const i = [...e.matchAll(/\{\{([^}]+)\}\}/g)].map((u) => u[1].trim());
70
- return i.length === 0 ? null : ["id", ...i].join(",");
71
- })(), { data: O = [], isFetching: B } = w({
72
- queryKey: [
73
- "m2m-options",
74
- r,
75
- x,
76
- L,
77
- g ?? "",
78
- S ?? ""
79
- ],
80
- queryFn: () => y.request(
81
- q(`/items/${r}`, {
82
- limit: 200,
83
- search: x || void 0,
84
- filter: L,
85
- picker: "1",
86
- // A dotted display template ({{core_category.name}}) needs the
87
- // nested expansion — a bare row only carries the FK id.
88
- ...S ? { fields: S } : {},
89
- ...g ? { sort: g } : {}
90
- })
91
- ).then((e) => e.data ?? []),
92
- enabled: P && !!r,
93
- staleTime: L ? 0 : 3e4
94
- }), V = (t == null ? void 0 : t.getStagedLinks(d)) ?? [], k = (t == null ? void 0 : t.getStagedUnlinks(d)) ?? /* @__PURE__ */ new Set(), U = X.filter((e) => !k.has(e.id)), f = new Set(U.map((e) => String(e[v]))), _ = [...f], Y = JSON.stringify(h ? { _and: [{ id: { _in: _ } }, h] } : { id: { _in: _ } }), { data: m } = w({
95
- queryKey: ["m2m-avail", r, _.join(","), L],
96
- queryFn: () => y.request(
97
- q(`/items/${r}`, {
98
- filter: Y,
69
+ const a = [...e.matchAll(/\{\{([^}]+)\}\}/g)].map((f) => f[1].trim());
70
+ return a.length === 0 ? null : ["id", ...a].join(",");
71
+ })(), {
72
+ options: Y,
73
+ isLoading: M,
74
+ localSearch: B
75
+ } = Ue({
76
+ client: x,
77
+ relatedCollection: s,
78
+ search: y,
79
+ filterParam: R,
80
+ serverSort: z,
81
+ templateNestedFields: H,
82
+ enabled: j && !!s,
83
+ labelOf: k
84
+ }), Z = (t == null ? void 0 : t.getStagedLinks(u)) ?? [], _ = (t == null ? void 0 : t.getStagedUnlinks(u)) ?? /* @__PURE__ */ new Set(), A = W.filter((e) => !_.has(e.id)), g = new Set(A.map((e) => String(e[w]))), O = [...g], ee = JSON.stringify(d ? { _and: [{ id: { _in: O } }, d] } : { id: { _in: O } }), { data: m } = L({
85
+ queryKey: ["m2m-avail", s, O.join(","), R],
86
+ queryFn: () => x.request(
87
+ U(`/items/${s}`, {
88
+ filter: ee,
99
89
  picker: "1",
100
90
  limit: 200,
101
91
  fields: "id"
102
92
  })
103
93
  ).then((e) => e.data ?? []),
104
- enabled: !!r && _.length > 0,
94
+ enabled: !!s && O.length > 0,
105
95
  staleTime: 3e4
106
- }), Z = new Set((m ?? []).map((e) => String(e.id))), $ = m !== void 0 ? new Set(_.filter((e) => !Z.has(e))) : /* @__PURE__ */ new Set(), I = new Set(V.map(String)), A = /* @__PURE__ */ new Set([...f, ...I]), j = me(J);
107
- j.current = J, ue(() => {
96
+ }), te = new Set((m ?? []).map((e) => String(e.id))), $ = m !== void 0 ? new Set(O.filter((e) => !te.has(e))) : /* @__PURE__ */ new Set(), K = new Set(Z.map(String)), J = /* @__PURE__ */ new Set([...g, ...K]), I = me(N);
97
+ I.current = N, fe(() => {
108
98
  var e;
109
- (e = j.current) == null || e.call(j, A.size);
110
- }, [A.size]);
99
+ (e = I.current) == null || e.call(I, J.size);
100
+ }, [J.size]);
111
101
  function G(e) {
112
- const i = String(e);
113
- if (I.has(i)) {
114
- t == null || t.unstageLink(d, e);
102
+ const a = String(e);
103
+ if (K.has(a)) {
104
+ t == null || t.unstageLink(u, e);
115
105
  return;
116
106
  }
117
- const u = X.find((M) => String(M[v]) === i);
118
- if (u) {
119
- k.has(u.id) ? t == null || t.unstageUnlink(d, u.id) : t == null || t.stageUnlink(d, u.id);
107
+ const f = W.find((V) => String(V[w]) === a);
108
+ if (f) {
109
+ _.has(f.id) ? t == null || t.unstageUnlink(u, f.id) : t == null || t.stageUnlink(u, f.id);
120
110
  return;
121
111
  }
122
- t == null || t.stageLink(d, e);
112
+ t == null || t.stageLink(u, e);
123
113
  }
124
- function F(e) {
125
- const i = (a == null ? void 0 : a.display_template) ?? null;
126
- return i ? Le(i, e) : String(e._display ?? e.id ?? "");
114
+ function k(e) {
115
+ const a = (o == null ? void 0 : o.display_template) ?? null;
116
+ return a ? Oe(a, e) : String(e._display ?? e.id ?? "");
127
117
  }
128
- return K ? /* @__PURE__ */ c(
118
+ return S ? /* @__PURE__ */ c(
129
119
  "button",
130
120
  {
131
121
  type: "button",
@@ -134,31 +124,31 @@ function lt({
134
124
  children: [
135
125
  /* @__PURE__ */ c("span", { className: "truncate", children: [
136
126
  "Select ",
137
- K,
127
+ S,
138
128
  " first"
139
129
  ] }),
140
- /* @__PURE__ */ n(te, { className: "h-4 w-4 shrink-0 opacity-50" })
130
+ /* @__PURE__ */ l(le, { className: "h-4 w-4 shrink-0 opacity-50" })
141
131
  ]
142
132
  }
143
- ) : /* @__PURE__ */ n("div", { children: /* @__PURE__ */ c(
144
- _e,
133
+ ) : /* @__PURE__ */ l("div", { children: /* @__PURE__ */ c(
134
+ Le,
145
135
  {
146
- open: P,
136
+ open: j,
147
137
  onOpenChange: (e) => {
148
- C(e), e || T("");
138
+ v(e), e || C("");
149
139
  },
150
140
  children: [
151
- /* @__PURE__ */ n(qe, { asChild: !0, children: /* @__PURE__ */ c(
141
+ /* @__PURE__ */ l(qe, { asChild: !0, children: /* @__PURE__ */ c(
152
142
  "div",
153
143
  {
154
144
  role: "button",
155
145
  tabIndex: 0,
156
146
  onKeyDown: (e) => {
157
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), C((i) => !i));
147
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), v((a) => !a));
158
148
  },
159
149
  className: "flex min-h-9 w-full cursor-pointer items-center justify-between gap-2 rounded-md border border-input bg-background px-3 py-1 text-sm text-left font-normal hover:bg-muted",
160
150
  children: [
161
- A.size > 0 ? /* @__PURE__ */ c(
151
+ J.size > 0 ? /* @__PURE__ */ c(
162
152
  "span",
163
153
  {
164
154
  className: "flex min-w-0 flex-1 flex-wrap items-center gap-1",
@@ -166,55 +156,55 @@ function lt({
166
156
  e.target.closest("button") && e.stopPropagation();
167
157
  },
168
158
  children: [
169
- U.map((e) => {
170
- const i = e[v], u = $.has(String(i));
159
+ A.map((e) => {
160
+ const a = e[w], f = $.has(String(a));
171
161
  return /* @__PURE__ */ c(
172
162
  "span",
173
163
  {
174
- title: u ? "This record is no longer an available option" : void 0,
164
+ title: f ? "This record is no longer an available option" : void 0,
175
165
  className: Q(
176
166
  "inline-flex items-center gap-1 rounded-full border pl-2.5 pr-1.5 py-0.5 text-[12px]",
177
- u ? "border-amber-300 bg-amber-50 text-amber-700 dark:border-amber-600 dark:bg-amber-950/30 dark:text-amber-400" : "border-slate-200 bg-slate-50 text-slate-700 dark:border-border dark:bg-muted dark:text-slate-200"
167
+ f ? "border-amber-300 bg-amber-50 text-amber-700 dark:border-amber-600 dark:bg-amber-950/30 dark:text-amber-400" : "border-slate-200 bg-slate-50 text-slate-700 dark:border-border dark:bg-muted dark:text-slate-200"
178
168
  ),
179
169
  children: [
180
- u && /* @__PURE__ */ n(ce, { className: "h-3 w-3 shrink-0 text-amber-500" }),
181
- r && (D && W ? /* @__PURE__ */ n(
170
+ f && /* @__PURE__ */ l(de, { className: "h-3 w-3 shrink-0 text-amber-500" }),
171
+ s && (q && F ? /* @__PURE__ */ l(
182
172
  "button",
183
173
  {
184
174
  type: "button",
185
175
  title: "Open detail panel",
186
- onClick: () => W.open({
187
- collection: r,
188
- itemId: String(i),
189
- layoutId: D.layout_id,
190
- width: D.width
176
+ onClick: () => F.open({
177
+ collection: s,
178
+ itemId: String(a),
179
+ layoutId: q.layout_id,
180
+ width: q.width
191
181
  }),
192
182
  className: "underline decoration-slate-300 decoration-dotted underline-offset-2 hover:text-[#172940] hover:decoration-nvr-cyan dark:hover:text-nvr-cyan",
193
- children: /* @__PURE__ */ n(
194
- ie,
183
+ children: /* @__PURE__ */ l(
184
+ ae,
195
185
  {
196
- collection: r,
197
- id: i,
198
- displayTemplate: a == null ? void 0 : a.display_template
186
+ collection: s,
187
+ id: a,
188
+ displayTemplate: o == null ? void 0 : o.display_template
199
189
  }
200
190
  )
201
191
  }
202
- ) : /* @__PURE__ */ n(
203
- ie,
192
+ ) : /* @__PURE__ */ l(
193
+ ae,
204
194
  {
205
- collection: r,
206
- id: i,
207
- displayTemplate: a == null ? void 0 : a.display_template
195
+ collection: s,
196
+ id: a,
197
+ displayTemplate: o == null ? void 0 : o.display_template
208
198
  }
209
199
  )),
210
- /* @__PURE__ */ n(
200
+ /* @__PURE__ */ l(
211
201
  "button",
212
202
  {
213
203
  type: "button",
214
204
  "aria-label": "Remove",
215
- onClick: () => t == null ? void 0 : t.stageUnlink(d, e.id),
205
+ onClick: () => t == null ? void 0 : t.stageUnlink(u, e.id),
216
206
  className: "rounded-full p-0.5 text-slate-400 hover:text-red-500",
217
- children: /* @__PURE__ */ n(oe, { className: "h-3 w-3" })
207
+ children: /* @__PURE__ */ l(ce, { className: "h-3 w-3" })
218
208
  }
219
209
  )
220
210
  ]
@@ -222,27 +212,27 @@ function lt({
222
212
  String(e.id)
223
213
  );
224
214
  }),
225
- V.map((e) => /* @__PURE__ */ c(
215
+ Z.map((e) => /* @__PURE__ */ c(
226
216
  "span",
227
217
  {
228
218
  className: "inline-flex items-center gap-1 rounded-full border border-dashed border-nvr-cyan/50 bg-nvr-cyan/5 pl-2.5 pr-1.5 py-0.5 text-[12px] text-slate-600 dark:text-slate-300",
229
219
  children: [
230
- r ? /* @__PURE__ */ n(
231
- ie,
220
+ s ? /* @__PURE__ */ l(
221
+ ae,
232
222
  {
233
- collection: r,
223
+ collection: s,
234
224
  id: e,
235
- displayTemplate: a == null ? void 0 : a.display_template
225
+ displayTemplate: o == null ? void 0 : o.display_template
236
226
  }
237
227
  ) : String(e),
238
- /* @__PURE__ */ n(
228
+ /* @__PURE__ */ l(
239
229
  "button",
240
230
  {
241
231
  type: "button",
242
232
  "aria-label": "Remove",
243
- onClick: () => t == null ? void 0 : t.unstageLink(d, e),
233
+ onClick: () => t == null ? void 0 : t.unstageLink(u, e),
244
234
  className: "rounded-full p-0.5 text-slate-400 hover:text-red-500",
245
- children: /* @__PURE__ */ n(oe, { className: "h-3 w-3" })
235
+ children: /* @__PURE__ */ l(ce, { className: "h-3 w-3" })
246
236
  }
247
237
  )
248
238
  ]
@@ -251,63 +241,63 @@ function lt({
251
241
  ))
252
242
  ]
253
243
  }
254
- ) : /* @__PURE__ */ n("span", { className: "truncate text-muted-foreground", children: "Select items…" }),
255
- /* @__PURE__ */ n(te, { className: "h-4 w-4 shrink-0 opacity-50" })
244
+ ) : /* @__PURE__ */ l("span", { className: "truncate text-muted-foreground", children: "Select items…" }),
245
+ /* @__PURE__ */ l(le, { className: "h-4 w-4 shrink-0 opacity-50" })
256
246
  ]
257
247
  }
258
248
  ) }),
259
- /* @__PURE__ */ n(Ce, { className: "w-[320px] p-0", align: "start", children: /* @__PURE__ */ c(ve, { shouldFilter: !1, children: [
260
- /* @__PURE__ */ n(
261
- ge,
249
+ /* @__PURE__ */ l(Ce, { className: "w-[320px] p-0", align: "start", children: /* @__PURE__ */ c(ve, { shouldFilter: !1, children: [
250
+ /* @__PURE__ */ l(
251
+ ke,
262
252
  {
263
253
  placeholder: "Search…",
264
- value: x,
265
- onValueChange: T,
254
+ value: y,
255
+ onValueChange: C,
266
256
  className: "h-9 text-[13px]"
267
257
  }
268
258
  ),
269
- /* @__PURE__ */ c(ke, { children: [
270
- B ? /* @__PURE__ */ n("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ n(ae, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : /* @__PURE__ */ n(we, { className: "py-3 text-left text-[12px] text-muted-foreground px-3", children: "No results" }),
271
- /* @__PURE__ */ n(Ne, { children: !B && (g ? [...O] : [...O].sort(
272
- (e, i) => he(F(e), F(i), x, b === "-label")
259
+ /* @__PURE__ */ c(Se, { children: [
260
+ M ? /* @__PURE__ */ l("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ l(oe, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : /* @__PURE__ */ l(Ne, { className: "py-3 text-left text-[12px] text-muted-foreground px-3", children: "No results" }),
261
+ /* @__PURE__ */ l(we, { children: !M && (z ? [...se(Y, y, B, k)] : [...se(Y, y, B, k)].sort(
262
+ (e, a) => be(k(e), k(a), y, h === "-label")
273
263
  )).map((e) => {
274
- const i = String(e.id), u = A.has(i);
264
+ const a = String(e.id), f = J.has(a);
275
265
  return /* @__PURE__ */ c(
276
- Se,
266
+ _e,
277
267
  {
278
- value: i,
268
+ value: a,
279
269
  onSelect: () => G(e.id),
280
270
  className: "flex items-center gap-2 text-[13px]",
281
271
  children: [
282
- /* @__PURE__ */ n(
272
+ /* @__PURE__ */ l(
283
273
  "div",
284
274
  {
285
275
  className: Q(
286
276
  "flex h-4 w-4 shrink-0 items-center justify-center rounded border",
287
- u ? "border-nvr-cyan bg-nvr-cyan" : "border-slate-300 dark:border-slate-500"
277
+ f ? "border-nvr-cyan bg-nvr-cyan" : "border-slate-300 dark:border-slate-500"
288
278
  ),
289
- children: u && /* @__PURE__ */ n(de, { className: "h-2.5 w-2.5 text-white" })
279
+ children: f && /* @__PURE__ */ l(ue, { className: "h-2.5 w-2.5 text-white" })
290
280
  }
291
281
  ),
292
- r === "nivaro_users" && /* @__PURE__ */ n(
293
- xe,
282
+ s === "nivaro_users" && /* @__PURE__ */ l(
283
+ ge,
294
284
  {
295
- userId: i,
285
+ userId: a,
296
286
  className: "h-4 w-4",
297
- fallback: /* @__PURE__ */ n("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children: Fe(F(e)) })
287
+ fallback: /* @__PURE__ */ l("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children: je(k(e)) })
298
288
  }
299
289
  ),
300
- r === "nivaro_users" && E.has(i.toUpperCase()) && /* @__PURE__ */ n(
290
+ s === "nivaro_users" && E.has(a.toUpperCase()) && /* @__PURE__ */ l(
301
291
  "span",
302
292
  {
303
293
  className: "h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500",
304
294
  "data-tip": "Online now"
305
295
  }
306
296
  ),
307
- /* @__PURE__ */ n("span", { className: "truncate", children: F(e) })
297
+ /* @__PURE__ */ l("span", { className: "truncate", children: k(e) })
308
298
  ]
309
299
  },
310
- i
300
+ a
311
301
  );
312
302
  }) })
313
303
  ] })
@@ -316,101 +306,131 @@ function lt({
316
306
  }
317
307
  ) });
318
308
  }
319
- function rt({
320
- relation: s,
321
- parentId: o,
322
- allRelations: N,
323
- extraFilter: h,
324
- optionSort: b,
325
- requiredParent: K,
326
- onCountChange: J,
327
- readOnly: D
309
+ function Ue(n) {
310
+ const { client: i, relatedCollection: p, search: d, filterParam: h, serverSort: S, templateNestedFields: N } = n, q = (T) => i.request(
311
+ U(`/items/${p}`, {
312
+ limit: Ae,
313
+ search: T || void 0,
314
+ filter: h,
315
+ picker: "1",
316
+ // A dotted display template ({{core_category.name}}) needs the
317
+ // nested expansion — a bare row only carries the FK id.
318
+ ...N ? { fields: N } : {},
319
+ ...S ? { sort: S } : {}
320
+ })
321
+ ).then((s) => s.data ?? []), x = (T) => [
322
+ "m2m-options",
323
+ p,
324
+ T,
325
+ h,
326
+ S ?? "",
327
+ N ?? ""
328
+ ], F = h ? 0 : 3e4, { data: t, isFetching: j } = L({
329
+ queryKey: x(""),
330
+ queryFn: () => q(""),
331
+ enabled: n.enabled,
332
+ staleTime: F
333
+ }), v = ze(t, d, n.labelOf), { data: y, isFetching: C } = L({
334
+ queryKey: x(d),
335
+ queryFn: () => q(d),
336
+ enabled: n.enabled && v,
337
+ staleTime: F
338
+ });
339
+ return v ? { options: y ?? [], isLoading: !y && C, localSearch: !1 } : { options: t ?? [], isLoading: !t && j, localSearch: !!d };
340
+ }
341
+ const Ae = 200;
342
+ function ze(n, i, p) {
343
+ return i.trim() ? !n || n.length >= Ae ? !0 : se(n, i, !0, p).length === 0 : !1;
344
+ }
345
+ function se(n, i, p, d) {
346
+ return !p || !i.trim() ? n : n.filter((h) => Ee(d(h), i));
347
+ }
348
+ function ct({
349
+ relation: n,
350
+ parentId: i,
351
+ allRelations: p,
352
+ extraFilter: d,
353
+ optionSort: h,
354
+ requiredParent: S,
355
+ onCountChange: N,
356
+ readOnly: q
328
357
  }) {
329
- const y = fe(), W = Ke(), t = je(), [P, C] = ne(!1), [x, T] = ne(""), le = N.find(
330
- (l) => l.many_collection === s.many_collection && l.many_field === s.junction_field && l.id !== s.id
331
- ), r = Oe(le), v = s.junction_field ?? "", R = s.many_field ?? "", d = s.one_field ?? `${s.many_collection}.${v}`, { data: a } = w({
332
- queryKey: ["col-meta", r],
333
- queryFn: () => y.request(q(`/collections/${r}`)).then((l) => l.data),
334
- enabled: !!r,
358
+ const x = pe(), F = De(), t = Fe(), [j, v] = re(!1), [y, C] = re(""), T = p.find(
359
+ (r) => r.many_collection === n.many_collection && r.many_field === n.junction_field && r.id !== n.id
360
+ ), s = Ie(T), w = n.junction_field ?? "", P = n.many_field ?? "", u = n.one_field ?? `${n.many_collection}.${w}`, { data: o } = L({
361
+ queryKey: ["col-meta", s],
362
+ queryFn: () => x.request(U(`/collections/${s}`)).then((r) => r.data),
363
+ enabled: !!s,
335
364
  staleTime: 3e5,
336
365
  retry: !1
337
- }), { data: X = [], isFetching: re } = w({
338
- queryKey: ["m2m-items", s.many_collection, R, o],
339
- queryFn: () => y.request(
340
- q(`/items/${s.many_collection}`, {
341
- filter: JSON.stringify({ [R]: { _eq: o } }),
366
+ }), { data: W = [], isFetching: ie } = L({
367
+ queryKey: ["m2m-items", n.many_collection, P, i],
368
+ queryFn: () => x.request(
369
+ U(`/items/${n.many_collection}`, {
370
+ filter: JSON.stringify({ [P]: { _eq: i } }),
342
371
  limit: 1,
343
- fields: `id,${v}`
372
+ fields: `id,${w}`
344
373
  })
345
- ).then((l) => l.data ?? []),
374
+ ).then((r) => r.data ?? []),
346
375
  staleTime: 3e4,
347
- enabled: !!o && o !== "new"
348
- }), z = pe().isAdmin, E = r === "nivaro_users" ? ye(z) : null, H = be(r === "nivaro_users"), L = h ? E ? { _and: [h, E] } : h : E, g = L ? JSON.stringify(L) : void 0, S = b && !/^-?label$/.test(b) ? b : void 0, O = (() => {
349
- const l = a == null ? void 0 : a.display_template;
350
- if (!l || !l.includes(".")) return null;
351
- const p = [...l.matchAll(/\{\{([^}]+)\}\}/g)].map((ee) => ee[1].trim());
352
- return p.length === 0 ? null : ["id", ...p].join(",");
353
- })(), { data: B = [], isFetching: V } = w({
354
- queryKey: [
355
- "m2m-options",
356
- r,
357
- x,
358
- g,
359
- S ?? "",
360
- O ?? ""
361
- ],
362
- queryFn: () => y.request(
363
- q(`/items/${r}`, {
364
- limit: 200,
365
- search: x || void 0,
366
- filter: g,
367
- picker: "1",
368
- // A dotted display template ({{core_category.name}}) needs the
369
- // nested expansion — a bare row only carries the FK id.
370
- ...O ? { fields: O } : {},
371
- ...S ? { sort: S } : {}
372
- })
373
- ).then((l) => l.data ?? []),
374
- enabled: P && !!r,
375
- staleTime: g ? 0 : 3e4
376
- }), k = (t == null ? void 0 : t.getStagedLinks(d)) ?? [], U = (t == null ? void 0 : t.getStagedUnlinks(d)) ?? /* @__PURE__ */ new Set(), f = X.find((l) => !U.has(l.id)) ?? null, _ = f ? f[v] : null, Y = k.length > 0 ? k[k.length - 1] : null, m = Y ?? _, Z = k.length > 0 || U.size > 0, $ = me(J);
377
- $.current = J, ue(() => {
378
- var l;
379
- (l = $.current) == null || l.call($, m != null ? 1 : 0);
376
+ enabled: !!i && i !== "new"
377
+ }), D = he().isAdmin, E = s === "nivaro_users" ? xe(D) : null, X = ye(s === "nivaro_users"), R = d ? E ? { _and: [d, E] } : d : E, z = R ? JSON.stringify(R) : void 0, H = h && !/^-?label$/.test(h) ? h : void 0, Y = (() => {
378
+ const r = o == null ? void 0 : o.display_template;
379
+ if (!r || !r.includes(".")) return null;
380
+ const b = [...r.matchAll(/\{\{([^}]+)\}\}/g)].map((ne) => ne[1].trim());
381
+ return b.length === 0 ? null : ["id", ...b].join(",");
382
+ })(), {
383
+ options: M,
384
+ isLoading: B,
385
+ localSearch: Z
386
+ } = Ue({
387
+ client: x,
388
+ relatedCollection: s,
389
+ search: y,
390
+ filterParam: z,
391
+ serverSort: H,
392
+ templateNestedFields: Y,
393
+ enabled: j && !!s,
394
+ labelOf: e
395
+ }), _ = (t == null ? void 0 : t.getStagedLinks(u)) ?? [], A = (t == null ? void 0 : t.getStagedUnlinks(u)) ?? /* @__PURE__ */ new Set(), g = W.find((r) => !A.has(r.id)) ?? null, O = g ? g[w] : null, ee = _.length > 0 ? _[_.length - 1] : null, m = ee ?? O, te = _.length > 0 || A.size > 0, $ = me(N);
396
+ $.current = N, fe(() => {
397
+ var r;
398
+ (r = $.current) == null || r.call($, m != null ? 1 : 0);
380
399
  }, [m]);
381
- const { data: I } = w({
382
- queryKey: ["relation-single", r, String(m)],
383
- queryFn: () => W(r, m),
384
- enabled: !!r && m != null,
400
+ const { data: K } = L({
401
+ queryKey: ["relation-single", s, String(m)],
402
+ queryFn: () => F(s, m),
403
+ enabled: !!s && m != null,
385
404
  staleTime: 6e4
386
- }), A = JSON.stringify(h ? { _and: [{ id: { _eq: m } }, h] } : { id: { _eq: m } }), { data: j } = w({
387
- queryKey: ["relation-avail", r, String(m), g],
388
- queryFn: () => y.request(
389
- q(`/items/${r}`, {
390
- filter: A,
405
+ }), J = JSON.stringify(d ? { _and: [{ id: { _eq: m } }, d] } : { id: { _eq: m } }), { data: I } = L({
406
+ queryKey: ["relation-avail", s, String(m), z],
407
+ queryFn: () => x.request(
408
+ U(`/items/${s}`, {
409
+ filter: J,
391
410
  picker: "1",
392
411
  limit: 1,
393
412
  fields: "id"
394
413
  })
395
- ).then((l) => l.data ?? []),
396
- enabled: !!r && m != null && !!I,
414
+ ).then((r) => r.data ?? []),
415
+ enabled: !!s && m != null && !!K,
397
416
  staleTime: 3e4
398
- }), G = j !== void 0 && j.length === 0, F = Je(G), e = (a == null ? void 0 : a.display_template) ?? null;
399
- function i(l) {
400
- return e ? Le(e, l) : String(l.name ?? l.title ?? l.label ?? l.id ?? "");
417
+ }), G = I !== void 0 && I.length === 0, k = Re(G);
418
+ function e(r) {
419
+ const b = (o == null ? void 0 : o.display_template) ?? null;
420
+ return b ? Oe(b, r) : String(r.name ?? r.title ?? r.label ?? r.id ?? "");
401
421
  }
402
- const u = B.find((l) => String(l.id) === String(m)) ?? I, M = m != null && !I && !u, se = u ? i(u) : null;
403
- if (D)
404
- return /* @__PURE__ */ n("span", { className: "block truncate text-[12px] text-slate-700 dark:text-slate-200", children: M ? "…" : se ?? "—" });
405
- function Ue(l) {
406
- for (const p of k) t == null || t.unstageLink(d, p);
407
- f && !U.has(f.id) && (t == null || t.stageUnlink(d, f.id)), String(l) === String(_) && f ? t == null || t.unstageUnlink(d, f.id) : String(l) !== String(m) && (t == null || t.stageLink(d, l)), C(!1), T("");
422
+ const a = M.find((r) => String(r.id) === String(m)) ?? K, f = m != null && !K && !a, V = a ? e(a) : null;
423
+ if (q)
424
+ return /* @__PURE__ */ l("span", { className: "block truncate text-[12px] text-slate-700 dark:text-slate-200", children: f ? "…" : V ?? "—" });
425
+ function $e(r) {
426
+ for (const b of _) t == null || t.unstageLink(u, b);
427
+ g && !A.has(g.id) && (t == null || t.stageUnlink(u, g.id)), String(r) === String(O) && g ? t == null || t.unstageUnlink(u, g.id) : String(r) !== String(m) && (t == null || t.stageLink(u, r)), v(!1), C("");
408
428
  }
409
- function $e() {
410
- for (const l of k) t == null || t.unstageLink(d, l);
411
- f && (t == null || t.stageUnlink(d, f.id)), C(!1);
429
+ function Ke() {
430
+ for (const r of _) t == null || t.unstageLink(u, r);
431
+ g && (t == null || t.stageUnlink(u, g.id)), v(!1);
412
432
  }
413
- return K ? /* @__PURE__ */ c(
433
+ return S ? /* @__PURE__ */ c(
414
434
  "button",
415
435
  {
416
436
  type: "button",
@@ -419,54 +439,54 @@ function rt({
419
439
  children: [
420
440
  /* @__PURE__ */ c("span", { className: "truncate text-muted-foreground", children: [
421
441
  "Select ",
422
- K,
442
+ S,
423
443
  " first"
424
444
  ] }),
425
- /* @__PURE__ */ n(te, { className: "h-4 w-4 shrink-0 opacity-50" })
445
+ /* @__PURE__ */ l(le, { className: "h-4 w-4 shrink-0 opacity-50" })
426
446
  ]
427
447
  }
428
- ) : /* @__PURE__ */ c("div", { ...F.bind, children: [
448
+ ) : /* @__PURE__ */ c("div", { ...k.bind, children: [
429
449
  /* @__PURE__ */ c(
430
- _e,
450
+ Le,
431
451
  {
432
- open: P,
433
- onOpenChange: (l) => {
434
- C(l), l || T("");
452
+ open: j,
453
+ onOpenChange: (r) => {
454
+ v(r), r || C("");
435
455
  },
436
456
  children: [
437
- /* @__PURE__ */ n(qe, { asChild: !0, children: /* @__PURE__ */ c(
457
+ /* @__PURE__ */ l(qe, { asChild: !0, children: /* @__PURE__ */ c(
438
458
  "button",
439
459
  {
440
460
  type: "button",
441
461
  className: Q(
442
462
  "w-full h-9 px-3 text-[12px] border rounded-md bg-background text-left flex items-center justify-between hover:bg-muted cursor-pointer transition-colors disabled:pointer-events-none disabled:opacity-50",
443
- G ? "border-amber-300 dark:border-amber-600" : Z ? "border-nvr-cyan/50" : "border-input"
463
+ G ? "border-amber-300 dark:border-amber-600" : te ? "border-nvr-cyan/50" : "border-input"
444
464
  ),
445
465
  children: [
446
- M || re && Y == null && o !== "new" ? /* @__PURE__ */ n(ae, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" }) : /* @__PURE__ */ c(
466
+ f || ie && ee == null && i !== "new" ? /* @__PURE__ */ l(oe, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" }) : /* @__PURE__ */ c(
447
467
  "span",
448
468
  {
449
469
  className: Q(
450
470
  "flex items-center gap-1.5 truncate min-w-0",
451
- se ? Z ? "text-nvr-cyan" : "text-slate-800 dark:text-slate-100" : "text-muted-foreground"
471
+ V ? te ? "text-nvr-cyan" : "text-slate-800 dark:text-slate-100" : "text-muted-foreground"
452
472
  ),
453
473
  children: [
454
- G && /* @__PURE__ */ n(ce, { className: "h-3.5 w-3.5 shrink-0 text-amber-500" }),
455
- /* @__PURE__ */ n("span", { className: "truncate", children: se ?? "Select…" })
474
+ G && /* @__PURE__ */ l(de, { className: "h-3.5 w-3.5 shrink-0 text-amber-500" }),
475
+ /* @__PURE__ */ l("span", { className: "truncate", children: V ?? "Select…" })
456
476
  ]
457
477
  }
458
478
  ),
459
- /* @__PURE__ */ n(te, { className: "h-4 w-4 shrink-0 opacity-50" })
479
+ /* @__PURE__ */ l(le, { className: "h-4 w-4 shrink-0 opacity-50" })
460
480
  ]
461
481
  }
462
482
  ) }),
463
- /* @__PURE__ */ n(Ce, { className: "w-[320px] p-0", align: "start", children: /* @__PURE__ */ c(ve, { shouldFilter: !1, children: [
464
- /* @__PURE__ */ n(
465
- ge,
483
+ /* @__PURE__ */ l(Ce, { className: "w-[320px] p-0", align: "start", children: /* @__PURE__ */ c(ve, { shouldFilter: !1, children: [
484
+ /* @__PURE__ */ l(
485
+ ke,
466
486
  {
467
487
  placeholder: "Search…",
468
- value: x,
469
- onValueChange: T,
488
+ value: y,
489
+ onValueChange: C,
470
490
  className: "h-9 text-[12px]"
471
491
  }
472
492
  ),
@@ -475,57 +495,57 @@ function rt({
475
495
  {
476
496
  type: "button",
477
497
  onClick: () => {
478
- $e(), C(!1);
498
+ Ke(), v(!1);
479
499
  },
480
500
  className: "flex w-full items-center gap-2 px-3 py-1.5 text-[13px] text-slate-500 hover:bg-muted border-b border-slate-100 dark:text-slate-400 dark:border-border",
481
501
  children: [
482
- /* @__PURE__ */ n(oe, { className: "h-3.5 w-3.5 text-slate-400" }),
502
+ /* @__PURE__ */ l(ce, { className: "h-3.5 w-3.5 text-slate-400" }),
483
503
  "Clear selection"
484
504
  ]
485
505
  }
486
506
  ),
487
- /* @__PURE__ */ c(ke, { children: [
488
- V ? /* @__PURE__ */ n("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ n(ae, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : /* @__PURE__ */ n(we, { className: "py-3 text-left text-[12px] text-muted-foreground px-3", children: "No results" }),
489
- !V && /* @__PURE__ */ n(Ne, { children: [...B].sort(
490
- (l, p) => S ? 0 : he(i(l), i(p), x, b === "-label")
491
- ).map((l) => {
492
- const p = String(l.id), ee = String(m) === p;
507
+ /* @__PURE__ */ c(Se, { children: [
508
+ B ? /* @__PURE__ */ l("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ l(oe, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : /* @__PURE__ */ l(Ne, { className: "py-3 text-left text-[12px] text-muted-foreground px-3", children: "No results" }),
509
+ !B && /* @__PURE__ */ l(we, { children: [...se(M, y, Z, e)].sort(
510
+ (r, b) => H ? 0 : be(e(r), e(b), y, h === "-label")
511
+ ).map((r) => {
512
+ const b = String(r.id), ne = String(m) === b;
493
513
  return /* @__PURE__ */ c(
494
- Se,
514
+ _e,
495
515
  {
496
- value: p,
497
- onSelect: () => Ue(l.id),
516
+ value: b,
517
+ onSelect: () => $e(r.id),
498
518
  className: "flex items-center gap-2 text-[12px]",
499
519
  children: [
500
- /* @__PURE__ */ n(
520
+ /* @__PURE__ */ l(
501
521
  "div",
502
522
  {
503
523
  className: Q(
504
524
  "flex h-4 w-4 shrink-0 items-center justify-center rounded-full border transition-colors",
505
- ee ? "border-nvr-cyan bg-nvr-cyan" : "border-slate-300 dark:border-slate-500"
525
+ ne ? "border-nvr-cyan bg-nvr-cyan" : "border-slate-300 dark:border-slate-500"
506
526
  ),
507
- children: ee && /* @__PURE__ */ n(de, { className: "h-2.5 w-2.5 text-white" })
527
+ children: ne && /* @__PURE__ */ l(ue, { className: "h-2.5 w-2.5 text-white" })
508
528
  }
509
529
  ),
510
- r === "nivaro_users" && /* @__PURE__ */ n(
511
- xe,
530
+ s === "nivaro_users" && /* @__PURE__ */ l(
531
+ ge,
512
532
  {
513
- userId: p,
533
+ userId: b,
514
534
  className: "h-4 w-4",
515
- fallback: /* @__PURE__ */ n("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children: Fe(i(l)) })
535
+ fallback: /* @__PURE__ */ l("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children: je(e(r)) })
516
536
  }
517
537
  ),
518
- r === "nivaro_users" && H.has(p.toUpperCase()) && /* @__PURE__ */ n(
538
+ s === "nivaro_users" && X.has(b.toUpperCase()) && /* @__PURE__ */ l(
519
539
  "span",
520
540
  {
521
541
  className: "h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500",
522
542
  "data-tip": "Online now"
523
543
  }
524
544
  ),
525
- /* @__PURE__ */ n("span", { className: "truncate", children: i(l) })
545
+ /* @__PURE__ */ l("span", { className: "truncate", children: e(r) })
526
546
  ]
527
547
  },
528
- p
548
+ b
529
549
  );
530
550
  }) })
531
551
  ] })
@@ -533,12 +553,14 @@ function rt({
533
553
  ]
534
554
  }
535
555
  ),
536
- F.tip
556
+ k.tip
537
557
  ] });
538
558
  }
539
559
  export {
540
- lt as M2MCombobox,
541
- rt as M2MSingleSelectCombobox,
542
- nt as m2aWriteMeta,
543
- Oe as resolveM2MRelatedCollection
560
+ ot as M2MCombobox,
561
+ ct as M2MSingleSelectCombobox,
562
+ at as m2aWriteMeta,
563
+ ze as m2mAsksServer,
564
+ se as narrowM2MOptions,
565
+ Ie as resolveM2MRelatedCollection
544
566
  };