@nivaro/react 0.2.54 → 0.2.56
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +99 -98
- package/dist/index.d.ts +367 -2
- package/dist/index.js +645 -616
- package/dist/layout-editor.d.ts +4 -0
- package/dist/shared/components/BackgroundRunOffer.js +117 -0
- package/dist/shared/components/BroadcastView.js +214 -213
- package/dist/shared/components/CollectionBrowserView.js +2592 -2695
- package/dist/shared/components/ItemEditForm.js +4066 -3832
- package/dist/shared/components/JobsTray.js +100 -55
- package/dist/shared/components/MyWorkView.js +91 -89
- package/dist/shared/components/NotificationBell.js +80 -79
- package/dist/shared/components/ProfileView.js +568 -520
- package/dist/shared/components/RecordCompare.js +254 -0
- package/dist/shared/components/RecordReadView.js +599 -552
- package/dist/shared/components/ReportView.js +578 -543
- package/dist/shared/components/RowPresence.js +91 -0
- package/dist/shared/components/WidgetSlot.js +474 -458
- package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
- package/dist/shared/components/ai/AskPanel.js +139 -119
- package/dist/shared/components/ai/FirstWeekCard.js +126 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
- package/dist/shared/components/bulk/bulk-field-options.js +45 -0
- package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
- package/dist/shared/components/chat/ChannelArchive.js +326 -0
- package/dist/shared/components/chat/ChannelExtras.js +141 -121
- package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
- package/dist/shared/components/chat/ChatPanel.js +1695 -1733
- package/dist/shared/components/chat/Composer.js +357 -303
- package/dist/shared/components/chat/MessageActions.js +92 -0
- package/dist/shared/components/chat/MessageFormat.js +290 -264
- package/dist/shared/components/chat/OutboxBubbles.js +146 -0
- package/dist/shared/components/chat/RequestIdCard.js +135 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
- package/dist/shared/components/chat/RoomParts.js +213 -274
- package/dist/shared/components/chat/ScreenClip.js +184 -0
- package/dist/shared/components/chat/chat-core.js +402 -483
- package/dist/shared/components/chat/chat-drafts.js +59 -0
- package/dist/shared/components/chat/chat-emoji.js +348 -0
- package/dist/shared/components/chat/chat-local-time.js +41 -0
- package/dist/shared/components/chat/chat-outbox.js +303 -0
- package/dist/shared/components/chat/chat-window.js +163 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
- package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
- package/dist/shared/components/help-videos/api.js +76 -73
- package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
- package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
- package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
- package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
- package/dist/shared/components/item-edit/FieldRow.js +292 -279
- package/dist/shared/components/item-edit/GroupSection.js +698 -574
- package/dist/shared/components/item-edit/InlineTableField.js +3 -1
- package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
- package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
- package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
- package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
- package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
- package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
- package/dist/shared/components/item-edit/lazy-sections.js +36 -0
- package/dist/shared/components/item-edit/lock-why.js +39 -32
- package/dist/shared/components/item-edit/picker-miss.js +26 -0
- package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
- package/dist/shared/components/layout-editor/AddPanel.js +134 -117
- package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
- package/dist/shared/components/layout-editor/CollabParts.js +80 -75
- package/dist/shared/components/layout-editor/DesignNode.js +126 -120
- package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
- package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
- package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
- package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
- package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
- package/dist/shared/components/layout-editor/StagedChip.js +22 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
- package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
- package/dist/shared/components/layout-editor/dnd/node.js +69 -57
- package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
- package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
- package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
- package/dist/shared/components/layout-editor/entry/presets.js +71 -0
- package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
- package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
- package/dist/shared/components/layout-editor/grid-guides.js +142 -0
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
- package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
- package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
- package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
- package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
- package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
- package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/restore-piece.js +192 -0
- package/dist/shared/components/layout-editor/section-structure.js +241 -0
- package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
- package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
- package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
- package/dist/shared/components/layout-editor/staged-api.js +64 -0
- package/dist/shared/components/layout-editor/structure-ops.js +81 -77
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
- package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
- package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
- package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
- package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
- package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
- package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
- package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
- package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
- package/dist/shared/components/profile/AgentsPanel.js +479 -0
- package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
- package/dist/shared/components/support/SupportAnalytics.js +171 -0
- package/dist/shared/components/support/SupportView.js +75 -73
- package/dist/shared/lib/background-runs.js +150 -0
- package/dist/shared/lib/delivery-ack.js +9 -0
- package/dist/shared/lib/entry-badge-style.js +13 -0
- package/dist/shared/lib/entry-config.js +71 -0
- package/dist/shared/lib/form-sections.js +64 -0
- package/dist/shared/lib/form-structure.js +99 -0
- package/dist/shared/lib/form-usage-beacon.js +101 -52
- package/dist/shared/lib/jobs-tray.js +25 -23
- package/dist/shared/lib/keyset-pager.js +37 -0
- package/dist/shared/lib/layout-ops.js +84 -82
- package/dist/shared/lib/layout-resolve.js +113 -0
- package/dist/shared/lib/placement-behaviour.js +144 -0
- package/dist/shared/lib/prefetch.js +149 -0
- package/dist/shared/lib/presence-hooks.js +199 -0
- package/dist/shared/lib/record-outbox.js +82 -81
- package/dist/shared/lib/replay-socket.js +93 -0
- package/dist/shared/lib/request-gate.js +51 -50
- package/dist/shared/lib/room-gaps.js +96 -0
- package/dist/shared/lib/search-log.js +27 -0
- package/dist/shared/lib/socket-realtime.js +101 -80
- package/dist/shared/lib/stale-chunk.js +60 -0
- package/dist/shared/lib/worker-socket.js +200 -0
- package/package.json +1 -1
|
@@ -1,123 +1,134 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { X as
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import { cn as
|
|
8
|
-
import { formatDuration as
|
|
9
|
-
import { parseMomentUrl as
|
|
10
|
-
import { splitMessageTokens as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsx as l, Fragment as L, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as R } from "@tanstack/react-query";
|
|
3
|
+
import { X as I, PlayCircle as S, ExternalLink as U, ListChecks as M, LayoutDashboard as P, Gauge as O, Database as Z, Table2 as z, Sparkles as V } from "lucide-react";
|
|
4
|
+
import { useMemo as v, Fragment as k } from "react";
|
|
5
|
+
import { useNivaroClient as T, useNavigation as B, useApiFetchConfig as W } from "../../context.js";
|
|
6
|
+
import { get as j } from "../../lib/commands.js";
|
|
7
|
+
import { cn as g, getDisplayTimezone as K } from "../../lib/utils.js";
|
|
8
|
+
import { formatDuration as N } from "../help-videos/viewer/format.js";
|
|
9
|
+
import { parseMomentUrl as X } from "../help-videos/viewer/moments.js";
|
|
10
|
+
import { splitMessageTokens as H } from "./chat-core.js";
|
|
11
|
+
import { useEmojiUrls as G, withCustomEmoji as Q } from "./chat-emoji.js";
|
|
12
|
+
import { useLinkPreview as J } from "./chat-hooks.js";
|
|
13
|
+
import { useNearViewport as Y } from "./chat-window.js";
|
|
14
|
+
import { OpsProposalCard as ee } from "./OpsProposalCard.js";
|
|
15
|
+
import { extractRequestIds as te, RequestIdCard as re, RequestCardView as se } from "./RequestIdCard.js";
|
|
16
|
+
const E = /\bhttps?:\/\/[^\s<>()"'`]+[^\s<>()"'`.,;:!?*_~]/gi, D = /`([^`\n]+)`/g, ne = new RegExp("(\\*\\*[^*\\n]+?\\*\\*|~~[^~\\n]+?~~|(?<![\\w*])\\*(?!\\s)[^*\\n]+?(?<!\\s)\\*(?![\\w*])|(?<![\\w_])_(?!\\s)[^_\\n]+?(?<!\\s)_(?![\\w_]))", "g");
|
|
17
|
+
function F(s) {
|
|
15
18
|
if (s.startsWith("/")) return s;
|
|
16
19
|
try {
|
|
17
20
|
if (typeof window > "u") return null;
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
21
|
+
const t = new URL(s);
|
|
22
|
+
if (t.origin === window.location.origin) return `${t.pathname}${t.search}${t.hash}`;
|
|
20
23
|
} catch {
|
|
21
24
|
return null;
|
|
22
25
|
}
|
|
23
26
|
return null;
|
|
24
27
|
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
for (const
|
|
28
|
-
return
|
|
28
|
+
function ae(s) {
|
|
29
|
+
const t = [], o = s.replace(/```[\s\S]*?```/g, " ").replace(D, " ");
|
|
30
|
+
for (const e of o.matchAll(E)) t.includes(e[0]) || t.push(e[0]);
|
|
31
|
+
return t;
|
|
29
32
|
}
|
|
30
|
-
function
|
|
31
|
-
const
|
|
32
|
-
let
|
|
33
|
+
function le({ text: s, at: t, mine: o }) {
|
|
34
|
+
const e = new Date(t), i = K() ?? Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
35
|
+
let a = s, c = "";
|
|
33
36
|
try {
|
|
34
|
-
const
|
|
35
|
-
timeZone:
|
|
37
|
+
const n = /* @__PURE__ */ new Date(), r = (h) => new Intl.DateTimeFormat("en-CA", { timeZone: i, dateStyle: "short" }).format(h), d = new Date(n.getTime() + 864e5), f = new Intl.DateTimeFormat("en-US", {
|
|
38
|
+
timeZone: i,
|
|
36
39
|
hour: "numeric",
|
|
37
40
|
minute: "2-digit"
|
|
38
|
-
}).format(
|
|
39
|
-
timeZone:
|
|
41
|
+
}).format(e), p = r(e) === r(n) ? "today" : r(e) === r(d) ? "tomorrow" : new Intl.DateTimeFormat("en-US", {
|
|
42
|
+
timeZone: i,
|
|
40
43
|
weekday: "short",
|
|
41
44
|
month: "short",
|
|
42
45
|
day: "numeric"
|
|
43
|
-
}).format(
|
|
44
|
-
|
|
45
|
-
timeZone:
|
|
46
|
+
}).format(e);
|
|
47
|
+
a = `${f} ${p}`, c = new Intl.DateTimeFormat("en-US", {
|
|
48
|
+
timeZone: i,
|
|
46
49
|
weekday: "long",
|
|
47
50
|
month: "long",
|
|
48
51
|
day: "numeric",
|
|
49
52
|
hour: "numeric",
|
|
50
53
|
minute: "2-digit",
|
|
51
54
|
timeZoneName: "short"
|
|
52
|
-
}).format(
|
|
55
|
+
}).format(e);
|
|
53
56
|
} catch {
|
|
54
57
|
}
|
|
55
58
|
return /* @__PURE__ */ m(
|
|
56
59
|
"span",
|
|
57
60
|
{
|
|
58
|
-
className:
|
|
61
|
+
className: g(
|
|
59
62
|
"inline-flex items-center gap-1 rounded px-1 font-medium",
|
|
60
|
-
|
|
63
|
+
o ? "bg-black/15" : "bg-slate-200/70 text-slate-800 dark:bg-white/10 dark:text-slate-100"
|
|
61
64
|
),
|
|
62
|
-
title: `“${s}” — ${
|
|
65
|
+
title: `“${s}” — ${c} (your time)`,
|
|
63
66
|
"data-chat-time-chip": !0,
|
|
64
67
|
children: [
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
|
|
68
|
+
/* @__PURE__ */ l("span", { "aria-hidden": !0, children: "🕒" }),
|
|
69
|
+
a
|
|
67
70
|
]
|
|
68
71
|
}
|
|
69
72
|
);
|
|
70
73
|
}
|
|
71
|
-
function w(s,
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
function w(s, t, o) {
|
|
75
|
+
const e = [];
|
|
76
|
+
if (t.emoji && t.emoji.size > 0 && s.includes(":")) {
|
|
77
|
+
const n = Q(s, t.emoji, o);
|
|
78
|
+
if (n.length > 1 || typeof n[0] != "string")
|
|
79
|
+
return n.forEach(
|
|
80
|
+
(r, d) => typeof r == "string" ? e.push(...w(r, { ...t, emoji: void 0 }, `${o}.m${d}`)) : e.push(r)
|
|
81
|
+
), e;
|
|
82
|
+
}
|
|
83
|
+
const i = t.timeRefs.filter((n) => n.text && s.includes(n.text));
|
|
84
|
+
if (i.length === 0)
|
|
85
|
+
return H(s, t.entityPattern).forEach(
|
|
86
|
+
(n, r) => e.push(/* @__PURE__ */ l(k, { children: t.renderToken(n, `${o}.${r}`) }, `${o}.${r}`))
|
|
87
|
+
), e;
|
|
88
|
+
let a = s, c = 0;
|
|
89
|
+
for (; a.length; ) {
|
|
90
|
+
let n = null;
|
|
91
|
+
for (const r of i) {
|
|
92
|
+
const d = a.indexOf(r.text);
|
|
93
|
+
d >= 0 && (!n || d < n.idx) && (n = { idx: d, ref: r });
|
|
83
94
|
}
|
|
84
|
-
if (!
|
|
85
|
-
|
|
95
|
+
if (!n) {
|
|
96
|
+
e.push(...w(a, { ...t, timeRefs: [] }, `${o}.t${c++}`));
|
|
86
97
|
break;
|
|
87
98
|
}
|
|
88
|
-
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
),
|
|
99
|
+
n.idx > 0 && e.push(...w(a.slice(0, n.idx), { ...t, timeRefs: [] }, `${o}.t${c++}`)), e.push(
|
|
100
|
+
/* @__PURE__ */ l(le, { text: n.ref.text, at: n.ref.at, mine: t.mine }, `${o}.c${c++}`)
|
|
101
|
+
), a = a.slice(n.idx + n.ref.text.length);
|
|
91
102
|
}
|
|
92
|
-
return
|
|
103
|
+
return e;
|
|
93
104
|
}
|
|
94
|
-
function x(s,
|
|
95
|
-
const
|
|
96
|
-
let
|
|
97
|
-
for (const
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
const r =
|
|
101
|
-
r.startsWith("**") ?
|
|
105
|
+
function x(s, t, o) {
|
|
106
|
+
const e = [];
|
|
107
|
+
let i = 0, a = 0;
|
|
108
|
+
for (const c of s.matchAll(ne)) {
|
|
109
|
+
const n = c.index ?? 0;
|
|
110
|
+
n > i && e.push(...w(s.slice(i, n), t, `${o}.p${a}`));
|
|
111
|
+
const r = c[0], d = `${o}.e${a++}`;
|
|
112
|
+
r.startsWith("**") ? e.push(/* @__PURE__ */ l("strong", { children: x(r.slice(2, -2), t, d) }, d)) : r.startsWith("~~") ? e.push(/* @__PURE__ */ l("s", { children: x(r.slice(2, -2), t, d) }, d)) : e.push(/* @__PURE__ */ l("em", { children: x(r.slice(1, -1), t, d) }, d)), i = n + r.length;
|
|
102
113
|
}
|
|
103
|
-
return
|
|
114
|
+
return i < s.length && e.push(...w(s.slice(i), t, `${o}.z`)), e;
|
|
104
115
|
}
|
|
105
|
-
function
|
|
106
|
-
const
|
|
107
|
-
let
|
|
108
|
-
for (const
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
const r =
|
|
112
|
-
|
|
116
|
+
function C(s, t, o) {
|
|
117
|
+
const e = [];
|
|
118
|
+
let i = 0, a = 0;
|
|
119
|
+
for (const c of s.matchAll(E)) {
|
|
120
|
+
const n = c.index ?? 0;
|
|
121
|
+
n > i && e.push(...x(s.slice(i, n), t, `${o}.u${a}`));
|
|
122
|
+
const r = c[0], d = F(r), f = `${o}.l${a++}`;
|
|
123
|
+
e.push(
|
|
113
124
|
/* @__PURE__ */ m(
|
|
114
125
|
"a",
|
|
115
126
|
{
|
|
116
127
|
href: r,
|
|
117
128
|
target: d ? void 0 : "_blank",
|
|
118
129
|
rel: "noopener noreferrer",
|
|
119
|
-
onClick: (
|
|
120
|
-
d &&
|
|
130
|
+
onClick: (p) => {
|
|
131
|
+
d && t.navigate && (p.preventDefault(), t.navigate(d));
|
|
121
132
|
},
|
|
122
133
|
className: "break-all underline underline-offset-2 hover:opacity-80",
|
|
123
134
|
"data-chat-link": !0,
|
|
@@ -126,314 +137,328 @@ function v(s, e, c) {
|
|
|
126
137
|
r.length > 90 ? "…" : ""
|
|
127
138
|
]
|
|
128
139
|
},
|
|
129
|
-
|
|
140
|
+
f
|
|
130
141
|
)
|
|
131
|
-
),
|
|
142
|
+
), i = n + r.length;
|
|
132
143
|
}
|
|
133
|
-
return
|
|
144
|
+
return i < s.length && e.push(...x(s.slice(i), t, `${o}.y`)), e;
|
|
134
145
|
}
|
|
135
|
-
function
|
|
136
|
-
const
|
|
137
|
-
let
|
|
138
|
-
for (const
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
/* @__PURE__ */
|
|
146
|
+
function b(s, t, o) {
|
|
147
|
+
const e = [];
|
|
148
|
+
let i = 0, a = 0;
|
|
149
|
+
for (const c of s.matchAll(D)) {
|
|
150
|
+
const n = c.index ?? 0;
|
|
151
|
+
n > i && e.push(...C(s.slice(i, n), t, `${o}.s${a}`)), e.push(
|
|
152
|
+
/* @__PURE__ */ l(
|
|
142
153
|
"code",
|
|
143
154
|
{
|
|
144
|
-
className:
|
|
155
|
+
className: g(
|
|
145
156
|
"rounded px-1 py-px font-mono text-[11.5px]",
|
|
146
|
-
|
|
157
|
+
t.mine ? "bg-black/20" : "bg-slate-200/80 dark:bg-white/10"
|
|
147
158
|
),
|
|
148
|
-
children:
|
|
159
|
+
children: c[1]
|
|
149
160
|
},
|
|
150
|
-
`${
|
|
161
|
+
`${o}.c${a++}`
|
|
151
162
|
)
|
|
152
|
-
),
|
|
163
|
+
), i = n + c[0].length;
|
|
153
164
|
}
|
|
154
|
-
return
|
|
165
|
+
return i < s.length && e.push(...C(s.slice(i), t, `${o}.x`)), e;
|
|
155
166
|
}
|
|
156
|
-
const
|
|
157
|
-
function
|
|
158
|
-
return s.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((
|
|
167
|
+
const $ = 25, _ = 10;
|
|
168
|
+
function q(s) {
|
|
169
|
+
return s.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((t) => t.trim());
|
|
159
170
|
}
|
|
160
|
-
function
|
|
161
|
-
const
|
|
171
|
+
function oe(s) {
|
|
172
|
+
const t = s.replace(/\r\n?/g, `
|
|
162
173
|
`).split(`
|
|
163
|
-
`),
|
|
164
|
-
let
|
|
165
|
-
const
|
|
166
|
-
|
|
174
|
+
`), o = [];
|
|
175
|
+
let e = [];
|
|
176
|
+
const i = () => {
|
|
177
|
+
e.length && o.push({ t: "p", lines: e }), e = [];
|
|
167
178
|
};
|
|
168
|
-
for (let
|
|
169
|
-
const
|
|
170
|
-
if (/^```/.test(
|
|
171
|
-
|
|
179
|
+
for (let a = 0; a < t.length; a++) {
|
|
180
|
+
const c = t[a];
|
|
181
|
+
if (/^```/.test(c.trim())) {
|
|
182
|
+
i();
|
|
172
183
|
const r = [];
|
|
173
|
-
for (
|
|
174
|
-
|
|
184
|
+
for (a++; a < t.length && !/^```/.test(t[a].trim()); ) r.push(t[a++]);
|
|
185
|
+
o.push({ t: "code", text: r.join(`
|
|
175
186
|
`) });
|
|
176
187
|
continue;
|
|
177
188
|
}
|
|
178
|
-
if (/^\s*\|.*\|\s*$/.test(
|
|
179
|
-
|
|
180
|
-
const r =
|
|
181
|
-
for (
|
|
182
|
-
d.length <
|
|
183
|
-
|
|
189
|
+
if (/^\s*\|.*\|\s*$/.test(c) && a + 1 < t.length && /^\s*\|?\s*:?-{2,}/.test(t[a + 1])) {
|
|
190
|
+
i();
|
|
191
|
+
const r = q(c).slice(0, _), d = [];
|
|
192
|
+
for (a += 2; a < t.length && /^\s*\|.*\|\s*$/.test(t[a]); )
|
|
193
|
+
d.length < $ && d.push(q(t[a]).slice(0, _)), a++;
|
|
194
|
+
a--, o.push({ t: "table", head: r, rows: d });
|
|
184
195
|
continue;
|
|
185
196
|
}
|
|
186
|
-
if (/^>\s?/.test(
|
|
187
|
-
|
|
197
|
+
if (/^>\s?/.test(c)) {
|
|
198
|
+
i();
|
|
188
199
|
const r = [];
|
|
189
|
-
for (;
|
|
190
|
-
|
|
200
|
+
for (; a < t.length && /^>\s?/.test(t[a]); ) r.push(t[a++].replace(/^>\s?/, ""));
|
|
201
|
+
a--, o.push({ t: "quote", lines: r });
|
|
191
202
|
continue;
|
|
192
203
|
}
|
|
193
|
-
if (/^\s*[-*•]\s+/.test(
|
|
194
|
-
|
|
204
|
+
if (/^\s*[-*•]\s+/.test(c)) {
|
|
205
|
+
i();
|
|
195
206
|
const r = [];
|
|
196
|
-
for (;
|
|
197
|
-
r.push(
|
|
198
|
-
|
|
207
|
+
for (; a < t.length && /^\s*[-*•]\s+/.test(t[a]); )
|
|
208
|
+
r.push(t[a++].replace(/^\s*[-*•]\s+/, ""));
|
|
209
|
+
a--, o.push({ t: "ul", items: r });
|
|
199
210
|
continue;
|
|
200
211
|
}
|
|
201
|
-
const
|
|
202
|
-
if (
|
|
203
|
-
|
|
212
|
+
const n = c.match(/^\s*(\d{1,3})[.)]\s+/);
|
|
213
|
+
if (n) {
|
|
214
|
+
i();
|
|
204
215
|
const r = [];
|
|
205
|
-
for (;
|
|
206
|
-
r.push(
|
|
207
|
-
|
|
216
|
+
for (; a < t.length && /^\s*\d{1,3}[.)]\s+/.test(t[a]); )
|
|
217
|
+
r.push(t[a++].replace(/^\s*\d{1,3}[.)]\s+/, ""));
|
|
218
|
+
a--, o.push({ t: "ol", items: r, start: Number(n[1]) });
|
|
208
219
|
continue;
|
|
209
220
|
}
|
|
210
|
-
if (
|
|
211
|
-
|
|
221
|
+
if (c.trim() === "") {
|
|
222
|
+
i();
|
|
212
223
|
continue;
|
|
213
224
|
}
|
|
214
|
-
|
|
225
|
+
e.push(c);
|
|
215
226
|
}
|
|
216
|
-
return
|
|
227
|
+
return i(), o;
|
|
217
228
|
}
|
|
218
|
-
function
|
|
229
|
+
function qe({
|
|
219
230
|
text: s,
|
|
220
|
-
mine:
|
|
221
|
-
renderToken:
|
|
222
|
-
entityPattern:
|
|
223
|
-
timeRefs:
|
|
224
|
-
navigate:
|
|
231
|
+
mine: t,
|
|
232
|
+
renderToken: o,
|
|
233
|
+
entityPattern: e,
|
|
234
|
+
timeRefs: i,
|
|
235
|
+
navigate: a
|
|
225
236
|
}) {
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
228
|
-
const
|
|
229
|
-
return /* @__PURE__ */
|
|
230
|
-
|
|
231
|
-
f
|
|
232
|
-
] },
|
|
237
|
+
const c = v(() => oe(s), [s]), r = { emoji: G(), mine: t, renderToken: o, entityPattern: e, timeRefs: i ?? [], navigate: a };
|
|
238
|
+
if (c.length === 1 && c[0].t === "p") {
|
|
239
|
+
const d = c[0];
|
|
240
|
+
return /* @__PURE__ */ l(L, { children: d.lines.map((f, p) => /* @__PURE__ */ m(k, { children: [
|
|
241
|
+
p > 0 && /* @__PURE__ */ l("br", {}),
|
|
242
|
+
b(f, r, `l${p}`)
|
|
243
|
+
] }, p)) });
|
|
233
244
|
}
|
|
234
|
-
return /* @__PURE__ */
|
|
235
|
-
const
|
|
236
|
-
switch (
|
|
245
|
+
return /* @__PURE__ */ l("div", { className: "space-y-1.5", "data-chat-formatted": !0, children: c.map((d, f) => {
|
|
246
|
+
const p = `b${f}`;
|
|
247
|
+
switch (d.t) {
|
|
237
248
|
case "p":
|
|
238
|
-
return /* @__PURE__ */
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
] },
|
|
249
|
+
return /* @__PURE__ */ l("p", { children: d.lines.map((h, u) => /* @__PURE__ */ m(k, { children: [
|
|
250
|
+
u > 0 && /* @__PURE__ */ l("br", {}),
|
|
251
|
+
b(h, r, `${p}.${u}`)
|
|
252
|
+
] }, u)) }, p);
|
|
242
253
|
case "code":
|
|
243
|
-
return /* @__PURE__ */
|
|
254
|
+
return /* @__PURE__ */ l(
|
|
244
255
|
"pre",
|
|
245
256
|
{
|
|
246
|
-
className:
|
|
257
|
+
className: g(
|
|
247
258
|
"max-w-full overflow-x-auto whitespace-pre rounded-md px-2 py-1.5 font-mono text-[11.5px] leading-snug",
|
|
248
|
-
|
|
259
|
+
t ? "bg-black/20" : "bg-slate-200/80 dark:bg-black/30"
|
|
249
260
|
),
|
|
250
|
-
children:
|
|
261
|
+
children: d.text
|
|
251
262
|
},
|
|
252
|
-
|
|
263
|
+
p
|
|
253
264
|
);
|
|
254
265
|
case "quote":
|
|
255
|
-
return /* @__PURE__ */
|
|
266
|
+
return /* @__PURE__ */ l(
|
|
256
267
|
"blockquote",
|
|
257
268
|
{
|
|
258
|
-
className:
|
|
269
|
+
className: g(
|
|
259
270
|
"border-l-2 pl-2",
|
|
260
|
-
|
|
271
|
+
t ? "border-white/60" : "border-slate-300 text-slate-600 dark:border-slate-500 dark:text-slate-300"
|
|
261
272
|
),
|
|
262
|
-
children:
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
] },
|
|
273
|
+
children: d.lines.map((h, u) => /* @__PURE__ */ m(k, { children: [
|
|
274
|
+
u > 0 && /* @__PURE__ */ l("br", {}),
|
|
275
|
+
b(h, r, `${p}.${u}`)
|
|
276
|
+
] }, u))
|
|
266
277
|
},
|
|
267
|
-
|
|
278
|
+
p
|
|
268
279
|
);
|
|
269
280
|
case "ul":
|
|
270
|
-
return /* @__PURE__ */
|
|
281
|
+
return /* @__PURE__ */ l("ul", { className: "list-disc space-y-0.5 pl-4", children: d.items.map((h, u) => /* @__PURE__ */ l("li", { children: b(h, r, `${p}.${u}`) }, u)) }, p);
|
|
271
282
|
case "ol":
|
|
272
|
-
return /* @__PURE__ */
|
|
283
|
+
return /* @__PURE__ */ l("ol", { start: d.start, className: "list-decimal space-y-0.5 pl-5", children: d.items.map((h, u) => /* @__PURE__ */ l("li", { children: b(h, r, `${p}.${u}`) }, u)) }, p);
|
|
273
284
|
case "table":
|
|
274
|
-
return /* @__PURE__ */
|
|
275
|
-
/* @__PURE__ */
|
|
285
|
+
return /* @__PURE__ */ l("div", { className: "max-w-full overflow-x-auto", "data-chat-table": !0, children: /* @__PURE__ */ m("table", { className: "border-collapse text-[11.5px] tabular-nums", children: [
|
|
286
|
+
/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ l("tr", { children: d.head.map((h, u) => /* @__PURE__ */ l(
|
|
276
287
|
"th",
|
|
277
288
|
{
|
|
278
|
-
className:
|
|
289
|
+
className: g(
|
|
279
290
|
"border px-1.5 py-0.5 text-left font-semibold",
|
|
280
|
-
|
|
291
|
+
t ? "border-white/30" : "border-slate-300 dark:border-slate-600"
|
|
281
292
|
),
|
|
282
|
-
children:
|
|
293
|
+
children: b(h, r, `${p}.h${u}`)
|
|
283
294
|
},
|
|
284
|
-
|
|
295
|
+
u
|
|
285
296
|
)) }) }),
|
|
286
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ l("tbody", { children: d.rows.map((h, u) => /* @__PURE__ */ l("tr", { children: d.head.map((pe, y) => /* @__PURE__ */ l(
|
|
287
298
|
"td",
|
|
288
299
|
{
|
|
289
|
-
className:
|
|
300
|
+
className: g(
|
|
290
301
|
"border px-1.5 py-0.5 align-top",
|
|
291
|
-
|
|
302
|
+
t ? "border-white/30" : "border-slate-300 dark:border-slate-600"
|
|
292
303
|
),
|
|
293
|
-
children:
|
|
304
|
+
children: b(h[y] ?? "", r, `${p}.${u}.${y}`)
|
|
294
305
|
},
|
|
295
|
-
|
|
296
|
-
)) },
|
|
297
|
-
] }) },
|
|
306
|
+
y
|
|
307
|
+
)) }, u)) })
|
|
308
|
+
] }) }, p);
|
|
298
309
|
}
|
|
299
310
|
}) });
|
|
300
311
|
}
|
|
301
|
-
function
|
|
302
|
-
const
|
|
312
|
+
function Ae(s) {
|
|
313
|
+
const t = s.replace(/\r\n?/g, `
|
|
303
314
|
`).replace(/\n+$/, "").split(`
|
|
304
315
|
`);
|
|
305
|
-
if (
|
|
306
|
-
const
|
|
307
|
-
(
|
|
308
|
-
),
|
|
309
|
-
if (
|
|
310
|
-
const
|
|
311
|
-
for (const
|
|
312
|
-
return
|
|
313
|
-
_…${
|
|
316
|
+
if (t.length < 2 || !t.every((c) => c.includes(" "))) return null;
|
|
317
|
+
const o = t.slice(0, $ + 1).map(
|
|
318
|
+
(c) => c.split(" ").slice(0, _).map((n) => n.replace(/\|/g, "/").trim())
|
|
319
|
+
), e = Math.max(...o.map((c) => c.length));
|
|
320
|
+
if (e < 2) return null;
|
|
321
|
+
const i = (c) => `| ${Array.from({ length: e }, (n, r) => c[r] ?? "").join(" | ")} |`, a = [i(o[0]), `| ${Array.from({ length: e }, () => "---").join(" | ")} |`];
|
|
322
|
+
for (const c of o.slice(1)) a.push(i(c));
|
|
323
|
+
return t.length > $ + 1 && a.push(`
|
|
324
|
+
_…${t.length - $ - 1} more rows_`), a.join(`
|
|
314
325
|
`);
|
|
315
326
|
}
|
|
316
|
-
function
|
|
327
|
+
function ie({
|
|
317
328
|
data: s,
|
|
318
|
-
path:
|
|
319
|
-
navigate:
|
|
329
|
+
path: t,
|
|
330
|
+
navigate: o
|
|
320
331
|
}) {
|
|
321
332
|
return /* @__PURE__ */ m(
|
|
322
333
|
"button",
|
|
323
334
|
{
|
|
324
335
|
type: "button",
|
|
325
|
-
onClick: () =>
|
|
336
|
+
onClick: () => o == null ? void 0 : o(t),
|
|
326
337
|
className: "block w-full max-w-[360px] rounded-lg border border-slate-200 bg-white px-2.5 py-2 text-left text-slate-700 hover:border-slate-300 dark:border-border dark:bg-card dark:text-slate-200",
|
|
327
338
|
"data-chat-app-card": "ask",
|
|
328
339
|
children: [
|
|
329
340
|
/* @__PURE__ */ m("span", { className: "flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400", children: [
|
|
330
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ l(V, { className: "h-3 w-3" }),
|
|
331
342
|
" Ask AI · ",
|
|
332
343
|
s.owner_name,
|
|
333
344
|
(s.turns ?? 0) > 1 && ` · ${s.turns} questions`
|
|
334
345
|
] }),
|
|
335
|
-
/* @__PURE__ */
|
|
336
|
-
s.answer ? /* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ l("span", { className: "mt-0.5 block line-clamp-2 text-[12.5px] font-medium", children: s.question ?? s.name }),
|
|
347
|
+
s.answer ? /* @__PURE__ */ l("span", { className: "mt-0.5 block line-clamp-3 text-[11.5px] text-slate-600 dark:text-slate-300", children: s.answer }) : s.answer_hidden ? /* @__PURE__ */ m("span", { className: "mt-0.5 block text-[11px] italic text-slate-500 dark:text-slate-400", children: [
|
|
337
348
|
"Answered with ",
|
|
338
349
|
s.owner_name,
|
|
339
350
|
"’s access — open it to get the answer with yours."
|
|
340
351
|
] }) : null,
|
|
341
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ l("span", { className: "mt-1 block text-[11px] font-medium text-nvr-navy dark:text-nvr-cyan", children: "Open conversation" })
|
|
342
353
|
]
|
|
343
354
|
}
|
|
344
355
|
);
|
|
345
356
|
}
|
|
346
|
-
function
|
|
347
|
-
const
|
|
357
|
+
function ce({ path: s, navigate: t }) {
|
|
358
|
+
const o = T(), { data: e } = R({
|
|
348
359
|
queryKey: ["nvr-chat-app-card", s],
|
|
349
|
-
queryFn: () =>
|
|
360
|
+
queryFn: () => o.request(j("/chat/app-card", { path: s })).then((r) => r.data ?? null),
|
|
350
361
|
staleTime: 6e4,
|
|
351
362
|
retry: !1
|
|
352
363
|
});
|
|
353
|
-
if (!
|
|
354
|
-
if (
|
|
355
|
-
return /* @__PURE__ */
|
|
356
|
-
if (
|
|
357
|
-
return /* @__PURE__ */
|
|
358
|
-
|
|
359
|
-
|
|
364
|
+
if (!e) return null;
|
|
365
|
+
if (e.kind === "ops-proposal")
|
|
366
|
+
return /* @__PURE__ */ l(ee, { path: s, card: e });
|
|
367
|
+
if (e.kind === "ask")
|
|
368
|
+
return /* @__PURE__ */ l(ie, { data: e, path: s, navigate: t });
|
|
369
|
+
if (e.kind === "request")
|
|
370
|
+
return /* @__PURE__ */ l(se, { card: e, navigate: t });
|
|
371
|
+
const i = e.kind === "queue" ? M : e.kind === "dashboard" ? P : e.kind === "report" ? O : e.kind === "custom-query" ? Z : z, a = e.kind === "record" ? e.label ?? e.id : e.name ?? e.id, c = e.kind === "record" ? e.collection_label ?? "Record" : e.kind === "view" ? `Saved view${e.collection_label ? ` of ${e.collection_label}` : ""}` : e.kind === "custom-query" ? "Custom query" : e.kind.charAt(0).toUpperCase() + e.kind.slice(1), n = [];
|
|
372
|
+
return e.widgets != null && n.push(`${e.widgets} ${e.widgets === 1 ? "widget" : "widgets"}`), e.sources && n.push(`${e.sources} ${e.sources === 1 ? "source" : "sources"}`), e.kind === "custom-query" && e.params != null && n.push(
|
|
373
|
+
e.params === 0 ? "No parameters" : `${e.params} ${e.params === 1 ? "parameter" : "parameters"}`
|
|
374
|
+
), /* @__PURE__ */ m(
|
|
360
375
|
"button",
|
|
361
376
|
{
|
|
362
377
|
type: "button",
|
|
363
|
-
onClick: () =>
|
|
378
|
+
onClick: () => t == null ? void 0 : t(s),
|
|
364
379
|
className: "flex w-full max-w-[320px] items-center gap-2 rounded-lg border border-slate-200 bg-white px-2.5 py-1.5 text-left text-slate-700 hover:border-slate-300 dark:border-border dark:bg-card dark:text-slate-200",
|
|
365
|
-
"data-chat-app-card":
|
|
380
|
+
"data-chat-app-card": e.kind,
|
|
366
381
|
children: [
|
|
367
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ l(i, { className: "h-4 w-4 shrink-0 text-slate-400" }),
|
|
368
383
|
/* @__PURE__ */ m("span", { className: "min-w-0 flex-1", children: [
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
|
|
371
|
-
|
|
384
|
+
/* @__PURE__ */ m("span", { className: "block truncate text-[11px] text-slate-500 dark:text-slate-400", children: [
|
|
385
|
+
c,
|
|
386
|
+
n.length > 0 && ` · ${n.join(" · ")}`
|
|
387
|
+
] }),
|
|
388
|
+
/* @__PURE__ */ l("span", { className: "block truncate text-[12px] font-medium", children: a }),
|
|
389
|
+
e.description && /* @__PURE__ */ l(
|
|
390
|
+
"span",
|
|
391
|
+
{
|
|
392
|
+
className: "line-clamp-2 text-[11px] text-slate-600 dark:text-slate-300",
|
|
393
|
+
"data-chat-app-card-description": !0,
|
|
394
|
+
children: e.description
|
|
395
|
+
}
|
|
396
|
+
)
|
|
372
397
|
] }),
|
|
373
|
-
|
|
398
|
+
e.state && /* @__PURE__ */ l(
|
|
374
399
|
"span",
|
|
375
400
|
{
|
|
376
401
|
className: "shrink-0 rounded-full px-1.5 py-px text-[10px] font-semibold",
|
|
377
402
|
style: {
|
|
378
|
-
backgroundColor:
|
|
379
|
-
color:
|
|
403
|
+
backgroundColor: e.state.color ? `${e.state.color}26` : "rgba(100,116,139,.15)",
|
|
404
|
+
color: e.state.color ?? void 0
|
|
380
405
|
},
|
|
381
|
-
children:
|
|
406
|
+
children: e.state.label
|
|
382
407
|
}
|
|
383
408
|
)
|
|
384
409
|
]
|
|
385
410
|
}
|
|
386
411
|
);
|
|
387
412
|
}
|
|
388
|
-
function
|
|
413
|
+
function de({
|
|
389
414
|
search: s,
|
|
390
|
-
navigate:
|
|
391
|
-
fallback:
|
|
415
|
+
navigate: t,
|
|
416
|
+
fallback: o
|
|
392
417
|
}) {
|
|
393
|
-
const
|
|
394
|
-
queryKey: ["nvr-chat-app-card",
|
|
395
|
-
queryFn: () =>
|
|
396
|
-
var
|
|
397
|
-
return ((
|
|
418
|
+
const e = T(), i = B(), { apiBase: a } = W(), c = a.replace(/\/api$/, ""), n = `${i.helpVideosPath ?? "/help-videos"}${s}`, { data: r, isFetched: d } = R({
|
|
419
|
+
queryKey: ["nvr-chat-app-card", n],
|
|
420
|
+
queryFn: () => e.request(j("/chat/app-card", { path: n })).then((p) => {
|
|
421
|
+
var h;
|
|
422
|
+
return ((h = p.data) == null ? void 0 : h.kind) === "help-video" ? p.data : null;
|
|
398
423
|
}),
|
|
399
424
|
staleTime: 6e4,
|
|
400
425
|
retry: !1
|
|
401
426
|
});
|
|
402
|
-
if (!r) return d ? /* @__PURE__ */
|
|
403
|
-
const
|
|
427
|
+
if (!r) return d ? /* @__PURE__ */ l(L, { children: o }) : null;
|
|
428
|
+
const f = r.chapter != null ? `Starts at ${r.chapter.title} (${N(r.start_ms)})` : r.start_ms >= 1e3 ? `Starts at ${N(r.start_ms)}` : null;
|
|
404
429
|
return /* @__PURE__ */ m(
|
|
405
430
|
"button",
|
|
406
431
|
{
|
|
407
432
|
type: "button",
|
|
408
|
-
onClick: () =>
|
|
433
|
+
onClick: () => t ? t(n) : i.navigate(n),
|
|
409
434
|
className: "flex w-full max-w-[320px] items-center gap-2.5 rounded-lg border border-slate-200 bg-white p-1.5 pr-2.5 text-left text-slate-700 hover:border-slate-300 dark:border-border dark:bg-card dark:text-slate-200",
|
|
410
435
|
"data-chat-app-card": "help-video",
|
|
411
436
|
"data-chat-help-video": r.id,
|
|
412
437
|
children: [
|
|
413
438
|
/* @__PURE__ */ m("span", { className: "relative h-12 w-20 shrink-0 overflow-hidden rounded bg-[#0b0f17]", children: [
|
|
414
|
-
r.poster_url && /* @__PURE__ */
|
|
439
|
+
r.poster_url && /* @__PURE__ */ l(
|
|
415
440
|
"img",
|
|
416
441
|
{
|
|
417
|
-
src: `${
|
|
442
|
+
src: `${c}${r.poster_url}`,
|
|
418
443
|
alt: "",
|
|
419
444
|
className: "h-full w-full object-cover",
|
|
420
445
|
loading: "lazy"
|
|
421
446
|
}
|
|
422
447
|
),
|
|
423
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ l(S, { className: "absolute left-1/2 top-1/2 h-5 w-5 -translate-x-1/2 -translate-y-1/2 text-white drop-shadow" })
|
|
424
449
|
] }),
|
|
425
450
|
/* @__PURE__ */ m("span", { className: "min-w-0 flex-1", children: [
|
|
426
451
|
/* @__PURE__ */ m("span", { className: "block text-[10px] font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400", children: [
|
|
427
452
|
"Video",
|
|
428
|
-
r.duration_ms ? ` · ${
|
|
453
|
+
r.duration_ms ? ` · ${N(r.duration_ms)}` : ""
|
|
429
454
|
] }),
|
|
430
|
-
/* @__PURE__ */
|
|
431
|
-
|
|
455
|
+
/* @__PURE__ */ l("span", { className: "block truncate text-[12px] font-medium", children: r.title || "Untitled video" }),
|
|
456
|
+
f && /* @__PURE__ */ l(
|
|
432
457
|
"span",
|
|
433
458
|
{
|
|
434
459
|
className: "block truncate text-[11px] text-slate-500 dark:text-slate-400",
|
|
435
460
|
"data-chat-help-video-start": r.start_ms,
|
|
436
|
-
children:
|
|
461
|
+
children: f
|
|
437
462
|
}
|
|
438
463
|
)
|
|
439
464
|
] })
|
|
@@ -442,8 +467,8 @@ function re({
|
|
|
442
467
|
);
|
|
443
468
|
}
|
|
444
469
|
function A({ url: s }) {
|
|
445
|
-
const
|
|
446
|
-
return
|
|
470
|
+
const t = J(s);
|
|
471
|
+
return t != null && t.ok ? /* @__PURE__ */ m(
|
|
447
472
|
"a",
|
|
448
473
|
{
|
|
449
474
|
href: s,
|
|
@@ -453,54 +478,55 @@ function A({ url: s }) {
|
|
|
453
478
|
"data-chat-link-preview": !0,
|
|
454
479
|
children: [
|
|
455
480
|
/* @__PURE__ */ m("span", { className: "flex items-center gap-1 text-[10.5px] text-slate-500 dark:text-slate-400", children: [
|
|
456
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ l(U, { className: "h-3 w-3" }),
|
|
457
482
|
" ",
|
|
458
|
-
|
|
483
|
+
t.site
|
|
459
484
|
] }),
|
|
460
|
-
/* @__PURE__ */
|
|
461
|
-
|
|
485
|
+
/* @__PURE__ */ l("span", { className: "block truncate text-[12px] font-semibold text-slate-800 dark:text-slate-100", children: t.title }),
|
|
486
|
+
t.description && /* @__PURE__ */ l("span", { className: "line-clamp-2 text-[11px] text-slate-600 dark:text-slate-300", children: t.description })
|
|
462
487
|
]
|
|
463
488
|
}
|
|
464
489
|
) : null;
|
|
465
490
|
}
|
|
466
|
-
function
|
|
491
|
+
function Le({
|
|
467
492
|
text: s,
|
|
468
|
-
navigate:
|
|
469
|
-
onDismiss:
|
|
493
|
+
navigate: t,
|
|
494
|
+
onDismiss: o
|
|
470
495
|
}) {
|
|
471
|
-
const
|
|
472
|
-
return
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
496
|
+
const e = v(() => ae(s).slice(0, 3), [s]), i = v(() => te(s), [s]), [a, c] = Y();
|
|
497
|
+
return e.length === 0 && i.length === 0 ? null : c ? /* @__PURE__ */ m("div", { className: "group/prev relative mt-1 space-y-1", "data-chat-previews": !0, children: [
|
|
498
|
+
i.map((n) => /* @__PURE__ */ l(re, { id: n, navigate: t }, n)),
|
|
499
|
+
e.map((n) => {
|
|
500
|
+
const r = F(n), d = X(n);
|
|
501
|
+
return d ? /* @__PURE__ */ l(
|
|
502
|
+
de,
|
|
477
503
|
{
|
|
478
|
-
search:
|
|
479
|
-
navigate:
|
|
480
|
-
fallback:
|
|
504
|
+
search: d.search,
|
|
505
|
+
navigate: t,
|
|
506
|
+
fallback: r ? null : /* @__PURE__ */ l(A, { url: n })
|
|
481
507
|
},
|
|
482
|
-
|
|
483
|
-
) :
|
|
508
|
+
n
|
|
509
|
+
) : r ? /* @__PURE__ */ l(ce, { path: r, navigate: t }, n) : /* @__PURE__ */ l(A, { url: n }, n);
|
|
484
510
|
}),
|
|
485
|
-
|
|
511
|
+
o && /* @__PURE__ */ l(
|
|
486
512
|
"button",
|
|
487
513
|
{
|
|
488
514
|
type: "button",
|
|
489
|
-
onClick:
|
|
515
|
+
onClick: o,
|
|
490
516
|
className: "absolute -right-1.5 -top-1.5 hidden rounded-full border border-slate-200 bg-white p-0.5 text-slate-500 shadow-sm hover:text-slate-800 group-hover/prev:block dark:border-border dark:bg-card",
|
|
491
517
|
title: "Remove the preview (for everyone)",
|
|
492
518
|
"aria-label": "Remove link preview",
|
|
493
519
|
"data-chat-preview-dismiss": !0,
|
|
494
|
-
children: /* @__PURE__ */
|
|
520
|
+
children: /* @__PURE__ */ l(I, { className: "h-3 w-3" })
|
|
495
521
|
}
|
|
496
522
|
)
|
|
497
|
-
] });
|
|
523
|
+
] }) : /* @__PURE__ */ l("div", { ref: a, "data-chat-previews-pending": !0 });
|
|
498
524
|
}
|
|
499
525
|
export {
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
526
|
+
qe as FormattedMessage,
|
|
527
|
+
Le as LinkPreviews,
|
|
528
|
+
F as appPath,
|
|
529
|
+
ae as extractUrls,
|
|
530
|
+
oe as parseBlocks,
|
|
531
|
+
Ae as tsvToTable
|
|
506
532
|
};
|