@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.
- 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 +1728 -22
- 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 +4909 -4182
- 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 +612 -551
- 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/OverflowRail.js +326 -0
- 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/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/SignalCard.js +84 -77
- 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/list/PhonePager.js +50 -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 +389 -323
- 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 +2050 -1942
- 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/OwnerAvatars.js +9 -9
- 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 +2407 -1950
- package/dist/shared/components/queue/worklist-helpers.js +10 -6
- 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/ui/popover.js +53 -29
- 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/keep-row-focus.js +43 -0
- 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-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/obligation-banner.js +17 -17
- 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/rail-menu-context.js +9 -0
- 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/row-surface.js +7 -0
- 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/table-pins.js +20 -18
- 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 +62 -0
- package/dist/shared/lib/upload-presence.js +127 -0
- package/dist/shared/lib/urgent-chime.js +65 -0
- package/dist/shared/lib/use-below-md.js +29 -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
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { useQueryClient as
|
|
2
|
-
import { useSyncExternalStore as
|
|
3
|
-
import { expandCoalesced as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { useQueryClient as ce } from "@tanstack/react-query";
|
|
2
|
+
import { useSyncExternalStore as he, useRef as pe, useEffect as ie } from "react";
|
|
3
|
+
import { expandCoalesced as ge } from "./live.js";
|
|
4
|
+
import { getLiveMode as me } from "./live-preference.js";
|
|
5
|
+
import { LIVE_WIDGET_SAFETY_MS as we } from "./live-widgets.js";
|
|
6
|
+
import { isOwnWrite as ye } from "./own-writes.js";
|
|
7
|
+
import { useOptionalRealtime as le, useRealtimeStatus as Me } from "./realtime.js";
|
|
8
|
+
import { setScreenRefreshClient as be } from "./screen-refresh.js";
|
|
9
|
+
function xe(n) {
|
|
10
|
+
return { live: n };
|
|
9
11
|
}
|
|
10
|
-
const
|
|
12
|
+
const Oe = [
|
|
11
13
|
"item",
|
|
12
14
|
"rrv-record",
|
|
13
15
|
"revisions",
|
|
@@ -23,6 +25,8 @@ const he = [
|
|
|
23
25
|
"pipeline-instance-owners",
|
|
24
26
|
"pipeline-owners-resolved",
|
|
25
27
|
"approval-brief",
|
|
28
|
+
// rt8 #12: what changed since a send back (a RECORD_QUERY_HEADS entry).
|
|
29
|
+
"resubmission",
|
|
26
30
|
"erp-submissions",
|
|
27
31
|
"record-integrations",
|
|
28
32
|
"record-integrity",
|
|
@@ -39,230 +43,271 @@ const he = [
|
|
|
39
43
|
"my-work",
|
|
40
44
|
"widget-data",
|
|
41
45
|
"live-record",
|
|
42
|
-
"live-list"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
"live-list",
|
|
47
|
+
// Realtime round 2 (rt2-record): the record page's SLA clock re-reads after a reconnect too.
|
|
48
|
+
"sla-breach"
|
|
49
|
+
], m = (n) => {
|
|
50
|
+
var i;
|
|
51
|
+
const s = (i = n.meta) == null ? void 0 : i.live;
|
|
46
52
|
return s && typeof s == "object" ? s : null;
|
|
47
53
|
};
|
|
48
|
-
function
|
|
49
|
-
var
|
|
50
|
-
if (!
|
|
54
|
+
function Se(n) {
|
|
55
|
+
var i;
|
|
56
|
+
if (!n || n.reconcileOnly) return [];
|
|
51
57
|
const s = /* @__PURE__ */ new Set();
|
|
52
|
-
for (const
|
|
53
|
-
return (
|
|
58
|
+
for (const f of n.reads ?? []) f && s.add(f);
|
|
59
|
+
return (i = n.record) != null && i.collection && s.add(n.record.collection), [...s];
|
|
54
60
|
}
|
|
55
|
-
function
|
|
56
|
-
var
|
|
57
|
-
if (
|
|
58
|
-
const
|
|
59
|
-
if (!
|
|
60
|
-
const
|
|
61
|
-
for (const
|
|
62
|
-
if (
|
|
63
|
-
if (
|
|
64
|
-
const
|
|
65
|
-
if (!
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
-
var
|
|
69
|
-
return (
|
|
70
|
-
})) || (
|
|
71
|
-
var
|
|
72
|
-
return (
|
|
61
|
+
function Ce(n, s, i) {
|
|
62
|
+
var Q;
|
|
63
|
+
if (n.reconcileOnly) return !1;
|
|
64
|
+
const f = n.record, v = !!f && f.collection === s;
|
|
65
|
+
if (!v && !(n.reads ?? []).includes(s)) return !1;
|
|
66
|
+
const C = n.includeOwn ?? !v, L = v ? String(f == null ? void 0 : f.id) : null;
|
|
67
|
+
for (const p of i) {
|
|
68
|
+
if (p.own && !C || L !== null && String(p.item) !== L && p.item !== "*") continue;
|
|
69
|
+
if (p.action === "create" || p.action === "delete") return !0;
|
|
70
|
+
const a = p.changed_fields;
|
|
71
|
+
if (!a || a.length === 0) return !0;
|
|
72
|
+
const E = a.filter((u) => !u.startsWith("$"));
|
|
73
|
+
if (E.length > 0 && (!n.fields || E.some((u) => {
|
|
74
|
+
var w;
|
|
75
|
+
return (w = n.fields) == null ? void 0 : w.includes(u);
|
|
76
|
+
})) || (Q = n.aspects) != null && Q.length && a.some((u) => {
|
|
77
|
+
var w;
|
|
78
|
+
return (w = n.aspects) == null ? void 0 : w.includes(u);
|
|
73
79
|
})) return !0;
|
|
74
80
|
}
|
|
75
81
|
return !1;
|
|
76
82
|
}
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
for (const
|
|
83
|
+
const x = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Set(), re = (n, s) => {
|
|
84
|
+
const i = (x.get(n) ?? 0) + s;
|
|
85
|
+
i > 0 ? x.set(n, i) : x.delete(n);
|
|
86
|
+
for (const f of V) f();
|
|
81
87
|
};
|
|
82
|
-
function
|
|
83
|
-
var
|
|
84
|
-
const
|
|
85
|
-
let
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
88
|
-
const
|
|
89
|
-
if (!
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
for (const
|
|
93
|
-
if (
|
|
94
|
-
|
|
88
|
+
function Ee(n, s, i = {}) {
|
|
89
|
+
var $, J;
|
|
90
|
+
const f = i.windowMs ?? 300, v = i.readsGapMs ?? 1e4, C = i.hiddenReconcileMs ?? 5 * 6e4, L = i.lingerMs ?? 3e4, Q = i.jitterMs ?? 1500, p = i.isOwn ?? ((t, e) => ye(t, e)), a = i.now ?? (() => Date.now()), E = i.random ?? Math.random, u = i.doc === void 0 ? typeof document > "u" ? null : document : i.doc, w = i.win === void 0 ? typeof window > "u" ? null : window : i.win, k = n.getQueryCache(), R = { events: 0, refetches: 0, reconciles: 0, deferred: 0 };
|
|
91
|
+
let g = !1;
|
|
92
|
+
const h = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map(), ue = 500, fe = (t) => {
|
|
93
|
+
if (g || !(t != null && t.collection)) return;
|
|
94
|
+
const e = String(t.collection);
|
|
95
|
+
if (!h.has(e)) return;
|
|
96
|
+
R.events++;
|
|
97
|
+
const o = A.get(e) ?? [];
|
|
98
|
+
for (const c of ge(t)) {
|
|
99
|
+
if (o.length >= ue) {
|
|
100
|
+
o.length = 0, o.push({ collection: e, item: "*", own: !1 });
|
|
95
101
|
break;
|
|
96
102
|
}
|
|
97
|
-
|
|
103
|
+
o.push({ ...c, own: c.item != null && c.item !== "*" && p(e, c.item) });
|
|
98
104
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
setTimeout(() =>
|
|
105
|
+
A.set(e, o), j.has(e) || j.set(
|
|
106
|
+
e,
|
|
107
|
+
setTimeout(() => ae(e), f)
|
|
102
108
|
);
|
|
103
|
-
},
|
|
104
|
-
if (
|
|
105
|
-
const
|
|
106
|
-
for (const
|
|
107
|
-
if (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
i && (clearTimeout(i), w.delete(n)), v.has(n) || v.set(n, s.subscribeCollections([n], ne));
|
|
109
|
+
}, U = () => {
|
|
110
|
+
if (g) return;
|
|
111
|
+
const t = /* @__PURE__ */ new Set();
|
|
112
|
+
for (const e of k.getAll()) {
|
|
113
|
+
if (e.getObserversCount() === 0) continue;
|
|
114
|
+
const o = m(e);
|
|
115
|
+
if (!(o != null && o.staleOnly && !e.state.dataUpdatedAt))
|
|
116
|
+
for (const c of Se(o)) t.add(c);
|
|
112
117
|
}
|
|
113
|
-
for (const
|
|
114
|
-
|
|
115
|
-
|
|
118
|
+
for (const e of t) {
|
|
119
|
+
const o = M.get(e);
|
|
120
|
+
o && (clearTimeout(o), M.delete(e)), h.has(e) || h.set(e, s.subscribeCollections([e], fe));
|
|
121
|
+
}
|
|
122
|
+
for (const e of h.keys())
|
|
123
|
+
t.has(e) || M.has(e) || M.set(
|
|
124
|
+
e,
|
|
116
125
|
setTimeout(() => {
|
|
117
|
-
var
|
|
118
|
-
|
|
119
|
-
},
|
|
126
|
+
var o;
|
|
127
|
+
M.delete(e), (o = h.get(e)) == null || o(), h.delete(e);
|
|
128
|
+
}, L)
|
|
120
129
|
);
|
|
121
130
|
};
|
|
122
|
-
let
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
131
|
+
let G = !1;
|
|
132
|
+
const W = () => {
|
|
133
|
+
G || (G = !0, queueMicrotask(() => {
|
|
134
|
+
G = !1, U();
|
|
126
135
|
}));
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
+
}, z = /* @__PURE__ */ new WeakSet(), de = k.subscribe((t) => {
|
|
137
|
+
var e, o;
|
|
138
|
+
if (t.type === "added" || t.type === "removed" || t.type === "observerAdded" || t.type === "observerRemoved" || t.type === "observerOptionsUpdated")
|
|
139
|
+
W();
|
|
140
|
+
else if (t.type === "updated" && ((e = t.action) == null ? void 0 : e.type) === "success") {
|
|
141
|
+
const c = t.query;
|
|
142
|
+
(o = m(c)) != null && o.staleOnly && !z.has(c) && (z.add(c), W());
|
|
143
|
+
}
|
|
144
|
+
}), D = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Set(), H = (t, e) => {
|
|
145
|
+
if (t.length === 0) return;
|
|
146
|
+
const o = new Set(t), c = a();
|
|
147
|
+
for (const l of t) D.set(l, c);
|
|
148
|
+
R.refetches += t.filter((l) => l.getObserversCount() > 0).length, n.invalidateQueries(
|
|
149
|
+
{ predicate: (l) => o.has(l) },
|
|
150
|
+
{ cancelRefetch: e }
|
|
136
151
|
);
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
152
|
+
}, N = (t, e = !0) => {
|
|
153
|
+
var ee, te, ne;
|
|
154
|
+
const o = [], c = [];
|
|
155
|
+
for (const r of t)
|
|
156
|
+
r.getObserversCount() === 0 || (ee = m(r)) != null && ee.staleOnly ? c.push(r) : u != null && u.hidden ? (c.push(r), _.add(r)) : o.push(r);
|
|
157
|
+
if (c.length) {
|
|
158
|
+
const r = new Set(c);
|
|
159
|
+
R.deferred += c.length, n.invalidateQueries({ predicate: (d) => r.has(d), refetchType: "none" });
|
|
144
160
|
}
|
|
145
|
-
const
|
|
146
|
-
for (const
|
|
147
|
-
const
|
|
148
|
-
if (
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
} else
|
|
152
|
-
|
|
161
|
+
const l = a(), y = [];
|
|
162
|
+
for (const r of o) {
|
|
163
|
+
const d = m(r), S = (d == null ? void 0 : d.minGapMs) ?? (d != null && d.record ? 0 : v), se = D.get(r) ?? 0;
|
|
164
|
+
if (S <= 0 || l - se >= S) {
|
|
165
|
+
const oe = b.get(r);
|
|
166
|
+
oe && (clearTimeout(oe), b.delete(r)), y.push(r);
|
|
167
|
+
} else b.has(r) || b.set(
|
|
168
|
+
r,
|
|
153
169
|
setTimeout(
|
|
154
170
|
() => {
|
|
155
|
-
|
|
171
|
+
b.delete(r), g || N([r]);
|
|
156
172
|
},
|
|
157
|
-
|
|
173
|
+
se + S - l
|
|
158
174
|
)
|
|
159
175
|
);
|
|
160
176
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
177
|
+
const Z = [];
|
|
178
|
+
for (const r of y) {
|
|
179
|
+
const d = ((te = m(r)) == null ? void 0 : te.jitterMs) ?? 0, S = ((ne = m(r)) == null ? void 0 : ne.delayMs) ?? 0;
|
|
180
|
+
if (d <= 0 && S <= 0) {
|
|
181
|
+
Z.push(r);
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
I.has(r) || (D.set(r, l), I.set(
|
|
185
|
+
r,
|
|
186
|
+
setTimeout(
|
|
187
|
+
() => {
|
|
188
|
+
I.delete(r), g || H([r], e);
|
|
189
|
+
},
|
|
190
|
+
S + Math.floor(E() * Math.max(0, d))
|
|
191
|
+
)
|
|
192
|
+
));
|
|
193
|
+
}
|
|
194
|
+
H(Z, e);
|
|
195
|
+
}, ae = (t) => {
|
|
196
|
+
j.delete(t);
|
|
197
|
+
const e = A.get(t) ?? [];
|
|
198
|
+
if (A.delete(t), g || e.length === 0) return;
|
|
199
|
+
const o = [];
|
|
200
|
+
for (const c of k.getAll()) {
|
|
201
|
+
const l = m(c);
|
|
202
|
+
l && Ce(l, t, e) && o.push(c);
|
|
203
|
+
}
|
|
204
|
+
N(o);
|
|
205
|
+
}, ve = new Set(Oe), B = (t) => {
|
|
206
|
+
if (g || me() === "off") return;
|
|
207
|
+
R.reconciles++;
|
|
208
|
+
const e = [], o = /* @__PURE__ */ new Set();
|
|
209
|
+
for (const l of k.getAll()) {
|
|
210
|
+
const y = m(l);
|
|
211
|
+
y != null && y.staleOnly ? o.add(l) : y && e.push(l);
|
|
170
212
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
I(r) && n.push(r);
|
|
178
|
-
k.clear();
|
|
179
|
-
const i = new Set(n);
|
|
180
|
-
t.invalidateQueries(
|
|
213
|
+
_.clear(), o.size > 0 && n.invalidateQueries({
|
|
214
|
+
predicate: (l) => o.has(l),
|
|
215
|
+
refetchType: "none"
|
|
216
|
+
});
|
|
217
|
+
const c = new Set(e);
|
|
218
|
+
n.invalidateQueries(
|
|
181
219
|
{
|
|
182
|
-
predicate: (
|
|
220
|
+
predicate: (l) => c.has(l) || l.getObserversCount() > 0 && ve.has(String(l.queryKey[0]))
|
|
183
221
|
},
|
|
184
222
|
{ cancelRefetch: !1 }
|
|
185
223
|
);
|
|
186
224
|
};
|
|
187
|
-
let
|
|
188
|
-
const
|
|
189
|
-
|
|
225
|
+
let T = null;
|
|
226
|
+
const K = (t) => {
|
|
227
|
+
T || (T = setTimeout(
|
|
190
228
|
() => {
|
|
191
|
-
|
|
229
|
+
T = null, B();
|
|
192
230
|
},
|
|
193
|
-
Math.floor(
|
|
231
|
+
Math.floor(E() * Q)
|
|
194
232
|
));
|
|
195
233
|
};
|
|
196
|
-
let
|
|
197
|
-
const
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
}),
|
|
201
|
-
|
|
202
|
-
let
|
|
203
|
-
const
|
|
204
|
-
if (!
|
|
205
|
-
if (
|
|
206
|
-
|
|
234
|
+
let P = (($ = s.status) == null ? void 0 : $.call(s).state) !== "reconnecting";
|
|
235
|
+
const F = (J = s.onStatus) == null ? void 0 : J.call(s, (t) => {
|
|
236
|
+
const e = t.state === "live";
|
|
237
|
+
e && !P && (t.resumed === "unverified" || t.resumed === void 0) && K(), P = e;
|
|
238
|
+
}), X = () => K(), O = i.reconcileOnCatchupFull === !1 ? null : w;
|
|
239
|
+
O == null || O.addEventListener("nvr:catchup-full", X);
|
|
240
|
+
let q = u != null && u.hidden ? a() : null;
|
|
241
|
+
const Y = () => {
|
|
242
|
+
if (!u) return;
|
|
243
|
+
if (u.hidden) {
|
|
244
|
+
q ?? (q = a());
|
|
207
245
|
return;
|
|
208
246
|
}
|
|
209
|
-
const
|
|
210
|
-
if (
|
|
211
|
-
|
|
247
|
+
const t = q == null ? 0 : a() - q;
|
|
248
|
+
if (q = null, t >= C) {
|
|
249
|
+
B();
|
|
212
250
|
return;
|
|
213
251
|
}
|
|
214
|
-
const
|
|
215
|
-
|
|
252
|
+
const e = [..._].filter((o) => o.getObserversCount() > 0);
|
|
253
|
+
_.clear(), N(e, !1);
|
|
216
254
|
};
|
|
217
|
-
return
|
|
218
|
-
reconcile:
|
|
219
|
-
collections: () => [...
|
|
220
|
-
stats: () => ({ ...
|
|
255
|
+
return u == null || u.addEventListener("visibilitychange", Y), re(n, 1), U(), {
|
|
256
|
+
reconcile: B,
|
|
257
|
+
collections: () => [...h.keys()],
|
|
258
|
+
stats: () => ({ ...R }),
|
|
221
259
|
dispose() {
|
|
222
|
-
if (!
|
|
223
|
-
|
|
224
|
-
for (const
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
260
|
+
if (!g) {
|
|
261
|
+
g = !0, de(), F == null || F(), O == null || O.removeEventListener("nvr:catchup-full", X), u == null || u.removeEventListener("visibilitychange", Y);
|
|
262
|
+
for (const t of [
|
|
263
|
+
...j.values(),
|
|
264
|
+
...M.values(),
|
|
265
|
+
...b.values(),
|
|
266
|
+
...I.values()
|
|
267
|
+
])
|
|
268
|
+
clearTimeout(t);
|
|
269
|
+
T && clearTimeout(T);
|
|
270
|
+
for (const t of h.values()) t();
|
|
271
|
+
h.clear(), re(n, -1);
|
|
229
272
|
}
|
|
230
273
|
}
|
|
231
274
|
};
|
|
232
275
|
}
|
|
233
|
-
function
|
|
234
|
-
const s =
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
276
|
+
function Ge(n) {
|
|
277
|
+
const s = ce(), i = le(), f = pe(n);
|
|
278
|
+
ie(() => {
|
|
279
|
+
be(s);
|
|
280
|
+
}, [s]), ie(() => {
|
|
281
|
+
if (!i) return;
|
|
282
|
+
const v = Ee(s, i, f.current);
|
|
283
|
+
return () => v.dispose();
|
|
284
|
+
}, [s, i]);
|
|
240
285
|
}
|
|
241
|
-
function
|
|
242
|
-
const
|
|
243
|
-
return
|
|
244
|
-
(s) => (
|
|
245
|
-
|
|
286
|
+
function Re() {
|
|
287
|
+
const n = ce();
|
|
288
|
+
return he(
|
|
289
|
+
(s) => (V.add(s), () => {
|
|
290
|
+
V.delete(s);
|
|
246
291
|
}),
|
|
247
|
-
() =>
|
|
292
|
+
() => x.has(n),
|
|
248
293
|
() => !1
|
|
249
294
|
);
|
|
250
295
|
}
|
|
251
|
-
function
|
|
252
|
-
const
|
|
253
|
-
return
|
|
296
|
+
function De(n, s = {}) {
|
|
297
|
+
const i = le(), f = Me(), v = Re(), C = s.enabled !== !1 && !!i && (f == null ? void 0 : f.state) !== "reconnecting" && (!s.requireBridge || v);
|
|
298
|
+
return Te(C, n, s.safetyMs);
|
|
254
299
|
}
|
|
255
|
-
function
|
|
256
|
-
return !
|
|
300
|
+
function Te(n, s, i = we) {
|
|
301
|
+
return !n || s == null || s === !1 ? s : Math.max(s, i);
|
|
257
302
|
}
|
|
258
303
|
export {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
304
|
+
Oe as LIVE_RECONCILE_HEADS,
|
|
305
|
+
Ee as createLiveQueryBridge,
|
|
306
|
+
Se as liveCollectionsOf,
|
|
307
|
+
Ce as liveEventsMatch,
|
|
308
|
+
xe as liveQueryMeta,
|
|
309
|
+
Te as liveRefetchInterval,
|
|
310
|
+
Re as useLiveQueriesOn,
|
|
311
|
+
Ge as useLiveQueryBridge,
|
|
312
|
+
De as useLiveRefetchInterval
|
|
268
313
|
};
|