@inkandswitch/patchwork-pkg-base 0.0.7 → 0.0.8
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/modules.json +4 -0
- package/package.json +1 -1
- package/packages/account-history/dist/assets/HistoryRecorder-HO_sxeuE.js +248 -0
- package/packages/account-history/dist/assets/HistoryRecorder-HO_sxeuE.js.map +1 -0
- package/packages/account-history/dist/assets/HistoryViewer-Ct5g7zek.js +308 -0
- package/packages/account-history/dist/assets/HistoryViewer-Ct5g7zek.js.map +1 -0
- package/packages/account-history/dist/assets/NotebookViewer-BkYJL6Jc.js +504 -0
- package/packages/account-history/dist/assets/NotebookViewer-BkYJL6Jc.js.map +1 -0
- package/packages/account-history/dist/assets/index-CFzuSuJg.js +148 -0
- package/packages/account-history/dist/assets/index-CFzuSuJg.js.map +1 -0
- package/packages/account-history/dist/assets/makeDocumentProjection-DXgEZYyv.js +706 -0
- package/packages/account-history/dist/assets/makeDocumentProjection-DXgEZYyv.js.map +1 -0
- package/packages/account-history/dist/assets/store-CRmRL4Cv.js +1079 -0
- package/packages/account-history/dist/assets/store-CRmRL4Cv.js.map +1 -0
- package/packages/account-history/dist/index.js +5 -0
- package/packages/account-history/dist/index.js.map +1 -0
- package/packages/account-history/package.json +33 -0
- package/packages/chat/dist/ChatRoot-BXsklgz7.js +6113 -0
- package/packages/chat/dist/context-tool-CenQrztX.js +107 -0
- package/packages/chat/dist/datatype-1niKKK-c.js +15 -0
- package/packages/chat/dist/index-DYFHDHZ9.js +368 -0
- package/packages/chat/dist/index.js +5 -0
- package/packages/chat/dist/tool-D9BTS5wc.js +38 -0
- package/packages/chat/package.json +42 -0
- package/packages/comments-view/dist/assets/comments-D9lwpHOh.js +50 -0
- package/packages/comments-view/dist/assets/comments-D9lwpHOh.js.map +1 -0
- package/packages/comments-view/dist/assets/datatype-C4SMwWiO.js +22 -0
- package/packages/comments-view/dist/assets/datatype-C4SMwWiO.js.map +1 -0
- package/packages/comments-view/dist/assets/main-C8GVksuY.js +2973 -0
- package/packages/comments-view/dist/assets/main-C8GVksuY.js.map +1 -0
- package/packages/comments-view/dist/index.js +115 -0
- package/packages/comments-view/dist/index.js.map +1 -0
- package/packages/comments-view/package.json +36 -0
- package/packages/drafts/dist/assets/DraftDatatype-Dn8VF6oC.js +14 -0
- package/packages/drafts/dist/assets/DraftDatatype-Dn8VF6oC.js.map +1 -0
- package/packages/drafts/dist/assets/DraftListProvider-DVhUGU1x.js +362 -0
- package/packages/drafts/dist/assets/DraftListProvider-DVhUGU1x.js.map +1 -0
- package/packages/drafts/dist/assets/DraftOverlayProvider-NMDqnpBV.js +123 -0
- package/packages/drafts/dist/assets/DraftOverlayProvider-NMDqnpBV.js.map +1 -0
- package/packages/drafts/dist/assets/clone-policy-D4XOfZxs.js +15 -0
- package/packages/drafts/dist/assets/clone-policy-D4XOfZxs.js.map +1 -0
- package/packages/drafts/dist/assets/index-DAqs20jZ.js +65 -0
- package/packages/drafts/dist/assets/index-DAqs20jZ.js.map +1 -0
- package/packages/drafts/dist/assets/main-Cdev7z-t.js +2366 -0
- package/packages/drafts/dist/assets/main-Cdev7z-t.js.map +1 -0
- package/packages/drafts/dist/index.js +140 -0
- package/packages/drafts/dist/index.js.map +1 -0
- package/packages/drafts/package.json +34 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { render as k, createComponent as y, insert as H, template as U } from "solid-js/web";
|
|
2
|
+
import { createSignal as C, createEffect as m, onCleanup as S, Show as x } from "solid-js";
|
|
3
|
+
import { C as T, s as _ } from "./ChatRoot-BXsklgz7.js";
|
|
4
|
+
import { s as v, t as D } from "./index-DYFHDHZ9.js";
|
|
5
|
+
var L = /* @__PURE__ */ U("<div class=chat-context-empty>");
|
|
6
|
+
const g = ["computer", "model"], A = ["computer"];
|
|
7
|
+
function w(e) {
|
|
8
|
+
return Array.isArray(e) && e.length === A.length && e.every((r, c) => r === A[c]);
|
|
9
|
+
}
|
|
10
|
+
async function I(e, r, c) {
|
|
11
|
+
const s = await e.find(r), l = s.doc()?.["@patchwork"]?.chitchat;
|
|
12
|
+
if (l) {
|
|
13
|
+
const i = await e.find(l);
|
|
14
|
+
return i.change((t) => {
|
|
15
|
+
const n = !Array.isArray(t.plugins);
|
|
16
|
+
n ? t.plugins = c.slice() : w(t.plugins) && (t.plugins = g.slice()), n && t["@patchwork"]?.type === "chitterchatter" && (t["@patchwork"].type = "chat");
|
|
17
|
+
}), i;
|
|
18
|
+
}
|
|
19
|
+
const f = s.doc()?.title, u = await e.create2({
|
|
20
|
+
title: "chat: " + (f || "document"),
|
|
21
|
+
messages: [],
|
|
22
|
+
docs: [],
|
|
23
|
+
// Seed the plugin set from the user's remembered chitchat default (starts as
|
|
24
|
+
// just the computer). The computer is auto-invited below.
|
|
25
|
+
plugins: c.slice(),
|
|
26
|
+
"@patchwork": {
|
|
27
|
+
type: "chat"
|
|
28
|
+
},
|
|
29
|
+
// Auto-invite the computer (ChatRoot's onMount claims the host when
|
|
30
|
+
// hasComputer is set) — but it stays off nosey, so it only replies when
|
|
31
|
+
// @mentioned or replied to.
|
|
32
|
+
hasComputer: !0
|
|
33
|
+
}), h = await e.find(u.url);
|
|
34
|
+
return s.change((i) => {
|
|
35
|
+
i["@patchwork"] || (i["@patchwork"] = {}), i["@patchwork"].chitchat = h.url;
|
|
36
|
+
}), h;
|
|
37
|
+
}
|
|
38
|
+
function E(e) {
|
|
39
|
+
const r = v(e.element), [c, s] = C(null);
|
|
40
|
+
let l = null;
|
|
41
|
+
const f = D(e.element, "chitchat"), [u, h] = C(null);
|
|
42
|
+
m(() => {
|
|
43
|
+
const t = f();
|
|
44
|
+
t && e.repo.find(t).then((n) => {
|
|
45
|
+
const o = n;
|
|
46
|
+
Array.isArray(o.doc()?.defaultPlugins) ? w(o.doc()?.defaultPlugins) && o.change((a) => {
|
|
47
|
+
w(a.defaultPlugins) && (a.defaultPlugins = g.slice());
|
|
48
|
+
}) : o.change((a) => {
|
|
49
|
+
Array.isArray(a.defaultPlugins) || (a.defaultPlugins = g.slice());
|
|
50
|
+
}), h(o);
|
|
51
|
+
}).catch((n) => console.warn("[chitchat] tool-storage:", n));
|
|
52
|
+
});
|
|
53
|
+
const i = () => u()?.doc()?.defaultPlugins ?? g;
|
|
54
|
+
return m(() => {
|
|
55
|
+
const t = r();
|
|
56
|
+
if (!t) {
|
|
57
|
+
l = null, s(null);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
l !== t && (l = t, s(null), I(e.repo, t, i()).then((n) => {
|
|
61
|
+
r() === t && s(n);
|
|
62
|
+
}).catch((n) => console.warn("[chitterchatter:context] ensureChitchat", n)));
|
|
63
|
+
}), m(() => {
|
|
64
|
+
const t = c(), n = u();
|
|
65
|
+
if (!t || !n) return;
|
|
66
|
+
const o = () => {
|
|
67
|
+
const a = t.doc()?.plugins;
|
|
68
|
+
if (!Array.isArray(a)) return;
|
|
69
|
+
const d = n.doc()?.defaultPlugins;
|
|
70
|
+
Array.isArray(d) && d.length === a.length && d.every((p, P) => p === a[P]) || n.change((p) => {
|
|
71
|
+
p.defaultPlugins = a.slice();
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
o(), t.on("change", o), S(() => t.off("change", o));
|
|
75
|
+
}), y(x, {
|
|
76
|
+
get when() {
|
|
77
|
+
return c();
|
|
78
|
+
},
|
|
79
|
+
keyed: !0,
|
|
80
|
+
get fallback() {
|
|
81
|
+
return (() => {
|
|
82
|
+
var t = L();
|
|
83
|
+
return H(t, () => r() ? "Loading chat…" : "Select a document to chat about it."), t;
|
|
84
|
+
})();
|
|
85
|
+
},
|
|
86
|
+
children: (t) => y(T, {
|
|
87
|
+
handle: t,
|
|
88
|
+
get element() {
|
|
89
|
+
return e.element;
|
|
90
|
+
},
|
|
91
|
+
mode: "context",
|
|
92
|
+
targetDocUrl: r
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function O(e) {
|
|
97
|
+
const r = e.repo || window.repo;
|
|
98
|
+
_(r), getComputedStyle(e).position === "static" && (e.style.position = "relative");
|
|
99
|
+
const c = k(() => y(E, {
|
|
100
|
+
element: e,
|
|
101
|
+
repo: r
|
|
102
|
+
}), e);
|
|
103
|
+
return () => c();
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
O as ChatContextComponent
|
|
107
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function s(t, e, i) {
|
|
2
|
+
t.title = e, t.messages = [], t.docs = [], t.plugins = i;
|
|
3
|
+
}
|
|
4
|
+
const a = (t) => t.title || "chat", n = (t, e) => {
|
|
5
|
+
t.title = e;
|
|
6
|
+
}, l = {
|
|
7
|
+
init(t) {
|
|
8
|
+
s(t, "chat " + (/* @__PURE__ */ new Date()).toLocaleString(), ["computer", "model"]);
|
|
9
|
+
},
|
|
10
|
+
getTitle: a,
|
|
11
|
+
setTitle: n
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
l as ChatDatatype
|
|
15
|
+
};
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import { createComponent as _, insert as A, effect as B, setAttribute as O, template as $ } from "solid-js/web";
|
|
2
|
+
import { createSignal as S, createEffect as I, onCleanup as v, Show as R } from "solid-js";
|
|
3
|
+
function x(e, t, o) {
|
|
4
|
+
const [r, a] = S(o), s = e.closest("patchwork-view") ?? e, n = new MessageChannel(), c = n.port2, l = new AbortController();
|
|
5
|
+
return c.addEventListener(
|
|
6
|
+
"message",
|
|
7
|
+
(u) => {
|
|
8
|
+
u.data?.type === "change" && a(() => u.data.value);
|
|
9
|
+
},
|
|
10
|
+
{ signal: l.signal }
|
|
11
|
+
), c.start(), s.dispatchEvent(
|
|
12
|
+
new CustomEvent("patchwork:subscribe", {
|
|
13
|
+
detail: { selector: t, port: n.port1 },
|
|
14
|
+
bubbles: !0,
|
|
15
|
+
composed: !0
|
|
16
|
+
})
|
|
17
|
+
), v(() => {
|
|
18
|
+
if (!l.signal.aborted) {
|
|
19
|
+
l.abort();
|
|
20
|
+
try {
|
|
21
|
+
c.postMessage({ type: "unsubscribe" });
|
|
22
|
+
} catch {
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
c.close();
|
|
26
|
+
} catch {
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}), r;
|
|
30
|
+
}
|
|
31
|
+
function j(e) {
|
|
32
|
+
const t = x(
|
|
33
|
+
e,
|
|
34
|
+
{ type: "patchwork:selected-doc" },
|
|
35
|
+
[]
|
|
36
|
+
);
|
|
37
|
+
return () => t()?.[0];
|
|
38
|
+
}
|
|
39
|
+
function W(e) {
|
|
40
|
+
const t = e?.rangePositions;
|
|
41
|
+
return typeof t == "function" ? e.rangePositions() : t;
|
|
42
|
+
}
|
|
43
|
+
function P(e, t, o) {
|
|
44
|
+
const r = x(
|
|
45
|
+
e,
|
|
46
|
+
{ type: "patchwork:focus" },
|
|
47
|
+
void 0
|
|
48
|
+
), [a, i] = S(null), s = /* @__PURE__ */ new Map();
|
|
49
|
+
return I(() => {
|
|
50
|
+
const n = r(), c = o();
|
|
51
|
+
if (!n || !c) {
|
|
52
|
+
i(null);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
let l = null, u = null, m = !1;
|
|
56
|
+
const d = async () => {
|
|
57
|
+
if (m) return;
|
|
58
|
+
const h = l?.doc(), g = (h?.selection ? Object.keys(h.selection) : []).find((p) => p.startsWith(c));
|
|
59
|
+
if (!g) return i(null);
|
|
60
|
+
try {
|
|
61
|
+
let p = s.get(g);
|
|
62
|
+
if (p || (p = await t.find(g), s.set(g, p)), m) return;
|
|
63
|
+
const f = W(p);
|
|
64
|
+
if (!f || f[0] === f[1]) return i(null);
|
|
65
|
+
const [C, b] = f, M = u?.doc()?.content, E = typeof M == "string" ? M.slice(C, b) : "";
|
|
66
|
+
i({ url: g, from: C, to: b, text: E });
|
|
67
|
+
} catch {
|
|
68
|
+
i(null);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
Promise.all([t.find(n), t.find(c)]).then(([h, y]) => {
|
|
72
|
+
m || (l = h, u = y, h.on("change", d), y.on("change", d), d());
|
|
73
|
+
}).catch(() => i(null)), v(() => {
|
|
74
|
+
m = !0, l?.off("change", d), u?.off("change", d);
|
|
75
|
+
});
|
|
76
|
+
}), a;
|
|
77
|
+
}
|
|
78
|
+
function ee(e, t) {
|
|
79
|
+
return x(
|
|
80
|
+
e,
|
|
81
|
+
{ type: "patchwork:tool-storage", toolId: t },
|
|
82
|
+
void 0
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
var L = /* @__PURE__ */ $("<span class=chat-selection-chip>@selection: “<!>”");
|
|
86
|
+
const w = "@selection";
|
|
87
|
+
function D(e) {
|
|
88
|
+
const t = e.replace(/\s+/g, " ").trim();
|
|
89
|
+
return t.length > 48 ? t.slice(0, 48) + "…" : t;
|
|
90
|
+
}
|
|
91
|
+
const te = {
|
|
92
|
+
type: "chat:autocomplete",
|
|
93
|
+
id: "selection-mention",
|
|
94
|
+
tier: "core",
|
|
95
|
+
create(e) {
|
|
96
|
+
const t = P(e.element, e.repo, j(e.element));
|
|
97
|
+
return ({
|
|
98
|
+
trigger: o,
|
|
99
|
+
query: r
|
|
100
|
+
}) => {
|
|
101
|
+
if (o !== "@") return [];
|
|
102
|
+
const a = t();
|
|
103
|
+
return a ? "selection".startsWith(r) || r === "" ? [{
|
|
104
|
+
display: w,
|
|
105
|
+
label: w,
|
|
106
|
+
desc: a.text ? "“" + D(a.text) + "”" : "selected text"
|
|
107
|
+
}] : [] : [];
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
function H(e, t) {
|
|
112
|
+
const o = e.chat.element, r = e.chat.repo, a = P(o, r, j(o)), i = t?.registerPreSend?.((s) => {
|
|
113
|
+
if (!s || typeof s.text != "string" || !s.text.includes(w)) return;
|
|
114
|
+
const n = a();
|
|
115
|
+
n && (s.selectionRef = n.url, s.text += `
|
|
116
|
+
[Referring to the selected text in the focused document (characters ${n.from}–${n.to}): «${n.text}»]`);
|
|
117
|
+
});
|
|
118
|
+
return i && v(i), _(R, {
|
|
119
|
+
get when() {
|
|
120
|
+
return a();
|
|
121
|
+
},
|
|
122
|
+
children: (s) => (() => {
|
|
123
|
+
var n = L(), c = n.firstChild, l = c.nextSibling;
|
|
124
|
+
return l.nextSibling, A(n, () => D(s().text), l), B(() => O(n, "title", s().text)), n;
|
|
125
|
+
})()
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
const T = {
|
|
129
|
+
type: "chat:feature",
|
|
130
|
+
id: "selection-mention",
|
|
131
|
+
name: "Selection mention",
|
|
132
|
+
tier: "core",
|
|
133
|
+
slots: {
|
|
134
|
+
"input-actions-left": H
|
|
135
|
+
}
|
|
136
|
+
}, U = [
|
|
137
|
+
{ type: "chat:feature", id: "presence", name: "Presence", tier: "core" },
|
|
138
|
+
{ type: "chat:feature", id: "typing", name: "Typing indicator", tier: "core" },
|
|
139
|
+
{ type: "chat:feature", id: "computer", name: "Computer (AI)", tier: "full" },
|
|
140
|
+
T
|
|
141
|
+
], V = U.map((e) => {
|
|
142
|
+
const { slots: t, ...o } = e;
|
|
143
|
+
return { ...o, async load() {
|
|
144
|
+
return { slots: t };
|
|
145
|
+
} };
|
|
146
|
+
}), q = [
|
|
147
|
+
{
|
|
148
|
+
type: "chat:syntax",
|
|
149
|
+
id: "italic",
|
|
150
|
+
name: "Italic",
|
|
151
|
+
tier: "core",
|
|
152
|
+
kind: "mark",
|
|
153
|
+
async load() {
|
|
154
|
+
return { pattern: /(?<![_\w])_([^_\n]+?)_(?![_.\w])/, toDOM: () => ["em"], key: "Mod-i", wrap: "_" };
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
type: "chat:syntax",
|
|
159
|
+
id: "bold",
|
|
160
|
+
name: "Bold",
|
|
161
|
+
tier: "core",
|
|
162
|
+
kind: "mark",
|
|
163
|
+
async load() {
|
|
164
|
+
return { pattern: /\*([^*\n]+?)\*/, toDOM: () => ["strong"], key: "Mod-b", wrap: "*" };
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
type: "chat:syntax",
|
|
169
|
+
id: "code",
|
|
170
|
+
name: "Code",
|
|
171
|
+
tier: "core",
|
|
172
|
+
kind: "mark",
|
|
173
|
+
async load() {
|
|
174
|
+
return { pattern: /`([^`\n]+?)`/, toDOM: () => ["code"], raw: !0, wrap: "`" };
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
type: "chat:syntax",
|
|
179
|
+
id: "link",
|
|
180
|
+
name: "Link",
|
|
181
|
+
tier: "core",
|
|
182
|
+
kind: "mark",
|
|
183
|
+
async load() {
|
|
184
|
+
return {
|
|
185
|
+
pattern: /(https?:\/\/[^\s<]+)/,
|
|
186
|
+
parse: (e) => ({ href: e }),
|
|
187
|
+
toDOM: ({ href: e }) => ["a", { href: e, target: "_blank", rel: "noopener" }]
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
], N = q, F = [
|
|
192
|
+
{
|
|
193
|
+
// tier:"core" so a bare `chat` (empty plugin list) can still bootstrap itself.
|
|
194
|
+
type: "chat:slash",
|
|
195
|
+
id: "plugin",
|
|
196
|
+
cmd: "/plugin",
|
|
197
|
+
aliases: ["/plugins"],
|
|
198
|
+
tier: "core",
|
|
199
|
+
usage: "/plugin [ls | load <id> | unload <id>]",
|
|
200
|
+
desc: "List, load, or unload chat plugins for this document",
|
|
201
|
+
sideEffect: "plugin"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
type: "chat:slash",
|
|
205
|
+
id: "computer",
|
|
206
|
+
cmd: "/computer",
|
|
207
|
+
tier: "full",
|
|
208
|
+
usage: "/computer [invite|kick|nosey|clear|owner|own|pwn]",
|
|
209
|
+
desc: "Manage the AI assistant: invite, kick, toggle nosey, clear context, see or take over the owner",
|
|
210
|
+
sideEffect: "computer"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
type: "chat:slash",
|
|
214
|
+
id: "model",
|
|
215
|
+
cmd: "/model",
|
|
216
|
+
aliases: ["/or", "/openrouter", "/ollama", "/provider", "/models"],
|
|
217
|
+
tier: "full",
|
|
218
|
+
usage: "/model",
|
|
219
|
+
desc: "Configure the AI model and provider",
|
|
220
|
+
sideEffect: "model"
|
|
221
|
+
}
|
|
222
|
+
], G = F.map((e) => {
|
|
223
|
+
const { transform: t, run: o, ...r } = e;
|
|
224
|
+
return { ...r, async load() {
|
|
225
|
+
return { transform: t, run: o };
|
|
226
|
+
} };
|
|
227
|
+
});
|
|
228
|
+
function ne(e, t) {
|
|
229
|
+
if (!e.startsWith("/")) return null;
|
|
230
|
+
const o = e.toLowerCase();
|
|
231
|
+
for (const r of t) {
|
|
232
|
+
const a = [r.cmd, ...r.aliases || []];
|
|
233
|
+
for (const i of a) {
|
|
234
|
+
const s = i.toLowerCase();
|
|
235
|
+
if (o === s || o.startsWith(s + " ")) {
|
|
236
|
+
let n = e.slice(i.length);
|
|
237
|
+
return n.startsWith(" ") && (n = n.slice(1)), { plugin: r, argText: n };
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
243
|
+
const K = {
|
|
244
|
+
reply: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 17 4 12 9 7"/><path d="M20 18v-2a4 4 0 0 0-4-4H4"/></svg>',
|
|
245
|
+
send: '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>',
|
|
246
|
+
play: '<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="none"><polygon points="5 3 19 12 5 21 5 3"/></svg>',
|
|
247
|
+
pause: '<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="none"><rect x="6" y="4" width="4" height="16"/><rect x="14" y="4" width="4" height="16"/></svg>',
|
|
248
|
+
close: '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',
|
|
249
|
+
bellOutline: '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 0 1-3.46 0"/></svg>',
|
|
250
|
+
pin: '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="17" x2="12" y2="22"/><path d="M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z"/></svg>',
|
|
251
|
+
sidebar: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"/><line x1="15" y1="3" x2="15" y2="21"/></svg>'
|
|
252
|
+
}, Z = [
|
|
253
|
+
{
|
|
254
|
+
type: "chat:messageaction",
|
|
255
|
+
id: "reply",
|
|
256
|
+
name: "Reply",
|
|
257
|
+
icon: K.reply,
|
|
258
|
+
tier: "core",
|
|
259
|
+
show: (e) => !e._loading,
|
|
260
|
+
run: (e) => e.onReply(e.msg.id)
|
|
261
|
+
}
|
|
262
|
+
], z = Z.map((e) => {
|
|
263
|
+
const { show: t, run: o, ...r } = e;
|
|
264
|
+
return { ...r, async load() {
|
|
265
|
+
return { show: t, run: o };
|
|
266
|
+
} };
|
|
267
|
+
}), k = [];
|
|
268
|
+
function oe(e) {
|
|
269
|
+
k.length = 0, k.push(...e);
|
|
270
|
+
}
|
|
271
|
+
const J = [
|
|
272
|
+
{
|
|
273
|
+
type: "chat:emojipack",
|
|
274
|
+
id: "unicode",
|
|
275
|
+
name: "Emoji",
|
|
276
|
+
tier: "core",
|
|
277
|
+
getEmojis: () => k.map((e) => e.emoji)
|
|
278
|
+
}
|
|
279
|
+
], Q = J.map((e) => {
|
|
280
|
+
const { getEmojis: t, ...o } = e;
|
|
281
|
+
return { ...o, async load() {
|
|
282
|
+
return { getEmojis: t };
|
|
283
|
+
} };
|
|
284
|
+
}), re = [
|
|
285
|
+
{
|
|
286
|
+
// The "Chat" preset: seeds just the computer. Grows via `/plugin load` or by
|
|
287
|
+
// loading the chitter bundle. `chat` is also the legacy datatype id. The
|
|
288
|
+
// "everything" preset now lives in the chitter bundle (the `chitter`
|
|
289
|
+
// datatype); the base tool still RENDERS `chitterchatter`/`chitter` docs via
|
|
290
|
+
// `supportedDatatypes`, and chitter registers those datatypes' presets.
|
|
291
|
+
type: "patchwork:datatype",
|
|
292
|
+
id: "chat",
|
|
293
|
+
name: "Chat",
|
|
294
|
+
icon: "MessageSquare",
|
|
295
|
+
async load() {
|
|
296
|
+
return (await import("./datatype-1niKKK-c.js")).ChatDatatype;
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
// The single chat tool. Which features are active is driven by the
|
|
301
|
+
// document's `plugins` array, not by the tool. Registered under `chat`;
|
|
302
|
+
// a `chitterchatter` alias below keeps existing pins/toolIds resolving.
|
|
303
|
+
type: "patchwork:tool",
|
|
304
|
+
id: "chat",
|
|
305
|
+
name: "Chat",
|
|
306
|
+
icon: "MessageSquare",
|
|
307
|
+
supportedDatatypes: ["chitterchatter", "chat", "chitter"],
|
|
308
|
+
async load() {
|
|
309
|
+
return (await import("./tool-D9BTS5wc.js")).ChatTool;
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
// Host-embeddable component (<patchwork-view component="chat">). Defaults to
|
|
314
|
+
// the minimal feature set; features="full" for everything.
|
|
315
|
+
type: "patchwork:component",
|
|
316
|
+
id: "chat",
|
|
317
|
+
name: "Chat",
|
|
318
|
+
icon: "MessageSquare",
|
|
319
|
+
async load() {
|
|
320
|
+
return (await import("./tool-D9BTS5wc.js")).ChatComponent;
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
// Streamlined context-sidebar variant: no sidebar, chats about whatever
|
|
325
|
+
// document is focused (chat stored at focusedDoc['@patchwork'].chitchat),
|
|
326
|
+
// and the computer edits that document via universal Automerge ops.
|
|
327
|
+
type: "patchwork:component",
|
|
328
|
+
id: "watercooler",
|
|
329
|
+
name: "Watercooler",
|
|
330
|
+
icon: "MessageCircle",
|
|
331
|
+
tags: ["context-tool"],
|
|
332
|
+
async load() {
|
|
333
|
+
const { ChatContextComponent: e } = await import("./context-tool-CenQrztX.js");
|
|
334
|
+
return e;
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
// ── Host-registrable feature plugins ────────────────────────────────────────
|
|
338
|
+
// The four extensible seams, registered like newspace's sketchy:* plugins so
|
|
339
|
+
// other modules can contribute inline syntax, slash commands, hover actions and
|
|
340
|
+
// emoji packs. The tool also keeps these as built-in fallbacks (see lib/*),
|
|
341
|
+
// so it works even if the registry is empty.
|
|
342
|
+
//
|
|
343
|
+
// These MUST be serializable: the host reads `plugins` in a worker and clones
|
|
344
|
+
// each entry to the main thread (excluding `load`). `feature`/`parser-extension`
|
|
345
|
+
// entries are pure data (RegExp is cloneable) and spread raw; `slash`,
|
|
346
|
+
// `messageaction` and `emojipack` carry function fields, so they're registered
|
|
347
|
+
// as descriptions with the fancy code behind `async load()`.
|
|
348
|
+
...V,
|
|
349
|
+
...N,
|
|
350
|
+
...G,
|
|
351
|
+
...z,
|
|
352
|
+
...Q
|
|
353
|
+
];
|
|
354
|
+
export {
|
|
355
|
+
K as S,
|
|
356
|
+
q as a,
|
|
357
|
+
F as b,
|
|
358
|
+
x as c,
|
|
359
|
+
oe as d,
|
|
360
|
+
J as e,
|
|
361
|
+
U as f,
|
|
362
|
+
te as g,
|
|
363
|
+
ne as h,
|
|
364
|
+
Z as m,
|
|
365
|
+
re as p,
|
|
366
|
+
j as s,
|
|
367
|
+
ee as t
|
|
368
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.chat-root{--bg-dark: var(--editor-fill, var(--studio-fill, oklch(.15 .03 270)));--bg-darkest: var(--editor-fill-offset-20, var(--studio-fill-offset-20, oklch(.12 .02 270)));--bg-mid: var(--editor-fill-offset-10, var(--studio-fill-offset-10, oklch(.19 .03 270)));--bg-input: var(--editor-fill, var(--studio-fill, oklch(.17 .03 270)));--bg-hover: var(--editor-fill-offset-20, var(--studio-fill-offset-20, oklch(.22 .04 270)));--border: var(--editor-fill-offset-20, var(--studio-fill-offset-20, oklch(.28 .05 270)));--accent: var(--studio-primary-fill, var(--studio-primary, oklch(.55 .18 270)));--accent-line: var(--studio-primary-line, var(--editor-fill, var(--studio-fill, oklch(1 0 0))));--accent-text: var(--studio-primary-text, var(--accent));--accent-hover: color-mix(in oklch, var(--accent), var(--studio-line, black) 18%);--accent-soft: color-mix(in oklch, var(--accent), transparent 85%);--accent-fg: var(--accent-line);--theme: var(--accent);--text-primary: var(--studio-line, oklch(1 0 0));--text-secondary: var(--studio-line-offset-30, oklch(1 0 0 / .6));--text-muted: var(--studio-line-offset-50, oklch(1 0 0 / .4));--link: var(--studio-link-text, var(--studio-link, oklch(.75 .15 250)))}.chat-root{display:flex;flex-direction:row;position:absolute;inset:0;font-family:var(--studio-family-sans, system-ui,-apple-system,sans-serif);background:var(--bg-dark);color:var(--text-primary);box-sizing:border-box;font-size:var(--studio-font-size, 15px);overflow:hidden;user-select:text;-webkit-user-select:text;height:100%}.chat-context-empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;padding:24px;color:var(--text-secondary, #888);font-family:var(--studio-family-sans, system-ui,-apple-system,sans-serif);font-size:var(--studio-font-size, 15px)}.chat-root *,.chat-root *:before,.chat-root *:after{box-sizing:border-box}.chat-root a{color:var(--link);text-decoration:underline}.chat-root a:hover{text-decoration:none}.chat-theme-btn{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:16px;padding:2px 6px;border-radius:4px;position:relative}.chat-theme-btn:hover,.chat-notify-btn:hover{background:var(--bg-hover);color:var(--text-primary)}.chat-notify-btn{background:none;border:none;color:var(--text-muted);cursor:pointer;padding:2px 4px;border-radius:4px;display:flex;align-items:center;position:relative}.chat-notify-menu{display:none;position:absolute;top:100%;right:0;margin-top:4px;background:var(--bg-darkest);border:1px solid var(--border);border-radius:8px;padding:8px;min-width:180px;z-index:200}.chat-notify-menu.show{display:block}.chat-notify-menu-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 4px;font-size:13px;color:var(--text-secondary);cursor:pointer;border-radius:4px}.chat-notify-menu-row:hover{background:var(--bg-hover)}.chat-notify-toggle{width:32px;height:18px;border-radius:9px;border:none;cursor:pointer;background:var(--bg-hover);position:relative;transition:background .15s;flex-shrink:0}.chat-notify-toggle.on{background:var(--accent)}.chat-notify-toggle:after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .15s}.chat-notify-toggle.on:after{transform:translate(14px)}.chat-presence-bar{padding:4px 16px;background:var(--bg-darkest);border-bottom:1px solid var(--border);display:flex;gap:8px;align-items:center;flex-shrink:0;min-height:24px;position:relative;z-index:50;overflow:visible}.chat-presence-user{display:flex;align-items:center;gap:4px;font-size:12px;color:var(--text-secondary);transition:opacity .2s}.chat-presence-user.away{opacity:.9}.chat-presence-avatar{width:18px;height:18px;border-radius:50%;overflow:hidden;flex-shrink:0;background:var(--bg-hover);display:flex;align-items:center;justify-content:center;font-size:10px;color:var(--text-muted)}.chat-presence-avatar img{width:100%;height:100%;object-fit:cover}.chat-messages{flex:1;overflow-y:auto;padding:8px 0;display:flex;flex-direction:column;min-height:0;height:100%;overflow:scroll}.chat-msg-group{padding:2px 16px;display:flex;gap:12px;position:relative}.chat-msg-group:hover{background:var(--bg-hover)}.chat-avatar-col{width:40px;flex-shrink:0;padding-top:2px}.chat-avatar{width:40px;height:40px;border-radius:50%;background:var(--accent);display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:700;color:var(--accent-fg);overflow:hidden;cursor:pointer;position:relative;user-select:none}.chat-avatar img{width:100%;height:100%;object-fit:cover}.chat-avatar-view{display:block;width:100%;height:100%}.chat-avatar-view img{width:100%;height:100%;object-fit:cover}.chat-avatar.gif-selfie,.chat-avatar.gif-selfie img{border-radius:4px}.chat-avatar.cat-ears:before{content:"";position:absolute;top:-6px;left:2px;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:12px solid var(--accent);z-index:2}.chat-avatar.cat-ears:after{content:"";position:absolute;top:-6px;right:2px;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:12px solid var(--accent);z-index:2}.chat-msg-body{flex:1;min-width:0}.chat-msg-header{display:flex;align-items:baseline;gap:8px}.chat-msg-name{font-weight:600;font-size:15px;color:var(--text-primary);cursor:pointer}.chat-msg-name:hover{text-decoration:underline}.chat-msg-time{font-size:11px;color:var(--text-muted)}.chat-msg-text{color:var(--text-primary);line-height:1.45;margin-top:2px;white-space:pre-wrap;word-wrap:break-word}.chat-msg-text.emoji-only{font-size:2em;line-height:1.2}.chat-quick-replies{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.chat-quick-reply{font:inherit;font-size:.9em;cursor:pointer;padding:4px 10px;border-radius:var(--studio-radius-round, 999px);border:1px solid var(--accent-line, currentColor);background:transparent;color:var(--accent-text, var(--text-primary))}.chat-quick-reply:hover:not(:disabled){background:var(--accent);color:var(--accent-fg)}.chat-quick-reply:disabled{opacity:.5;cursor:default}.chat-msg-text.emoji-only .chat-emoticon-inline{height:2em}.chat-msg-text code:not(.shiki code):not(.chat-code-block code){background:var(--bg-hover);padding:1px 4px;border-radius:3px;font-family:ui-monospace,monospace;font-size:.9em}.chat-msg-text a{color:var(--link);text-decoration:underline}.chat-msg-text a:hover{text-decoration:none}.chat-msg-text.streaming:after{content:"";display:inline-block;width:6px;height:1em;background:var(--accent);margin-left:2px;vertical-align:text-bottom;border-radius:1px;animation:blink-cursor .8s step-end infinite}.chat-msg-text.streaming:empty:after{content:"";width:auto;height:auto;background:none;animation:none}.chat-msg-text.streaming:empty:before{content:"• • •";letter-spacing:2px;color:var(--text-muted);font-size:18px;animation:thinking-dots 1.4s ease-in-out infinite}@keyframes thinking-dots{0%,to{opacity:.3}50%{opacity:1}}@keyframes blink-cursor{0%,to{opacity:1}50%{opacity:0}}.chat-streaming-cancel{margin-top:4px;padding:2px 10px;border-radius:4px;border:1px solid var(--border);background:var(--bg-hover);color:var(--text-muted);cursor:pointer;font-size:11px}.chat-streaming-cancel:hover{color:var(--text-primary);background:var(--bg-mid)}.chat-spoiler{background:var(--text-primary);color:transparent;border-radius:3px;padding:0 3px;cursor:pointer;transition:all .2s}.chat-spoiler.revealed{background:var(--bg-hover);color:var(--text-primary)}.chat-inverted{background:var(--text-primary);color:var(--bg-dark);padding:0 3px;border-radius:3px}.chat-underline-em{text-decoration:underline;font-style:italic}.chat-msg-action{padding:4px 16px;font-style:italic;color:var(--text-secondary);font-size:14px;position:relative}.chat-msg-action:hover{background:var(--bg-hover)}.chat-msg-action .chat-msg-action-name{font-weight:600;color:var(--text-primary)}.chat-time-gap{margin-top:16px}.chat-input-wrap{position:relative;flex:1;min-width:0}.chat-input-wrap .cm-editor{background:transparent}.chat-input-wrap .cm-editor .cm-content,.chat-input-wrap .cm-editor .cm-scroller{max-height:120px}.chat-msg-continuation{padding:0 16px 0 68px;position:relative}.chat-msg-continuation.has-gif{padding-left:16px;display:flex;gap:12px;align-items:flex-start}.chat-msg-continuation:hover{background:var(--bg-hover)}.chat-msg-inline-time{font-size:10px;color:var(--text-muted);position:absolute;top:100%;right:0;white-space:nowrap;margin-top:2px;pointer-events:none}.chat-msg-gif-inline{width:40px;height:40px;border-radius:4px;object-fit:cover;border:none;display:block;margin-right:6px;flex-shrink:0}.chat-msg-reply-ref{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--text-muted);margin-bottom:2px;padding-left:36px;cursor:pointer;position:relative}.chat-msg-reply-ref:before{content:"";position:absolute;left:20px;top:50%;width:12px;height:12px;border-left:2px solid var(--border);border-top:2px solid var(--border);border-radius:6px 0 0;transform:translateY(-20%)}.chat-msg-reply-ref:hover{color:var(--text-primary)}.chat-msg-reply-ref-avatar{width:16px;height:16px;border-radius:50%;overflow:hidden;flex-shrink:0}.chat-msg-reply-ref-avatar img{width:100%;height:100%;object-fit:cover}.chat-msg-reply-ref-name{font-weight:600;color:var(--text-primary)}.chat-msg-reply-ref-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:300px}.chat-msg-image-wrap{position:relative;display:inline-block;margin-top:4px;max-width:100%}.chat-msg-image{display:block;border-radius:8px;cursor:pointer;width:100%;height:100%;object-fit:cover}.chat-msg-embed{margin-top:6px;border:1px solid var(--border);border-radius:8px;width:100%;height:300px;position:relative;background:var(--bg-surface);display:flex;flex-direction:column}.chat-msg-embed patchwork-view{width:100%;flex:1;min-height:0;display:block;overflow:hidden}.chat-msg-embed-title{padding:0 8px 0 0;font-weight:500;color:var(--text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-shrink:1;min-width:0}.chat-embed-infobar{display:flex;align-items:center;gap:4px;padding:3px 6px;background:var(--bg-darkest);border-top:1px solid var(--border);font-size:11px;overflow:hidden;flex-wrap:wrap}.chat-embed-pill{display:inline-flex;align-items:center;gap:3px;background:var(--bg-hover);border:1px solid var(--border);border-radius:10px;padding:1px 8px;font-size:10px;color:var(--text-secondary);white-space:nowrap;cursor:default;max-width:200px;overflow:hidden;text-overflow:ellipsis;flex-shrink:0}.chat-embed-pill.clickable{cursor:pointer}.chat-embed-pill.clickable:hover{color:var(--text-primary);border-color:var(--accent-line);background:var(--bg-input)}.chat-embed-pill-label{opacity:.6;font-size:9px;text-transform:uppercase;letter-spacing:.3px}.chat-embed-tool-input{background:var(--bg-darkest);border:1px solid var(--accent-line);border-radius:10px;color:var(--text-primary);font-size:10px;padding:1px 8px;outline:none;width:120px}.chat-embed-tool-menu{position:absolute;top:100%;left:0;z-index:20;background:var(--bg-surface);border:1px solid var(--border);border-radius:6px;padding:2px;box-shadow:0 2px 8px #0000004d;white-space:nowrap;min-width:140px;max-height:200px;overflow-y:auto}.chat-embed-tool-menu button{display:block;width:100%;text-align:left;background:none;border:none;color:var(--text-secondary);font-size:11px;padding:4px 8px;cursor:pointer;border-radius:4px}.chat-embed-tool-menu button:hover{background:var(--bg-hover);color:var(--text-primary)}.chat-embed-tool-menu button.active{color:var(--accent-text);font-weight:600}.chat-embed-tool-menu .tool-menu-input-row{display:flex;gap:4px;padding:4px;border-top:1px solid var(--border);margin-top:2px}.chat-embed-tool-menu .tool-menu-input-row input{flex:1;background:var(--bg-darkest);border:1px solid var(--border);border-radius:4px;color:var(--text-primary);font-size:10px;padding:2px 6px;outline:none;min-width:0}.chat-embed-tool-menu .tool-menu-input-row input:focus{border-color:var(--accent-line)}.chat-embed-url-menu{position:absolute;top:100%;left:0;z-index:20;background:var(--bg-surface);border:1px solid var(--border);border-radius:6px;padding:2px;box-shadow:0 2px 8px #0000004d;white-space:nowrap}.chat-embed-url-menu button{display:block;width:100%;text-align:left;background:none;border:none;color:var(--text-secondary);font-size:11px;padding:4px 10px;cursor:pointer;border-radius:4px}.chat-embed-url-menu button:hover{background:var(--bg-hover);color:var(--text-primary)}.chat-resize-handle{position:absolute;bottom:0;right:0;width:16px;height:16px;cursor:nwse-resize;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .15s;z-index:5}.chat-msg-image-wrap:hover .chat-resize-handle,.chat-msg-embed:hover .chat-resize-handle{opacity:.6}.chat-resize-handle:hover{opacity:1!important}.chat-resize-handle svg{width:10px;height:10px;color:var(--text-muted)}.chat-rich-blocks{display:flex;flex-direction:column;gap:4px;margin-top:6px}.chat-rich-block{border:1px solid var(--border);border-radius:6px;overflow:hidden;background:var(--bg-darkest);font-size:13px}.chat-rich-block-header{display:flex;align-items:center;gap:6px;padding:5px 10px;cursor:pointer;border:none;background:transparent;color:var(--text-secondary);width:100%;text-align:left;font-size:12px;font-family:monospace}.chat-rich-block-header:hover{background:var(--bg-hover);color:var(--text-primary)}.chat-rich-block-chevron{transition:transform .15s;flex-shrink:0}.chat-rich-block.open .chat-rich-block-chevron{transform:rotate(90deg)}.chat-rich-block-label{opacity:.8}.chat-rich-block-body{border-top:1px solid var(--border);max-height:400px;overflow:auto}.chat-rich-block-code{margin:0;font-size:12px;line-height:1.5}.chat-rich-block-code pre{margin:0;padding:10px;overflow-x:auto}.chat-rich-block-code code{font-family:monospace;white-space:pre}.chat-rich-block-result-label{font-size:11px;color:var(--text-muted);padding:6px 10px 2px;text-transform:uppercase;letter-spacing:.5px;border-top:1px solid var(--border)}.shiki{margin:0!important;padding:10px 12px!important;font-size:13px!important;line-height:1.5!important;overflow-x:auto;border-radius:6px}.shiki code{font-family:ui-monospace,SF Mono,Cascadia Code,Menlo,Consolas,monospace!important}.chat-code-block{background:var(--bg-darkest);border:none;border-radius:6px;padding:0;margin:6px 0;overflow-x:auto;font-size:13px;line-height:1.5}.chat-code-block code{font-family:ui-monospace,SF Mono,Cascadia Code,Menlo,Consolas,monospace;white-space:pre;display:block;padding:10px 12px}.chat-msg-text .shiki{border-radius:6px;border:none;margin:6px 0}.chat-msg-text .shiki code{white-space:pre;display:block}.chat-rich-block-code .shiki{margin:0;border-radius:0}.chat-think-block{background:var(--bg-darkest);border-radius:6px;margin:6px 0;font-size:13px;overflow:hidden}.chat-think-block summary{cursor:pointer;padding:5px 10px;color:var(--text-secondary);font-family:ui-monospace,monospace;font-size:12px;user-select:none;list-style:none}.chat-think-block summary:before{content:"▶ ";display:inline;font-size:10px}.chat-think-block[open] summary:before{content:"▼ "}.chat-think-block summary:hover{background:var(--bg-hover);color:var(--text-primary)}.chat-think-content{padding:8px 12px;white-space:pre-wrap;color:var(--text-secondary);font-family:ui-monospace,monospace;border-top:1px solid var(--bg-hover);max-height:300px;overflow-y:auto}.chat-voice-note{display:flex;align-items:center;gap:8px;margin-top:4px;padding:8px 12px;background:var(--bg-darkest);border-radius:8px;max-width:300px;flex-wrap:wrap}.chat-voice-transcription{width:100%;font-size:13px;color:var(--text-secondary);font-style:italic;padding-left:2px;margin-top:2px}.chat-voice-transcribing{opacity:.5;animation:chat-pulse 1.5s ease-in-out infinite}@keyframes chat-pulse{0%,to{opacity:.5}50%{opacity:.3}}.chat-voice-transcribe-btn{background:none;border:none;color:var(--text-muted);font-size:11px;cursor:pointer;padding:2px 4px;opacity:.6;font-style:italic}.chat-voice-transcribe-btn:hover{opacity:1;text-decoration:underline}.chat-voice-play-btn{width:32px;height:32px;border-radius:50%;background:var(--accent);color:var(--accent-fg);border:none;font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0}.chat-voice-play-btn:hover{background:var(--accent-hover)}.chat-voice-waveform{flex:1;height:24px;display:flex;align-items:center;gap:2px}.chat-voice-bar{width:3px;background:var(--accent);border-radius:2px;min-height:3px}.chat-voice-duration{font-size:12px;color:var(--text-muted);flex-shrink:0}.chat-reactions{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}.chat-reaction{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:8px;border:1px solid var(--border);background:var(--bg-dark);font-size:15px;cursor:pointer;user-select:none;transition:all .1s}.chat-reaction:hover{border-color:var(--accent-line);background:var(--bg-hover)}.chat-reaction.mine{border-color:var(--accent-line);background:var(--accent-soft)}.chat-reaction-count{font-size:12px;color:var(--text-secondary);font-weight:500}.chat-reaction-add{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;border:1px dashed var(--border);background:transparent;font-size:16px;cursor:pointer;color:var(--text-muted);transition:all .1s}.chat-reaction-add:hover{border-color:var(--accent-line);color:var(--text-primary);background:var(--bg-hover)}.chat-emoticon-tooltip{position:absolute;z-index:200;pointer-events:none;background:var(--bg-darkest);border:1px solid var(--border);border-radius:8px;padding:8px 12px;box-shadow:0 4px 16px #0000004d;display:none;flex-direction:column;align-items:center;gap:4px;max-width:200px}.chat-emoticon-tooltip.show{display:flex;pointer-events:auto}.chat-emoticon-tooltip-preview{font-size:48px;line-height:1}.chat-emoticon-tooltip-preview img{width:48px;height:48px;object-fit:contain}.chat-emoticon-tooltip-name{font-size:12px;color:var(--text-muted)}.chat-emoticon-tooltip-names{font-size:11px;color:var(--text-secondary);text-align:center}.chat-emoticon-tooltip-adopt{background:var(--accent);color:var(--accent-fg);border:none;cursor:pointer;font-size:11px;padding:2px 10px;border-radius:4px;font-weight:600}.chat-emoticon-tooltip-adopt:hover{opacity:.85}.chat-msg-actions{position:absolute;top:-14px;right:16px;display:none;background:var(--bg-darkest);border:1px solid var(--border);border-radius:4px;z-index:10}.chat-msg-group:hover .chat-msg-actions,.chat-msg-continuation:hover .chat-msg-actions,.chat-msg-action:hover .chat-msg-actions{display:flex}.chat-msg-action-btn{background:none;border:none;color:var(--text-secondary);padding:6px 8px;cursor:pointer;font-size:16px}.chat-msg-action-btn:hover{background:var(--bg-hover);color:var(--text-primary)}.chat-emoji-picker-overlay{position:fixed;inset:0;z-index:100;display:none}.chat-emoji-picker-overlay.show{display:block}.chat-emoji-picker{position:absolute;background:var(--bg-darkest);border:1px solid var(--border);border-radius:8px;padding:8px;box-shadow:0 4px 20px #0000004d;z-index:101;max-width:280px;width:280px;display:flex;flex-direction:column;max-height:320px}.chat-emoji-picker-scroll{overflow-y:auto;overscroll-behavior:contain;min-height:0;flex:1}.chat-emoji-grid{display:flex;flex-wrap:wrap;gap:2px}.chat-emoji-grid button{background:none;border:none;font-size:22px;cursor:pointer;padding:4px;border-radius:4px;width:36px;height:36px;display:flex;align-items:center;justify-content:center}.chat-emoji-grid button:hover{background:var(--bg-hover)}.chat-emoji-active{background:var(--accent)!important;outline:2px solid var(--accent-line);outline-offset:-2px;opacity:.8}.chat-emoji-picker-search{width:100%;padding:6px 10px;background:var(--bg-input);border:1px solid var(--border);border-radius:4px;color:var(--text-primary);font-size:14px;margin-bottom:6px;outline:none;flex-shrink:0}.chat-emoji-picker-search:focus{border-color:var(--accent-line)}.chat-emoticon-section{border-bottom:1px solid var(--border);padding-bottom:6px;margin-bottom:6px}.chat-emoticon-section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px;font-size:11px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px}.chat-emoticon-section-label{font-size:11px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;margin:6px 0 4px;padding:0 2px}.chat-emoticon-btn{position:relative;width:36px;height:36px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;border-radius:4px;cursor:pointer;padding:2px}.chat-emoticon-btn:hover{background:var(--bg-hover)}.chat-emoticon-img{width:28px;height:28px;object-fit:contain}.chat-emoticon-add-btn{background:none;border:1px dashed var(--border);color:var(--text-muted);cursor:pointer;font-size:11px;padding:2px 8px;border-radius:4px}.chat-emoticon-add-btn:hover{border-color:var(--accent-line);color:var(--text-primary)}.chat-emoticon-grid{display:flex;flex-wrap:wrap;gap:2px}.chat-emoticon-grid button{background:none;border:none;cursor:pointer;padding:2px;border-radius:4px;width:36px;height:36px;display:flex;align-items:center;justify-content:center;position:relative}.chat-emoticon-grid button:hover{background:var(--bg-hover)}.chat-emoticon-grid button img{width:28px;height:28px;object-fit:contain}.chat-emoticon-adopt{position:absolute;top:-2px;right:-2px;width:14px;height:14px;border-radius:50%;background:var(--accent);color:var(--accent-fg);border:none;cursor:pointer;font-size:10px;display:none;align-items:center;justify-content:center;line-height:1}.chat-emoticon-grid button:hover .chat-emoticon-adopt{display:flex}.chat-emoticon-remove{position:absolute;top:-4px;right:-4px;width:16px;height:16px;border-radius:50%;background:var(--bg-hover);color:var(--text-muted);border:1px solid var(--border);cursor:pointer;font-size:10px;display:none;align-items:center;justify-content:center;line-height:1}.chat-emoticon-grid button:hover .chat-emoticon-remove{display:flex}.chat-emoticon-remove:hover{background:#ed4245!important;color:#fff!important;border-color:#ed4245!important}.chat-emoticon-remove.confirm{background:#ed4245;color:#fff;border-color:#ed4245;display:flex}.chat-emoticon-inline{height:1.5em;vertical-align:middle;display:inline}.chat-emoticon-dialog{padding:8px;display:flex;flex-direction:column;gap:8px}.chat-emoticon-dialog input[type=text]{width:100%;padding:6px 10px;background:var(--bg-input);border:1px solid var(--border);border-radius:4px;color:var(--text-primary);font-size:14px;outline:none}.chat-emoticon-dialog input[type=text]:focus{border-color:var(--accent-line)}.chat-emoticon-dialog-preview{width:80px;height:80px;border-radius:4px;background:var(--bg-hover);display:flex;align-items:center;justify-content:center;overflow:hidden;align-self:center;color:var(--text-muted);font-size:24px}.chat-emoticon-dialog-preview:hover{background:var(--bg-input);border:1px dashed var(--border)}.chat-emoticon-dialog-preview img{width:100%;height:100%;object-fit:contain}.chat-emoticon-dialog-counter{font-size:11px;color:var(--text-muted);text-align:center}.chat-emoticon-dialog-btns{display:flex;gap:6px;justify-content:flex-end}.chat-emoticon-dialog-btns button{padding:4px 12px;border-radius:4px;font-size:13px;cursor:pointer;border:none}.chat-emoticon-dialog .cancel-btn{background:var(--bg-hover);color:var(--text-primary)}.chat-emoticon-dialog .save-btn{background:var(--accent);color:var(--accent-fg);font-weight:600}.chat-emoticon-dialog .save-btn:disabled{opacity:.5;cursor:default}.chat-font-dialog{padding:8px;display:flex;flex-direction:column;gap:8px}.chat-font-dialog input[type=text]{width:100%;padding:6px 10px;background:var(--bg-input);border:1px solid var(--border);border-radius:4px;color:var(--text-primary);font-size:14px;outline:none}.chat-font-dialog input[type=text]:focus{border-color:var(--accent-line)}.chat-font-dialog-preview{padding:10px;border-radius:4px;background:var(--bg-hover);text-align:center;font-size:18px;color:var(--text-primary);min-height:48px;display:flex;align-items:center;justify-content:center}.chat-font-dialog-filebtn{background:none;border:1px dashed var(--border);color:var(--text-muted);cursor:pointer;font-size:13px;padding:6px 12px;border-radius:4px;text-align:center}.chat-font-dialog-filebtn:hover{border-color:var(--accent-line);color:var(--text-primary)}.chat-font-dialog-btns{display:flex;gap:6px;justify-content:flex-end}.chat-font-dialog-btns button{padding:4px 12px;border-radius:4px;font-size:13px;cursor:pointer;border:none}.chat-font-dialog .cancel-btn{background:var(--bg-hover);color:var(--text-primary)}.chat-font-dialog .save-btn{background:var(--accent);color:var(--accent-fg);font-weight:600}.chat-font-dialog .save-btn:disabled{opacity:.5;cursor:default}.chat-font-list{display:flex;flex-direction:column;gap:2px;max-height:120px;overflow-y:auto;overscroll-behavior:contain}.chat-font-list-item{display:flex;align-items:center;justify-content:space-between;padding:4px 8px;border-radius:4px;font-size:13px;color:var(--text-primary)}.chat-font-list-item:hover{background:var(--bg-hover)}.chat-font-list-item .font-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-font-list-remove{width:18px;height:18px;border-radius:50%;background:var(--bg-hover);color:var(--text-muted);border:1px solid var(--border);cursor:pointer;font-size:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.chat-font-list-remove:hover,.chat-font-list-remove.confirm{background:#ed4245;color:#fff;border-color:#ed4245}.chat-msg-menu-wrap{position:relative}.chat-msg-menu{display:none;position:absolute;top:100%;right:0;margin-top:2px;background:var(--bg-darkest);border:1px solid var(--border);border-radius:6px;padding:4px 0;min-width:120px;z-index:20;box-shadow:0 4px 12px #0000004d}.chat-msg-menu.show{display:block}.chat-msg-menu-item{display:flex;align-items:center;gap:8px;width:100%;padding:6px 12px;background:none;border:none;color:var(--text-primary);font-size:13px;cursor:pointer;text-align:left}.chat-msg-menu-item:hover{background:var(--bg-hover)}.chat-msg-menu-item.danger{color:#ed4245}.chat-msg-menu-item.danger:hover{background:#ed42451a}.chat-typing-bar{padding:0 16px;min-height:22px;font-size:12px;color:var(--text-muted);font-style:italic;flex-shrink:0}.chat-llm-status{padding:0 16px;min-height:22px;font-size:12px;color:var(--text-muted);font-style:italic;flex-shrink:0;font-family:monospace}.chat-stop-btn{display:inline-flex;align-items:center;gap:4px;padding:2px 10px;border:1px solid var(--border);border-radius:4px;background:var(--bg-mid);color:var(--text-secondary);font-size:12px;font-family:inherit;cursor:pointer;font-style:normal}.chat-stop-btn:hover{background:var(--bg-hover);color:var(--text-primary)}.chat-input-wrapper{flex-shrink:0;padding:0 16px 16px;position:relative}.chat-autocomplete{display:none;position:absolute;bottom:100%;left:0;right:0;background:var(--bg-darkest);border:1px solid var(--border);border-radius:8px;max-height:200px;overflow-y:auto;overscroll-behavior:contain;box-shadow:0 -4px 16px #0000004d;z-index:50;margin-bottom:4px}.chat-autocomplete.show{display:block}.chat-autocomplete-item{display:flex;align-items:center;gap:8px;padding:6px 12px;cursor:pointer;font-size:14px;color:var(--text-primary)}.chat-autocomplete-item:hover,.chat-autocomplete-item.active{background:var(--bg-hover)}.chat-autocomplete-item-emoji{font-size:20px;width:28px;text-align:center;flex-shrink:0}.chat-autocomplete-item-emoji img{width:24px;height:24px;object-fit:contain}.chat-autocomplete-item-name{color:var(--text-secondary);font-size:12px}.chat-autocomplete-item-desc{color:var(--text-muted);font-size:11px;margin-left:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:50%}.chat-autocomplete-item-cmd{font-weight:600;font-size:14px;color:var(--text-primary);min-width:0}.chat-autocomplete-pop{position:fixed;z-index:50;min-width:200px;max-width:340px;max-height:200px;overflow-y:auto;overscroll-behavior:contain;background:var(--editor-fill, Canvas);color:var(--editor-line, currentColor);border:1px solid var(--border);border-radius:8px;box-shadow:0 4px 16px #0000004d}.chat-autocomplete-item-icon{width:20px;height:20px;flex-shrink:0;color:var(--text-muted)}.chat-reply-bar{display:none;padding:8px 12px;background:var(--bg-mid);border-radius:8px 8px 0 0;border-left:3px solid var(--accent-line);align-items:center;gap:8px;font-size:13px;color:var(--text-secondary)}.chat-reply-bar.show{display:flex}.chat-reply-bar-text{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-reply-bar-close{background:none;border:none;font-size:16px;cursor:pointer;color:var(--text-secondary)}.chat-reply-bar-close:hover{color:var(--text-primary)}.chat-paste-preview{display:none;padding:8px 12px;background:var(--bg-mid);align-items:center;gap:8px;flex-wrap:wrap}.chat-paste-preview.show{display:flex}.chat-paste-preview img{max-height:50px;border-radius:4px}.chat-paste-preview video{max-height:50px;border-radius:4px}.chat-paste-preview-close{background:none;border:none;font-size:16px;cursor:pointer;color:var(--text-secondary);margin-left:auto}.chat-paste-file{display:flex;align-items:center;gap:6px;background:var(--bg-hover);border-radius:6px;padding:4px 8px;font-size:12px;color:var(--text-secondary);max-width:200px}.chat-paste-file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-paste-file-remove{background:none;border:none;cursor:pointer;color:var(--text-secondary);padding:0;display:flex;align-items:center}.chat-paste-file-remove:hover{color:var(--text-primary)}.chat-paste-embed{display:flex;align-items:center;gap:6px;background:var(--bg-hover);border-radius:6px;padding:4px 8px;font-size:12px;color:var(--text-secondary);max-width:200px}.chat-paste-embed-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-selection-chip{display:inline-flex;align-items:center;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:var(--bg-hover);color:var(--text-secondary);border-radius:6px;padding:2px 8px;margin:0 4px;font-size:12px}.chat-paste-embed-remove{background:none;border:none;cursor:pointer;color:var(--text-secondary);padding:0;display:flex;align-items:center}.chat-paste-embed-remove:hover{color:var(--text-primary)}.chat-sidebar-pinned-wrap{position:relative}.chat-sidebar-pinned-wrap[data-drop-position=above]:before{content:"";position:absolute;top:-2px;left:4px;right:4px;height:2px;background:var(--accent);border-radius:1px;z-index:10}.chat-sidebar-pinned-wrap[data-drop-position=below]:after{content:"";position:absolute;bottom:-2px;left:4px;right:4px;height:2px;background:var(--accent);border-radius:1px;z-index:10}.chat-sidebar-pinned-wrap.dragging{opacity:.4}.chat-drop-overlay{display:none;position:absolute;inset:0;z-index:100;background:color-mix(in oklch,var(--theme) 20%,black 60%);align-items:center;justify-content:center;font-size:18px;color:var(--text-primary);font-weight:600;border:3px dashed var(--accent-line);border-radius:12px;pointer-events:none}.chat-drop-overlay.show{display:flex}.chat-msg-video-wrap{max-width:350px;border-radius:8px;overflow:hidden;margin-top:4px;position:relative}.chat-msg-video{width:100%;display:block;border-radius:8px;cursor:pointer}.chat-lightbox{display:none;position:absolute;inset:0;z-index:200;background:#000000d9;align-items:center;justify-content:center;cursor:zoom-out}.chat-lightbox.show{display:flex}.chat-lightbox img,.chat-lightbox video{max-width:95%;max-height:95%;object-fit:contain;border-radius:4px;cursor:default}.chat-lightbox video{background:#000}.chat-msg-file{display:inline-flex;align-items:center;gap:6px;background:var(--bg-hover);border-radius:6px;padding:6px 10px;margin-top:4px;font-size:13px;color:var(--text-secondary);cursor:pointer;text-decoration:none}.chat-msg-file:hover{background:var(--bg-input);color:var(--text-primary)}.chat-msg-file-icon{flex-shrink:0}.chat-input-row{display:flex;gap:0;background:var(--bg-input);border-radius:8px;padding:4px;align-items:flex-end}.chat-input{width:100%;padding:8px 12px;border:none;font-size:15px;outline:none;background:transparent;color:var(--text-primary);font-family:inherit;resize:none;max-height:120px;min-height:24px;line-height:1.4;position:relative;z-index:1}.chat-input::placeholder{color:var(--text-muted)}.chat-input-btn{width:36px;height:36px;background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:20px;border-radius:4px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.chat-input-btn:hover{color:var(--text-primary)}.chat-input-btn.recording{color:#ed4245;animation:pulse 1s infinite}@keyframes pulse{0%,to{transform:scale(1)}50%{transform:scale(1.15)}}.chat-recording-bar{display:flex;align-items:center;gap:10px;background:var(--bg-input);border-radius:8px;padding:8px 12px;animation:fadeIn .15s ease}.chat-recording-overlay{position:absolute;inset:0;z-index:3}@keyframes fadeIn{0%{opacity:0;transform:scale(.98)}to{opacity:1;transform:scale(1)}}.chat-recording-dot{width:10px;height:10px;border-radius:50%;background:#ed4245;flex-shrink:0;animation:recPulse 1s ease-in-out infinite}@keyframes recPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.8)}}.chat-recording-time{font-size:14px;color:var(--text-primary);font-variant-numeric:tabular-nums;min-width:40px}.chat-recording-viz{flex:1;height:24px;display:flex;align-items:center;gap:2px;overflow:hidden}.chat-recording-viz-bar{width:3px;border-radius:2px;background:var(--accent);min-height:3px;transition:height .1s ease}.chat-recording-cancel{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:13px;padding:4px 10px;border-radius:4px}.chat-recording-cancel:hover{color:var(--text-primary);background:var(--bg-hover)}.chat-recording-send{background:var(--accent);color:var(--accent-fg);border:none;cursor:pointer;padding:6px 14px;border-radius:6px;font-size:13px;font-weight:600}.chat-recording-send:hover{background:var(--accent-hover)}.chat-gif-toggle{width:36px;height:36px;border:none;cursor:pointer;border-radius:4px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:none;color:var(--text-muted);font-size:20px;position:relative;overflow:hidden}.chat-gif-toggle:hover{color:var(--text-primary)}.chat-gif-toggle.active{color:var(--accent-text)}.chat-gif-toggle video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:4px;display:none}.chat-gif-toggle.active video{display:block}.chat-gif-toggle.active .chat-gif-icon{display:none}.chat-gif-toggle.recording{pointer-events:none;position:relative;overflow:visible}.chat-gif-progress{position:absolute;top:-10px;left:-10px;width:calc(100% + 20px);height:calc(100% + 20px);z-index:20;pointer-events:none}.chat-gif-progress circle.chat-gif-progress-bg{fill:none;stroke:#00000026;stroke-width:2}.chat-gif-progress circle.chat-gif-progress-fg{fill:none;stroke:var(--accent-line);stroke-width:2;stroke-linecap:round;transform:rotate(-90deg);transform-origin:center;transition:stroke-dashoffset .1s linear}.chat-input-row.processing .chat-input,.chat-input-row.processing .chat-input-wrap,.chat-input-row.processing .chat-input-btn{opacity:.5;pointer-events:none}.chat-empty{flex:1;display:flex;align-items:center;justify-content:center;color:var(--text-muted);font-size:16px}@keyframes chat-skeleton-pulse{0%,to{opacity:.3}50%{opacity:.6}}.chat-msg-loading{opacity:.5}.chat-skeleton{background:var(--bg-hover);animation:chat-skeleton-pulse 1.5s ease-in-out infinite}.chat-skeleton-line{height:14px;background:var(--bg-hover);border-radius:4px;margin:4px 0;animation:chat-skeleton-pulse 1.5s ease-in-out infinite;width:60%}.chat-skeleton-line.short{width:30%}.chat-main{display:flex;flex-direction:column;flex:1;min-width:0;position:relative;height:100%}.chat-sidebar{display:none;flex-direction:column;width:40%;min-width:15%;border-left:1px solid var(--border);background:var(--bg-darkest);overflow:hidden;position:relative}.chat-sidebar.visible{display:flex}.chat-sidebar.drop-target{display:flex;min-width:60px;width:60px;align-items:center;justify-content:center;border:2px dashed var(--accent-line);background:color-mix(in oklch,var(--accent) 10%,var(--bg-darkest))}.chat-sidebar.drop-target:after{content:"Pin";font-size:11px;color:var(--accent-text);font-weight:600;pointer-events:none}.chat-sidebar.visible.drop-target{width:40%;min-width:15%}.chat-sidebar.visible.drop-target:after{display:none}.chat-sidebar.collapsed{width:0!important;min-width:0!important;border-left:none;overflow:hidden}.chat-root.sidebar-left{flex-direction:row-reverse}.chat-root.sidebar-left .chat-sidebar{border-left:none;border-right:1px solid var(--border)}.chat-root.sidebar-left .chat-sidebar-resize{left:auto;right:-3px}.chat-sidebar-resize{position:absolute;left:-3px;top:0;bottom:0;width:6px;cursor:col-resize;z-index:10}.chat-sidebar-resize:hover,.chat-sidebar-resize.dragging{background:var(--accent);opacity:.3}.chat-sidebar-header{display:flex;align-items:center;justify-content:space-between;padding:4px 6px;border-bottom:1px solid var(--border);flex-shrink:0}.chat-sidebar-header-title{font-size:11px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px}.chat-sidebar-collapse-btn{background:none;border:none;cursor:pointer;padding:2px 4px;color:var(--text-muted);display:flex;align-items:center}.chat-sidebar-collapse-btn:hover{color:var(--text-primary)}.chat-sidebar-pinned{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:0;padding:4px}.chat-sidebar-pinned:empty{display:none}.chat-sidebar-pinned-wrap{position:relative;display:flex;flex-direction:column;flex:1;min-height:200px;border:1px solid var(--border);border-radius:6px;overflow:hidden;margin-bottom:4px;background:var(--bg-mid)}.chat-sidebar-pinned-toolbar{position:absolute;top:4px;right:4px;z-index:10;display:flex;gap:2px;opacity:0;transition:opacity .15s;pointer-events:auto}.chat-sidebar-pinned-wrap:hover .chat-sidebar-pinned-toolbar{opacity:1}.chat-sidebar-pinned-toolbar button{background:var(--bg-darkest);border:1px solid var(--border);border-radius:4px;color:var(--text-muted);cursor:pointer;padding:2px 4px;font-size:10px;display:flex;align-items:center;gap:2px;line-height:1}.chat-sidebar-pinned-toolbar button:hover{color:var(--text-primary);background:var(--bg-mid)}.chat-sidebar-pinned-toolbar button svg{width:12px;height:12px}.chat-sidebar-pinned iframe{width:100%;flex:1;border:none;border-radius:4px;min-height:200px;background:var(--bg-mid)}.chat-sidebar-pinned-info{background:var(--bg-darkest);border-bottom:1px solid var(--border);font-size:11px;color:var(--text-secondary)}.chat-sidebar-pinned-info-main{display:flex;align-items:center;gap:4px;padding:3px 8px;cursor:pointer}.chat-sidebar-pinned-info-main:hover{background:var(--bg-hover)}.chat-sidebar-pinned-info-title{flex:1;font-weight:600;color:var(--text-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}.chat-sidebar-pinned-info-chevron{font-size:10px;transition:transform .15s;flex-shrink:0}.chat-sidebar-pinned-info-chevron.open{transform:rotate(90deg)}.chat-sidebar-pinned-info-details{padding:2px 8px 4px}.chat-sidebar-pinned-info-row{display:flex;align-items:center;gap:4px;padding:1px 0}.chat-sidebar-pinned-info-label{color:var(--text-muted);font-size:10px;min-width:24px;flex-shrink:0}.chat-sidebar-pinned-info-value{font-family:monospace;font-size:10px;color:var(--text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-sidebar-pinned-info-url{cursor:pointer}.chat-sidebar-pinned-info-url:hover{color:var(--text-primary);text-decoration:underline}.chat-sidebar-pinned-info-editable{cursor:pointer;border-bottom:1px dashed var(--text-muted)}.chat-sidebar-pinned-info-editable:hover{color:var(--text-primary)}.chat-sidebar-pinned-info-input{font-family:monospace;font-size:10px;background:var(--bg-input);border:1px solid var(--border);border-radius:3px;color:var(--text-primary);padding:1px 4px;flex:1;min-width:0}.chat-sidebar-pinned-resize-handle{height:6px;cursor:row-resize;flex-shrink:0;background:transparent;position:relative}.chat-sidebar-pinned-resize-handle:after{content:"";position:absolute;left:20%;right:20%;top:2px;height:2px;border-radius:1px;background:var(--border);opacity:0;transition:opacity .15s}.chat-sidebar-pinned-resize-handle:hover:after,.chat-sidebar-pinned-resize-handle.active:after{opacity:1}.chat-sidebar-pinned-resize-handle.active:after{background:var(--accent)}.chat-sidebar-status{padding:4px 8px;font-size:11px;color:var(--text-muted);text-align:center}.chat-sidebar-toggle-btn{background:none;border:none;color:var(--text-muted);cursor:pointer;padding:2px 4px;border-radius:4px;display:flex;align-items:center}.chat-sidebar-toggle-btn:hover{background:var(--bg-hover);color:var(--text-primary)}.chat-embed-pin{cursor:pointer}.chat-embed-pin.pinned{color:var(--accent-text)}.chat-msg-name-computer{color:var(--accent-text);font-style:italic}.chat-avatar.computer{background:var(--accent-soft);overflow:hidden}.chat-avatar.computer img{width:100%;height:100%;object-fit:cover;display:block}.computer-presence img{width:100%;height:100%;object-fit:cover;display:block;border-radius:50%}.chat-dialog-overlay{position:fixed;inset:0;z-index:100;background:#00000080;display:flex;align-items:center;justify-content:center;animation:fadeIn .15s ease}.chat-emoticon-dialog,.chat-font-dialog{background:var(--bg-dark);border:1px solid var(--border);border-radius:8px;min-width:300px;max-width:400px;box-shadow:0 8px 32px #0006}.chat-plugin-panel{background:var(--bg-dark);border:1px solid var(--border);border-radius:8px;min-width:300px;max-width:420px;max-height:70vh;display:flex;flex-direction:column;box-shadow:0 8px 32px #0006}.chat-plugin-panel-header{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-bottom:1px solid var(--border);font-size:14px;font-weight:600}.chat-plugin-panel-close{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:18px;line-height:1}.chat-plugin-panel-close:hover{color:var(--text-primary)}.chat-plugin-panel-body{padding:6px;overflow-y:auto;display:flex;flex-direction:column;gap:1px}.chat-plugin-section{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--text-muted);padding:10px 6px 4px}.chat-plugin-item{display:flex;align-items:center;gap:8px;padding:5px 6px;border-radius:4px;cursor:pointer;font-size:13px;color:var(--text-primary)}.chat-plugin-item:hover{background:var(--bg-hover)}.chat-plugin-item input{cursor:pointer}.chat-plugin-item-locked,.chat-plugin-item-locked input{cursor:default}.chat-plugin-item-locked{opacity:.55}.chat-plugin-item-locked:hover{background:none}.chat-plugin-id{margin-left:auto;font-family:ui-monospace,monospace;font-size:11px;color:var(--text-muted)}.chat-emoticon-dialog-header,.chat-font-dialog-header{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-bottom:1px solid var(--border);font-size:14px;font-weight:600}.chat-emoticon-dialog-close,.chat-font-dialog-close{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:18px;line-height:1}.chat-emoticon-dialog-close:hover,.chat-font-dialog-close:hover{color:var(--text-primary)}.chat-emoticon-dialog-body,.chat-font-dialog-body{padding:12px;display:flex;flex-direction:column;gap:8px}.chat-emoticon-dialog-footer,.chat-font-dialog-footer{display:flex;gap:6px;justify-content:flex-end;padding:8px 12px;border-top:1px solid var(--border)}.chat-emoticon-dialog-footer button,.chat-font-dialog-footer button{padding:6px 14px;border-radius:6px;font-size:13px;cursor:pointer;border:none}.chat-emoticon-dialog-save,.chat-font-dialog-save{background:var(--accent);color:var(--accent-fg);font-weight:600}.chat-emoticon-dialog-save:disabled,.chat-font-dialog-save:disabled{opacity:.5;cursor:default}.chat-emoticon-dialog-save:not(:disabled):hover,.chat-font-dialog-save:not(:disabled):hover{background:var(--accent-hover)}.chat-emoticon-dialog-nav{display:flex;align-items:center;justify-content:center;gap:8px;font-size:12px;color:var(--text-muted)}.chat-emoticon-dialog-nav button{background:none;border:1px solid var(--border);color:var(--text-secondary);cursor:pointer;padding:2px 8px;border-radius:4px;font-size:12px}.chat-emoticon-dialog-nav button:disabled{opacity:.4;cursor:default}.chat-emoticon-dialog-nav button:not(:disabled):hover{background:var(--bg-hover)}.chat-emoticon-dialog-name,.chat-font-dialog-name{width:100%;padding:6px 10px;background:var(--bg-input);border:1px solid var(--border);border-radius:4px;color:var(--text-primary);font-size:14px;outline:none}.chat-emoticon-dialog-name:focus,.chat-font-dialog-name:focus{border-color:var(--accent-line)}.chat-font-dialog-list{display:flex;flex-direction:column;gap:2px;max-height:120px;overflow-y:auto}.chat-font-dialog-item{display:flex;align-items:center;justify-content:space-between;padding:4px 8px;border-radius:4px;font-size:13px}.chat-font-dialog-item:hover{background:var(--bg-hover)}.chat-font-dialog-remove{width:20px;height:20px;border-radius:50%;background:var(--bg-hover);color:var(--text-muted);border:1px solid var(--border);cursor:pointer;font-size:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.chat-font-dialog-remove:hover{background:#ed4245;color:#fff;border-color:#ed4245}.chat-font-dialog-choose{background:none;border:1px dashed var(--border);color:var(--text-muted);cursor:pointer;font-size:13px;padding:8px 12px;border-radius:4px;text-align:center;width:100%}.chat-font-dialog-choose:hover{border-color:var(--accent-line);color:var(--text-primary)}.chat-font-dialog-preview{padding:10px;border-radius:4px;background:var(--bg-hover);text-align:center;font-size:16px;color:var(--text-primary)}.chat-gif-toggle .chat-gif-progress{position:absolute;inset:-4px;width:calc(100% + 8px);height:calc(100% + 8px);z-index:20;pointer-events:none}.chat-time-gap{text-align:center;color:var(--text-muted);font-size:11px;padding:8px 0 4px;position:relative}.chat-time-gap:before{content:"";position:absolute;left:20%;right:20%;top:50%;border-top:1px solid var(--border);z-index:0}.chat-time-gap span{position:relative;z-index:1;background:var(--bg-dark);padding:0 8px}.chat-model-dialog{background:var(--bg-mid);border:1px solid var(--border);border-radius:8px;width:420px;max-width:90vw;padding:0;overflow:hidden}.chat-model-dialog-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid var(--border);font-weight:600;font-size:14px}.chat-model-dialog-close{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:20px;padding:0 4px}.chat-model-dialog-close:hover{color:var(--text-primary)}.chat-model-dialog-tabs{display:flex;border-bottom:1px solid var(--border)}.chat-model-dialog-tabs button{flex:1;background:none;border:none;color:var(--text-secondary);padding:8px 12px;cursor:pointer;font-size:13px;border-bottom:2px solid transparent}.chat-model-dialog-tabs button:hover{color:var(--text-primary)}.chat-model-dialog-tabs button.active{color:var(--accent-text);border-bottom-color:var(--accent-line)}.chat-model-dialog-body{padding:12px 16px;min-height:120px}.chat-model-dialog-label{display:block;font-size:12px;color:var(--text-secondary);margin-bottom:10px}.chat-model-dialog-input{display:block;width:100%;margin-top:4px;padding:6px 8px;background:var(--bg-input);border:1px solid var(--border);border-radius:4px;color:var(--text-primary);font-size:13px;outline:none}.chat-model-dialog-input:focus{border-color:var(--accent-line)}select.chat-model-dialog-input{flex:1}.chat-model-dialog-btn{background:var(--bg-hover);border:1px solid var(--border);border-radius:4px;color:var(--text-primary);padding:6px 12px;cursor:pointer;font-size:13px}.chat-model-dialog-btn:hover{background:var(--accent-soft)}.chat-model-dialog-btn.primary{background:var(--accent);color:var(--accent-fg);border-color:var(--accent-line)}.chat-model-dialog-btn.primary:hover{opacity:.9}.chat-model-dialog-footer{display:flex;gap:8px;justify-content:flex-end;padding:12px 16px;border-top:1px solid var(--border)}@media (max-width: 600px){.chat-root,.chat-root.sidebar-left{flex-direction:column-reverse!important}.chat-sidebar{width:100%!important;min-width:0!important;border-left:none!important;border-right:none!important;border-bottom:1px solid var(--border);max-height:50%}.chat-sidebar.visible{max-height:50%}.chat-sidebar.drop-target{width:100%!important;min-width:0!important;height:60px}.chat-sidebar.visible.drop-target{width:100%!important}.chat-sidebar-resize{display:none}.chat-msg-group{padding:2px 10px;gap:8px}.chat-msg-continuation{padding:0 10px 0 48px}.chat-msg-continuation.has-gif{padding-left:10px}.chat-msg-action{padding:4px 10px}.chat-avatar-col{width:30px}.chat-avatar{width:30px;height:30px;font-size:14px}.chat-msg-gif-inline{width:30px;height:30px}.chat-presence-bar{padding:4px 10px;gap:6px;flex-wrap:wrap}.chat-input-wrapper{padding:0 8px 8px}.chat-input{padding:6px 8px;font-size:14px}.chat-input-btn,.chat-gif-toggle{width:32px;height:32px;font-size:18px}.chat-reply-bar{padding:6px 8px;font-size:12px}.chat-msg-reply-ref{padding-left:24px;font-size:12px}.chat-msg-reply-ref:before{left:12px}.chat-msg-reply-ref-text{max-width:180px}.chat-voice-note{max-width:100%}.chat-msg-embed{height:200px}.chat-msg-video-wrap,.chat-msg-image-wrap{max-width:100%}.chat-code-block code{font-size:12px}.shiki{font-size:12px!important}.chat-emoji-picker{max-width:260px;width:260px}.chat-emoticon-dialog,.chat-font-dialog{min-width:0;max-width:calc(100vw - 24px);width:calc(100vw - 24px)}.chat-model-dialog{width:calc(100vw - 24px)}.chat-autocomplete-item{padding:6px 8px;font-size:13px}.chat-typing-bar,.chat-llm-status{padding:0 10px}.chat-recording-bar{padding:6px 8px}.chat-sidebar-pinned-wrap{min-height:120px}.chat-sidebar-toggle-btn svg,.chat-sidebar-collapse-btn svg{transform:rotate(90deg)}.chat-time-gap:before{left:10%;right:10%}}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
import { p as r } from "./index-DYFHDHZ9.js";
|
|
3
|
+
export {
|
|
4
|
+
r as plugins
|
|
5
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { render as p, createComponent as c } from "solid-js/web";
|
|
2
|
+
import { s as e, C as u } from "./ChatRoot-BXsklgz7.js";
|
|
3
|
+
function C(t, o) {
|
|
4
|
+
e(o.repo), getComputedStyle(o).position === "static" && (o.style.position = "relative");
|
|
5
|
+
const s = p(() => c(u, {
|
|
6
|
+
handle: t,
|
|
7
|
+
element: o
|
|
8
|
+
}), o);
|
|
9
|
+
return () => {
|
|
10
|
+
s();
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function h(t) {
|
|
14
|
+
const o = t.repo || window.repo;
|
|
15
|
+
e(o);
|
|
16
|
+
const s = t.getAttribute("doc-url") || t.docUrl || null, r = t.getAttribute("features"), l = r ? r === "all" || r === "core" ? r : r.split(",").map((i) => i.trim()).filter(Boolean) : void 0;
|
|
17
|
+
let n = null, a = !1;
|
|
18
|
+
return (async () => {
|
|
19
|
+
if (!(!o || !s))
|
|
20
|
+
try {
|
|
21
|
+
const i = await o.find(s.split("#")[0]);
|
|
22
|
+
if (a) return;
|
|
23
|
+
getComputedStyle(t).position === "static" && (t.style.position = "relative"), n = p(() => c(u, {
|
|
24
|
+
handle: i,
|
|
25
|
+
element: t,
|
|
26
|
+
selector: l
|
|
27
|
+
}), t);
|
|
28
|
+
} catch (i) {
|
|
29
|
+
console.warn("[Chat] component find:", i);
|
|
30
|
+
}
|
|
31
|
+
})(), () => {
|
|
32
|
+
a = !0, n?.();
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
h as ChatComponent,
|
|
37
|
+
C as ChatTool
|
|
38
|
+
};
|