@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,34 +1,37 @@
1
- import { jsxs as m, jsx as s, Fragment as ft } from "react/jsx-runtime";
1
+ import { jsxs as f, jsx as s, Fragment as mt } from "react/jsx-runtime";
2
2
  import { useQuery as I } from "@tanstack/react-query";
3
- import { ChevronDown as mt, Loader2 as ye, AlertTriangle as At, Search as Ft, X as Ot, Check as pt } from "lucide-react";
3
+ import { ChevronDown as ft, Loader2 as ye, AlertTriangle as Ot, Search as Mt, X as Tt, Check as pt } from "lucide-react";
4
4
  import { useState as F, useRef as D, useEffect as w, useId as gt, useLayoutEffect as ht, useMemo as A } from "react";
5
- import { createPortal as xt } from "react-dom";
6
- import { useNivaroClient as Te, useItemEditAuth as Tt, useStaleFieldReporter as jt } from "../../context.js";
7
- import { get as G, post as Mt } from "../../lib/commands.js";
8
- import { compareByMatch as Pt } from "../../lib/picker-rank.js";
9
- import { useRecordReader as vt } from "../../lib/record-loader.js";
10
- import { useOnlineUsers as Ut } from "../../lib/use-online-users.js";
11
- import { SearchHighlight as Ht } from "../SearchHighlight.js";
12
- import { UserAvatar as Jt } from "../UserAvatar.js";
13
- import { queryKeys as zt } from "../../lib/query-keys.js";
14
- import { userOptionFilter as Yt, matchesAllTokens as Wt, cn as U } from "../../lib/utils.js";
5
+ import { createPortal as vt } from "react-dom";
6
+ import { useNivaroClient as Me, useItemEditAuth as jt, useStaleFieldReporter as Pt } from "../../context.js";
7
+ import { get as V, post as Ut } from "../../lib/commands.js";
8
+ import { compareByMatch as Ht } from "../../lib/picker-rank.js";
9
+ import { useRecordReader as wt } from "../../lib/record-loader.js";
10
+ import { useOnlineUsers as Jt } from "../../lib/use-online-users.js";
11
+ import { SearchHighlight as zt } from "../SearchHighlight.js";
12
+ import { UserAvatar as Yt } from "../UserAvatar.js";
13
+ import { pickerOptionsMeta as bt } from "../../lib/live-pickers.js";
14
+ import { useOptionBadges as Wt } from "../../lib/picker-badges.js";
15
+ import { queryKeys as Gt } from "../../lib/query-keys.js";
16
+ import { userOptionFilter as Vt, matchesAllTokens as Xt, cn as H } from "../../lib/utils.js";
15
17
  import { applyDisplayTemplate as k } from "./helpers.js";
