@nivaro/react 0.3.113 → 0.3.115

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 (285) 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 +1727 -19
  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 +4088 -3592
  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 +544 -504
  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/PageRenderer.js +636 -599
  39. package/dist/shared/components/PresenceDot.js +21 -0
  40. package/dist/shared/components/ProfileView.js +656 -536
  41. package/dist/shared/components/RealtimeStatusBanner.js +25 -25
  42. package/dist/shared/components/RecentRecordsRail.js +51 -48
  43. package/dist/shared/components/RecordCompare.js +241 -150
  44. package/dist/shared/components/RecordDrilldownSheet.js +66 -64
  45. package/dist/shared/components/RecordGridEditor.js +350 -311
  46. package/dist/shared/components/RecordHoverCard.js +147 -0
  47. package/dist/shared/components/RecordPeekHost.js +111 -0
  48. package/dist/shared/components/RecordReadView.js +414 -412
  49. package/dist/shared/components/RelativeTime.js +16 -0
  50. package/dist/shared/components/ReportView.js +1396 -1304
  51. package/dist/shared/components/ScreenRefreshButton.js +77 -0
  52. package/dist/shared/components/TabCountHost.js +10 -0
  53. package/dist/shared/components/TickerNumber.js +19 -18
  54. package/dist/shared/components/TipLayer.js +70 -58
  55. package/dist/shared/components/WidgetImageMenu.js +59 -0
  56. package/dist/shared/components/WidgetSlot.js +571 -524
  57. package/dist/shared/components/activity/RecordActivityStream.js +317 -0
  58. package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
  59. package/dist/shared/components/cbv/approval-changed.js +20 -0
  60. package/dist/shared/components/cbv/changed-by-others.js +251 -0
  61. package/dist/shared/components/cbv/column-totals.js +75 -67
  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/api.js +161 -117
  79. package/dist/shared/components/integrations/console/tone.js +15 -12
  80. package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
  81. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
  82. package/dist/shared/components/item-edit/CloneDialog.js +208 -206
  83. package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
  84. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
  85. package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
  86. package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
  87. package/dist/shared/components/item-edit/FieldComments.js +159 -116
  88. package/dist/shared/components/item-edit/FieldPointer.js +132 -0
  89. package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
  90. package/dist/shared/components/item-edit/FieldRow.js +519 -439
  91. package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
  92. package/dist/shared/components/item-edit/FilePickerField.js +454 -369
  93. package/dist/shared/components/item-edit/GroupSection.js +618 -567
  94. package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
  95. package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
  96. package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
  97. package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
  98. package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
  99. package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
  100. package/dist/shared/components/item-edit/PickerBadges.js +52 -0
  101. package/dist/shared/components/item-edit/PlanGrid.js +434 -439
  102. package/dist/shared/components/item-edit/RecalcValue.js +55 -0
  103. package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
  104. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
  105. package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
  106. package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
  107. package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
  108. package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
  109. package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
  110. package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
  111. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
  112. package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
  113. package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
  114. package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
  115. package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
  116. package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
  117. package/dist/shared/components/item-edit/SectionPresence.js +78 -0
  118. package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
  119. package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
  120. package/dist/shared/components/item-edit/coedit/collab.js +84 -0
  121. package/dist/shared/components/item-edit/coedit/context.js +24 -0
  122. package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
  123. package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
  124. package/dist/shared/components/item-edit/coedit/session.js +382 -0
  125. package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
  126. package/dist/shared/components/item-edit/file-live.js +77 -0
  127. package/dist/shared/components/item-edit/file-processing.js +87 -0
  128. package/dist/shared/components/item-edit/layout-switch.js +148 -0
  129. package/dist/shared/components/item-edit/live-related.js +23 -0
  130. package/dist/shared/components/item-edit/live-title.js +66 -0
  131. package/dist/shared/components/item-edit/partner-needs.js +142 -0
  132. package/dist/shared/components/item-edit/removed-line.js +58 -0
  133. package/dist/shared/components/item-edit/render-stability.js +70 -59
  134. package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
  135. package/dist/shared/components/layout-editor/CollabParts.js +72 -70
  136. package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
  137. package/dist/shared/components/list/InlineEdit.js +504 -208
  138. package/dist/shared/components/list/ListViewers.js +81 -0
  139. package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
  140. package/dist/shared/components/merge/MergeWithFlow.js +290 -0
  141. package/dist/shared/components/merge/merge-values.js +110 -0
  142. package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
  143. package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
  144. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
  145. package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
  146. package/dist/shared/components/notifications/bundles.js +21 -19
  147. package/dist/shared/components/notifications/resolved-line.js +25 -0
  148. package/dist/shared/components/ops/OpsTasksView.js +45 -44
  149. package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
  150. package/dist/shared/components/panels/AlertBanners.js +132 -0
  151. package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
  152. package/dist/shared/components/panels/BranchLanes.js +82 -54
  153. package/dist/shared/components/panels/CommentAwareness.js +332 -0
  154. package/dist/shared/components/panels/CommentImages.js +219 -0
  155. package/dist/shared/components/panels/CommentPanel.js +649 -530
  156. package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
  157. package/dist/shared/components/panels/NewSinceChip.js +16 -0
  158. package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
  159. package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
  160. package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
  161. package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
  162. package/dist/shared/components/panels/SlaClock.js +130 -99
  163. package/dist/shared/components/panels/TaskPanel.js +308 -287
  164. package/dist/shared/components/panels/unseen-move-check.js +101 -0
  165. package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
  166. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
  167. package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
  168. package/dist/shared/components/profile/AgentNameField.js +141 -0
  169. package/dist/shared/components/profile/AgentsPanel.js +55 -46
  170. package/dist/shared/components/profile/PersonAccess.js +398 -330
  171. package/dist/shared/components/profile/PersonAdminTools.js +127 -113
  172. package/dist/shared/components/profile/PersonProfile.js +81 -73
  173. package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
  174. package/dist/shared/components/queue/QueueBulkBar.js +101 -84
  175. package/dist/shared/components/queue/QueueItemSheet.js +66 -66
  176. package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
  177. package/dist/shared/components/queue/QueueWorklist.js +2076 -1686
  178. package/dist/shared/components/queue/queue-totals.js +92 -0
  179. package/dist/shared/components/queue/worklist-helpers.js +18 -14
  180. package/dist/shared/components/send-view/SendViewButton.js +136 -0
  181. package/dist/shared/components/send-view/SentViewCards.js +147 -0
  182. package/dist/shared/components/support/ReportProblem.js +1 -0
  183. package/dist/shared/components/support/ScreenShare.js +554 -0
  184. package/dist/shared/components/support/SupportView.js +160 -129
  185. package/dist/shared/components/support/TicketDetailSheet.js +101 -89
  186. package/dist/shared/components/watch-list/WatchDock.js +1044 -0
  187. package/dist/shared/components/watch-list/WatchExtras.js +723 -0
  188. package/dist/shared/components/watch-list/WatchListButton.js +46 -0
  189. package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
  190. package/dist/shared/components/watch-list/WatchRows.js +348 -0
  191. package/dist/shared/lib/activity-sentence.js +87 -75
  192. package/dist/shared/lib/agent-presence.js +46 -0
  193. package/dist/shared/lib/approval-progress.js +49 -0
  194. package/dist/shared/lib/attention-prefs.js +27 -0
  195. package/dist/shared/lib/cell-locks.js +56 -0
  196. package/dist/shared/lib/co-edit.js +166 -0
  197. package/dist/shared/lib/coedit-registry.js +44 -0
  198. package/dist/shared/lib/comment-awareness.js +124 -0
  199. package/dist/shared/lib/comment-images.js +45 -0
  200. package/dist/shared/lib/config-watch.js +94 -0
  201. package/dist/shared/lib/copy-rules.js +65 -0
  202. package/dist/shared/lib/count-step.js +30 -0
  203. package/dist/shared/lib/deadline-ticker.js +68 -0
  204. package/dist/shared/lib/derived-causes.js +115 -0
  205. package/dist/shared/lib/draft-store.js +114 -85
  206. package/dist/shared/lib/error-hints.js +1 -0
  207. package/dist/shared/lib/field-merge.js +126 -0
  208. package/dist/shared/lib/filter-sentence.js +10 -10
  209. package/dist/shared/lib/focus-mode.js +16 -12
  210. package/dist/shared/lib/grid-cursors.js +77 -0
  211. package/dist/shared/lib/grid-presence.js +182 -0
  212. package/dist/shared/lib/idle-reload.js +100 -73
  213. package/dist/shared/lib/in-step.js +45 -0
  214. package/dist/shared/lib/integration-chip.js +19 -18
  215. package/dist/shared/lib/line-locks.js +141 -0
  216. package/dist/shared/lib/line-split.js +41 -0
  217. package/dist/shared/lib/linked-changes.js +150 -0
  218. package/dist/shared/lib/list-link.js +56 -50
  219. package/dist/shared/lib/list-return.js +231 -0
  220. package/dist/shared/lib/list-viewers.js +52 -0
  221. package/dist/shared/lib/live-announcer.js +86 -0
  222. package/dist/shared/lib/live-counts.js +85 -0
  223. package/dist/shared/lib/live-data-changed.js +108 -0
  224. package/dist/shared/lib/live-deltas.js +81 -0
  225. package/dist/shared/lib/live-findings.js +113 -0
  226. package/dist/shared/lib/live-groups.js +122 -0
  227. package/dist/shared/lib/live-link-labels.js +162 -0
  228. package/dist/shared/lib/live-list-flow.js +334 -0
  229. package/dist/shared/lib/live-list.js +143 -129
  230. package/dist/shared/lib/live-moves.js +51 -0
  231. package/dist/shared/lib/live-ops.js +26 -26
  232. package/dist/shared/lib/live-pickers.js +7 -0
  233. package/dist/shared/lib/live-preference.js +184 -0
  234. package/dist/shared/lib/live-queries.js +226 -181
  235. package/dist/shared/lib/live-screen.js +333 -0
  236. package/dist/shared/lib/live-search.js +108 -0
  237. package/dist/shared/lib/live-seen.js +35 -0
  238. package/dist/shared/lib/live-views.js +100 -0
  239. package/dist/shared/lib/live.js +159 -133
  240. package/dist/shared/lib/missed-updates.js +198 -0
  241. package/dist/shared/lib/newer-file.js +56 -0
  242. package/dist/shared/lib/notification-sound.js +42 -20
  243. package/dist/shared/lib/own-writes.js +59 -41
  244. package/dist/shared/lib/picker-badges.js +94 -0
  245. package/dist/shared/lib/presence-signals.js +131 -84
  246. package/dist/shared/lib/realtime.js +49 -24
  247. package/dist/shared/lib/record-gaps.js +85 -0
  248. package/dist/shared/lib/record-outbox.js +369 -222
  249. package/dist/shared/lib/record-peek.js +75 -0
  250. package/dist/shared/lib/record-tabs.js +92 -72
  251. package/dist/shared/lib/relative-ticker.js +42 -0
  252. package/dist/shared/lib/request-gate.js +119 -119
  253. package/dist/shared/lib/rollup-recalc.js +107 -0
  254. package/dist/shared/lib/room-gaps.js +40 -36
  255. package/dist/shared/lib/rum.js +137 -87
  256. package/dist/shared/lib/save-progress.js +20 -0
  257. package/dist/shared/lib/scheduled-countdown.js +67 -0
  258. package/dist/shared/lib/screen-refresh.js +160 -0
  259. package/dist/shared/lib/screen-share.js +234 -0
  260. package/dist/shared/lib/seen-since.js +74 -0
  261. package/dist/shared/lib/selection-watch.js +205 -0
  262. package/dist/shared/lib/send-status.js +132 -0
  263. package/dist/shared/lib/send-view.js +23 -0
  264. package/dist/shared/lib/socket-liveness.js +155 -0
  265. package/dist/shared/lib/socket-realtime.js +168 -140
  266. package/dist/shared/lib/state-census.js +53 -0
  267. package/dist/shared/lib/summary-mode.js +61 -39
  268. package/dist/shared/lib/tab-attention.js +143 -32
  269. package/dist/shared/lib/table-density.js +64 -0
  270. package/dist/shared/lib/track-travel.js +40 -0
  271. package/dist/shared/lib/unseen-changes.js +68 -0
  272. package/dist/shared/lib/upload-file.js +33 -0
  273. package/dist/shared/lib/upload-presence.js +127 -0
  274. package/dist/shared/lib/urgent-chime.js +65 -0
  275. package/dist/shared/lib/use-online-users.js +32 -11
  276. package/dist/shared/lib/user-sync.js +155 -39
  277. package/dist/shared/lib/waiting-count.js +44 -0
  278. package/dist/shared/lib/watch-desktop.js +83 -0
  279. package/dist/shared/lib/watch-list.js +447 -0
  280. package/dist/shared/lib/widget-image-render.js +64 -0
  281. package/dist/shared/lib/widget-image.js +111 -0
  282. package/dist/shared/lib/worker-socket.js +130 -104
  283. package/dist/shared/lib/write-to-screen.js +133 -0
  284. package/package.json +1 -1
  285. package/styles.css +49 -1
