@nivaro/react 0.3.116 → 0.3.118

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 (142) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +140 -14
  4. package/dist/index.js +488 -485
  5. package/dist/shared/components/ActivityEntry.js +130 -125
  6. package/dist/shared/components/AgentPresenceChip.js +36 -26
  7. package/dist/shared/components/CellCopyLayer.js +50 -45
  8. package/dist/shared/components/CollectionBrowserView.js +3855 -3785
  9. package/dist/shared/components/FilePreviewLightbox.js +96 -58
  10. package/dist/shared/components/InStep.js +18 -17
  11. package/dist/shared/components/ItemEditForm.js +4220 -4175
  12. package/dist/shared/components/JobsTray.js +8 -8
  13. package/dist/shared/components/LiveNewMatchesPill.js +21 -14
  14. package/dist/shared/components/LiveOffNote.js +3 -2
  15. package/dist/shared/components/LiveRowMark.js +53 -23
  16. package/dist/shared/components/LiveTraceView.js +162 -123
  17. package/dist/shared/components/MyWorkView.js +320 -299
  18. package/dist/shared/components/NotificationBell.js +14 -14
  19. package/dist/shared/components/OverflowRail.js +1 -1
  20. package/dist/shared/components/PageRenderer.js +120 -116
  21. package/dist/shared/components/ProfileView.js +203 -202
  22. package/dist/shared/components/RealtimeStatusBanner.js +31 -29
  23. package/dist/shared/components/RecordDrilldownSheet.js +7 -7
  24. package/dist/shared/components/RecordHoverCard.js +102 -84
  25. package/dist/shared/components/RecordReadView.js +146 -146
  26. package/dist/shared/components/ReportView.js +1086 -1091
  27. package/dist/shared/components/ScreenRefreshButton.js +34 -32
  28. package/dist/shared/components/TipLayer.js +65 -58
  29. package/dist/shared/components/WidgetImageMenu.js +83 -43
  30. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  31. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  32. package/dist/shared/components/cbv/column-totals.js +62 -57
  33. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  34. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  35. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  36. package/dist/shared/components/charts/category-axis.js +93 -0
  37. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  38. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  39. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  40. package/dist/shared/components/collections-directory/page-model.js +72 -67
  41. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  42. package/dist/shared/components/integrations/SendStatus.js +65 -59
  43. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  44. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  45. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  46. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
  47. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  48. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  49. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  50. package/dist/shared/components/item-edit/FieldComments.js +54 -53
  51. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  52. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  53. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  54. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  55. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  56. package/dist/shared/components/item-edit/HeaderTools.js +94 -85
  57. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  58. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  59. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  60. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  61. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  62. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  63. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  64. package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
  65. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  66. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  67. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  68. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  69. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  70. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  71. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  72. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  73. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  74. package/dist/shared/components/item-edit/UserChip.js +1 -1
  75. package/dist/shared/components/item-edit/file-live.js +69 -54
  76. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  77. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  78. package/dist/shared/components/item-edit/removed-line.js +31 -25
  79. package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
  80. package/dist/shared/components/list/ListViewers.js +46 -35
  81. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  82. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  83. package/dist/shared/components/panels/AlertBanners.js +82 -72
  84. package/dist/shared/components/panels/BranchLanes.js +22 -22
  85. package/dist/shared/components/panels/CommentImages.js +123 -102
  86. package/dist/shared/components/panels/CommentPanel.js +186 -185
  87. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  88. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  89. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  90. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  91. package/dist/shared/components/pipeline/BindingStartStateSettings.js +163 -0
  92. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  93. package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
  94. package/dist/shared/components/profile/AgentNameField.js +107 -81
  95. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  96. package/dist/shared/components/profile/PersonAccess.js +599 -495
  97. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  98. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  99. package/dist/shared/components/profile/primitives.js +1 -1
  100. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  101. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  102. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  103. package/dist/shared/components/support/AssignRules.js +1733 -0
  104. package/dist/shared/components/support/PersonPick.js +88 -0
  105. package/dist/shared/components/support/RequestList.js +790 -0
  106. package/dist/shared/components/support/ScreenShare.js +158 -152
  107. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  108. package/dist/shared/components/support/SupportView.js +140 -246
  109. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  110. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  111. package/dist/shared/components/support/assign-rules-text.js +171 -0
  112. package/dist/shared/components/support/support-list.js +125 -0
  113. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  114. package/dist/shared/components/ui/checkbox.js +6 -6
  115. package/dist/shared/components/ui/select.js +43 -39
  116. package/dist/shared/components/ui/sheet.js +9 -9
  117. package/dist/shared/components/ui/switch.js +12 -11
  118. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  119. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  120. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  121. package/dist/shared/lib/activity-sentence.js +103 -91
  122. package/dist/shared/lib/agent-presence.js +27 -21
  123. package/dist/shared/lib/approval-progress.js +2 -2
  124. package/dist/shared/lib/copy-rules.js +31 -24
  125. package/dist/shared/lib/derived-causes.js +113 -78
  126. package/dist/shared/lib/grid-cursors.js +26 -26
  127. package/dist/shared/lib/label-flash.js +27 -0
  128. package/dist/shared/lib/list-return.js +137 -125
  129. package/dist/shared/lib/live-deltas.js +40 -34
  130. package/dist/shared/lib/live-groups.js +56 -52
  131. package/dist/shared/lib/live-preference.js +64 -59
  132. package/dist/shared/lib/live-screen.js +223 -192
  133. package/dist/shared/lib/partner-failure.js +11 -11
  134. package/dist/shared/lib/rollup-recalc.js +68 -64
  135. package/dist/shared/lib/screen-refresh.js +74 -68
  136. package/dist/shared/lib/screen-share.js +108 -104
  137. package/dist/shared/lib/send-status.js +77 -61
  138. package/dist/shared/lib/text-diff-window.js +29 -0
  139. package/dist/shared/lib/use-query-entry.js +17 -0
  140. package/dist/shared/lib/watch-list.js +210 -209
  141. package/dist/shared/lib/widget-image-render.js +72 -49
  142. package/package.json +1 -1
