@nivaro/react 0.3.114 → 0.3.116

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 (293) hide show
  1. package/dist/components/ScreenShareHost.js +24 -0
  2. package/dist/full.css +50 -2
  3. package/dist/hooks/useSessionRecorder.js +61 -60
  4. package/dist/index.d.ts +1728 -22
  5. package/dist/index.js +1091 -950
  6. package/dist/shared/components/ActivityEntry.js +209 -97
  7. package/dist/shared/components/AgentPresenceChip.js +51 -0
  8. package/dist/shared/components/AnnouncementBanner.js +56 -41
  9. package/dist/shared/components/AutolinkedText.js +98 -85
  10. package/dist/shared/components/BroadcastView.js +149 -141
  11. package/dist/shared/components/CacheStamp.js +78 -30
  12. package/dist/shared/components/CollectionBrowserView.js +4909 -4182
  13. package/dist/shared/components/ConfigChangeStrip.js +63 -0
  14. package/dist/shared/components/ConfigReachNote.js +107 -0
  15. package/dist/shared/components/ConformanceView.js +389 -319
  16. package/dist/shared/components/DataTable.js +612 -551
  17. package/dist/shared/components/DelegateCoverLine.js +164 -0
  18. package/dist/shared/components/EnvironmentNotice.js +56 -65
  19. package/dist/shared/components/FilePreviewLightbox.js +89 -43
  20. package/dist/shared/components/FindingFixedMark.js +23 -0
  21. package/dist/shared/components/GridPresenceLine.js +100 -0
  22. package/dist/shared/components/IdleReloadWatcher.js +82 -43
  23. package/dist/shared/components/InStep.js +46 -0
  24. package/dist/shared/components/ItemEditForm.js +5504 -4889
  25. package/dist/shared/components/LiveAnnouncer.js +62 -0
  26. package/dist/shared/components/LiveCount.js +54 -0
  27. package/dist/shared/components/LiveFigure.js +28 -0
  28. package/dist/shared/components/LiveListControls.js +114 -0
  29. package/dist/shared/components/LiveNewMatchesPill.js +25 -0
  30. package/dist/shared/components/LiveOffNote.js +44 -0
  31. package/dist/shared/components/LivePreferenceHost.js +42 -0
  32. package/dist/shared/components/LiveRowMark.js +25 -20
  33. package/dist/shared/components/LiveTraceView.js +257 -0
  34. package/dist/shared/components/MapView.js +30 -29
  35. package/dist/shared/components/MatrixEditor.js +497 -462
  36. package/dist/shared/components/MyWorkView.js +346 -272
  37. package/dist/shared/components/NotificationBell.js +215 -201
  38. package/dist/shared/components/OverflowRail.js +326 -0
  39. package/dist/shared/components/PageRenderer.js +636 -599
  40. package/dist/shared/components/PresenceDot.js +21 -0
  41. package/dist/shared/components/ProfileView.js +656 -536
  42. package/dist/shared/components/RealtimeStatusBanner.js +25 -25
  43. package/dist/shared/components/RecentRecordsRail.js +51 -48
  44. package/dist/shared/components/RecordCompare.js +241 -150
  45. package/dist/shared/components/RecordDrilldownSheet.js +66 -64
  46. package/dist/shared/components/RecordGridEditor.js +350 -311
  47. package/dist/shared/components/RecordHoverCard.js +147 -0
  48. package/dist/shared/components/RecordPeekHost.js +111 -0
  49. package/dist/shared/components/RecordReadView.js +414 -412
  50. package/dist/shared/components/RelativeTime.js +16 -0
  51. package/dist/shared/components/ReportView.js +1396 -1304
  52. package/dist/shared/components/ScreenRefreshButton.js +77 -0
  53. package/dist/shared/components/TabCountHost.js +10 -0
  54. package/dist/shared/components/TickerNumber.js +19 -18
  55. package/dist/shared/components/TipLayer.js +70 -58
  56. package/dist/shared/components/WidgetImageMenu.js +59 -0
  57. package/dist/shared/components/WidgetSlot.js +571 -524
  58. package/dist/shared/components/activity/RecordActivityStream.js +317 -0
  59. package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
  60. package/dist/shared/components/cbv/approval-changed.js +20 -0
  61. package/dist/shared/components/cbv/changed-by-others.js +251 -0
  62. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
  63. package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
  64. package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
  65. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
  66. package/dist/shared/components/change-proposals/types.js +4 -0
  67. package/dist/shared/components/chat/ChatPanel.js +1571 -1528
  68. package/dist/shared/components/chat/Composer.js +276 -298
  69. package/dist/shared/components/chat/room-due.js +13 -0
  70. package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
  71. package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
  72. package/dist/shared/components/collections-directory/directory-data.js +75 -63
  73. package/dist/shared/components/imports/ImportConsole.js +159 -155
  74. package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
  75. package/dist/shared/components/integrations/SendStatus.js +202 -0
  76. package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
  77. package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
  78. package/dist/shared/components/integrations/console/SignalCard.js +84 -77
  79. package/dist/shared/components/integrations/console/api.js +161 -117
  80. package/dist/shared/components/integrations/console/tone.js +15 -12
  81. package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
  82. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
  83. package/dist/shared/components/item-edit/CloneDialog.js +208 -206
  84. package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
  85. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
  86. package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
  87. package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
  88. package/dist/shared/components/item-edit/FieldComments.js +159 -116
  89. package/dist/shared/components/item-edit/FieldPointer.js +132 -0
  90. package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
  91. package/dist/shared/components/item-edit/FieldRow.js +519 -439
  92. package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
  93. package/dist/shared/components/item-edit/FilePickerField.js +454 -369
  94. package/dist/shared/components/item-edit/GroupSection.js +618 -567
  95. package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
  96. package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
  97. package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
  98. package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
  99. package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
  100. package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
  101. package/dist/shared/components/item-edit/PickerBadges.js +52 -0
  102. package/dist/shared/components/item-edit/PlanGrid.js +434 -439
  103. package/dist/shared/components/item-edit/RecalcValue.js +55 -0
  104. package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
  105. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
  106. package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
  107. package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
  108. package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
  109. package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
  110. package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
  111. package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
  112. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
  113. package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
  114. package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
  115. package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
  116. package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
  117. package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
  118. package/dist/shared/components/item-edit/SectionPresence.js +78 -0
  119. package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
  120. package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
  121. package/dist/shared/components/item-edit/coedit/collab.js +84 -0
  122. package/dist/shared/components/item-edit/coedit/context.js +24 -0
  123. package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
  124. package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
  125. package/dist/shared/components/item-edit/coedit/session.js +382 -0
  126. package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
  127. package/dist/shared/components/item-edit/file-live.js +77 -0
  128. package/dist/shared/components/item-edit/file-processing.js +87 -0
  129. package/dist/shared/components/item-edit/layout-switch.js +148 -0
  130. package/dist/shared/components/item-edit/live-related.js +23 -0
  131. package/dist/shared/components/item-edit/live-title.js +66 -0
  132. package/dist/shared/components/item-edit/partner-needs.js +142 -0
  133. package/dist/shared/components/item-edit/removed-line.js +58 -0
  134. package/dist/shared/components/item-edit/render-stability.js +70 -59
  135. package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
  136. package/dist/shared/components/layout-editor/CollabParts.js +72 -70
  137. package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
  138. package/dist/shared/components/list/InlineEdit.js +504 -208
  139. package/dist/shared/components/list/ListViewers.js +81 -0
  140. package/dist/shared/components/list/PhonePager.js +50 -0
  141. package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
  142. package/dist/shared/components/merge/MergeWithFlow.js +290 -0
  143. package/dist/shared/components/merge/merge-values.js +110 -0
  144. package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
  145. package/dist/shared/components/notifications/NotificationCenterView.js +389 -323
  146. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
  147. package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
  148. package/dist/shared/components/notifications/bundles.js +21 -19
  149. package/dist/shared/components/notifications/resolved-line.js +25 -0
  150. package/dist/shared/components/ops/OpsTasksView.js +45 -44
  151. package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
  152. package/dist/shared/components/panels/AlertBanners.js +132 -0
  153. package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
  154. package/dist/shared/components/panels/BranchLanes.js +82 -54
  155. package/dist/shared/components/panels/CommentAwareness.js +332 -0
  156. package/dist/shared/components/panels/CommentImages.js +219 -0
  157. package/dist/shared/components/panels/CommentPanel.js +649 -530
  158. package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
  159. package/dist/shared/components/panels/NewSinceChip.js +16 -0
  160. package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
  161. package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
  162. package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
  163. package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
  164. package/dist/shared/components/panels/SlaClock.js +130 -99
  165. package/dist/shared/components/panels/TaskPanel.js +308 -287
  166. package/dist/shared/components/panels/unseen-move-check.js +101 -0
  167. package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
  168. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
  169. package/dist/shared/components/pipeline/PipelineEditorView.js +2050 -1942
  170. package/dist/shared/components/profile/AgentNameField.js +141 -0
  171. package/dist/shared/components/profile/AgentsPanel.js +55 -46
  172. package/dist/shared/components/profile/PersonAccess.js +398 -330
  173. package/dist/shared/components/profile/PersonAdminTools.js +127 -113
  174. package/dist/shared/components/profile/PersonProfile.js +81 -73
  175. package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
  176. package/dist/shared/components/queue/OwnerAvatars.js +9 -9
  177. package/dist/shared/components/queue/QueueBulkBar.js +101 -84
  178. package/dist/shared/components/queue/QueueItemSheet.js +66 -66
  179. package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
  180. package/dist/shared/components/queue/QueueWorklist.js +2407 -1950
  181. package/dist/shared/components/queue/worklist-helpers.js +10 -6
  182. package/dist/shared/components/send-view/SendViewButton.js +136 -0
  183. package/dist/shared/components/send-view/SentViewCards.js +147 -0
  184. package/dist/shared/components/support/ReportProblem.js +1 -0
  185. package/dist/shared/components/support/ScreenShare.js +554 -0
  186. package/dist/shared/components/support/SupportView.js +160 -129
  187. package/dist/shared/components/support/TicketDetailSheet.js +101 -89
  188. package/dist/shared/components/ui/popover.js +53 -29
  189. package/dist/shared/components/watch-list/WatchDock.js +1044 -0
  190. package/dist/shared/components/watch-list/WatchExtras.js +723 -0
  191. package/dist/shared/components/watch-list/WatchListButton.js +46 -0
  192. package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
  193. package/dist/shared/components/watch-list/WatchRows.js +348 -0
  194. package/dist/shared/lib/activity-sentence.js +87 -75
  195. package/dist/shared/lib/agent-presence.js +46 -0
  196. package/dist/shared/lib/approval-progress.js +49 -0
  197. package/dist/shared/lib/attention-prefs.js +27 -0
  198. package/dist/shared/lib/cell-locks.js +56 -0
  199. package/dist/shared/lib/co-edit.js +166 -0
  200. package/dist/shared/lib/coedit-registry.js +44 -0
  201. package/dist/shared/lib/comment-awareness.js +124 -0
  202. package/dist/shared/lib/comment-images.js +45 -0
  203. package/dist/shared/lib/config-watch.js +94 -0
  204. package/dist/shared/lib/copy-rules.js +65 -0
  205. package/dist/shared/lib/count-step.js +30 -0
  206. package/dist/shared/lib/deadline-ticker.js +68 -0
  207. package/dist/shared/lib/derived-causes.js +115 -0
  208. package/dist/shared/lib/draft-store.js +114 -85
  209. package/dist/shared/lib/error-hints.js +1 -0
  210. package/dist/shared/lib/field-merge.js +126 -0
  211. package/dist/shared/lib/filter-sentence.js +10 -10
  212. package/dist/shared/lib/focus-mode.js +16 -12
  213. package/dist/shared/lib/grid-cursors.js +77 -0
  214. package/dist/shared/lib/grid-presence.js +182 -0
  215. package/dist/shared/lib/idle-reload.js +100 -73
  216. package/dist/shared/lib/in-step.js +45 -0
  217. package/dist/shared/lib/integration-chip.js +19 -18
  218. package/dist/shared/lib/keep-row-focus.js +43 -0
  219. package/dist/shared/lib/line-locks.js +141 -0
  220. package/dist/shared/lib/line-split.js +41 -0
  221. package/dist/shared/lib/linked-changes.js +150 -0
  222. package/dist/shared/lib/list-return.js +231 -0
  223. package/dist/shared/lib/list-viewers.js +52 -0
  224. package/dist/shared/lib/live-announcer.js +86 -0
  225. package/dist/shared/lib/live-counts.js +85 -0
  226. package/dist/shared/lib/live-data-changed.js +108 -0
  227. package/dist/shared/lib/live-deltas.js +81 -0
  228. package/dist/shared/lib/live-findings.js +113 -0
  229. package/dist/shared/lib/live-groups.js +122 -0
  230. package/dist/shared/lib/live-link-labels.js +162 -0
  231. package/dist/shared/lib/live-list-flow.js +334 -0
  232. package/dist/shared/lib/live-list.js +143 -129
  233. package/dist/shared/lib/live-moves.js +51 -0
  234. package/dist/shared/lib/live-ops.js +26 -26
  235. package/dist/shared/lib/live-pickers.js +7 -0
  236. package/dist/shared/lib/live-preference.js +184 -0
  237. package/dist/shared/lib/live-queries.js +226 -181
  238. package/dist/shared/lib/live-screen.js +333 -0
  239. package/dist/shared/lib/live-search.js +108 -0
  240. package/dist/shared/lib/live-seen.js +35 -0
  241. package/dist/shared/lib/live-views.js +100 -0
  242. package/dist/shared/lib/live.js +159 -133
  243. package/dist/shared/lib/missed-updates.js +198 -0
  244. package/dist/shared/lib/newer-file.js +56 -0
  245. package/dist/shared/lib/notification-sound.js +42 -20
  246. package/dist/shared/lib/obligation-banner.js +17 -17
  247. package/dist/shared/lib/own-writes.js +59 -41
  248. package/dist/shared/lib/picker-badges.js +94 -0
  249. package/dist/shared/lib/presence-signals.js +131 -84
  250. package/dist/shared/lib/rail-menu-context.js +9 -0
  251. package/dist/shared/lib/realtime.js +49 -24
  252. package/dist/shared/lib/record-gaps.js +85 -0
  253. package/dist/shared/lib/record-outbox.js +369 -222
  254. package/dist/shared/lib/record-peek.js +75 -0
  255. package/dist/shared/lib/record-tabs.js +92 -72
  256. package/dist/shared/lib/relative-ticker.js +42 -0
  257. package/dist/shared/lib/request-gate.js +119 -119
  258. package/dist/shared/lib/rollup-recalc.js +107 -0
  259. package/dist/shared/lib/room-gaps.js +40 -36
  260. package/dist/shared/lib/row-surface.js +7 -0
  261. package/dist/shared/lib/rum.js +137 -87
  262. package/dist/shared/lib/save-progress.js +20 -0
  263. package/dist/shared/lib/scheduled-countdown.js +67 -0
  264. package/dist/shared/lib/screen-refresh.js +160 -0
  265. package/dist/shared/lib/screen-share.js +234 -0
  266. package/dist/shared/lib/seen-since.js +74 -0
  267. package/dist/shared/lib/selection-watch.js +205 -0
  268. package/dist/shared/lib/send-status.js +132 -0
  269. package/dist/shared/lib/send-view.js +23 -0
  270. package/dist/shared/lib/socket-liveness.js +155 -0
  271. package/dist/shared/lib/socket-realtime.js +168 -140
  272. package/dist/shared/lib/state-census.js +53 -0
  273. package/dist/shared/lib/summary-mode.js +61 -39
  274. package/dist/shared/lib/tab-attention.js +143 -32
  275. package/dist/shared/lib/table-density.js +64 -0
  276. package/dist/shared/lib/table-pins.js +20 -18
  277. package/dist/shared/lib/track-travel.js +40 -0
  278. package/dist/shared/lib/unseen-changes.js +68 -0
  279. package/dist/shared/lib/upload-file.js +62 -0
  280. package/dist/shared/lib/upload-presence.js +127 -0
  281. package/dist/shared/lib/urgent-chime.js +65 -0
  282. package/dist/shared/lib/use-below-md.js +29 -0
  283. package/dist/shared/lib/use-online-users.js +32 -11
  284. package/dist/shared/lib/user-sync.js +155 -39
  285. package/dist/shared/lib/waiting-count.js +44 -0
  286. package/dist/shared/lib/watch-desktop.js +83 -0
  287. package/dist/shared/lib/watch-list.js +447 -0
  288. package/dist/shared/lib/widget-image-render.js +64 -0
  289. package/dist/shared/lib/widget-image.js +111 -0
  290. package/dist/shared/lib/worker-socket.js +130 -104
  291. package/dist/shared/lib/write-to-screen.js +133 -0
  292. package/package.json +1 -1
  293. package/styles.css +49 -1