@@ -1,17 +1,19 @@
1
- import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
- import { useQueryClient as I, useQuery as T } from "@tanstack/react-query";
3
- import { useState as f, useRef as V, useEffect as G, useMemo as j } from "react";
4
- import { useNivaroClient as B, useItemNavigation as H, useNavigation as O } from "../context.js";
5
- import { get as M, post as A, put as J } from "../lib/commands.js";
6
- import { useLiveWatchRoom as X, useLiveEvent as Z } from "../lib/live.js";
7
- import { userErrorMessage as P } from "../lib/safe-error.js";
8
- import { cn as N, toLocalDateString as ee, titleCase as te } from "../lib/utils.js";
9
- import { PickList as U } from "./imports/ServiceConfigBuilder.js";
10
- import { useOverviewFields as re } from "./layout-editor/overview/overview-api.js";
11
- import { TipLayer as ae } from "./TipLayer.js";
12
- function ne({ p: r }) {
13
- const a = r.total ? Math.min(100, Math.round(r.checked / r.total * 100)) : null;
14
- return /* @__PURE__ */ n("div", { className: "flex items-center gap-3 text-[11.5px]", "data-conformance-sweep": r.run, children: [
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import { useQueryClient as U, useQuery as T } from "@tanstack/react-query";
3
+ import { useState as v, useRef as G, useEffect as H, useMemo as D } from "react";
4
+ import { useNivaroClient as K, useItemNavigation as J, useNavigation as Y } from "../context.js";
5
+ import { get as B, post as A, put as X } from "../lib/commands.js";
6
+ import { useLiveWatchRoom as Z, useLiveEvent as P } from "../lib/live.js";
7
+ import { useResolvedFindings as ee } from "../lib/live-findings.js";
8
+ import { userErrorMessage as te } from "../lib/safe-error.js";
9
+ import { cn as _, toLocalDateString as re, titleCase as ne } from "../lib/utils.js";
10
+ import { FindingFixedMark as z } from "./FindingFixedMark.js";
11
+ import { PickList as O } from "./imports/ServiceConfigBuilder.js";
12
+ import { useOverviewFields as ae } from "./layout-editor/overview/overview-api.js";
13
+ import { TipLayer as le } from "./TipLayer.js";
14
+ function oe({ p: r }) {
15
+ const n = r.total ? Math.min(100, Math.round(r.checked / r.total * 100)) : null;
16
+ return /* @__PURE__ */ l("div", { className: "flex items-center gap-3 text-[11.5px]", "data-conformance-sweep": r.run, children: [
15
17
  /* @__PURE__ */ e("span", { className: "w-[180px] shrink-0 truncate font-medium text-slate-700 dark:text-foreground", children: r.collection }),
16
18
  /* @__PURE__ */ e(
17
19
  "span",
@@ -20,21 +22,21 @@ function ne({ p: r }) {
20
22
  "aria-label": `${r.collection} sweep`,
21
23
  "aria-valuemin": 0,
22
24
  "aria-valuemax": 100,
23
- "aria-valuenow": a ?? void 0,
25
+ "aria-valuenow": n ?? void 0,
24
26
  className: "relative h-1.5 w-[220px] overflow-hidden rounded-full bg-slate-100 dark:bg-white/10",
25
27
  children: /* @__PURE__ */ e(
26
28
  "span",
27
29
  {
28
- className: N(
30
+ className: _(
29
31
  "absolute inset-y-0 left-0 rounded-full bg-nvr-cyan transition-[width] duration-300 motion-reduce:transition-none",
30
- a === null && "w-1/3 animate-pulse"
32
+ n === null && "w-1/3 animate-pulse"
31
33
  ),
32
- style: a === null ? void 0 : { width: `${a}%` }
34
+ style: n === null ? void 0 : { width: `${n}%` }
33
35
  }
34
36
  )
35
37
  }
36
38
  ),
37
- /* @__PURE__ */ n("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: [
39
+ /* @__PURE__ */ l("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: [
38
40
  r.checked.toLocaleString(),
39
41
  r.total ? ` of ${r.total.toLocaleString()}` : "",
40
42
  " checked · ",
@@ -46,22 +48,22 @@ function ne({ p: r }) {
46
48
  ] })
47
49
  ] });
48
50
  }
49
- function le(r) {
51
+ function se(r) {
50
52
  if (!r) return "";
51
- const a = Date.now() - new Date(r).getTime(), s = Math.round(a / 6e4);
52
- if (s < 1) return "just now";
53
- if (s < 60) return `${s}m ago`;
54
- const p = Math.round(s / 60);
55
- return p < 24 ? `${p}h ago` : ee(r);
53
+ const n = Date.now() - new Date(r).getTime(), d = Math.round(n / 6e4);
54
+ if (d < 1) return "just now";
55
+ if (d < 60) return `${d}m ago`;
56
+ const p = Math.round(d / 60);
57
+ return p < 24 ? `${p}h ago` : re(r);
56
58
  }
57
- function oe(r) {
59
+ function ie(r) {
58
60
  if (!r.started_at || !r.finished_at) return "";
59
- const a = Math.round(
61
+ const n = Math.round(
60
62
  (new Date(r.finished_at).getTime() - new Date(r.started_at).getTime()) / 1e3
61
63
  );
62
- return a < 60 ? `${a}s` : `${Math.floor(a / 60)}m ${a % 60}s`;
64
+ return n < 60 ? `${n}s` : `${Math.floor(n / 60)}m ${n % 60}s`;
63
65
  }
64
- const F = {
66
+ const M = {
65
67
  required: {
66
68
  label: "Required empty",
67
69
  cls: "bg-red-500/10 text-red-700 dark:text-red-400"
@@ -99,45 +101,45 @@ const F = {
99
101
  cls: "bg-purple-500/10 text-purple-700 dark:text-purple-400"
100
102
  }
101
103
  };
102
- function z(r) {
104
+ function W(r) {
103
105
  return String(r ?? "").trim() || "Record with no number";
104
106
  }
105
- function D(r, a) {
106
- return r[a] || te(a);
107
+ function Q(r, n) {
108
+ return r[n] || ne(n);
107
109
  }
108
- const E = (r) => r.replace(/[-_]+/g, " ").replace(/^\w/, (a) => a.toUpperCase());
109
- function se({ findingId: r }) {
110
- const a = B(), [s, p] = f(!1), [x, d] = f(""), [o, i] = f(!1), [g, v] = f(null), w = T({
111
- queryKey: ["conformance-assign-users", x],
112
- queryFn: () => a.request(M(`/users?search=${encodeURIComponent(x)}&limit=8`)).then((u) => u.data),
113
- enabled: s && x.trim().length >= 2,
110
+ const j = (r) => r.replace(/[-_]+/g, " ").replace(/^\w/, (n) => n.toUpperCase());
111
+ function de({ findingId: r }) {
112
+ const n = K(), [d, p] = v(!1), [h, c] = v(""), [a, u] = v(!1), [f, x] = v(null), N = T({
113
+ queryKey: ["conformance-assign-users", h],
114
+ queryFn: () => n.request(B(`/users?search=${encodeURIComponent(h)}&limit=8`)).then((m) => m.data),
115
+ enabled: d && h.trim().length >= 2,
114
116
  staleTime: 3e4
115
- }), y = async (u) => {
116
- i(!0);
117
+ }), k = async (m) => {
118
+ u(!0);
117
119
  try {
118
- await a.request(
119
- A(`/config-conformance/findings/${r}/assign`, { user_id: u.id })
120
- ), v([u.first_name, u.last_name].filter(Boolean).join(" ") || u.email), p(!1);
120
+ await n.request(
121
+ A(`/config-conformance/findings/${r}/assign`, { user_id: m.id })
122
+ ), x([m.first_name, m.last_name].filter(Boolean).join(" ") || m.email), p(!1);
121
123
  } finally {
122
- i(!1);
124
+ u(!1);
123
125
  }
124
126
  };
125
- return g ? /* @__PURE__ */ n("span", { className: "text-[11px] text-emerald-700 dark:text-emerald-400", "data-finding-assigned": !0, children: [
127
+ return f ? /* @__PURE__ */ l("span", { className: "text-[11px] text-emerald-700 dark:text-emerald-400", "data-finding-assigned": !0, children: [
126
128
  "→ ",
127
- g
128
- ] }) : /* @__PURE__ */ n("span", { className: "relative inline-block", children: [
129
+ f
130
+ ] }) : /* @__PURE__ */ l("span", { className: "relative inline-block", children: [
129
131
  /* @__PURE__ */ e(
130
132
  "button",
131
133
  {
132
134
  type: "button",
133
- onClick: () => p((u) => !u),
135
+ onClick: () => p((m) => !m),
134
136
  "data-finding-assign": r,
135
137
  className: "rounded-md border border-slate-200 px-2 py-0.5 text-[11px] text-slate-600 hover:border-slate-300 hover:text-slate-800 dark:border-border dark:text-muted-foreground",
136
138
  title: "Assign this finding to someone as a task on the record",
137
139
  children: "Assign…"
138
140
  }
139
141
  ),
140
- s && /* @__PURE__ */ n(
142
+ d && /* @__PURE__ */ l(
141
143
  "div",
142
144
  {
143
145
  className: "absolute right-0 top-7 z-30 w-64 rounded-md border border-slate-200 bg-white p-2 text-left shadow-md dark:border-border dark:bg-card",
@@ -147,131 +149,131 @@ function se({ findingId: r }) {
147
149
  "input",
148
150
  {
149
151
  autoFocus: !0,
150
- value: x,
151
- onChange: (u) => d(u.target.value),
152
+ value: h,
153
+ onChange: (m) => c(m.target.value),
152
154
  placeholder: "Type a name…",
153
155
  className: "h-7 w-full rounded-md border border-slate-200 bg-white px-2 text-[12px] dark:border-border dark:bg-background"
154
156
  }
155
157
  ),
156
- /* @__PURE__ */ n("ul", { className: "mt-1 max-h-48 overflow-y-auto", children: [
157
- (w.data ?? []).map((u) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ n(
158
+ /* @__PURE__ */ l("ul", { className: "mt-1 max-h-48 overflow-y-auto", children: [
159
+ (N.data ?? []).map((m) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ l(
158
160
  "button",
159
161
  {
160
162
  type: "button",
161
- disabled: o,
162
- onClick: () => void y(u),
163
+ disabled: a,
164
+ onClick: () => void k(m),
163
165
  className: "w-full rounded px-2 py-1 text-left text-[12px] hover:bg-muted disabled:opacity-50",
164
166
  children: [
165
- [u.first_name, u.last_name].filter(Boolean).join(" ") || u.email,
166
- /* @__PURE__ */ e("span", { className: "ml-1 text-[10.5px] text-slate-400", children: u.email })
167
+ [m.first_name, m.last_name].filter(Boolean).join(" ") || m.email,
168
+ /* @__PURE__ */ e("span", { className: "ml-1 text-[10.5px] text-slate-400", children: m.email })
167
169
  ]
168
170
  }
169
- ) }, u.id)),
170
- s && x.trim().length >= 2 && w.data && w.data.length === 0 && /* @__PURE__ */ e("li", { className: "px-2 py-1 text-[11.5px] text-slate-400", children: "No one matches" })
171
+ ) }, m.id)),
172
+ d && h.trim().length >= 2 && N.data && N.data.length === 0 && /* @__PURE__ */ e("li", { className: "px-2 py-1 text-[11.5px] text-slate-400", children: "No one matches" })
171
173
  ] })
172
174
  ]
173
175
  }
174
176
  )
175
177
  ] });
176
178
  }
177
- function $e({ className: r }) {
178
- const a = B(), s = I(), p = H(), x = O(), [d, o] = f(""), [i, g] = f(null), [v, w] = f(!1), [y, u] = f(null), [C, q] = f("5000"), c = X("conformance"), [$, R] = f({}), t = V(null);
179
- G(
179
+ function Le({ className: r }) {
180
+ const n = K(), d = U(), p = J(), h = Y(), [c, a] = v(""), [u, f] = v(null), [x, N] = v(!1), [k, m] = v(null), [y, q] = v("5000"), s = Z("conformance"), [w, I] = v({}), b = G(null);
181
+ H(
180
182
  () => () => {
181
- t.current && clearTimeout(t.current);
183
+ b.current && clearTimeout(b.current);
182
184
  },
183
185
  []
184
- ), Z(
186
+ ), P(
185
187
  "conformance:progress",
186
- (l) => {
187
- R((L) => {
188
- const K = { ...L };
189
- return l.status === "running" ? K[l.run] = l : delete K[l.run], K;
188
+ (o) => {
189
+ I((F) => {
190
+ const E = { ...F };
191
+ return o.status === "running" ? E[o.run] = o : delete E[o.run], E;
190
192
  });
191
- const _ = () => {
192
- s.invalidateQueries({ queryKey: ["conformance-runs"] }), s.invalidateQueries({ queryKey: ["conformance-run", l.run] }), l.status !== "running" && s.invalidateQueries({ queryKey: ["conformance-collections"] });
193
+ const L = () => {
194
+ d.invalidateQueries({ queryKey: ["conformance-runs"] }), d.invalidateQueries({ queryKey: ["conformance-run", o.run] }), o.status !== "running" && d.invalidateQueries({ queryKey: ["conformance-collections"] });
193
195
  };
194
- l.status !== "running" ? (t.current && clearTimeout(t.current), t.current = null, _()) : t.current || (t.current = setTimeout(() => {
195
- t.current = null, _();
196
+ o.status !== "running" ? (b.current && clearTimeout(b.current), b.current = null, L()) : b.current || (b.current = setTimeout(() => {
197
+ b.current = null, L();
196
198
  }, 1500));
197
199
  },
198
200
  { includeOwn: !0 }
199
201
  );
200
- const { data: m = [], isLoading: h } = T(
202
+ const { data: R = [], isLoading: g } = T(
201
203
  {
202
204
  queryKey: ["conformance-collections"],
203
- queryFn: () => a.request(M("/config-conformance/collections")).then((l) => l.data ?? []),
205
+ queryFn: () => n.request(B("/config-conformance/collections")).then((o) => o.data ?? []),
204
206
  staleTime: 5 * 6e4
205
207
  }
206
- ), { data: b = [], isFetched: W } = T({
207
- queryKey: ["conformance-runs", d],
208
- queryFn: () => a.request(
209
- M(`/config-conformance/runs${d ? `?collection=${d}` : ""}`)
210
- ).then((l) => l.data ?? []),
211
- refetchInterval: (l) => {
212
- var _;
213
- return (_ = l.state.data) != null && _.some((L) => L.status === "running") ? c ? 2e4 : 3e3 : !1;
208
+ ), { data: t = [], isFetched: i } = T({
209
+ queryKey: ["conformance-runs", c],
210
+ queryFn: () => n.request(
211
+ B(`/config-conformance/runs${c ? `?collection=${c}` : ""}`)
212
+ ).then((o) => o.data ?? []),
213
+ refetchInterval: (o) => {
214
+ var L;
215
+ return (L = o.state.data) != null && L.some((F) => F.status === "running") ? s ? 2e4 : 3e3 : !1;
214
216
  }
215
- }), Q = Object.values($).filter((l) => {
216
- const _ = b.find((L) => L.id === l.run);
217
- return !_ || _.status === "running";
218
- }), S = (i != null ? b.find((l) => l.id === i) : void 0) ?? b[0], k = m.find((l) => l.collection === d), Y = async () => {
219
- if (d) {
220
- w(!0), u(null);
217
+ }), S = Object.values(w).filter((o) => {
218
+ const L = t.find((F) => F.id === o.run);
219
+ return !L || L.status === "running";
220
+ }), $ = (u != null ? t.find((o) => o.id === u) : void 0) ?? t[0], C = R.find((o) => o.collection === c), V = async () => {
221
+ if (c) {
222
+ N(!0), m(null);
221
223
  try {
222
- const l = await a.request(
223
- A(`/config-conformance/${d}/run`, {
224
- limit: C === "0" ? 0 : Number(C) || 5e3
224
+ const o = await n.request(
225
+ A(`/config-conformance/${c}/run`, {
226
+ limit: y === "0" ? 0 : Number(y) || 5e3
225
227
  })
226
228
  );
227
- g(l.data.id), s.invalidateQueries({ queryKey: ["conformance-runs"] });
228
- } catch (l) {
229
- u(P(l, "Could not start the run"));
229
+ f(o.data.id), d.invalidateQueries({ queryKey: ["conformance-runs"] });
230
+ } catch (o) {
231
+ m(te(o, "Could not start the run"));
230
232
  } finally {
231
- w(!1);
233
+ N(!1);
232
234
  }
233
235
  }
234
236
  };
235
- return /* @__PURE__ */ n("div", { className: N("flex min-h-0 flex-1 flex-col gap-4 p-6", r), "data-conformance": !0, children: [
236
- /* @__PURE__ */ e(ae, {}),
237
- /* @__PURE__ */ n("div", { className: "flex flex-wrap items-end gap-3", children: [
238
- /* @__PURE__ */ n("div", { className: "w-[300px]", children: [
237
+ return /* @__PURE__ */ l("div", { className: _("flex min-h-0 flex-1 flex-col gap-4 p-6", r), "data-conformance": !0, children: [
238
+ /* @__PURE__ */ e(le, {}),
239
+ /* @__PURE__ */ l("div", { className: "flex flex-wrap items-end gap-3", children: [
240
+ /* @__PURE__ */ l("div", { className: "w-[300px]", children: [
239
241
  /* @__PURE__ */ e("p", { className: "mb-1 text-[11.5px] font-medium text-slate-700 dark:text-foreground", children: "Collection" }),
240
242
  /* @__PURE__ */ e(
241
- U,
243
+ O,
242
244
  {
243
- value: d,
244
- onChange: (l) => {
245
- o(l), g(null);
245
+ value: c,
246
+ onChange: (o) => {
247
+ a(o), f(null);
246
248
  },
247
- options: m.map((l) => ({
248
- value: l.collection,
249
- label: l.display_name || l.collection
249
+ options: R.map((o) => ({
250
+ value: o.collection,
251
+ label: o.display_name || o.collection
250
252
  })),
251
- placeholder: h ? "Loading…" : "Choose a collection…",
253
+ placeholder: g ? "Loading…" : "Choose a collection…",
252
254
  className: "h-8"
253
255
  }
254
256
  )
255
257
  ] }),
256
- k && /* @__PURE__ */ n("p", { className: "pb-1.5 text-[11.5px] text-slate-400", children: [
257
- k.required,
258
+ C && /* @__PURE__ */ l("p", { className: "pb-1.5 text-[11.5px] text-slate-400", children: [
259
+ C.required,
258
260
  " required · ",
259
- k.validation,
261
+ C.validation,
260
262
  " validation · ",
261
- k.cascade,
263
+ C.cascade,
262
264
  " ",
263
265
  "cascade check",
264
- k.cascade === 1 ? "" : "s",
265
- (k.row_rules ?? 0) > 0 && ` · ${k.row_rules} grid${k.row_rules === 1 ? "" : "s"} with row rules`,
266
- (k.row_lints ?? 0) > 0 && ` · ${k.row_lints} grid${k.row_lints === 1 ? "" : "s"} with row lints`,
267
- k.skipped > 0 && ` · ${k.skipped} not evaluable`
266
+ C.cascade === 1 ? "" : "s",
267
+ (C.row_rules ?? 0) > 0 && ` · ${C.row_rules} grid${C.row_rules === 1 ? "" : "s"} with row rules`,
268
+ (C.row_lints ?? 0) > 0 && ` · ${C.row_lints} grid${C.row_lints === 1 ? "" : "s"} with row lints`,
269
+ C.skipped > 0 && ` · ${C.skipped} not evaluable`
268
270
  ] }),
269
- /* @__PURE__ */ n("div", { className: "w-[170px]", children: [
271
+ /* @__PURE__ */ l("div", { className: "w-[170px]", children: [
270
272
  /* @__PURE__ */ e("p", { className: "mb-1 text-[11.5px] font-medium text-slate-700 dark:text-foreground", children: "Sample size" }),
271
273
  /* @__PURE__ */ e(
272
- U,
274
+ O,
273
275
  {
274
- value: C,
276
+ value: y,
275
277
  onChange: q,
276
278
  options: [
277
279
  { value: "1000", label: "1,000 newest" },
@@ -290,80 +292,80 @@ function $e({ className: r }) {
290
292
  "button",
291
293
  {
292
294
  type: "button",
293
- disabled: !d || v || b.some((l) => l.status === "running"),
294
- onClick: () => void Y(),
295
+ disabled: !c || x || t.some((o) => o.status === "running"),
296
+ onClick: () => void V(),
295
297
  className: "h-8 rounded-md bg-nvr-cyan px-3 text-[12.5px] font-medium text-white disabled:opacity-50",
296
- children: v ? "Starting…" : "Run checks"
298
+ children: x ? "Starting…" : "Run checks"
297
299
  }
298
300
  ),
299
- d && /* @__PURE__ */ e(de, { collection: d }),
300
- b.filter((l) => l.status === "completed").length >= 2 && /* @__PURE__ */ e(ie, { runs: b }),
301
- y && /* @__PURE__ */ e("p", { className: "pb-1.5 text-[12px] text-red-600 dark:text-red-400", children: y })
301
+ c && /* @__PURE__ */ e(ce, { collection: c }),
302
+ t.filter((o) => o.status === "completed").length >= 2 && /* @__PURE__ */ e(ue, { runs: t }),
303
+ k && /* @__PURE__ */ e("p", { className: "pb-1.5 text-[12px] text-red-600 dark:text-red-400", children: k })
302
304
  ] }),
303
- Q.length > 0 && /* @__PURE__ */ n(
305
+ S.length > 0 && /* @__PURE__ */ l(
304
306
  "div",
305
307
  {
306
308
  className: "flex flex-col gap-2 rounded-lg border border-slate-200 bg-white px-4 py-3 dark:border-border dark:bg-card",
307
309
  "data-conformance-sweeps": !0,
308
310
  children: [
309
311
  /* @__PURE__ */ e("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Sweeps in progress" }),
310
- Q.map((l) => /* @__PURE__ */ e(ne, { p: l }, l.run))
312
+ S.map((o) => /* @__PURE__ */ e(oe, { p: o }, o.run))
311
313
  ]
312
314
  }
313
315
  ),
314
- b.length > 0 && /* @__PURE__ */ e(ce, { runs: b, activeId: (S == null ? void 0 : S.id) ?? null, onSelect: g }),
315
- S && /* @__PURE__ */ e(
316
- ue,
316
+ t.length > 0 && /* @__PURE__ */ e(me, { runs: t, activeId: ($ == null ? void 0 : $.id) ?? null, onSelect: f }),
317
+ $ && /* @__PURE__ */ e(
318
+ he,
317
319
  {
318
- run: S,
319
- liveProgress: $[S.id] ?? null,
320
- live: c,
321
- onOpenItem: (l, _) => {
322
- if (_) {
323
- const L = p.urlFor({ collection: S.collection, itemId: l });
324
- x.navigate(
325
- `${L}${L.includes("?") ? "&" : "?"}focus=${encodeURIComponent(_)}`
320
+ run: $,
321
+ liveProgress: w[$.id] ?? null,
322
+ live: s,
323
+ onOpenItem: (o, L) => {
324
+ if (L) {
325
+ const F = p.urlFor({ collection: $.collection, itemId: o });
326
+ h.navigate(
327
+ `${F}${F.includes("?") ? "&" : "?"}focus=${encodeURIComponent(L)}`
326
328
  );
327
329
  } else
328
- p.open({ collection: S.collection, itemId: l });
330
+ p.open({ collection: $.collection, itemId: o });
329
331
  }
330
332
  }
331
333
  ),
332
- !S && !h && W && /* @__PURE__ */ n("div", { className: "max-w-[560px] rounded-lg border border-slate-200 bg-white p-5 dark:border-border dark:bg-card", children: [
334
+ !$ && !g && i && /* @__PURE__ */ l("div", { className: "max-w-[560px] rounded-lg border border-slate-200 bg-white p-5 dark:border-border dark:bg-card", children: [
333
335
  /* @__PURE__ */ e("p", { className: "text-[13px] font-medium text-slate-800 dark:text-foreground", children: "Which records would fail their own form?" }),
334
336
  /* @__PURE__ */ e("p", { className: "mt-1.5 text-[12.5px] leading-relaxed text-slate-500 dark:text-muted-foreground", children: "Field rules accumulate while data drifts underneath them — imports, integrations, and parent-link changes leave records whose values a person could never save today (“this value is not an available option”). Pick a collection and run its checks: required fields, validation rules, cascade availability, and inline-grid row rules (a labor line still priced at $40, a line whose task no longer matches its category), evaluated against the newest records." })
335
337
  ] })
336
338
  ] });
337
339
  }
338
- function de({ collection: r }) {
339
- const a = B(), s = I(), { data: p, isError: x } = T({
340
+ function ce({ collection: r }) {
341
+ const n = K(), d = U(), { data: p, isError: h } = T({
340
342
  queryKey: ["conformance-schedules"],
341
- queryFn: () => a.request(
342
- M("/config-conformance/schedules")
343
- ).then((o) => o.data ?? []),
343
+ queryFn: () => n.request(
344
+ B("/config-conformance/schedules")
345
+ ).then((a) => a.data ?? []),
344
346
  retry: !1,
345
347
  staleTime: 6e4
346
348
  });
347
- if (x || !p) return null;
348
- const d = p.some((o) => o.collection === r && o.is_active);
349
- return /* @__PURE__ */ n("label", { className: "flex shrink-0 cursor-pointer items-center gap-1.5 whitespace-nowrap pb-1.5 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
349
+ if (h || !p) return null;
350
+ const c = p.some((a) => a.collection === r && a.is_active);
351
+ return /* @__PURE__ */ l("label", { className: "flex shrink-0 cursor-pointer items-center gap-1.5 whitespace-nowrap pb-1.5 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
350
352
  /* @__PURE__ */ e(
351
353
  "button",
352
354
  {
353
355
  type: "button",
354
356
  role: "switch",
355
- "aria-checked": d,
356
- onClick: () => void a.request(J(`/config-conformance/schedules/${r}`, { is_active: !d })).then(() => s.invalidateQueries({ queryKey: ["conformance-schedules"] })),
357
- className: N(
357
+ "aria-checked": c,
358
+ onClick: () => void n.request(X(`/config-conformance/schedules/${r}`, { is_active: !c })).then(() => d.invalidateQueries({ queryKey: ["conformance-schedules"] })),
359
+ className: _(
358
360
  "relative h-4 w-7 shrink-0 rounded-full transition-colors",
359
- d ? "bg-nvr-cyan" : "bg-slate-300 dark:bg-border"
361
+ c ? "bg-nvr-cyan" : "bg-slate-300 dark:bg-border"
360
362
  ),
361
363
  children: /* @__PURE__ */ e(
362
364
  "span",
363
365
  {
364
- className: N(
366
+ className: _(
365
367
  "absolute left-0 top-0.5 h-3 w-3 rounded-full bg-white transition-transform",
366
- d ? "translate-x-3.5" : "translate-x-0.5"
368
+ c ? "translate-x-3.5" : "translate-x-0.5"
367
369
  )
368
370
  }
369
371
  )
@@ -372,38 +374,38 @@ function de({ collection: r }) {
372
374
  "Nightly sweep"
373
375
  ] });
374
376
  }
375
- function ie({ runs: r }) {
376
- const a = r.filter((i) => i.status === "completed").slice(0, 12).reverse();
377
- if (a.length < 2) return null;
378
- const s = Math.max(...a.map((i) => i.violation_count), 1), p = 90, x = 22, d = a.map(
379
- (i, g) => `${g / (a.length - 1) * (p - 4) + 2},${x - 3 - i.violation_count / s * (x - 6)}`
380
- ).join(" "), o = a[a.length - 1].violation_count <= a[0].violation_count;
377
+ function ue({ runs: r }) {
378
+ const n = r.filter((u) => u.status === "completed").slice(0, 12).reverse();
379
+ if (n.length < 2) return null;
380
+ const d = Math.max(...n.map((u) => u.violation_count), 1), p = 90, h = 22, c = n.map(
381
+ (u, f) => `${f / (n.length - 1) * (p - 4) + 2},${h - 3 - u.violation_count / d * (h - 6)}`
382
+ ).join(" "), a = n[n.length - 1].violation_count <= n[0].violation_count;
381
383
  return /* @__PURE__ */ e(
382
384
  "span",
383
385
  {
384
386
  className: "flex items-end gap-1.5 pb-1",
385
- "data-tip": `${a[0].violation_count.toLocaleString()} → ${a[a.length - 1].violation_count.toLocaleString()} issues across the last ${a.length} runs`,
386
- children: /* @__PURE__ */ e("svg", { width: p, height: x, className: "overflow-visible", children: /* @__PURE__ */ e(
387
+ "data-tip": `${n[0].violation_count.toLocaleString()} → ${n[n.length - 1].violation_count.toLocaleString()} issues across the last ${n.length} runs`,
388
+ children: /* @__PURE__ */ e("svg", { width: p, height: h, className: "overflow-visible", children: /* @__PURE__ */ e(
387
389
  "polyline",
388
390
  {
389
- points: d,
391
+ points: c,
390
392
  fill: "none",
391
393
  strokeWidth: "1.5",
392
- className: o ? "stroke-emerald-500" : "stroke-amber-500"
394
+ className: a ? "stroke-emerald-500" : "stroke-amber-500"
393
395
  }
394
396
  ) })
395
397
  }
396
398
  );
397
399
  }
398
- function ce({
400
+ function me({
399
401
  runs: r,
400
- activeId: a,
401
- onSelect: s
402
+ activeId: n,
403
+ onSelect: d
402
404
  }) {
403
- const [p, x] = f(!1), d = p ? r : r.slice(0, 5);
404
- return /* @__PURE__ */ n("div", { className: "overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
405
- /* @__PURE__ */ n("table", { className: "w-full border-collapse text-[12px] tabular-nums", children: [
406
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "border-b border-slate-100 text-left text-[10.5px] uppercase tracking-wide text-slate-400 dark:border-border", children: [
405
+ const [p, h] = v(!1), c = p ? r : r.slice(0, 5);
406
+ return /* @__PURE__ */ l("div", { className: "overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
407
+ /* @__PURE__ */ l("table", { className: "w-full border-collapse text-[12px] tabular-nums", children: [
408
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "border-b border-slate-100 text-left text-[10.5px] uppercase tracking-wide text-slate-400 dark:border-border", children: [
407
409
  /* @__PURE__ */ e("th", { className: "px-3 py-1.5 font-medium", children: "Run" }),
408
410
  /* @__PURE__ */ e("th", { className: "px-2 py-1.5 font-medium", children: "Collection" }),
409
411
  /* @__PURE__ */ e("th", { className: "px-2 py-1.5 font-medium", children: "Result" }),
@@ -412,94 +414,145 @@ function ce({
412
414
  /* @__PURE__ */ e("th", { className: "px-2 py-1.5 font-medium", children: "Started" }),
413
415
  /* @__PURE__ */ e("th", { className: "px-3 py-1.5 font-medium", children: "By" })
414
416
  ] }) }),
415
- /* @__PURE__ */ e("tbody", { children: d.map((o) => /* @__PURE__ */ n(
417
+ /* @__PURE__ */ e("tbody", { children: c.map((a) => /* @__PURE__ */ l(
416
418
  "tr",
417
419
  {
418
- onClick: () => s(o.id),
419
- className: N(
420
+ onClick: () => d(a.id),
421
+ className: _(
420
422
  "cursor-pointer border-b border-slate-50 transition-colors last:border-0 dark:border-border/50",
421
- a === o.id ? "bg-nvr-cyan/[0.06] dark:bg-nvr-cyan/10" : "hover:bg-slate-50 dark:hover:bg-background/40"
423
+ n === a.id ? "bg-nvr-cyan/[0.06] dark:bg-nvr-cyan/10" : "hover:bg-slate-50 dark:hover:bg-background/40"
422
424
  ),
423
425
  children: [
424
- /* @__PURE__ */ n("td", { className: "px-3 py-1.5 font-mono text-[11px] text-slate-500 dark:text-muted-foreground", children: [
426
+ /* @__PURE__ */ l("td", { className: "px-3 py-1.5 font-mono text-[11px] text-slate-500 dark:text-muted-foreground", children: [
425
427
  "#",
426
- o.id
428
+ a.id
427
429
  ] }),
428
- /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-slate-700 dark:text-foreground", children: o.collection }),
429
- /* @__PURE__ */ e("td", { className: "px-2 py-1.5", children: o.status === "running" ? /* @__PURE__ */ n("span", { className: "flex items-center gap-1.5 text-nvr-cyan-dark dark:text-nvr-cyan", children: [
430
+ /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-slate-700 dark:text-foreground", children: a.collection }),
431
+ /* @__PURE__ */ e("td", { className: "px-2 py-1.5", children: a.status === "running" ? /* @__PURE__ */ l("span", { className: "flex items-center gap-1.5 text-nvr-cyan-dark dark:text-nvr-cyan", children: [
430
432
  /* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan" }),
431
433
  "running"
432
- ] }) : o.status === "error" ? /* @__PURE__ */ e("span", { className: "text-red-600 dark:text-red-400", "data-tip": o.error ?? void 0, children: "error" }) : o.violation_count === 0 ? /* @__PURE__ */ e("span", { className: "text-emerald-600 dark:text-emerald-400", children: "clean" }) : /* @__PURE__ */ n("span", { className: "text-slate-700 dark:text-foreground", children: [
433
- o.violation_count.toLocaleString(),
434
+ ] }) : a.status === "error" ? /* @__PURE__ */ e("span", { className: "text-red-600 dark:text-red-400", "data-tip": a.error ?? void 0, children: "error" }) : a.violation_count === 0 ? /* @__PURE__ */ e("span", { className: "text-emerald-600 dark:text-emerald-400", children: "clean" }) : /* @__PURE__ */ l("span", { className: "text-slate-700 dark:text-foreground", children: [
435
+ a.violation_count.toLocaleString(),
434
436
  " issue",
435
- o.violation_count === 1 ? "" : "s"
437
+ a.violation_count === 1 ? "" : "s"
436
438
  ] }) }),
437
- /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500 dark:text-muted-foreground", children: o.checked_records.toLocaleString() }),
438
- /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500 dark:text-muted-foreground", children: oe(o) }),
439
+ /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500 dark:text-muted-foreground", children: a.checked_records.toLocaleString() }),
440
+ /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500 dark:text-muted-foreground", children: ie(a) }),
439
441
  /* @__PURE__ */ e(
440
442
  "td",
441
443
  {
442
444
  className: "px-2 py-1.5 text-slate-500 dark:text-muted-foreground",
443
- "data-tip": o.started_at ? new Date(o.started_at).toLocaleString() : void 0,
444
- children: le(o.started_at)
445
+ "data-tip": a.started_at ? new Date(a.started_at).toLocaleString() : void 0,
446
+ children: se(a.started_at)
445
447
  }
446
448
  ),
447
- /* @__PURE__ */ e("td", { className: "px-3 py-1.5 text-slate-500 dark:text-muted-foreground", children: o.triggered_by_name ?? "Scheduled" })
449
+ /* @__PURE__ */ e("td", { className: "px-3 py-1.5 text-slate-500 dark:text-muted-foreground", children: a.triggered_by_name ?? "Scheduled" })
448
450
  ]
449
451
  },
450
- o.id
452
+ a.id
451
453
  )) })
452
454
  ] }),
453
455
  r.length > 5 && /* @__PURE__ */ e(
454
456
  "button",
455
457
  {
456
458
  type: "button",
457
- onClick: () => x((o) => !o),
459
+ onClick: () => h((a) => !a),
458
460
  className: "w-full border-t border-slate-100 py-1.5 text-[11px] text-slate-400 transition-colors hover:text-slate-600 dark:border-border dark:hover:text-muted-foreground",
459
461
  children: p ? "Show fewer" : `Show all ${r.length} runs`
460
462
  }
461
463
  )
462
464
  ] });
463
465
  }
464
- function ue({
466
+ async function pe(r, n, d, p) {
467
+ const h = /* @__PURE__ */ new Map();
468
+ for (const x of d) h.set(x.itemId, [...h.get(x.itemId) ?? [], x]);
469
+ const c = [], a = [...h.entries()];
470
+ let u = 0;
471
+ const f = async () => {
472
+ var x, N;
473
+ for (; u < a.length; ) {
474
+ const [k, m] = a[u++];
475
+ try {
476
+ const y = await r.request(
477
+ A(
478
+ `/config-conformance/record/${encodeURIComponent(n)}/${encodeURIComponent(k)}/check`
479
+ )
480
+ );
481
+ if (((x = y.data) == null ? void 0 : x.enabled) === !1) continue;
482
+ const q = new Set(
483
+ (((N = y.data) == null ? void 0 : N.findings) ?? []).map((s) => `${s.field ?? ""}\0${s.rule}`)
484
+ );
485
+ for (const s of m) {
486
+ const w = p.get(s.key);
487
+ w && !q.has(`${w.field}\0${w.rule}`) && c.push(s.key);
488
+ }
489
+ } catch (y) {
490
+ if ((y == null ? void 0 : y.status) === 404) for (const q of m) c.push(q.key);
491
+ }
492
+ }
493
+ };
494
+ return await Promise.all([f(), f(), f(), f()]), c;
495
+ }
496
+ function he({
465
497
  run: r,
466
- onOpenItem: a,
467
- liveProgress: s,
498
+ onOpenItem: n,
499
+ liveProgress: d,
468
500
  live: p
469
501
  }) {
470
- const x = B(), [d, o] = f(1), [i, g] = f(""), [v, w] = f(""), [y, u] = f(!1), { data: C } = re(r.collection), q = j(() => {
502
+ const h = K(), [c, a] = v(1), [u, f] = v(""), [x, N] = v(""), [k, m] = v(!1), { data: y } = ae(r.collection), q = D(() => {
471
503
  const t = {};
472
- for (const m of C ?? []) m.label && (t[m.field] = m.label);
504
+ for (const i of y ?? []) i.label && (t[i.field] = i.label);
473
505
  return t;
474
- }, [C]), { data: c } = T({
475
- queryKey: ["conformance-run", r.id, d, i, v, y],
476
- queryFn: () => x.request(
477
- M(
478
- `/config-conformance/runs/${r.id}?page=${d}&limit=50${i ? `&rule=${i}` : ""}${v ? `&field=${v}` : ""}${y ? "&group=record" : ""}`
506
+ }, [y]), { data: s } = T({
507
+ queryKey: ["conformance-run", r.id, c, u, x, k],
508
+ queryFn: () => h.request(
509
+ B(
510
+ `/config-conformance/runs/${r.id}?page=${c}&limit=50${u ? `&rule=${u}` : ""}${x ? `&field=${x}` : ""}${k ? "&group=record" : ""}`
479
511
  )
480
512
  ).then((t) => t.data),
481
513
  refetchInterval: r.status === "running" ? p ? 2e4 : 3e3 : !1
482
- }), $ = Math.max(1, Math.ceil(((c == null ? void 0 : c.total) ?? 0) / 50)), R = j(
514
+ }), w = Math.max(1, Math.ceil(((s == null ? void 0 : s.total) ?? 0) / 50)), I = D(
483
515
  () => ({
484
- rules: (c == null ? void 0 : c.by_rule) ?? [],
485
- fields: ((c == null ? void 0 : c.by_field) ?? []).slice(0, 12)
516
+ rules: (s == null ? void 0 : s.by_rule) ?? [],
517
+ fields: ((s == null ? void 0 : s.by_field) ?? []).slice(0, 12)
486
518
  }),
487
- [c]
488
- );
489
- return /* @__PURE__ */ n("div", { className: "flex min-h-0 flex-1 flex-col rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
490
- /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-3 border-b border-slate-100 px-4 py-2.5 dark:border-border", children: [
491
- /* @__PURE__ */ n("span", { className: "text-[13px] font-semibold text-slate-800 dark:text-foreground", children: [
519
+ [s]
520
+ ), b = D(() => {
521
+ const t = [];
522
+ for (const i of (s == null ? void 0 : s.findings) ?? [])
523
+ "findings" in i ? t.push(...i.findings.map((S) => ({ ...S, item_id: i.item_id }))) : t.push(i);
524
+ return t;
525
+ }, [s]), R = D(
526
+ () => b.map((t) => ({
527
+ key: String(t.id),
528
+ collection: r.collection,
529
+ itemId: t.item_id
530
+ })),
531
+ [b, r.collection]
532
+ ), { resolved: g } = ee({
533
+ findings: R,
534
+ enabled: r.status === "completed",
535
+ recheck: (t) => pe(
536
+ h,
537
+ r.collection,
538
+ t,
539
+ new Map(b.map((i) => [String(i.id), { field: i.field, rule: i.rule }]))
540
+ )
541
+ });
542
+ return /* @__PURE__ */ l("div", { className: "flex min-h-0 flex-1 flex-col rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
543
+ /* @__PURE__ */ l("div", { className: "flex flex-wrap items-center gap-3 border-b border-slate-100 px-4 py-2.5 dark:border-border", children: [
544
+ /* @__PURE__ */ l("span", { className: "text-[13px] font-semibold text-slate-800 dark:text-foreground", children: [
492
545
  "Run #",
493
546
  r.id
494
547
  ] }),
495
- r.status === "running" && /* @__PURE__ */ n("span", { className: "flex items-center gap-1.5 text-[11.5px] text-nvr-cyan-dark dark:text-nvr-cyan", children: [
548
+ r.status === "running" && /* @__PURE__ */ l("span", { className: "flex items-center gap-1.5 text-[11.5px] text-nvr-cyan-dark dark:text-nvr-cyan", children: [
496
549
  /* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan" }),
497
550
  "running — ",
498
- Math.max(r.checked_records, (s == null ? void 0 : s.checked) ?? 0).toLocaleString(),
499
- s != null && s.total ? ` of ${s.total.toLocaleString()}` : "",
551
+ Math.max(r.checked_records, (d == null ? void 0 : d.checked) ?? 0).toLocaleString(),
552
+ d != null && d.total ? ` of ${d.total.toLocaleString()}` : "",
500
553
  " checked so far"
501
554
  ] }),
502
- r.status === "completed" && /* @__PURE__ */ n("span", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
555
+ r.status === "completed" && /* @__PURE__ */ l("span", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
503
556
  r.checked_records.toLocaleString(),
504
557
  " record",
505
558
  r.checked_records === 1 ? "" : "s",
@@ -520,32 +573,32 @@ function ue({
520
573
  {
521
574
  type: "button",
522
575
  onClick: () => {
523
- u(t.value), o(1);
576
+ m(t.value), a(1);
524
577
  },
525
- className: N(
578
+ className: _(
526
579
  "rounded px-2 py-0.5 text-[11px] font-medium transition-colors",
527
- y === t.value ? "bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "text-slate-400 hover:text-slate-600 dark:hover:text-muted-foreground"
580
+ k === t.value ? "bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "text-slate-400 hover:text-slate-600 dark:hover:text-muted-foreground"
528
581
  ),
529
582
  children: t.label
530
583
  },
531
584
  t.label
532
585
  )) }),
533
- R.rules.map((t) => {
534
- var m, h;
535
- return /* @__PURE__ */ n(
586
+ I.rules.map((t) => {
587
+ var i, S;
588
+ return /* @__PURE__ */ l(
536
589
  "button",
537
590
  {
538
591
  type: "button",
539
592
  onClick: () => {
540
- g((b) => b === t.rule ? "" : t.rule), o(1);
593
+ f(($) => $ === t.rule ? "" : t.rule), a(1);
541
594
  },
542
- className: N(
595
+ className: _(
543
596
  "rounded-full px-2 py-0.5 text-[11px] font-medium transition-opacity",
544
- ((m = F[t.rule]) == null ? void 0 : m.cls) ?? "bg-slate-500/10 text-slate-600",
545
- i && i !== t.rule && "opacity-40"
597
+ ((i = M[t.rule]) == null ? void 0 : i.cls) ?? "bg-slate-500/10 text-slate-600",
598
+ u && u !== t.rule && "opacity-40"
546
599
  ),
547
600
  children: [
548
- ((h = F[t.rule]) == null ? void 0 : h.label) ?? E(t.rule),
601
+ ((S = M[t.rule]) == null ? void 0 : S.label) ?? j(t.rule),
549
602
  " ",
550
603
  Number(t.c).toLocaleString()
551
604
  ]
@@ -554,26 +607,26 @@ function ue({
554
607
  );
555
608
  })
556
609
  ] }),
557
- R.fields.length > 1 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5 border-b border-slate-100 px-4 py-2 dark:border-border", children: R.fields.map((t) => /* @__PURE__ */ n(
610
+ I.fields.length > 1 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5 border-b border-slate-100 px-4 py-2 dark:border-border", children: I.fields.map((t) => /* @__PURE__ */ l(
558
611
  "button",
559
612
  {
560
613
  type: "button",
561
614
  onClick: () => {
562
- w((m) => m === t.field ? "" : t.field), o(1);
615
+ N((i) => i === t.field ? "" : t.field), a(1);
563
616
  },
564
- className: N(
617
+ className: _(
565
618
  "rounded border px-1.5 py-0.5 text-[11px] transition-colors",
566
- v === t.field ? "border-nvr-cyan/50 bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "border-slate-200 text-slate-500 dark:border-border dark:text-muted-foreground"
619
+ x === t.field ? "border-nvr-cyan/50 bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "border-slate-200 text-slate-500 dark:border-border dark:text-muted-foreground"
567
620
  ),
568
621
  children: [
569
- D(q, t.field),
622
+ Q(q, t.field),
570
623
  " · ",
571
624
  Number(t.c).toLocaleString()
572
625
  ]
573
626
  },
574
627
  t.field
575
628
  )) }),
576
- i && v && [
629
+ u && x && [
577
630
  "cascade",
578
631
  "option-filter",
579
632
  "validation",
@@ -581,126 +634,142 @@ function ue({
581
634
  "row-rule",
582
635
  "required",
583
636
  "row-input"
584
- ].includes(i) && /* @__PURE__ */ e(me, { run: r, rule: i, field: v, total: (c == null ? void 0 : c.total) ?? 0 }),
585
- /* @__PURE__ */ n("div", { className: "min-h-0 flex-1 overflow-y-auto", children: [
586
- c !== void 0 && ((c == null ? void 0 : c.findings) ?? []).length === 0 && r.status === "completed" && /* @__PURE__ */ e("p", { className: "px-4 py-6 text-[12.5px] text-emerald-600 dark:text-emerald-400", children: i || v ? "No findings match the filters." : "Every checked record satisfies its field configuration." }),
587
- y ? /* @__PURE__ */ e("div", { children: ((c == null ? void 0 : c.findings) ?? []).map((t) => /* @__PURE__ */ n(
637
+ ].includes(u) && /* @__PURE__ */ e(xe, { run: r, rule: u, field: x, total: (s == null ? void 0 : s.total) ?? 0 }),
638
+ /* @__PURE__ */ l("div", { className: "min-h-0 flex-1 overflow-y-auto", children: [
639
+ s !== void 0 && ((s == null ? void 0 : s.findings) ?? []).length === 0 && r.status === "completed" && /* @__PURE__ */ e("p", { className: "px-4 py-6 text-[12.5px] text-emerald-600 dark:text-emerald-400", children: u || x ? "No findings match the filters." : "Every checked record satisfies its field configuration." }),
640
+ k ? /* @__PURE__ */ e("div", { children: ((s == null ? void 0 : s.findings) ?? []).map((t) => /* @__PURE__ */ l(
588
641
  "div",
589
642
  {
590
643
  className: "border-b border-slate-100 px-4 py-2 dark:border-border/60",
591
644
  children: [
592
- /* @__PURE__ */ n("div", { className: "flex items-center gap-2.5", children: [
645
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-2.5", children: [
593
646
  /* @__PURE__ */ e(
594
647
  "button",
595
648
  {
596
649
  type: "button",
597
- onClick: () => a(t.item_id),
650
+ onClick: () => n(t.item_id),
598
651
  className: "text-[12.5px] font-medium text-nvr-cyan underline decoration-dotted underline-offset-2",
599
- children: z(t.item_label)
652
+ children: W(t.item_label)
600
653
  }
601
654
  ),
602
- /* @__PURE__ */ n("span", { className: "rounded-full bg-slate-100 px-1.5 py-0.5 text-[10.5px] font-medium text-slate-600 dark:bg-background dark:text-muted-foreground", children: [
655
+ /* @__PURE__ */ l("span", { className: "rounded-full bg-slate-100 px-1.5 py-0.5 text-[10.5px] font-medium text-slate-600 dark:bg-background dark:text-muted-foreground", children: [
603
656
  t.count,
604
657
  " issue",
605
658
  t.count === 1 ? "" : "s"
606
659
  ] })
607
660
  ] }),
608
- /* @__PURE__ */ e("div", { className: "mt-1 space-y-0.5", children: t.findings.map((m) => {
609
- var h, b;
610
- return /* @__PURE__ */ n("div", { className: "flex items-baseline gap-2 text-[12px]", children: [
611
- /* @__PURE__ */ e(
612
- "button",
613
- {
614
- type: "button",
615
- onClick: () => a(t.item_id, m.field),
616
- "data-tip": "Open the record at this field",
617
- className: "w-[150px] shrink-0 text-left text-[11.5px] text-slate-500 underline decoration-dotted underline-offset-2 hover:text-nvr-cyan dark:text-muted-foreground",
618
- children: D(q, m.field)
619
- }
620
- ),
621
- /* @__PURE__ */ e(
622
- "span",
623
- {
624
- className: N(
625
- "shrink-0 rounded-full px-2 py-0.5 text-[10.5px] font-medium",
626
- ((h = F[m.rule]) == null ? void 0 : h.cls) ?? "bg-slate-500/10 text-slate-600"
661
+ /* @__PURE__ */ e("div", { className: "mt-1 space-y-0.5", children: t.findings.map((i) => {
662
+ var S, $;
663
+ return /* @__PURE__ */ l(
664
+ "div",
665
+ {
666
+ "data-finding-resolved": g.has(String(i.id)) ? "" : void 0,
667
+ className: _(
668
+ "flex items-baseline gap-2 text-[12px] transition-opacity",
669
+ g.has(String(i.id)) && "opacity-60"
670
+ ),
671
+ children: [
672
+ /* @__PURE__ */ e(
673
+ "button",
674
+ {
675
+ type: "button",
676
+ onClick: () => n(t.item_id, i.field),
677
+ "data-tip": "Open the record at this field",
678
+ className: "w-[150px] shrink-0 text-left text-[11.5px] text-slate-500 underline decoration-dotted underline-offset-2 hover:text-nvr-cyan dark:text-muted-foreground",
679
+ children: Q(q, i.field)
680
+ }
681
+ ),
682
+ /* @__PURE__ */ e(
683
+ "span",
684
+ {
685
+ className: _(
686
+ "shrink-0 rounded-full px-2 py-0.5 text-[10.5px] font-medium",
687
+ ((S = M[i.rule]) == null ? void 0 : S.cls) ?? "bg-slate-500/10 text-slate-600"
688
+ ),
689
+ children: (($ = M[i.rule]) == null ? void 0 : $.label) ?? j(i.rule)
690
+ }
627
691
  ),
628
- children: ((b = F[m.rule]) == null ? void 0 : b.label) ?? E(m.rule)
629
- }
630
- ),
631
- /* @__PURE__ */ e("span", { className: "min-w-0 text-slate-600 dark:text-muted-foreground", children: m.message })
632
- ] }, m.id);
692
+ /* @__PURE__ */ e("span", { className: "min-w-0 text-slate-600 dark:text-muted-foreground", children: i.message }),
693
+ g.get(String(i.id)) && /* @__PURE__ */ e(z, { mark: g.get(String(i.id)) })
694
+ ]
695
+ },
696
+ i.id
697
+ );
633
698
  }) })
634
699
  ]
635
700
  },
636
701
  t.item_id
637
- )) }) : /* @__PURE__ */ e("table", { className: "w-full border-collapse text-[12px] tabular-nums", children: /* @__PURE__ */ e("tbody", { children: ((c == null ? void 0 : c.findings) ?? []).map((t) => {
638
- var m, h;
639
- return /* @__PURE__ */ n(
702
+ )) }) : /* @__PURE__ */ e("table", { className: "w-full border-collapse text-[12px] tabular-nums", children: /* @__PURE__ */ e("tbody", { children: ((s == null ? void 0 : s.findings) ?? []).map((t) => {
703
+ var i, S;
704
+ return /* @__PURE__ */ l(
640
705
  "tr",
641
706
  {
642
- className: "border-b border-slate-50 transition-colors hover:bg-slate-50 dark:border-border/50 dark:hover:bg-background/40",
707
+ "data-finding-resolved": g.has(String(t.id)) ? "" : void 0,
708
+ className: _(
709
+ "border-b border-slate-50 transition-colors hover:bg-slate-50 dark:border-border/50 dark:hover:bg-background/40",
710
+ g.has(String(t.id)) && "opacity-60"
711
+ ),
643
712
  children: [
644
713
  /* @__PURE__ */ e("td", { className: "w-[190px] px-4 py-1.5", children: /* @__PURE__ */ e(
645
714
  "button",
646
715
  {
647
716
  type: "button",
648
- onClick: () => a(t.item_id),
717
+ onClick: () => n(t.item_id),
649
718
  className: "text-left text-nvr-cyan underline decoration-dotted underline-offset-2",
650
- children: z(t.item_label)
719
+ children: W(t.item_label)
651
720
  }
652
721
  ) }),
653
722
  /* @__PURE__ */ e("td", { className: "w-[160px] px-2 py-1.5", children: /* @__PURE__ */ e(
654
723
  "button",
655
724
  {
656
725
  type: "button",
657
- onClick: () => a(t.item_id, t.field),
726
+ onClick: () => n(t.item_id, t.field),
658
727
  "data-tip": "Open the record at this field",
659
728
  className: "text-[11.5px] text-slate-500 underline decoration-dotted underline-offset-2 hover:text-nvr-cyan dark:text-muted-foreground",
660
- children: D(q, t.field)
729
+ children: Q(q, t.field)
661
730
  }
662
731
  ) }),
663
732
  /* @__PURE__ */ e("td", { className: "w-[150px] px-2 py-1.5", children: /* @__PURE__ */ e(
664
733
  "span",
665
734
  {
666
- className: N(
735
+ className: _(
667
736
  "rounded-full px-2 py-0.5 text-[10.5px] font-medium",
668
- ((m = F[t.rule]) == null ? void 0 : m.cls) ?? "bg-slate-500/10 text-slate-600"
737
+ ((i = M[t.rule]) == null ? void 0 : i.cls) ?? "bg-slate-500/10 text-slate-600"
669
738
  ),
670
- children: ((h = F[t.rule]) == null ? void 0 : h.label) ?? E(t.rule)
739
+ children: ((S = M[t.rule]) == null ? void 0 : S.label) ?? j(t.rule)
671
740
  }
672
741
  ) }),
673
742
  /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-slate-600 dark:text-muted-foreground", children: t.message }),
674
- /* @__PURE__ */ e("td", { className: "w-[120px] px-2 py-1.5 text-right", children: /* @__PURE__ */ e(se, { findingId: t.id }) })
743
+ /* @__PURE__ */ e("td", { className: "w-[120px] px-2 py-1.5 text-right", children: g.get(String(t.id)) ? /* @__PURE__ */ e(z, { mark: g.get(String(t.id)) }) : /* @__PURE__ */ e(de, { findingId: t.id }) })
675
744
  ]
676
745
  },
677
746
  t.id
678
747
  );
679
748
  }) }) })
680
749
  ] }),
681
- $ > 1 && /* @__PURE__ */ n("div", { className: "flex items-center justify-between border-t border-slate-100 px-4 py-2 text-[11.5px] text-slate-500 dark:border-border dark:text-muted-foreground", children: [
750
+ w > 1 && /* @__PURE__ */ l("div", { className: "flex items-center justify-between border-t border-slate-100 px-4 py-2 text-[11.5px] text-slate-500 dark:border-border dark:text-muted-foreground", children: [
682
751
  /* @__PURE__ */ e(
683
752
  "button",
684
753
  {
685
754
  type: "button",
686
- disabled: d <= 1,
687
- onClick: () => o((t) => t - 1),
755
+ disabled: c <= 1,
756
+ onClick: () => a((t) => t - 1),
688
757
  className: "disabled:opacity-40",
689
758
  children: "← Previous"
690
759
  }
691
760
  ),
692
- /* @__PURE__ */ n("span", { children: [
761
+ /* @__PURE__ */ l("span", { children: [
693
762
  "Page ",
694
- d,
763
+ c,
695
764
  " of ",
696
- $
765
+ w
697
766
  ] }),
698
767
  /* @__PURE__ */ e(
699
768
  "button",
700
769
  {
701
770
  type: "button",
702
- disabled: d >= $,
703
- onClick: () => o((t) => t + 1),
771
+ disabled: c >= w,
772
+ onClick: () => a((t) => t + 1),
704
773
  className: "disabled:opacity-40",
705
774
  children: "Next →"
706
775
  }
@@ -708,63 +777,63 @@ function ue({
708
777
  ] })
709
778
  ] });
710
779
  }
711
- function me({
780
+ function xe({
712
781
  run: r,
713
- rule: a,
714
- field: s,
782
+ rule: n,
783
+ field: d,
715
784
  total: p
716
785
  }) {
717
- const x = B(), d = I(), o = O(), [i, g] = f(null), [v, w] = f(!1), [y, u] = f(null), [C, q] = f(!1);
718
- if (p === 0 && !y) return null;
719
- const c = () => {
720
- q(!0), x.request(
721
- A(`/config-conformance/runs/${r.id}/plan`, { field: s, rule: a })
722
- ).then((t) => o.navigate(`/ai-plans?plan=${encodeURIComponent(t.data.plan_id)}`)).catch((t) => u(t.message)).finally(() => q(!1));
723
- }, $ = a === "row-rule" ? "rederive" : ["cascade", "option-filter", "validation", "display"].includes(a) ? "clear" : null, R = (t) => {
724
- w(!0), x.request(A(`/config-conformance/runs/${r.id}/remediate`, { action: t, field: s, rule: a })).then((m) => {
725
- const h = m.data, b = h.failed ? ` — ${h.failed} failed` : "";
726
- u(
727
- t === "apply-high" ? `Applied confident fixes on ${h.applied ?? 0} record(s); ${h.skipped ?? 0} need a person${b}. Re-run the checks to confirm.` : t === "rederive" ? `Re-derived ${h.lines ?? 0} line(s) across ${h.records ?? 0} record(s)${b}. Re-run the checks to confirm.` : `Cleared on ${h.cleared ?? 0} record(s)${b}. Re-run the checks to confirm.`
728
- ), d.invalidateQueries({ queryKey: ["conformance-run", r.id] });
729
- }).catch((m) => u(m.message)).finally(() => {
730
- w(!1), g(null);
786
+ const h = K(), c = U(), a = Y(), [u, f] = v(null), [x, N] = v(!1), [k, m] = v(null), [y, q] = v(!1);
787
+ if (p === 0 && !k) return null;
788
+ const s = () => {
789
+ q(!0), h.request(
790
+ A(`/config-conformance/runs/${r.id}/plan`, { field: d, rule: n })
791
+ ).then((b) => a.navigate(`/ai-plans?plan=${encodeURIComponent(b.data.plan_id)}`)).catch((b) => m(b.message)).finally(() => q(!1));
792
+ }, w = n === "row-rule" ? "rederive" : ["cascade", "option-filter", "validation", "display"].includes(n) ? "clear" : null, I = (b) => {
793
+ N(!0), h.request(A(`/config-conformance/runs/${r.id}/remediate`, { action: b, field: d, rule: n })).then((R) => {
794
+ const g = R.data, t = g.failed ? ` — ${g.failed} failed` : "";
795
+ m(
796
+ b === "apply-high" ? `Applied confident fixes on ${g.applied ?? 0} record(s); ${g.skipped ?? 0} need a person${t}. Re-run the checks to confirm.` : b === "rederive" ? `Re-derived ${g.lines ?? 0} line(s) across ${g.records ?? 0} record(s)${t}. Re-run the checks to confirm.` : `Cleared on ${g.cleared ?? 0} record(s)${t}. Re-run the checks to confirm.`
797
+ ), c.invalidateQueries({ queryKey: ["conformance-run", r.id] });
798
+ }).catch((R) => m(R.message)).finally(() => {
799
+ N(!1), f(null);
731
800
  });
732
801
  };
733
- return /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2.5 border-b border-slate-100 bg-slate-50/60 px-4 py-2 dark:border-border dark:bg-background/40", children: [
734
- /* @__PURE__ */ n("span", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
802
+ return /* @__PURE__ */ l("div", { className: "flex flex-wrap items-center gap-2.5 border-b border-slate-100 bg-slate-50/60 px-4 py-2 dark:border-border dark:bg-background/40", children: [
803
+ /* @__PURE__ */ l("span", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
735
804
  "Bulk fix on ",
736
- /* @__PURE__ */ e("span", { className: "font-mono", children: s }),
805
+ /* @__PURE__ */ e("span", { className: "font-mono", children: d }),
737
806
  " across the affected records — each write is revisioned and attributed to you."
738
807
  ] }),
739
- y ? /* @__PURE__ */ e("span", { className: "text-[11.5px] font-medium text-emerald-600 dark:text-emerald-400", children: y }) : i ? /* @__PURE__ */ n("span", { className: "flex items-center gap-2", children: [
808
+ k ? /* @__PURE__ */ e("span", { className: "text-[11.5px] font-medium text-emerald-600 dark:text-emerald-400", children: k }) : u ? /* @__PURE__ */ l("span", { className: "flex items-center gap-2", children: [
740
809
  /* @__PURE__ */ e(
741
810
  "button",
742
811
  {
743
812
  type: "button",
744
- disabled: v,
745
- onClick: () => R(i),
746
- className: N(
813
+ disabled: x,
814
+ onClick: () => I(u),
815
+ className: _(
747
816
  "h-6 rounded-md px-2.5 text-[11.5px] font-medium text-white disabled:opacity-50",
748
- i === "clear" ? "bg-red-600" : i === "rederive" ? "bg-orange-600" : "bg-emerald-600"
817
+ u === "clear" ? "bg-red-600" : u === "rederive" ? "bg-orange-600" : "bg-emerald-600"
749
818
  ),
750
- children: v ? "Working…" : i === "apply-high" ? `Yes, apply confident fixes on ${p.toLocaleString()} record(s)` : i === "rederive" ? `Yes, re-run rules on ${p.toLocaleString()} record(s)` : `Yes, clear ${p.toLocaleString()} value(s)`
819
+ children: x ? "Working…" : u === "apply-high" ? `Yes, apply confident fixes on ${p.toLocaleString()} record(s)` : u === "rederive" ? `Yes, re-run rules on ${p.toLocaleString()} record(s)` : `Yes, clear ${p.toLocaleString()} value(s)`
751
820
  }
752
821
  ),
753
822
  /* @__PURE__ */ e(
754
823
  "button",
755
824
  {
756
825
  type: "button",
757
- onClick: () => g(null),
826
+ onClick: () => f(null),
758
827
  className: "text-[11.5px] text-slate-400 hover:text-slate-600",
759
828
  children: "Cancel"
760
829
  }
761
830
  )
762
- ] }) : /* @__PURE__ */ n("span", { className: "flex items-center gap-1.5", children: [
831
+ ] }) : /* @__PURE__ */ l("span", { className: "flex items-center gap-1.5", children: [
763
832
  /* @__PURE__ */ e(
764
833
  "button",
765
834
  {
766
835
  type: "button",
767
- onClick: () => g("apply-high"),
836
+ onClick: () => f("apply-high"),
768
837
  title: "For each record, apply the top proposal only when its confidence is high (an only option, a rule-derived value); everything else is left for a person.",
769
838
  className: "h-6 rounded-md border border-emerald-300 px-2.5 text-[11.5px] font-medium text-emerald-700 hover:bg-emerald-50 dark:border-emerald-500/40 dark:text-emerald-400 dark:hover:bg-emerald-500/10",
770
839
  children: "Apply confident fixes…"
@@ -774,30 +843,31 @@ function me({
774
843
  "button",
775
844
  {
776
845
  type: "button",
777
- disabled: C,
778
- onClick: c,
846
+ disabled: y,
847
+ onClick: s,
779
848
  "data-tip": "Build the same confident fixes as a plan: review every record’s old → new value, then approve, schedule or discard it.",
780
849
  className: "h-6 rounded-md border border-slate-200 px-2.5 text-[11.5px] font-medium text-slate-600 hover:border-nvr-cyan hover:text-nvr-cyan disabled:opacity-50 dark:border-border dark:text-muted-foreground",
781
- children: C ? "Building plan…" : "Fix as a plan…"
850
+ children: y ? "Building plan…" : "Fix as a plan…"
782
851
  }
783
852
  ),
784
- $ && /* @__PURE__ */ e(
853
+ w && /* @__PURE__ */ e(
785
854
  "button",
786
855
  {
787
856
  type: "button",
788
- onClick: () => g($),
789
- className: N(
857
+ onClick: () => f(w),
858
+ className: _(
790
859
  "h-6 rounded-md border border-slate-200 px-2.5 text-[11.5px] font-medium text-slate-600 dark:border-border dark:text-muted-foreground",
791
- $ === "rederive" ? "hover:border-orange-300 hover:text-orange-600" : "hover:border-red-300 hover:text-red-600"
860
+ w === "rederive" ? "hover:border-orange-300 hover:text-orange-600" : "hover:border-red-300 hover:text-red-600"
792
861
  ),
793
- children: $ === "rederive" ? "Re-run rules…" : "Clear values…"
862
+ children: w === "rederive" ? "Re-run rules…" : "Clear values…"
794
863
  }
795
864
  )
796
865
  ] })
797
866
  ] });
798
867
  }
799
868
  export {
800
- $e as ConformanceView,
801
- D as findingFieldLabel,
802
- z as findingRecordName
869
+ Le as ConformanceView,
870
+ Q as findingFieldLabel,
871
+ W as findingRecordName,
872
+ pe as fixedConformanceFindings
803
873
  };