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