@@ -1,35 +1,36 @@
1
- import { jsx as r, jsxs as a } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as a, Fragment as I } from "react/jsx-runtime";
2
2
  import { useState as b } from "react";
3
- import { useItemEditAuth as _ } from "../../context.js";
3
+ import { useItemEditAuth as S } from "../../context.js";
4
4
  import { cn as l } from "../../lib/utils.js";
5
- import { PermissionSummaryCard as I } from "../access/PermissionSummary.js";
6
- import { Tabs as S, TabsList as A, TabsTrigger as P, TabsContent as i } from "../ui/tabs.js";
7
- import { DayTimelineCard as T } from "./DayTimeline.js";
8
- import { DelegationCard as D } from "./DelegationCard.js";
9
- import { MyDefaultsCard as U } from "./MyDefaultsCard.js";
10
- import { SuspensionBanner as F, AccessCard as M, UserScopesCard as O, UserDirectoryCard as W, SessionsCard as j, ApiTokenCard as E } from "./PersonAccess.js";
11
- import { AccessSummaryCard as L } from "./PersonAccessSummary.js";
12
- import { StatsCard as R, SignInsCard as V, JourneyCard as B } from "./PersonActivity.js";
13
- import { ForceReloadCard as H, SignOutEverywhereCard as J, MergeCard as q, OffboardingCard as z } from "./PersonAdminTools.js";
14
- import { PersonAiMemoryCard as G } from "./PersonAiMemory.js";
15
- import { CompareAccessCard as K } from "./PersonCompare.js";
16
- import { PersonDidPanel as Q } from "./PersonDidPanel.js";
17
- import { WorkingOnCard as X, TeamLoadCard as Y, WhyCard as Z } from "./PersonExtras.js";
18
- import { PersonHeader as $ } from "./PersonHeader.js";
19
- import { AboutCard as ee, PeopleCard as re, AvailabilityCard as ae, ResponsibilitiesCard as de } from "./PersonOverview.js";
20
- import { PersonWeekCard as se } from "./PersonWeek.js";
21
- import { SignedInDevices as te } from "./SignedInDevices.js";
22
- import { SlowScreensCard as ie } from "./SlowScreensCard.js";
23
- import { usePersonProfile as oe, useInvalidatePerson as ne } from "./types.js";
24
- import { ActivityFeedCard as le } from "./ActivityFeedCard.js";
25
- function Oe({
5
+ import { PermissionSummaryCard as A } from "../access/PermissionSummary.js";
6
+ import { Tabs as P, TabsList as T, TabsTrigger as D, TabsContent as i } from "../ui/tabs.js";
7
+ import { DayTimelineCard as F } from "./DayTimeline.js";
8
+ import { DelegationCard as U } from "./DelegationCard.js";
9
+ import { MyDefaultsCard as L } from "./MyDefaultsCard.js";
10
+ import { SuspensionBanner as M, AccessCard as O, UserScopesCard as W, UserDirectoryCard as j, SessionsCard as E, ApiTokenCard as R } from "./PersonAccess.js";
11
+ import { AccessSummaryCard as V } from "./PersonAccessSummary.js";
12
+ import { StatsCard as B, SignInsCard as H, JourneyCard as J } from "./PersonActivity.js";
13
+ import { ForceReloadCard as q, LiveTraceCard as z, SignOutEverywhereCard as G, MergeCard as K, OffboardingCard as Q } from "./PersonAdminTools.js";
14
+ import { PersonAiMemoryCard as X } from "./PersonAiMemory.js";
15
+ import { CompareAccessCard as Y } from "./PersonCompare.js";
16
+ import { PersonDidPanel as Z } from "./PersonDidPanel.js";
17
+ import { WorkingOnCard as $, TeamLoadCard as ee, WhyCard as re } from "./PersonExtras.js";
18
+ import { PersonHeader as ae } from "./PersonHeader.js";
19
+ import { AboutCard as de, PeopleCard as se, AvailabilityCard as te, ResponsibilitiesCard as ie } from "./PersonOverview.js";
20
+ import { PersonWeekCard as oe } from "./PersonWeek.js";
21
+ import { SignedInDevices as ne } from "./SignedInDevices.js";
22
+ import { SignInTroubleshooterCard as h } from "./SignInTroubleshooter.js";
23
+ import { SlowScreensCard as le } from "./SlowScreensCard.js";
24
+ import { usePersonProfile as ce, useInvalidatePerson as me } from "./types.js";
25
+ import { ActivityFeedCard as pe } from "./ActivityFeedCard.js";
26
+ function Ee({
26
27
  userId: o,
27
28
  className: c,
28
- initialTab: h = "overview"
29
+ initialTab: y = "overview"
29
30
  }) {
30
31
  var v, g, f;
31
- const t = _(), s = !!(t != null && t.isAdmin), { data: e, isLoading: y, isError: x } = oe(o), N = ne(o), [p, C] = b(h), [n, k] = b("feed");
32
- if (y || !e && !x) return /* @__PURE__ */ r(ce, { className: c });
32
+ const t = S(), s = !!(t != null && t.isAdmin), { data: e, isLoading: x, isError: C } = ce(o), N = me(o), [m, _] = b(y), [n, k] = b("feed");
33
+ if (x || !e && !C) return /* @__PURE__ */ r(ue, { className: c });
33
34
  if (!e)
34
35
  return /* @__PURE__ */ a(
35
36
  "div",
@@ -47,21 +48,21 @@ function Oe({
47
48
  );
48
49
  const w = !!(t != null && t.userId) && !!((v = e.manager) != null && v.id) && String(e.manager.id).toUpperCase() === String(t.userId).toUpperCase(), u = /* @__PURE__ */ a("div", { className: "grid gap-4 lg:grid-cols-2", children: [
49
50
  /* @__PURE__ */ a("div", { className: "space-y-4", children: [
50
- /* @__PURE__ */ r(ee, { profile: e, isAdmin: s }),
51
- /* @__PURE__ */ r(X, { profile: e }),
51
+ /* @__PURE__ */ r(de, { profile: e, isAdmin: s }),
52
+ /* @__PURE__ */ r($, { profile: e }),
52
53
  e.direct_reports.length > 0 && /* @__PURE__ */ r(
53
- Y,
54
+ ee,
54
55
  {
55
56
  userId: e.id,
56
57
  firstName: e.first_name ?? e.name,
57
58
  expectedRows: e.direct_reports.length
58
59
  }
59
60
  ),
60
- /* @__PURE__ */ r(re, { profile: e })
61
+ /* @__PURE__ */ r(se, { profile: e })
61
62
  ] }),
62
63
  /* @__PURE__ */ a("div", { className: "space-y-4", children: [
63
64
  s ? /* @__PURE__ */ r(
64
- D,
65
+ U,
65
66
  {
66
67
  user: {
67
68
  id: e.id,
@@ -80,17 +81,17 @@ function Oe({
80
81
  coversFor: e.covers_for,
81
82
  onSaved: N
82
83
  }
83
- ) : /* @__PURE__ */ r(ae, { profile: e }),
84
- /* @__PURE__ */ r(de, { profile: e, isAdmin: s }),
85
- (s || w) && /* @__PURE__ */ r(se, { profile: e })
84
+ ) : /* @__PURE__ */ r(te, { profile: e }),
85
+ /* @__PURE__ */ r(ie, { profile: e, isAdmin: s }),
86
+ (s || w) && /* @__PURE__ */ r(oe, { profile: e })
86
87
  ] })
87
88
  ] });
88
89
  return /* @__PURE__ */ a("div", { className: l("flex flex-col gap-4", c), "data-nvr-person": e.id, children: [
89
- /* @__PURE__ */ r($, { profile: e, isAdmin: s }),
90
- s && /* @__PURE__ */ r(F, { profile: e }),
91
- s ? /* @__PURE__ */ a(S, { value: p, onValueChange: (d) => C(d), children: [
90
+ /* @__PURE__ */ r(ae, { profile: e, isAdmin: s }),
91
+ s && /* @__PURE__ */ r(M, { profile: e }),
92
+ s ? /* @__PURE__ */ a(P, { value: m, onValueChange: (d) => _(d), children: [
92
93
  /* @__PURE__ */ r(
93
- A,
94
+ T,
94
95
  {
95
96
  className: "h-9 w-full justify-start gap-1 rounded-lg border border-slate-200 bg-white p-1 dark:border-border dark:bg-card",
96
97
  "data-person-tabs": !0,
@@ -100,13 +101,13 @@ function Oe({
100
101
  ["activity", "Activity"],
101
102
  ["did", "What they did"],
102
103
  ["tools", "Admin tools"]
103
- ].map(([d, m]) => /* @__PURE__ */ r(
104
- P,
104
+ ].map(([d, p]) => /* @__PURE__ */ r(
105
+ D,
105
106
  {
106
107
  value: d,
107
108
  "data-person-tab": d,
108
109
  className: "h-7 rounded-md px-3 text-[12px] font-medium text-slate-500 data-[state=active]:bg-nvr-cyan/10 data-[state=active]:text-nvr-navy data-[state=active]:shadow-none dark:text-slate-400 dark:data-[state=active]:text-nvr-cyan",
109
- children: m
110
+ children: p
110
111
  },
111
112
  d
112
113
  ))
@@ -115,18 +116,18 @@ function Oe({
115
116
  /* @__PURE__ */ r(i, { value: "overview", className: "mt-4 focus-visible:outline-none", children: u }),
116
117
  /* @__PURE__ */ r(i, { value: "access", className: "mt-4 focus-visible:outline-none", children: /* @__PURE__ */ a("div", { className: "grid gap-4 lg:grid-cols-2", children: [
117
118
  /* @__PURE__ */ a("div", { className: "space-y-4", children: [
118
- /* @__PURE__ */ r(M, { profile: e }),
119
- /* @__PURE__ */ r(L, { userId: e.id }),
120
- /* @__PURE__ */ r(I, { userId: e.id }),
121
- /* @__PURE__ */ r(O, { userId: e.id }),
122
- /* @__PURE__ */ r(Z, { profile: e }),
123
- /* @__PURE__ */ r(K, { profile: e })
119
+ /* @__PURE__ */ r(O, { profile: e }),
120
+ /* @__PURE__ */ r(V, { userId: e.id }),
121
+ /* @__PURE__ */ r(A, { userId: e.id }),
122
+ /* @__PURE__ */ r(W, { userId: e.id }),
123
+ /* @__PURE__ */ r(re, { profile: e }),
124
+ /* @__PURE__ */ r(Y, { profile: e })
124
125
  ] }),
125
126
  /* @__PURE__ */ a("div", { className: "space-y-4", children: [
126
- /* @__PURE__ */ r(W, { profile: e }),
127
- /* @__PURE__ */ r(j, { userId: e.id }),
128
- /* @__PURE__ */ r(te, { userId: e.id, name: e.first_name ?? e.name }),
129
- /* @__PURE__ */ r(E, { profile: e })
127
+ /* @__PURE__ */ r(j, { profile: e }),
128
+ /* @__PURE__ */ r(E, { userId: e.id }),
129
+ /* @__PURE__ */ r(ne, { userId: e.id, name: e.first_name ?? e.name }),
130
+ /* @__PURE__ */ r(R, { profile: e })
130
131
  ] })
131
132
  ] }) }),
132
133
  /* @__PURE__ */ a(i, { value: "activity", className: "mt-4 focus-visible:outline-none", children: [
@@ -141,7 +142,7 @@ function Oe({
141
142
  ["feed", "Feed"],
142
143
  ["day", "Day"],
143
144
  ["speed", "Slow screens"]
144
- ].map(([d, m]) => /* @__PURE__ */ r(
145
+ ].map(([d, p]) => /* @__PURE__ */ r(
145
146
  "button",
146
147
  {
147
148
  type: "button",
@@ -152,41 +153,48 @@ function Oe({
152
153
  "h-6 rounded-md px-3 text-[11.5px] font-medium",
153
154
  n === d ? "bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200"
154
155
  ),
155
- children: m
156
+ children: p
156
157
  },
157
158
  d
158
159
  ))
159
160
  ]
160
161
  }
161
162
  ),
162
- n === "day" && s ? /* @__PURE__ */ r(T, { userId: e.id }) : n === "speed" && s ? /* @__PURE__ */ r(ie, { userId: e.id, name: e.first_name ?? e.name }) : /* @__PURE__ */ a("div", { className: "grid gap-4 lg:grid-cols-2", children: [
163
+ n === "day" && s ? /* @__PURE__ */ r(F, { userId: e.id }) : n === "speed" && s ? /* @__PURE__ */ r(le, { userId: e.id, name: e.first_name ?? e.name }) : /* @__PURE__ */ a("div", { className: "grid gap-4 lg:grid-cols-2", children: [
163
164
  /* @__PURE__ */ a("div", { className: "space-y-4", children: [
164
- /* @__PURE__ */ r(R, { userId: e.id }),
165
- /* @__PURE__ */ r(le, { userId: e.id })
165
+ /* @__PURE__ */ r(B, { userId: e.id }),
166
+ /* @__PURE__ */ r(pe, { userId: e.id })
166
167
  ] }),
167
168
  /* @__PURE__ */ a("div", { className: "space-y-4", children: [
168
- /* @__PURE__ */ r(V, { profile: e }),
169
- /* @__PURE__ */ r(B, { userId: e.id })
169
+ /* @__PURE__ */ r(H, { profile: e }),
170
+ /* @__PURE__ */ r(J, { userId: e.id })
170
171
  ] })
171
172
  ] })
172
173
  ] }),
173
- /* @__PURE__ */ r(i, { value: "did", className: "mt-4 focus-visible:outline-none", children: p === "did" && /* @__PURE__ */ r(Q, { userId: e.id, name: e.first_name ?? e.name }) }),
174
- /* @__PURE__ */ r(i, { value: "tools", className: "mt-4 focus-visible:outline-none", children: /* @__PURE__ */ a("div", { className: "grid gap-4 lg:grid-cols-2", children: [
175
- /* @__PURE__ */ a("div", { className: "space-y-4", children: [
176
- /* @__PURE__ */ r(H, { profile: e }),
177
- /* @__PURE__ */ r(J, { profile: e }),
178
- /* @__PURE__ */ r(q, { profile: e })
179
- ] }),
180
- /* @__PURE__ */ a("div", { className: "space-y-4", children: [
181
- /* @__PURE__ */ r(z, { profile: e }),
182
- /* @__PURE__ */ r(G, { profile: e }),
183
- /* @__PURE__ */ r(U, { userId: e.id, name: e.first_name ?? e.name })
174
+ /* @__PURE__ */ r(i, { value: "did", className: "mt-4 focus-visible:outline-none", children: m === "did" && /* @__PURE__ */ r(Z, { userId: e.id, name: e.first_name ?? e.name }) }),
175
+ /* @__PURE__ */ a(i, { value: "tools", className: "mt-4 focus-visible:outline-none", children: [
176
+ m === "tools" && /* @__PURE__ */ r(h, { profile: e }),
177
+ /* @__PURE__ */ a("div", { className: "mt-4 grid gap-4 lg:grid-cols-2", children: [
178
+ /* @__PURE__ */ a("div", { className: "space-y-4", children: [
179
+ /* @__PURE__ */ r(q, { profile: e }),
180
+ /* @__PURE__ */ r(z, { profile: e }),
181
+ /* @__PURE__ */ r(G, { profile: e }),
182
+ /* @__PURE__ */ r(K, { profile: e })
183
+ ] }),
184
+ /* @__PURE__ */ a("div", { className: "space-y-4", children: [
185
+ /* @__PURE__ */ r(Q, { profile: e }),
186
+ /* @__PURE__ */ r(X, { profile: e }),
187
+ /* @__PURE__ */ r(L, { userId: e.id, name: e.first_name ?? e.name })
188
+ ] })
184
189
  ] })
185
- ] }) })
186
- ] }) : u
190
+ ] })
191
+ ] }) : /* @__PURE__ */ a(I, { children: [
192
+ e.sign_in_help && /* @__PURE__ */ r(h, { profile: e }),
193
+ u
194
+ ] })
187
195
  ] });
188
196
  }
189
- function ce({ className: o }) {
197
+ function ue({ className: o }) {
190
198
  return /* @__PURE__ */ a("div", { className: l("flex animate-pulse flex-col gap-4", o), "aria-busy": "true", children: [
191
199
  /* @__PURE__ */ a("div", { className: "flex items-center gap-5 rounded-lg border border-slate-200 bg-white p-5 dark:border-border dark:bg-card", children: [
192
200
  /* @__PURE__ */ r("div", { className: "h-[76px] w-[76px] rounded-full bg-slate-100 dark:bg-muted" }),
@@ -203,5 +211,5 @@ function ce({ className: o }) {
203
211
  ] });
204
212
  }
205
213
  export {
206
- Oe as PersonProfile
214
+ Ee as PersonProfile
207
215
  };
@@ -0,0 +1,361 @@
1
+ import { jsx as t, jsxs as s, Fragment as p } from "react/jsx-runtime";
2
+ import { useQuery as y } from "@tanstack/react-query";
3
+ import { KeyRound as E, CircleCheck as w, CircleX as v, CircleHelp as L, CircleAlert as I, LogIn as B, Smartphone as F, ChevronDown as O } from "lucide-react";
4
+ import { useState as k } from "react";
5
+ import { useNivaroClient as _ } from "../../context.js";
6
+ import { get as T } from "../../lib/commands.js";
7
+ import { formatDateTime as h, formatRelative as x, cn as u } from "../../lib/utils.js";
8
+ import { ErrorNotice as S } from "../ErrorNotice.js";
9
+ import { Skeleton as g } from "../ui/skeleton.js";
10
+ import { SectionCard as P, EmptyLine as q } from "./primitives.js";
11
+ const C = {
12
+ person: "They can fix this",
13
+ admin: "An administrator here fixes this",
14
+ it: "Their IT team fixes this",
15
+ wait: "Usually clears by itself"
16
+ }, R = {
17
+ oidc: "Single sign-on",
18
+ saml: "SAML",
19
+ password: "Password",
20
+ totp: "Two-factor code",
21
+ token: "Token",
22
+ static_token: "Token",
23
+ phone: "Phone app"
24
+ }, f = (e) => e ? e === "admin" ? "Admin" : e === "phone" ? "Phone app" : e : null, N = 8;
25
+ function Y({ profile: e }) {
26
+ var d, m;
27
+ const i = _(), a = y({
28
+ queryKey: ["nvr-sign-in-troubleshooter", e.id],
29
+ queryFn: () => i.request(T(`/users/${e.id}/sign-in-troubleshooter`)).then((o) => o.data),
30
+ staleTime: 3e4
31
+ }), [l, r] = k(!1), c = ((d = e.first_name) == null ? void 0 : d.trim()) || e.name || "They";
32
+ return /* @__PURE__ */ t(
33
+ P,
34
+ {
35
+ icon: /* @__PURE__ */ t(E, { className: "h-4 w-4" }),
36
+ title: "Sign-in troubleshooter",
37
+ hint: "Why their sign-ins failed in the last 30 days, and what to do",
38
+ testId: "sign-in-troubleshooter",
39
+ children: a.isLoading ? /* @__PURE__ */ s("div", { className: "space-y-3", "aria-hidden": !0, children: [
40
+ /* @__PURE__ */ t(g, { className: "h-16 w-full" }),
41
+ /* @__PURE__ */ t(g, { className: "h-9 w-full" }),
42
+ /* @__PURE__ */ t(g, { className: "h-9 w-2/3" })
43
+ ] }) : a.isError || !a.data ? /* @__PURE__ */ t(S, { error: a.error, what: "sign-in history", onRetry: () => a.refetch() }) : /* @__PURE__ */ t(
44
+ W,
45
+ {
46
+ t: a.data,
47
+ first: c,
48
+ sessions: ((m = e.admin) == null ? void 0 : m.sessions) ?? null,
49
+ userId: e.id,
50
+ all: l,
51
+ onAll: () => r(!0)
52
+ }
53
+ )
54
+ }
55
+ );
56
+ }
57
+ function W({
58
+ t: e,
59
+ first: i,
60
+ sessions: a,
61
+ userId: l,
62
+ all: r,
63
+ onAll: c
64
+ }) {
65
+ var o;
66
+ const d = e.attempts.filter((n) => n.outcome === "failed").length, m = r ? e.attempts : e.attempts.slice(0, N);
67
+ return /* @__PURE__ */ s("div", { className: "space-y-4", "data-sign-in-troubleshooter": !0, children: [
68
+ /* @__PURE__ */ t(j, { t: e, first: i }),
69
+ /* @__PURE__ */ t("ul", { className: "grid gap-x-4 gap-y-2 sm:grid-cols-2", "data-sign-in-checks": !0, children: e.checks.map((n) => /* @__PURE__ */ s("li", { className: "flex min-w-0 items-start gap-2", "data-sign-in-check": n.key, children: [
70
+ n.ok === !0 ? /* @__PURE__ */ t(w, { className: "mt-px h-3.5 w-3.5 shrink-0 text-emerald-600 dark:text-emerald-400" }) : n.ok === !1 ? /* @__PURE__ */ t(v, { className: "mt-px h-3.5 w-3.5 shrink-0 text-red-600 dark:text-red-400" }) : /* @__PURE__ */ t(L, { className: "mt-px h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500" }),
71
+ /* @__PURE__ */ s("div", { className: "min-w-0", children: [
72
+ /* @__PURE__ */ t("p", { className: "text-[12px] font-medium text-slate-800 dark:text-slate-100", children: n.label }),
73
+ /* @__PURE__ */ t("p", { className: "text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: n.detail })
74
+ ] })
75
+ ] }, n.key)) }),
76
+ /* @__PURE__ */ s(
77
+ "dl",
78
+ {
79
+ className: u(
80
+ "grid grid-cols-2 gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border",
81
+ a == null ? "sm:grid-cols-3" : "sm:grid-cols-4"
82
+ ),
83
+ children: [
84
+ /* @__PURE__ */ t(
85
+ b,
86
+ {
87
+ label: "Last sign-in",
88
+ value: e.last_success ? x(e.last_success.at) : "None in 30 days",
89
+ tip: e.last_success ? h(e.last_success.at) : void 0,
90
+ sub: e.last_success && [f(e.last_success.app), R[e.last_success.method]].filter(Boolean).join(" · ") || null
91
+ }
92
+ ),
93
+ a != null && /* @__PURE__ */ t(b, { label: "Live sessions", value: String(a), sub: "Browser tabs signed in" }),
94
+ /* @__PURE__ */ t(
95
+ b,
96
+ {
97
+ label: "Phones",
98
+ value: String(e.phones.length),
99
+ sub: ((o = e.phones[0]) == null ? void 0 : o.name) ?? "None signed in"
100
+ }
101
+ ),
102
+ /* @__PURE__ */ t(
103
+ b,
104
+ {
105
+ label: `Failed · ${e.window_days} days`,
106
+ value: String(d),
107
+ sub: e.by_reason[0] ? `Mostly: ${e.by_reason[0].label}` : "No failures",
108
+ warn: d > 0
109
+ }
110
+ )
111
+ ]
112
+ }
113
+ ),
114
+ e.apps.length > 0 && /* @__PURE__ */ s("p", { className: "text-[11.5px] text-slate-500 dark:text-slate-400", "data-sign-in-apps": !0, children: [
115
+ "Signed in to",
116
+ " ",
117
+ e.apps.map((n, A) => /* @__PURE__ */ s("span", { children: [
118
+ A > 0 && ", ",
119
+ /* @__PURE__ */ t("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: f(n.app) ?? n.app }),
120
+ " ",
121
+ /* @__PURE__ */ t("span", { "data-tip": h(n.at), children: x(n.at) })
122
+ ] }, n.app)),
123
+ "."
124
+ ] }),
125
+ /* @__PURE__ */ s("div", { children: [
126
+ /* @__PURE__ */ t("h4", { className: "mb-1.5 text-[12px] font-semibold text-slate-700 dark:text-slate-200", children: "Attempts" }),
127
+ e.attempts.length === 0 ? /* @__PURE__ */ s(q, { children: [
128
+ "No sign-ins or failed attempts in the last ",
129
+ e.window_days,
130
+ " days. Failures from before this was turned on are not recorded."
131
+ ] }) : /* @__PURE__ */ t("ol", { className: "divide-y divide-slate-100 rounded-lg border border-slate-200 dark:divide-border/60 dark:border-border", children: m.map((n) => /* @__PURE__ */ t($, { a: n }, n.id)) }),
132
+ !r && e.attempts.length > N && /* @__PURE__ */ s(
133
+ "button",
134
+ {
135
+ type: "button",
136
+ onClick: c,
137
+ className: "mt-2 text-[11.5px] font-medium text-nvr-navy hover:underline dark:text-nvr-cyan",
138
+ children: [
139
+ "Show all ",
140
+ e.attempts.length
141
+ ]
142
+ }
143
+ )
144
+ ] }),
145
+ /* @__PURE__ */ t(D, { userId: l })
146
+ ] });
147
+ }
148
+ function j({ t: e, first: i }) {
149
+ const a = e.current;
150
+ if (a)
151
+ return /* @__PURE__ */ t(
152
+ "div",
153
+ {
154
+ className: "rounded-lg border border-amber-200 bg-amber-50 px-3.5 py-3 dark:border-amber-500/30 dark:bg-amber-500/10",
155
+ "data-sign-in-current": a.reason ?? "",
156
+ children: /* @__PURE__ */ s("div", { className: "flex items-start gap-2.5", children: [
157
+ /* @__PURE__ */ t(I, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-600 dark:text-amber-400" }),
158
+ /* @__PURE__ */ s("div", { className: "min-w-0 space-y-1", children: [
159
+ /* @__PURE__ */ s("p", { className: "text-[13px] font-semibold text-amber-950 dark:text-amber-100", children: [
160
+ a.label,
161
+ /* @__PURE__ */ s("span", { className: "ml-2 text-[11.5px] font-normal text-amber-800 dark:text-amber-300", children: [
162
+ /* @__PURE__ */ t("span", { "data-tip": h(a.at), children: x(a.at) }),
163
+ a.match === "browser" && " · probably them"
164
+ ] })
165
+ ] }),
166
+ a.explain && /* @__PURE__ */ t("p", { className: "text-[12px] leading-snug text-amber-900 dark:text-amber-200", children: a.explain }),
167
+ a.todo && /* @__PURE__ */ s("p", { className: "text-[12px] leading-snug text-amber-950 dark:text-amber-50", children: [
168
+ /* @__PURE__ */ t("span", { className: "font-semibold", children: "What to do: " }),
169
+ a.todo
170
+ ] }),
171
+ a.owner && /* @__PURE__ */ s("p", { className: "text-[11.5px] text-amber-800 dark:text-amber-300", children: [
172
+ C[a.owner],
173
+ a.code && /* @__PURE__ */ s(p, { children: [
174
+ " · code ",
175
+ a.code
176
+ ] })
177
+ ] })
178
+ ] })
179
+ ] })
180
+ }
181
+ );
182
+ const l = e.last_success;
183
+ return /* @__PURE__ */ s(
184
+ "div",
185
+ {
186
+ className: "flex items-start gap-2.5 rounded-lg border border-slate-200 bg-slate-50 px-3.5 py-3 dark:border-border dark:bg-muted/40",
187
+ "data-sign-in-current": "none",
188
+ children: [
189
+ /* @__PURE__ */ t(w, { className: "mt-0.5 h-4 w-4 shrink-0 text-emerald-600 dark:text-emerald-400" }),
190
+ /* @__PURE__ */ t("p", { className: "text-[12.5px] leading-snug text-slate-700 dark:text-slate-200", children: l ? /* @__PURE__ */ s(p, { children: [
191
+ /* @__PURE__ */ t("span", { className: "font-semibold", children: "No sign-in problem since their last sign-in" }),
192
+ " ",
193
+ /* @__PURE__ */ t("span", { "data-tip": h(l.at), children: x(l.at) }),
194
+ l.browser && /* @__PURE__ */ s(p, { children: [
195
+ " on ",
196
+ l.browser
197
+ ] }),
198
+ "."
199
+ ] }) : /* @__PURE__ */ s(p, { children: [
200
+ /* @__PURE__ */ s("span", { className: "font-semibold", children: [
201
+ i,
202
+ " has not signed in for 30 days"
203
+ ] }),
204
+ ", and no failed attempt was recorded. If they say sign-in fails, ask them to try once now, then refresh this card."
205
+ ] }) })
206
+ ]
207
+ }
208
+ );
209
+ }
210
+ function b({
211
+ label: e,
212
+ value: i,
213
+ sub: a,
214
+ tip: l,
215
+ warn: r
216
+ }) {
217
+ return /* @__PURE__ */ s("div", { className: "min-w-0 bg-white px-3 py-2 dark:bg-card", children: [
218
+ /* @__PURE__ */ t("dt", { className: "text-[10.5px] font-medium text-slate-500 dark:text-slate-400", children: e }),
219
+ /* @__PURE__ */ t(
220
+ "dd",
221
+ {
222
+ className: u(
223
+ "truncate text-[13px] font-semibold tabular-nums",
224
+ r ? "text-amber-700 dark:text-amber-300" : "text-slate-800 dark:text-slate-100"
225
+ ),
226
+ "data-tip": l,
227
+ children: i
228
+ }
229
+ ),
230
+ a && /* @__PURE__ */ t("dd", { className: "truncate text-[11px] text-slate-500 dark:text-slate-400", title: a, children: a })
231
+ ] });
232
+ }
233
+ function $({ a: e }) {
234
+ const [i, a] = k(!1), l = e.outcome === "failed", r = !!(e.explain || e.todo), c = [
235
+ f(e.app),
236
+ e.method ? R[e.method] ?? e.method : null,
237
+ e.code
238
+ ].filter(Boolean), d = e.outcome === "signed_in" ? B : e.outcome === "ended" ? F : v, m = /* @__PURE__ */ s(p, { children: [
239
+ /* @__PURE__ */ t(
240
+ d,
241
+ {
242
+ className: u(
243
+ "mt-0.5 h-3.5 w-3.5 shrink-0",
244
+ l ? "text-red-600 dark:text-red-400" : e.outcome === "signed_in" ? "text-emerald-600 dark:text-emerald-400" : "text-slate-400 dark:text-slate-500"
245
+ )
246
+ }
247
+ ),
248
+ /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
249
+ /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-0.5", children: [
250
+ /* @__PURE__ */ t(
251
+ "span",
252
+ {
253
+ className: u(
254
+ "text-[12px] font-medium",
255
+ l ? "text-slate-900 dark:text-slate-50" : "text-slate-700 dark:text-slate-200"
256
+ ),
257
+ children: e.label
258
+ }
259
+ ),
260
+ c.map((o) => /* @__PURE__ */ t(
261
+ "span",
262
+ {
263
+ className: "rounded bg-slate-100 px-1.5 py-px text-[10.5px] text-slate-600 dark:bg-muted dark:text-slate-300",
264
+ children: o
265
+ },
266
+ o
267
+ )),
268
+ e.match === "browser" && /* @__PURE__ */ t(
269
+ "span",
270
+ {
271
+ className: "rounded bg-amber-100 px-1.5 py-px text-[10.5px] text-amber-800 dark:bg-amber-500/15 dark:text-amber-300",
272
+ "data-tip": "Nobody was named on this attempt; it came from the same address and browser as one of their sign-ins",
273
+ children: "Probably them"
274
+ }
275
+ ),
276
+ e.new_ip && /* @__PURE__ */ t("span", { className: "rounded bg-sky-100 px-1.5 py-px text-[10.5px] text-sky-800 dark:bg-sky-500/15 dark:text-sky-300", children: "New address" })
277
+ ] }),
278
+ /* @__PURE__ */ t("p", { className: "truncate text-[11px] text-slate-500 dark:text-slate-400", children: [e.browser, e.ip].filter(Boolean).join(" · ") || " " }),
279
+ i && r && /* @__PURE__ */ s("div", { className: "mt-1.5 space-y-1 text-[11.5px] leading-snug", "data-sign-in-detail": !0, children: [
280
+ e.explain && /* @__PURE__ */ t("p", { className: "text-slate-600 dark:text-slate-300", children: e.explain }),
281
+ e.todo && /* @__PURE__ */ s("p", { className: "text-slate-800 dark:text-slate-100", children: [
282
+ /* @__PURE__ */ t("span", { className: "font-semibold", children: "What to do: " }),
283
+ e.todo
284
+ ] }),
285
+ e.owner && /* @__PURE__ */ t("p", { className: "text-slate-500 dark:text-slate-400", children: C[e.owner] })
286
+ ] })
287
+ ] }),
288
+ /* @__PURE__ */ t(
289
+ "span",
290
+ {
291
+ className: "shrink-0 text-[11px] tabular-nums text-slate-500 dark:text-slate-400",
292
+ "data-tip": h(e.at),
293
+ children: x(e.at)
294
+ }
295
+ ),
296
+ r && /* @__PURE__ */ t(
297
+ O,
298
+ {
299
+ className: u(
300
+ "mt-0.5 h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform",
301
+ i && "rotate-180"
302
+ )
303
+ }
304
+ )
305
+ ] });
306
+ return /* @__PURE__ */ t("li", { "data-sign-in-attempt": e.outcome, children: r ? /* @__PURE__ */ t(
307
+ "button",
308
+ {
309
+ type: "button",
310
+ "aria-expanded": i,
311
+ onClick: () => a((o) => !o),
312
+ className: "flex w-full items-start gap-2 px-3 py-2 text-left hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan dark:hover:bg-muted/40",
313
+ children: m
314
+ }
315
+ ) : /* @__PURE__ */ t("div", { className: "flex items-start gap-2 px-3 py-2", children: m }) });
316
+ }
317
+ function D({ userId: e }) {
318
+ var c;
319
+ const i = _(), [a, l] = k(!1), r = y({
320
+ queryKey: ["nvr-sign-in-refusals", e],
321
+ queryFn: () => i.request(
322
+ T(`/users/${e}/sign-in-troubleshooter/refusals`)
323
+ ).then((d) => d),
324
+ enabled: a,
325
+ staleTime: 6e4
326
+ });
327
+ return a ? /* @__PURE__ */ s("div", { className: "border-t border-slate-100 pt-3 dark:border-border/60", "data-sign-in-refusals": !0, children: [
328
+ /* @__PURE__ */ t("h4", { className: "mb-1.5 text-[12px] font-semibold text-slate-700 dark:text-slate-200", children: "Refused requests · 7 days" }),
329
+ r.isLoading ? /* @__PURE__ */ t(g, { className: "h-8 w-full" }) : r.isError ? /* @__PURE__ */ t(S, { error: r.error, what: "refused requests", onRetry: () => r.refetch() }) : (c = r.data) != null && c.data.length ? /* @__PURE__ */ t("ul", { className: "space-y-1", children: r.data.data.map((d) => /* @__PURE__ */ s("li", { className: "flex items-baseline gap-2 text-[12px]", children: [
330
+ /* @__PURE__ */ s("span", { className: "font-medium tabular-nums text-slate-800 dark:text-slate-100", children: [
331
+ d.n,
332
+ "×"
333
+ ] }),
334
+ /* @__PURE__ */ t("span", { className: "text-slate-700 dark:text-slate-200", children: d.code }),
335
+ /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-slate-500 dark:text-slate-400", children: d.message ?? "" }),
336
+ /* @__PURE__ */ t(
337
+ "span",
338
+ {
339
+ className: "shrink-0 text-[11px] text-slate-500 dark:text-slate-400",
340
+ "data-tip": h(d.last_at),
341
+ children: x(d.last_at)
342
+ }
343
+ )
344
+ ] }, d.code)) }) : /* @__PURE__ */ t(q, { children: "None — every request made as them was let through." })
345
+ ] }) : /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-2 border-t border-slate-100 pt-3 dark:border-border/60", children: [
346
+ /* @__PURE__ */ t(
347
+ "button",
348
+ {
349
+ type: "button",
350
+ onClick: () => l(!0),
351
+ className: "inline-flex h-7 items-center rounded-md border border-slate-200 px-2.5 text-[11.5px] font-medium text-slate-700 transition-colors hover:bg-slate-50 dark:border-border dark:text-slate-200 dark:hover:bg-muted/40",
352
+ "data-sign-in-refusals-ask": !0,
353
+ children: "Check refused requests"
354
+ }
355
+ ),
356
+ /* @__PURE__ */ t("span", { className: "text-[11.5px] text-slate-500 dark:text-slate-400", children: "Requests made as them that were refused in the last 7 days. Reads the request log, so it takes a moment." })
357
+ ] });
358
+ }
359
+ export {
360
+ Y as SignInTroubleshooterCard
361
+ };