@nivaro/react 0.3.111 → 0.3.112

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 (75) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +170 -2
  4. package/dist/index.js +745 -728
  5. package/dist/shared/components/CollectionBrowserView.js +3097 -2972
  6. package/dist/shared/components/CollectionImportBanner.js +135 -0
  7. package/dist/shared/components/ItemEditForm.js +2235 -2218
  8. package/dist/shared/components/JobsTray.js +54 -47
  9. package/dist/shared/components/ViewAsPersonButton.js +109 -0
  10. package/dist/shared/components/bulk/BulkFieldUpdate.js +228 -150
  11. package/dist/shared/components/bulk/BulkFieldUpdateButton.js +35 -41
  12. package/dist/shared/components/bulk/BulkLinksValue.js +91 -0
  13. package/dist/shared/components/bulk/bulk-field-options.js +20 -19
  14. package/dist/shared/components/bulk/bulk-update-preview.js +39 -0
  15. package/dist/shared/components/cbv/ColumnHeaderMenu.js +113 -0
  16. package/dist/shared/components/cbv/column-totals.js +66 -0
  17. package/dist/shared/components/collections-directory/CollectionHoverCard.js +108 -81
  18. package/dist/shared/components/collections-directory/CollectionRow.js +164 -148
  19. package/dist/shared/components/collections-directory/CollectionsDirectory.js +167 -166
  20. package/dist/shared/components/collections-directory/directory-data.js +70 -58
  21. package/dist/shared/components/imports/CollectionImportPanel.js +120 -118
  22. package/dist/shared/components/imports/DefinitionsPanel.js +24 -24
  23. package/dist/shared/components/imports/ImportDuplicatesNotice.js +65 -0
  24. package/dist/shared/components/item-edit/CatalogPickerField.js +631 -639
  25. package/dist/shared/components/item-edit/DuplicateNotice.js +168 -0
  26. package/dist/shared/components/item-edit/FieldRow.js +248 -246
  27. package/dist/shared/components/item-edit/InlineGridField.js +34 -33
  28. package/dist/shared/components/item-edit/InlineTableField.js +3064 -2882
  29. package/dist/shared/components/item-edit/MembershipSetField.js +165 -169
  30. package/dist/shared/components/item-edit/NestedRelationEditor.js +184 -189
  31. package/dist/shared/components/item-edit/PlanGrid.js +2 -1
  32. package/dist/shared/components/item-edit/QuickPickerDialog.js +35 -34
  33. package/dist/shared/components/item-edit/RecordLiveSync.js +32 -30
  34. package/dist/shared/components/item-edit/RelationCombobox.js +101 -100
  35. package/dist/shared/components/item-edit/RowHistorySheet.js +28 -27
  36. package/dist/shared/components/item-edit/SummaryPanel.js +133 -135
  37. package/dist/shared/components/item-edit/ViewAsRole.js +129 -52
  38. package/dist/shared/components/item-edit/grid-search.js +345 -0
  39. package/dist/shared/components/item-edit/render-stability.js +61 -54
  40. package/dist/shared/components/notifications/NotificationRulesEditor.js +25 -20
  41. package/dist/shared/components/ops-report/DigestSections.js +163 -144
  42. package/dist/shared/components/ops-report/drill.js +97 -97
  43. package/dist/shared/components/panels/AddendumLinesDiff.js +52 -51
  44. package/dist/shared/components/panels/AddendumPanel.js +92 -91
  45. package/dist/shared/components/panels/AsyncUserPicker.js +108 -0
  46. package/dist/shared/components/panels/CommentPanel.js +265 -252
  47. package/dist/shared/components/panels/OwnersSlot.js +47 -35
  48. package/dist/shared/components/panels/PipelineInsight.js +186 -0
  49. package/dist/shared/components/panels/PipelinePanel.js +1529 -1492
  50. package/dist/shared/components/panels/RecordIntegrityBanner.js +39 -38
  51. package/dist/shared/components/panels/RevisionsPanel.js +261 -260
  52. package/dist/shared/components/pipeline/FieldPicker.js +41 -40
  53. package/dist/shared/components/pipeline/OwnerMatrix.js +829 -700
  54. package/dist/shared/components/pipeline/OwnerRecordTrial.js +362 -0
  55. package/dist/shared/components/pipeline/PipelineEditorView.js +483 -467
  56. package/dist/shared/components/pipeline/PipelineStateOwners.js +65 -64
  57. package/dist/shared/components/pipeline/owner-matrix-draft.js +178 -0
  58. package/dist/shared/components/profile/MyDefaultsCard.js +36 -35
  59. package/dist/shared/components/profile/PersonHeader.js +29 -29
  60. package/dist/shared/components/profile/PersonProfile.js +30 -28
  61. package/dist/shared/components/profile/SlowScreensCard.js +286 -0
  62. package/dist/shared/components/queue/QueueWorklist.js +1090 -1071
  63. package/dist/shared/components/quick-filters/useQuickFilterEditing.js +45 -44
  64. package/dist/shared/components/support/TicketDetailSheet.js +25 -16
  65. package/dist/shared/components/support/TicketSlowScreens.js +32 -0
  66. package/dist/shared/lib/activity-sentence.js +224 -178
  67. package/dist/shared/lib/collection-import-banner.js +27 -0
  68. package/dist/shared/lib/crash-report.js +112 -0
  69. package/dist/shared/lib/export-runs.js +99 -0
  70. package/dist/shared/lib/jobs-tray.js +89 -67
  71. package/dist/shared/lib/list-link.js +76 -69
  72. package/dist/shared/lib/nav-trail.js +180 -76
  73. package/dist/shared/lib/query-keys.js +26 -0
  74. package/dist/shared/lib/view-as.js +16 -11
  75. package/package.json +1 -1
