@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,48 +1,159 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
const
|
|
3
|
-
let
|
|
4
|
-
function
|
|
5
|
-
return
|
|
1
|
+
import { useRef as x, useEffect as w } from "react";
|
|
2
|
+
const B = /^\(\d+\+?\) /, u = /* @__PURE__ */ new Map();
|
|
3
|
+
let c = null, g = [], l = null, M = 0, m = "";
|
|
4
|
+
function E(t) {
|
|
5
|
+
return t > 0 ? `(${t > 99 ? "99+" : Math.floor(t)}) ` : "";
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
|
|
7
|
+
function R(t, n, e, i = []) {
|
|
8
|
+
const o = [...new Set([e, ...i].filter((f) => !!f))];
|
|
9
|
+
let r = t;
|
|
10
|
+
for (let f = 0; f < 8; f++) {
|
|
11
|
+
const s = r;
|
|
12
|
+
r = r.replace(B, "");
|
|
13
|
+
for (const a of o) r.startsWith(`${a} · `) && (r = r.slice(a.length + 3));
|
|
14
|
+
if (r === s) break;
|
|
15
|
+
}
|
|
16
|
+
return E(n) + (e ? `${e} · ` : "") + r;
|
|
17
|
+
}
|
|
18
|
+
function $(t) {
|
|
19
|
+
return t > 0 ? t > 9 ? "9+" : String(Math.floor(t)) : "";
|
|
20
|
+
}
|
|
21
|
+
function q(t, n) {
|
|
22
|
+
const e = t.length > 1, i = Math.round(n * (e ? 0.33 : 0.28));
|
|
23
|
+
return {
|
|
24
|
+
cx: n - i,
|
|
25
|
+
cy: i,
|
|
26
|
+
r: i,
|
|
27
|
+
ring: Math.max(1, Math.round(n * 0.05)),
|
|
28
|
+
font: Math.round(n * (e ? 0.34 : 0.44))
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function T() {
|
|
32
|
+
let t = 0;
|
|
33
|
+
for (const n of u.values()) t = Math.max(t, n.count);
|
|
34
|
+
return t;
|
|
35
|
+
}
|
|
36
|
+
function L() {
|
|
37
|
+
for (const t of u.values()) if (t.favicon && t.count > 0) return !0;
|
|
38
|
+
return !1;
|
|
39
|
+
}
|
|
40
|
+
function k() {
|
|
41
|
+
const t = R(document.title, T(), c, g);
|
|
42
|
+
g = [], document.title !== t && (document.title = t);
|
|
43
|
+
}
|
|
44
|
+
function S() {
|
|
45
|
+
return u.size > 0 || !!c;
|
|
9
46
|
}
|
|
10
47
|
function p() {
|
|
11
|
-
|
|
12
|
-
for (const r of t.values()) e = Math.max(e, r);
|
|
13
|
-
return e;
|
|
48
|
+
return [...document.querySelectorAll('link[rel~="icon"]')];
|
|
14
49
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
50
|
+
function A(t) {
|
|
51
|
+
var n;
|
|
52
|
+
for (const e of t)
|
|
53
|
+
if (e.href && e.href !== m) return e.href;
|
|
54
|
+
return ((n = t.find((e) => e.dataset.nvrIcon)) == null ? void 0 : n.dataset.nvrIcon) ?? "";
|
|
18
55
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
56
|
+
function O() {
|
|
57
|
+
M++;
|
|
58
|
+
for (const t of p())
|
|
59
|
+
t.dataset.nvrIcon !== void 0 && (t.dataset.nvrIcon && (t.href = t.dataset.nvrIcon), delete t.dataset.nvrIcon);
|
|
60
|
+
m = "";
|
|
23
61
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
62
|
+
function I(t, n, e) {
|
|
63
|
+
const i = $(e), o = q(i, n);
|
|
64
|
+
t.beginPath(), t.arc(o.cx, o.cy, o.r + o.ring, 0, Math.PI * 2), t.fillStyle = "#ffffff", t.fill(), t.beginPath(), t.arc(o.cx, o.cy, o.r, 0, Math.PI * 2), t.fillStyle = "#dc2626", t.fill(), t.fillStyle = "#ffffff", t.font = `bold ${o.font}px system-ui, -apple-system, sans-serif`, t.textAlign = "center", t.textBaseline = "middle", t.fillText(i, o.cx, o.cy + n * 0.02);
|
|
26
65
|
}
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
|
|
66
|
+
function P() {
|
|
67
|
+
const t = p();
|
|
68
|
+
if (t.length === 0) return;
|
|
69
|
+
if (!L()) {
|
|
70
|
+
O();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const n = A(t);
|
|
74
|
+
for (const h of t) h.dataset.nvrIcon === void 0 && (h.dataset.nvrIcon = n);
|
|
75
|
+
const e = T(), i = ++M, o = (h) => {
|
|
76
|
+
if (i !== M) return;
|
|
77
|
+
let y = "";
|
|
78
|
+
try {
|
|
79
|
+
y = h.toDataURL("image/png");
|
|
80
|
+
} catch {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
m = y;
|
|
84
|
+
for (const b of p())
|
|
85
|
+
b.dataset.nvrIcon === void 0 && (b.dataset.nvrIcon = n), b.href = y;
|
|
86
|
+
}, r = 64, f = document.createElement("canvas");
|
|
87
|
+
f.width = r, f.height = r;
|
|
88
|
+
let s = null;
|
|
89
|
+
try {
|
|
90
|
+
s = f.getContext("2d");
|
|
91
|
+
} catch {
|
|
92
|
+
s = null;
|
|
93
|
+
}
|
|
94
|
+
if (!s) return;
|
|
95
|
+
const a = s, v = new Image();
|
|
96
|
+
if (v.onload = () => {
|
|
97
|
+
a.drawImage(v, 0, 0, r, r), I(a, r, e), o(f);
|
|
98
|
+
}, v.onerror = () => {
|
|
99
|
+
I(a, r, e), o(f);
|
|
100
|
+
}, !n) {
|
|
101
|
+
I(a, r, e), o(f);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
v.src = n;
|
|
105
|
+
}
|
|
106
|
+
function F() {
|
|
107
|
+
l || typeof MutationObserver > "u" || (l = new MutationObserver((t) => {
|
|
108
|
+
if (!S()) return;
|
|
109
|
+
if (k(), t.some(
|
|
110
|
+
(e) => e.type === "attributes" && e.target instanceof HTMLLinkElement && e.target.href !== m && e.target.rel.includes("icon")
|
|
111
|
+
) && L()) {
|
|
112
|
+
for (const e of p()) delete e.dataset.nvrIcon;
|
|
113
|
+
P();
|
|
114
|
+
}
|
|
115
|
+
}), l.observe(document.head, {
|
|
116
|
+
subtree: !0,
|
|
117
|
+
childList: !0,
|
|
118
|
+
characterData: !0,
|
|
119
|
+
attributes: !0,
|
|
120
|
+
attributeFilter: ["href"]
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
123
|
+
function d() {
|
|
124
|
+
k(), P(), !S() && l && (l.disconnect(), l = null);
|
|
125
|
+
}
|
|
126
|
+
function D(t, n = {}) {
|
|
127
|
+
const e = x(Symbol("tab-attention")), i = n.enabled ?? !0, o = n.favicon === !0;
|
|
128
|
+
w(() => {
|
|
30
129
|
if (typeof document > "u") return;
|
|
31
|
-
const
|
|
32
|
-
if (!
|
|
33
|
-
|
|
130
|
+
const r = e.current;
|
|
131
|
+
if (!i) {
|
|
132
|
+
u.delete(r) && d();
|
|
34
133
|
return;
|
|
35
134
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
135
|
+
const f = u.get(r);
|
|
136
|
+
f && f.count === t && f.favicon === o || (u.set(r, { count: t, favicon: o }), F(), d());
|
|
137
|
+
}, [t, i, o]), w(() => {
|
|
138
|
+
const r = e.current;
|
|
39
139
|
return () => {
|
|
40
|
-
|
|
140
|
+
u.delete(r) && d();
|
|
41
141
|
};
|
|
42
142
|
}, []);
|
|
43
143
|
}
|
|
144
|
+
function H(t) {
|
|
145
|
+
w(() => {
|
|
146
|
+
if (!(typeof document > "u" || !t))
|
|
147
|
+
return c && c !== t && g.push(c), c = t, F(), d(), () => {
|
|
148
|
+
c === t && (c = null, g.push(t), d());
|
|
149
|
+
};
|
|
150
|
+
}, [t]);
|
|
151
|
+
}
|
|
44
152
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
153
|
+
R as composeTabTitle,
|
|
154
|
+
q as faviconBadgeLayout,
|
|
155
|
+
$ as faviconBadgeText,
|
|
156
|
+
E as tabTitlePrefix,
|
|
157
|
+
D as useTabAttention,
|
|
158
|
+
H as useTabTitleLabel
|
|
48
159
|
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useQuery as y } from "@tanstack/react-query";
|
|
2
|
+
import { useState as d, useRef as p, useEffect as u, useCallback as b } from "react";
|
|
3
|
+
import { useOptionalNivaroClient as S } from "../context.js";
|
|
4
|
+
import { get as _, patch as g } from "./commands.js";
|
|
5
|
+
import { userSyncScoped as s, announceLocalPrefs as v } from "./user-sync.js";
|
|
6
|
+
const a = "nvr_table_density", h = 5e3;
|
|
7
|
+
function l() {
|
|
8
|
+
try {
|
|
9
|
+
return localStorage.getItem(a) === "comfortable" ? "comfortable" : "compact";
|
|
10
|
+
} catch {
|
|
11
|
+
return "compact";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function E(t) {
|
|
15
|
+
const r = t == null ? void 0 : t.table_density;
|
|
16
|
+
return r === "compact" || r === "comfortable" ? r : null;
|
|
17
|
+
}
|
|
18
|
+
function A() {
|
|
19
|
+
const t = S(), [r, c] = d(l), i = p(0);
|
|
20
|
+
u(() => {
|
|
21
|
+
const e = (o) => {
|
|
22
|
+
o.key === a && c(l());
|
|
23
|
+
};
|
|
24
|
+
return window.addEventListener("storage", e), () => window.removeEventListener("storage", e);
|
|
25
|
+
}, []);
|
|
26
|
+
const { data: m } = y({
|
|
27
|
+
queryKey: ["nvr-profile-prefs"],
|
|
28
|
+
queryFn: () => t.request(_("/users/me")).then((e) => {
|
|
29
|
+
var o;
|
|
30
|
+
return ((o = e.data) == null ? void 0 : o.preferences) ?? {};
|
|
31
|
+
}),
|
|
32
|
+
enabled: !!t,
|
|
33
|
+
staleTime: 6e4,
|
|
34
|
+
retry: !1
|
|
35
|
+
}), n = E(m);
|
|
36
|
+
u(() => {
|
|
37
|
+
if (!(!n || s()) && !(Date.now() - i.current < h)) {
|
|
38
|
+
c((e) => e === n ? e : n);
|
|
39
|
+
try {
|
|
40
|
+
localStorage.setItem(a, n);
|
|
41
|
+
} catch {
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}, [n]);
|
|
45
|
+
const f = b(
|
|
46
|
+
(e) => {
|
|
47
|
+
if (i.current = Date.now(), c(e), !s())
|
|
48
|
+
try {
|
|
49
|
+
localStorage.setItem(a, e);
|
|
50
|
+
} catch {
|
|
51
|
+
}
|
|
52
|
+
!t || s() || t.request(g("/users/me/preferences", { table_density: e })).then(() => v(["table_density"])).catch(() => {
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
[t]
|
|
56
|
+
);
|
|
57
|
+
return [r, f];
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
a as TABLE_DENSITY_KEY,
|
|
61
|
+
E as densityFromPrefs,
|
|
62
|
+
l as readLocalDensity,
|
|
63
|
+
A as useTableDensity
|
|
64
|
+
};
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
3
|
-
if (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
for (const t of f) {
|
|
8
|
-
const n = c(t);
|
|
9
|
-
if (s.length > 0 && o + n > r) break;
|
|
10
|
-
s.push(t), o += n;
|
|
11
|
-
}
|
|
1
|
+
const d = 0.6;
|
|
2
|
+
function N(s, r, f, k, o, n = {}) {
|
|
3
|
+
if (n.compact) return { left: s.slice(0, 1), right: [] };
|
|
4
|
+
if (o <= 0) return { left: s, right: r };
|
|
5
|
+
const u = o * 0.6;
|
|
6
|
+
let c = k;
|
|
12
7
|
const i = [];
|
|
13
|
-
for (
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
i.
|
|
8
|
+
for (const t of s) {
|
|
9
|
+
const e = f(t);
|
|
10
|
+
if (i.length > 0 && c + e > u) break;
|
|
11
|
+
i.push(t), c += e;
|
|
12
|
+
}
|
|
13
|
+
const I = n.rightShare != null ? o * n.rightShare : Number.POSITIVE_INFINITY, l = n.rank, a = l ? r.map((t, e) => ({ key: t, i: e, r: l(t) })).sort((t, e) => t.r - e.r || t.i - e.i).map((t) => t.key) : r, h = /* @__PURE__ */ new Set();
|
|
14
|
+
let g = 0;
|
|
15
|
+
for (let t = a.length - 1; t >= 0; t--) {
|
|
16
|
+
const e = f(a[t]);
|
|
17
|
+
if (c + e > u || g + e > I) break;
|
|
18
|
+
h.add(a[t]), c += e, g += e;
|
|
17
19
|
}
|
|
18
|
-
return { left:
|
|
20
|
+
return { left: i, right: r.filter((t) => h.has(t)) };
|
|
19
21
|
}
|
|
20
22
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
d as PIN_BUDGET,
|
|
24
|
+
N as fitPins
|
|
23
25
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useRef as a, useState as p, useEffect as v } from "react";
|
|
2
|
+
import { liveMotionAllowed as M } from "./live-preference.js";
|
|
3
|
+
import { isOwnWrite as d } from "./own-writes.js";
|
|
4
|
+
const m = 840, w = 240, c = (n) => String(n ?? "").toUpperCase();
|
|
5
|
+
function R(n, o) {
|
|
6
|
+
if (!o) return null;
|
|
7
|
+
const t = n.map(c), r = t.indexOf(c(o.from)), e = t.indexOf(c(o.to));
|
|
8
|
+
if (r < 0 || e < 0 || r === e) return null;
|
|
9
|
+
const f = e < r, s = Math.abs(e - r), u = Math.max(90, Math.min(w, Math.floor(m / s))), l = /* @__PURE__ */ new Map();
|
|
10
|
+
for (let i = 0; i < s; i++) {
|
|
11
|
+
const T = f ? r - 1 - i : r + i;
|
|
12
|
+
l.set(T, i * u);
|
|
13
|
+
}
|
|
14
|
+
return { seg: u, segments: l, backward: f, arriveIndex: e, arriveDelay: s * u };
|
|
15
|
+
}
|
|
16
|
+
function A(n, o, t) {
|
|
17
|
+
return !n || !o || c(n) === c(o) ? !1 : !t.own && t.motion;
|
|
18
|
+
}
|
|
19
|
+
function E(n, o, t) {
|
|
20
|
+
const r = a(void 0), e = a(0), [f, s] = p(null);
|
|
21
|
+
return v(() => {
|
|
22
|
+
const u = r.current;
|
|
23
|
+
if (r.current = t ?? null, u === void 0) return;
|
|
24
|
+
const l = !!n && d(n, o, ["$state"]);
|
|
25
|
+
if (!A(u, t, { own: l, motion: M() })) {
|
|
26
|
+
s(null);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
e.current += 1, s({ from: u, to: t, n: e.current });
|
|
30
|
+
const i = setTimeout(() => s(null), m + 600);
|
|
31
|
+
return () => clearTimeout(i);
|
|
32
|
+
}, [t, n, o]), f;
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
w as TRACK_TRAVEL_SEG_MS,
|
|
36
|
+
m as TRACK_TRAVEL_TOTAL_MS,
|
|
37
|
+
A as shouldTravel,
|
|
38
|
+
R as travelPlan,
|
|
39
|
+
E as useTrackTravel
|
|
40
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var f = Object.defineProperty;
|
|
2
|
+
var l = (e, s, t) => s in e ? f(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
|
|
3
|
+
var o = (e, s, t) => l(e, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
+
import { serverClockOffset as u } from "./server-clock.js";
|
|
5
|
+
const h = 1e3;
|
|
6
|
+
function a(e, s, t) {
|
|
7
|
+
if (!Array.isArray(e) || e.length < 3) return null;
|
|
8
|
+
const r = e[0];
|
|
9
|
+
return (r === "item" || r === "rrv-record") && e[1] === s ? String(e[2]) === t ? "field" : null : r === "o2m-rows" && typeof e[1] == "string" && String(e[3]) === t ? `lines:${e[1]}` : r === "m2m-items" && typeof e[1] == "string" && String(e[3]) === t ? `files:${e[1]}` : null;
|
|
10
|
+
}
|
|
11
|
+
function p(e, s, t = h) {
|
|
12
|
+
return e.filter((r) => {
|
|
13
|
+
const i = Date.parse(r.at);
|
|
14
|
+
return Number.isFinite(i) ? !s.some((n) => n.scope === r.scope && n.at >= i - t) : !0;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const c = (e) => e + u();
|
|
18
|
+
class g {
|
|
19
|
+
constructor(s, t) {
|
|
20
|
+
o(this, "starts", /* @__PURE__ */ new Map());
|
|
21
|
+
o(this, "marks", []);
|
|
22
|
+
o(this, "first", null);
|
|
23
|
+
this.collection = s, this.itemId = t;
|
|
24
|
+
}
|
|
25
|
+
seed(s) {
|
|
26
|
+
for (const t of s) {
|
|
27
|
+
const r = a(t.queryKey, this.collection, this.itemId);
|
|
28
|
+
!r || !t.dataUpdatedAt || this.mark(r, c(t.dataUpdatedAt) - 1e3);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/** A read of `hash` started (client ms). */
|
|
32
|
+
started(s, t = Date.now()) {
|
|
33
|
+
this.starts.set(s, c(t));
|
|
34
|
+
}
|
|
35
|
+
/** A read of `hash` (for `queryKey`) finished well. */
|
|
36
|
+
succeeded(s, t, r = Date.now()) {
|
|
37
|
+
const i = a(t, this.collection, this.itemId), n = this.starts.get(s) ?? c(r) - 1e3;
|
|
38
|
+
this.starts.delete(s), i && this.mark(i, n);
|
|
39
|
+
}
|
|
40
|
+
mark(s, t) {
|
|
41
|
+
(this.first == null || t < this.first) && (this.first = t), this.marks.push({ scope: s, at: t });
|
|
42
|
+
const r = /* @__PURE__ */ new Map();
|
|
43
|
+
for (const i of this.marks) {
|
|
44
|
+
const n = r.get(i.scope);
|
|
45
|
+
(!n || i.at > n.at) && r.set(i.scope, i);
|
|
46
|
+
}
|
|
47
|
+
this.marks = [...r.values()];
|
|
48
|
+
}
|
|
49
|
+
/** When the page first read the record (server ms), or null before any read. */
|
|
50
|
+
since() {
|
|
51
|
+
return this.first;
|
|
52
|
+
}
|
|
53
|
+
/** The newest read of the record's own fields (server ms). */
|
|
54
|
+
fieldsSince() {
|
|
55
|
+
var s;
|
|
56
|
+
return ((s = this.marks.find((t) => t.scope === "field")) == null ? void 0 : s.at) ?? null;
|
|
57
|
+
}
|
|
58
|
+
all() {
|
|
59
|
+
return [...this.marks];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
h as SEEN_SKEW_MS,
|
|
64
|
+
g as SeenLog,
|
|
65
|
+
p as filterUnseen,
|
|
66
|
+
a as scopeOfQueryKey,
|
|
67
|
+
c as toServerTime
|
|
68
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
function p(o, n) {
|
|
2
|
+
if (o === 413) return "That file is too large to upload.";
|
|
3
|
+
try {
|
|
4
|
+
const t = JSON.parse(n).error;
|
|
5
|
+
if (typeof t == "string" && t && !/^(\d{3}\b|[A-Z_]{4,}$)/.test(t)) return t;
|
|
6
|
+
} catch {
|
|
7
|
+
}
|
|
8
|
+
return "Upload failed";
|
|
9
|
+
}
|
|
10
|
+
function d() {
|
|
11
|
+
return typeof window > "u" ? !1 : window.__nvrViewAsFetch === !0;
|
|
12
|
+
}
|
|
13
|
+
function c(o, n, t) {
|
|
14
|
+
const e = new AbortController(), i = new FormData();
|
|
15
|
+
i.append("file", n), fetch(`${o.apiBase}/files/upload`, {
|
|
16
|
+
method: "POST",
|
|
17
|
+
headers: o.authHeaders,
|
|
18
|
+
credentials: o.credentials,
|
|
19
|
+
body: i,
|
|
20
|
+
signal: e.signal
|
|
21
|
+
}).then(async (a) => {
|
|
22
|
+
var u;
|
|
23
|
+
const s = await a.text().catch(() => "");
|
|
24
|
+
if (!a.ok) return t.onError(p(a.status, s));
|
|
25
|
+
try {
|
|
26
|
+
(u = t.onProgress) == null || u.call(t, 1), t.onDone(JSON.parse(s).data.id);
|
|
27
|
+
} catch {
|
|
28
|
+
t.onError("Upload failed");
|
|
29
|
+
}
|
|
30
|
+
}).catch(() => {
|
|
31
|
+
e.signal.aborted || t.onError("Upload failed");
|
|
32
|
+
});
|
|
33
|
+
const r = () => e.abort();
|
|
34
|
+
return { xhr: { abort: r }, abort: r };
|
|
35
|
+
}
|
|
36
|
+
function f(o, n, t) {
|
|
37
|
+
if (d() || typeof XMLHttpRequest > "u")
|
|
38
|
+
return c(o, n, t);
|
|
39
|
+
const e = new XMLHttpRequest();
|
|
40
|
+
e.upload.onprogress = (r) => {
|
|
41
|
+
var a;
|
|
42
|
+
r.lengthComputable && ((a = t.onProgress) == null || a.call(t, r.loaded / r.total));
|
|
43
|
+
}, e.onload = () => {
|
|
44
|
+
if (e.status >= 200 && e.status < 300)
|
|
45
|
+
try {
|
|
46
|
+
t.onDone(JSON.parse(e.responseText).data.id);
|
|
47
|
+
} catch {
|
|
48
|
+
t.onError("Upload failed");
|
|
49
|
+
}
|
|
50
|
+
else
|
|
51
|
+
t.onError(p(e.status, e.responseText));
|
|
52
|
+
}, e.onerror = () => t.onError("Upload failed"), e.open("POST", `${o.apiBase}/files/upload`);
|
|
53
|
+
for (const [r, a] of Object.entries(o.authHeaders)) e.setRequestHeader(r, a);
|
|
54
|
+
e.withCredentials = o.credentials === "include";
|
|
55
|
+
const i = new FormData();
|
|
56
|
+
return i.append("file", n), e.send(i), { xhr: e, abort: () => e.abort() };
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
f as startFileUpload,
|
|
60
|
+
p as uploadFailureMessage,
|
|
61
|
+
d as viewAsFetchActive
|
|
62
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { useEffect as U, useSyncExternalStore as v } from "react";
|
|
2
|
+
import { startFileUpload as b, viewAsFetchActive as M } from "./upload-file.js";
|
|
3
|
+
const R = "nvr:upload-state", _ = 500, k = 3e4;
|
|
4
|
+
let g = 0;
|
|
5
|
+
function A() {
|
|
6
|
+
return g = (g + 1) % 1e6, `u${Date.now().toString(36)}${g.toString(36)}${Math.random().toString(36).slice(2, 6)}`;
|
|
7
|
+
}
|
|
8
|
+
function h(e) {
|
|
9
|
+
if (typeof window > "u") return;
|
|
10
|
+
const t = {
|
|
11
|
+
...e,
|
|
12
|
+
state: e.phase === "done" || e.phase === "cancel" ? "done" : "start"
|
|
13
|
+
};
|
|
14
|
+
window.dispatchEvent(new CustomEvent(R, { detail: t }));
|
|
15
|
+
}
|
|
16
|
+
function D() {
|
|
17
|
+
return typeof window > "u" || typeof XMLHttpRequest > "u" ? !1 : !M();
|
|
18
|
+
}
|
|
19
|
+
function x(e, t) {
|
|
20
|
+
const r = {
|
|
21
|
+
upload: A(),
|
|
22
|
+
name: e.name,
|
|
23
|
+
field: t.field,
|
|
24
|
+
collection: t.collection,
|
|
25
|
+
item: t.item
|
|
26
|
+
};
|
|
27
|
+
h({ ...r, phase: "start", pct: 0 });
|
|
28
|
+
let o = 0;
|
|
29
|
+
const a = (l) => h({ ...r, phase: l, pct: null });
|
|
30
|
+
return D() ? new Promise((l, p) => {
|
|
31
|
+
b(t.cfg, e, {
|
|
32
|
+
onProgress: (i) => {
|
|
33
|
+
var w;
|
|
34
|
+
const u = Math.max(0, Math.min(100, Math.round(i * 100)));
|
|
35
|
+
(w = t.onProgress) == null || w.call(t, u);
|
|
36
|
+
const m = Date.now();
|
|
37
|
+
m - o < _ && u < 100 || (o = m, h({ ...r, phase: "progress", pct: u }));
|
|
38
|
+
},
|
|
39
|
+
onDone: (i) => {
|
|
40
|
+
a("done"), l({ id: i });
|
|
41
|
+
},
|
|
42
|
+
onError: (i) => {
|
|
43
|
+
a("cancel"), p(new Error(i));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}) : t.fallback(e).then(
|
|
47
|
+
(l) => (a("done"), l),
|
|
48
|
+
(l) => {
|
|
49
|
+
throw a("cancel"), l;
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
let s = [];
|
|
54
|
+
const c = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Set();
|
|
55
|
+
let d = null, y = { uploads: s };
|
|
56
|
+
const f = () => {
|
|
57
|
+
y = { uploads: s };
|
|
58
|
+
for (const e of S) e();
|
|
59
|
+
};
|
|
60
|
+
function P() {
|
|
61
|
+
d || typeof setInterval > "u" || (d = setInterval(() => {
|
|
62
|
+
const e = Date.now() - k, t = s.filter((n) => n.seen >= e);
|
|
63
|
+
t.length !== s.length && (s = t, f()), s.length === 0 && d && (clearInterval(d), d = null);
|
|
64
|
+
}, 5e3));
|
|
65
|
+
}
|
|
66
|
+
function L(e, t = Date.now()) {
|
|
67
|
+
if (!e || typeof e != "object") return;
|
|
68
|
+
const n = e;
|
|
69
|
+
if (n.collection == null || n.item == null) return;
|
|
70
|
+
const r = String(n.user_name ?? n.user ?? "Someone"), a = n.name_hidden === !0 ? null : String(n.name ?? "") || null, l = typeof n.upload == "string" && n.upload ? n.upload : `${r}:${a ?? ""}`, p = String(n.phase ?? (n.state === "done" ? "done" : "start")), i = s.filter((m) => m.key !== l);
|
|
71
|
+
if (p === "done" || p === "cancel") {
|
|
72
|
+
i.length !== s.length && (s = i, f());
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const u = Number.isFinite(Number(n.pct)) && n.pct !== null ? Number(n.pct) : null;
|
|
76
|
+
s = [
|
|
77
|
+
...i,
|
|
78
|
+
{
|
|
79
|
+
key: l,
|
|
80
|
+
collection: String(n.collection),
|
|
81
|
+
item: String(n.item),
|
|
82
|
+
field: typeof n.field == "string" && n.field ? n.field : null,
|
|
83
|
+
user: r,
|
|
84
|
+
name: a,
|
|
85
|
+
pct: u,
|
|
86
|
+
seen: t
|
|
87
|
+
}
|
|
88
|
+
], P(), f();
|
|
89
|
+
}
|
|
90
|
+
const F = (e) => (S.add(e), () => {
|
|
91
|
+
S.delete(e);
|
|
92
|
+
}), $ = () => y, E = (e, t, n) => `${e}\0${t}\0${n}`;
|
|
93
|
+
function T(e, t, n, r) {
|
|
94
|
+
return e.filter((o) => o.collection !== t || o.item !== String(n) ? !1 : r === void 0 ? !0 : r === "unclaimed" ? !o.field || !c.has(E(t, String(n), o.field)) : o.field === r);
|
|
95
|
+
}
|
|
96
|
+
function O(e, t, n) {
|
|
97
|
+
const { uploads: r } = v(F, $, $);
|
|
98
|
+
return !e || t == null ? [] : T(r, e, String(t), n);
|
|
99
|
+
}
|
|
100
|
+
function q(e, t, n) {
|
|
101
|
+
U(() => {
|
|
102
|
+
if (!e || t == null || !n) return;
|
|
103
|
+
const r = E(e, String(t), n);
|
|
104
|
+
return c.set(r, (c.get(r) ?? 0) + 1), f(), () => {
|
|
105
|
+
const o = (c.get(r) ?? 1) - 1;
|
|
106
|
+
o <= 0 ? c.delete(r) : c.set(r, o), f();
|
|
107
|
+
};
|
|
108
|
+
}, [e, t, n]);
|
|
109
|
+
}
|
|
110
|
+
function C(e) {
|
|
111
|
+
const t = e.name ? e.name.length > 40 ? `${e.name.slice(0, 39)}…` : e.name : null, n = t ? `“${t}”` : "a file", r = e.pct != null && e.pct > 0 && e.pct < 100 ? ` (${e.pct}%)` : "";
|
|
112
|
+
return `${e.user} is uploading ${n}${r}`;
|
|
113
|
+
}
|
|
114
|
+
export {
|
|
115
|
+
_ as PROGRESS_REPORT_MS,
|
|
116
|
+
k as STALE_MS,
|
|
117
|
+
R as UPLOAD_STATE_EVENT,
|
|
118
|
+
L as applyRemoteUpload,
|
|
119
|
+
A as newUploadId,
|
|
120
|
+
D as progressUploadAllowed,
|
|
121
|
+
T as remoteUploadsFor,
|
|
122
|
+
h as reportUploadState,
|
|
123
|
+
x as trackedUpload,
|
|
124
|
+
C as uploadSentence,
|
|
125
|
+
q as useClaimUploadField,
|
|
126
|
+
O as useRemoteUploads
|
|
127
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useRef as s } from "react";
|
|
2
|
+
import { huddleHolds as m } from "../components/chat/huddle/huddle-hold.js";
|
|
3
|
+
import { isCleanRecording as p } from "../components/help-videos/recorder/cleanRecording.js";
|
|
4
|
+
import { isDndActive as g } from "./dnd.js";
|
|
5
|
+
import { isFocusModeOn as v } from "./focus-mode.js";
|
|
6
|
+
import { useLiveEvent as h } from "./live.js";
|
|
7
|
+
import { getLiveMode as y } from "./live-preference.js";
|
|
8
|
+
import { noteUrgentChime as A } from "./notification-sound.js";
|
|
9
|
+
import { shouldPlayHere as w } from "./tab-sound.js";
|
|
10
|
+
function C(e, t) {
|
|
11
|
+
return !t.enabled || (e == null ? void 0 : e.urgent) !== !0 || e.quiet === !0 || t.liveMode === "off" || t.dnd || t.focus || t.huddle || t.recording ? !1 : t.activated;
|
|
12
|
+
}
|
|
13
|
+
function d(e) {
|
|
14
|
+
return (e == null ? void 0 : e.urgent_sound) === !0;
|
|
15
|
+
}
|
|
16
|
+
function T() {
|
|
17
|
+
try {
|
|
18
|
+
const e = navigator.userActivation;
|
|
19
|
+
return (e == null ? void 0 : e.hasBeenActive) ?? !0;
|
|
20
|
+
} catch {
|
|
21
|
+
return !1;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
let u = null;
|
|
25
|
+
function R(e = {}) {
|
|
26
|
+
if (typeof window > "u" || !e.preview && (!w() || !T())) return !1;
|
|
27
|
+
try {
|
|
28
|
+
u || (u = new AudioContext()), u.state === "suspended" && u.resume().catch(() => {
|
|
29
|
+
});
|
|
30
|
+
const t = u, a = t.currentTime, c = (o, n, l, f) => {
|
|
31
|
+
const i = t.createOscillator(), r = t.createGain();
|
|
32
|
+
i.type = "triangle", i.frequency.value = o, r.gain.setValueAtTime(1e-4, n), r.gain.exponentialRampToValueAtTime(f, n + 0.012), r.gain.exponentialRampToValueAtTime(1e-4, n + l), i.connect(r), r.connect(t.destination), i.start(n), i.stop(n + l + 0.05);
|
|
33
|
+
};
|
|
34
|
+
return c(659.25, a, 0.22, 0.07), c(987.77, a + 0.13, 0.36, 0.06), A(), !0;
|
|
35
|
+
} catch {
|
|
36
|
+
return !1;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function D(e) {
|
|
40
|
+
const t = s(e);
|
|
41
|
+
t.current = e;
|
|
42
|
+
const a = d(e);
|
|
43
|
+
h(
|
|
44
|
+
"notification:new",
|
|
45
|
+
(c) => {
|
|
46
|
+
const o = t.current;
|
|
47
|
+
C(c, {
|
|
48
|
+
enabled: d(o),
|
|
49
|
+
liveMode: y(),
|
|
50
|
+
dnd: g(o ?? null),
|
|
51
|
+
focus: v(),
|
|
52
|
+
huddle: m(o ?? null),
|
|
53
|
+
recording: p(),
|
|
54
|
+
activated: !0
|
|
55
|
+
}) && R();
|
|
56
|
+
},
|
|
57
|
+
{ enabled: a, includeOwn: !0 }
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
R as playUrgentChime,
|
|
62
|
+
C as shouldChime,
|
|
63
|
+
d as urgentSoundOn,
|
|
64
|
+
D as useUrgentChime
|
|
65
|
+
};
|