@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.
- package/dist/components/ScreenShareHost.js +24 -0
- package/dist/full.css +50 -2
- package/dist/hooks/useSessionRecorder.js +61 -60
- package/dist/index.d.ts +1727 -19
- package/dist/index.js +1091 -950
- package/dist/shared/components/ActivityEntry.js +209 -97
- package/dist/shared/components/AgentPresenceChip.js +51 -0
- package/dist/shared/components/AnnouncementBanner.js +56 -41
- package/dist/shared/components/AutolinkedText.js +98 -85
- package/dist/shared/components/BroadcastView.js +149 -141
- package/dist/shared/components/CacheStamp.js +78 -30
- package/dist/shared/components/CollectionBrowserView.js +4088 -3592
- package/dist/shared/components/ConfigChangeStrip.js +63 -0
- package/dist/shared/components/ConfigReachNote.js +107 -0
- package/dist/shared/components/ConformanceView.js +389 -319
- package/dist/shared/components/DataTable.js +544 -504
- package/dist/shared/components/DelegateCoverLine.js +164 -0
- package/dist/shared/components/EnvironmentNotice.js +56 -65
- package/dist/shared/components/FilePreviewLightbox.js +89 -43
- package/dist/shared/components/FindingFixedMark.js +23 -0
- package/dist/shared/components/GridPresenceLine.js +100 -0
- package/dist/shared/components/IdleReloadWatcher.js +82 -43
- package/dist/shared/components/InStep.js +46 -0
- package/dist/shared/components/ItemEditForm.js +5504 -4889
- package/dist/shared/components/LiveAnnouncer.js +62 -0
- package/dist/shared/components/LiveCount.js +54 -0
- package/dist/shared/components/LiveFigure.js +28 -0
- package/dist/shared/components/LiveListControls.js +114 -0
- package/dist/shared/components/LiveNewMatchesPill.js +25 -0
- package/dist/shared/components/LiveOffNote.js +44 -0
- package/dist/shared/components/LivePreferenceHost.js +42 -0
- package/dist/shared/components/LiveRowMark.js +25 -20
- package/dist/shared/components/LiveTraceView.js +257 -0
- package/dist/shared/components/MapView.js +30 -29
- package/dist/shared/components/MatrixEditor.js +497 -462
- package/dist/shared/components/MyWorkView.js +346 -272
- package/dist/shared/components/NotificationBell.js +215 -201
- package/dist/shared/components/PageRenderer.js +636 -599
- package/dist/shared/components/PresenceDot.js +21 -0
- package/dist/shared/components/ProfileView.js +656 -536
- package/dist/shared/components/RealtimeStatusBanner.js +25 -25
- package/dist/shared/components/RecentRecordsRail.js +51 -48
- package/dist/shared/components/RecordCompare.js +241 -150
- package/dist/shared/components/RecordDrilldownSheet.js +66 -64
- package/dist/shared/components/RecordGridEditor.js +350 -311
- package/dist/shared/components/RecordHoverCard.js +147 -0
- package/dist/shared/components/RecordPeekHost.js +111 -0
- package/dist/shared/components/RecordReadView.js +414 -412
- package/dist/shared/components/RelativeTime.js +16 -0
- package/dist/shared/components/ReportView.js +1396 -1304
- package/dist/shared/components/ScreenRefreshButton.js +77 -0
- package/dist/shared/components/TabCountHost.js +10 -0
- package/dist/shared/components/TickerNumber.js +19 -18
- package/dist/shared/components/TipLayer.js +70 -58
- package/dist/shared/components/WidgetImageMenu.js +59 -0
- package/dist/shared/components/WidgetSlot.js +571 -524
- package/dist/shared/components/activity/RecordActivityStream.js +317 -0
- package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
- package/dist/shared/components/cbv/approval-changed.js +20 -0
- package/dist/shared/components/cbv/changed-by-others.js +251 -0
- package/dist/shared/components/cbv/column-totals.js +75 -67
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
- package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
- package/dist/shared/components/change-proposals/types.js +4 -0
- package/dist/shared/components/chat/ChatPanel.js +1571 -1528
- package/dist/shared/components/chat/Composer.js +276 -298
- package/dist/shared/components/chat/room-due.js +13 -0
- package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
- package/dist/shared/components/collections-directory/directory-data.js +75 -63
- package/dist/shared/components/imports/ImportConsole.js +159 -155
- package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
- package/dist/shared/components/integrations/SendStatus.js +202 -0
- package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
- package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
- package/dist/shared/components/integrations/console/api.js +161 -117
- package/dist/shared/components/integrations/console/tone.js +15 -12
- package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
- package/dist/shared/components/item-edit/CloneDialog.js +208 -206
- package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
- package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
- package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
- package/dist/shared/components/item-edit/FieldComments.js +159 -116
- package/dist/shared/components/item-edit/FieldPointer.js +132 -0
- package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
- package/dist/shared/components/item-edit/FieldRow.js +519 -439
- package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
- package/dist/shared/components/item-edit/FilePickerField.js +454 -369
- package/dist/shared/components/item-edit/GroupSection.js +618 -567
- package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
- package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
- package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
- package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
- package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
- package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
- package/dist/shared/components/item-edit/PickerBadges.js +52 -0
- package/dist/shared/components/item-edit/PlanGrid.js +434 -439
- package/dist/shared/components/item-edit/RecalcValue.js +55 -0
- package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
- package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
- package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
- package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
- package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
- package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
- package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
- package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
- package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
- package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
- package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
- package/dist/shared/components/item-edit/SectionPresence.js +78 -0
- package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
- package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
- package/dist/shared/components/item-edit/coedit/collab.js +84 -0
- package/dist/shared/components/item-edit/coedit/context.js +24 -0
- package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
- package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
- package/dist/shared/components/item-edit/coedit/session.js +382 -0
- package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
- package/dist/shared/components/item-edit/file-live.js +77 -0
- package/dist/shared/components/item-edit/file-processing.js +87 -0
- package/dist/shared/components/item-edit/layout-switch.js +148 -0
- package/dist/shared/components/item-edit/live-related.js +23 -0
- package/dist/shared/components/item-edit/live-title.js +66 -0
- package/dist/shared/components/item-edit/partner-needs.js +142 -0
- package/dist/shared/components/item-edit/removed-line.js +58 -0
- package/dist/shared/components/item-edit/render-stability.js +70 -59
- package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
- package/dist/shared/components/layout-editor/CollabParts.js +72 -70
- package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
- package/dist/shared/components/list/InlineEdit.js +504 -208
- package/dist/shared/components/list/ListViewers.js +81 -0
- package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
- package/dist/shared/components/merge/MergeWithFlow.js +290 -0
- package/dist/shared/components/merge/merge-values.js +110 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
- package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
- package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
- package/dist/shared/components/notifications/bundles.js +21 -19
- package/dist/shared/components/notifications/resolved-line.js +25 -0
- package/dist/shared/components/ops/OpsTasksView.js +45 -44
- package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
- package/dist/shared/components/panels/AlertBanners.js +132 -0
- package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
- package/dist/shared/components/panels/BranchLanes.js +82 -54
- package/dist/shared/components/panels/CommentAwareness.js +332 -0
- package/dist/shared/components/panels/CommentImages.js +219 -0
- package/dist/shared/components/panels/CommentPanel.js +649 -530
- package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
- package/dist/shared/components/panels/NewSinceChip.js +16 -0
- package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
- package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
- package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
- package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
- package/dist/shared/components/panels/SlaClock.js +130 -99
- package/dist/shared/components/panels/TaskPanel.js +308 -287
- package/dist/shared/components/panels/unseen-move-check.js +101 -0
- package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
- package/dist/shared/components/profile/AgentNameField.js +141 -0
- package/dist/shared/components/profile/AgentsPanel.js +55 -46
- package/dist/shared/components/profile/PersonAccess.js +398 -330
- package/dist/shared/components/profile/PersonAdminTools.js +127 -113
- package/dist/shared/components/profile/PersonProfile.js +81 -73
- package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
- package/dist/shared/components/queue/QueueBulkBar.js +101 -84
- package/dist/shared/components/queue/QueueItemSheet.js +66 -66
- package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
- package/dist/shared/components/queue/QueueWorklist.js +2076 -1686
- package/dist/shared/components/queue/queue-totals.js +92 -0
- package/dist/shared/components/queue/worklist-helpers.js +18 -14
- package/dist/shared/components/send-view/SendViewButton.js +136 -0
- package/dist/shared/components/send-view/SentViewCards.js +147 -0
- package/dist/shared/components/support/ReportProblem.js +1 -0
- package/dist/shared/components/support/ScreenShare.js +554 -0
- package/dist/shared/components/support/SupportView.js +160 -129
- package/dist/shared/components/support/TicketDetailSheet.js +101 -89
- package/dist/shared/components/watch-list/WatchDock.js +1044 -0
- package/dist/shared/components/watch-list/WatchExtras.js +723 -0
- package/dist/shared/components/watch-list/WatchListButton.js +46 -0
- package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
- package/dist/shared/components/watch-list/WatchRows.js +348 -0
- package/dist/shared/lib/activity-sentence.js +87 -75
- package/dist/shared/lib/agent-presence.js +46 -0
- package/dist/shared/lib/approval-progress.js +49 -0
- package/dist/shared/lib/attention-prefs.js +27 -0
- package/dist/shared/lib/cell-locks.js +56 -0
- package/dist/shared/lib/co-edit.js +166 -0
- package/dist/shared/lib/coedit-registry.js +44 -0
- package/dist/shared/lib/comment-awareness.js +124 -0
- package/dist/shared/lib/comment-images.js +45 -0
- package/dist/shared/lib/config-watch.js +94 -0
- package/dist/shared/lib/copy-rules.js +65 -0
- package/dist/shared/lib/count-step.js +30 -0
- package/dist/shared/lib/deadline-ticker.js +68 -0
- package/dist/shared/lib/derived-causes.js +115 -0
- package/dist/shared/lib/draft-store.js +114 -85
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/field-merge.js +126 -0
- package/dist/shared/lib/filter-sentence.js +10 -10
- package/dist/shared/lib/focus-mode.js +16 -12
- package/dist/shared/lib/grid-cursors.js +77 -0
- package/dist/shared/lib/grid-presence.js +182 -0
- package/dist/shared/lib/idle-reload.js +100 -73
- package/dist/shared/lib/in-step.js +45 -0
- package/dist/shared/lib/integration-chip.js +19 -18
- package/dist/shared/lib/line-locks.js +141 -0
- package/dist/shared/lib/line-split.js +41 -0
- package/dist/shared/lib/linked-changes.js +150 -0
- package/dist/shared/lib/list-link.js +56 -50
- package/dist/shared/lib/list-return.js +231 -0
- package/dist/shared/lib/list-viewers.js +52 -0
- package/dist/shared/lib/live-announcer.js +86 -0
- package/dist/shared/lib/live-counts.js +85 -0
- package/dist/shared/lib/live-data-changed.js +108 -0
- package/dist/shared/lib/live-deltas.js +81 -0
- package/dist/shared/lib/live-findings.js +113 -0
- package/dist/shared/lib/live-groups.js +122 -0
- package/dist/shared/lib/live-link-labels.js +162 -0
- package/dist/shared/lib/live-list-flow.js +334 -0
- package/dist/shared/lib/live-list.js +143 -129
- package/dist/shared/lib/live-moves.js +51 -0
- package/dist/shared/lib/live-ops.js +26 -26
- package/dist/shared/lib/live-pickers.js +7 -0
- package/dist/shared/lib/live-preference.js +184 -0
- package/dist/shared/lib/live-queries.js +226 -181
- package/dist/shared/lib/live-screen.js +333 -0
- package/dist/shared/lib/live-search.js +108 -0
- package/dist/shared/lib/live-seen.js +35 -0
- package/dist/shared/lib/live-views.js +100 -0
- package/dist/shared/lib/live.js +159 -133
- package/dist/shared/lib/missed-updates.js +198 -0
- package/dist/shared/lib/newer-file.js +56 -0
- package/dist/shared/lib/notification-sound.js +42 -20
- package/dist/shared/lib/own-writes.js +59 -41
- package/dist/shared/lib/picker-badges.js +94 -0
- package/dist/shared/lib/presence-signals.js +131 -84
- package/dist/shared/lib/realtime.js +49 -24
- package/dist/shared/lib/record-gaps.js +85 -0
- package/dist/shared/lib/record-outbox.js +369 -222
- package/dist/shared/lib/record-peek.js +75 -0
- package/dist/shared/lib/record-tabs.js +92 -72
- package/dist/shared/lib/relative-ticker.js +42 -0
- package/dist/shared/lib/request-gate.js +119 -119
- package/dist/shared/lib/rollup-recalc.js +107 -0
- package/dist/shared/lib/room-gaps.js +40 -36
- package/dist/shared/lib/rum.js +137 -87
- package/dist/shared/lib/save-progress.js +20 -0
- package/dist/shared/lib/scheduled-countdown.js +67 -0
- package/dist/shared/lib/screen-refresh.js +160 -0
- package/dist/shared/lib/screen-share.js +234 -0
- package/dist/shared/lib/seen-since.js +74 -0
- package/dist/shared/lib/selection-watch.js +205 -0
- package/dist/shared/lib/send-status.js +132 -0
- package/dist/shared/lib/send-view.js +23 -0
- package/dist/shared/lib/socket-liveness.js +155 -0
- package/dist/shared/lib/socket-realtime.js +168 -140
- package/dist/shared/lib/state-census.js +53 -0
- package/dist/shared/lib/summary-mode.js +61 -39
- package/dist/shared/lib/tab-attention.js +143 -32
- package/dist/shared/lib/table-density.js +64 -0
- package/dist/shared/lib/track-travel.js +40 -0
- package/dist/shared/lib/unseen-changes.js +68 -0
- package/dist/shared/lib/upload-file.js +33 -0
- package/dist/shared/lib/upload-presence.js +127 -0
- package/dist/shared/lib/urgent-chime.js +65 -0
- package/dist/shared/lib/use-online-users.js +32 -11
- package/dist/shared/lib/user-sync.js +155 -39
- package/dist/shared/lib/waiting-count.js +44 -0
- package/dist/shared/lib/watch-desktop.js +83 -0
- package/dist/shared/lib/watch-list.js +447 -0
- package/dist/shared/lib/widget-image-render.js +64 -0
- package/dist/shared/lib/widget-image.js +111 -0
- package/dist/shared/lib/worker-socket.js +130 -104
- package/dist/shared/lib/write-to-screen.js +133 -0
- package/package.json +1 -1
- package/styles.css +49 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const d = 150, f = 250;
|
|
2
|
+
function p(e = c) {
|
|
3
|
+
let t = null, r = null, n = null;
|
|
4
|
+
const o = () => {
|
|
5
|
+
n = null, r !== t && (t && e(t, "end"), t = r, t && e(t, "start"));
|
|
6
|
+
}, i = (s) => {
|
|
7
|
+
n && clearTimeout(n), n = setTimeout(o, s);
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
focus(s) {
|
|
11
|
+
r = s, i(s ? 150 : 250);
|
|
12
|
+
},
|
|
13
|
+
blur() {
|
|
14
|
+
r = null, i(250);
|
|
15
|
+
},
|
|
16
|
+
flush() {
|
|
17
|
+
n && clearTimeout(n), n = null, t && e(t, "end"), t = null, r = null;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function c(e, t) {
|
|
22
|
+
typeof window > "u" || window.dispatchEvent(new CustomEvent("nvr:cell-editing", { detail: { cell: e, state: t } }));
|
|
23
|
+
}
|
|
24
|
+
const u = [
|
|
25
|
+
"#0ea5e9",
|
|
26
|
+
// sky
|
|
27
|
+
"#8b5cf6",
|
|
28
|
+
// violet
|
|
29
|
+
"#10b981",
|
|
30
|
+
// emerald
|
|
31
|
+
"#ec4899",
|
|
32
|
+
// pink
|
|
33
|
+
"#64748b",
|
|
34
|
+
// slate
|
|
35
|
+
"#84cc16"
|
|
36
|
+
// lime
|
|
37
|
+
];
|
|
38
|
+
function l(e) {
|
|
39
|
+
const t = String(e ?? "").toUpperCase();
|
|
40
|
+
let r = 0;
|
|
41
|
+
for (let n = 0; n < t.length; n++) r = r * 31 + t.charCodeAt(n) | 0;
|
|
42
|
+
return u[Math.abs(r) % u.length];
|
|
43
|
+
}
|
|
44
|
+
function C(e, t = /* @__PURE__ */ new Map()) {
|
|
45
|
+
const r = /* @__PURE__ */ new Map(), n = (o) => o.toUpperCase();
|
|
46
|
+
for (const o of e) {
|
|
47
|
+
const i = t.get(n(o));
|
|
48
|
+
i && ![...r.values()].includes(i) && r.set(n(o), i);
|
|
49
|
+
}
|
|
50
|
+
for (const o of e) {
|
|
51
|
+
if (r.has(n(o))) continue;
|
|
52
|
+
const i = new Set(r.values()), s = u.find((a) => !i.has(a));
|
|
53
|
+
r.set(n(o), s ?? l(o));
|
|
54
|
+
}
|
|
55
|
+
return r;
|
|
56
|
+
}
|
|
57
|
+
function m(e) {
|
|
58
|
+
const t = e.trim().split(/\s+/).filter(Boolean);
|
|
59
|
+
return t.length === 0 ? "?" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[t.length - 1][0]).toUpperCase();
|
|
60
|
+
}
|
|
61
|
+
function S(e, t, r) {
|
|
62
|
+
const n = e.getAttribute("data-tip");
|
|
63
|
+
return e.classList.add("nvr-remote-editing"), e.dataset.remoteEditor = t.name, e.style.setProperty("--nvr-cursor", r ?? l(t.id ?? t.name)), e.setAttribute("data-tip", `${t.name} is here`), () => {
|
|
64
|
+
e.classList.remove("nvr-remote-editing"), delete e.dataset.remoteEditor, e.style.removeProperty("--nvr-cursor"), n == null ? e.removeAttribute("data-tip") : e.setAttribute("data-tip", n);
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
u as CURSOR_COLORS,
|
|
69
|
+
f as CURSOR_LEAVE_MS,
|
|
70
|
+
d as CURSOR_SETTLE_MS,
|
|
71
|
+
C as assignCursorColors,
|
|
72
|
+
p as createCellAnnouncer,
|
|
73
|
+
l as cursorColor,
|
|
74
|
+
S as markRemoteCell,
|
|
75
|
+
m as personInitials,
|
|
76
|
+
c as windowCellEmit
|
|
77
|
+
};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { useMemo as z, useRef as y, useCallback as H, useEffect as C, useState as D } from "react";
|
|
2
|
+
import { assignCursorColors as U, markRemoteCell as j, createCellAnnouncer as B, personInitials as K, cursorColor as N } from "./grid-cursors.js";
|
|
3
|
+
import { useLiveEvent as G } from "./live.js";
|
|
4
|
+
import { useLivePreference as W } from "./live-preference.js";
|
|
5
|
+
import { useMyUserId as q } from "./presence-signals.js";
|
|
6
|
+
import { useOptionalRealtime as F, useRealtimeStatus as X } from "./realtime.js";
|
|
7
|
+
const Y = 2e4, Z = 5e4, J = 300, b = "pg|";
|
|
8
|
+
function Q(o, e) {
|
|
9
|
+
return `${b}${o}|${e}`;
|
|
10
|
+
}
|
|
11
|
+
function O(o) {
|
|
12
|
+
if (!(o != null && o.startsWith(b))) return null;
|
|
13
|
+
const e = o.slice(b.length), r = e.indexOf("|");
|
|
14
|
+
return r <= 0 || r === e.length - 1 ? null : { item: e.slice(0, r), field: e.slice(r + 1) };
|
|
15
|
+
}
|
|
16
|
+
function V(o, e, r, i) {
|
|
17
|
+
var m, u;
|
|
18
|
+
const s = new Map(o), c = ((m = e == null ? void 0 : e.user) == null ? void 0 : m.id) == null ? "" : String(e.user.id);
|
|
19
|
+
if (!c || typeof e.page != "string" || e.item == null || r && c.toUpperCase() === r.toUpperCase()) return s;
|
|
20
|
+
const a = `${c.toUpperCase()}|${e.page}`;
|
|
21
|
+
if (e.state === "end") {
|
|
22
|
+
const S = s.get(a);
|
|
23
|
+
return S && S.item === String(e.item) && s.delete(a), s;
|
|
24
|
+
}
|
|
25
|
+
return s.set(a, {
|
|
26
|
+
userId: c,
|
|
27
|
+
name: typeof ((u = e.user) == null ? void 0 : u.name) == "string" && e.user.name ? e.user.name : "Someone",
|
|
28
|
+
item: String(e.item),
|
|
29
|
+
field: typeof e.field == "string" ? e.field : null,
|
|
30
|
+
page: e.page,
|
|
31
|
+
at: i,
|
|
32
|
+
color: N(c)
|
|
33
|
+
}), s;
|
|
34
|
+
}
|
|
35
|
+
function ee(o, e, r = Z) {
|
|
36
|
+
return [...o.values()].filter((i) => e - i.at <= r).sort((i, s) => i.name.localeCompare(s.name) || i.userId.localeCompare(s.userId));
|
|
37
|
+
}
|
|
38
|
+
const te = [];
|
|
39
|
+
function ae(o) {
|
|
40
|
+
const e = F(), r = X(), i = q(), s = W(), { page: c, collection: a, containerRef: m } = o, u = o.enabled !== !1 && !!e && !!a && !!c, S = z(
|
|
41
|
+
() => [...new Set(o.items.map(String).filter((t) => t && t !== "new"))].slice(0, J).join(""),
|
|
42
|
+
[o.items]
|
|
43
|
+
), g = y(/* @__PURE__ */ new Set()), w = H(
|
|
44
|
+
(t, l) => {
|
|
45
|
+
for (let n = 0; n < l.length; n += 100)
|
|
46
|
+
e == null || e.emit(t, { collection: a, items: l.slice(n, n + 100) });
|
|
47
|
+
},
|
|
48
|
+
[e, a]
|
|
49
|
+
);
|
|
50
|
+
C(() => {
|
|
51
|
+
if (!u) return;
|
|
52
|
+
const t = new Set(S.split("").filter(Boolean)), l = [...t].filter((p) => !g.current.has(p)), n = [...g.current].filter((p) => !t.has(p));
|
|
53
|
+
g.current = t, l.length && w("grid:watch", l), n.length && w("grid:unwatch", n);
|
|
54
|
+
}, [u, S, w]), C(() => {
|
|
55
|
+
if (u)
|
|
56
|
+
return () => {
|
|
57
|
+
g.current.size && w("grid:unwatch", [...g.current]), g.current = /* @__PURE__ */ new Set();
|
|
58
|
+
};
|
|
59
|
+
}, [u, w]);
|
|
60
|
+
const v = y(!1), I = y(null);
|
|
61
|
+
C(() => {
|
|
62
|
+
if (u) {
|
|
63
|
+
if ((r == null ? void 0 : r.state) === "reconnecting") v.current = !0;
|
|
64
|
+
else if (v.current) {
|
|
65
|
+
v.current = !1, g.current.size && w("grid:watch", [...g.current]);
|
|
66
|
+
const t = I.current;
|
|
67
|
+
t && (e == null || e.emit("grid:here", { collection: a, page: c, ...t, state: "start" }));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, [r == null ? void 0 : r.state, u, w, e, a, c]), G(
|
|
71
|
+
"access:changed",
|
|
72
|
+
() => {
|
|
73
|
+
g.current.size && w("grid:watch", [...g.current]);
|
|
74
|
+
},
|
|
75
|
+
{ enabled: u, includeOwn: !0, debounceMs: 800 }
|
|
76
|
+
), C(() => {
|
|
77
|
+
const t = m == null ? void 0 : m.current;
|
|
78
|
+
if (!u || !t) return;
|
|
79
|
+
const n = B((f, d) => {
|
|
80
|
+
const h = O(f);
|
|
81
|
+
h && (I.current = d === "start" ? h : null, e == null || e.emit("grid:here", { collection: a, page: c, item: h.item, field: h.field, state: d }));
|
|
82
|
+
}), p = (f) => {
|
|
83
|
+
var h, P;
|
|
84
|
+
const d = (P = (h = f == null ? void 0 : f.closest) == null ? void 0 : h.call(f, "[data-grid-cell]")) == null ? void 0 : P.getAttribute("data-grid-cell");
|
|
85
|
+
return O(d) ? d : null;
|
|
86
|
+
}, _ = (f) => {
|
|
87
|
+
const d = p(f.target);
|
|
88
|
+
d && n.focus(d);
|
|
89
|
+
}, $ = (f) => {
|
|
90
|
+
const d = f.relatedTarget, h = d && t.contains(d) ? p(d) : null;
|
|
91
|
+
h ? n.focus(h) : n.blur();
|
|
92
|
+
};
|
|
93
|
+
t.addEventListener("focusin", _), t.addEventListener("focusout", $);
|
|
94
|
+
const k = setInterval(() => {
|
|
95
|
+
const f = I.current;
|
|
96
|
+
f && (e == null || e.emit("grid:here", { collection: a, page: c, ...f, state: "start" }));
|
|
97
|
+
}, Y);
|
|
98
|
+
return () => {
|
|
99
|
+
t.removeEventListener("focusin", _), t.removeEventListener("focusout", $), clearInterval(k), n.flush(), I.current = null;
|
|
100
|
+
};
|
|
101
|
+
}, [u, m, e, a, c]);
|
|
102
|
+
const [E, x] = D(() => /* @__PURE__ */ new Map()), [L, A] = D(() => Date.now());
|
|
103
|
+
C(() => x(/* @__PURE__ */ new Map()), [c, a]), G(
|
|
104
|
+
"grid:editing",
|
|
105
|
+
(t) => {
|
|
106
|
+
const l = Date.now();
|
|
107
|
+
x((n) => V(n, t, i, l)), A(l);
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
enabled: u,
|
|
111
|
+
includeOwn: !0,
|
|
112
|
+
match: (t) => (t == null ? void 0 : t.collection) === a && (t == null ? void 0 : t.page) === c
|
|
113
|
+
}
|
|
114
|
+
), C(() => {
|
|
115
|
+
if (!u || E.size === 0) return;
|
|
116
|
+
const t = setInterval(() => A(Date.now()), 1e4);
|
|
117
|
+
return () => clearInterval(t);
|
|
118
|
+
}, [u, E.size]);
|
|
119
|
+
const T = s.normal && u, R = y(/* @__PURE__ */ new Map()), M = z(() => {
|
|
120
|
+
if (!T) return te;
|
|
121
|
+
const t = ee(E, L), l = U([...new Set(t.map((n) => n.userId))], R.current);
|
|
122
|
+
return R.current = l, t.map((n) => ({ ...n, color: l.get(n.userId.toUpperCase()) ?? n.color }));
|
|
123
|
+
}, [T, E, L]);
|
|
124
|
+
return C(() => {
|
|
125
|
+
const t = m == null ? void 0 : m.current;
|
|
126
|
+
if (!t || M.length === 0) return;
|
|
127
|
+
const l = [];
|
|
128
|
+
for (const n of M) {
|
|
129
|
+
if (!n.field) continue;
|
|
130
|
+
const p = t.querySelector(
|
|
131
|
+
`[data-grid-cell="${re(Q(n.item, n.field))}"]`
|
|
132
|
+
);
|
|
133
|
+
p && (l.push(j(p, { id: n.userId, name: n.name }, n.color)), l.push(ne(p, n)));
|
|
134
|
+
}
|
|
135
|
+
return () => {
|
|
136
|
+
for (const n of l) n();
|
|
137
|
+
};
|
|
138
|
+
}), { editors: M };
|
|
139
|
+
}
|
|
140
|
+
function fe(o, ...e) {
|
|
141
|
+
let r = 5381;
|
|
142
|
+
const i = e.join("");
|
|
143
|
+
for (let s = 0; s < i.length; s++) r = (r << 5) + r + i.charCodeAt(s) | 0;
|
|
144
|
+
return `${o.replace(/[^A-Za-z0-9_-]/g, "").slice(0, 24)}:${(r >>> 0).toString(36)}`;
|
|
145
|
+
}
|
|
146
|
+
function ne(o, e) {
|
|
147
|
+
const r = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement ? o.parentElement : o;
|
|
148
|
+
if (!r || typeof document > "u") return () => {
|
|
149
|
+
};
|
|
150
|
+
const i = document.createElement("span");
|
|
151
|
+
i.setAttribute("data-grid-presence-chip", ""), i.setAttribute("aria-hidden", "true"), i.textContent = K(e.name), Object.assign(i.style, {
|
|
152
|
+
position: "absolute",
|
|
153
|
+
top: "-7px",
|
|
154
|
+
right: "2px",
|
|
155
|
+
zIndex: "5",
|
|
156
|
+
padding: "0 4px",
|
|
157
|
+
borderRadius: "4px",
|
|
158
|
+
background: e.color,
|
|
159
|
+
color: "#fff",
|
|
160
|
+
font: "600 9px/14px ui-sans-serif, system-ui, sans-serif",
|
|
161
|
+
letterSpacing: "0.02em",
|
|
162
|
+
pointerEvents: "none"
|
|
163
|
+
});
|
|
164
|
+
const s = getComputedStyle(r).position === "static", c = r.style.position;
|
|
165
|
+
return s && (r.style.position = "relative"), r.appendChild(i), () => {
|
|
166
|
+
i.remove(), s && (r.style.position = c);
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function re(o) {
|
|
170
|
+
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(o) : o.replace(/["\\]/g, "\\$&");
|
|
171
|
+
}
|
|
172
|
+
export {
|
|
173
|
+
Y as GRID_HEARTBEAT_MS,
|
|
174
|
+
Z as GRID_MARK_TTL_MS,
|
|
175
|
+
J as GRID_WATCH_LIMIT,
|
|
176
|
+
V as foldGridEditing,
|
|
177
|
+
ee as freshGridEditors,
|
|
178
|
+
fe as gridPageKey,
|
|
179
|
+
Q as gridPresenceCell,
|
|
180
|
+
O as parseGridPresenceCell,
|
|
181
|
+
ae as useGridPresence
|
|
182
|
+
};
|
|
@@ -1,138 +1,165 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
3
|
-
var
|
|
4
|
-
const
|
|
5
|
-
return (Number.isFinite(
|
|
1
|
+
const C = 60, O = 18e4, v = 9e5, F = 36e5, T = 9e5, g = 1;
|
|
2
|
+
function E(e) {
|
|
3
|
+
var n;
|
|
4
|
+
const t = Number((n = e == null ? void 0 : e.auto_reload) == null ? void 0 : n.idle_seconds);
|
|
5
|
+
return (Number.isFinite(t) && t > 0 ? t : 60) * 1e3;
|
|
6
6
|
}
|
|
7
|
-
function p(e,
|
|
8
|
-
var
|
|
9
|
-
return e && !((
|
|
7
|
+
function p(e, t) {
|
|
8
|
+
var n;
|
|
9
|
+
return e && !((n = e.auto_reload) != null && n.enabled) || t >= 36e5 ? 9e5 : 18e4;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function Y(e) {
|
|
12
12
|
var o;
|
|
13
13
|
if (e.declined) return { action: "wait", reason: "declined" };
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
14
|
+
const t = e.now - e.lastInput;
|
|
15
|
+
if (t < E(e.status)) return { action: "wait", reason: "active" };
|
|
16
16
|
if (e.unsaved.length > 0) return { action: "wait", reason: "unsaved" };
|
|
17
17
|
if (e.holds.length > 0) return { action: "wait", reason: "held" };
|
|
18
|
-
const
|
|
19
|
-
return !
|
|
18
|
+
const n = e.status;
|
|
19
|
+
return !n || e.now - e.statusAt >= p(n, t) ? { action: "check" } : (o = n.auto_reload) != null && o.enabled ? !n.older || !n.id ? { action: "wait", reason: "current" } : e.reloadedFor(n.id) >= 1 ? { action: "wait", reason: "already" } : { action: "reload", id: n.id } : { action: "wait", reason: "off" };
|
|
20
|
+
}
|
|
21
|
+
const y = 24 * 36e5, S = 4 * 36e5, L = 6e4, x = 6e4;
|
|
22
|
+
function h(e) {
|
|
23
|
+
var n;
|
|
24
|
+
const t = Number((n = e == null ? void 0 : e.data_resync) == null ? void 0 : n.replay_window_s);
|
|
25
|
+
return Number.isFinite(t) && t > 0 ? t * 1e3 : y;
|
|
26
|
+
}
|
|
27
|
+
function R(e) {
|
|
28
|
+
var n;
|
|
29
|
+
const t = Number((n = e == null ? void 0 : e.data_resync) == null ? void 0 : n.idle_hours);
|
|
30
|
+
return Number.isFinite(t) && t > 0 ? t * 36e5 : S;
|
|
20
31
|
}
|
|
21
|
-
|
|
32
|
+
function H(e) {
|
|
33
|
+
if (e.reloadDue) return { action: "none", reason: "build" };
|
|
34
|
+
if (e.lastResyncAt > 0 && e.now - e.lastResyncAt < L)
|
|
35
|
+
return { action: "none", reason: "recent" };
|
|
36
|
+
if (e.awayMs >= h(e.status)) return { action: "resync", reason: "replay-window" };
|
|
37
|
+
if (e.missed) return { action: "resync", reason: "missed-events" };
|
|
38
|
+
const t = R(e.status), n = Math.max(e.lastInput, e.lastResyncAt);
|
|
39
|
+
return e.now - n >= t ? { action: "resync", reason: "idle-hours" } : { action: "none", reason: "fresh" };
|
|
40
|
+
}
|
|
41
|
+
const m = ["keydown", "pointerdown", "touchstart", "wheel", "input"];
|
|
22
42
|
let f = Date.now(), d = !1;
|
|
23
|
-
function
|
|
43
|
+
function P() {
|
|
24
44
|
if (d || typeof window > "u") return;
|
|
25
45
|
d = !0;
|
|
26
46
|
const e = () => {
|
|
27
47
|
f = Date.now();
|
|
28
48
|
};
|
|
29
|
-
for (const
|
|
49
|
+
for (const t of m) window.addEventListener(t, e, { passive: !0, capture: !0 });
|
|
30
50
|
}
|
|
31
|
-
function
|
|
51
|
+
function k() {
|
|
32
52
|
return f;
|
|
33
53
|
}
|
|
34
|
-
const
|
|
35
|
-
function
|
|
54
|
+
const l = "nvr-idle-reload-scroll", D = 2 * 6e4, I = 8e3, M = 12;
|
|
55
|
+
function b(e) {
|
|
36
56
|
if (e.id) return `#${e.id}`;
|
|
37
|
-
const
|
|
38
|
-
let
|
|
39
|
-
for (;
|
|
40
|
-
const o =
|
|
57
|
+
const t = [];
|
|
58
|
+
let n = e;
|
|
59
|
+
for (; n && n !== document.body; ) {
|
|
60
|
+
const o = n.parentElement;
|
|
41
61
|
if (!o) return null;
|
|
42
|
-
|
|
62
|
+
t.unshift(Array.prototype.indexOf.call(o.children, n)), n = o;
|
|
43
63
|
}
|
|
44
|
-
return
|
|
64
|
+
return n === document.body ? `>${t.join(">")}` : null;
|
|
45
65
|
}
|
|
46
|
-
function
|
|
66
|
+
function N(e) {
|
|
47
67
|
if (e.startsWith("#")) return document.getElementById(e.slice(1));
|
|
48
68
|
if (!e.startsWith(">")) return null;
|
|
49
|
-
let
|
|
50
|
-
for (const
|
|
51
|
-
const o = Number(
|
|
52
|
-
if (!
|
|
53
|
-
|
|
69
|
+
let t = document.body;
|
|
70
|
+
for (const n of e.slice(1).split(">")) {
|
|
71
|
+
const o = Number(n);
|
|
72
|
+
if (!t || n === "" || !Number.isInteger(o)) return null;
|
|
73
|
+
t = t.children[o] ?? null;
|
|
54
74
|
}
|
|
55
|
-
return
|
|
75
|
+
return t;
|
|
56
76
|
}
|
|
57
77
|
function w() {
|
|
58
78
|
return `${window.location.pathname}${window.location.search}`;
|
|
59
79
|
}
|
|
60
|
-
function
|
|
80
|
+
function G() {
|
|
61
81
|
try {
|
|
62
82
|
const e = [];
|
|
63
|
-
for (const
|
|
64
|
-
if (e.length >=
|
|
65
|
-
if (
|
|
66
|
-
const o =
|
|
67
|
-
o && e.push({ key: o, top:
|
|
83
|
+
for (const n of document.querySelectorAll("body *")) {
|
|
84
|
+
if (e.length >= M) break;
|
|
85
|
+
if (n.scrollTop <= 0 && n.scrollLeft <= 0) continue;
|
|
86
|
+
const o = b(n);
|
|
87
|
+
o && e.push({ key: o, top: n.scrollTop, left: n.scrollLeft });
|
|
68
88
|
}
|
|
69
|
-
const
|
|
89
|
+
const t = {
|
|
70
90
|
path: w(),
|
|
71
91
|
at: Date.now(),
|
|
72
92
|
window: { x: window.scrollX, y: window.scrollY },
|
|
73
93
|
boxes: e
|
|
74
94
|
};
|
|
75
|
-
sessionStorage.setItem(
|
|
95
|
+
sessionStorage.setItem(l, JSON.stringify(t));
|
|
76
96
|
} catch {
|
|
77
97
|
}
|
|
78
98
|
}
|
|
79
|
-
function
|
|
99
|
+
function A(e, t, n = Date.now()) {
|
|
80
100
|
if (!e) return null;
|
|
81
101
|
try {
|
|
82
102
|
const o = JSON.parse(e);
|
|
83
|
-
return !o || o.path !==
|
|
103
|
+
return !o || o.path !== t || typeof o.at != "number" || n - o.at > D || n < o.at - 5e3 ? null : { ...o, boxes: Array.isArray(o.boxes) ? o.boxes : [] };
|
|
84
104
|
} catch {
|
|
85
105
|
return null;
|
|
86
106
|
}
|
|
87
107
|
}
|
|
88
|
-
function
|
|
108
|
+
function K() {
|
|
89
109
|
if (typeof window > "u") return () => {
|
|
90
110
|
};
|
|
91
111
|
let e = null;
|
|
92
112
|
try {
|
|
93
|
-
e =
|
|
113
|
+
e = A(sessionStorage.getItem(l), w()), sessionStorage.removeItem(l);
|
|
94
114
|
} catch {
|
|
95
115
|
e = null;
|
|
96
116
|
}
|
|
97
117
|
if (!e) return () => {
|
|
98
118
|
};
|
|
99
|
-
const
|
|
100
|
-
let o =
|
|
101
|
-
const
|
|
102
|
-
|
|
119
|
+
const t = e, n = new Map(t.boxes.map((r) => [r.key, r]));
|
|
120
|
+
let o = t.window.y <= 0 && t.window.x <= 0, c = !1;
|
|
121
|
+
const s = () => {
|
|
122
|
+
c = !0;
|
|
103
123
|
};
|
|
104
|
-
window.addEventListener("pointerdown",
|
|
105
|
-
const
|
|
106
|
-
if (!
|
|
107
|
-
o || (window.scrollTo(
|
|
108
|
-
for (const [r,
|
|
109
|
-
const i =
|
|
110
|
-
!i || i.scrollHeight - i.clientHeight <
|
|
124
|
+
window.addEventListener("pointerdown", s, { once: !0, capture: !0 }), window.addEventListener("keydown", s, { once: !0, capture: !0 }), window.addEventListener("wheel", s, { once: !0, capture: !0, passive: !0 });
|
|
125
|
+
const _ = Date.now(), u = () => {
|
|
126
|
+
if (!c) {
|
|
127
|
+
o || (window.scrollTo(t.window.x, t.window.y), o = Math.abs(window.scrollY - t.window.y) < 2);
|
|
128
|
+
for (const [r, a] of n) {
|
|
129
|
+
const i = N(r);
|
|
130
|
+
!i || i.scrollHeight - i.clientHeight < a.top - 1 || (i.scrollTop = a.top, i.scrollLeft = a.left, n.delete(r));
|
|
111
131
|
}
|
|
112
|
-
if (o &&
|
|
113
|
-
|
|
132
|
+
if (o && n.size === 0 || Date.now() - _ > I) {
|
|
133
|
+
c = !0;
|
|
114
134
|
return;
|
|
115
135
|
}
|
|
116
136
|
setTimeout(u, 200);
|
|
117
137
|
}
|
|
118
138
|
};
|
|
119
|
-
return setTimeout(u, 0),
|
|
139
|
+
return setTimeout(u, 0), s;
|
|
120
140
|
}
|
|
121
141
|
export {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
142
|
+
v as CHECK_EVERY_LONG_IDLE_MS,
|
|
143
|
+
O as CHECK_EVERY_MS,
|
|
144
|
+
T as CHECK_EVERY_WHEN_OFF_MS,
|
|
145
|
+
S as DEFAULT_IDLE_RESYNC_MS,
|
|
146
|
+
C as DEFAULT_IDLE_SECONDS,
|
|
147
|
+
y as DEFAULT_REPLAY_WINDOW_MS,
|
|
148
|
+
g as IDLE_RELOADS_PER_TARGET,
|
|
149
|
+
F as LONG_IDLE_MS,
|
|
150
|
+
L as RESYNC_MIN_GAP_MS,
|
|
151
|
+
x as SLEEP_GAP_MS,
|
|
128
152
|
p as checkEveryMs,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
153
|
+
Y as decideIdleReload,
|
|
154
|
+
H as decideIdleResync,
|
|
155
|
+
b as domPathKey,
|
|
156
|
+
N as findByDomPathKey,
|
|
157
|
+
E as idleMsFor,
|
|
158
|
+
R as idleResyncMsFor,
|
|
159
|
+
k as lastIdleReloadInput,
|
|
160
|
+
h as replayWindowMsFor,
|
|
161
|
+
K as restoreScrollAfterReload,
|
|
162
|
+
G as saveScrollForReload,
|
|
163
|
+
P as trackIdleReloadInput,
|
|
164
|
+
A as usableScroll
|
|
138
165
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { countdownText as c } from "./deadline-ticker.js";
|
|
2
|
+
const a = "$in_step", m = "__in_step__", f = "in_step";
|
|
3
|
+
function o(n) {
|
|
4
|
+
if (n == null || n === "") return null;
|
|
5
|
+
const e = n instanceof Date ? n.getTime() : typeof n == "number" ? n : new Date(n).getTime();
|
|
6
|
+
return Number.isFinite(e) ? e : null;
|
|
7
|
+
}
|
|
8
|
+
function _(n, e) {
|
|
9
|
+
const t = o(n);
|
|
10
|
+
return t == null ? null : c(Math.max(0, e - t));
|
|
11
|
+
}
|
|
12
|
+
function g(n, e, t) {
|
|
13
|
+
const u = _(e, t);
|
|
14
|
+
if (u == null) return null;
|
|
15
|
+
const r = String(n ?? "").trim();
|
|
16
|
+
return r ? `${r} · ${u}` : u;
|
|
17
|
+
}
|
|
18
|
+
function S(n, e) {
|
|
19
|
+
const t = _(n, e);
|
|
20
|
+
return t == null ? null : `for ${t}`;
|
|
21
|
+
}
|
|
22
|
+
function T(n, e, t) {
|
|
23
|
+
if (!n) return null;
|
|
24
|
+
const u = String(n).toUpperCase();
|
|
25
|
+
let r = null, s = null;
|
|
26
|
+
for (const i of e ?? []) {
|
|
27
|
+
if (String(i.to_state ?? "").toUpperCase() !== u) continue;
|
|
28
|
+
const l = o(i.timestamp);
|
|
29
|
+
l != null && (r == null || l > r) && (r = l, s = i.timestamp);
|
|
30
|
+
}
|
|
31
|
+
return s ?? (t && o(t) != null ? t : null);
|
|
32
|
+
}
|
|
33
|
+
function h(n) {
|
|
34
|
+
return n === "state_entered" ? "-aging_hours" : n === "-state_entered" || n === f ? "aging_hours" : n === `-${f}` ? "-aging_hours" : n;
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
m as IN_STEP_COLUMN,
|
|
38
|
+
a as IN_STEP_SORT,
|
|
39
|
+
f as QUEUE_IN_STEP_COLUMN,
|
|
40
|
+
T as enteredAtFromHistory,
|
|
41
|
+
S as forStepText,
|
|
42
|
+
_ as inStepSpan,
|
|
43
|
+
g as inStepText,
|
|
44
|
+
h as queueServerSort
|
|
45
|
+
};
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
3
|
-
const n = [], s = /* @__PURE__ */ new Set();
|
|
1
|
+
const p = (e) => e === "accepted" ? "ok" : e === "failed" || e === "rejected" ? "attention" : e === "pending" ? "pending" : "neutral";
|
|
2
|
+
function c(e, r, i = () => "", l = /* @__PURE__ */ new Set()) {
|
|
3
|
+
const u = new Set([...l].map((t) => t.toLowerCase())), o = (t, n) => n === "attention" && u.has(t.toLowerCase()) ? "retrying" : n, a = [], s = /* @__PURE__ */ new Set();
|
|
4
4
|
for (const t of e) {
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
const n = t.tone === "positive" ? "ok" : t.tone === "danger" ? "attention" : t.outcome === "pending" ? "pending" : "neutral";
|
|
6
|
+
a.push({ name: t.api, status: o(t.api, n), tip: `${t.api} · ${t.text}` }), s.add(t.api.toLowerCase());
|
|
7
7
|
}
|
|
8
|
-
for (const t of
|
|
9
|
-
const
|
|
10
|
-
s.has(
|
|
11
|
-
name:
|
|
12
|
-
status:
|
|
13
|
-
tip: `${
|
|
8
|
+
for (const t of r) {
|
|
9
|
+
const n = t.external_api_name ?? (t.external_api != null ? `#${t.external_api}` : "External");
|
|
10
|
+
s.has(n.toLowerCase()) || (s.add(n.toLowerCase()), a.push({
|
|
11
|
+
name: n,
|
|
12
|
+
status: o(n, p(t.status)),
|
|
13
|
+
tip: `${n} · ${t.status} · ${i(t.updated_at ?? t.created_at)}${t.last_error ? ` — ${t.last_error.slice(0, 120)}` : ""}`
|
|
14
14
|
}));
|
|
15
15
|
}
|
|
16
16
|
return {
|
|
17
|
-
partners:
|
|
18
|
-
ok:
|
|
19
|
-
attention:
|
|
20
|
-
pending:
|
|
17
|
+
partners: a,
|
|
18
|
+
ok: a.filter((t) => t.status === "ok").length,
|
|
19
|
+
attention: a.filter((t) => t.status === "attention").length,
|
|
20
|
+
pending: a.filter((t) => t.status === "pending").length,
|
|
21
|
+
retrying: a.filter((t) => t.status === "retrying").length
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
+
function g(e) {
|
|
24
25
|
return e.layoutOn ? e.obligations === null || e.submissions === null ? null : e.partnerIntegration !== !1 || e.obligations > 0 || e.submissions > 0 : !1;
|
|
25
26
|
}
|
|
26
27
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
g as externalRequestsShown,
|
|
29
|
+
c as integrationChipSummary
|
|
29
30
|
};
|