@@ -1,200 +1,196 @@
1
- import { jsxs as b, jsx as n } from "react/jsx-runtime";
2
- import { useQueryClient as ye, useQuery as K } from "@tanstack/react-query";
3
- import { Search as ge, X as ve, Check as O, ChevronsUpDown as we } from "lucide-react";
4
- import { useState as C, useMemo as $ } from "react";
5
- import { useNivaroClient as ce } from "../../context.js";
6
- import { get as R, patch as ke, post as se, del as ne } from "../../lib/commands.js";
7
- import { userErrorMessage as Ne } from "../../lib/safe-error.js";
8
- import { matchesAllTokens as de, titleCase as P, cn as _ } from "../../lib/utils.js";
9
- import { Popover as _e, PopoverTrigger as $e, PopoverContent as Se } from "../ui/popover.js";
10
- import { applyDisplayTemplate as qe } from "./helpers.js";
11
- import { RelationCombobox as Ce } from "./RelationCombobox.js";
12
- const oe = (a, l) => `${a ?? ""}\0${l ?? ""}`;
13
- function Le(a, l) {
14
- const u = new Map(l.map((y) => [oe(y[0], y[1]), y])), i = /* @__PURE__ */ new Set(), o = [];
15
- for (const y of a) {
16
- const h = oe(y.value, y.value2);
17
- u.has(h) && !i.has(h) ? i.add(h) : o.push(y.id);
1
+ import { jsxs as b, jsx as s } from "react/jsx-runtime";
2
+ import { useQueryClient as ye, useQuery as T } from "@tanstack/react-query";
3
+ import { Search as ge, X as ve, Check as R, ChevronsUpDown as we } from "lucide-react";
4
+ import { useState as q, useMemo as S } from "react";
5
+ import { useNivaroClient as ie } from "../../context.js";
6
+ import { get as ke, patch as Ne, post as le, del as se } from "../../lib/commands.js";
7
+ import { fetchCollectionRelations as Ce, queryKeys as ce, fetchCollectionMeta as Se } from "../../lib/query-keys.js";
8
+ import { userErrorMessage as _e } from "../../lib/safe-error.js";
9
+ import { matchesAllTokens as de, titleCase as O, cn as C } from "../../lib/utils.js";
10
+ import { Popover as $e, PopoverTrigger as qe, PopoverContent as Le } from "../ui/popover.js";
11
+ import { applyDisplayTemplate as Ke } from "./helpers.js";
12
+ import { RelationCombobox as Te } from "./RelationCombobox.js";
13
+ const ne = (r, l) => `${r ?? ""}\0${l ?? ""}`;
14
+ function Me(r, l) {
15
+ const u = new Map(l.map((y) => [ne(y[0], y[1]), y])), c = /* @__PURE__ */ new Set(), o = [];
16
+ for (const y of r) {
17
+ const h = ne(y.value, y.value2);
18
+ u.has(h) && !c.has(h) ? c.add(h) : o.push(y.id);
18
19
  }
19
20
  const m = [], g = [];
20
21
  for (const [y, h] of u) {
21
- if (i.has(y)) continue;
22
- const c = o.shift();
23
- c !== void 0 ? m.push({ id: c, pair: h }) : g.push(h);
22
+ if (c.has(y)) continue;
23
+ const i = o.shift();
24
+ i !== void 0 ? m.push({ id: i, pair: h }) : g.push(h);
24
25
  }
25
26
  return { repoint: m, create: g, remove: o };
26
27
  }
27
- const Te = (a, l) => {
28
- const u = a.size ? [...a] : [null], i = l.size ? [...l] : [null];
29
- return u.flatMap((o) => i.map((m) => [o, m]));
30
- }, Ke = 10;
31
- async function Q(a, l, u) {
32
- const i = [];
28
+ const je = (r, l) => {
29
+ const u = r.size ? [...r] : [null], c = l.size ? [...l] : [null];
30
+ return u.flatMap((o) => c.map((m) => [o, m]));
31
+ }, Fe = 10;
32
+ async function A(r, l, u) {
33
+ const c = [];
33
34
  for (let o = 1; o <= 50; o++) {
34
- const m = await a.request(R(l, { ...u, limit: 1e3, page: o })).then((g) => g.data ?? []);
35
- if (i.push(...m), m.length < 1e3) break;
35
+ const m = await r.request(ke(l, { ...u, limit: 1e3, page: o })).then((g) => g.data ?? []);
36
+ if (c.push(...m), m.length < 1e3) break;
36
37
  }
37
- return i;
38
+ return c;
38
39
  }
39
- const Me = (a) => [...(a ?? "").matchAll(/\{\{([\w.]+)\}\}/g)].map((l) => l[1]);
40
- function A(a, l) {
41
- const u = ce(), { data: i } = K({
42
- queryKey: ["collection-display-meta", a],
43
- queryFn: () => u.request(R(`/collections/${a}`)).then((c) => {
44
- var s;
45
- return { display_template: ((s = c.data) == null ? void 0 : s.display_template) ?? null };
46
- }),
47
- enabled: !!a,
40
+ const Re = (r) => [...(r ?? "").matchAll(/\{\{([\w.]+)\}\}/g)].map((l) => l[1]);
41
+ function P(r, l) {
42
+ const u = ie(), { data: c } = T({
43
+ queryKey: ce.collectionDisplayMeta(r),
44
+ queryFn: () => Se(u, r),
45
+ select: (i) => (i == null ? void 0 : i.display_template) ?? null,
46
+ enabled: !!r,
48
47
  staleTime: 10 * 6e4
49
- }), o = (i == null ? void 0 : i.display_template) ?? null, m = l === "all" ? "all" : [...l].sort().join(","), { data: g = [], isLoading: y } = K({
50
- queryKey: ["membership-set-labels", a, o, m],
48
+ }), o = c ?? null, m = l === "all" ? "all" : [...l].sort().join(","), { data: g = [], isLoading: y } = T({
49
+ queryKey: ["membership-set-labels", r, o, m],
51
50
  queryFn: async () => {
52
- const c = Me(o), s = c.length ? { fields: ["id", ...c].join(",") } : {};
53
- if (l === "all") return Q(u, `/items/${a}`, s);
51
+ const i = Re(o), n = i.length ? { fields: ["id", ...i].join(",") } : {};
52
+ if (l === "all") return A(u, `/items/${r}`, n);
54
53
  const f = [];
55
54
  for (let w = 0; w < l.length; w += 150)
56
55
  f.push(
57
- ...await Q(u, `/items/${a}`, {
58
- ...s,
56
+ ...await A(u, `/items/${r}`, {
57
+ ...n,
59
58
  filter: JSON.stringify({ id: { _in: l.slice(w, w + 150) } })
60
59
  })
61
60
  );
62
61
  return f;
63
62
  },
64
- enabled: !!a && i !== void 0 && (l === "all" || l.length > 0),
63
+ enabled: !!r && c !== void 0 && (l === "all" || l.length > 0),
65
64
  staleTime: 6e4
66
65
  });
67
- return { labels: $(() => {
68
- const c = /* @__PURE__ */ new Map();
69
- for (const s of g) {
70
- const f = String(s.name ?? s.title ?? s.label ?? `#${s.id}`);
71
- c.set(String(s.id), (o ? qe(o, s) : "").trim() || f);
66
+ return { labels: S(() => {
67
+ const i = /* @__PURE__ */ new Map();
68
+ for (const n of g) {
69
+ const f = String(n.name ?? n.title ?? n.label ?? `#${n.id}`);
70
+ i.set(String(n.id), (o ? Ke(o, n) : "").trim() || f);
72
71
  }
73
- return c;
72
+ return i;
74
73
  }, [g, o]), isLoading: y };
75
74
  }
76
- function Je({
77
- relatedCollection: a,
75
+ function Xe({
76
+ relatedCollection: r,
78
77
  manyField: l,
79
78
  parentId: u,
80
- config: i,
79
+ config: c,
81
80
  readOnly: o
82
81
  }) {
83
- const m = ce(), g = ye(), y = u === "new", { key_field: h, value_field: c } = i, s = i.value_field_2 || null, f = i.empty_label ?? "All", w = i.empty_label_2 ?? f, [S, p] = C(""), [k, z] = C(null), [B, D] = C(null), { data: ue = [] } = K({
84
- queryKey: ["collection-relations", a],
85
- queryFn: () => m.request(R(`/collections/${a}`)).then((e) => {
86
- var r;
87
- return ((r = e.data) == null ? void 0 : r.relations) ?? [];
88
- }),
82
+ const m = ie(), g = ye(), y = u === "new", { key_field: h, value_field: i } = c, n = c.value_field_2 || null, f = c.empty_label ?? "All", w = c.empty_label_2 ?? f, [_, p] = q(""), [k, Q] = q(null), [z, D] = q(null), { data: ue = [] } = T({
83
+ queryKey: ce.collectionRelations(r),
84
+ queryFn: () => Ce(m, r),
89
85
  staleTime: 10 * 6e4
90
86
  }), M = (e) => {
91
- var r;
92
- return ((r = ue.find((t) => t.many_collection === a && t.many_field === e)) == null ? void 0 : r.one_collection) ?? null;
93
- }, L = M(h), E = M(c), J = s ? M(s) : null, V = ["membership-set-rows", a, l, String(u)], { data: H = [], isLoading: me } = K({
94
- queryKey: V,
95
- queryFn: async () => (await Q(m, `/items/${a}`, {
96
- fields: ["id", h, c, ...s ? [s] : []].join(","),
87
+ var a;
88
+ return ((a = ue.find((t) => t.many_collection === r && t.many_field === e)) == null ? void 0 : a.one_collection) ?? null;
89
+ }, L = M(h), B = M(i), E = n ? M(n) : null, J = ["membership-set-rows", r, l, String(u)], { data: V = [], isLoading: me } = T({
90
+ queryKey: J,
91
+ queryFn: async () => (await A(m, `/items/${r}`, {
92
+ fields: ["id", h, i, ...n ? [n] : []].join(","),
97
93
  filter: JSON.stringify({ [l]: { _eq: u } })
98
94
  })).filter((e) => e[h] != null).map((e) => ({
99
95
  id: e.id,
100
96
  key: String(e[h]),
101
- value: e[c] == null ? null : String(e[c]),
102
- value2: !s || e[s] == null ? null : String(e[s])
97
+ value: e[i] == null ? null : String(e[i]),
98
+ value2: !n || e[n] == null ? null : String(e[n])
103
99
  })),
104
100
  enabled: !y,
105
101
  staleTime: 15e3
106
- }), N = $(() => {
102
+ }), N = S(() => {
107
103
  const e = /* @__PURE__ */ new Map();
108
- for (const r of H) e.set(r.key, [...e.get(r.key) ?? [], r]);
104
+ for (const a of V) e.set(a.key, [...e.get(a.key) ?? [], a]);
109
105
  return e;
110
- }, [H]), v = $(() => [...N.keys()], [N]), { labels: U } = A(L, v), { labels: X } = A(E, "all"), { labels: G } = A(J, "all"), W = (e) => [...e.entries()].map(([r, t]) => ({ id: r, label: t })).sort((r, t) => r.label.localeCompare(t.label, void 0, { numeric: !0 })), pe = $(() => W(X), [X]), be = $(() => W(G), [G]), he = () => {
111
- g.invalidateQueries({ queryKey: V }), g.invalidateQueries({ queryKey: ["o2m-rows", a] });
112
- }, j = async (e, r) => {
113
- z(e), D(null);
106
+ }, [V]), v = S(() => [...N.keys()], [N]), { labels: H } = P(L, v), { labels: U } = P(B, "all"), { labels: X } = P(E, "all"), G = (e) => [...e.entries()].map(([a, t]) => ({ id: a, label: t })).sort((a, t) => a.label.localeCompare(t.label, void 0, { numeric: !0 })), pe = S(() => G(U), [U]), be = S(() => G(X), [X]), he = () => {
107
+ g.invalidateQueries({ queryKey: J }), g.invalidateQueries({ queryKey: ["o2m-rows", r] });
108
+ }, j = async (e, a) => {
109
+ Q(e), D(null);
114
110
  try {
115
- await r();
111
+ await a();
116
112
  } catch (t) {
117
113
  const x = t == null ? void 0 : t.response;
118
- D((x == null ? void 0 : x.error) ?? Ne(t, "Could not save"));
114
+ D((x == null ? void 0 : x.error) ?? _e(t, "Could not save"));
119
115
  } finally {
120
- z(null), he();
116
+ Q(null), he();
121
117
  }
122
- }, Y = (e) => {
123
- const r = N.get(e) ?? [];
118
+ }, W = (e) => {
119
+ const a = N.get(e) ?? [];
124
120
  return {
125
- a: new Set(r.filter((t) => t.value !== null).map((t) => t.value)),
126
- b: new Set(r.filter((t) => t.value2 !== null).map((t) => t.value2))
121
+ a: new Set(a.filter((t) => t.value !== null).map((t) => t.value)),
122
+ b: new Set(a.filter((t) => t.value2 !== null).map((t) => t.value2))
127
123
  };
128
- }, F = ([e, r]) => ({
129
- [c]: e,
130
- ...s ? { [s]: r } : {}
131
- }), T = (e, r, t) => j(e, async () => {
132
- const x = Le(N.get(e) ?? [], Te(r, t));
124
+ }, F = ([e, a]) => ({
125
+ [i]: e,
126
+ ...n ? { [n]: a } : {}
127
+ }), K = (e, a, t) => j(e, async () => {
128
+ const x = Me(N.get(e) ?? [], je(a, t));
133
129
  for (const d of x.repoint)
134
- await m.request(ke(`/items/${a}/${d.id}`, F(d.pair)));
130
+ await m.request(Ne(`/items/${r}/${d.id}`, F(d.pair)));
135
131
  for (const d of x.create)
136
132
  await m.request(
137
- se(`/items/${a}`, {
133
+ le(`/items/${r}`, {
138
134
  [l]: u,
139
135
  [h]: e,
140
136
  ...F(d)
141
137
  })
142
138
  );
143
- for (const d of x.remove) await m.request(ne(`/items/${a}/${d}`));
144
- }), Z = (e, r) => {
139
+ for (const d of x.remove) await m.request(se(`/items/${r}/${d}`));
140
+ }), Y = (e, a) => {
145
141
  const t = new Set(e);
146
- return t.has(r) ? t.delete(r) : t.add(r), t;
147
- }, I = (e, r, t = 1) => {
148
- const { a: x, b: d } = Y(e);
149
- return t === 1 ? T(e, Z(x, r), d) : T(e, x, Z(d, r));
150
- }, ee = (e, r = 1) => {
151
- const { a: t, b: x } = Y(e);
152
- if ((r === 1 ? t : x).size !== 0)
153
- return r === 1 ? T(e, /* @__PURE__ */ new Set(), x) : T(e, t, /* @__PURE__ */ new Set());
142
+ return t.has(a) ? t.delete(a) : t.add(a), t;
143
+ }, Z = (e, a, t = 1) => {
144
+ const { a: x, b: d } = W(e);
145
+ return t === 1 ? K(e, Y(x, a), d) : K(e, x, Y(d, a));
146
+ }, I = (e, a = 1) => {
147
+ const { a: t, b: x } = W(e);
148
+ if ((a === 1 ? t : x).size !== 0)
149
+ return a === 1 ? K(e, /* @__PURE__ */ new Set(), x) : K(e, t, /* @__PURE__ */ new Set());
154
150
  }, fe = (e) => j(e, async () => {
155
- for (const r of N.get(e) ?? [])
156
- await m.request(ne(`/items/${a}/${r.id}`));
151
+ for (const a of N.get(e) ?? [])
152
+ await m.request(se(`/items/${r}/${a.id}`));
157
153
  }), xe = (e) => {
158
154
  e == null || e === "" || N.has(String(e)) || j(
159
155
  String(e),
160
156
  () => m.request(
161
- se(`/items/${a}`, {
157
+ le(`/items/${r}`, {
162
158
  [l]: u,
163
159
  [h]: e,
164
160
  ...F([null, null])
165
161
  })
166
162
  )
167
163
  );
168
- }, te = $(() => {
169
- const e = v.map((t) => ({ key: t, label: U.get(t) ?? `#${t}` })).sort((t, x) => t.label.localeCompare(x.label, void 0, { numeric: !0 })), r = S.trim();
170
- return r ? e.filter((t) => de(t.label, r)) : e;
171
- }, [v, U, S]), q = i.key_label ?? P(L ?? h), re = i.value_label ?? P(E ?? c), ae = s ? i.value_label_2 ?? P(J ?? s) : "", le = s ? "grid-cols-[minmax(140px,1fr)_minmax(0,1.5fr)_minmax(0,1.5fr)_28px]" : "grid-cols-[minmax(140px,1fr)_minmax(0,2fr)_28px]";
164
+ }, ee = S(() => {
165
+ const e = v.map((t) => ({ key: t, label: H.get(t) ?? `#${t}` })).sort((t, x) => t.label.localeCompare(x.label, void 0, { numeric: !0 })), a = _.trim();
166
+ return a ? e.filter((t) => de(t.label, a)) : e;
167
+ }, [v, H, _]), $ = c.key_label ?? O(L ?? h), te = c.value_label ?? O(B ?? i), re = n ? c.value_label_2 ?? O(E ?? n) : "", ae = n ? "grid-cols-[minmax(140px,1fr)_minmax(0,1.5fr)_minmax(0,1.5fr)_28px]" : "grid-cols-[minmax(140px,1fr)_minmax(0,2fr)_28px]";
172
168
  return y ? /* @__PURE__ */ b("p", { className: "rounded-lg border border-dashed border-slate-200 px-3 py-4 text-[12px] text-slate-500 dark:border-border dark:text-muted-foreground", children: [
173
169
  "Save this record first, then add ",
174
- q.toLowerCase(),
170
+ $.toLowerCase(),
175
171
  " here."
176
- ] }) : /* @__PURE__ */ b("div", { "data-membership-set": `${a}:${l}`, className: "space-y-2", children: [
172
+ ] }) : /* @__PURE__ */ b("div", { "data-membership-set": `${r}:${l}`, className: "space-y-2", children: [
177
173
  !o && L && /* @__PURE__ */ b("div", { className: "flex flex-wrap items-center gap-2", children: [
178
- /* @__PURE__ */ n("div", { className: "w-[320px] max-w-full", children: /* @__PURE__ */ n(
179
- Ce,
174
+ /* @__PURE__ */ s("div", { className: "w-[320px] max-w-full", children: /* @__PURE__ */ s(
175
+ Te,
180
176
  {
181
177
  collection: L,
182
178
  value: null,
183
179
  onChange: xe,
184
- placeholder: `Add ${q.toLowerCase()}…`,
180
+ placeholder: `Add ${$.toLowerCase()}…`,
185
181
  extraFilter: v.length && v.length <= 400 ? { id: { _nin: v } } : void 0
186
182
  },
187
183
  v.length
188
184
  ) }),
189
185
  v.length > 8 && /* @__PURE__ */ b("label", { className: "relative ml-auto block w-[220px] max-w-full", children: [
190
- /* @__PURE__ */ n(ge, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
191
- /* @__PURE__ */ n(
186
+ /* @__PURE__ */ s(ge, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
187
+ /* @__PURE__ */ s(
192
188
  "input",
193
189
  {
194
- value: S,
190
+ value: _,
195
191
  onChange: (e) => p(e.target.value),
196
192
  placeholder: `Filter ${v.length}…`,
197
- "aria-label": `Filter ${q}`,
193
+ "aria-label": `Filter ${$}`,
198
194
  className: "h-8 w-full rounded-md border border-slate-200 bg-background pl-7 pr-2 text-[12px] outline-none focus:border-nvr-cyan dark:border-border"
199
195
  }
200
196
  )
@@ -204,49 +200,49 @@ function Je({
204
200
  /* @__PURE__ */ b(
205
201
  "div",
206
202
  {
207
- className: _(
208
- le,
203
+ className: C(
204
+ ae,
209
205
  "grid gap-3 border-b border-slate-200 bg-slate-50 px-3 py-1.5 text-[10.5px] font-medium uppercase tracking-wide text-slate-500 dark:border-border dark:bg-muted dark:text-muted-foreground"
210
206
  ),
211
207
  children: [
212
- /* @__PURE__ */ n("span", { children: q }),
208
+ /* @__PURE__ */ s("span", { children: $ }),
213
209
  /* @__PURE__ */ b("span", { children: [
214
- re,
210
+ te,
215
211
  " ",
216
212
  /* @__PURE__ */ b("span", { className: "normal-case tracking-normal text-slate-400", children: [
217
213
  "· none picked = ",
218
214
  f.toLowerCase()
219
215
  ] })
220
216
  ] }),
221
- s && /* @__PURE__ */ b("span", { children: [
222
- ae,
217
+ n && /* @__PURE__ */ b("span", { children: [
218
+ re,
223
219
  " ",
224
220
  /* @__PURE__ */ b("span", { className: "normal-case tracking-normal text-slate-400", children: [
225
221
  "· none picked = ",
226
222
  w.toLowerCase()
227
223
  ] })
228
224
  ] }),
229
- /* @__PURE__ */ n("span", {})
225
+ /* @__PURE__ */ s("span", {})
230
226
  ]
231
227
  }
232
228
  ),
233
- me ? /* @__PURE__ */ n("div", { className: "space-y-2 p-3", children: [0, 1, 2].map((e) => /* @__PURE__ */ n("div", { className: "h-6 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" }, e)) }) : te.length === 0 ? /* @__PURE__ */ n("p", { className: "px-3 py-5 text-center text-[12px] text-slate-500 dark:text-muted-foreground", children: v.length ? "Nothing matches that filter." : `No ${q.toLowerCase()} yet.` }) : /* @__PURE__ */ n("ul", { className: "max-h-[480px] divide-y divide-slate-100 overflow-y-auto dark:divide-border", children: te.map((e) => {
234
- const r = N.get(e.key) ?? [], t = new Set(
235
- r.filter((d) => d.value !== null).map((d) => d.value)
229
+ me ? /* @__PURE__ */ s("div", { className: "space-y-2 p-3", children: [0, 1, 2].map((e) => /* @__PURE__ */ s("div", { className: "h-6 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" }, e)) }) : ee.length === 0 ? /* @__PURE__ */ s("p", { className: "px-3 py-5 text-center text-[12px] text-slate-500 dark:text-muted-foreground", children: v.length ? "Nothing matches that filter." : `No ${$.toLowerCase()} yet.` }) : /* @__PURE__ */ s("ul", { className: "max-h-[480px] divide-y divide-slate-100 overflow-y-auto dark:divide-border", children: ee.map((e) => {
230
+ const a = N.get(e.key) ?? [], t = new Set(
231
+ a.filter((d) => d.value !== null).map((d) => d.value)
236
232
  ), x = new Set(
237
- r.filter((d) => d.value2 !== null).map((d) => d.value2)
233
+ a.filter((d) => d.value2 !== null).map((d) => d.value2)
238
234
  );
239
235
  return /* @__PURE__ */ b(
240
236
  "li",
241
237
  {
242
238
  "data-membership-key": e.key,
243
- className: _(
244
- le,
239
+ className: C(
240
+ ae,
245
241
  "grid items-center gap-3 px-3 py-1.5 text-[12px]",
246
242
  k === e.key && "opacity-60"
247
243
  ),
248
244
  children: [
249
- /* @__PURE__ */ n(
245
+ /* @__PURE__ */ s(
250
246
  "span",
251
247
  {
252
248
  className: "truncate font-medium text-slate-800 dark:text-foreground",
@@ -254,31 +250,31 @@ function Je({
254
250
  children: e.label
255
251
  }
256
252
  ),
257
- /* @__PURE__ */ n(
258
- ie,
253
+ /* @__PURE__ */ s(
254
+ oe,
259
255
  {
260
256
  options: pe,
261
257
  picked: t,
262
258
  emptyLabel: f,
263
- valueTitle: re,
259
+ valueTitle: te,
264
260
  disabled: !!o || k === e.key,
265
- onToggle: (d) => I(e.key, d),
266
- onClear: () => ee(e.key)
261
+ onToggle: (d) => Z(e.key, d),
262
+ onClear: () => I(e.key)
267
263
  }
268
264
  ),
269
- s && /* @__PURE__ */ n(
270
- ie,
265
+ n && /* @__PURE__ */ s(
266
+ oe,
271
267
  {
272
268
  options: be,
273
269
  picked: x,
274
270
  emptyLabel: w,
275
- valueTitle: ae,
271
+ valueTitle: re,
276
272
  disabled: !!o || k === e.key,
277
- onToggle: (d) => I(e.key, d, 2),
278
- onClear: () => ee(e.key, 2)
273
+ onToggle: (d) => Z(e.key, d, 2),
274
+ onClear: () => I(e.key, 2)
279
275
  }
280
276
  ),
281
- o ? /* @__PURE__ */ n("span", {}) : /* @__PURE__ */ n(
277
+ o ? /* @__PURE__ */ s("span", {}) : /* @__PURE__ */ s(
282
278
  "button",
283
279
  {
284
280
  type: "button",
@@ -287,7 +283,7 @@ function Je({
287
283
  "aria-label": `Remove ${e.label}`,
288
284
  "data-tip": "Remove",
289
285
  className: "flex h-6 w-6 items-center justify-center rounded text-slate-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-500/10",
290
- children: /* @__PURE__ */ n(ve, { className: "h-3.5 w-3.5" })
286
+ children: /* @__PURE__ */ s(ve, { className: "h-3.5 w-3.5" })
291
287
  }
292
288
  )
293
289
  ]
@@ -296,36 +292,36 @@ function Je({
296
292
  );
297
293
  }) })
298
294
  ] }),
299
- B && /* @__PURE__ */ n("p", { className: "text-[12px] text-red-600 dark:text-red-400", children: B })
295
+ z && /* @__PURE__ */ s("p", { className: "text-[12px] text-red-600 dark:text-red-400", children: z })
300
296
  ] });
301
297
  }
302
- function ie({
303
- options: a,
298
+ function oe({
299
+ options: r,
304
300
  picked: l,
305
301
  emptyLabel: u,
306
- valueTitle: i,
302
+ valueTitle: c,
307
303
  disabled: o,
308
304
  onToggle: m,
309
305
  onClear: g
310
306
  }) {
311
- const [y, h] = C(!1), [c, s] = C(""), f = l.size === 0;
312
- if (a.length <= Ke)
307
+ const [y, h] = q(!1), [i, n] = q(""), f = l.size === 0;
308
+ if (r.length <= Fe)
313
309
  return /* @__PURE__ */ b("div", { className: "flex flex-wrap items-center gap-1", "data-membership-values": !0, children: [
314
- /* @__PURE__ */ n(
310
+ /* @__PURE__ */ s(
315
311
  "button",
316
312
  {
317
313
  type: "button",
318
314
  disabled: o || f,
319
315
  "aria-pressed": f,
320
316
  onClick: g,
321
- className: _(
317
+ className: C(
322
318
  "h-6 rounded-full border px-2 text-[11px] transition-colors",
323
319
  f ? "border-nvr-cyan/40 bg-nvr-cyan/10 font-medium text-slate-800 dark:text-foreground" : "border-slate-200 text-slate-500 hover:bg-muted dark:border-border dark:text-muted-foreground"
324
320
  ),
325
321
  children: u
326
322
  }
327
323
  ),
328
- a.map((p) => {
324
+ r.map((p) => {
329
325
  const k = l.has(p.id);
330
326
  return /* @__PURE__ */ b(
331
327
  "button",
@@ -335,12 +331,12 @@ function ie({
335
331
  "aria-pressed": k,
336
332
  "data-membership-value": p.id,
337
333
  onClick: () => m(p.id),
338
- className: _(
334
+ className: C(
339
335
  "inline-flex h-6 items-center gap-1 rounded-full border px-2 text-[11px] transition-colors",
340
336
  k ? "border-nvr-cyan/40 bg-nvr-cyan/10 font-medium text-slate-800 dark:text-foreground" : "border-slate-200 text-slate-500 hover:bg-muted dark:border-border dark:text-muted-foreground"
341
337
  ),
342
338
  children: [
343
- k && /* @__PURE__ */ n(O, { className: "h-3 w-3" }),
339
+ k && /* @__PURE__ */ s(R, { className: "h-3 w-3" }),
344
340
  p.label
345
341
  ]
346
342
  },
@@ -348,32 +344,32 @@ function ie({
348
344
  );
349
345
  })
350
346
  ] });
351
- const w = c.trim() ? a.filter((p) => de(p.label, c)) : a, S = f ? u : a.filter((p) => l.has(p.id)).map((p) => p.label).join(", ");
352
- return /* @__PURE__ */ b(_e, { open: y, onOpenChange: h, children: [
353
- /* @__PURE__ */ n($e, { asChild: !0, children: /* @__PURE__ */ b(
347
+ const w = i.trim() ? r.filter((p) => de(p.label, i)) : r, _ = f ? u : r.filter((p) => l.has(p.id)).map((p) => p.label).join(", ");
348
+ return /* @__PURE__ */ b($e, { open: y, onOpenChange: h, children: [
349
+ /* @__PURE__ */ s(qe, { asChild: !0, children: /* @__PURE__ */ b(
354
350
  "button",
355
351
  {
356
352
  type: "button",
357
353
  disabled: o,
358
354
  className: "flex h-7 w-full items-center justify-between gap-2 rounded-md border border-slate-200 bg-background px-2 text-left text-[12px] dark:border-border",
359
355
  children: [
360
- /* @__PURE__ */ n("span", { className: _("truncate", f && "text-slate-500 dark:text-muted-foreground"), children: S }),
361
- /* @__PURE__ */ n(we, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
356
+ /* @__PURE__ */ s("span", { className: C("truncate", f && "text-slate-500 dark:text-muted-foreground"), children: _ }),
357
+ /* @__PURE__ */ s(we, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
362
358
  ]
363
359
  }
364
360
  ) }),
365
- /* @__PURE__ */ b(Se, { align: "start", className: "w-[260px] p-1", children: [
366
- /* @__PURE__ */ n(
361
+ /* @__PURE__ */ b(Le, { align: "start", className: "w-[260px] p-1", children: [
362
+ /* @__PURE__ */ s(
367
363
  "input",
368
364
  {
369
- value: c,
370
- onChange: (p) => s(p.target.value),
371
- placeholder: `Search ${i.toLowerCase()}…`,
365
+ value: i,
366
+ onChange: (p) => n(p.target.value),
367
+ placeholder: `Search ${c.toLowerCase()}…`,
372
368
  className: "mb-1 h-7 w-full rounded border border-slate-200 bg-background px-2 text-[12px] outline-none dark:border-border"
373
369
  }
374
370
  ),
375
371
  /* @__PURE__ */ b("ul", { className: "max-h-[240px] overflow-y-auto", children: [
376
- !c.trim() && /* @__PURE__ */ n("li", { className: "mb-1 border-b border-slate-100 pb-1 dark:border-border", children: /* @__PURE__ */ b(
372
+ !i.trim() && /* @__PURE__ */ s("li", { className: "mb-1 border-b border-slate-100 pb-1 dark:border-border", children: /* @__PURE__ */ b(
377
373
  "button",
378
374
  {
379
375
  type: "button",
@@ -384,22 +380,22 @@ function ie({
384
380
  "data-membership-clear": !0,
385
381
  className: "flex w-full items-center gap-2 rounded px-2 py-1 text-left text-[12px] font-medium hover:bg-muted",
386
382
  children: [
387
- /* @__PURE__ */ n(O, { className: _("h-3.5 w-3.5", f ? "opacity-100" : "opacity-0") }),
383
+ /* @__PURE__ */ s(R, { className: C("h-3.5 w-3.5", f ? "opacity-100" : "opacity-0") }),
388
384
  u
389
385
  ]
390
386
  }
391
387
  ) }),
392
- w.map((p) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ b(
388
+ w.map((p) => /* @__PURE__ */ s("li", { children: /* @__PURE__ */ b(
393
389
  "button",
394
390
  {
395
391
  type: "button",
396
392
  onClick: () => m(p.id),
397
393
  className: "flex w-full items-center gap-2 rounded px-2 py-1 text-left text-[12px] hover:bg-muted",
398
394
  children: [
399
- /* @__PURE__ */ n(
400
- O,
395
+ /* @__PURE__ */ s(
396
+ R,
401
397
  {
402
- className: _("h-3.5 w-3.5", l.has(p.id) ? "opacity-100" : "opacity-0")
398
+ className: C("h-3.5 w-3.5", l.has(p.id) ? "opacity-100" : "opacity-0")
403
399
  }
404
400
  ),
405
401
  p.label
@@ -411,6 +407,6 @@ function ie({
411
407
  ] });
412
408
  }
413
409
  export {
414
- Je as MembershipSetField,
415
- Le as planMembershipRows
410
+ Xe as MembershipSetField,
411
+ Me as planMembershipRows
416
412
  };