@thewhatmatters/wmds 0.4.3 → 0.4.5
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/CHANGELOG.md +39 -0
- package/CONSUMING.md +1 -1
- package/dist/colors.css +3 -0
- package/dist/components/molecules/IntakeForm/IntakeForm.d.ts +14 -2
- package/dist/components/molecules/IntakeForm/IntakeForm.d.ts.map +1 -1
- package/dist/components/molecules/IntakeForm/IntakeForm.js +25 -25
- package/dist/components/organisms/ChatDock/ChatDock.d.ts +25 -10
- package/dist/components/organisms/ChatDock/ChatDock.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/ChatDock.js +423 -428
- package/dist/components/organisms/ChatDock/ChatDockGate.d.ts +12 -10
- package/dist/components/organisms/ChatDock/ChatDockGate.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/ChatDockGate.js +130 -153
- package/dist/components/organisms/ChatDock/chatDockGateContext.d.ts +7 -6
- package/dist/components/organisms/ChatDock/chatDockGateContext.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/chatDockGateStyles.d.ts +19 -11
- package/dist/components/organisms/ChatDock/chatDockGateStyles.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/chatDockGateStyles.js +2 -3
- package/dist/components/organisms/ChatDock/chatDockStyles.d.ts +6 -12
- package/dist/components/organisms/ChatDock/chatDockStyles.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/chatDockStyles.js +6 -9
- package/dist/components/organisms/Dialog/Dialog.js +34 -34
- package/dist/components/organisms/Sheet/Sheet.js +38 -38
- package/dist/lib/dialogOverlay.d.ts +0 -5
- package/dist/lib/dialogOverlay.d.ts.map +1 -1
- package/dist/lib/dialogOverlay.js +1 -12
- package/dist/lib/shadows.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +1 -0
- package/docs/component-contracts.md +2 -2
- package/docs/components.md +3 -3
- package/docs/exports.json +3 -2
- package/docs/patterns/components-accordion--flush.tsx +1 -1
- package/docs/patterns/components-avatar--dropdown-row.tsx +1 -1
- package/docs/patterns/components-badge--outline-tags.tsx +1 -1
- package/docs/patterns/components-badge--with-avatar.tsx +1 -1
- package/docs/patterns/components-breadcrumb--editorial.tsx +1 -1
- package/docs/patterns/components-breadcrumb--long-path.tsx +1 -1
- package/docs/patterns/components-breadcrumb--path.tsx +1 -1
- package/docs/patterns/components-breadcrumb--router-links.tsx +1 -1
- package/docs/patterns/components-button-button--copy-button.tsx +1 -1
- package/docs/patterns/components-button-button--destructive-action.tsx +1 -1
- package/docs/patterns/components-button-button--external-link.tsx +1 -1
- package/docs/patterns/components-button-button--ghost-action.tsx +1 -1
- package/docs/patterns/components-button-button--inverse-action.tsx +1 -1
- package/docs/patterns/components-button-button--link-render.tsx +1 -1
- package/docs/patterns/components-button-button--multi-state-badge.tsx +1 -1
- package/docs/patterns/components-button-button--outline-mono.tsx +1 -1
- package/docs/patterns/components-button-button--primary-action.tsx +1 -1
- package/docs/patterns/components-button-button--row-hug.tsx +1 -1
- package/docs/patterns/components-button-button--row-layout.tsx +1 -1
- package/docs/patterns/components-button-button--secondary-action.tsx +1 -1
- package/docs/patterns/components-button-button--suggestion-pills.tsx +1 -1
- package/docs/patterns/components-button-button--with-count.tsx +1 -1
- package/docs/patterns/components-button-button--with-icon.tsx +1 -1
- package/docs/patterns/components-button-floatingactionbutton--vertical-actions.tsx +1 -1
- package/docs/patterns/components-calembed--pattern-skip-in-footer.tsx +1 -1
- package/docs/patterns/components-card-card--body-slot-occupancy-history.tsx +1 -1
- package/docs/patterns/components-card-card--headerless-media.tsx +1 -1
- package/docs/patterns/components-card-card--outlined-layout.tsx +1 -1
- package/docs/patterns/components-card-card--pinned-height.tsx +1 -1
- package/docs/patterns/components-card-selectablecard--selectable-cards-pattern.tsx +1 -1
- package/docs/patterns/components-chart--audience-activity-heatmap.tsx +1 -1
- package/docs/patterns/components-chart--cartesian-no-data-gaps.tsx +1 -1
- package/docs/patterns/components-chart--occupancy-history-in-card.tsx +1 -1
- package/docs/patterns/components-chart--occupancy-in-card.tsx +1 -1
- package/docs/patterns/components-chart--post-reach-distribution.tsx +1 -1
- package/docs/patterns/components-chart--ranked-audience-breakdown.tsx +1 -1
- package/docs/patterns/components-chart--unit-grid-composition.tsx +1 -1
- package/docs/patterns/components-chatdock--pattern-chat-dock.tsx +3 -2
- package/docs/patterns/components-chatdock--pattern-start-project-gate.tsx +4 -3
- package/docs/patterns/components-chatqa--pattern-qa-with-reply.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--default.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--with-count.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--with-description.tsx +1 -1
- package/docs/patterns/components-checkbox-checkboxgroup--default.tsx +1 -1
- package/docs/patterns/components-checkbox-checkboxgroup--option-counts.tsx +1 -1
- package/docs/patterns/components-descriptionlist--details.tsx +1 -1
- package/docs/patterns/components-descriptionlist--post-metadata.tsx +1 -1
- package/docs/patterns/components-dialog--alert-dialog-destructive.tsx +1 -1
- package/docs/patterns/components-dialog--default-dialog.tsx +1 -1
- package/docs/patterns/components-dialog--form-dialog.tsx +1 -1
- package/docs/patterns/components-displaycontrols--page-utilities.tsx +1 -1
- package/docs/patterns/components-field--horizontal-input.tsx +1 -1
- package/docs/patterns/components-field--horizontal-text-area.tsx +1 -1
- package/docs/patterns/components-field--multi-control.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-ruled-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-with-gallery-intro.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-page-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--ruled-grid-footer-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--sequenced-marketing-hero.tsx +1 -1
- package/docs/patterns/components-herointro--two-line-intro.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-pattern.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-text-sequence.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-with-gallery-intro.tsx +1 -1
- package/docs/patterns/components-indexlist--post-index.tsx +1 -1
- package/docs/patterns/components-intakeconfirmation--booked-pattern.tsx +1 -1
- package/docs/patterns/components-intakeconfirmation--emailed-pattern.tsx +1 -1
- package/docs/patterns/components-intakeform--about-you-pattern.tsx +1 -1
- package/docs/patterns/components-intakeform--short-form-pattern.tsx +12 -0
- package/docs/patterns/components-intakemodal--intake-modal-pattern.tsx +1 -1
- package/docs/patterns/components-kbd--command-row.tsx +1 -1
- package/docs/patterns/components-kbd--numbered-choices.tsx +1 -1
- package/docs/patterns/components-kbd--shortcut.tsx +1 -1
- package/docs/patterns/components-moremenu--action-menu.tsx +1 -1
- package/docs/patterns/components-moremenu--in-card-header.tsx +1 -1
- package/docs/patterns/components-navlist--side-nav-settings.tsx +1 -1
- package/docs/patterns/components-pageheader--app-header-pattern.tsx +1 -1
- package/docs/patterns/components-pageheader--page-section-header.tsx +1 -1
- package/docs/patterns/components-pageheader--toolbar-header.tsx +1 -1
- package/docs/patterns/components-panel--end-detail-rail.tsx +1 -1
- package/docs/patterns/components-pillgroup--pill-group-pattern.tsx +1 -1
- package/docs/patterns/components-promptbar--pattern-prompt-bar.tsx +1 -1
- package/docs/patterns/components-prose--article-body.tsx +1 -1
- package/docs/patterns/components-radio-radiogroup--default.tsx +1 -1
- package/docs/patterns/components-scrollhorizontal--project-gallery-pattern.tsx +1 -1
- package/docs/patterns/components-scrollhorizontal--with-intro.tsx +1 -1
- package/docs/patterns/components-sectioncaption--column-caption.tsx +1 -1
- package/docs/patterns/components-sectioncaption--with-action.tsx +1 -1
- package/docs/patterns/components-sheet--bottom-sheet.tsx +1 -1
- package/docs/patterns/components-sheet--end-sheet.tsx +1 -1
- package/docs/patterns/components-sitenav--brand-and-cta.tsx +1 -1
- package/docs/patterns/components-sitenav--centered-links.tsx +1 -1
- package/docs/patterns/components-sitenav--compact.tsx +1 -1
- package/docs/patterns/components-sitenav--marketing-header.tsx +1 -1
- package/docs/patterns/components-sitenav--mega-menu.tsx +1 -1
- package/docs/patterns/components-stat--insights-row.tsx +1 -1
- package/docs/patterns/components-stepprogress--step-progress-pattern.tsx +1 -1
- package/docs/patterns/components-switch--default.tsx +1 -1
- package/docs/patterns/components-switch--settings-row.tsx +1 -1
- package/docs/patterns/components-tab--settings-pages.tsx +1 -1
- package/docs/patterns/components-taskrows--action-details.tsx +1 -1
- package/docs/patterns/components-taskrows--capsules.tsx +1 -1
- package/docs/patterns/components-taskrows--card-with-status-rows.tsx +1 -1
- package/docs/patterns/components-taskrows--controlled-expand.tsx +1 -1
- package/docs/patterns/components-taskrows--custom-slots.tsx +1 -1
- package/docs/patterns/components-taskrows--status-list.tsx +1 -1
- package/docs/patterns/components-taskrows--tag-chips.tsx +1 -1
- package/docs/patterns/components-textlink--external-destination.tsx +1 -1
- package/docs/patterns/components-textlink--inline-prose.tsx +1 -1
- package/docs/patterns/components-textlink--quiet-title.tsx +1 -1
- package/docs/patterns/components-textlink--supporting-copy.tsx +1 -1
- package/docs/patterns/components-textsequence--default.tsx +1 -1
- package/docs/patterns/components-textsequence--reduced-motion.tsx +1 -1
- package/docs/patterns/components-textsequence--shapes.tsx +1 -1
- package/docs/patterns/components-toast--stacked-notifications.tsx +1 -1
- package/docs/patterns/components-tooltip--controlled.tsx +1 -1
- package/docs/patterns/components-tooltip--disabled-control.tsx +1 -1
- package/docs/patterns/components-tooltip--icon-action.tsx +1 -1
- package/docs/patterns/components-tooltip--keyboard-shortcut.tsx +1 -1
- package/docs/patterns/components-tooltip--placement.tsx +1 -1
- package/docs/patterns/foundations-scroll-fade--horizontal-rail.tsx +1 -1
- package/docs/patterns/foundations-scroll-fade--overflowing-list.tsx +1 -1
- package/docs/patterns/guides-chart-explorations--comparison-gallery.tsx +1 -1
- package/docs/patterns/guides-filter-panel--filtered-index.tsx +1 -1
- package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
- package/docs/patterns/guides-post-page--post-page.tsx +1 -1
- package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
- package/docs/patterns/index.json +9 -1
- package/package.json +1 -1
|
@@ -6,18 +6,17 @@ import { Button as a } from "../../atoms/Button/Button.js";
|
|
|
6
6
|
import { IconButton as o } from "../../atoms/IconButton/IconButton.js";
|
|
7
7
|
import { Status as ee } from "../../atoms/Status/Status.js";
|
|
8
8
|
import { PromptBar as te } from "../../molecules/PromptBar/PromptBar.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { AnimatePresence as g, MotionConfigContext as Qe, motion as _ } from "motion/react";
|
|
9
|
+
import { OverlayPanelHeader as ne } from "../Dialog/OverlayPanelHeader.js";
|
|
10
|
+
import { ChatDockGateContext as re } from "./chatDockGateContext.js";
|
|
11
|
+
import { subscribeChatDockViewport as ie, useChatDockReducedMotion as ae, useChatDockVisibleArea as oe, useChatDockWide as se } from "./chatDockViewport.js";
|
|
12
|
+
import { ChatDockGate as s, chatDockGateDefaultLabels as ce } from "./ChatDockGate.js";
|
|
13
|
+
import { chatDockAssistantMessageClasses as le, chatDockComposerClasses as ue, chatDockComposerFootSpacerClasses as de, chatDockDisclaimerClasses as fe, chatDockDockClasses as pe, chatDockDockHoverClasses as me, chatDockFollowUpRowClasses as he, chatDockFollowUpsComposerClasses as ge, chatDockFollowUpsInlineClasses as _e, chatDockGateSlotClasses as ve, chatDockGridClasses as ye, chatDockMarkClasses as be, chatDockPillClasses as xe, chatDockPillsClasses as Se, chatDockPlacements as c, chatDockReplyActionsClasses as Ce, chatDockReplyActionsPendingClasses as we, chatDockReplyButtonsClasses as Te, chatDockReplyClasses as Ee, chatDockReplyMetaClasses as De, chatDockRootClasses as Oe, chatDockRootRaisedClasses as ke, chatDockSuggestionLabelClasses as Ae, chatDockSuggestionListClasses as je, chatDockSuggestionRowContentClasses as Me, chatDockThinkingClasses as Ne, chatDockThreadClasses as Pe, chatDockThreadContentClasses as Fe, chatDockUserMessageClasses as Ie, chatDockWindowClasses as Le, chatDockWindowContentClasses as Re } from "./chatDockStyles.js";
|
|
14
|
+
import { useContext as ze, useEffect as l, useId as Be, useLayoutEffect as u, useRef as d, useState as f, useSyncExternalStore as Ve } from "react";
|
|
15
|
+
import { Check as He, Copy as Ue, CornerDownRight as We, ThumbsDown as Ge, ThumbsUp as Ke } from "lucide-react";
|
|
16
|
+
import { Fragment as qe, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
17
|
+
import { AnimatePresence as h, MotionConfigContext as Je, motion as g } from "motion/react";
|
|
19
18
|
//#region src/components/organisms/ChatDock/ChatDock.tsx
|
|
20
|
-
var
|
|
19
|
+
var Ye = {
|
|
21
20
|
close: "Close chat",
|
|
22
21
|
thinking: "Thinking…",
|
|
23
22
|
conversation: "Conversation",
|
|
@@ -28,19 +27,20 @@ var $e = {
|
|
|
28
27
|
copy: "Copy reply",
|
|
29
28
|
copied: "Copied",
|
|
30
29
|
helpful: "Mark this reply helpful",
|
|
31
|
-
notHelpful: "Mark this reply not helpful"
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
notHelpful: "Mark this reply not helpful",
|
|
31
|
+
gatePlaceholder: "Finish or cancel the form to keep chatting"
|
|
32
|
+
}, Xe = ["inline", "composer"];
|
|
33
|
+
function Ze(e) {
|
|
34
34
|
return e.filter((e) => e.prompt != null && e.prompt.trim() !== "");
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function Qe(e, t) {
|
|
37
37
|
return e.length > 0 && t.length === 0;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function $e({ followUps: e, messages: t, thinking: n, sentAfterId: r }) {
|
|
40
40
|
let i = t[t.length - 1];
|
|
41
41
|
return e.length > 0 && !n && i?.role === "assistant" && i.id !== r;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function et({ message: e, isLatest: t, thinking: n, takesVotes: r }) {
|
|
44
44
|
if (e.role !== "assistant") return null;
|
|
45
45
|
let i = {
|
|
46
46
|
copy: e.copyText != null,
|
|
@@ -52,153 +52,195 @@ function rt({ message: e, isLatest: t, thinking: n, takesVotes: r }) {
|
|
|
52
52
|
ready: !(t && n)
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
var
|
|
56
|
-
function
|
|
55
|
+
var tt = 2e3, nt = 48;
|
|
56
|
+
function rt() {
|
|
57
57
|
return window.innerHeight;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function it() {
|
|
60
60
|
return Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function at(e, t, n) {
|
|
63
63
|
return e === "inline" ? 32 * n : Math.max(0, Math.min(40 * n, t - 7 * n));
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
let
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
65
|
+
function ot({ normal: e, needed: t, max: n }) {
|
|
66
|
+
return Math.round(Math.max(e, Math.min(n, t)));
|
|
67
|
+
}
|
|
68
|
+
var st = 900;
|
|
69
|
+
function ct(e, t) {
|
|
70
|
+
e != null && t != null && (t.offsetHeight <= e.clientHeight ? e.scrollTop = e.scrollHeight : e.scrollTop += t.getBoundingClientRect().top - e.getBoundingClientRect().top);
|
|
71
|
+
}
|
|
72
|
+
function _({ title: s, subtitle: ce, mark: c, greeting: Xe, messages: _ = [], thinking: v = !1, suggestions: y = [], onSend: lt, onSuggestionSelect: ut, followUps: b = [], followUpsPlacement: dt = "inline", onMessageFeedback: ft, gate: pt, gateSubtitle: mt, open: ht, defaultOpen: gt = !1, onOpenChange: _t, placeholder: vt, disclaimer: x, labels: yt, placement: S = "fixed", className: bt }) {
|
|
73
|
+
let C = {
|
|
74
|
+
...Ye,
|
|
75
|
+
...yt
|
|
76
|
+
}, xt = Be(), St = Be(), { reducedMotion: Ct } = ze(Je), w = ae(Ct), T = se(), wt = Ve(ie, rt, () => 800), E = Ve(ie, it, () => 16), Tt = ht !== void 0, [Et, Dt] = f(gt), D = Tt ? ht : Et, [Ot, kt] = f(""), [At, jt] = f(null), [O, Mt] = f(null), [Nt, Pt] = f(!D);
|
|
77
|
+
D && Nt && Pt(!1);
|
|
78
|
+
let k = !D && Nt, A = pt != null, j = A && D, [Ft, It] = f(null), M = oe(S === "fixed" && !T && !k), N = d(null), Lt = d(null), Rt = d(null), zt = d(null), P = d(null), Bt = d(null), Vt = d(null), F = d(null), Ht = d(0), Ut = d(A), I = d(A), L = d(j), R = d(null), z = d(null), B = d(!0), V = d(!1), H = d(D), U = d(D);
|
|
79
|
+
function W(e) {
|
|
80
|
+
e !== D && (Tt || Dt(e), _t?.(e));
|
|
78
81
|
}
|
|
79
|
-
function
|
|
82
|
+
function Wt(e) {
|
|
80
83
|
let t = e.trim();
|
|
81
|
-
t !== "" && (
|
|
84
|
+
t !== "" && (W(!0), B.current = !0, kt(""), jt(_[_.length - 1]?.id ?? null), lt(t));
|
|
82
85
|
}
|
|
83
|
-
function
|
|
84
|
-
ut?.(e), e.prompt != null &&
|
|
86
|
+
function G(e) {
|
|
87
|
+
ut?.(e), e.prompt != null && Wt(e.prompt);
|
|
85
88
|
}
|
|
86
|
-
function
|
|
89
|
+
function Gt(e) {
|
|
87
90
|
let t = e.copyText, n = typeof navigator > "u" ? void 0 : navigator.clipboard;
|
|
88
|
-
t != null && n != null && n.writeText(t).then(() =>
|
|
91
|
+
t != null && n != null && n.writeText(t).then(() => Mt({
|
|
89
92
|
id: e.id,
|
|
90
93
|
at: Date.now()
|
|
91
94
|
}), () => void 0);
|
|
92
95
|
}
|
|
93
|
-
|
|
94
|
-
if (
|
|
95
|
-
let e = window.setTimeout(() =>
|
|
96
|
+
l(() => {
|
|
97
|
+
if (O == null) return;
|
|
98
|
+
let e = window.setTimeout(() => Mt(null), tt);
|
|
96
99
|
return () => window.clearTimeout(e);
|
|
97
|
-
}, [
|
|
98
|
-
function
|
|
99
|
-
|
|
100
|
+
}, [O]);
|
|
101
|
+
function Kt(e) {
|
|
102
|
+
G(e), R.current?.focus();
|
|
100
103
|
}
|
|
101
|
-
function
|
|
102
|
-
|
|
104
|
+
function qt(e) {
|
|
105
|
+
G(e), e.prompt != null && R.current?.focus();
|
|
103
106
|
}
|
|
104
|
-
|
|
105
|
-
|
|
107
|
+
l(() => {
|
|
108
|
+
U.current = D;
|
|
106
109
|
let e = R.current;
|
|
107
|
-
if (e != null &&
|
|
108
|
-
else if (e != null && !
|
|
109
|
-
let t = document.activeElement, n = t == null || t === document.body ||
|
|
110
|
-
t !== e && n && (
|
|
110
|
+
if (e != null && D && !H.current) document.activeElement !== e && e.focus();
|
|
111
|
+
else if (e != null && !D && H.current) {
|
|
112
|
+
let t = document.activeElement, n = t == null || t === document.body || N.current?.contains(t) === !0;
|
|
113
|
+
t !== e && n && (V.current = !0, e.focus(), V.current = !1);
|
|
111
114
|
}
|
|
112
|
-
|
|
113
|
-
}, [
|
|
114
|
-
|
|
115
|
-
}),
|
|
116
|
-
if (
|
|
117
|
-
let e =
|
|
115
|
+
H.current = D;
|
|
116
|
+
}, [D]), l(() => {
|
|
117
|
+
A && !Ut.current && !U.current && W(!0), Ut.current = A;
|
|
118
|
+
}), l(() => {
|
|
119
|
+
if (j && !L.current) {
|
|
120
|
+
let e = P.current;
|
|
118
121
|
(e?.querySelector("[data-chat-dock-gate-focus]") ?? e)?.focus({ preventScroll: !0 });
|
|
119
|
-
} else if (!
|
|
120
|
-
let e = R.current, t = document.activeElement, n = t == null || t === document.body ||
|
|
121
|
-
e != null && n && (
|
|
122
|
+
} else if (!j && L.current && D) {
|
|
123
|
+
let e = R.current, t = document.activeElement, n = t == null || t === document.body || N.current?.contains(t) === !0;
|
|
124
|
+
e != null && n && (V.current = !0, e.focus({ preventScroll: !0 }), V.current = !1);
|
|
122
125
|
}
|
|
123
|
-
L.current =
|
|
124
|
-
}, [
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
L.current = j;
|
|
127
|
+
}, [j, D]);
|
|
128
|
+
let [K] = f(() => ({ revealGate: () => {
|
|
129
|
+
Ht.current = performance.now() + st, ct(z.current, P.current);
|
|
130
|
+
} }));
|
|
131
|
+
l(() => {
|
|
132
|
+
j && K.revealGate();
|
|
133
|
+
}, [j, K]), u(() => {
|
|
134
|
+
let e = z.current, t = F.current;
|
|
135
|
+
if (!j || e == null || t == null || typeof ResizeObserver > "u") return;
|
|
136
|
+
let n = new ResizeObserver(() => {
|
|
137
|
+
performance.now() <= Ht.current && ct(e, P.current);
|
|
138
|
+
});
|
|
139
|
+
return n.observe(e), n.observe(t), () => {
|
|
140
|
+
n.disconnect();
|
|
131
141
|
};
|
|
132
|
-
}, [
|
|
133
|
-
let
|
|
134
|
-
|
|
135
|
-
let e =
|
|
142
|
+
}, [j]);
|
|
143
|
+
let Jt = x != null, q = S === "fixed" && !T ? "rise" : "grow";
|
|
144
|
+
u(() => {
|
|
145
|
+
let e = N.current, t = Rt.current, n = zt.current;
|
|
136
146
|
if (e == null || t == null || n == null) return;
|
|
137
147
|
let r = () => {
|
|
138
|
-
let r =
|
|
139
|
-
|
|
148
|
+
let r = q === "rise" ? Math.max(0, window.innerHeight - M.bottom - e.getBoundingClientRect().bottom) : 0;
|
|
149
|
+
Lt.current?.style.setProperty("--chat-dock-composer", `${t.offsetHeight + n.offsetHeight + r}px`);
|
|
140
150
|
};
|
|
141
151
|
if (r(), typeof ResizeObserver > "u") return;
|
|
142
152
|
let i = new ResizeObserver(r);
|
|
143
153
|
return i.observe(t), i.observe(n), () => {
|
|
144
154
|
i.disconnect();
|
|
145
155
|
};
|
|
156
|
+
}, [
|
|
157
|
+
Jt,
|
|
158
|
+
q,
|
|
159
|
+
wt,
|
|
160
|
+
M.top,
|
|
161
|
+
M.bottom
|
|
162
|
+
]);
|
|
163
|
+
let Yt = j && S === "fixed" && q === "grow";
|
|
164
|
+
u(() => {
|
|
165
|
+
let e = Bt.current, t = Vt.current, n = F.current, r = z.current;
|
|
166
|
+
if (!Yt || e == null || t == null || n == null || r == null) {
|
|
167
|
+
It(null);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
let i = () => {
|
|
171
|
+
let i = getComputedStyle(e), a = getComputedStyle(r), o = Number.parseFloat(i.paddingTop) + Number.parseFloat(i.paddingBottom) + t.offsetHeight + Number.parseFloat(i.rowGap || "0") + n.offsetHeight + Number.parseFloat(a.paddingTop) + Number.parseFloat(a.paddingBottom);
|
|
172
|
+
It(ot({
|
|
173
|
+
normal: at(S, window.innerHeight, E),
|
|
174
|
+
needed: o,
|
|
175
|
+
max: Math.max(0, window.innerHeight - 7 * E)
|
|
176
|
+
}));
|
|
177
|
+
};
|
|
178
|
+
if (i(), typeof ResizeObserver > "u") return;
|
|
179
|
+
let a = new ResizeObserver(i);
|
|
180
|
+
return a.observe(n), a.observe(t), () => {
|
|
181
|
+
a.disconnect();
|
|
182
|
+
};
|
|
146
183
|
}, [
|
|
147
184
|
Yt,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
185
|
+
S,
|
|
186
|
+
E,
|
|
187
|
+
wt
|
|
188
|
+
]), u(() => {
|
|
189
|
+
let e = z.current;
|
|
190
|
+
I.current && !A && (B.current = !0), I.current = A, e != null && B.current && !A && (e.scrollTop = e.scrollHeight);
|
|
191
|
+
}), u(() => {
|
|
192
|
+
let e = z.current;
|
|
193
|
+
if (e == null || typeof ResizeObserver > "u") return;
|
|
194
|
+
let t = new ResizeObserver(() => {
|
|
195
|
+
!I.current && B.current && (e.scrollTop = e.scrollHeight);
|
|
196
|
+
});
|
|
197
|
+
return t.observe(e), () => {
|
|
198
|
+
t.disconnect();
|
|
199
|
+
};
|
|
200
|
+
}, []);
|
|
156
201
|
function Xt(e) {
|
|
157
|
-
!
|
|
202
|
+
!D || e.key !== "Escape" || e.defaultPrevented || (e.preventDefault(), W(!1));
|
|
158
203
|
}
|
|
159
|
-
let Zt = {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
thinking: b,
|
|
166
|
-
sentAfterId: kt
|
|
167
|
-
}), K = k ? "open" : "closed", q = r("medium"), J = r("fast"), Y = n(), X = t(1), Z = Y, Q = { duration: 0 }, $ = {
|
|
204
|
+
let Zt = A ? mt : ce, Qt = Ze(y), $t = !A && Qe(y, _), en = !A && $e({
|
|
205
|
+
followUps: b,
|
|
206
|
+
messages: _,
|
|
207
|
+
thinking: v,
|
|
208
|
+
sentAfterId: At
|
|
209
|
+
}), J = D ? "open" : "closed", Y = r("medium"), X = r("fast"), tn = n(), nn = t(1), Z = tn, Q = { duration: 0 }, $ = {
|
|
168
210
|
default: Q,
|
|
169
|
-
opacity:
|
|
170
|
-
},
|
|
171
|
-
height:
|
|
211
|
+
opacity: X
|
|
212
|
+
}, rn = 3.25 * E, an = {
|
|
213
|
+
height: rn,
|
|
172
214
|
left: 0,
|
|
173
215
|
right: 0,
|
|
174
|
-
borderRadius:
|
|
175
|
-
},
|
|
176
|
-
height:
|
|
177
|
-
left: -
|
|
178
|
-
right: -
|
|
179
|
-
borderRadius:
|
|
180
|
-
},
|
|
216
|
+
borderRadius: rn / 2
|
|
217
|
+
}, on = {
|
|
218
|
+
height: Yt && Ft != null ? Ft : at(S, wt, E),
|
|
219
|
+
left: -E,
|
|
220
|
+
right: -E,
|
|
221
|
+
borderRadius: E
|
|
222
|
+
}, sn = w ? {
|
|
181
223
|
open: {
|
|
182
|
-
...
|
|
224
|
+
...q === "grow" ? on : { y: 0 },
|
|
183
225
|
opacity: 1,
|
|
184
226
|
transition: $
|
|
185
227
|
},
|
|
186
228
|
closed: {
|
|
187
|
-
...
|
|
229
|
+
...q === "grow" ? on : { y: 0 },
|
|
188
230
|
opacity: 0,
|
|
189
231
|
transition: $
|
|
190
232
|
}
|
|
191
|
-
} :
|
|
233
|
+
} : q === "grow" ? {
|
|
192
234
|
open: {
|
|
193
|
-
...
|
|
235
|
+
...on,
|
|
194
236
|
opacity: 1,
|
|
195
|
-
transition:
|
|
237
|
+
transition: Y
|
|
196
238
|
},
|
|
197
239
|
closed: {
|
|
198
|
-
...
|
|
240
|
+
...an,
|
|
199
241
|
opacity: 1,
|
|
200
242
|
transition: {
|
|
201
|
-
...
|
|
243
|
+
...Y,
|
|
202
244
|
delay: Z
|
|
203
245
|
}
|
|
204
246
|
}
|
|
@@ -206,18 +248,18 @@ function y({ title: s, subtitle: c, mark: u, greeting: v, messages: y = [], thin
|
|
|
206
248
|
open: {
|
|
207
249
|
y: 0,
|
|
208
250
|
opacity: 1,
|
|
209
|
-
transition:
|
|
251
|
+
transition: Y
|
|
210
252
|
},
|
|
211
253
|
closed: {
|
|
212
254
|
y: "100%",
|
|
213
255
|
opacity: 1,
|
|
214
256
|
transition: {
|
|
215
|
-
...
|
|
257
|
+
...Y,
|
|
216
258
|
delay: Z
|
|
217
259
|
}
|
|
218
260
|
}
|
|
219
|
-
},
|
|
220
|
-
variants:
|
|
261
|
+
}, cn = {
|
|
262
|
+
variants: w ? {
|
|
221
263
|
open: {},
|
|
222
264
|
closed: {}
|
|
223
265
|
} : {
|
|
@@ -225,67 +267,67 @@ function y({ title: s, subtitle: c, mark: u, greeting: v, messages: y = [], thin
|
|
|
225
267
|
opacity: 1,
|
|
226
268
|
y: 0,
|
|
227
269
|
transition: {
|
|
228
|
-
...
|
|
229
|
-
delay:
|
|
270
|
+
...X,
|
|
271
|
+
delay: nn + e * tn
|
|
230
272
|
}
|
|
231
273
|
}),
|
|
232
274
|
closed: {
|
|
233
275
|
opacity: 0,
|
|
234
276
|
y: 8,
|
|
235
|
-
transition:
|
|
277
|
+
transition: X
|
|
236
278
|
}
|
|
237
279
|
},
|
|
238
280
|
initial: !1,
|
|
239
|
-
animate:
|
|
240
|
-
},
|
|
281
|
+
animate: J
|
|
282
|
+
}, ln = {
|
|
241
283
|
open: {
|
|
242
284
|
width: 0,
|
|
243
285
|
opacity: 0,
|
|
244
|
-
transition:
|
|
245
|
-
width:
|
|
246
|
-
opacity:
|
|
286
|
+
transition: w ? $ : {
|
|
287
|
+
width: Y,
|
|
288
|
+
opacity: X
|
|
247
289
|
}
|
|
248
290
|
},
|
|
249
291
|
closed: {
|
|
250
292
|
width: "auto",
|
|
251
293
|
opacity: 1,
|
|
252
|
-
transition:
|
|
294
|
+
transition: w ? $ : {
|
|
253
295
|
width: {
|
|
254
|
-
...
|
|
296
|
+
...Y,
|
|
255
297
|
delay: Z
|
|
256
298
|
},
|
|
257
299
|
opacity: {
|
|
258
|
-
...
|
|
259
|
-
delay:
|
|
300
|
+
...X,
|
|
301
|
+
delay: nn
|
|
260
302
|
}
|
|
261
303
|
}
|
|
262
304
|
}
|
|
263
|
-
},
|
|
305
|
+
}, un = {
|
|
264
306
|
open: {
|
|
265
307
|
height: "auto",
|
|
266
308
|
opacity: 1,
|
|
267
|
-
transition:
|
|
268
|
-
height:
|
|
309
|
+
transition: w ? $ : {
|
|
310
|
+
height: Y,
|
|
269
311
|
opacity: {
|
|
270
|
-
...
|
|
271
|
-
delay:
|
|
312
|
+
...X,
|
|
313
|
+
delay: nn
|
|
272
314
|
}
|
|
273
315
|
}
|
|
274
316
|
},
|
|
275
317
|
closed: {
|
|
276
318
|
height: 0,
|
|
277
319
|
opacity: 0,
|
|
278
|
-
transition:
|
|
320
|
+
transition: w ? $ : {
|
|
279
321
|
height: {
|
|
280
|
-
...
|
|
322
|
+
...Y,
|
|
281
323
|
delay: Z
|
|
282
324
|
},
|
|
283
|
-
opacity:
|
|
325
|
+
opacity: X
|
|
284
326
|
}
|
|
285
327
|
}
|
|
286
|
-
},
|
|
287
|
-
initial: !
|
|
288
|
-
animate:
|
|
328
|
+
}, dn = {
|
|
329
|
+
initial: !w && "hidden",
|
|
330
|
+
animate: D ? "visible" : "folded",
|
|
289
331
|
exit: {
|
|
290
332
|
opacity: 0,
|
|
291
333
|
transition: Q
|
|
@@ -295,16 +337,16 @@ function y({ title: s, subtitle: c, mark: u, greeting: v, messages: y = [], thin
|
|
|
295
337
|
visible: {
|
|
296
338
|
opacity: 1,
|
|
297
339
|
transition: {
|
|
298
|
-
...
|
|
299
|
-
staggerChildren:
|
|
340
|
+
...X,
|
|
341
|
+
staggerChildren: tn
|
|
300
342
|
}
|
|
301
343
|
},
|
|
302
344
|
folded: {
|
|
303
345
|
opacity: 0,
|
|
304
|
-
transition:
|
|
346
|
+
transition: w ? Q : X
|
|
305
347
|
}
|
|
306
348
|
}
|
|
307
|
-
},
|
|
349
|
+
}, fn = {
|
|
308
350
|
hidden: {
|
|
309
351
|
opacity: 0,
|
|
310
352
|
y: 6
|
|
@@ -312,178 +354,215 @@ function y({ title: s, subtitle: c, mark: u, greeting: v, messages: y = [], thin
|
|
|
312
354
|
visible: {
|
|
313
355
|
opacity: 1,
|
|
314
356
|
y: 0,
|
|
315
|
-
transition:
|
|
357
|
+
transition: X
|
|
316
358
|
}
|
|
317
|
-
},
|
|
318
|
-
function
|
|
319
|
-
let r =
|
|
320
|
-
return /* @__PURE__ */
|
|
321
|
-
className: e(
|
|
359
|
+
}, pn = (e) => e.preventDefault(), mn = T ? "sm" : "md";
|
|
360
|
+
function hn(t, n) {
|
|
361
|
+
let r = O?.id === t.id, i = t.feedback ?? null, a = (e) => ft?.(t, i === e ? null : e);
|
|
362
|
+
return /* @__PURE__ */ m("div", {
|
|
363
|
+
className: e(Ce, n.ready ? void 0 : we),
|
|
322
364
|
"data-reply-actions": n.ready ? "ready" : "pending",
|
|
323
|
-
children: [n.copy || n.vote ? /* @__PURE__ */
|
|
324
|
-
className:
|
|
325
|
-
children: [n.copy ? /* @__PURE__ */
|
|
326
|
-
size:
|
|
327
|
-
icon:
|
|
328
|
-
"aria-label": r ?
|
|
329
|
-
onClick: () =>
|
|
330
|
-
}) : null, n.vote ? /* @__PURE__ */
|
|
331
|
-
size:
|
|
332
|
-
icon: /* @__PURE__ */
|
|
333
|
-
"aria-label":
|
|
365
|
+
children: [n.copy || n.vote ? /* @__PURE__ */ m("div", {
|
|
366
|
+
className: Te,
|
|
367
|
+
children: [n.copy ? /* @__PURE__ */ p(o, {
|
|
368
|
+
size: mn,
|
|
369
|
+
icon: p(r ? He : Ue, {}),
|
|
370
|
+
"aria-label": r ? C.copied : C.copy,
|
|
371
|
+
onClick: () => Gt(t)
|
|
372
|
+
}) : null, n.vote ? /* @__PURE__ */ m(qe, { children: [/* @__PURE__ */ p(o, {
|
|
373
|
+
size: mn,
|
|
374
|
+
icon: /* @__PURE__ */ p(Ke, {}),
|
|
375
|
+
"aria-label": C.helpful,
|
|
334
376
|
pressed: i === "up",
|
|
335
377
|
onClick: () => a("up")
|
|
336
|
-
}), /* @__PURE__ */
|
|
337
|
-
size:
|
|
338
|
-
icon: /* @__PURE__ */
|
|
339
|
-
"aria-label":
|
|
378
|
+
}), /* @__PURE__ */ p(o, {
|
|
379
|
+
size: mn,
|
|
380
|
+
icon: /* @__PURE__ */ p(Ge, {}),
|
|
381
|
+
"aria-label": C.notHelpful,
|
|
340
382
|
pressed: i === "down",
|
|
341
383
|
onClick: () => a("down")
|
|
342
384
|
})] }) : null]
|
|
343
|
-
}) : null, t.meta == null ? null : /* @__PURE__ */
|
|
344
|
-
className:
|
|
345
|
-
children: [t.meta.label, t.meta.description == null ? null : /* @__PURE__ */
|
|
385
|
+
}) : null, t.meta == null ? null : /* @__PURE__ */ m("p", {
|
|
386
|
+
className: De,
|
|
387
|
+
children: [t.meta.label, t.meta.description == null ? null : /* @__PURE__ */ m("span", {
|
|
346
388
|
className: "sr-only",
|
|
347
389
|
children: [". ", t.meta.description]
|
|
348
390
|
})]
|
|
349
391
|
})]
|
|
350
392
|
});
|
|
351
393
|
}
|
|
352
|
-
return /* @__PURE__ */
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
"data-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
"--chat-dock-vv-
|
|
359
|
-
"--chat-dock-vv-bottom": `${F.bottom}px`
|
|
394
|
+
return /* @__PURE__ */ p("div", {
|
|
395
|
+
className: e(Oe[S], S === "fixed" && !k ? ke : void 0, bt),
|
|
396
|
+
"data-open": D ? "" : void 0,
|
|
397
|
+
"data-gate": j ? "" : void 0,
|
|
398
|
+
style: M.top > 0 || M.bottom > 0 ? {
|
|
399
|
+
"--chat-dock-vv-top": `${M.top}px`,
|
|
400
|
+
"--chat-dock-vv-bottom": `${M.bottom}px`
|
|
360
401
|
} : void 0,
|
|
361
|
-
children:
|
|
362
|
-
|
|
363
|
-
children:
|
|
364
|
-
className: Ne,
|
|
365
|
-
"aria-hidden": "true",
|
|
366
|
-
"data-chat-dock-scrim": "",
|
|
367
|
-
initial: { opacity: 0 },
|
|
368
|
-
animate: {
|
|
369
|
-
opacity: 1,
|
|
370
|
-
transition: E ? J : q
|
|
371
|
-
},
|
|
372
|
-
exit: {
|
|
373
|
-
opacity: 0,
|
|
374
|
-
transition: E ? J : q
|
|
375
|
-
},
|
|
376
|
-
onClick: () => U(!1)
|
|
377
|
-
}, "scrim") : null
|
|
378
|
-
}), /* @__PURE__ */ m("div", {
|
|
379
|
-
className: xe,
|
|
380
|
-
children: /* @__PURE__ */ m("div", {
|
|
402
|
+
children: /* @__PURE__ */ p("div", {
|
|
403
|
+
className: ye,
|
|
404
|
+
children: /* @__PURE__ */ p("div", {
|
|
381
405
|
className: "band",
|
|
382
|
-
children: /* @__PURE__ */
|
|
383
|
-
ref:
|
|
384
|
-
className: e(
|
|
385
|
-
role:
|
|
386
|
-
"aria-modal":
|
|
387
|
-
"aria-labelledby":
|
|
388
|
-
"aria-describedby":
|
|
406
|
+
children: /* @__PURE__ */ m("div", {
|
|
407
|
+
ref: N,
|
|
408
|
+
className: e(pe, k ? me : void 0),
|
|
409
|
+
role: D ? "dialog" : void 0,
|
|
410
|
+
"aria-modal": D ? "false" : void 0,
|
|
411
|
+
"aria-labelledby": D ? xt : void 0,
|
|
412
|
+
"aria-describedby": D && Zt != null ? St : void 0,
|
|
389
413
|
onKeyDown: Xt,
|
|
390
414
|
children: [
|
|
391
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ p(h, {
|
|
392
416
|
initial: !1,
|
|
393
|
-
children: !
|
|
394
|
-
className:
|
|
417
|
+
children: !D && Qt.length > 0 ? /* @__PURE__ */ p(g.div, {
|
|
418
|
+
className: Se,
|
|
395
419
|
role: "group",
|
|
396
|
-
"aria-label":
|
|
420
|
+
"aria-label": C.suggestions,
|
|
397
421
|
exit: {
|
|
398
422
|
opacity: 0,
|
|
399
|
-
transition:
|
|
423
|
+
transition: w ? Q : X
|
|
400
424
|
},
|
|
401
|
-
children: Qt.map((e, t) => /* @__PURE__ */
|
|
402
|
-
className:
|
|
425
|
+
children: Qt.map((e, t) => /* @__PURE__ */ p("span", {
|
|
426
|
+
className: xe,
|
|
403
427
|
style: { "--chat-dock-pill-index": t },
|
|
404
|
-
children: /* @__PURE__ */
|
|
428
|
+
children: /* @__PURE__ */ p(a, {
|
|
405
429
|
type: "button",
|
|
406
430
|
role: "secondary",
|
|
407
431
|
size: "md",
|
|
408
432
|
icon: e.icon,
|
|
409
|
-
onClick: () =>
|
|
433
|
+
onClick: () => G(e),
|
|
410
434
|
children: e.label
|
|
411
435
|
})
|
|
412
436
|
}, e.id))
|
|
413
437
|
}, "pills") : null
|
|
414
438
|
}),
|
|
415
|
-
/* @__PURE__ */
|
|
416
|
-
ref:
|
|
417
|
-
className:
|
|
418
|
-
"data-chat-dock-window":
|
|
419
|
-
hidden:
|
|
420
|
-
variants: an,
|
|
439
|
+
/* @__PURE__ */ p(g.div, {
|
|
440
|
+
ref: Lt,
|
|
441
|
+
className: Le[S],
|
|
442
|
+
"data-chat-dock-window": J,
|
|
443
|
+
hidden: k,
|
|
421
444
|
initial: !1,
|
|
422
|
-
animate:
|
|
423
|
-
onAnimationComplete: (
|
|
424
|
-
|
|
445
|
+
animate: sn[J],
|
|
446
|
+
onAnimationComplete: () => {
|
|
447
|
+
U.current || Pt(!0);
|
|
425
448
|
},
|
|
426
|
-
children:
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
animate: M ? {
|
|
430
|
-
opacity: 0,
|
|
431
|
-
transition: k ? J : Q
|
|
432
|
-
} : {
|
|
433
|
-
opacity: 1,
|
|
434
|
-
transition: k && !E ? {
|
|
435
|
-
...J,
|
|
436
|
-
delay: X
|
|
437
|
-
} : k ? J : Q
|
|
438
|
-
},
|
|
439
|
-
onAnimationComplete: () => {
|
|
440
|
-
M && Ft(!0);
|
|
441
|
-
},
|
|
449
|
+
children: /* @__PURE__ */ m("div", {
|
|
450
|
+
ref: Bt,
|
|
451
|
+
className: Re,
|
|
442
452
|
children: [
|
|
443
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ p(g.div, {
|
|
454
|
+
ref: Vt,
|
|
444
455
|
className: "shrink-0",
|
|
445
456
|
custom: 0,
|
|
446
|
-
...
|
|
447
|
-
children: /* @__PURE__ */
|
|
448
|
-
titleId:
|
|
449
|
-
descriptionId:
|
|
457
|
+
...cn,
|
|
458
|
+
children: /* @__PURE__ */ p(ne, {
|
|
459
|
+
titleId: xt,
|
|
460
|
+
descriptionId: St,
|
|
450
461
|
title: s,
|
|
451
|
-
description:
|
|
452
|
-
headerStart:
|
|
453
|
-
closeLabel:
|
|
454
|
-
onClose: () =>
|
|
462
|
+
description: Zt,
|
|
463
|
+
headerStart: c,
|
|
464
|
+
closeLabel: C.close,
|
|
465
|
+
onClose: () => W(!1),
|
|
455
466
|
delineated: !0
|
|
456
467
|
})
|
|
457
468
|
}),
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
-
ref:
|
|
460
|
-
className:
|
|
469
|
+
/* @__PURE__ */ p(g.div, {
|
|
470
|
+
ref: z,
|
|
471
|
+
className: Pe,
|
|
461
472
|
role: "log",
|
|
462
|
-
"aria-label":
|
|
473
|
+
"aria-label": C.conversation,
|
|
463
474
|
tabIndex: 0,
|
|
464
475
|
custom: 1,
|
|
465
|
-
...
|
|
476
|
+
...cn,
|
|
466
477
|
onScroll: (e) => {
|
|
467
478
|
let t = e.currentTarget;
|
|
468
|
-
|
|
479
|
+
B.current = t.scrollHeight - t.scrollTop - t.clientHeight <= nt;
|
|
469
480
|
},
|
|
470
|
-
children:
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
481
|
+
children: /* @__PURE__ */ m("div", {
|
|
482
|
+
ref: F,
|
|
483
|
+
className: Fe,
|
|
484
|
+
children: [Xe == null ? null : /* @__PURE__ */ p("div", {
|
|
485
|
+
className: le,
|
|
486
|
+
children: Xe
|
|
487
|
+
}), /* @__PURE__ */ m(h, {
|
|
488
|
+
initial: !1,
|
|
489
|
+
children: [
|
|
490
|
+
_.map((e, t) => {
|
|
491
|
+
let n = A ? null : et({
|
|
492
|
+
message: e,
|
|
493
|
+
isLatest: t === _.length - 1,
|
|
494
|
+
thinking: v,
|
|
495
|
+
takesVotes: ft != null
|
|
496
|
+
});
|
|
497
|
+
return /* @__PURE__ */ p(g.div, {
|
|
498
|
+
"data-role": e.role,
|
|
499
|
+
className: e.role === "user" ? Ie : n == null ? le : Ee,
|
|
500
|
+
initial: !w && {
|
|
501
|
+
opacity: 0,
|
|
502
|
+
y: 8
|
|
503
|
+
},
|
|
504
|
+
animate: {
|
|
505
|
+
opacity: 1,
|
|
506
|
+
y: 0
|
|
507
|
+
},
|
|
508
|
+
transition: X,
|
|
509
|
+
children: n == null ? e.content : /* @__PURE__ */ m(qe, { children: [/* @__PURE__ */ p("div", {
|
|
510
|
+
className: le,
|
|
511
|
+
children: e.content
|
|
512
|
+
}), hn(e, n)] })
|
|
513
|
+
}, e.id);
|
|
514
|
+
}),
|
|
515
|
+
en && dt === "inline" ? /* @__PURE__ */ p(g.div, {
|
|
516
|
+
role: "group",
|
|
517
|
+
"aria-label": C.followUps,
|
|
518
|
+
"data-follow-ups": "inline",
|
|
519
|
+
className: _e,
|
|
520
|
+
...dn,
|
|
521
|
+
animate: "visible",
|
|
522
|
+
children: b.map((e) => /* @__PURE__ */ p(g.div, {
|
|
523
|
+
className: he,
|
|
524
|
+
variants: fn,
|
|
525
|
+
children: /* @__PURE__ */ p(a, {
|
|
526
|
+
type: "button",
|
|
527
|
+
role: "ghost",
|
|
528
|
+
layout: "row",
|
|
529
|
+
onMouseDown: pn,
|
|
530
|
+
onClick: () => Kt(e),
|
|
531
|
+
children: /* @__PURE__ */ m("span", {
|
|
532
|
+
className: Me,
|
|
533
|
+
children: [/* @__PURE__ */ p(i, {
|
|
534
|
+
size: "md",
|
|
535
|
+
children: /* @__PURE__ */ p(We, {})
|
|
536
|
+
}), /* @__PURE__ */ p("span", {
|
|
537
|
+
className: Ae,
|
|
538
|
+
children: e.label
|
|
539
|
+
})]
|
|
540
|
+
})
|
|
541
|
+
})
|
|
542
|
+
}, e.id))
|
|
543
|
+
}, "follow-ups") : null,
|
|
544
|
+
v ? /* @__PURE__ */ m(g.div, {
|
|
545
|
+
className: Ne,
|
|
546
|
+
initial: !w && { opacity: 0 },
|
|
547
|
+
animate: { opacity: 1 },
|
|
548
|
+
exit: {
|
|
549
|
+
opacity: 0,
|
|
550
|
+
transition: Q
|
|
551
|
+
},
|
|
552
|
+
transition: X,
|
|
553
|
+
children: [/* @__PURE__ */ p(ee, {
|
|
554
|
+
variant: "dot",
|
|
555
|
+
tone: "neutral",
|
|
556
|
+
pulsing: !0,
|
|
557
|
+
besideLabel: !0
|
|
558
|
+
}), /* @__PURE__ */ p("span", { children: C.thinking })]
|
|
559
|
+
}, "thinking") : null,
|
|
560
|
+
A ? /* @__PURE__ */ p(g.div, {
|
|
561
|
+
ref: P,
|
|
562
|
+
className: ve,
|
|
563
|
+
"data-chat-dock-gate": "",
|
|
564
|
+
"aria-live": "off",
|
|
565
|
+
initial: !w && {
|
|
487
566
|
opacity: 0,
|
|
488
567
|
y: 8
|
|
489
568
|
},
|
|
@@ -491,207 +570,123 @@ function y({ title: s, subtitle: c, mark: u, greeting: v, messages: y = [], thin
|
|
|
491
570
|
opacity: 1,
|
|
492
571
|
y: 0
|
|
493
572
|
},
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
role: "group",
|
|
503
|
-
"aria-label": T.followUps,
|
|
504
|
-
"data-follow-ups": "inline",
|
|
505
|
-
className: ye,
|
|
506
|
-
...ln,
|
|
507
|
-
animate: "visible",
|
|
508
|
-
children: S.map((e) => /* @__PURE__ */ m(_.div, {
|
|
509
|
-
className: _e,
|
|
510
|
-
variants: un,
|
|
511
|
-
children: /* @__PURE__ */ m(a, {
|
|
512
|
-
type: "button",
|
|
513
|
-
role: "ghost",
|
|
514
|
-
layout: "row",
|
|
515
|
-
onMouseDown: dn,
|
|
516
|
-
onClick: () => qt(e),
|
|
517
|
-
children: /* @__PURE__ */ h("span", {
|
|
518
|
-
className: Ie,
|
|
519
|
-
children: [/* @__PURE__ */ m(i, {
|
|
520
|
-
size: "md",
|
|
521
|
-
children: /* @__PURE__ */ m(Je, {})
|
|
522
|
-
}), /* @__PURE__ */ m("span", {
|
|
523
|
-
className: Pe,
|
|
524
|
-
children: e.label
|
|
525
|
-
})]
|
|
526
|
-
})
|
|
573
|
+
exit: {
|
|
574
|
+
opacity: 0,
|
|
575
|
+
transition: Q
|
|
576
|
+
},
|
|
577
|
+
transition: X,
|
|
578
|
+
children: /* @__PURE__ */ p(re.Provider, {
|
|
579
|
+
value: K,
|
|
580
|
+
children: pt
|
|
527
581
|
})
|
|
528
|
-
},
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
initial: !E && { opacity: 0 },
|
|
533
|
-
animate: { opacity: 1 },
|
|
534
|
-
exit: {
|
|
535
|
-
opacity: 0,
|
|
536
|
-
transition: Q
|
|
537
|
-
},
|
|
538
|
-
transition: J,
|
|
539
|
-
children: [/* @__PURE__ */ m(ee, {
|
|
540
|
-
variant: "dot",
|
|
541
|
-
tone: "neutral",
|
|
542
|
-
pulsing: !0,
|
|
543
|
-
besideLabel: !0
|
|
544
|
-
}), /* @__PURE__ */ m("span", { children: T.thinking })]
|
|
545
|
-
}, "thinking") : null
|
|
546
|
-
]
|
|
547
|
-
})]
|
|
582
|
+
}, "gate") : null
|
|
583
|
+
]
|
|
584
|
+
})]
|
|
585
|
+
})
|
|
548
586
|
}),
|
|
549
|
-
$t ? /* @__PURE__ */
|
|
550
|
-
className:
|
|
587
|
+
$t ? /* @__PURE__ */ p(g.div, {
|
|
588
|
+
className: je,
|
|
551
589
|
role: "group",
|
|
552
|
-
"aria-label":
|
|
590
|
+
"aria-label": C.suggestions,
|
|
553
591
|
custom: 2,
|
|
554
|
-
...
|
|
555
|
-
children:
|
|
592
|
+
...cn,
|
|
593
|
+
children: y.map((e) => /* @__PURE__ */ p(a, {
|
|
556
594
|
type: "button",
|
|
557
595
|
role: "ghost",
|
|
558
596
|
layout: "row",
|
|
559
|
-
onMouseDown: e.prompt == null ? void 0 :
|
|
560
|
-
onClick: () =>
|
|
561
|
-
children: /* @__PURE__ */
|
|
562
|
-
className:
|
|
563
|
-
children: [e.icon == null ? null : /* @__PURE__ */
|
|
597
|
+
onMouseDown: e.prompt == null ? void 0 : pn,
|
|
598
|
+
onClick: () => qt(e),
|
|
599
|
+
children: /* @__PURE__ */ m("span", {
|
|
600
|
+
className: Me,
|
|
601
|
+
children: [e.icon == null ? null : /* @__PURE__ */ p(i, {
|
|
564
602
|
size: "md",
|
|
565
603
|
children: e.icon
|
|
566
|
-
}), /* @__PURE__ */
|
|
567
|
-
className:
|
|
604
|
+
}), /* @__PURE__ */ p("span", {
|
|
605
|
+
className: Ae,
|
|
568
606
|
children: e.label
|
|
569
607
|
})]
|
|
570
608
|
})
|
|
571
609
|
}, e.id))
|
|
572
610
|
}) : null,
|
|
573
|
-
/* @__PURE__ */
|
|
611
|
+
/* @__PURE__ */ p(h, {
|
|
574
612
|
initial: !1,
|
|
575
|
-
children: en && dt === "composer" ? /* @__PURE__ */
|
|
613
|
+
children: en && dt === "composer" ? /* @__PURE__ */ p(g.div, {
|
|
576
614
|
role: "group",
|
|
577
|
-
"aria-label":
|
|
615
|
+
"aria-label": C.followUps,
|
|
578
616
|
"data-follow-ups": "composer",
|
|
579
|
-
className:
|
|
580
|
-
...
|
|
581
|
-
children:
|
|
617
|
+
className: ge,
|
|
618
|
+
...dn,
|
|
619
|
+
children: b.map((e) => /* @__PURE__ */ p(g.span, {
|
|
582
620
|
className: "inline-flex",
|
|
583
|
-
variants:
|
|
584
|
-
children: /* @__PURE__ */
|
|
621
|
+
variants: fn,
|
|
622
|
+
children: /* @__PURE__ */ p(a, {
|
|
585
623
|
type: "button",
|
|
586
624
|
role: "secondary",
|
|
587
625
|
size: "md",
|
|
588
|
-
onMouseDown:
|
|
589
|
-
onClick: () =>
|
|
626
|
+
onMouseDown: pn,
|
|
627
|
+
onClick: () => Kt(e),
|
|
590
628
|
children: e.label
|
|
591
629
|
})
|
|
592
630
|
}, e.id))
|
|
593
631
|
}, "follow-ups") : null
|
|
594
632
|
})
|
|
595
633
|
]
|
|
596
|
-
})
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
ref: Ht,
|
|
600
|
-
className: be[w],
|
|
601
|
-
"data-chat-dock-gate": "",
|
|
602
|
-
initial: { opacity: 0 },
|
|
603
|
-
animate: k ? {
|
|
604
|
-
opacity: 1,
|
|
605
|
-
transition: E ? J : {
|
|
606
|
-
...J,
|
|
607
|
-
delay: X
|
|
608
|
-
}
|
|
609
|
-
} : {
|
|
610
|
-
opacity: 0,
|
|
611
|
-
transition: J
|
|
612
|
-
},
|
|
613
|
-
exit: {
|
|
614
|
-
opacity: 0,
|
|
615
|
-
transition: J
|
|
616
|
-
},
|
|
617
|
-
children: /* @__PURE__ */ m(oe.Provider, {
|
|
618
|
-
value: Zt,
|
|
619
|
-
children: pt
|
|
620
|
-
})
|
|
621
|
-
}, "gate") : null
|
|
622
|
-
})]
|
|
623
|
-
}, G),
|
|
624
|
-
/* @__PURE__ */ m("span", {
|
|
634
|
+
})
|
|
635
|
+
}, q),
|
|
636
|
+
/* @__PURE__ */ p("span", {
|
|
625
637
|
className: "sr-only",
|
|
626
638
|
role: "status",
|
|
627
|
-
children:
|
|
639
|
+
children: O == null ? "" : C.copied
|
|
628
640
|
}),
|
|
629
|
-
/* @__PURE__ */
|
|
630
|
-
className:
|
|
631
|
-
children: [/* @__PURE__ */
|
|
632
|
-
ref:
|
|
633
|
-
children: /* @__PURE__ */
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
opacity: 0,
|
|
639
|
-
transition: J
|
|
640
|
-
} : {
|
|
641
|
-
opacity: 1,
|
|
642
|
-
transition: k && !E ? {
|
|
643
|
-
...J,
|
|
644
|
-
delay: X
|
|
645
|
-
} : J
|
|
641
|
+
/* @__PURE__ */ m("div", {
|
|
642
|
+
className: ue,
|
|
643
|
+
children: [/* @__PURE__ */ p("div", {
|
|
644
|
+
ref: Rt,
|
|
645
|
+
children: /* @__PURE__ */ p(te, {
|
|
646
|
+
ref: R,
|
|
647
|
+
value: Ot,
|
|
648
|
+
onValueChange: (e) => {
|
|
649
|
+
kt(e), W(!0);
|
|
646
650
|
},
|
|
647
|
-
|
|
648
|
-
|
|
651
|
+
onSend: Wt,
|
|
652
|
+
onFocus: () => {
|
|
653
|
+
V.current || W(!0);
|
|
649
654
|
},
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
"aria-hidden": k ? !0 : void 0,
|
|
664
|
-
variants: sn,
|
|
665
|
-
initial: !1,
|
|
666
|
-
animate: K,
|
|
667
|
-
children: u
|
|
668
|
-
}),
|
|
669
|
-
placeholder: _t,
|
|
670
|
-
"aria-label": T.field,
|
|
671
|
-
sendLabel: T.send
|
|
672
|
-
})
|
|
655
|
+
onClick: () => W(!0),
|
|
656
|
+
disabled: j,
|
|
657
|
+
start: c == null ? void 0 : /* @__PURE__ */ p(g.span, {
|
|
658
|
+
className: be,
|
|
659
|
+
"aria-hidden": D ? !0 : void 0,
|
|
660
|
+
variants: ln,
|
|
661
|
+
initial: !1,
|
|
662
|
+
animate: J,
|
|
663
|
+
children: c
|
|
664
|
+
}),
|
|
665
|
+
placeholder: j ? C.gatePlaceholder : vt,
|
|
666
|
+
"aria-label": C.field,
|
|
667
|
+
sendLabel: C.send
|
|
673
668
|
})
|
|
674
|
-
}), /* @__PURE__ */
|
|
669
|
+
}), /* @__PURE__ */ p(g.div, {
|
|
675
670
|
className: "overflow-hidden",
|
|
676
|
-
"aria-hidden": !
|
|
677
|
-
variants:
|
|
671
|
+
"aria-hidden": !D || void 0,
|
|
672
|
+
variants: un,
|
|
678
673
|
initial: !1,
|
|
679
|
-
animate:
|
|
680
|
-
children: /* @__PURE__ */
|
|
681
|
-
ref:
|
|
682
|
-
children:
|
|
683
|
-
className:
|
|
684
|
-
children:
|
|
685
|
-
})
|
|
674
|
+
animate: J,
|
|
675
|
+
children: /* @__PURE__ */ p("div", {
|
|
676
|
+
ref: zt,
|
|
677
|
+
children: x == null ? /* @__PURE__ */ p("div", { className: de[S] }) : /* @__PURE__ */ p("p", {
|
|
678
|
+
className: fe[S],
|
|
679
|
+
children: x
|
|
680
|
+
})
|
|
686
681
|
})
|
|
687
682
|
})]
|
|
688
683
|
})
|
|
689
684
|
]
|
|
690
685
|
})
|
|
691
686
|
})
|
|
692
|
-
})
|
|
687
|
+
})
|
|
693
688
|
});
|
|
694
689
|
}
|
|
695
|
-
var
|
|
690
|
+
var v = Object.assign(_, { Gate: s });
|
|
696
691
|
//#endregion
|
|
697
|
-
export {
|
|
692
|
+
export { v as ChatDock, s as ChatDockGate, Ye as chatDockDefaultLabels, Xe as chatDockFollowUpsPlacements, ce as chatDockGateDefaultLabels, ot as chatDockGateWindowHeight, at as chatDockOpenHeight, Ze as chatDockPillSuggestions, c as chatDockPlacements, et as chatDockReplyRow, $e as chatDockShowsFollowUps, Qe as chatDockShowsSuggestionRows };
|