@squadico/chatbot 1.0.0 → 1.1.0
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/README.md +113 -5
- package/dist/chatbot.global.js +6 -6
- package/dist/chatbot.global.js.map +1 -1
- package/dist/components/ChatbotWidget.d.ts.map +1 -1
- package/dist/element.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/jsx.d.ts +2 -0
- package/dist/jsx.d.ts.map +1 -1
- package/dist/lib/client.d.ts +4 -0
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/lib/useChat.d.ts +4 -1
- package/dist/lib/useChat.d.ts.map +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +3 -2
- package/dist/react.js.map +1 -1
- package/dist/{src-CN1vDssu.js → src-D4ZbNlbK.js} +193 -169
- package/dist/src-D4ZbNlbK.js.map +1 -0
- package/dist/src-wGegp_8B.cjs +8 -0
- package/dist/src-wGegp_8B.cjs.map +1 -0
- package/dist/types.d.ts +27 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/src-CN1vDssu.js.map +0 -1
- package/dist/src-DvRdkFTu.cjs +0 -8
- package/dist/src-DvRdkFTu.cjs.map +0 -1
|
@@ -735,11 +735,12 @@ var qe = "https://api.squadico.com", Je = 2e4, q = class extends Error {
|
|
|
735
735
|
function Ye(e, t) {
|
|
736
736
|
return `${e.replace(/\/+$/, "")}${t}`;
|
|
737
737
|
}
|
|
738
|
-
function Xe(e) {
|
|
738
|
+
function Xe(e, t) {
|
|
739
739
|
return {
|
|
740
740
|
"Content-Type": "application/json",
|
|
741
741
|
Accept: "text/event-stream, application/json",
|
|
742
|
-
...e ? { "X-Visitor-Token": e } : {}
|
|
742
|
+
...e ? { "X-Visitor-Token": e } : {},
|
|
743
|
+
...t ? { "X-Subject-Token": t } : {}
|
|
743
744
|
};
|
|
744
745
|
}
|
|
745
746
|
function Ze(e) {
|
|
@@ -913,7 +914,7 @@ async function pt(e) {
|
|
|
913
914
|
async function mt(e, t, n) {
|
|
914
915
|
let r = await fetch(e, {
|
|
915
916
|
method: "POST",
|
|
916
|
-
headers: Xe(n.visitorToken),
|
|
917
|
+
headers: Xe(n.visitorToken, n.subjectToken),
|
|
917
918
|
body: JSON.stringify(t),
|
|
918
919
|
signal: n.signal
|
|
919
920
|
});
|
|
@@ -992,15 +993,22 @@ function yt(e, { embedKey: t, user: n }) {
|
|
|
992
993
|
}
|
|
993
994
|
//#endregion
|
|
994
995
|
//#region src/lib/useChat.ts
|
|
995
|
-
function bt(e) {
|
|
996
|
+
async function bt(e) {
|
|
997
|
+
if (e) try {
|
|
998
|
+
return await e() || void 0;
|
|
999
|
+
} catch {
|
|
1000
|
+
return;
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
function xt(e) {
|
|
996
1004
|
let t = e instanceof q ? e.status : void 0;
|
|
997
1005
|
return t === 415 ? "unsupported" : t === 413 ? "tooLarge" : t === 409 ? "tooMany" : t === 422 ? "unreadable" : "failed";
|
|
998
1006
|
}
|
|
999
|
-
var
|
|
1000
|
-
function
|
|
1007
|
+
var St = 5e3;
|
|
1008
|
+
function Ct(e) {
|
|
1001
1009
|
return e instanceof q && e.code === "conversation_retired";
|
|
1002
1010
|
}
|
|
1003
|
-
function
|
|
1011
|
+
function wt(e) {
|
|
1004
1012
|
let [t, n] = H([]), [r, i] = H(!1), [a, o] = H(""), [s, c] = H([]), [l, u] = H(""), [d, f] = H(null), [p, m] = H(!1), [h, g] = H([]), [_, v] = H([]), [y, b] = H(null), x = W(null), S = W(e);
|
|
1005
1013
|
S.current = e;
|
|
1006
1014
|
let C = W(null), w = W(null), T = W(void 0), E = e.greeting, D = G(() => E ? {
|
|
@@ -1098,7 +1106,7 @@ function Ct(e) {
|
|
|
1098
1106
|
try {
|
|
1099
1107
|
l = await t(i, c, o.signal);
|
|
1100
1108
|
} catch (e) {
|
|
1101
|
-
if (!
|
|
1109
|
+
if (!Ct(e) || (vt(), w.current = null, C.current = null, !r)) throw e;
|
|
1102
1110
|
i = await j(), a = "", k(s, { content: "" }), l = await t(i, c, o.signal);
|
|
1103
1111
|
}
|
|
1104
1112
|
if (l.withHuman && m(!0), l.held) {
|
|
@@ -1138,7 +1146,8 @@ function Ct(e) {
|
|
|
1138
1146
|
let t = e.trim();
|
|
1139
1147
|
if (!t && h.length === 0) return;
|
|
1140
1148
|
let n = h;
|
|
1141
|
-
g([]), b(null), N(t, (e, r, i) => ft({
|
|
1149
|
+
g([]), b(null), N(t, async (e, r, i) => ft({
|
|
1150
|
+
subjectToken: await bt(S.current.getSubjectToken),
|
|
1142
1151
|
apiUrl: S.current.apiUrl ?? "https://api.squadico.com",
|
|
1143
1152
|
conversationId: e.sessionId,
|
|
1144
1153
|
visitorToken: e.visitorToken,
|
|
@@ -1157,7 +1166,7 @@ function Ct(e) {
|
|
|
1157
1166
|
conversationId: t.sessionId,
|
|
1158
1167
|
visitorToken: t.visitorToken,
|
|
1159
1168
|
file: e
|
|
1160
|
-
})).then((e) => g((t) => [...t, e])).catch((e) => b(
|
|
1169
|
+
})).then((e) => g((t) => [...t, e])).catch((e) => b(xt(e))).finally(() => v((t) => {
|
|
1161
1170
|
let n = t.indexOf(e.name);
|
|
1162
1171
|
return n < 0 ? t : [...t.slice(0, n), ...t.slice(n + 1)];
|
|
1163
1172
|
}));
|
|
@@ -1181,7 +1190,8 @@ function Ct(e) {
|
|
|
1181
1190
|
});
|
|
1182
1191
|
}, []), ee = K((e, t) => {
|
|
1183
1192
|
let n = d;
|
|
1184
|
-
n && N(t, (t, r, i) => pt({
|
|
1193
|
+
n && N(t, async (t, r, i) => pt({
|
|
1194
|
+
subjectToken: await bt(S.current.getSubjectToken),
|
|
1185
1195
|
apiUrl: S.current.apiUrl ?? "https://api.squadico.com",
|
|
1186
1196
|
conversationId: t.sessionId,
|
|
1187
1197
|
visitorToken: t.visitorToken,
|
|
@@ -1197,7 +1207,7 @@ function Ct(e) {
|
|
|
1197
1207
|
type: "chatbot-reset",
|
|
1198
1208
|
sessionId: ""
|
|
1199
1209
|
});
|
|
1200
|
-
}, [O]), z = e.humanPollMs ??
|
|
1210
|
+
}, [O]), z = e.humanPollMs ?? St;
|
|
1201
1211
|
U(() => {
|
|
1202
1212
|
if (!p || !a) return;
|
|
1203
1213
|
let e = setInterval(() => {
|
|
@@ -1242,7 +1252,7 @@ function Ct(e) {
|
|
|
1242
1252
|
}
|
|
1243
1253
|
//#endregion
|
|
1244
1254
|
//#region node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js
|
|
1245
|
-
var
|
|
1255
|
+
var Tt = 0;
|
|
1246
1256
|
Array.isArray;
|
|
1247
1257
|
function J(e, n, r, i, a, o) {
|
|
1248
1258
|
n || (n = {});
|
|
@@ -1259,7 +1269,7 @@ function J(e, n, r, i, a, o) {
|
|
|
1259
1269
|
__e: null,
|
|
1260
1270
|
__c: null,
|
|
1261
1271
|
constructor: void 0,
|
|
1262
|
-
__v: --
|
|
1272
|
+
__v: --Tt,
|
|
1263
1273
|
__i: -1,
|
|
1264
1274
|
__u: 0,
|
|
1265
1275
|
__source: a,
|
|
@@ -1270,17 +1280,17 @@ function J(e, n, r, i, a, o) {
|
|
|
1270
1280
|
}
|
|
1271
1281
|
//#endregion
|
|
1272
1282
|
//#region src/components/Composer.tsx
|
|
1273
|
-
var
|
|
1274
|
-
function
|
|
1283
|
+
var Et = 132, Dt = "image/png,image/jpeg,image/gif,image/webp,application/pdf,.docx,.txt,.md,.csv,.json", Ot = /^[a-zA-Z0-9_-]*$/;
|
|
1284
|
+
function kt(e, t) {
|
|
1275
1285
|
let n = e.slice(0, t), r = n.lastIndexOf("@");
|
|
1276
1286
|
if (r < 0 || r > 0 && !/\s/.test(n[r - 1] ?? "")) return null;
|
|
1277
1287
|
let i = n.slice(r + 1);
|
|
1278
|
-
return
|
|
1288
|
+
return Ot.test(i) ? {
|
|
1279
1289
|
start: r,
|
|
1280
1290
|
query: i
|
|
1281
1291
|
} : null;
|
|
1282
1292
|
}
|
|
1283
|
-
function
|
|
1293
|
+
function At({ placeholder: e, locale: t, busy: n, autoFocus: r, handles: i, addressee: a, attachments: o = [], uploading: s = [], attachmentError: c, onAttach: l, onDetach: u, onSend: d, onStop: f }) {
|
|
1284
1294
|
let [p, m] = H(""), [h, g] = H(null), [_, v] = H(0), [y, b] = H(!1), x = W(null), C = W(null), w = !!l, T = s.length > 0, E = G(() => {
|
|
1285
1295
|
if (!h || !i || i.length === 0) return [];
|
|
1286
1296
|
let e = h.query.toLowerCase();
|
|
@@ -1289,8 +1299,8 @@ function kt({ placeholder: e, locale: t, busy: n, autoFocus: r, handles: i, addr
|
|
|
1289
1299
|
let e = x.current;
|
|
1290
1300
|
if (!e) return;
|
|
1291
1301
|
e.style.height = "auto";
|
|
1292
|
-
let t = e.scrollHeight >
|
|
1293
|
-
e.style.height = `${Math.min(e.scrollHeight,
|
|
1302
|
+
let t = e.scrollHeight > Et;
|
|
1303
|
+
e.style.height = `${Math.min(e.scrollHeight, Et)}px`, e.style.overflowY = t ? "auto" : "hidden";
|
|
1294
1304
|
}, []);
|
|
1295
1305
|
U(() => {
|
|
1296
1306
|
r && x.current?.focus(), O();
|
|
@@ -1298,7 +1308,7 @@ function kt({ placeholder: e, locale: t, busy: n, autoFocus: r, handles: i, addr
|
|
|
1298
1308
|
a && (m((e) => e || `@${a} `), requestAnimationFrame(O));
|
|
1299
1309
|
}, [a, O]);
|
|
1300
1310
|
let k = K((e) => {
|
|
1301
|
-
g(
|
|
1311
|
+
g(kt(e.value, e.selectionStart ?? e.value.length)), v(0);
|
|
1302
1312
|
}, []), A = K((e) => {
|
|
1303
1313
|
let t = x.current;
|
|
1304
1314
|
if (!t || !h) return;
|
|
@@ -1451,7 +1461,7 @@ function kt({ placeholder: e, locale: t, busy: n, autoFocus: r, handles: i, addr
|
|
|
1451
1461
|
ref: C,
|
|
1452
1462
|
type: "file",
|
|
1453
1463
|
multiple: !0,
|
|
1454
|
-
accept:
|
|
1464
|
+
accept: Dt,
|
|
1455
1465
|
class: "sqc-file-input",
|
|
1456
1466
|
onChange: (e) => {
|
|
1457
1467
|
j(e.currentTarget.files), e.currentTarget.value = "";
|
|
@@ -1513,18 +1523,18 @@ function kt({ placeholder: e, locale: t, busy: n, autoFocus: r, handles: i, addr
|
|
|
1513
1523
|
}
|
|
1514
1524
|
//#endregion
|
|
1515
1525
|
//#region src/lib/confirm.ts
|
|
1516
|
-
var
|
|
1526
|
+
var jt = {
|
|
1517
1527
|
fr: /\br[ée]ponde?z? +«?\s*oui\b/i,
|
|
1518
1528
|
en: /\b(?:reply|answer|respond) +[“"']?\s*yes\b/i,
|
|
1519
1529
|
es: /\bresponda?e?d? +«?\s*s[íi]\b/i
|
|
1520
|
-
},
|
|
1530
|
+
}, Mt = {
|
|
1521
1531
|
fr: [
|
|
1522
1532
|
/\b(?:confirmes?[- ]tu|confirmez[- ]vous)\b/i,
|
|
1523
1533
|
/\b(?:valides?[- ]tu|validez[- ]vous)\b/i,
|
|
1524
1534
|
/\b(?:es[- ]tu s[ûu]re?|[êe]tes[- ]vous s[ûu]re?s?)\b/i,
|
|
1525
1535
|
/\b(?:dois[- ]je|puis[- ]je)\b/i,
|
|
1526
1536
|
/\b(?:je continue|on continue|on y va|je lance)\b/i,
|
|
1527
|
-
|
|
1537
|
+
jt.fr
|
|
1528
1538
|
],
|
|
1529
1539
|
en: [
|
|
1530
1540
|
/\bdo you confirm\b/i,
|
|
@@ -1532,7 +1542,7 @@ var At = {
|
|
|
1532
1542
|
/\b(?:shall|should) I\b/i,
|
|
1533
1543
|
/\bare you sure\b/i,
|
|
1534
1544
|
/\b(?:shall we|should I) (?:proceed|continue|go ahead)\b/i,
|
|
1535
|
-
|
|
1545
|
+
jt.en
|
|
1536
1546
|
],
|
|
1537
1547
|
es: [
|
|
1538
1548
|
/\b(?:confirmas|confirma|confirm[áa]is)\b/i,
|
|
@@ -1540,25 +1550,25 @@ var At = {
|
|
|
1540
1550
|
/\best[áa]s? seguro\b/i,
|
|
1541
1551
|
/\b(?:contin[úu]o|procedo|lo lanzo|lo hago)\b/i,
|
|
1542
1552
|
/\bquieres? que\b/i,
|
|
1543
|
-
|
|
1553
|
+
jt.es
|
|
1544
1554
|
]
|
|
1545
|
-
},
|
|
1546
|
-
function
|
|
1547
|
-
if (
|
|
1555
|
+
}, Nt = /^\s*(?:[-*•]\s+)?\[[ xX]\]\s+/m;
|
|
1556
|
+
function Pt(e, t = "en") {
|
|
1557
|
+
if (Nt.test(e)) return !1;
|
|
1548
1558
|
let n = e.split("\n").map((e) => e.trim()).filter(Boolean), r = n[n.length - 1];
|
|
1549
|
-
return !r || !r.includes("?") && !
|
|
1559
|
+
return !r || !r.includes("?") && !jt[t].test(r) ? !1 : Mt[t].some((e) => e.test(r));
|
|
1550
1560
|
}
|
|
1551
1561
|
//#endregion
|
|
1552
1562
|
//#region src/components/Approval.tsx
|
|
1553
|
-
var
|
|
1554
|
-
function
|
|
1555
|
-
let t = e.replace(
|
|
1563
|
+
var Ft = /^mcp_[0-9a-f]{8}_/;
|
|
1564
|
+
function It(e) {
|
|
1565
|
+
let t = e.replace(Ft, "").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim().toLowerCase();
|
|
1556
1566
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : e;
|
|
1557
1567
|
}
|
|
1558
|
-
function
|
|
1568
|
+
function Lt(e) {
|
|
1559
1569
|
return typeof e == "string" ? e : JSON.stringify(e) ?? String(e);
|
|
1560
1570
|
}
|
|
1561
|
-
function
|
|
1571
|
+
function Rt({ locale: e, call: t, onDecide: n }) {
|
|
1562
1572
|
let { approval: r, confirm: i } = e.t, [a, o] = H(null), s = !!n && a === null, c = (e, t) => {
|
|
1563
1573
|
o(t), n?.(e, t);
|
|
1564
1574
|
}, l = t ? Object.entries(t.arguments) : [];
|
|
@@ -1570,7 +1580,7 @@ function Lt({ locale: e, call: t, onDecide: n }) {
|
|
|
1570
1580
|
t && /* @__PURE__ */ J("p", {
|
|
1571
1581
|
class: "sqc-approval__request",
|
|
1572
1582
|
"data-testid": "sqc-approval-tool",
|
|
1573
|
-
children: r.request.replace("{tool}",
|
|
1583
|
+
children: r.request.replace("{tool}", It(t.tool))
|
|
1574
1584
|
}),
|
|
1575
1585
|
l.length > 0 && /* @__PURE__ */ J("dl", {
|
|
1576
1586
|
class: "sqc-approval__args",
|
|
@@ -1579,10 +1589,10 @@ function Lt({ locale: e, call: t, onDecide: n }) {
|
|
|
1579
1589
|
class: "sqc-approval__arg",
|
|
1580
1590
|
children: [/* @__PURE__ */ J("dt", {
|
|
1581
1591
|
class: "sqc-approval__arg-name",
|
|
1582
|
-
children:
|
|
1592
|
+
children: It(e)
|
|
1583
1593
|
}), /* @__PURE__ */ J("dd", {
|
|
1584
1594
|
class: "sqc-approval__arg-value",
|
|
1585
|
-
children:
|
|
1595
|
+
children: Lt(t)
|
|
1586
1596
|
})]
|
|
1587
1597
|
}, e))
|
|
1588
1598
|
}),
|
|
@@ -1609,7 +1619,7 @@ function Lt({ locale: e, call: t, onDecide: n }) {
|
|
|
1609
1619
|
}
|
|
1610
1620
|
//#endregion
|
|
1611
1621
|
//#region src/components/Confirm.tsx
|
|
1612
|
-
function
|
|
1622
|
+
function zt({ locale: e, onPick: t }) {
|
|
1613
1623
|
let [n, r] = H(null), i = !!t && n === null, { confirm: a } = e.t, o = [{
|
|
1614
1624
|
value: a.yesValue,
|
|
1615
1625
|
label: a.yes,
|
|
@@ -1637,7 +1647,7 @@ function Rt({ locale: e, onPick: t }) {
|
|
|
1637
1647
|
}
|
|
1638
1648
|
//#endregion
|
|
1639
1649
|
//#region src/components/Choices.tsx
|
|
1640
|
-
function
|
|
1650
|
+
function Bt() {
|
|
1641
1651
|
return /* @__PURE__ */ J("svg", {
|
|
1642
1652
|
viewBox: "0 0 16 16",
|
|
1643
1653
|
fill: "none",
|
|
@@ -1651,7 +1661,7 @@ function zt() {
|
|
|
1651
1661
|
})
|
|
1652
1662
|
});
|
|
1653
1663
|
}
|
|
1654
|
-
function
|
|
1664
|
+
function Vt({ items: e, locale: t, onPick: n }) {
|
|
1655
1665
|
let [r, i] = H(null), a = !!n && r === null;
|
|
1656
1666
|
return /* @__PURE__ */ J("div", {
|
|
1657
1667
|
class: "sqc-choices",
|
|
@@ -1670,7 +1680,7 @@ function Bt({ items: e, locale: t, onPick: n }) {
|
|
|
1670
1680
|
children: [/* @__PURE__ */ J("span", {
|
|
1671
1681
|
class: `sqc-choice__box${o ? " sqc-choice__box--on" : ""}`,
|
|
1672
1682
|
"aria-hidden": "true",
|
|
1673
|
-
children: o && /* @__PURE__ */ J(
|
|
1683
|
+
children: o && /* @__PURE__ */ J(Bt, {})
|
|
1674
1684
|
}), /* @__PURE__ */ J("span", {
|
|
1675
1685
|
class: "sqc-choice__label",
|
|
1676
1686
|
children: e.content
|
|
@@ -1681,9 +1691,9 @@ function Bt({ items: e, locale: t, onPick: n }) {
|
|
|
1681
1691
|
}
|
|
1682
1692
|
//#endregion
|
|
1683
1693
|
//#region src/components/RichText.tsx
|
|
1684
|
-
var
|
|
1685
|
-
function
|
|
1686
|
-
return
|
|
1694
|
+
var Ht = /(\*\*[^*\n]+\*\*|`[^`\n]+`|~~[^~\n]+~~|\[[^\]\n]+\]\([^)\s]+\)|\*[^*\n]+\*|https?:\/\/[^\s<>()]+)/g, Ut = /^\[([^\]\n]+)\]\(([^)\s]+)\)$/, Wt = /^(https?:|mailto:)/i;
|
|
1695
|
+
function Gt(e, t, n) {
|
|
1696
|
+
return Wt.test(e) ? /* @__PURE__ */ J("a", {
|
|
1687
1697
|
href: e,
|
|
1688
1698
|
target: "_blank",
|
|
1689
1699
|
rel: "noopener noreferrer",
|
|
@@ -1691,28 +1701,28 @@ function Wt(e, t, n) {
|
|
|
1691
1701
|
}, n) : t;
|
|
1692
1702
|
}
|
|
1693
1703
|
function Y(e, t) {
|
|
1694
|
-
let n = e.split(
|
|
1704
|
+
let n = e.split(Ht), r = [];
|
|
1695
1705
|
return n.forEach((e, n) => {
|
|
1696
1706
|
if (!e) return;
|
|
1697
|
-
let i = `${t}-${n}`, a =
|
|
1698
|
-
e.startsWith("**") && e.endsWith("**") && e.length > 4 ? r.push(/* @__PURE__ */ J("strong", { children: e.slice(2, -2) }, i)) : e.startsWith("`") && e.endsWith("`") && e.length > 2 ? r.push(/* @__PURE__ */ J("code", { children: e.slice(1, -1) }, i)) : e.startsWith("~~") && e.endsWith("~~") && e.length > 4 ? r.push(/* @__PURE__ */ J("del", { children: e.slice(2, -2) }, i)) : a ? r.push(
|
|
1707
|
+
let i = `${t}-${n}`, a = Ut.exec(e);
|
|
1708
|
+
e.startsWith("**") && e.endsWith("**") && e.length > 4 ? r.push(/* @__PURE__ */ J("strong", { children: e.slice(2, -2) }, i)) : e.startsWith("`") && e.endsWith("`") && e.length > 2 ? r.push(/* @__PURE__ */ J("code", { children: e.slice(1, -1) }, i)) : e.startsWith("~~") && e.endsWith("~~") && e.length > 4 ? r.push(/* @__PURE__ */ J("del", { children: e.slice(2, -2) }, i)) : a ? r.push(Gt(a[2], a[1], i)) : e.startsWith("*") && e.endsWith("*") && e.length > 2 ? r.push(/* @__PURE__ */ J("em", { children: e.slice(1, -1) }, i)) : /^https?:\/\//.test(e) ? r.push(Gt(e, e, i)) : r.push(e);
|
|
1699
1709
|
}), r;
|
|
1700
1710
|
}
|
|
1701
|
-
var
|
|
1702
|
-
function
|
|
1711
|
+
var Kt = /^\s*(?:[-*•]\s+)?\[([ xX])\]\s+(.+)$/;
|
|
1712
|
+
function qt(e) {
|
|
1703
1713
|
return e.replace(/\[([^\]\n]+)\]\([^)\s]+\)/g, "$1").replace(/\*\*|~~|`|\*/g, "").trim();
|
|
1704
1714
|
}
|
|
1705
|
-
var
|
|
1706
|
-
function
|
|
1715
|
+
var Jt = /^(\s*)[-*•]\s+/, Yt = /^(\s*)\d+[.)]\s+/, Xt = /^\s{0,3}(#{1,6})\s+(.+?)#*\s*$/, Zt = /^\s*([-*_])(?:\s*\1){2,}\s*$/, Qt = /^\s*>\s?(.*)$/, $t = /^\s*\|.*\|\s*$/, en = /^\s*\|(?:\s*:?-{1,}:?\s*\|)+\s*$/, tn = /^\s*```/;
|
|
1716
|
+
function nn(e) {
|
|
1707
1717
|
return e.replace(/^\s*\|/, "").replace(/\|\s*$/, "").split("|").map((e) => e.trim());
|
|
1708
1718
|
}
|
|
1709
|
-
function
|
|
1719
|
+
function rn(e, t, n, r) {
|
|
1710
1720
|
let i = e[t].ordered, a = [], o = t;
|
|
1711
1721
|
for (; o < e.length && e[o].depth >= n;) {
|
|
1712
1722
|
let t = e[o];
|
|
1713
1723
|
if (t.depth === n && t.ordered !== i) break;
|
|
1714
1724
|
if (t.depth > n) {
|
|
1715
|
-
let [n, i] =
|
|
1725
|
+
let [n, i] = rn(e, o, t.depth, `${r}-${o}`), s = a[a.length - 1];
|
|
1716
1726
|
s ? s.nested.push(n) : a.push({
|
|
1717
1727
|
key: `${r}-${o}`,
|
|
1718
1728
|
text: null,
|
|
@@ -1729,7 +1739,7 @@ function nn(e, t, n, r) {
|
|
|
1729
1739
|
let s = a.map((e) => /* @__PURE__ */ J("li", { children: [e.text === null ? null : Y(e.text, e.key), e.nested] }, e.key));
|
|
1730
1740
|
return [J(i ? "ol" : "ul", { children: s }, r), o];
|
|
1731
1741
|
}
|
|
1732
|
-
function
|
|
1742
|
+
function an({ text: e, locale: t, onChoice: n }) {
|
|
1733
1743
|
let r = e.split("\n"), i = [], a = [], o = [], s = [], c = () => {
|
|
1734
1744
|
if (!a.length) return;
|
|
1735
1745
|
let e = `p${i.length}`;
|
|
@@ -1738,7 +1748,7 @@ function rn({ text: e, locale: t, onChoice: n }) {
|
|
|
1738
1748
|
if (!o.length) return;
|
|
1739
1749
|
let e = 0;
|
|
1740
1750
|
for (; e < o.length;) {
|
|
1741
|
-
let t = `l${i.length}`, [n, r] =
|
|
1751
|
+
let t = `l${i.length}`, [n, r] = rn(o, e, o[e].depth, t);
|
|
1742
1752
|
i.push(n), e = r;
|
|
1743
1753
|
}
|
|
1744
1754
|
o = [];
|
|
@@ -1751,18 +1761,18 @@ function rn({ text: e, locale: t, onChoice: n }) {
|
|
|
1751
1761
|
};
|
|
1752
1762
|
for (let e = 0; e < r.length; e += 1) {
|
|
1753
1763
|
let f = r[e];
|
|
1754
|
-
if (
|
|
1764
|
+
if (tn.test(f)) {
|
|
1755
1765
|
d();
|
|
1756
1766
|
let t = [];
|
|
1757
|
-
for (e += 1; e < r.length && !
|
|
1767
|
+
for (e += 1; e < r.length && !tn.test(r[e]);) t.push(r[e]), e += 1;
|
|
1758
1768
|
let n = `c${i.length}`;
|
|
1759
1769
|
i.push(/* @__PURE__ */ J("pre", { children: /* @__PURE__ */ J("code", { children: t.join("\n") }) }, n));
|
|
1760
1770
|
continue;
|
|
1761
1771
|
}
|
|
1762
|
-
if (
|
|
1772
|
+
if ($t.test(f) && e + 1 < r.length && en.test(r[e + 1])) {
|
|
1763
1773
|
d();
|
|
1764
|
-
let t =
|
|
1765
|
-
for (e += 2; e < r.length &&
|
|
1774
|
+
let t = nn(f), n = [];
|
|
1775
|
+
for (e += 2; e < r.length && $t.test(r[e]);) n.push(nn(r[e])), e += 1;
|
|
1766
1776
|
--e;
|
|
1767
1777
|
let a = `t${i.length}`;
|
|
1768
1778
|
i.push(/* @__PURE__ */ J("div", {
|
|
@@ -1775,43 +1785,43 @@ function rn({ text: e, locale: t, onChoice: n }) {
|
|
|
1775
1785
|
d();
|
|
1776
1786
|
continue;
|
|
1777
1787
|
}
|
|
1778
|
-
if (
|
|
1788
|
+
if (Kt.test(f)) {
|
|
1779
1789
|
d();
|
|
1780
1790
|
let a = [];
|
|
1781
1791
|
for (; e < r.length;) {
|
|
1782
|
-
let t =
|
|
1792
|
+
let t = Kt.exec(r[e]);
|
|
1783
1793
|
if (!t) break;
|
|
1784
1794
|
let n = t[2].trim(), o = `o${i.length}-${a.length}`;
|
|
1785
1795
|
a.push({
|
|
1786
|
-
label:
|
|
1796
|
+
label: qt(n),
|
|
1787
1797
|
checked: t[1].toLowerCase() === "x",
|
|
1788
1798
|
content: Y(n, o)
|
|
1789
1799
|
}), e += 1;
|
|
1790
1800
|
}
|
|
1791
|
-
--e, i.push(/* @__PURE__ */ J(
|
|
1801
|
+
--e, i.push(/* @__PURE__ */ J(Vt, {
|
|
1792
1802
|
items: a,
|
|
1793
1803
|
locale: t,
|
|
1794
1804
|
onPick: n
|
|
1795
1805
|
}, `o${i.length}`));
|
|
1796
1806
|
continue;
|
|
1797
1807
|
}
|
|
1798
|
-
let p =
|
|
1808
|
+
let p = Xt.exec(f);
|
|
1799
1809
|
if (p) {
|
|
1800
1810
|
d();
|
|
1801
1811
|
let e = p[1].length, t = e <= 2 ? "h3" : e === 3 ? "h4" : "h5", n = `h${i.length}`;
|
|
1802
1812
|
i.push(/* @__PURE__ */ J(t, { children: Y(p[2], n) }, n));
|
|
1803
1813
|
continue;
|
|
1804
1814
|
}
|
|
1805
|
-
if (
|
|
1815
|
+
if (Zt.test(f)) {
|
|
1806
1816
|
d(), i.push(/* @__PURE__ */ J("hr", {}, `r${i.length}`));
|
|
1807
1817
|
continue;
|
|
1808
1818
|
}
|
|
1809
|
-
let m =
|
|
1819
|
+
let m = Qt.exec(f);
|
|
1810
1820
|
if (m) {
|
|
1811
1821
|
c(), l(), s.push(m[1]);
|
|
1812
1822
|
continue;
|
|
1813
1823
|
}
|
|
1814
|
-
let h =
|
|
1824
|
+
let h = Jt.exec(f), g = h ? null : Yt.exec(f), _ = h ?? g;
|
|
1815
1825
|
if (_) {
|
|
1816
1826
|
c(), u(), o.push({
|
|
1817
1827
|
depth: _[1].replace(/\t/g, " ").length,
|
|
@@ -1826,8 +1836,8 @@ function rn({ text: e, locale: t, onChoice: n }) {
|
|
|
1826
1836
|
}
|
|
1827
1837
|
//#endregion
|
|
1828
1838
|
//#region src/components/MessageList.tsx
|
|
1829
|
-
var
|
|
1830
|
-
function
|
|
1839
|
+
var on = 80;
|
|
1840
|
+
function sn({ at: e, locale: t }) {
|
|
1831
1841
|
let n = new Date(e);
|
|
1832
1842
|
return /* @__PURE__ */ J("time", {
|
|
1833
1843
|
class: "sqc-msg__time",
|
|
@@ -1838,7 +1848,7 @@ function on({ at: e, locale: t }) {
|
|
|
1838
1848
|
})
|
|
1839
1849
|
});
|
|
1840
1850
|
}
|
|
1841
|
-
function
|
|
1851
|
+
function cn({ file: e, load: t }) {
|
|
1842
1852
|
let [n, r] = H(null);
|
|
1843
1853
|
return U(() => {
|
|
1844
1854
|
let n = null, i = !0;
|
|
@@ -1856,10 +1866,10 @@ function sn({ file: e, load: t }) {
|
|
|
1856
1866
|
children: e.filename
|
|
1857
1867
|
});
|
|
1858
1868
|
}
|
|
1859
|
-
function
|
|
1869
|
+
function ln({ files: e, load: t }) {
|
|
1860
1870
|
return e.length === 0 || !t ? null : /* @__PURE__ */ J("div", {
|
|
1861
1871
|
class: "sqc-attachments sqc-attachments--sent",
|
|
1862
|
-
children: e.map((e) => e.kind === "image" ? /* @__PURE__ */ J(
|
|
1872
|
+
children: e.map((e) => e.kind === "image" ? /* @__PURE__ */ J(cn, {
|
|
1863
1873
|
file: e,
|
|
1864
1874
|
load: t
|
|
1865
1875
|
}, e.id) : /* @__PURE__ */ J("span", {
|
|
@@ -1872,7 +1882,7 @@ function cn({ files: e, load: t }) {
|
|
|
1872
1882
|
}, e.id))
|
|
1873
1883
|
});
|
|
1874
1884
|
}
|
|
1875
|
-
function
|
|
1885
|
+
function un({ message: e, locale: t, assistantName: n, onChoice: r, onDecide: i, onLoadAttachment: a }) {
|
|
1876
1886
|
let o = e.streaming && !e.content, s = !!e.approval;
|
|
1877
1887
|
return /* @__PURE__ */ J("div", {
|
|
1878
1888
|
class: `sqc-msg sqc-msg--${e.role}${e.error ? " sqc-msg--error" : ""}`,
|
|
@@ -1882,7 +1892,7 @@ function ln({ message: e, locale: t, assistantName: n, onChoice: r, onDecide: i,
|
|
|
1882
1892
|
class: "sqc-msg__emoji",
|
|
1883
1893
|
"aria-hidden": "true",
|
|
1884
1894
|
children: e.agent.avatarEmoji
|
|
1885
|
-
}) : /* @__PURE__ */ J(
|
|
1895
|
+
}) : /* @__PURE__ */ J(fn, {}), e.authorName ?? e.agent?.name ?? n]
|
|
1886
1896
|
}), /* @__PURE__ */ J("div", {
|
|
1887
1897
|
class: "sqc-msg__bubble",
|
|
1888
1898
|
children: [o ? /* @__PURE__ */ J("span", {
|
|
@@ -1896,7 +1906,7 @@ function ln({ message: e, locale: t, assistantName: n, onChoice: r, onDecide: i,
|
|
|
1896
1906
|
}) : /* @__PURE__ */ J("div", {
|
|
1897
1907
|
class: "sqc-msg__body",
|
|
1898
1908
|
children: [
|
|
1899
|
-
/* @__PURE__ */ J(
|
|
1909
|
+
/* @__PURE__ */ J(an, {
|
|
1900
1910
|
text: e.content,
|
|
1901
1911
|
locale: t,
|
|
1902
1912
|
onChoice: r
|
|
@@ -1905,32 +1915,32 @@ function ln({ message: e, locale: t, assistantName: n, onChoice: r, onDecide: i,
|
|
|
1905
1915
|
class: "sqc-caret",
|
|
1906
1916
|
"aria-hidden": "true"
|
|
1907
1917
|
}),
|
|
1908
|
-
s && /* @__PURE__ */ J(
|
|
1918
|
+
s && /* @__PURE__ */ J(Rt, {
|
|
1909
1919
|
locale: t,
|
|
1910
1920
|
call: e.content.trim() === "" ? e.approval : void 0,
|
|
1911
1921
|
onDecide: i
|
|
1912
1922
|
}),
|
|
1913
|
-
!s && !e.streaming && !e.error &&
|
|
1923
|
+
!s && !e.streaming && !e.error && Pt(e.content, t.code) && /* @__PURE__ */ J(zt, {
|
|
1914
1924
|
locale: t,
|
|
1915
1925
|
onPick: r
|
|
1916
1926
|
}),
|
|
1917
|
-
e.unknownHandle && !e.streaming && /* @__PURE__ */ J(
|
|
1927
|
+
e.unknownHandle && !e.streaming && /* @__PURE__ */ J(dn, {
|
|
1918
1928
|
message: e,
|
|
1919
1929
|
locale: t
|
|
1920
1930
|
}),
|
|
1921
|
-
/* @__PURE__ */ J(
|
|
1931
|
+
/* @__PURE__ */ J(ln, {
|
|
1922
1932
|
files: e.attachments ?? [],
|
|
1923
1933
|
load: a
|
|
1924
1934
|
})
|
|
1925
1935
|
]
|
|
1926
|
-
}), !o && /* @__PURE__ */ J(
|
|
1936
|
+
}), !o && /* @__PURE__ */ J(sn, {
|
|
1927
1937
|
at: e.createdAt,
|
|
1928
1938
|
locale: t
|
|
1929
1939
|
})]
|
|
1930
1940
|
})]
|
|
1931
1941
|
});
|
|
1932
1942
|
}
|
|
1933
|
-
function
|
|
1943
|
+
function dn({ message: e, locale: t }) {
|
|
1934
1944
|
let n = e.offered ?? [];
|
|
1935
1945
|
return /* @__PURE__ */ J("p", {
|
|
1936
1946
|
class: "sqc-msg__unaddressed",
|
|
@@ -1947,7 +1957,7 @@ function un({ message: e, locale: t }) {
|
|
|
1947
1957
|
]
|
|
1948
1958
|
});
|
|
1949
1959
|
}
|
|
1950
|
-
function
|
|
1960
|
+
function fn() {
|
|
1951
1961
|
return /* @__PURE__ */ J("svg", {
|
|
1952
1962
|
viewBox: "0 0 24 24",
|
|
1953
1963
|
fill: "none",
|
|
@@ -1959,7 +1969,7 @@ function dn() {
|
|
|
1959
1969
|
children: /* @__PURE__ */ J("path", { d: "M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719" })
|
|
1960
1970
|
});
|
|
1961
1971
|
}
|
|
1962
|
-
function
|
|
1972
|
+
function pn({ messages: e, locale: t, assistantName: n, suggestions: r, showSuggestions: i, busy: a, withHuman: o, onSuggestion: s, onChoice: c, onDecide: l, onLoadAttachment: u }) {
|
|
1963
1973
|
let d = W(null), f = W(!0);
|
|
1964
1974
|
return ve(() => {
|
|
1965
1975
|
let e = d.current;
|
|
@@ -1968,7 +1978,7 @@ function fn({ messages: e, locale: t, assistantName: n, suggestions: r, showSugg
|
|
|
1968
1978
|
let e = d.current;
|
|
1969
1979
|
if (!e) return;
|
|
1970
1980
|
let t = () => {
|
|
1971
|
-
f.current = e.scrollHeight - e.scrollTop - e.clientHeight <
|
|
1981
|
+
f.current = e.scrollHeight - e.scrollTop - e.clientHeight < on;
|
|
1972
1982
|
};
|
|
1973
1983
|
return e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
|
|
1974
1984
|
}, []), /* @__PURE__ */ J("div", {
|
|
@@ -1978,7 +1988,7 @@ function fn({ messages: e, locale: t, assistantName: n, suggestions: r, showSugg
|
|
|
1978
1988
|
"aria-live": "polite",
|
|
1979
1989
|
"aria-atomic": "false",
|
|
1980
1990
|
children: [
|
|
1981
|
-
e.map((r, i) => /* @__PURE__ */ J(
|
|
1991
|
+
e.map((r, i) => /* @__PURE__ */ J(un, {
|
|
1982
1992
|
message: r,
|
|
1983
1993
|
locale: t,
|
|
1984
1994
|
assistantName: n,
|
|
@@ -2005,28 +2015,28 @@ function fn({ messages: e, locale: t, assistantName: n, suggestions: r, showSugg
|
|
|
2005
2015
|
}
|
|
2006
2016
|
//#endregion
|
|
2007
2017
|
//#region src/components/ChatbotWidget.tsx
|
|
2008
|
-
var
|
|
2009
|
-
function
|
|
2018
|
+
var mn = { width: "min(392px, 100vw)" }, hn = /* @__PURE__ */ new Set(["sessionId"]);
|
|
2019
|
+
function gn(e) {
|
|
2010
2020
|
let t = e.replace(/Id$|Ref$/, "").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim().toLowerCase();
|
|
2011
2021
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : e;
|
|
2012
2022
|
}
|
|
2013
|
-
function
|
|
2023
|
+
function _n(e) {
|
|
2014
2024
|
if (!e) return [];
|
|
2015
2025
|
let t = [];
|
|
2016
2026
|
for (let [n, r] of Object.entries(e)) {
|
|
2017
|
-
if (
|
|
2027
|
+
if (hn.has(n) || typeof r != "string" && !ke(r)) continue;
|
|
2018
2028
|
let e = Oe(r);
|
|
2019
2029
|
e && t.push({
|
|
2020
|
-
label:
|
|
2030
|
+
label: gn(n),
|
|
2021
2031
|
value: e
|
|
2022
2032
|
});
|
|
2023
2033
|
}
|
|
2024
2034
|
return t;
|
|
2025
2035
|
}
|
|
2026
|
-
function
|
|
2036
|
+
function vn(e, t) {
|
|
2027
2037
|
return e?.trim() ? e : t;
|
|
2028
2038
|
}
|
|
2029
|
-
function
|
|
2039
|
+
function yn(e) {
|
|
2030
2040
|
let [t, n] = H(!1);
|
|
2031
2041
|
return U(() => {
|
|
2032
2042
|
if (e !== "auto" || typeof matchMedia != "function") return;
|
|
@@ -2036,10 +2046,11 @@ function vn(e) {
|
|
|
2036
2046
|
return t.addEventListener("change", r), () => t.removeEventListener("change", r);
|
|
2037
2047
|
}, [e]), e === "dark" ? "dark" : e === "light" ? "light" : t ? "dark" : "light";
|
|
2038
2048
|
}
|
|
2039
|
-
function
|
|
2040
|
-
let t = e.persistOpen ?? !0, [n, r] = H(() => Ve(e.defaultOpen, t)), [i, a] = H(!1), [o, s] = H(!1), c = W(null), l = W(null), u =
|
|
2049
|
+
function bn(e) {
|
|
2050
|
+
let t = e.persistOpen ?? !0, [n, r] = H(() => Ve(e.defaultOpen, t)), [i, a] = H(!1), [o, s] = H(!1), c = W(null), l = W(null), u = yn(e.theme ?? "light"), d = G(() => Le(e.locale), [e.locale]), f = d.t, p = vn(e.heading, f.heading), m = vn(e.assistantName, f.assistant), h = vn(e.greeting, f.greeting), g = e.onEvent, { send: _, reset: v, decide: y, stop: b, start: x, busy: S, messages: C, withHuman: w, sessionId: T, handles: E, addressee: D, attachments: O, uploading: k, attachmentError: A, attach: j, detach: M, loadAttachment: N } = wt({
|
|
2041
2051
|
embedKey: e.embedKey,
|
|
2042
2052
|
user: e.user,
|
|
2053
|
+
getSubjectToken: e.getSubjectToken,
|
|
2043
2054
|
agent: e.agent,
|
|
2044
2055
|
context: e.context,
|
|
2045
2056
|
greeting: h,
|
|
@@ -2109,14 +2120,15 @@ function yn(e) {
|
|
|
2109
2120
|
};
|
|
2110
2121
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
2111
2122
|
}, [I, n]);
|
|
2112
|
-
let ne = G(() => C.some((e) => e.id !== "greeting"), [C]), re = G(() =>
|
|
2123
|
+
let ne = G(() => C.some((e) => e.id !== "greeting"), [C]), re = G(() => _n(e.context), [e.context]), ie = {
|
|
2113
2124
|
...e.accent ? { "--sqc-accent": e.accent } : {},
|
|
2114
|
-
"--sqc-width": e.width ??
|
|
2125
|
+
"--sqc-width": e.width ?? mn.width
|
|
2115
2126
|
};
|
|
2116
2127
|
return /* @__PURE__ */ J("div", {
|
|
2117
2128
|
class: "sqc",
|
|
2118
2129
|
"data-theme": u,
|
|
2119
2130
|
"data-position": e.position ?? "bottom-right",
|
|
2131
|
+
"data-layout": e.layout ?? "sidebar",
|
|
2120
2132
|
"data-open": n ? "true" : "false",
|
|
2121
2133
|
style: ie,
|
|
2122
2134
|
children: [/* @__PURE__ */ J("button", {
|
|
@@ -2132,7 +2144,7 @@ function yn(e) {
|
|
|
2132
2144
|
children: /* @__PURE__ */ J("slot", {
|
|
2133
2145
|
name: "launcher-icon",
|
|
2134
2146
|
class: "sqc-slot-icon",
|
|
2135
|
-
children: /* @__PURE__ */ J(
|
|
2147
|
+
children: /* @__PURE__ */ J(fn, {})
|
|
2136
2148
|
})
|
|
2137
2149
|
}), o && /* @__PURE__ */ J("span", {
|
|
2138
2150
|
class: "sqc-launcher__badge",
|
|
@@ -2152,7 +2164,7 @@ function yn(e) {
|
|
|
2152
2164
|
/* @__PURE__ */ J("span", {
|
|
2153
2165
|
class: "sqc-header__icon",
|
|
2154
2166
|
"aria-hidden": "true",
|
|
2155
|
-
children: /* @__PURE__ */ J(
|
|
2167
|
+
children: /* @__PURE__ */ J(fn, {})
|
|
2156
2168
|
}),
|
|
2157
2169
|
/* @__PURE__ */ J("div", {
|
|
2158
2170
|
class: "sqc-header__titles",
|
|
@@ -2161,7 +2173,7 @@ function yn(e) {
|
|
|
2161
2173
|
children: p
|
|
2162
2174
|
}), /* @__PURE__ */ J("p", {
|
|
2163
2175
|
class: "sqc-header__sub",
|
|
2164
|
-
children:
|
|
2176
|
+
children: vn(e.subheading, f.subheading)
|
|
2165
2177
|
})]
|
|
2166
2178
|
}),
|
|
2167
2179
|
/* @__PURE__ */ J("button", {
|
|
@@ -2209,7 +2221,7 @@ function yn(e) {
|
|
|
2209
2221
|
children: [/* @__PURE__ */ J("b", { children: e.label }), e.value]
|
|
2210
2222
|
}, e.label))
|
|
2211
2223
|
}),
|
|
2212
|
-
/* @__PURE__ */ J(
|
|
2224
|
+
/* @__PURE__ */ J(pn, {
|
|
2213
2225
|
messages: C,
|
|
2214
2226
|
locale: d,
|
|
2215
2227
|
assistantName: m,
|
|
@@ -2222,8 +2234,8 @@ function yn(e) {
|
|
|
2222
2234
|
onDecide: y,
|
|
2223
2235
|
onLoadAttachment: N
|
|
2224
2236
|
}),
|
|
2225
|
-
/* @__PURE__ */ J(
|
|
2226
|
-
placeholder:
|
|
2237
|
+
/* @__PURE__ */ J(At, {
|
|
2238
|
+
placeholder: vn(e.placeholder, f.placeholder),
|
|
2227
2239
|
locale: d,
|
|
2228
2240
|
busy: S,
|
|
2229
2241
|
autoFocus: n,
|
|
@@ -2247,21 +2259,21 @@ function yn(e) {
|
|
|
2247
2259
|
}
|
|
2248
2260
|
//#endregion
|
|
2249
2261
|
//#region src/styles.css?inline
|
|
2250
|
-
var bn = ":host{--sqc-width:min(392px, 100vw);--sqc-z:2147480000;--sqc-radius:16px;--sqc-font-family:\"Plus Jakarta Sans\", ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;--sqc-font-heading:var(--sqc-font-family);z-index:var(--sqc-z);pointer-events:none;font-family:var(--sqc-font-family);-webkit-font-smoothing:antialiased;text-align:left;font-size:14px;line-height:1.5;display:block;position:fixed;top:0;bottom:0;left:0;right:0;margin:0!important}:host([hidden]){display:none}.sqc{--sqc-neutral-50:#f8fafc;--sqc-neutral-100:#f1f5f9;--sqc-neutral-200:#e2e8f0;--sqc-neutral-300:#cbd5e1;--sqc-neutral-400:#94a3b8;--sqc-neutral-500:#64748b;--sqc-neutral-600:#475569;--sqc-neutral-900:#0f172a;--sqc-error-50:#fff1f2;--sqc-error-100:#ffe4e6;--sqc-error-600:#e11d48;--sqc-accent-default:#000;--sqc-accent-color:var(--sqc-accent,var(--sqc-accent-default));--sqc-on-accent:#fff;--sqc-accent-hover:color-mix(in oklab, var(--sqc-accent-color) 84%, var(--sqc-on-accent));--sqc-accent-fg:var(--sqc-accent,var(--sqc-text));--sqc-bg:#fff;--sqc-surface:var(--sqc-neutral-50);--sqc-selected:var(--sqc-neutral-100);--sqc-border:var(--sqc-neutral-200);--sqc-border-strong:var(--sqc-neutral-300);--sqc-text:var(--sqc-neutral-900);--sqc-text-muted:var(--sqc-neutral-500);--sqc-link:#2563eb;--sqc-bubble-user:var(--sqc-accent-color);--sqc-bubble-user-text:var(--sqc-on-accent);--sqc-code-bg:var(--sqc-neutral-100);--sqc-disabled:var(--sqc-neutral-300);--sqc-shadow:0 10px 15px -3px #0f172a1a, 0 4px 6px -4px #0f172a1a;--sqc-shadow-bottom:0 6px 8px -6px #0f172a2e;--sqc-focus:0 0 0 2px var(--sqc-bg), 0 0 0 4px #0f172a4d;--sqc-focus-input:0 0 0 3px #0f172a1a;--sqc-danger:var(--sqc-error-600);color:var(--sqc-text);position:absolute;top:0;bottom:0;left:0;right:0}.sqc[data-theme=dark]{--sqc-neutral-50:#172033;--sqc-neutral-100:#1e293b;--sqc-neutral-200:#334155;--sqc-neutral-300:#475569;--sqc-neutral-400:#64748b;--sqc-neutral-500:#94a3b8;--sqc-neutral-600:#cbd5e1;--sqc-neutral-900:#f8fafc;--sqc-error-50:#2a0a12;--sqc-error-100:#4c0519;--sqc-error-600:#fb7185;--sqc-accent-default:#fff;--sqc-on-accent:#0f172a;--sqc-bg:#0f172a;--sqc-link:#60a5fa;--sqc-code-bg:#020617;--sqc-shadow:0 10px 24px -4px #0000008c;--sqc-shadow-bottom:0 6px 8px -6px #0000008c;--sqc-focus:0 0 0 2px var(--sqc-bg), 0 0 0 4px #f8fafc59;--sqc-focus-input:0 0 0 3px #f8fafc1f}@supports (color:oklch(from red l c h)){.sqc{--sqc-on-accent:oklch(from var(--sqc-accent-color) clamp(.208, (.62 - l) * 1000, 1) 0 0)}}.sqc *,.sqc :before,.sqc :after{box-sizing:border-box}.sqc-launcher{background:var(--sqc-accent-color);width:56px;height:56px;color:var(--sqc-on-accent);cursor:pointer;pointer-events:auto;box-shadow:var(--sqc-shadow);border:none;border-radius:50%;place-items:center;padding:0;transition:transform .18s,opacity .18s,background .18s,box-shadow .18s;display:grid;position:absolute;bottom:24px;right:24px}.sqc[data-position=bottom-left] .sqc-launcher{left:24px;right:auto}.sqc-launcher:hover{background:var(--sqc-accent-hover);transform:scale(1.06)}.sqc-launcher:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc[data-open=true] .sqc-launcher{opacity:0;pointer-events:none;transform:scale(.5)}.sqc-launcher__icon svg{width:26px;height:26px;display:block}.sqc-slot-icon::slotted(*){justify-content:center;align-items:center;width:26px;height:26px;display:inline-flex}.sqc-launcher__badge{background:var(--sqc-error-600);border:2px solid var(--sqc-bg);border-radius:50%;width:12px;height:12px;position:absolute;top:6px;right:6px}.sqc-panel{width:var(--sqc-width);background:var(--sqc-bg);border-left:1px solid var(--sqc-border);box-shadow:var(--sqc-shadow);pointer-events:auto;visibility:hidden;flex-direction:column;transition:transform .26s cubic-bezier(.22,1,.36,1),visibility 0s linear .26s;display:flex;position:absolute;top:0;bottom:0;right:0;transform:translate(100%)}.sqc[data-open=true] .sqc-panel{visibility:visible;transition:transform .26s cubic-bezier(.22,1,.36,1),visibility;transform:translate(0)}.sqc-header{background:var(--sqc-bg);color:var(--sqc-text);border-bottom:1px solid var(--sqc-border);flex-shrink:0;align-items:center;gap:8px;padding:13px 12px 13px 16px;display:flex}.sqc-header__icon{color:var(--sqc-accent-fg);flex-shrink:0;place-items:center;display:grid}.sqc-header__icon svg{width:17px;height:17px;display:block}.sqc-header__titles{flex:1;min-width:0}.sqc-header__heading,.sqc-header__sub{text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.sqc-header__heading{font-family:var(--sqc-font-heading);letter-spacing:-.2px;font-size:15px;font-weight:700}.sqc-header__sub{color:var(--sqc-text-muted);font-size:12px}.sqc-icon-btn{width:26px;height:26px;color:var(--sqc-text-muted);cursor:pointer;background:0 0;border:none;border-radius:8px;flex-shrink:0;place-items:center;transition:background .15s;display:grid}.sqc-icon-btn:hover{background:var(--sqc-surface);color:var(--sqc-text)}.sqc-icon-btn:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-icon-btn svg{width:16px;height:16px}.sqc-icon-btn[data-tip]{position:relative}.sqc-icon-btn[data-tip]:after{content:attr(data-tip);z-index:6;background:var(--sqc-text);color:var(--sqc-bg);font-family:var(--sqc-font-family);white-space:nowrap;pointer-events:none;opacity:0;border-radius:8px;padding:4px 8px;font-size:11px;font-weight:500;line-height:1.3;transition:opacity .12s .15s;position:absolute;top:calc(100% + 6px);right:0}.sqc-icon-btn[data-tip]:hover:after{opacity:1}.sqc-icon-btn[data-tip]:focus-visible:after{opacity:1}.sqc-history-pop{z-index:5;position:absolute;top:54px;left:0;right:0}.sqc-history{background:var(--sqc-bg);max-height:320px;box-shadow:var(--sqc-shadow-bottom);flex-direction:column;display:flex;overflow-y:auto}.sqc-history__empty{color:var(--sqc-text-muted);text-align:center;margin:0;padding:14px 16px;font-size:12px}.sqc-history__item{border:none;border-bottom:1px solid var(--sqc-border);width:100%;color:var(--sqc-text);text-align:left;cursor:pointer;background:0 0;flex-direction:column;gap:2px;padding:10px 16px;transition:background .15s;display:flex}.sqc-history__item:last-child{border-bottom:none}.sqc-history__item:hover{background:var(--sqc-surface)}.sqc-history__item:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-history__item[aria-current=true]{background:var(--sqc-selected)}.sqc-history__item[aria-current=true] .sqc-history__title{color:var(--sqc-text);font-weight:600}.sqc-history__title{text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.sqc-history__date{color:var(--sqc-text-muted);font-size:11px}.sqc-context{background:var(--sqc-selected);border:1px solid var(--sqc-border);color:var(--sqc-text);border-radius:12px;flex-wrap:wrap;flex-shrink:0;align-items:center;gap:8px;margin:12px 16px 4px;padding:8px 11px;font-size:12px;display:flex}.sqc-chip{text-overflow:ellipsis;white-space:nowrap;align-items:baseline;gap:4px;max-width:100%;display:inline-flex;overflow:hidden}.sqc-chip b{font-weight:600}.sqc-chip:not(:last-child):after{content:\"·\";opacity:.5;margin-left:4px}.sqc-messages{overscroll-behavior:contain;background:var(--sqc-bg);scrollbar-width:thin;scrollbar-color:var(--sqc-neutral-300) transparent;flex-direction:column;flex:1;gap:13px;min-height:0;padding:12px 16px;display:flex;overflow-y:auto}.sqc-messages::-webkit-scrollbar{width:6px}.sqc-messages::-webkit-scrollbar-thumb{background:var(--sqc-neutral-300);border-radius:99px}.sqc-msg{flex-direction:column;max-width:93%;font-size:13.5px;display:flex}.sqc-msg--assistant{align-self:flex-start}.sqc-msg--user{align-self:flex-end}.sqc-msg__who{color:var(--sqc-text-muted);align-items:center;gap:6px;margin-bottom:4px;font-size:11px;font-weight:500;display:flex}.sqc-msg__who svg{width:12px;height:12px;color:var(--sqc-accent-fg);flex-shrink:0}.sqc-msg__unaddressed{color:var(--sqc-text-muted);margin:8px 0 0;font-size:11.5px;line-height:1.5}.sqc-msg__unaddressed code{background:var(--sqc-code-bg);color:var(--sqc-text);border-radius:4px;margin-right:4px;padding:1px 4px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px}.sqc-msg--user .sqc-msg__bubble{background:var(--sqc-bubble-user);color:var(--sqc-bubble-user-text);border-radius:var(--sqc-radius) var(--sqc-radius) 4px var(--sqc-radius);padding:9px 13px}.sqc-msg--error .sqc-msg__bubble{background:var(--sqc-error-50);color:var(--sqc-error-600);border:1px solid var(--sqc-error-100);border-radius:12px;padding:11px}.sqc-msg__body{overflow-wrap:anywhere}.sqc-msg--assistant .sqc-msg__body{font-size:14px;line-height:1.6}.sqc-msg__body>:first-child{margin-top:0}.sqc-msg__body>:last-child{margin-bottom:0}.sqc-msg__body p{white-space:pre-wrap;margin:0 0 8px}.sqc-msg__body ul,.sqc-msg__body ol{margin:0 0 8px;padding-left:20px}.sqc-msg__body li{margin-bottom:3px}.sqc-msg__body code{background:var(--sqc-code-bg);border-radius:4px;padding:1px 4px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.85em}.sqc-msg--user .sqc-msg__body code{background:#ffffff38}.sqc-msg__body pre{background:var(--sqc-code-bg);border-radius:8px;margin:0 0 8px;padding:9px 11px;overflow-x:auto}.sqc-msg__body pre code{background:0 0;padding:0}.sqc-msg__body a{color:inherit;text-underline-offset:2px;text-decoration:underline}.sqc-msg--assistant .sqc-msg__body a{color:var(--sqc-link);text-decoration:none}.sqc-msg--assistant .sqc-msg__body a:hover{text-decoration:underline}.sqc-msg__body h3,.sqc-msg__body h4,.sqc-msg__body h5,.sqc-msg__body h6{font-family:var(--sqc-font-heading);letter-spacing:-.2px;margin:12px 0 6px;font-weight:700;line-height:1.3}.sqc-msg__body h3{font-size:1.05em}.sqc-msg__body h4{font-size:1em}.sqc-msg__body h5,.sqc-msg__body h6{font-size:.94em}.sqc-msg__body ul ul,.sqc-msg__body ul ol,.sqc-msg__body ol ul,.sqc-msg__body ol ol{margin:3px 0 0}.sqc-msg__body blockquote{border-left:2px solid var(--sqc-border-strong);color:var(--sqc-text-muted);white-space:pre-wrap;margin:0 0 8px;padding:2px 0 2px 10px}.sqc-msg--user .sqc-msg__body blockquote{color:inherit;opacity:.85;border-left-color:#ffffff73}.sqc-msg__body hr{border:0;border-top:1px solid var(--sqc-border);margin:10px 0}.sqc-msg--user .sqc-msg__body hr{border-top-color:#ffffff4d}.sqc-msg__body del{opacity:.7}.sqc-approval{flex-direction:column;gap:8px;margin:11px 0 2px;display:flex}.sqc-approval__actions{flex-wrap:wrap;gap:8px;display:flex}.sqc-approval__request{color:var(--sqc-text);margin:0;font-size:13px}.sqc-approval__args{border:1px solid var(--sqc-border);background:var(--sqc-surface);border-radius:12px;flex-direction:column;gap:4px;margin:0;padding:8px 10px;font-size:12px;display:flex}.sqc-approval__arg{gap:8px;display:flex}.sqc-approval__arg-name{color:var(--sqc-text-muted);flex:none;font-weight:500}.sqc-approval__arg-value{overflow-wrap:anywhere;min-width:0;color:var(--sqc-text);margin:0}.sqc-approval__btn{height:32px;font-family:var(--sqc-font-family);border:1px solid var(--sqc-border);background:var(--sqc-bg);color:var(--sqc-text);cursor:pointer;border-radius:12px;flex:auto;justify-content:center;align-items:center;padding:0 12px;font-size:13px;font-weight:500;transition:border-color .12s,background .12s;display:inline-flex}.sqc-approval__btn--yes:not(:disabled),.sqc-approval__btn--send:not(:disabled){background:var(--sqc-accent-color);color:var(--sqc-on-accent);border-color:#0000;font-weight:600}.sqc-approval__btn:hover:not(:disabled){border-color:var(--sqc-border-strong);background:var(--sqc-surface)}.sqc-approval__btn--yes:hover:not(:disabled),.sqc-approval__btn--send:hover:not(:disabled){background:var(--sqc-accent-hover);border-color:#0000}.sqc-approval__btn:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-approval__btn:disabled{cursor:default}.sqc-approval__btn:disabled[aria-pressed=false]{opacity:.45}.sqc-approval__btn[aria-pressed=true]{border-color:var(--sqc-border-strong);background:var(--sqc-selected);color:var(--sqc-text);font-weight:600}.sqc-approval__edit{flex-direction:column;gap:8px;display:flex}.sqc-approval__input{width:100%;font-family:var(--sqc-font-family);color:var(--sqc-text);background:var(--sqc-bg);border:1px solid var(--sqc-border-strong);resize:vertical;border-radius:12px;padding:8px 10px;font-size:13px;line-height:1.4}.sqc-approval__input:focus-visible{border-color:var(--sqc-text);box-shadow:var(--sqc-focus-input);outline:none}.sqc-approval__btn--send{flex:none;align-self:flex-end}.sqc-confirm{gap:8px;margin:11px 0 2px;display:flex}.sqc-confirm__btn{height:32px;font-family:var(--sqc-font-family);border:1px solid var(--sqc-border);background:var(--sqc-bg);color:var(--sqc-text);cursor:pointer;border-radius:12px;flex:1 1 0;justify-content:center;align-items:center;padding:0 12px;font-size:13px;font-weight:500;transition:border-color .12s,background .12s;display:inline-flex}.sqc-confirm__btn--yes:not(:disabled){background:var(--sqc-accent-color);color:var(--sqc-on-accent);border-color:#0000;font-weight:600}.sqc-confirm__btn:hover:not(:disabled){border-color:var(--sqc-border-strong);background:var(--sqc-surface)}.sqc-confirm__btn--yes:hover:not(:disabled){background:var(--sqc-accent-hover);border-color:#0000}.sqc-confirm__btn:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-confirm__btn:disabled{cursor:default}.sqc-confirm__btn:disabled[aria-pressed=false]{opacity:.45}.sqc-confirm__btn[aria-pressed=true]{border-color:var(--sqc-border-strong);background:var(--sqc-selected);color:var(--sqc-text);font-weight:600}.sqc-choices{flex-direction:column;gap:7px;margin:10px 0 2px;display:flex}.sqc-choice{width:100%;font-family:var(--sqc-font-family);text-align:left;color:var(--sqc-text);background:var(--sqc-bg);border:1px solid var(--sqc-border);cursor:pointer;border-radius:12px;align-items:center;gap:8px;padding:8px 11px;font-size:12.5px;transition:border-color .12s,background .12s;display:flex}.sqc-choice:hover:not(:disabled){border-color:var(--sqc-border-strong);background:var(--sqc-surface)}.sqc-choice:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-choice:disabled{cursor:default}.sqc-choice:disabled[aria-pressed=false]{opacity:.55}.sqc-choice[aria-pressed=true]{border-color:var(--sqc-border-strong);background:var(--sqc-selected)}.sqc-choice__box{border:1.5px solid var(--sqc-border-strong);border-radius:4px;flex:none;justify-content:center;align-items:center;width:15px;height:15px;display:inline-flex}.sqc-choice__box--on{color:var(--sqc-on-accent);background:var(--sqc-accent-color);border-color:var(--sqc-accent-color)}.sqc-choice__box svg{width:11px;height:11px}.sqc-choice__label{overflow-wrap:anywhere}.sqc-choice__detail{color:var(--sqc-text-muted);margin-top:1px;font-size:11.5px;display:block}.sqc-selection{flex-direction:column;gap:10px;margin:2px 0;display:flex}.sqc-selection__question{flex-direction:column;gap:2px;display:flex}.sqc-selection__ask{font-family:var(--sqc-font-family);color:var(--sqc-text);margin:0;font-size:13px;font-weight:600}.sqc-selection__actions{display:flex}.sqc-selection__validate{height:32px;font-family:var(--sqc-font-family);color:var(--sqc-on-accent);background:var(--sqc-accent-color);cursor:pointer;border:1px solid #0000;border-radius:12px;flex:auto;justify-content:center;align-items:center;padding:0 12px;font-size:13px;font-weight:600;transition:filter .12s,background .12s;display:inline-flex}.sqc-selection__validate:hover:not(:disabled){background:var(--sqc-accent-hover)}.sqc-selection__validate:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-selection__validate:disabled{cursor:not-allowed;color:#fff;background:var(--sqc-disabled)}.sqc-selection__hint{font-family:var(--sqc-font-family);color:var(--sqc-text-muted);margin:0;font-size:11.5px}.sqc-table{scrollbar-width:thin;margin:0 0 8px;overflow-x:auto}.sqc-table table{border-collapse:collapse;min-width:100%;font-family:var(--sqc-font-family);white-space:nowrap;font-size:12.5px}.sqc-table th,.sqc-table td{text-align:left;vertical-align:top;border-bottom:1px solid var(--sqc-border);padding:6px 10px 6px 0}.sqc-table thead th{text-transform:uppercase;letter-spacing:.05em;color:var(--sqc-text-muted);font-size:10.5px;font-weight:600}.sqc-table tbody th{font-weight:500}.sqc-msg--user .sqc-table th,.sqc-msg--user .sqc-table td{border-bottom-color:#ffffff40}.sqc-msg--user .sqc-table thead th{color:#fffc}.sqc-table tbody tr:last-child th,.sqc-table tbody tr:last-child td{border-bottom:0}.sqc-msg__time{color:var(--sqc-text-muted);font-variant-numeric:tabular-nums;margin-top:3px;font-size:10px;display:block}.sqc-msg--user .sqc-msg__time{color:#ffffffb3;text-align:right}.sqc-caret{vertical-align:text-bottom;background:currentColor;width:2px;height:1em;margin-left:2px;animation:1s step-end infinite sqc-blink;display:inline-block}@keyframes sqc-blink{0%,to{opacity:1}50%{opacity:0}}.sqc-typing{gap:3px;padding:2px 0;display:inline-flex}.sqc-typing i{background:var(--sqc-neutral-400);border-radius:50%;width:5px;height:5px;animation:1.2s infinite sqc-pulse}.sqc-typing i:nth-child(2){animation-delay:.2s}.sqc-typing i:nth-child(3){animation-delay:.4s}@keyframes sqc-pulse{0%,60%,to{opacity:.25}30%{opacity:1}}.sqc-suggestions{flex-direction:column;gap:7px;display:flex}.sqc-suggestion{border:1px solid var(--sqc-border);background:var(--sqc-bg);width:100%;color:var(--sqc-text);font-family:var(--sqc-font-family);cursor:pointer;text-align:left;border-radius:12px;align-items:center;gap:8px;padding:8px 11px;font-size:12.5px;transition:background .15s,border-color .15s;display:flex}.sqc-suggestion:before{content:\"\";background:var(--sqc-accent-fg);border-radius:50%;flex:none;width:5px;height:5px}.sqc-suggestion:hover{background:var(--sqc-surface);border-color:var(--sqc-border-strong)}.sqc-suggestion:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-composer{border-top:1px solid var(--sqc-border);background:var(--sqc-bg);flex-wrap:wrap;flex-shrink:0;align-items:flex-end;gap:8px;padding:12px 14px;display:flex}.sqc-composer--dropping{outline:2px dashed var(--sqc-accent-color);outline-offset:-4px}.sqc-attachments{flex-wrap:wrap;flex-basis:100%;gap:6px;display:flex}.sqc-attachments--sent{margin-top:8px}.sqc-chip{border:1px solid var(--sqc-border);background:var(--sqc-selected);max-width:100%;color:var(--sqc-text);border-radius:999px;align-items:center;gap:4px;padding:3px 4px 3px 10px;font-size:12px;display:inline-flex}.sqc-chip--waiting{opacity:.6;padding-right:10px}.sqc-chip__name{text-overflow:ellipsis;white-space:nowrap;max-width:180px;overflow:hidden}.sqc-chip__remove{width:18px;height:18px;color:var(--sqc-text-muted);cursor:pointer;background:0 0;border:0;border-radius:999px;justify-content:center;align-items:center;padding:0;font-size:14px;line-height:1;display:inline-flex}.sqc-chip__remove:hover{background:var(--sqc-selected);color:var(--sqc-text)}.sqc-attachments__error{color:var(--sqc-error-600);flex-basis:100%;margin:0;font-size:12px}.sqc-attachment__image{border-radius:12px;max-width:100%;max-height:180px;display:block}.sqc-file-input{display:none}.sqc-btn--attach{color:var(--sqc-text-muted);background:0 0}.sqc-btn--attach:hover{background:var(--sqc-selected);color:var(--sqc-text)}.sqc-composer__field{flex:1;min-width:0;position:relative}.sqc-composer__input{border:1px solid var(--sqc-border-strong);background:var(--sqc-bg);width:100%;min-height:38px;max-height:132px;color:var(--sqc-text);font-family:var(--sqc-font-family);resize:none;border-radius:12px;outline:none;padding:9px 12px;font-size:13.5px;line-height:1.4;transition:border-color .15s,box-shadow .15s;display:block;overflow-y:hidden}.sqc-composer__input::placeholder{color:var(--sqc-neutral-400)}.sqc-composer__input:focus{border-color:var(--sqc-text);box-shadow:var(--sqc-focus-input)}.sqc-mentions{z-index:2;border:1px solid var(--sqc-border);background:var(--sqc-bg);max-height:184px;box-shadow:var(--sqc-shadow);scrollbar-width:thin;border-radius:12px;margin:0;padding:4px;list-style:none;position:absolute;bottom:calc(100% + 6px);left:0;right:0;overflow-y:auto}.sqc-mention{cursor:pointer;color:var(--sqc-text);border-radius:8px;align-items:baseline;gap:6px;padding:6px 8px;font-size:12.5px;display:flex}.sqc-mention--active{background:var(--sqc-neutral-100)}.sqc-mention__icon{flex-shrink:0}.sqc-mention__handle{font-weight:600}.sqc-mention__name{text-overflow:ellipsis;white-space:nowrap;color:var(--sqc-text-muted);overflow:hidden}.sqc-composer__count{color:var(--sqc-text-muted);pointer-events:none;font-variant-numeric:tabular-nums;font-size:10px;position:absolute;bottom:4px;right:8px}.sqc-btn{cursor:pointer;border:none;border-radius:12px;flex-shrink:0;place-items:center;width:38px;height:38px;transition:background .15s,opacity .15s;display:grid}.sqc-btn svg{width:17px;height:17px}.sqc-btn--send{background:var(--sqc-accent-color);color:var(--sqc-on-accent)}.sqc-btn--send:hover:not(:disabled){background:var(--sqc-accent-hover)}.sqc-btn--send:disabled{background:var(--sqc-disabled);color:#fff;cursor:not-allowed}.sqc-btn--stop{background:var(--sqc-bg);color:var(--sqc-text);border:1px solid var(--sqc-border)}.sqc-btn--stop:hover{border-color:var(--sqc-border-strong);background:var(--sqc-surface)}.sqc-btn:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-hint{padding:0 16px max(9px, env(safe-area-inset-bottom));color:var(--sqc-text-muted);text-align:center;flex-shrink:0;margin:0;font-size:10.5px;line-height:1.35}@media (max-width:520px){.sqc{--sqc-width:100vw}.sqc-panel{border-left:none}.sqc-launcher{bottom:16px;right:16px}.sqc[data-position=bottom-left] .sqc-launcher{left:16px}}@media (prefers-reduced-motion:reduce){.sqc-launcher,.sqc-panel,.sqc-btn,.sqc-suggestion,.sqc-choice,.sqc-confirm__btn,.sqc-icon-btn,.sqc-icon-btn[data-tip]:after{transition:none}.sqc-typing i,.sqc-caret{animation:none}}.sqc-with-human{border:1px solid var(--sqc-border);background:var(--sqc-selected);color:var(--sqc-neutral-600);border-radius:12px;margin:8px 0 0;padding:8px 12px;font-size:13px}";
|
|
2262
|
+
var xn = ":host{--sqc-width:min(392px, 100vw);--sqc-height:640px;--sqc-z:2147480000;--sqc-radius:16px;--sqc-font-family:\"Plus Jakarta Sans\", ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;--sqc-font-heading:var(--sqc-font-family);z-index:var(--sqc-z);pointer-events:none;font-family:var(--sqc-font-family);-webkit-font-smoothing:antialiased;text-align:left;font-size:14px;line-height:1.5;display:block;position:fixed;top:0;bottom:0;left:0;right:0;margin:0!important}:host([hidden]){display:none}.sqc{--sqc-neutral-50:#f8fafc;--sqc-neutral-100:#f1f5f9;--sqc-neutral-200:#e2e8f0;--sqc-neutral-300:#cbd5e1;--sqc-neutral-400:#94a3b8;--sqc-neutral-500:#64748b;--sqc-neutral-600:#475569;--sqc-neutral-900:#0f172a;--sqc-error-50:#fff1f2;--sqc-error-100:#ffe4e6;--sqc-error-600:#e11d48;--sqc-accent-default:#000;--sqc-accent-color:var(--sqc-accent,var(--sqc-accent-default));--sqc-on-accent:#fff;--sqc-accent-hover:color-mix(in oklab, var(--sqc-accent-color) 84%, var(--sqc-on-accent));--sqc-accent-fg:var(--sqc-accent,var(--sqc-text));--sqc-bg:#fff;--sqc-surface:var(--sqc-neutral-50);--sqc-selected:var(--sqc-neutral-100);--sqc-border:var(--sqc-neutral-200);--sqc-border-strong:var(--sqc-neutral-300);--sqc-text:var(--sqc-neutral-900);--sqc-text-muted:var(--sqc-neutral-500);--sqc-link:#2563eb;--sqc-bubble-user:var(--sqc-accent-color);--sqc-bubble-user-text:var(--sqc-on-accent);--sqc-code-bg:var(--sqc-neutral-100);--sqc-disabled:var(--sqc-neutral-300);--sqc-shadow:0 10px 15px -3px #0f172a1a, 0 4px 6px -4px #0f172a1a;--sqc-shadow-bottom:0 6px 8px -6px #0f172a2e;--sqc-focus:0 0 0 2px var(--sqc-bg), 0 0 0 4px #0f172a4d;--sqc-focus-input:0 0 0 3px #0f172a1a;--sqc-danger:var(--sqc-error-600);color:var(--sqc-text);position:absolute;top:0;bottom:0;left:0;right:0}.sqc[data-theme=dark]{--sqc-neutral-50:#172033;--sqc-neutral-100:#1e293b;--sqc-neutral-200:#334155;--sqc-neutral-300:#475569;--sqc-neutral-400:#64748b;--sqc-neutral-500:#94a3b8;--sqc-neutral-600:#cbd5e1;--sqc-neutral-900:#f8fafc;--sqc-error-50:#2a0a12;--sqc-error-100:#4c0519;--sqc-error-600:#fb7185;--sqc-accent-default:#fff;--sqc-on-accent:#0f172a;--sqc-bg:#0f172a;--sqc-link:#60a5fa;--sqc-code-bg:#020617;--sqc-shadow:0 10px 24px -4px #0000008c;--sqc-shadow-bottom:0 6px 8px -6px #0000008c;--sqc-focus:0 0 0 2px var(--sqc-bg), 0 0 0 4px #f8fafc59;--sqc-focus-input:0 0 0 3px #f8fafc1f}@supports (color:oklch(from red l c h)){.sqc{--sqc-on-accent:oklch(from var(--sqc-accent-color) clamp(.208, (.62 - l) * 1000, 1) 0 0)}}.sqc *,.sqc :before,.sqc :after{box-sizing:border-box}.sqc-launcher{background:var(--sqc-accent-color);width:56px;height:56px;color:var(--sqc-on-accent);cursor:pointer;pointer-events:auto;box-shadow:var(--sqc-shadow);border:none;border-radius:50%;place-items:center;padding:0;transition:transform .18s,opacity .18s,background .18s,box-shadow .18s;display:grid;position:absolute;bottom:24px;right:24px}.sqc[data-position=bottom-left] .sqc-launcher{left:24px;right:auto}.sqc-launcher:hover{background:var(--sqc-accent-hover);transform:scale(1.06)}.sqc-launcher:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc[data-open=true] .sqc-launcher{opacity:0;pointer-events:none;transform:scale(.5)}.sqc-launcher__icon svg{width:26px;height:26px;display:block}.sqc-slot-icon::slotted(*){justify-content:center;align-items:center;width:26px;height:26px;display:inline-flex}.sqc-launcher__badge{background:var(--sqc-error-600);border:2px solid var(--sqc-bg);border-radius:50%;width:12px;height:12px;position:absolute;top:6px;right:6px}.sqc-panel{width:var(--sqc-width);background:var(--sqc-bg);border-left:1px solid var(--sqc-border);box-shadow:var(--sqc-shadow);pointer-events:auto;visibility:hidden;flex-direction:column;transition:transform .26s cubic-bezier(.22,1,.36,1),visibility 0s linear .26s;display:flex;position:absolute;top:0;bottom:0;right:0;transform:translate(100%)}.sqc[data-open=true] .sqc-panel{visibility:visible;transition:transform .26s cubic-bezier(.22,1,.36,1),visibility;transform:translate(0)}.sqc[data-layout=floating] .sqc-panel{max-width:calc(100% - 48px);height:var(--sqc-height);border:1px solid var(--sqc-border);border-radius:var(--sqc-radius);opacity:0;transform-origin:100% 100%;max-height:calc(100% - 48px);transition:transform .22s cubic-bezier(.22,1,.36,1),opacity .22s,visibility 0s linear .22s;top:auto;bottom:24px;right:24px;overflow:hidden;transform:translateY(16px)scale(.96)}.sqc[data-layout=floating][data-position=bottom-left] .sqc-panel{transform-origin:0 100%;left:24px;right:auto}.sqc[data-layout=floating][data-open=true] .sqc-panel{opacity:1;transition:transform .22s cubic-bezier(.22,1,.36,1),opacity .22s,visibility;transform:none}.sqc-header{background:var(--sqc-bg);color:var(--sqc-text);border-bottom:1px solid var(--sqc-border);flex-shrink:0;align-items:center;gap:8px;padding:13px 12px 13px 16px;display:flex}.sqc-header__icon{color:var(--sqc-accent-fg);flex-shrink:0;place-items:center;display:grid}.sqc-header__icon svg{width:17px;height:17px;display:block}.sqc-header__titles{flex:1;min-width:0}.sqc-header__heading,.sqc-header__sub{text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.sqc-header__heading{font-family:var(--sqc-font-heading);letter-spacing:-.2px;font-size:15px;font-weight:700}.sqc-header__sub{color:var(--sqc-text-muted);font-size:12px}.sqc-icon-btn{width:26px;height:26px;color:var(--sqc-text-muted);cursor:pointer;background:0 0;border:none;border-radius:8px;flex-shrink:0;place-items:center;transition:background .15s;display:grid}.sqc-icon-btn:hover{background:var(--sqc-surface);color:var(--sqc-text)}.sqc-icon-btn:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-icon-btn svg{width:16px;height:16px}.sqc-icon-btn[data-tip]{position:relative}.sqc-icon-btn[data-tip]:after{content:attr(data-tip);z-index:6;background:var(--sqc-text);color:var(--sqc-bg);font-family:var(--sqc-font-family);white-space:nowrap;pointer-events:none;opacity:0;border-radius:8px;padding:4px 8px;font-size:11px;font-weight:500;line-height:1.3;transition:opacity .12s .15s;position:absolute;top:calc(100% + 6px);right:0}.sqc-icon-btn[data-tip]:hover:after{opacity:1}.sqc-icon-btn[data-tip]:focus-visible:after{opacity:1}.sqc-history-pop{z-index:5;position:absolute;top:54px;left:0;right:0}.sqc-history{background:var(--sqc-bg);max-height:320px;box-shadow:var(--sqc-shadow-bottom);flex-direction:column;display:flex;overflow-y:auto}.sqc-history__empty{color:var(--sqc-text-muted);text-align:center;margin:0;padding:14px 16px;font-size:12px}.sqc-history__item{border:none;border-bottom:1px solid var(--sqc-border);width:100%;color:var(--sqc-text);text-align:left;cursor:pointer;background:0 0;flex-direction:column;gap:2px;padding:10px 16px;transition:background .15s;display:flex}.sqc-history__item:last-child{border-bottom:none}.sqc-history__item:hover{background:var(--sqc-surface)}.sqc-history__item:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-history__item[aria-current=true]{background:var(--sqc-selected)}.sqc-history__item[aria-current=true] .sqc-history__title{color:var(--sqc-text);font-weight:600}.sqc-history__title{text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.sqc-history__date{color:var(--sqc-text-muted);font-size:11px}.sqc-context{background:var(--sqc-selected);border:1px solid var(--sqc-border);color:var(--sqc-text);border-radius:12px;flex-wrap:wrap;flex-shrink:0;align-items:center;gap:8px;margin:12px 16px 4px;padding:8px 11px;font-size:12px;display:flex}.sqc-chip{text-overflow:ellipsis;white-space:nowrap;align-items:baseline;gap:4px;max-width:100%;display:inline-flex;overflow:hidden}.sqc-chip b{font-weight:600}.sqc-chip:not(:last-child):after{content:\"·\";opacity:.5;margin-left:4px}.sqc-messages{overscroll-behavior:contain;background:var(--sqc-bg);scrollbar-width:thin;scrollbar-color:var(--sqc-neutral-300) transparent;flex-direction:column;flex:1;gap:13px;min-height:0;padding:12px 16px;display:flex;overflow-y:auto}.sqc-messages::-webkit-scrollbar{width:6px}.sqc-messages::-webkit-scrollbar-thumb{background:var(--sqc-neutral-300);border-radius:99px}.sqc-msg{flex-direction:column;max-width:93%;font-size:13.5px;display:flex}.sqc-msg--assistant{align-self:flex-start}.sqc-msg--user{align-self:flex-end}.sqc-msg__who{color:var(--sqc-text-muted);align-items:center;gap:6px;margin-bottom:4px;font-size:11px;font-weight:500;display:flex}.sqc-msg__who svg{width:12px;height:12px;color:var(--sqc-accent-fg);flex-shrink:0}.sqc-msg__unaddressed{color:var(--sqc-text-muted);margin:8px 0 0;font-size:11.5px;line-height:1.5}.sqc-msg__unaddressed code{background:var(--sqc-code-bg);color:var(--sqc-text);border-radius:4px;margin-right:4px;padding:1px 4px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px}.sqc-msg--user .sqc-msg__bubble{background:var(--sqc-bubble-user);color:var(--sqc-bubble-user-text);border-radius:var(--sqc-radius) var(--sqc-radius) 4px var(--sqc-radius);padding:9px 13px}.sqc-msg--error .sqc-msg__bubble{background:var(--sqc-error-50);color:var(--sqc-error-600);border:1px solid var(--sqc-error-100);border-radius:12px;padding:11px}.sqc-msg__body{overflow-wrap:anywhere}.sqc-msg--assistant .sqc-msg__body{font-size:14px;line-height:1.6}.sqc-msg__body>:first-child{margin-top:0}.sqc-msg__body>:last-child{margin-bottom:0}.sqc-msg__body p{white-space:pre-wrap;margin:0 0 8px}.sqc-msg__body ul,.sqc-msg__body ol{margin:0 0 8px;padding-left:20px}.sqc-msg__body li{margin-bottom:3px}.sqc-msg__body code{background:var(--sqc-code-bg);border-radius:4px;padding:1px 4px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.85em}.sqc-msg--user .sqc-msg__body code{background:#ffffff38}.sqc-msg__body pre{background:var(--sqc-code-bg);border-radius:8px;margin:0 0 8px;padding:9px 11px;overflow-x:auto}.sqc-msg__body pre code{background:0 0;padding:0}.sqc-msg__body a{color:inherit;text-underline-offset:2px;text-decoration:underline}.sqc-msg--assistant .sqc-msg__body a{color:var(--sqc-link);text-decoration:none}.sqc-msg--assistant .sqc-msg__body a:hover{text-decoration:underline}.sqc-msg__body h3,.sqc-msg__body h4,.sqc-msg__body h5,.sqc-msg__body h6{font-family:var(--sqc-font-heading);letter-spacing:-.2px;margin:12px 0 6px;font-weight:700;line-height:1.3}.sqc-msg__body h3{font-size:1.05em}.sqc-msg__body h4{font-size:1em}.sqc-msg__body h5,.sqc-msg__body h6{font-size:.94em}.sqc-msg__body ul ul,.sqc-msg__body ul ol,.sqc-msg__body ol ul,.sqc-msg__body ol ol{margin:3px 0 0}.sqc-msg__body blockquote{border-left:2px solid var(--sqc-border-strong);color:var(--sqc-text-muted);white-space:pre-wrap;margin:0 0 8px;padding:2px 0 2px 10px}.sqc-msg--user .sqc-msg__body blockquote{color:inherit;opacity:.85;border-left-color:#ffffff73}.sqc-msg__body hr{border:0;border-top:1px solid var(--sqc-border);margin:10px 0}.sqc-msg--user .sqc-msg__body hr{border-top-color:#ffffff4d}.sqc-msg__body del{opacity:.7}.sqc-approval{flex-direction:column;gap:8px;margin:11px 0 2px;display:flex}.sqc-approval__actions{flex-wrap:wrap;gap:8px;display:flex}.sqc-approval__request{color:var(--sqc-text);margin:0;font-size:13px}.sqc-approval__args{border:1px solid var(--sqc-border);background:var(--sqc-surface);border-radius:12px;flex-direction:column;gap:4px;margin:0;padding:8px 10px;font-size:12px;display:flex}.sqc-approval__arg{gap:8px;display:flex}.sqc-approval__arg-name{color:var(--sqc-text-muted);flex:none;font-weight:500}.sqc-approval__arg-value{overflow-wrap:anywhere;min-width:0;color:var(--sqc-text);margin:0}.sqc-approval__btn{height:32px;font-family:var(--sqc-font-family);border:1px solid var(--sqc-border);background:var(--sqc-bg);color:var(--sqc-text);cursor:pointer;border-radius:12px;flex:auto;justify-content:center;align-items:center;padding:0 12px;font-size:13px;font-weight:500;transition:border-color .12s,background .12s;display:inline-flex}.sqc-approval__btn--yes:not(:disabled),.sqc-approval__btn--send:not(:disabled){background:var(--sqc-accent-color);color:var(--sqc-on-accent);border-color:#0000;font-weight:600}.sqc-approval__btn:hover:not(:disabled){border-color:var(--sqc-border-strong);background:var(--sqc-surface)}.sqc-approval__btn--yes:hover:not(:disabled),.sqc-approval__btn--send:hover:not(:disabled){background:var(--sqc-accent-hover);border-color:#0000}.sqc-approval__btn:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-approval__btn:disabled{cursor:default}.sqc-approval__btn:disabled[aria-pressed=false]{opacity:.45}.sqc-approval__btn[aria-pressed=true]{border-color:var(--sqc-border-strong);background:var(--sqc-selected);color:var(--sqc-text);font-weight:600}.sqc-approval__edit{flex-direction:column;gap:8px;display:flex}.sqc-approval__input{width:100%;font-family:var(--sqc-font-family);color:var(--sqc-text);background:var(--sqc-bg);border:1px solid var(--sqc-border-strong);resize:vertical;border-radius:12px;padding:8px 10px;font-size:13px;line-height:1.4}.sqc-approval__input:focus-visible{border-color:var(--sqc-text);box-shadow:var(--sqc-focus-input);outline:none}.sqc-approval__btn--send{flex:none;align-self:flex-end}.sqc-confirm{gap:8px;margin:11px 0 2px;display:flex}.sqc-confirm__btn{height:32px;font-family:var(--sqc-font-family);border:1px solid var(--sqc-border);background:var(--sqc-bg);color:var(--sqc-text);cursor:pointer;border-radius:12px;flex:1 1 0;justify-content:center;align-items:center;padding:0 12px;font-size:13px;font-weight:500;transition:border-color .12s,background .12s;display:inline-flex}.sqc-confirm__btn--yes:not(:disabled){background:var(--sqc-accent-color);color:var(--sqc-on-accent);border-color:#0000;font-weight:600}.sqc-confirm__btn:hover:not(:disabled){border-color:var(--sqc-border-strong);background:var(--sqc-surface)}.sqc-confirm__btn--yes:hover:not(:disabled){background:var(--sqc-accent-hover);border-color:#0000}.sqc-confirm__btn:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-confirm__btn:disabled{cursor:default}.sqc-confirm__btn:disabled[aria-pressed=false]{opacity:.45}.sqc-confirm__btn[aria-pressed=true]{border-color:var(--sqc-border-strong);background:var(--sqc-selected);color:var(--sqc-text);font-weight:600}.sqc-choices{flex-direction:column;gap:7px;margin:10px 0 2px;display:flex}.sqc-choice{width:100%;font-family:var(--sqc-font-family);text-align:left;color:var(--sqc-text);background:var(--sqc-bg);border:1px solid var(--sqc-border);cursor:pointer;border-radius:12px;align-items:center;gap:8px;padding:8px 11px;font-size:12.5px;transition:border-color .12s,background .12s;display:flex}.sqc-choice:hover:not(:disabled){border-color:var(--sqc-border-strong);background:var(--sqc-surface)}.sqc-choice:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-choice:disabled{cursor:default}.sqc-choice:disabled[aria-pressed=false]{opacity:.55}.sqc-choice[aria-pressed=true]{border-color:var(--sqc-border-strong);background:var(--sqc-selected)}.sqc-choice__box{border:1.5px solid var(--sqc-border-strong);border-radius:4px;flex:none;justify-content:center;align-items:center;width:15px;height:15px;display:inline-flex}.sqc-choice__box--on{color:var(--sqc-on-accent);background:var(--sqc-accent-color);border-color:var(--sqc-accent-color)}.sqc-choice__box svg{width:11px;height:11px}.sqc-choice__label{overflow-wrap:anywhere}.sqc-choice__detail{color:var(--sqc-text-muted);margin-top:1px;font-size:11.5px;display:block}.sqc-selection{flex-direction:column;gap:10px;margin:2px 0;display:flex}.sqc-selection__question{flex-direction:column;gap:2px;display:flex}.sqc-selection__ask{font-family:var(--sqc-font-family);color:var(--sqc-text);margin:0;font-size:13px;font-weight:600}.sqc-selection__actions{display:flex}.sqc-selection__validate{height:32px;font-family:var(--sqc-font-family);color:var(--sqc-on-accent);background:var(--sqc-accent-color);cursor:pointer;border:1px solid #0000;border-radius:12px;flex:auto;justify-content:center;align-items:center;padding:0 12px;font-size:13px;font-weight:600;transition:filter .12s,background .12s;display:inline-flex}.sqc-selection__validate:hover:not(:disabled){background:var(--sqc-accent-hover)}.sqc-selection__validate:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-selection__validate:disabled{cursor:not-allowed;color:#fff;background:var(--sqc-disabled)}.sqc-selection__hint{font-family:var(--sqc-font-family);color:var(--sqc-text-muted);margin:0;font-size:11.5px}.sqc-table{scrollbar-width:thin;margin:0 0 8px;overflow-x:auto}.sqc-table table{border-collapse:collapse;min-width:100%;font-family:var(--sqc-font-family);white-space:nowrap;font-size:12.5px}.sqc-table th,.sqc-table td{text-align:left;vertical-align:top;border-bottom:1px solid var(--sqc-border);padding:6px 10px 6px 0}.sqc-table thead th{text-transform:uppercase;letter-spacing:.05em;color:var(--sqc-text-muted);font-size:10.5px;font-weight:600}.sqc-table tbody th{font-weight:500}.sqc-msg--user .sqc-table th,.sqc-msg--user .sqc-table td{border-bottom-color:#ffffff40}.sqc-msg--user .sqc-table thead th{color:#fffc}.sqc-table tbody tr:last-child th,.sqc-table tbody tr:last-child td{border-bottom:0}.sqc-msg__time{color:var(--sqc-text-muted);font-variant-numeric:tabular-nums;margin-top:3px;font-size:10px;display:block}.sqc-msg--user .sqc-msg__time{color:#ffffffb3;text-align:right}.sqc-caret{vertical-align:text-bottom;background:currentColor;width:2px;height:1em;margin-left:2px;animation:1s step-end infinite sqc-blink;display:inline-block}@keyframes sqc-blink{0%,to{opacity:1}50%{opacity:0}}.sqc-typing{gap:3px;padding:2px 0;display:inline-flex}.sqc-typing i{background:var(--sqc-neutral-400);border-radius:50%;width:5px;height:5px;animation:1.2s infinite sqc-pulse}.sqc-typing i:nth-child(2){animation-delay:.2s}.sqc-typing i:nth-child(3){animation-delay:.4s}@keyframes sqc-pulse{0%,60%,to{opacity:.25}30%{opacity:1}}.sqc-suggestions{flex-direction:column;gap:7px;display:flex}.sqc-suggestion{border:1px solid var(--sqc-border);background:var(--sqc-bg);width:100%;color:var(--sqc-text);font-family:var(--sqc-font-family);cursor:pointer;text-align:left;border-radius:12px;align-items:center;gap:8px;padding:8px 11px;font-size:12.5px;transition:background .15s,border-color .15s;display:flex}.sqc-suggestion:before{content:\"\";background:var(--sqc-accent-fg);border-radius:50%;flex:none;width:5px;height:5px}.sqc-suggestion:hover{background:var(--sqc-surface);border-color:var(--sqc-border-strong)}.sqc-suggestion:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-composer{border-top:1px solid var(--sqc-border);background:var(--sqc-bg);flex-wrap:wrap;flex-shrink:0;align-items:flex-end;gap:8px;padding:12px 14px;display:flex}.sqc-composer--dropping{outline:2px dashed var(--sqc-accent-color);outline-offset:-4px}.sqc-attachments{flex-wrap:wrap;flex-basis:100%;gap:6px;display:flex}.sqc-attachments--sent{margin-top:8px}.sqc-chip{border:1px solid var(--sqc-border);background:var(--sqc-selected);max-width:100%;color:var(--sqc-text);border-radius:999px;align-items:center;gap:4px;padding:3px 4px 3px 10px;font-size:12px;display:inline-flex}.sqc-chip--waiting{opacity:.6;padding-right:10px}.sqc-chip__name{text-overflow:ellipsis;white-space:nowrap;max-width:180px;overflow:hidden}.sqc-chip__remove{width:18px;height:18px;color:var(--sqc-text-muted);cursor:pointer;background:0 0;border:0;border-radius:999px;justify-content:center;align-items:center;padding:0;font-size:14px;line-height:1;display:inline-flex}.sqc-chip__remove:hover{background:var(--sqc-selected);color:var(--sqc-text)}.sqc-attachments__error{color:var(--sqc-error-600);flex-basis:100%;margin:0;font-size:12px}.sqc-attachment__image{border-radius:12px;max-width:100%;max-height:180px;display:block}.sqc-file-input{display:none}.sqc-btn--attach{color:var(--sqc-text-muted);background:0 0}.sqc-btn--attach:hover{background:var(--sqc-selected);color:var(--sqc-text)}.sqc-composer__field{flex:1;min-width:0;position:relative}.sqc-composer__input{border:1px solid var(--sqc-border-strong);background:var(--sqc-bg);width:100%;min-height:38px;max-height:132px;color:var(--sqc-text);font-family:var(--sqc-font-family);resize:none;border-radius:12px;outline:none;padding:9px 12px;font-size:13.5px;line-height:1.4;transition:border-color .15s,box-shadow .15s;display:block;overflow-y:hidden}.sqc-composer__input::placeholder{color:var(--sqc-neutral-400)}.sqc-composer__input:focus{border-color:var(--sqc-text);box-shadow:var(--sqc-focus-input)}.sqc-mentions{z-index:2;border:1px solid var(--sqc-border);background:var(--sqc-bg);max-height:184px;box-shadow:var(--sqc-shadow);scrollbar-width:thin;border-radius:12px;margin:0;padding:4px;list-style:none;position:absolute;bottom:calc(100% + 6px);left:0;right:0;overflow-y:auto}.sqc-mention{cursor:pointer;color:var(--sqc-text);border-radius:8px;align-items:baseline;gap:6px;padding:6px 8px;font-size:12.5px;display:flex}.sqc-mention--active{background:var(--sqc-neutral-100)}.sqc-mention__icon{flex-shrink:0}.sqc-mention__handle{font-weight:600}.sqc-mention__name{text-overflow:ellipsis;white-space:nowrap;color:var(--sqc-text-muted);overflow:hidden}.sqc-composer__count{color:var(--sqc-text-muted);pointer-events:none;font-variant-numeric:tabular-nums;font-size:10px;position:absolute;bottom:4px;right:8px}.sqc-btn{cursor:pointer;border:none;border-radius:12px;flex-shrink:0;place-items:center;width:38px;height:38px;transition:background .15s,opacity .15s;display:grid}.sqc-btn svg{width:17px;height:17px}.sqc-btn--send{background:var(--sqc-accent-color);color:var(--sqc-on-accent)}.sqc-btn--send:hover:not(:disabled){background:var(--sqc-accent-hover)}.sqc-btn--send:disabled{background:var(--sqc-disabled);color:#fff;cursor:not-allowed}.sqc-btn--stop{background:var(--sqc-bg);color:var(--sqc-text);border:1px solid var(--sqc-border)}.sqc-btn--stop:hover{border-color:var(--sqc-border-strong);background:var(--sqc-surface)}.sqc-btn:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-hint{padding:0 16px max(9px, env(safe-area-inset-bottom));color:var(--sqc-text-muted);text-align:center;flex-shrink:0;margin:0;font-size:10.5px;line-height:1.35}@media (max-width:520px){.sqc{--sqc-width:100vw}.sqc-panel{border-left:none}.sqc-launcher{bottom:16px;right:16px}.sqc[data-position=bottom-left] .sqc-launcher{left:16px}.sqc[data-layout=floating] .sqc-panel,.sqc[data-layout=floating][data-position=bottom-left] .sqc-panel{border:none;border-radius:0;max-width:none;height:auto;max-height:none;top:0;bottom:0;left:0;right:0}}@media (prefers-reduced-motion:reduce){.sqc-launcher,.sqc-panel,.sqc-btn,.sqc-suggestion,.sqc-choice,.sqc-confirm__btn,.sqc-icon-btn,.sqc-icon-btn[data-tip]:after{transition:none}.sqc-typing i,.sqc-caret{animation:none}}.sqc-with-human{border:1px solid var(--sqc-border);background:var(--sqc-selected);color:var(--sqc-neutral-600);border-radius:12px;margin:8px 0 0;padding:8px 12px;font-size:13px}";
|
|
2251
2263
|
//#endregion
|
|
2252
2264
|
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/checkPrivateRedeclaration.js
|
|
2253
|
-
function
|
|
2265
|
+
function Sn(e, t) {
|
|
2254
2266
|
if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
|
|
2255
2267
|
}
|
|
2256
2268
|
//#endregion
|
|
2257
2269
|
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/classPrivateMethodInitSpec.js
|
|
2258
|
-
function
|
|
2259
|
-
|
|
2270
|
+
function Cn(e, t) {
|
|
2271
|
+
Sn(e, t), t.add(e);
|
|
2260
2272
|
}
|
|
2261
2273
|
//#endregion
|
|
2262
2274
|
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/classPrivateFieldInitSpec.js
|
|
2263
2275
|
function X(e, t, n) {
|
|
2264
|
-
|
|
2276
|
+
Sn(e, t), t.set(e, n);
|
|
2265
2277
|
}
|
|
2266
2278
|
//#endregion
|
|
2267
2279
|
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/assertClassBrand.js
|
|
@@ -2281,7 +2293,7 @@ function $(e, t) {
|
|
|
2281
2293
|
}
|
|
2282
2294
|
//#endregion
|
|
2283
2295
|
//#region src/element.tsx
|
|
2284
|
-
var
|
|
2296
|
+
var wn = "squadico-chatbot", Tn = [
|
|
2285
2297
|
"embed-key",
|
|
2286
2298
|
"context",
|
|
2287
2299
|
"user",
|
|
@@ -2296,24 +2308,25 @@ var Cn = "squadico-chatbot", wn = [
|
|
|
2296
2308
|
"accent",
|
|
2297
2309
|
"theme",
|
|
2298
2310
|
"position",
|
|
2311
|
+
"layout",
|
|
2299
2312
|
"open",
|
|
2300
2313
|
"persist-open",
|
|
2301
2314
|
"locale"
|
|
2302
|
-
],
|
|
2303
|
-
function
|
|
2304
|
-
if (
|
|
2315
|
+
], En;
|
|
2316
|
+
function Dn() {
|
|
2317
|
+
if (En !== void 0) return En;
|
|
2305
2318
|
try {
|
|
2306
2319
|
let e = new CSSStyleSheet();
|
|
2307
|
-
e.replaceSync(
|
|
2320
|
+
e.replaceSync(xn), En = e;
|
|
2308
2321
|
} catch {
|
|
2309
|
-
|
|
2322
|
+
En = null;
|
|
2310
2323
|
}
|
|
2311
|
-
return
|
|
2324
|
+
return En;
|
|
2312
2325
|
}
|
|
2313
|
-
function
|
|
2314
|
-
typeof console < "u" && console.warn(`[${
|
|
2326
|
+
function On(e, t) {
|
|
2327
|
+
typeof console < "u" && console.warn(`[${wn}] ${e}`, t ?? "");
|
|
2315
2328
|
}
|
|
2316
|
-
function
|
|
2329
|
+
function kn(e) {
|
|
2317
2330
|
if (!(!e || !e.trim())) try {
|
|
2318
2331
|
let t = JSON.parse(e);
|
|
2319
2332
|
if (t && typeof t == "object" && !Array.isArray(t)) {
|
|
@@ -2324,65 +2337,68 @@ function On(e) {
|
|
|
2324
2337
|
digest: typeof e.digest == "string" && e.digest ? e.digest : void 0
|
|
2325
2338
|
};
|
|
2326
2339
|
}
|
|
2327
|
-
|
|
2340
|
+
On("the \"user\" attribute needs an object with an id", e);
|
|
2328
2341
|
} catch (e) {
|
|
2329
|
-
|
|
2342
|
+
On("the \"user\" attribute is not valid JSON", e);
|
|
2330
2343
|
}
|
|
2331
2344
|
}
|
|
2332
|
-
function
|
|
2345
|
+
function An(e) {
|
|
2333
2346
|
if (!(!e || !e.trim())) try {
|
|
2334
2347
|
let t = JSON.parse(e);
|
|
2335
2348
|
if (t && typeof t == "object" && !Array.isArray(t)) return t;
|
|
2336
|
-
|
|
2349
|
+
On("the `context` attribute must be a JSON object", e);
|
|
2337
2350
|
} catch (e) {
|
|
2338
|
-
|
|
2351
|
+
On("the `context` attribute is not valid JSON", e);
|
|
2339
2352
|
}
|
|
2340
2353
|
}
|
|
2341
|
-
function
|
|
2354
|
+
function jn(e) {
|
|
2342
2355
|
if (!(!e || !e.trim())) {
|
|
2343
2356
|
if (e.trim().startsWith("[")) try {
|
|
2344
2357
|
let t = JSON.parse(e);
|
|
2345
2358
|
if (Array.isArray(t)) return t.map(String);
|
|
2346
2359
|
} catch (e) {
|
|
2347
|
-
|
|
2360
|
+
On("the `suggestions` attribute is not valid JSON", e);
|
|
2348
2361
|
return;
|
|
2349
2362
|
}
|
|
2350
2363
|
return e.split("|").map((e) => e.trim()).filter(Boolean);
|
|
2351
2364
|
}
|
|
2352
2365
|
}
|
|
2353
|
-
function
|
|
2366
|
+
function Mn(e) {
|
|
2354
2367
|
if (e !== null) return e !== "false" && e !== "0";
|
|
2355
2368
|
}
|
|
2356
|
-
function
|
|
2369
|
+
function Nn(e) {
|
|
2357
2370
|
return e === "dark" || e === "light" || e === "auto" ? e : void 0;
|
|
2358
2371
|
}
|
|
2359
|
-
function
|
|
2372
|
+
function Pn(e) {
|
|
2360
2373
|
return e === "bottom-left" || e === "bottom-right" ? e : void 0;
|
|
2361
2374
|
}
|
|
2362
|
-
function
|
|
2363
|
-
|
|
2364
|
-
|
|
2375
|
+
function Fn(e) {
|
|
2376
|
+
return e === "floating" || e === "sidebar" ? e : void 0;
|
|
2377
|
+
}
|
|
2378
|
+
function In() {
|
|
2379
|
+
var e, t, n, r, i, a, o, s, c, l, u, d, f, p;
|
|
2380
|
+
return t = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakSet(), f = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), e = class extends HTMLElement {
|
|
2365
2381
|
constructor() {
|
|
2366
|
-
super(),
|
|
2382
|
+
super(), Cn(this, d), X(this, t, void 0), X(this, n, null), X(this, r, !1), X(this, i, !1), X(this, a, ""), X(this, o, void 0), X(this, s, void 0), X(this, c, void 0), X(this, l, void 0), X(this, u, void 0), X(this, f, (e) => {
|
|
2367
2383
|
let { type: t, ...n } = e;
|
|
2368
2384
|
Q(a, this, n.sessionId), this.dispatchEvent(new CustomEvent(t, {
|
|
2369
2385
|
detail: n,
|
|
2370
2386
|
bubbles: !0,
|
|
2371
2387
|
composed: !0
|
|
2372
2388
|
}));
|
|
2373
|
-
}), X(this,
|
|
2389
|
+
}), X(this, p, (e) => {
|
|
2374
2390
|
Q(n, this, e), e && Q(a, this, e.sessionId());
|
|
2375
2391
|
});
|
|
2376
|
-
let e = this.attachShadow({ mode: "open" }),
|
|
2377
|
-
if (
|
|
2392
|
+
let e = this.attachShadow({ mode: "open" }), m = Dn();
|
|
2393
|
+
if (m) e.adoptedStyleSheets = [m];
|
|
2378
2394
|
else {
|
|
2379
2395
|
let t = document.createElement("style");
|
|
2380
|
-
t.textContent =
|
|
2396
|
+
t.textContent = xn, e.append(t);
|
|
2381
2397
|
}
|
|
2382
2398
|
Q(t, this, document.createElement("div")), e.append($(t, this));
|
|
2383
2399
|
}
|
|
2384
2400
|
connectedCallback() {
|
|
2385
|
-
Q(i, this, !0), Z(
|
|
2401
|
+
Q(i, this, !0), Z(d, this, h).call(this);
|
|
2386
2402
|
}
|
|
2387
2403
|
disconnectedCallback() {
|
|
2388
2404
|
Q(i, this, !1), ie(null, $(t, this)), Q(n, this, null);
|
|
@@ -2390,38 +2406,44 @@ function Pn() {
|
|
|
2390
2406
|
attributeChangedCallback(e, t, r) {
|
|
2391
2407
|
if (t !== r) {
|
|
2392
2408
|
if (e === "open" && $(n, this)) {
|
|
2393
|
-
|
|
2409
|
+
Mn(r) ? $(n, this).open() : $(n, this).close();
|
|
2394
2410
|
return;
|
|
2395
2411
|
}
|
|
2396
|
-
Z(
|
|
2412
|
+
Z(d, this, m).call(this);
|
|
2397
2413
|
}
|
|
2398
2414
|
}
|
|
2399
2415
|
get context() {
|
|
2400
|
-
return $(o, this) ??
|
|
2416
|
+
return $(o, this) ?? An(this.getAttribute("context"));
|
|
2401
2417
|
}
|
|
2402
2418
|
set context(e) {
|
|
2403
|
-
Q(o, this, e), Z(
|
|
2419
|
+
Q(o, this, e), Z(d, this, m).call(this);
|
|
2404
2420
|
}
|
|
2405
2421
|
get embedKey() {
|
|
2406
|
-
return $(
|
|
2422
|
+
return $(u, this) ?? this.getAttribute("embed-key") ?? void 0;
|
|
2407
2423
|
}
|
|
2408
2424
|
set embedKey(e) {
|
|
2409
|
-
Q(
|
|
2425
|
+
Q(u, this, e), Z(d, this, m).call(this);
|
|
2410
2426
|
}
|
|
2411
2427
|
get user() {
|
|
2412
|
-
return $(s, this) ??
|
|
2428
|
+
return $(s, this) ?? kn(this.getAttribute("user"));
|
|
2413
2429
|
}
|
|
2414
2430
|
set user(e) {
|
|
2415
|
-
Q(s, this, e), Z(
|
|
2431
|
+
Q(s, this, e), Z(d, this, m).call(this);
|
|
2432
|
+
}
|
|
2433
|
+
get getSubjectToken() {
|
|
2434
|
+
return $(c, this);
|
|
2435
|
+
}
|
|
2436
|
+
set getSubjectToken(e) {
|
|
2437
|
+
Q(c, this, e), Z(d, this, m).call(this);
|
|
2416
2438
|
}
|
|
2417
2439
|
get agent() {
|
|
2418
|
-
return $(
|
|
2440
|
+
return $(l, this) ?? this.getAttribute("agent") ?? void 0;
|
|
2419
2441
|
}
|
|
2420
2442
|
set agent(e) {
|
|
2421
|
-
Q(
|
|
2443
|
+
Q(l, this, e), Z(d, this, m).call(this);
|
|
2422
2444
|
}
|
|
2423
2445
|
get open() {
|
|
2424
|
-
return $(n, this)?.isOpen() ??
|
|
2446
|
+
return $(n, this)?.isOpen() ?? Mn(this.getAttribute("open")) ?? !1;
|
|
2425
2447
|
}
|
|
2426
2448
|
set open(e) {
|
|
2427
2449
|
e ? this.openChat() : this.closeChat();
|
|
@@ -2443,50 +2465,52 @@ function Pn() {
|
|
|
2443
2465
|
}
|
|
2444
2466
|
sendMessage(e) {
|
|
2445
2467
|
if (!$(n, this)) {
|
|
2446
|
-
|
|
2468
|
+
On("sendMessage() called before the component was mounted — ignored");
|
|
2447
2469
|
return;
|
|
2448
2470
|
}
|
|
2449
2471
|
$(n, this).send(e);
|
|
2450
2472
|
}
|
|
2451
|
-
}, Ke(e, "observedAttributes",
|
|
2452
|
-
function
|
|
2473
|
+
}, Ke(e, "observedAttributes", Tn), e;
|
|
2474
|
+
function m() {
|
|
2453
2475
|
$(r, this) || !$(i, this) || (Q(r, this, !0), queueMicrotask(() => {
|
|
2454
|
-
Q(r, this, !1), $(i, this) && Z(
|
|
2476
|
+
Q(r, this, !1), $(i, this) && Z(d, this, h).call(this);
|
|
2455
2477
|
}));
|
|
2456
2478
|
}
|
|
2457
|
-
function
|
|
2479
|
+
function h() {
|
|
2458
2480
|
let e = (e) => this.getAttribute(e) ?? void 0;
|
|
2459
|
-
ie(/* @__PURE__ */ J(
|
|
2481
|
+
ie(/* @__PURE__ */ J(bn, {
|
|
2460
2482
|
embedKey: this.embedKey,
|
|
2461
2483
|
context: this.context,
|
|
2462
2484
|
user: this.user,
|
|
2485
|
+
getSubjectToken: this.getSubjectToken,
|
|
2463
2486
|
agent: this.agent,
|
|
2464
2487
|
heading: e("heading"),
|
|
2465
2488
|
subheading: e("subheading"),
|
|
2466
2489
|
assistantName: e("assistant-name"),
|
|
2467
2490
|
placeholder: e("placeholder"),
|
|
2468
2491
|
greeting: e("greeting"),
|
|
2469
|
-
suggestions:
|
|
2492
|
+
suggestions: jn(this.getAttribute("suggestions")),
|
|
2470
2493
|
width: e("width"),
|
|
2471
2494
|
accent: e("accent"),
|
|
2472
|
-
theme:
|
|
2473
|
-
position:
|
|
2474
|
-
|
|
2475
|
-
|
|
2495
|
+
theme: Nn(this.getAttribute("theme")),
|
|
2496
|
+
position: Pn(this.getAttribute("position")),
|
|
2497
|
+
layout: Fn(this.getAttribute("layout")),
|
|
2498
|
+
defaultOpen: Mn(this.getAttribute("open")) ?? !1,
|
|
2499
|
+
persistOpen: Mn(this.getAttribute("persist-open")) ?? !0,
|
|
2476
2500
|
locale: e("locale"),
|
|
2477
|
-
onEvent: $(
|
|
2478
|
-
bind: $(
|
|
2501
|
+
onEvent: $(f, this),
|
|
2502
|
+
bind: $(p, this)
|
|
2479
2503
|
}), $(t, this));
|
|
2480
2504
|
}
|
|
2481
2505
|
}
|
|
2482
|
-
var
|
|
2483
|
-
function
|
|
2484
|
-
typeof window > "u" || typeof HTMLElement > "u" || (
|
|
2506
|
+
var Ln;
|
|
2507
|
+
function Rn(e = wn) {
|
|
2508
|
+
typeof window > "u" || typeof HTMLElement > "u" || (Ln ?? (Ln = In()), window.customElements.get(e) || window.customElements.define(e, Ln));
|
|
2485
2509
|
}
|
|
2486
2510
|
//#endregion
|
|
2487
2511
|
//#region src/index.ts
|
|
2488
|
-
|
|
2512
|
+
Rn();
|
|
2489
2513
|
//#endregion
|
|
2490
|
-
export { Je as a, Me as c, q as i,
|
|
2514
|
+
export { Je as a, Me as c, q as i, Rn as n, Ve as o, qe as r, je as s, wn as t };
|
|
2491
2515
|
|
|
2492
|
-
//# sourceMappingURL=src-
|
|
2516
|
+
//# sourceMappingURL=src-D4ZbNlbK.js.map
|