16
- import { collidingIds as Gt, disambiguators as Vt, isNamelessLabel as ee, NAMELESS_LABEL as le } from "./option-disambiguate.js";
17
- import { usePickerMissReport as Xt } from "./picker-miss.js";
18
- import { useLatestSearch as Zt, onlyCloseMatches as bt, labelOnlyMatches as Qt, narrowLocally as Bt, PICKER_PAGE as en } from "./picker-search.js";
19
- import { retryRelatedRead as wt, useRelatedMissing as kt, RelatedMissingLabel as Nt } from "./related-missing.js";
20
- function tn(o) {
18
+ import { collidingIds as Zt, disambiguators as Qt, isNamelessLabel as ne, NAMELESS_LABEL as le } from "./option-disambiguate.js";
19
+ import { RecordPickerBadges as Bt, PickerBadgeList as en } from "./PickerBadges.js";
20
+ import { usePickerMissReport as tn } from "./picker-miss.js";
21
+ import { useLatestSearch as nn, onlyCloseMatches as yt, labelOnlyMatches as rn, narrowLocally as on, PICKER_PAGE as sn } from "./picker-search.js";
22
+ import { retryRelatedRead as kt, useRelatedMissing as Nt, RelatedMissingLabel as St } from "./related-missing.js";
23
+ function an(o) {
21
24
  return o.replace(/\(.*$/, "").trim().split(/\s+/).map((r) => r[0]).filter(Boolean).slice(0, 2).join("").toUpperCase() || "?";
22
25
  }
23
- function nn(o) {
26
+ function ln(o) {
24
27
  const [r, h] = F(null), g = {
25
- onMouseEnter: (q) => {
28
+ onMouseEnter: (R) => {
26
29
  if (!o) return;
27
- const x = q.currentTarget.getBoundingClientRect(), N = window.innerHeight - x.bottom < 80;
30
+ const x = R.currentTarget.getBoundingClientRect(), N = window.innerHeight - x.bottom < 80;
28
31
  h({ x: x.left, y: N ? x.top - 58 : x.bottom + 4 });
29
32
  },
30
33
  onMouseLeave: () => h(null)
31
- }, O = o && r ? xt(
34
+ }, O = o && r ? vt(
32
35
  /* @__PURE__ */ s(
33
36
  "div",
34
37
  {
@@ -41,36 +44,36 @@ function nn(o) {
41
44
  ) : null;
42
45
  return { bind: g, tip: O };
43
46
  }
44
- function yt(o, r) {
47
+ function xt(o, r) {
45
48
  return o == null || o === "" || r == null || r === "" ? !1 : String(o) === String(r);
46
49
  }
47
- function rn({
50
+ function cn({
48
51
  collection: o,
49
52
  value: r,
50
53
  onChange: h,
51
54
  disabled: g,
52
55
  placeholder: O,
53
- extraFilter: q,
56
+ extraFilter: R,
54
57
  autoSelectSingle: x,
55
58
  optionSort: N,
56
- requiredParent: C,
59
+ requiredParent: q,
57
60
  facets: l,
58
- fieldKey: T,
61
+ fieldKey: M,
59
62
  narrowedBy: d,
60
- pinned: f,
63
+ pinned: m,
61
64
  missPlacement: y,
62
65
  defaultOpen: xe,
63
- onClose: je,
64
- displayTemplate: St
66
+ onClose: Te,
67
+ displayTemplate: Lt
65
68
  }) {
66
- const V = Te(), Me = vt(), [i, $] = F(xe ?? !1), [c, ce] = F(""), de = D(je);
67
- de.current = je;
69
+ const X = Me(), je = wt(), [i, $] = F(xe ?? !1), [c, ce] = F(""), de = D(Te);
70
+ de.current = Te;
68
71
  const Pe = D(i);
69
72
  w(() => {
70
73
  var e;
71
74
  Pe.current && !i && ((e = de.current) == null || e.call(de)), Pe.current = i;
72
75
  }, [i]);
73
- const [Lt, _t] = F(!1), j = Zt(c, Lt), Ue = D(null), X = D(null), ve = D(null), H = D(null), we = gt(), He = gt(), [Je, J] = F(-1), M = D(null), te = () => {
76
+ const [_t, Et] = F(!1), T = nn(c, _t), Ue = D(null), Z = D(null), ve = D(null), J = D(null), we = gt(), He = gt(), [Je, z] = F(-1), j = D(null), re = () => {
74
77
  var t;
75
78
  const e = Ue.current;
76
79
  if (!e || document.activeElement === e) return;
@@ -79,25 +82,25 @@ function rn({
79
82
  (t = e.setSelectionRange) == null || t.call(e, n, n);
80
83
  };
81
84
  w(() => {
82
- i ? setTimeout(te, 30) : (ce(""), M.current = null);
85
+ i ? setTimeout(re, 30) : (ce(""), j.current = null);
83
86
  }, [i]);
84
87
  const ke = D(!1), Ne = () => {
85
88
  var e;
86
- $(!1), (e = H.current) == null || e.focus(), ke.current = !0;
89
+ $(!1), (e = J.current) == null || e.focus(), ke.current = !0;
87
90
  };
88
91
  w(() => {
89
92
  var n;
90
93
  if (!ke.current) return;
91
94
  ke.current = !1;
92
95
  const e = document.activeElement;
93
- (!e || e === document.body) && ((n = H.current) == null || n.focus());
96
+ (!e || e === document.body) && ((n = J.current) == null || n.focus());
94
97
  }), w(() => {
95
98
  if (!i) return;
96
99
  const e = (n) => {
97
- var E, R, ae;
100
+ var E, C, ae;
98
101
  if (n.key !== "Escape") return;
99
102
  const t = document.activeElement;
100
- (t === document.body || t && ((E = ve.current) != null && E.contains(t) || (R = X.current) != null && R.contains(t))) && (n.preventDefault(), n.stopPropagation(), $(!1), (ae = H.current) == null || ae.focus());
103
+ (t === document.body || t && ((E = ve.current) != null && E.contains(t) || (C = Z.current) != null && C.contains(t))) && (n.preventDefault(), n.stopPropagation(), $(!1), (ae = J.current) == null || ae.focus());
101
104
  };
102
105
  return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
103
106
  }, [i]), w(() => {
@@ -105,7 +108,7 @@ function rn({
105
108
  const e = (n) => {
106
109
  var a, E;
107
110
  const t = n.target;
108
- !t || t === document.body || (a = t.closest) != null && a.call(t, "[data-nvr-combobox-panel]") || (E = X.current) != null && E.contains(t) || $(!1);
111
+ !t || t === document.body || (a = t.closest) != null && a.call(t, "[data-nvr-combobox-panel]") || (E = Z.current) != null && E.contains(t) || $(!1);
109
112
  };
110
113
  return document.addEventListener("focusin", e), () => document.removeEventListener("focusin", e);
111
114
  }, [i]), w(() => {
@@ -113,31 +116,31 @@ function rn({
113
116
  const e = (n) => {
114
117
  var a;
115
118
  const t = n.target;
116
- (a = t == null ? void 0 : t.closest) != null && a.call(t, "[data-nvr-combobox-panel]") || X.current && !X.current.contains(n.target) && $(!1);
119
+ (a = t == null ? void 0 : t.closest) != null && a.call(t, "[data-nvr-combobox-panel]") || Z.current && !Z.current.contains(n.target) && $(!1);
117
120
  };
118
121
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
119
122
  }, [i]);
120
- const [Se, Le] = F(null), [_e, Et] = F(null);
123
+ const [Se, Le] = F(null), [_e, Rt] = F(null);
121
124
  ht(() => {
122
125
  if (!i) {
123
126
  Le(null);
124
127
  return;
125
128
  }
126
129
  const e = () => {
127
- const n = X.current;
130
+ const n = Z.current;
128
131
  if (!n) return;
129
132
  const t = n.getBoundingClientRect(), a = n.closest('[role="dialog"]') ?? document.body;
130
- Et(a);
131
- const E = window.innerHeight - t.bottom < 340 && t.top > window.innerHeight - t.bottom, R = t.left, ae = E ? t.top - 4 : t.bottom + 4, dt = {
133
+ Rt(a);
134
+ const E = window.innerHeight - t.bottom < 340 && t.top > window.innerHeight - t.bottom, C = t.left, ae = E ? t.top - 4 : t.bottom + 4, dt = {
132
135
  minWidth: t.width,
133
136
  zIndex: 120,
134
137
  ...E ? { transform: "translateY(-100%)" } : {}
135
138
  };
136
139
  if (a === document.body)
137
- Le({ position: "fixed", left: R, top: ae, ...dt });
140
+ Le({ position: "fixed", left: C, top: ae, ...dt });
138
141
  else {
139
142
  const ut = a.getBoundingClientRect();
140
- Le({ position: "absolute", left: R - ut.left, top: ae - ut.top, ...dt });
143
+ Le({ position: "absolute", left: C - ut.left, top: ae - ut.top, ...dt });
141
144
  }
142
145
  };
143
146
  return e(), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
@@ -146,17 +149,17 @@ function rn({
146
149
  }, [i]);
147
150
  const ze = i && !!Se && !!_e;
148
151
  ht(() => {
149
- ze && document.activeElement === H.current && te();
152
+ ze && document.activeElement === J.current && re();
150
153
  }, [ze]);
151
154
  const { data: Ee, isPending: Ye } = I({
152
155
  queryKey: ["col-meta", o],
153
- queryFn: () => V.request(G(`/collections/${o}`)).then((e) => e.data),
156
+ queryFn: () => X.request(V(`/collections/${o}`)).then((e) => e.data),
154
157
  staleTime: 3e5,
155
158
  retry: !1
156
- }), [qe, qt] = F({}), { data: We = [] } = I({
157
- queryKey: zt.collectionRelations(o),
158
- queryFn: () => V.request(
159
- G(`/collections/${o}`)
159
+ }), [Re, qt] = F({}), { data: We = [] } = I({
160
+ queryKey: Gt.collectionRelations(o),
161
+ queryFn: () => X.request(
162
+ V(`/collections/${o}`)
160
163
  ).then(
161
164
  (e) => {
162
165
  var n;
@@ -174,46 +177,48 @@ function rn({
174
177
  t != null && t.one_collection && (e[n.field] = t.one_collection);
175
178
  }
176
179
  return e;
177
- }, [l, We, o]), Z = o === "nivaro_users", Rt = Ut(Z), Ge = Tt().isAdmin, Ce = A(() => {
180
+ }, [l, We, o]), P = o === "nivaro_users", $t = Jt(P), Ge = jt().isAdmin, qe = A(() => {
178
181
  const e = [];
179
- Z && e.push(Yt(Ge)), q && e.push(q);
180
- for (const [n, t] of Object.entries(qe))
182
+ P && e.push(Vt(Ge)), R && e.push(R);
183
+ for (const [n, t] of Object.entries(Re))
181
184
  t != null && t !== "" && e.push({ [n]: { _eq: t } });
182
185
  if (e.length !== 0)
183
186
  return e.length === 1 ? e[0] : { _and: e };
184
- }, [q, qe, Ge]), Q = St || (Ee == null ? void 0 : Ee.display_template) || (Z ? "{{first_name}} {{last_name}} ({{email}})" : null), v = A(() => {
187
+ }, [R, Re, Ge]), Q = Lt || (Ee == null ? void 0 : Ee.display_template) || (P ? "{{first_name}} {{last_name}} ({{email}})" : null), v = A(() => {
185
188
  if (!Q) return;
186
189
  const e = [...Q.matchAll(/\{\{([\w.]+)\}\}/g)].map((n) => n[1]);
187
190
  if (e.length)
188
191
  return [.../* @__PURE__ */ new Set(["id", ...e])].join(",");
189
- }, [Q]), S = Ce ? JSON.stringify(Ce) : void 0, z = N && !/^-?label$/.test(N) ? N : void 0, Ve = (e) => V.request(
190
- G(`/items/${o}`, {
191
- limit: en,
192
+ }, [Q]), S = qe ? JSON.stringify(qe) : void 0, Y = N && !/^-?label$/.test(N) ? N : void 0, Ve = (e) => X.request(
193
+ V(`/items/${o}`, {
194
+ limit: sn,
192
195
  picker: "1",
193
196
  // Typo pass (fix11-search): only when the exact search finds nothing,
194
197
  // the server answers close matches, each marked `fuzzy`.
195
198
  ...e.trim() ? { search: e.trim(), typo: "1" } : {},
196
199
  ...S ? { filter: S } : {},
197
200
  ...v ? { fields: v } : {},
198
- ...z ? { sort: z } : {}
201
+ ...Y ? { sort: Y } : {}
199
202
  })
200
203
  ).then((n) => n.data ?? []), {
201
204
  data: u,
202
- isFetching: Y,
203
- isPlaceholderData: Re
205
+ isFetching: W,
206
+ isPlaceholderData: Ce
204
207
  } = I({
205
208
  queryKey: [
206
209
  "relation-opts",
207
210
  o,
208
- j,
211
+ T,
209
212
  S,
210
213
  v,
211
- z ?? ""
214
+ Y ?? ""
212
215
  ],
213
- queryFn: () => Ve(j),
216
+ queryFn: () => Ve(T),
214
217
  // Wait for the display template: it decides `fields`, and starting before
215
218
  // it lands sent the whole first page twice.
216
219
  enabled: i && !Ye,
220
+ // Someone else's new / changed / removed record: re-read on the next open (live-pickers.ts).
221
+ meta: bt(o),
217
222
  staleTime: S ? 0 : 3e4,
218
223
  // A new SEARCH keeps the previous answer on screen (narrowed locally below)
219
224
  // instead of blanking the list behind a spinner. A changed filter, sort or
@@ -221,57 +226,58 @@ function rn({
221
226
  placeholderData: (e, n) => {
222
227
  const t = n == null ? void 0 : n.queryKey;
223
228
  if (!(!e || !t))
224
- return t[1] === o && t[3] === S && t[4] === v && t[5] === (z ?? "") ? e : void 0;
229
+ return t[1] === o && t[3] === S && t[4] === v && t[5] === (Y ?? "") ? e : void 0;
225
230
  }
226
231
  });
227
- w(() => _t(Y), [Y]);
228
- const ue = !!j.trim() && c === j && !Re && !Y && u !== void 0 && (u.length === 0 || bt(u)), { data: fe } = I({
229
- queryKey: ["relation-opts", o, "", S, v, z ?? ""],
232
+ w(() => Et(W), [W]);
233
+ const ue = !!T.trim() && c === T && !Ce && !W && u !== void 0 && (u.length === 0 || yt(u)), { data: me } = I({
234
+ queryKey: ["relation-opts", o, "", S, v, Y ?? ""],
230
235
  queryFn: () => Ve(""),
231
236
  enabled: i && !Ye && ue,
237
+ meta: bt(o),
232
238
  staleTime: S ? 0 : 3e4
233
239
  }), K = A(
234
- () => ue && fe ? Qt(
235
- fe,
240
+ () => ue && me ? rn(
241
+ me,
236
242
  (e) => k(Q, e) || "",
237
243
  c
238
244
  ) : null,
239
- [ue, fe, Q, c]
240
- ), Xe = ue && fe === void 0, ne = !!u && bt(u) && !(K && K.length > 0);
241
- Xt({
245
+ [ue, me, Q, c]
246
+ ), Xe = ue && me === void 0, oe = !!u && yt(u) && !(K && K.length > 0);
247
+ tn({
242
248
  placement: y,
243
249
  open: i,
244
- search: j,
245
- settled: !Y && !Re && u !== void 0 && !Xe,
250
+ search: T,
251
+ settled: !W && !Ce && u !== void 0 && !Xe,
246
252
  count: (K == null ? void 0 : K.length) ?? (u == null ? void 0 : u.length) ?? 0
247
253
  });
248
254
  const {
249
- data: re,
255
+ data: B,
250
256
  isLoading: Ze,
251
257
  error: Qe,
252
- isFetched: $t
258
+ isFetched: Dt
253
259
  } = I({
254
260
  queryKey: ["relation-single", o, String(r), v],
255
- queryFn: () => Me(o, r, v),
261
+ queryFn: () => je(o, r, v),
256
262
  enabled: !!r,
257
263
  staleTime: 6e4,
258
- retry: wt
259
- }), Be = !!r && !Ze && $t && !re, { settling: et } = kt(
264
+ retry: kt
265
+ }), Be = !!r && !Ze && Dt && !B, { settling: et } = Nt(
260
266
  Qe,
261
267
  Be ? o : null,
262
268
  r
263
- ), L = (f == null ? void 0 : f.id) != null && f.id !== "" ? String(f.id) : null, { data: P } = I({
269
+ ), L = (m == null ? void 0 : m.id) != null && m.id !== "" ? String(m.id) : null, { data: U } = I({
264
270
  queryKey: ["relation-single", o, L ?? "", v],
265
- queryFn: () => Me(o, L, v).catch(
271
+ queryFn: () => je(o, L, v).catch(
266
272
  () => null
267
273
  ),
268
274
  enabled: !!L && i,
269
275
  staleTime: 6e4
270
- }), Dt = JSON.stringify(q ? { _and: [{ id: { _eq: r } }, q] } : { id: { _eq: r } }), { data: me } = I({
276
+ }), It = JSON.stringify(R ? { _and: [{ id: { _eq: r } }, R] } : { id: { _eq: r } }), { data: fe } = I({
271
277
  queryKey: ["relation-avail", o, String(r), S],
272
- queryFn: () => V.request(
273
- G(`/items/${o}`, {
274
- filter: Dt,
278
+ queryFn: () => X.request(
279
+ V(`/items/${o}`, {
280
+ filter: It,
275
281
  picker: "1",
276
282
  limit: 1,
277
283
  fields: "id"
@@ -280,9 +286,9 @@ function rn({
280
286
  // The pinned option is offered OUTSIDE the option filter (a type's generic
281
287
  // item is excluded from the general list on purpose), so a value that IS
282
288
  // the pin is available by construction — never probe it, never flag it.
283
- enabled: !!r && !!re && String(r) !== L,
289
+ enabled: !!r && !!B && String(r) !== L,
284
290
  staleTime: 3e4
285
- }), oe = !!r && String(r) !== L && me !== void 0 && me.length === 0, pe = D(null), $e = D(!1), tt = `${o}|${S ?? ""}`, It = () => {
291
+ }), se = !!r && String(r) !== L && fe !== void 0 && fe.length === 0, pe = D(null), $e = D(!1), tt = `${o}|${S ?? ""}`, Kt = () => {
286
292
  $e.current = !0, pe.current = tt, h(null);
287
293
  }, ge = r == null || r === "";
288
294
  w(() => {
@@ -290,8 +296,8 @@ function rn({
290
296
  }, [ge]), w(() => {
291
297
  if (!x || g || !ge || $e.current) return;
292
298
  const e = tt;
293
- pe.current !== e && (pe.current = e, V.request(
294
- G(`/items/${o}`, {
299
+ pe.current !== e && (pe.current = e, X.request(
300
+ V(`/items/${o}`, {
295
301
  limit: 2,
296
302
  picker: "1",
297
303
  fields: "id",
@@ -305,77 +311,81 @@ function rn({
305
311
  pe.current = null;
306
312
  }));
307
313
  }, [x, g, ge, o, S]);
308
- const b = Q, De = r && re ? k(b, re) : null, Ie = De === null ? null : ee(De) ? le : De, W = !Re && c === j && !Xe, Ke = A(
309
- () => (K && (K.length > 0 || !(u != null && u.length)) ? K : null) ?? Bt(
314
+ const b = Q, De = r && B ? k(b, B) : null, Ie = De === null ? null : ne(De) ? le : De, G = !Ce && c === T && !Xe, Ke = A(
315
+ () => (K && (K.length > 0 || !(u != null && u.length)) ? K : null) ?? on(
310
316
  u ?? [],
311
317
  (e) => k(b, e) || `#${e.id}`,
312
318
  // The server also reads a joined code by its parts ("2026-NNO-POWER"
313
319
  // finds 2026-WEST-NNO-HE-POWERING, services/search-synonyms.ts), so
314
320
  // the list narrowed while that search is out does too.
315
321
  c.replace(/[-_/]+/g, " "),
316
- W
322
+ G
317
323
  ),
318
- [u, b, c, W, K]
324
+ [u, b, c, G, K]
319
325
  ), he = A(
320
- () => Gt(u ?? [], (e) => k(b, e) || `#${e.id}`),
326
+ () => Zt(u ?? [], (e) => k(b, e) || `#${e.id}`),
321
327
  [u, b]
322
- ), { data: se } = I({
328
+ ), { data: ie } = I({
323
329
  queryKey: ["relation-opts-dups", o, he.join(",")],
324
- queryFn: () => V.request(
325
- G(`/items/${o}`, {
330
+ queryFn: () => X.request(
331
+ V(`/items/${o}`, {
326
332
  limit: he.length,
327
333
  picker: "1",
328
334
  filter: JSON.stringify({ id: { _in: he } }),
329
335
  fields: "*"
330
336
  })
331
337
  ).then((e) => e.data ?? []),
332
- enabled: i && he.length > 0 && !Z,
338
+ enabled: i && he.length > 0 && !P,
333
339
  staleTime: 6e4
334
340
  }), nt = A(() => {
335
- if (!(se != null && se.length)) return /* @__PURE__ */ new Map();
341
+ if (!(ie != null && ie.length)) return /* @__PURE__ */ new Map();
336
342
  const e = new Map(
337
343
  (u ?? []).map((t) => [
338
344
  String(t.id),
339
345
  (k(b, t) || `#${t.id}`).trim().toLowerCase()
340
346
  ])
341
347
  ), n = /* @__PURE__ */ new Map();
342
- for (const t of se) {
348
+ for (const t of ie) {
343
349
  const a = e.get(String(t.id));
344
350
  a !== void 0 && n.set(a, [...n.get(a) ?? [], t]);
345
351
  }
346
- return Vt(
352
+ return Qt(
347
353
  [...n.values()],
348
354
  ((v == null ? void 0 : v.split(",")) ?? []).map((t) => t.split(".")[0])
349
355
  );
350
- }, [se, u, b, v]), Kt = !!r && Ze && !re || et, rt = nn(oe), ot = A(
351
- () => (u ?? []).some((e) => !ee(k(b, e))),
356
+ }, [ie, u, b, v]), At = !!r && Ze && !B || et, rt = ln(se), ot = A(
357
+ () => (u ?? []).some((e) => !ne(k(b, e))),
352
358
  [u, b]
353
- ), ie = A(
354
- () => (z ? [...Ke] : [...Ke].sort(
355
- (e, n) => Pt(
359
+ ), ee = A(
360
+ () => (Y ? [...Ke] : [...Ke].sort(
361
+ (e, n) => Ht(
356
362
  k(b, e),
357
363
  k(b, n),
358
364
  c,
359
365
  N === "-label"
360
366
  )
361
367
  )).filter((e) => !L || String(e.id) !== L).filter(
362
- (e) => !ot || String(e.id) === String(r) || !ee(k(b, e))
368
+ (e) => !ot || String(e.id) === String(r) || !ne(k(b, e))
363
369
  ),
364
- [Ke, z, b, c, N, L, r, ot]
365
- ), st = P && !ee(k(b, P)) ? k(b, P) : le, Ae = !!L && (!c.trim() || Wt(
366
- `${P ? st : ""} ${(f == null ? void 0 : f.tag) ?? "Default"}`,
370
+ [Ke, Y, b, c, N, L, r, ot]
371
+ ), Ft = Wt(
372
+ o,
373
+ ee.map((e) => e.id),
374
+ i && !P
375
+ ), st = U && !ne(k(b, U)) ? k(b, U) : le, Ae = !!L && (!c.trim() || Xt(
376
+ `${U ? st : ""} ${(m == null ? void 0 : m.tag) ?? "Default"}`,
367
377
  c.replace(/[-_/]+/g, " ")
368
- )), B = Ae ? 1 : 0, _ = B + ie.length, p = Je >= _ ? _ - 1 : Je;
378
+ )), te = Ae ? 1 : 0, _ = te + ee.length, p = Je >= _ ? _ - 1 : Je;
369
379
  w(() => {
370
- J(i && c.trim() && !ne ? B : -1);
371
- }, [i, c, B, ne]);
380
+ z(i && c.trim() && !oe ? te : -1);
381
+ }, [i, c, te, oe]);
372
382
  const Fe = (e) => `${we}-opt-${e}`, it = () => {
373
- const e = (P == null ? void 0 : P.id) ?? (f == null ? void 0 : f.id);
374
- yt(r, e) || h(e), Ne();
383
+ const e = (U == null ? void 0 : U.id) ?? (m == null ? void 0 : m.id);
384
+ xt(r, e) || h(e), Ne();
375
385
  }, at = (e) => {
376
- yt(r, e.id) || h(e.id), Ne();
386
+ xt(r, e.id) || h(e.id), Ne();
377
387
  }, be = (e) => {
378
- e < 0 || e >= _ || (e < B ? it() : at(ie[e - B]));
388
+ e < 0 || e >= _ || (e < te ? it() : at(ee[e - te]));
379
389
  };
380
390
  w(() => {
381
391
  var n, t;
@@ -383,18 +393,18 @@ function rn({
383
393
  const e = (n = ve.current) == null ? void 0 : n.querySelector(`[data-nav-index="${p}"]`);
384
394
  (t = e == null ? void 0 : e.scrollIntoView) == null || t.call(e, { block: "nearest" });
385
395
  }, [i, p]), w(() => {
386
- const e = M.current;
396
+ const e = j.current;
387
397
  if (e !== null) {
388
398
  if (!i || e !== c) {
389
- M.current = null;
399
+ j.current = null;
390
400
  return;
391
401
  }
392
- W && (M.current = null, p >= 0 ? be(p) : _ === 1 && u !== void 0 && !ne && be(0));
402
+ G && (j.current = null, p >= 0 ? be(p) : _ === 1 && u !== void 0 && !oe && be(0));
393
403
  }
394
- }, [i, c, W, p, _]);
404
+ }, [i, c, G, p, _]);
395
405
  const lt = (e) => {
396
406
  var n;
397
- e.key === "ArrowDown" ? (e.preventDefault(), _ > 0 && J(p < 0 ? 0 : Math.min(p + 1, _ - 1))) : e.key === "ArrowUp" ? (e.preventDefault(), _ > 0 && J(p <= 0 ? 0 : p - 1)) : e.key === "Home" && _ > 0 && !c ? (e.preventDefault(), J(0)) : e.key === "End" && _ > 0 && !c ? (e.preventDefault(), J(_ - 1)) : e.key === "Enter" ? (e.preventDefault(), c.trim() && !W ? M.current = c : p >= 0 ? be(p) : _ === 1 && W && u !== void 0 && !ne && be(0)) : e.key === "Tab" && ($(!1), (n = H.current) == null || n.focus());
407
+ e.key === "ArrowDown" ? (e.preventDefault(), _ > 0 && z(p < 0 ? 0 : Math.min(p + 1, _ - 1))) : e.key === "ArrowUp" ? (e.preventDefault(), _ > 0 && z(p <= 0 ? 0 : p - 1)) : e.key === "Home" && _ > 0 && !c ? (e.preventDefault(), z(0)) : e.key === "End" && _ > 0 && !c ? (e.preventDefault(), z(_ - 1)) : e.key === "Enter" ? (e.preventDefault(), c.trim() && !G ? j.current = c : p >= 0 ? be(p) : _ === 1 && G && u !== void 0 && !oe && be(0)) : e.key === "Tab" && ($(!1), (n = J.current) == null || n.focus());
398
408
  }, ct = (e) => {
399
409
  if (g) return;
400
410
  const n = e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && (i || e.key !== " ");
@@ -403,30 +413,30 @@ function rn({
403
413
  else if (n) {
404
414
  e.preventDefault();
405
415
  const t = e.key;
406
- M.current = null, ce((a) => t === " " && (a === "" || a.endsWith(" ")) ? a : a + t), i ? te() : $(!0);
407
- } else i && e.key === "Backspace" ? (e.preventDefault(), M.current = null, ce((t) => t.slice(0, -1)), te()) : i && (e.key === "Enter" || e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End") && (lt(e), te());
408
- }, Oe = jt();
416
+ j.current = null, ce((a) => t === " " && (a === "" || a.endsWith(" ")) ? a : a + t), i ? re() : $(!0);
417
+ } else i && e.key === "Backspace" ? (e.preventDefault(), j.current = null, ce((t) => t.slice(0, -1)), re()) : i && (e.key === "Enter" || e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End") && (lt(e), re());
418
+ }, Oe = Pt();
409
419
  return w(() => {
410
- !Oe || !T || me === void 0 || Oe(T, oe);
411
- }, [Oe, T, oe, me]), C ? /* @__PURE__ */ m(
420
+ !Oe || !M || fe === void 0 || Oe(M, se);
421
+ }, [Oe, M, se, fe]), q ? /* @__PURE__ */ f(
412
422
  "button",
413
423
  {
414
424
  type: "button",
415
425
  disabled: !0,
416
426
  className: "flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 text-sm text-left opacity-50 cursor-not-allowed",
417
427
  children: [
418
- /* @__PURE__ */ m("span", { className: "truncate text-muted-foreground", children: [
428
+ /* @__PURE__ */ f("span", { className: "truncate text-muted-foreground", children: [
419
429
  "Select ",
420
- C,
430
+ q,
421
431
  " first"
422
432
  ] }),
423
- /* @__PURE__ */ s(mt, { className: "h-4 w-4 shrink-0 opacity-50" })
433
+ /* @__PURE__ */ s(ft, { className: "h-4 w-4 shrink-0 opacity-50" })
424
434
  ]
425
435
  }
426
436
  ) : (
427
437
  // Stale tooltip binds on the WRAPPER: a disabled trigger button swallows
428
438
  // mouse events, so a locked-but-stale field would never show the hint.
429
- /* @__PURE__ */ m("div", { ref: X, className: "relative", ...rt.bind, children: [
439
+ /* @__PURE__ */ f("div", { ref: Z, className: "relative", ...rt.bind, children: [
430
440
  Be && !et ? (
431
441
  // A value the reader cannot open is words, not a button: the field
432
442
  // says the value is hidden from them (or gone) and, when it may be
@@ -436,20 +446,20 @@ function rn({
436
446
  // 2026-11-12); locked, that button was dead as well.
437
447
  // biome-ignore lint/a11y/noStaticElementInteractions: a pointer shortcut only; "Change" inside is the control a keyboard and a screen reader reach
438
448
  // biome-ignore lint/a11y/useKeyWithClickEvents: as above — the keys are handled on "Change"
439
- /* @__PURE__ */ m(
449
+ /* @__PURE__ */ f(
440
450
  "div",
441
451
  {
442
452
  "data-related-unavailable-field": "",
443
453
  onClick: g ? void 0 : (e) => {
444
454
  e.target.closest("button") || $((n) => !n);
445
455
  },
446
- className: U(
456
+ className: H(
447
457
  "flex h-9 w-full items-center gap-2 rounded-md border border-slate-200 bg-slate-50 px-3 text-sm dark:border-border dark:bg-muted/40",
448
458
  !g && "cursor-pointer"
449
459
  ),
450
460
  children: [
451
461
  /* @__PURE__ */ s("span", { className: "min-w-0 flex-1 truncate", children: /* @__PURE__ */ s(
452
- Nt,
462
+ St,
453
463
  {
454
464
  error: Qe,
455
465
  collection: o,
@@ -460,7 +470,7 @@ function rn({
460
470
  !g && /* @__PURE__ */ s(
461
471
  "button",
462
472
  {
463
- ref: H,
473
+ ref: J,
464
474
  type: "button",
465
475
  "aria-haspopup": "listbox",
466
476
  "aria-expanded": i,
@@ -474,32 +484,32 @@ function rn({
474
484
  ]
475
485
  }
476
486
  )
477
- ) : /* @__PURE__ */ m(
487
+ ) : /* @__PURE__ */ f(
478
488
  "button",
479
489
  {
480
- ref: H,
490
+ ref: J,
481
491
  type: "button",
482
492
  disabled: g,
483
493
  "aria-haspopup": "listbox",
484
494
  "aria-expanded": i,
485
495
  onClick: () => $((e) => !e),
486
496
  onKeyDown: ct,
487
- className: U(
497
+ className: H(
488
498
  "flex h-9 w-full items-center justify-between gap-2 rounded-md border bg-background px-3 text-sm text-left hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 disabled:pointer-events-none disabled:opacity-50",
489
- oe ? "border-amber-300 dark:border-amber-600" : "border-input"
499
+ se ? "border-amber-300 dark:border-amber-600" : "border-input"
490
500
  ),
491
501
  children: [
492
- Kt ? /* @__PURE__ */ s(ye, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" }) : /* @__PURE__ */ m(
502
+ At ? /* @__PURE__ */ s(ye, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" }) : /* @__PURE__ */ f(
493
503
  "span",
494
504
  {
495
- className: U(
505
+ className: H(
496
506
  "flex items-center gap-1.5 truncate min-w-0",
497
507
  (!Ie || Ie === le) && "text-muted-foreground"
498
508
  ),
499
509
  children: [
500
- oe && /* @__PURE__ */ m(ft, { children: [
510
+ se && /* @__PURE__ */ f(mt, { children: [
501
511
  /* @__PURE__ */ s(
502
- At,
512
+ Ot,
503
513
  {
504
514
  "aria-hidden": "true",
505
515
  className: "h-3.5 w-3.5 shrink-0 text-amber-500"
@@ -507,36 +517,37 @@ function rn({
507
517
  ),
508
518
  /* @__PURE__ */ s("span", { className: "sr-only", children: "Not an available option: " })
509
519
  ] }),
510
- /* @__PURE__ */ s("span", { className: "truncate", children: Ie ?? O ?? "Select…" })
520
+ /* @__PURE__ */ s("span", { className: "truncate", children: Ie ?? O ?? "Select…" }),
521
+ !!r && !!B && !P && /* @__PURE__ */ s(Bt, { collection: o, id: r })
511
522
  ]
512
523
  }
513
524
  ),
514
- /* @__PURE__ */ s(mt, { className: "h-4 w-4 shrink-0 opacity-50" })
525
+ /* @__PURE__ */ s(ft, { className: "h-4 w-4 shrink-0 opacity-50" })
515
526
  ]
516
527
  }
517
528
  ),
518
529
  rt.tip,
519
- i && Se && _e && xt(
520
- /* @__PURE__ */ m(
530
+ i && Se && _e && vt(
531
+ /* @__PURE__ */ f(
521
532
  "div",
522
533
  {
523
534
  ref: ve,
524
535
  "data-nvr-combobox-panel": "",
525
536
  style: Se,
526
- className: U(
537
+ className: H(
527
538
  "nvr-pop-in rounded-md border border-border bg-popover shadow-md",
528
539
  l != null && l.length ? "w-[560px] max-w-[92vw]" : "min-w-[240px] w-max max-w-[360px]"
529
540
  ),
530
541
  children: [
531
542
  !!(l != null && l.length) && /* @__PURE__ */ s("div", { className: "grid grid-cols-2 gap-2 border-b border-border bg-slate-50/60 p-2 dark:bg-muted/40", children: l.map((e) => {
532
543
  const n = Ct[e.field];
533
- return n ? /* @__PURE__ */ m("div", { children: [
544
+ return n ? /* @__PURE__ */ f("div", { children: [
534
545
  /* @__PURE__ */ s("p", { className: "mb-0.5 text-[10px] font-medium uppercase tracking-wide text-slate-400", children: e.label ?? e.field }),
535
546
  /* @__PURE__ */ s(
536
- rn,
547
+ cn,
537
548
  {
538
549
  collection: n,
539
- value: qe[e.field] ?? null,
550
+ value: Re[e.field] ?? null,
540
551
  onChange: (t) => qt((a) => ({ ...a, [e.field]: t })),
541
552
  placeholder: "Any",
542
553
  optionSort: e.sort,
@@ -545,15 +556,15 @@ function rn({
545
556
  )
546
557
  ] }, e.field) : null;
547
558
  }) }),
548
- /* @__PURE__ */ m("div", { className: "flex items-center border-b px-3", children: [
549
- /* @__PURE__ */ s(Ft, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
559
+ /* @__PURE__ */ f("div", { className: "flex items-center border-b px-3", children: [
560
+ /* @__PURE__ */ s(Mt, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
550
561
  /* @__PURE__ */ s(
551
562
  "input",
552
563
  {
553
564
  ref: Ue,
554
565
  value: c,
555
566
  onChange: (e) => {
556
- M.current = null, ce(e.target.value);
567
+ j.current = null, ce(e.target.value);
557
568
  },
558
569
  onKeyDown: lt,
559
570
  role: "combobox",
@@ -565,7 +576,7 @@ function rn({
565
576
  className: "flex h-9 w-full bg-transparent py-3 text-[13px] outline-none placeholder:text-muted-foreground"
566
577
  }
567
578
  ),
568
- Y && u !== void 0 && /* @__PURE__ */ s(
579
+ W && u !== void 0 && /* @__PURE__ */ s(
569
580
  ye,
570
581
  {
571
582
  "data-picker-searching": !0,
@@ -573,23 +584,23 @@ function rn({
573
584
  }
574
585
  )
575
586
  ] }),
576
- /* @__PURE__ */ m("div", { id: `${we}-list`, role: "listbox", className: "max-h-52 overflow-y-auto py-1", children: [
577
- !!r && !g && /* @__PURE__ */ m(
587
+ /* @__PURE__ */ f("div", { id: `${we}-list`, role: "listbox", className: "max-h-52 overflow-y-auto py-1", children: [
588
+ !!r && !g && /* @__PURE__ */ f(
578
589
  "button",
579
590
  {
580
591
  type: "button",
581
592
  tabIndex: -1,
582
593
  onClick: () => {
583
- It(), Ne();
594
+ Kt(), Ne();
584
595
  },
585
596
  className: "flex w-full items-center gap-2 px-3 py-1.5 text-[13px] text-slate-500 hover:bg-muted border-b border-slate-100 dark:text-slate-400 dark:border-border",
586
597
  children: [
587
- /* @__PURE__ */ s(Ot, { className: "h-3.5 w-3.5 text-slate-400" }),
598
+ /* @__PURE__ */ s(Tt, { className: "h-3.5 w-3.5 text-slate-400" }),
588
599
  "Clear selection"
589
600
  ]
590
601
  }
591
602
  ),
592
- Ae && /* @__PURE__ */ m(
603
+ Ae && /* @__PURE__ */ f(
593
604
  "button",
594
605
  {
595
606
  type: "button",
@@ -600,8 +611,8 @@ function rn({
600
611
  "data-nav-index": 0,
601
612
  "data-nvr-pinned-option": !0,
602
613
  onClick: it,
603
- onMouseMove: () => p !== 0 && J(0),
604
- className: U(
614
+ onMouseMove: () => p !== 0 && z(0),
615
+ className: H(
605
616
  "flex w-full items-center gap-2 border-b border-slate-100 px-3 py-1.5 text-left text-[13px] hover:bg-nvr-cyan/10 dark:border-border",
606
617
  p === 0 ? "bg-nvr-cyan/10" : "bg-nvr-cyan/5"
607
618
  ),
@@ -609,27 +620,27 @@ function rn({
609
620
  /* @__PURE__ */ s(
610
621
  "div",
611
622
  {
612
- className: U(
623
+ className: H(
613
624
  "flex h-4 w-4 shrink-0 items-center justify-center rounded-full border transition-colors",
614
625
  String(r) === L ? "border-nvr-cyan bg-nvr-cyan" : "border-slate-300"
615
626
  ),
616
627
  children: String(r) === L && /* @__PURE__ */ s(pt, { className: "h-2.5 w-2.5 text-white" })
617
628
  }
618
629
  ),
619
- /* @__PURE__ */ s("span", { className: "min-w-0 flex-1 truncate", children: P === void 0 ? "Loading…" : st }),
620
- /* @__PURE__ */ s("span", { className: "shrink-0 rounded bg-nvr-cyan/15 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-slate-700 dark:text-foreground", children: (f == null ? void 0 : f.tag) ?? "Default" })
630
+ /* @__PURE__ */ s("span", { className: "min-w-0 flex-1 truncate", children: U === void 0 ? "Loading…" : st }),
631
+ /* @__PURE__ */ s("span", { className: "shrink-0 rounded bg-nvr-cyan/15 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-slate-700 dark:text-foreground", children: (m == null ? void 0 : m.tag) ?? "Default" })
621
632
  ]
622
633
  }
623
634
  ),
624
- u === void 0 && Y ? /* @__PURE__ */ s("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ s(ye, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : ie.length === 0 && !W ? /* @__PURE__ */ s("p", { className: "px-3 py-2 text-[13px] text-muted-foreground", children: "Searching…" }) : ie.length === 0 ? Ae && c.trim() ? null : d && d.labels.length > 0 && !c.trim() ? /* @__PURE__ */ m("div", { className: "px-3 py-2 text-[12px] leading-5 text-muted-foreground", children: [
625
- /* @__PURE__ */ m("p", { children: [
635
+ u === void 0 && W ? /* @__PURE__ */ s("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ s(ye, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : ee.length === 0 && !G ? /* @__PURE__ */ s("p", { className: "px-3 py-2 text-[13px] text-muted-foreground", children: "Searching…" }) : ee.length === 0 ? Ae && c.trim() ? null : d && d.labels.length > 0 && !c.trim() ? /* @__PURE__ */ f("div", { className: "px-3 py-2 text-[12px] leading-5 text-muted-foreground", children: [
636
+ /* @__PURE__ */ f("p", { children: [
626
637
  "No options for",
627
638
  " ",
628
639
  /* @__PURE__ */ s("span", { className: "font-medium text-foreground", children: d.labels.join(" · ") }),
629
640
  d.onClear ? " — clear one to widen the list:" : ". Change it, or ask an administrator to add options for it."
630
641
  ] }),
631
642
  d.onClear && /* @__PURE__ */ s("div", { className: "mt-1.5 flex flex-wrap gap-1.5", children: d.keys.map(
632
- (e, n) => d.clearable && !d.clearable.includes(e) ? null : /* @__PURE__ */ m(
643
+ (e, n) => d.clearable && !d.clearable.includes(e) ? null : /* @__PURE__ */ f(
633
644
  "button",
634
645
  {
635
646
  type: "button",
@@ -646,8 +657,8 @@ function rn({
646
657
  e
647
658
  )
648
659
  ) })
649
- ] }) : /* @__PURE__ */ s("p", { className: "px-3 py-2 text-[13px] text-muted-foreground", children: c.trim() ? `No results for “${c.trim()}”` : "No results" }) : /* @__PURE__ */ m(ft, { children: [
650
- ne && /* @__PURE__ */ m(
660
+ ] }) : /* @__PURE__ */ s("p", { className: "px-3 py-2 text-[13px] text-muted-foreground", children: c.trim() ? `No results for “${c.trim()}”` : "No results" }) : /* @__PURE__ */ f(mt, { children: [
661
+ oe && /* @__PURE__ */ f(
651
662
  "p",
652
663
  {
653
664
  "data-picker-close-matches": !0,
@@ -659,50 +670,51 @@ function rn({
659
670
  ]
660
671
  }
661
672
  ),
662
- ie.map((e, n) => {
663
- const t = k(b, e), a = ee(t) ? le : t, E = String(e.id) === String(r), R = n + B;
664
- return /* @__PURE__ */ m(
673
+ ee.map((e, n) => {
674
+ const t = k(b, e), a = ne(t) ? le : t, E = String(e.id) === String(r), C = n + te;
675
+ return /* @__PURE__ */ f(
665
676
  "button",
666
677
  {
667
678
  type: "button",
668
679
  tabIndex: -1,
669
- id: Fe(R),
680
+ id: Fe(C),
670
681
  role: "option",
671
682
  "aria-selected": E,
672
- "data-nav-index": R,
683
+ "data-nav-index": C,
673
684
  onClick: () => at(e),
674
- onMouseMove: () => p !== R && J(R),
675
- className: U(
685
+ onMouseMove: () => p !== C && z(C),
686
+ className: H(
676
687
  "flex w-full items-center gap-2 px-3 py-1.5 text-[13px] text-left hover:bg-muted",
677
- p === R && "bg-muted"
688
+ p === C && "bg-muted"
678
689
  ),
679
690
  children: [
680
691
  /* @__PURE__ */ s(
681
692
  "div",
682
693
  {
683
- className: U(
694
+ className: H(
684
695
  "flex h-4 w-4 shrink-0 items-center justify-center rounded-full border transition-colors",
685
696
  E ? "border-nvr-cyan bg-nvr-cyan" : "border-slate-300"
686
697
  ),
687
698
  children: E && /* @__PURE__ */ s(pt, { className: "h-2.5 w-2.5 text-white" })
688
699
  }
689
700
  ),
690
- Z && /* @__PURE__ */ s(
691
- Jt,
701
+ P && /* @__PURE__ */ s(
702
+ Yt,
692
703
  {
693
704
  userId: e.id,
694
705
  className: "h-4 w-4",
695
- fallback: /* @__PURE__ */ s("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children: tn(a) })
706
+ fallback: /* @__PURE__ */ s("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children: an(a) })
696
707
  }
697
708
  ),
698
- Z && Rt.has(String(e.id).toUpperCase()) && /* @__PURE__ */ s(
709
+ P && $t.has(String(e.id).toUpperCase()) && /* @__PURE__ */ s(
699
710
  "span",
700
711
  {
701
712
  className: "h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500",
702
713
  "data-tip": "Online now"
703
714
  }
704
715
  ),
705
- /* @__PURE__ */ s(Ht, { text: a, query: c }),
716
+ /* @__PURE__ */ s(zt, { text: a, query: c }),
717
+ /* @__PURE__ */ s(en, { badges: Ft[String(e.id)] }),
706
718
  nt.has(String(e.id)) && /* @__PURE__ */ s(
707
719
  "span",
708
720
  {
@@ -718,14 +730,14 @@ function rn({
718
730
  })
719
731
  ] })
720
732
  ] }),
721
- !Y && /* @__PURE__ */ s(
722
- on,
733
+ !W && /* @__PURE__ */ s(
734
+ dn,
723
735
  {
724
736
  collection: o,
725
- search: j,
726
- filter: Ce,
737
+ search: T,
738
+ filter: qe,
727
739
  narrowedLabels: (d == null ? void 0 : d.labels) ?? [],
728
- auto: (u ?? []).length === 0 && !!j
740
+ auto: (u ?? []).length === 0 && !!T
729
741
  }
730
742
  )
731
743
  ]
@@ -736,17 +748,17 @@ function rn({
736
748
  ] })
737
749
  );
738
750
  }
739
- function on({
751
+ function dn({
740
752
  collection: o,
741
753
  search: r,
742
754
  filter: h,
743
755
  narrowedLabels: g,
744
756
  auto: O
745
757
  }) {
746
- const q = Te(), [x, N] = F(!1), C = h ? JSON.stringify(h) : "", { data: l, isFetching: T } = I({
747
- queryKey: ["picker-narrowing", o, r, C],
748
- queryFn: () => q.request(
749
- Mt("/picker-narrowing", { collection: o, search: r, filter: h ?? null })
758
+ const R = Me(), [x, N] = F(!1), q = h ? JSON.stringify(h) : "", { data: l, isFetching: M } = I({
759
+ queryKey: ["picker-narrowing", o, r, q],
760
+ queryFn: () => R.request(
761
+ Ut("/picker-narrowing", { collection: o, search: r, filter: h ?? null })
750
762
  ).then((y) => y.data),
751
763
  enabled: x || O,
752
764
  staleTime: 3e4,
@@ -765,12 +777,12 @@ function on({
765
777
  children: "Missing something?"
766
778
  }
767
779
  );
768
- if (T && !l)
780
+ if (M && !l)
769
781
  return /* @__PURE__ */ s("p", { className: "border-t border-border px-3 py-1.5 text-[11px] text-muted-foreground", children: "Checking what narrows this list…" });
770
782
  if (!l) return null;
771
- const d = [], f = r ? `match “${r}”` : "exist";
783
+ const d = [], m = r ? `match “${r}”` : "exist";
772
784
  return l.by_field_filter > 0 && d.push(
773
- `${l.by_field_filter.toLocaleString()} more ${f} but this field only offers ${g.length ? `records that fit ${g.join(" · ")}` : "records its filter allows"}.`
785
+ `${l.by_field_filter.toLocaleString()} more ${m} but this field only offers ${g.length ? `records that fit ${g.join(" · ")}` : "records its filter allows"}.`
774
786
  ), l.by_exclusions > 0 && d.push(
775
787
  `${l.by_exclusions.toLocaleString()} ${l.by_exclusions === 1 ? "is" : "are"} hidden from pickers by an admin.`
776
788
  ), l.scopes.length > 0 && d.push(`Your ${l.scopes.join(", ")} access narrows what you can pick here.`), l.row_filter && d.push("Your role only sees some of these records."), d.length === 0 && d.push(
@@ -786,54 +798,54 @@ function on({
786
798
  }
787
799
  );
788
800
  }
789
- function Ln({
801
+ function In({
790
802
  collection: o,
791
803
  id: r,
792
804
  displayTemplate: h,
793
805
  explainMissing: g
794
806
  }) {
795
- const O = Te(), q = vt(), x = o === "nivaro_files" || o === "directus_files", N = (() => {
807
+ const O = Me(), R = wt(), x = o === "nivaro_files" || o === "directus_files", N = (() => {
796
808
  if (!h || !h.includes(".")) return null;
797
809
  const y = [...h.matchAll(/\{\{([^}]+)\}\}/g)].map((xe) => xe[1].trim());
798
810
  return y.length > 0 ? ["id", ...y].join(",") : null;
799
- })(), { data: C, isLoading: l, error: T } = I({
811
+ })(), { data: q, isLoading: l, error: M } = I({
800
812
  queryKey: ["relation-single", o, String(r), N ?? ""],
801
813
  queryFn: () => x ? (
802
814
  // The file's row, not its bytes: GET /files/:id downloads the whole
803
815
  // file (twice with the retry, 404 when storage lost it) only to read
804
816
  // its name, and a missing object left the raw id as the label.
805
817
  O.request(
806
- G(`/files/${encodeURIComponent(String(r))}/meta`)
818
+ V(`/files/${encodeURIComponent(String(r))}/meta`)
807
819
  ).then((y) => y.data)
808
- ) : q(o, r, N),
820
+ ) : R(o, r, N),
809
821
  enabled: !!r && !!o,
810
822
  staleTime: 6e4,
811
- retry: wt
812
- }), { settling: d } = kt(
813
- T,
814
- g && !l && !C ? o : null,
823
+ retry: kt
824
+ }), { settling: d } = Nt(
825
+ M,
826
+ g && !l && !q ? o : null,
815
827
  r
816
828
  );
817
829
  if (l || d) return /* @__PURE__ */ s(ye, { className: "h-3 w-3 animate-spin text-slate-400" });
818
- if (!C)
830
+ if (!q)
819
831
  return r == null || r === "" ? null : /* @__PURE__ */ s(
820
- Nt,
832
+ St,
821
833
  {
822
- error: T,
834
+ error: M,
823
835
  collection: g ? o : null,
824
836
  id: g ? r : null
825
837
  }
826
838
  );
827
839
  if (x) {
828
- const y = C.title || C.filename_download || C.filename_disk || String(r);
840
+ const y = q.title || q.filename_download || q.filename_disk || String(r);
829
841
  return /* @__PURE__ */ s("span", { children: y });
830
842
  }
831
- const f = k(h, C);
832
- return ee(f) ? /* @__PURE__ */ s("span", { className: "italic text-muted-foreground", children: le }) : /* @__PURE__ */ s("span", { children: f });
843
+ const m = k(h, q);
844
+ return ne(m) ? /* @__PURE__ */ s("span", { className: "italic text-muted-foreground", children: le }) : /* @__PURE__ */ s("span", { children: m });
833
845
  }
834
846
  export {
835
- Ln as RelatedItemLabel,
836
- rn as RelationCombobox,
837
- yt as isSamePick,
838
- nn as useStaleTip
847
+ In as RelatedItemLabel,
848
+ cn as RelationCombobox,
849
+ xt as isSamePick,
850
+ ln as useStaleTip
839
851
  };