@@ -1,26 +1,27 @@
1
- import { jsx as a, jsxs as i } from "react/jsx-runtime";
2
- import { useState as x } from "react";
1
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
2
+ import { useState as b } from "react";
3
3
  import { cn as l } from "../../lib/utils.js";
4
- import { UserAvatar as h } from "../UserAvatar.js";
5
- import { Popover as b, PopoverTrigger as v, PopoverContent as k } from "../ui/popover.js";
6
- const p = {
4
+ import { UserChip as p } from "../item-edit/UserChip.js";
5
+ import { UserAvatar as v } from "../UserAvatar.js";
6
+ import { Popover as k, PopoverTrigger as N, PopoverContent as y } from "../ui/popover.js";
7
+ const m = {
7
8
  suspended: "suspended",
8
9
  former: "former user"
9
10
  };
10
- function N(e) {
11
- return e.inactive ? `${e.name} (${p[e.inactive]})` : e.name;
11
+ function g(e) {
12
+ return e.inactive ? `${e.name} (${m[e.inactive]})` : e.name;
12
13
  }
13
- function f({ owner: e }) {
14
- return e.inactive ? /* @__PURE__ */ a(
14
+ function c({ owner: e }) {
15
+ return e.inactive ? /* @__PURE__ */ n(
15
16
  "span",
16
17
  {
17
18
  "data-owner-inactive": e.inactive,
18
19
  className: "ml-1 shrink-0 rounded bg-slate-100 px-1 py-px text-[10px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
19
- children: p[e.inactive]
20
+ children: m[e.inactive]
20
21
  }
21
22
  ) : null;
22
23
  }
23
- const o = [
24
+ const u = [
24
25
  { bg: "#e0f2fe", fg: "#075985" },
25
26
  // sky
26
27
  { bg: "#dcfce7", fg: "#166534" },
@@ -46,33 +47,33 @@ const o = [
46
47
  { bg: "#f3e8ff", fg: "#6b21a8" }
47
48
  // purple
48
49
  ];
49
- function y(e) {
50
- let n = 0;
51
- for (let r = 0; r < e.length; r++) n = n * 31 + e.charCodeAt(r) | 0;
52
- return o[Math.abs(n) % o.length];
53
- }
54
50
  function C(e) {
55
- const n = e.trim().split(/\s+/);
56
- return n.length === 1 ? n[0].slice(0, 2).toUpperCase() : (n[0][0] + n[n.length - 1][0]).toUpperCase();
51
+ let a = 0;
52
+ for (let i = 0; i < e.length; i++) a = a * 31 + e.charCodeAt(i) | 0;
53
+ return u[Math.abs(a) % u.length];
54
+ }
55
+ function w(e) {
56
+ const a = e.trim().split(/\s+/);
57
+ return a.length === 1 ? a[0].slice(0, 2).toUpperCase() : (a[0][0] + a[a.length - 1][0]).toUpperCase();
57
58
  }
58
- function d({ owner: e, className: n }) {
59
- const r = y(e.id);
60
- return /* @__PURE__ */ a(
61
- h,
59
+ function o({ owner: e, className: a }) {
60
+ const i = C(e.id);
61
+ return /* @__PURE__ */ n(
62
+ v,
62
63
  {
63
64
  userId: e.id,
64
65
  alt: e.name,
65
- className: l("h-[22px] w-[22px] ring-2 ring-white dark:ring-card", n),
66
- fallback: /* @__PURE__ */ a(
66
+ className: l("h-[22px] w-[22px] ring-2 ring-white dark:ring-card", a),
67
+ fallback: /* @__PURE__ */ n(
67
68
  "span",
68
69
  {
69
70
  title: e.name,
70
71
  className: l(
71
72
  "inline-flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-full text-[9px] font-semibold ring-2 ring-white dark:ring-card",
72
- n
73
+ a
73
74
  ),
74
- style: { backgroundColor: r.bg, color: r.fg },
75
- children: C(e.name)
75
+ style: { backgroundColor: i.bg, color: i.fg },
76
+ children: w(e.name)
76
77
  }
77
78
  )
78
79
  }
@@ -80,38 +81,66 @@ function d({ owner: e, className: n }) {
80
81
  }
81
82
  function T({
82
83
  owners: e,
83
- max: n = 4,
84
- emptyLabel: r = "No owners"
84
+ max: a = 4,
85
+ emptyLabel: i = "No owners"
85
86
  }) {
86
- const [g, m] = x(!1);
87
+ const [h, x] = b(!1);
87
88
  if (e.length === 0)
88
- return /* @__PURE__ */ a("span", { "data-cell-empty": !0, className: "text-[12px] text-slate-300 dark:text-muted-foreground", children: r });
89
- const c = e.slice(0, n), s = e.length - c.length;
90
- return /* @__PURE__ */ i(b, { open: g, onOpenChange: m, children: [
91
- /* @__PURE__ */ a(v, { asChild: !0, children: /* @__PURE__ */ i(
89
+ return /* @__PURE__ */ n("span", { "data-cell-empty": !0, className: "text-[12px] text-slate-300 dark:text-muted-foreground", children: i });
90
+ if (e.length === 1) {
91
+ const t = e[0];
92
+ return /* @__PURE__ */ n(p, { userId: t.id, children: /* @__PURE__ */ r(
93
+ "button",
94
+ {
95
+ type: "button",
96
+ onClick: (s) => s.stopPropagation(),
97
+ "aria-label": `1 owner: ${g(t)}`,
98
+ className: "group/owners flex min-w-0 items-center rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
99
+ children: [
100
+ /* @__PURE__ */ n(o, { owner: t, className: l(t.inactive && "opacity-50 grayscale") }),
101
+ /* @__PURE__ */ r("span", { className: "ml-1.5 flex min-w-0 items-center", children: [
102
+ /* @__PURE__ */ n(
103
+ "span",
104
+ {
105
+ className: l(
106
+ "truncate text-[12px] text-slate-600 group-hover/owners:text-slate-800 group-hover/owners:underline dark:text-slate-300 dark:group-hover/owners:text-slate-100",
107
+ t.inactive && "line-through decoration-slate-400"
108
+ ),
109
+ children: t.name
110
+ }
111
+ ),
112
+ /* @__PURE__ */ n(c, { owner: t })
113
+ ] })
114
+ ]
115
+ }
116
+ ) });
117
+ }
118
+ const d = e.slice(0, a), f = e.length - d.length;
119
+ return /* @__PURE__ */ r(k, { open: h, onOpenChange: x, children: [
120
+ /* @__PURE__ */ n(N, { asChild: !0, children: /* @__PURE__ */ r(
92
121
  "button",
93
122
  {
94
123
  type: "button",
95
124
  onClick: (t) => t.stopPropagation(),
96
- "aria-label": `${e.length} owner${e.length === 1 ? "" : "s"}: ${e.map(N).join(", ")}`,
125
+ "aria-label": `${e.length} owner${e.length === 1 ? "" : "s"}: ${e.map(g).join(", ")}`,
97
126
  className: "group/owners flex items-center rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
98
127
  children: [
99
- /* @__PURE__ */ i("span", { className: "flex items-center transition-[gap]", children: [
100
- c.map((t, u) => /* @__PURE__ */ a(
101
- d,
128
+ /* @__PURE__ */ r("span", { className: "flex items-center transition-[gap]", children: [
129
+ d.map((t, s) => /* @__PURE__ */ n(
130
+ o,
102
131
  {
103
132
  owner: t,
104
- className: l(u > 0 && "-ml-1.5", t.inactive && "opacity-50 grayscale")
133
+ className: l(s > 0 && "-ml-0.5", t.inactive && "opacity-50 grayscale")
105
134
  },
106
135
  t.id
107
136
  )),
108
- s > 0 && /* @__PURE__ */ i("span", { className: "-ml-1.5 inline-flex h-[22px] min-w-[22px] shrink-0 items-center justify-center rounded-full bg-slate-100 px-1 text-[9px] font-semibold text-slate-600 ring-2 ring-white dark:bg-muted dark:text-slate-300 dark:ring-card", children: [
137
+ f > 0 && /* @__PURE__ */ r("span", { className: "-ml-0.5 inline-flex h-[22px] min-w-[22px] shrink-0 items-center justify-center rounded-full bg-slate-100 px-1 text-[9px] font-semibold text-slate-600 ring-2 ring-white dark:bg-muted dark:text-slate-300 dark:ring-card", children: [
109
138
  "+",
110
- s
139
+ f
111
140
  ] })
112
141
  ] }),
113
- e.length === 1 && /* @__PURE__ */ i("span", { className: "ml-1.5 flex min-w-0 items-center", children: [
114
- /* @__PURE__ */ a(
142
+ e.length === 1 && /* @__PURE__ */ r("span", { className: "ml-1.5 flex min-w-0 items-center", children: [
143
+ /* @__PURE__ */ n(
115
144
  "span",
116
145
  {
117
146
  className: l(
@@ -121,29 +150,37 @@ function T({
121
150
  children: e[0].name
122
151
  }
123
152
  ),
124
- /* @__PURE__ */ a(f, { owner: e[0] })
153
+ /* @__PURE__ */ n(c, { owner: e[0] })
125
154
  ] }),
126
- e.length > 1 && e.some((t) => t.inactive) && /* @__PURE__ */ a("span", { className: "ml-1.5 text-[10px] text-slate-500 dark:text-slate-400", children: e.every((t) => t.inactive) ? "none can act" : `${e.filter((t) => t.inactive).length} can’t act` })
155
+ e.length > 1 && e.some((t) => t.inactive) && /* @__PURE__ */ n("span", { className: "ml-1.5 text-[10px] text-slate-500 dark:text-slate-400", children: e.every((t) => t.inactive) ? "none can act" : `${e.filter((t) => t.inactive).length} can’t act` })
127
156
  ]
128
157
  }
129
158
  ) }),
130
- /* @__PURE__ */ i(
131
- k,
159
+ /* @__PURE__ */ r(
160
+ y,
132
161
  {
133
162
  className: "w-[240px] p-1.5",
134
163
  align: "start",
135
164
  onClick: (t) => t.stopPropagation(),
136
165
  children: [
137
- /* @__PURE__ */ i("p", { className: "px-2 pb-1 pt-0.5 text-[10px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: [
166
+ /* @__PURE__ */ r("p", { className: "px-2 pb-1 pt-0.5 text-[10px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: [
138
167
  e.length,
139
168
  " owner",
140
169
  e.length === 1 ? "" : "s"
141
170
  ] }),
142
- /* @__PURE__ */ a("div", { className: "max-h-[260px] space-y-0.5 overflow-y-auto", children: e.map((t) => /* @__PURE__ */ i("div", { className: "flex items-center gap-2 rounded px-2 py-1", children: [
143
- /* @__PURE__ */ a(d, { owner: t }),
144
- /* @__PURE__ */ a("span", { className: "truncate text-[12px] text-slate-700 dark:text-slate-200", children: t.name }),
145
- /* @__PURE__ */ a(f, { owner: t })
146
- ] }, t.id)) })
171
+ /* @__PURE__ */ n("div", { className: "max-h-[260px] space-y-0.5 overflow-y-auto", children: e.map((t) => /* @__PURE__ */ n(p, { userId: t.id, children: /* @__PURE__ */ r(
172
+ "button",
173
+ {
174
+ type: "button",
175
+ "data-owner-person": t.id,
176
+ className: "flex w-full items-center gap-2 rounded px-2 py-1 text-left hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan dark:hover:bg-white/5",
177
+ children: [
178
+ /* @__PURE__ */ n(o, { owner: t }),
179
+ /* @__PURE__ */ n("span", { className: "truncate text-[12px] text-slate-700 dark:text-slate-200", children: t.name }),
180
+ /* @__PURE__ */ n(c, { owner: t })
181
+ ]
182
+ }
183
+ ) }, t.id)) })
147
184
  ]
148
185
  }
149
186
  )
@@ -151,5 +188,5 @@ function T({
151
188
  }
152
189
  export {
153
190
  T as OwnerAvatars,
154
- N as ownerText
191
+ g as ownerText
155
192
  };
@@ -1,36 +1,37 @@
1
1
  import { jsx as a, jsxs as o, Fragment as A } from "react/jsx-runtime";
2
2
  import { readOnlinePresence as C } from "@nivaro/sdk";
3
3
  import { useQuery as O } from "@tanstack/react-query";
4
- import { useMemo as L, useState as P } from "react";
5
- import { useNivaroClient as U } from "../../context.js";
4
+ import { useMemo as P, useState as U } from "react";
5
+ import { useNivaroClient as L } from "../../context.js";
6
6
  import { get as E } from "../../lib/commands.js";
7
- import { useLiveEvent as j } from "../../lib/live.js";
8
- import { useLivePreference as F } from "../../lib/live-preference.js";
9
- import { usePresenceStates as I } from "../../lib/use-online-users.js";
7
+ import { useLiveEvent as I } from "../../lib/live.js";
8
+ import { useLivePreference as j } from "../../lib/live-preference.js";
9
+ import { usePresenceStates as F } from "../../lib/use-online-users.js";
10
10
  import { cn as b } from "../../lib/utils.js";
11
11
  import { UserAvatar as R } from "../UserAvatar.js";
12
- import { Popover as z, PopoverTrigger as M, PopoverContent as D } from "../ui/popover.js";
13
- const B = {
12
+ import { UserChip as z } from "../item-edit/UserChip.js";
13
+ import { Popover as M, PopoverTrigger as D, PopoverContent as B } from "../ui/popover.js";
14
+ const K = {
14
15
  online: "Online",
15
16
  away: "Away",
16
17
  out: "Out of office",
17
18
  offline: "Not online"
18
19
  }, q = { online: 0, away: 1, out: 2, offline: 3 };
19
- function K(n, e) {
20
+ function G(n, e) {
20
21
  return n.out_of_office ? "out" : e === "online" ? "online" : e === "idle" ? "away" : "offline";
21
22
  }
22
- function G(n) {
23
+ function Q(n) {
23
24
  const e = new Date(n);
24
25
  return Number.isNaN(e.getTime()) ? null : e.toLocaleDateString(void 0, { month: "short", day: "numeric" });
25
26
  }
26
- function Q(n) {
27
- const e = n.ooo_end ? G(n.ooo_end) : null, t = e ? `Out of office until ${e}` : "Out of office";
27
+ function W(n) {
28
+ const e = n.ooo_end ? Q(n.ooo_end) : null, t = e ? `Out of office until ${e}` : "Out of office";
28
29
  return n.covered_by ? `${t} · ${n.covered_by.name} covers` : t;
29
30
  }
30
- function W(n, e) {
31
+ function Y(n, e) {
31
32
  return n.map((t) => ({
32
33
  member: t,
33
- status: K(t, e.get(t.id.toUpperCase()))
34
+ status: G(t, e.get(t.id.toUpperCase()))
34
35
  })).sort(
35
36
  (t, s) => q[t.status] - q[s.status] || t.member.name.localeCompare(s.member.name)
36
37
  );
@@ -39,7 +40,7 @@ function T(n) {
39
40
  const e = (s) => n.filter((i) => i.status === s).length, t = [];
40
41
  return e("online") && t.push(`${e("online")} online`), e("away") && t.push(`${e("away")} away`), e("out") && t.push(`${e("out")} out`), t.length ? t.join(" · ") : "No one online";
41
42
  }
42
- const Y = {
43
+ const H = {
43
44
  online: "bg-emerald-500",
44
45
  away: "bg-amber-500",
45
46
  offline: "bg-slate-300 dark:bg-slate-600",
@@ -50,7 +51,7 @@ const Y = {
50
51
  out: "Out of office",
51
52
  offline: "Not online"
52
53
  };
53
- function H(n) {
54
+ function V(n) {
54
55
  var t;
55
56
  const e = n.trim().split(/\s+/).filter(Boolean);
56
57
  return ((((t = e[0]) == null ? void 0 : t[0]) ?? "") + (e.length > 1 ? e[e.length - 1][0] ?? "" : "")).toUpperCase().slice(0, 2);
@@ -83,7 +84,7 @@ function _({
83
84
  l
84
85
  ),
85
86
  style: { width: r, height: r },
86
- children: H(i.name)
87
+ children: V(i.name)
87
88
  }
88
89
  )
89
90
  }
@@ -95,7 +96,7 @@ function _({
95
96
  className: b(
96
97
  "absolute right-0 bottom-0 h-2 w-2 rounded-full ring-[1.5px]",
97
98
  l,
98
- Y[u]
99
+ H[u]
99
100
  )
100
101
  }
101
102
  )
@@ -103,11 +104,11 @@ function _({
103
104
  }
104
105
  );
105
106
  }
106
- const V = 6, J = ["online", "away", "out", "offline"], X = /* @__PURE__ */ new Map();
107
- function Z({ rows: n, more: e, note: t }) {
108
- const [s, i] = P(!1), u = (r) => n.filter((l) => l.status === r);
107
+ const J = 6, X = ["online", "away", "out", "offline"], Z = /* @__PURE__ */ new Map();
108
+ function ee({ rows: n, more: e, note: t }) {
109
+ const [s, i] = U(!1), u = (r) => n.filter((l) => l.status === r);
109
110
  return /* @__PURE__ */ o(A, { children: [
110
- /* @__PURE__ */ a("div", { className: "max-h-[340px] overflow-y-auto", children: J.map((r) => {
111
+ /* @__PURE__ */ a("div", { className: "max-h-[340px] overflow-y-auto", children: X.map((r) => {
111
112
  const l = u(r);
112
113
  if (l.length === 0) return null;
113
114
  const f = r === "offline" && !s;
@@ -143,20 +144,21 @@ function Z({ rows: n, more: e, note: t }) {
143
144
  }
144
145
  )
145
146
  ] }),
146
- !f && /* @__PURE__ */ a("ul", { children: l.map((c) => /* @__PURE__ */ o(
147
- "li",
147
+ !f && /* @__PURE__ */ a("ul", { children: l.map((c) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(z, { userId: c.member.id, children: /* @__PURE__ */ o(
148
+ "button",
148
149
  {
149
- className: "flex items-center gap-2.5 rounded-md px-2 py-1.5",
150
+ type: "button",
151
+ "data-team-person": c.member.id,
152
+ className: "flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan dark:hover:bg-slate-800",
150
153
  children: [
151
154
  /* @__PURE__ */ a(_, { row: c, size: 26, surface: "popover" }),
152
155
  /* @__PURE__ */ o("span", { className: "min-w-0 flex-1", children: [
153
156
  /* @__PURE__ */ a("span", { className: "block truncate font-medium text-[13px] text-slate-800 dark:text-slate-100", children: c.member.name }),
154
- c.status === "out" && /* @__PURE__ */ a("span", { className: "block text-[11px] text-slate-500 dark:text-slate-400", children: Q(c.member) })
157
+ c.status === "out" && /* @__PURE__ */ a("span", { className: "block text-[11px] text-slate-500 dark:text-slate-400", children: W(c.member) })
155
158
  ] })
156
159
  ]
157
- },
158
- c.member.id
159
- )) })
160
+ }
161
+ ) }) }, c.member.id)) })
160
162
  ] }, r);
161
163
  }) }),
162
164
  e > 0 && /* @__PURE__ */ o("p", { className: "px-2 py-1.5 text-[11px] text-slate-500 dark:text-slate-400", children: [
@@ -174,23 +176,23 @@ function Z({ rows: n, more: e, note: t }) {
174
176
  )
175
177
  ] });
176
178
  }
177
- function me({
179
+ function pe({
178
180
  queueId: n,
179
181
  right: e
180
182
  }) {
181
- var k, N;
182
- const t = U(), s = F(), { data: i, refetch: u } = O({
183
+ var v, k;
184
+ const t = L(), s = j(), { data: i, refetch: u } = O({
183
185
  queryKey: ["queue-team", n],
184
186
  queryFn: () => t.request(E(`/queues/${n}/team`)),
185
187
  staleTime: 6e4,
186
188
  refetchOnWindowFocus: !1,
187
189
  retry: !1
188
190
  });
189
- j("owners:changed", () => void u(), {
191
+ I("owners:changed", () => void u(), {
190
192
  debounceMs: 2e3,
191
193
  enabled: !s.quiet
192
194
  });
193
- const r = I(!s.quiet), l = O({
195
+ const r = F(!s.quiet), l = O({
194
196
  queryKey: ["queue-team-presence-frozen", n],
195
197
  queryFn: () => t.request(C()),
196
198
  enabled: s.quiet,
@@ -202,15 +204,15 @@ function me({
202
204
  select: (d) => {
203
205
  const p = /* @__PURE__ */ new Map();
204
206
  for (const g of (d == null ? void 0 : d.data) ?? []) {
205
- const v = String(g.user_id ?? "").toUpperCase();
206
- v && p.set(v, g.is_idle || g.away ? "idle" : "online");
207
+ const N = String(g.user_id ?? "").toUpperCase();
208
+ N && p.set(N, g.is_idle || g.away ? "idle" : "online");
207
209
  }
208
210
  return p;
209
211
  }
210
- }), f = s.quiet ? l.data ?? X : r, c = (k = i == null ? void 0 : i.data) == null ? void 0 : k.members, w = ((N = i == null ? void 0 : i.data) == null ? void 0 : N.more) ?? 0, m = L(() => W(c ?? [], f), [c, f]);
212
+ }), f = s.quiet ? l.data ?? Z : r, c = (v = i == null ? void 0 : i.data) == null ? void 0 : v.members, w = ((k = i == null ? void 0 : i.data) == null ? void 0 : k.more) ?? 0, m = P(() => Y(c ?? [], f), [c, f]);
211
213
  if (m.length === 0)
212
214
  return e ? /* @__PURE__ */ a("div", { className: "hidden shrink-0 items-center justify-end border-slate-100 border-b bg-white px-4 py-1.5 text-[12px] has-[[data-list-viewers]]:flex dark:border-slate-800 dark:bg-slate-900", children: e }) : null;
213
- const h = m.slice(0, V), y = m.length - h.length + w, x = s.quiet && l.dataUpdatedAt ? new Date(l.dataUpdatedAt).toLocaleTimeString(void 0, {
215
+ const h = m.slice(0, J), y = m.length - h.length + w, x = s.quiet && l.dataUpdatedAt ? new Date(l.dataUpdatedAt).toLocaleTimeString(void 0, {
214
216
  hour: "numeric",
215
217
  minute: "2-digit"
216
218
  }) : null, $ = s.quiet ? `${x ? `As of ${x} · ` : ""}live updates are off in ${s.calm ? "Calm" : "Off"} mode` : null;
@@ -229,8 +231,8 @@ function me({
229
231
  children: "Owners"
230
232
  }
231
233
  ),
232
- /* @__PURE__ */ o(z, { children: [
233
- /* @__PURE__ */ a(M, { asChild: !0, children: /* @__PURE__ */ o(
234
+ /* @__PURE__ */ o(M, { children: [
235
+ /* @__PURE__ */ a(D, { asChild: !0, children: /* @__PURE__ */ o(
234
236
  "button",
235
237
  {
236
238
  type: "button",
@@ -249,7 +251,7 @@ function me({
249
251
  {
250
252
  className: "relative inline-flex",
251
253
  style: { zIndex: h.length - p },
252
- "data-tip": `${d.member.name} · ${B[d.status]}`,
254
+ "data-tip": `${d.member.name} · ${K[d.status]}`,
253
255
  children: /* @__PURE__ */ a(_, { row: d, z: h.length - p })
254
256
  },
255
257
  d.member.id
@@ -262,7 +264,15 @@ function me({
262
264
  ]
263
265
  }
264
266
  ) }),
265
- /* @__PURE__ */ a(D, { align: "start", className: "w-[340px] p-1", children: /* @__PURE__ */ a(Z, { rows: m, more: w, note: $ }) })
267
+ /* @__PURE__ */ a(
268
+ B,
269
+ {
270
+ align: "start",
271
+ collisionPadding: 8,
272
+ className: "w-[min(340px,calc(100vw-16px))] p-1",
273
+ children: /* @__PURE__ */ a(ee, { rows: m, more: w, note: $ })
274
+ }
275
+ )
266
276
  ] }),
267
277
  e && /* @__PURE__ */ a("div", { className: "ml-auto flex min-w-0 shrink-0 items-center", children: e })
268
278
  ]
@@ -270,10 +280,10 @@ function me({
270
280
  );
271
281
  }
272
282
  export {
273
- me as QueueTeamStrip,
274
- B as TEAM_STATUS_LABEL,
275
- Q as outLine,
276
- W as teamRows,
277
- K as teamStatus,
283
+ pe as QueueTeamStrip,
284
+ K as TEAM_STATUS_LABEL,
285
+ W as outLine,
286
+ Y as teamRows,
287
+ G as teamStatus,
278
288
  T as teamSummary
279
289
  };