@akropolys/kiku 1.6.4 → 1.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +91 -233
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +91 -233
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +68 -1388
- package/dist/styles.css.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -515,7 +515,6 @@ function ChatWidget({
|
|
|
515
515
|
next[historyIdx] = {
|
|
516
516
|
...next[historyIdx],
|
|
517
517
|
content: messages[hookIdx].content,
|
|
518
|
-
cartSnapshot: messages[hookIdx].cartSnapshot,
|
|
519
518
|
actionType: messages[hookIdx].actionType
|
|
520
519
|
};
|
|
521
520
|
break;
|
|
@@ -1169,30 +1168,11 @@ var HistoryIcon = () => /* @__PURE__ */ jsxs6("svg", { width: "16", height: "16"
|
|
|
1169
1168
|
/* @__PURE__ */ jsx7("path", { d: "M12 7v5l4 2" })
|
|
1170
1169
|
] });
|
|
1171
1170
|
var NewChatIcon = () => /* @__PURE__ */ jsx7("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx7("path", { d: "M12 5v14M5 12h14" }) });
|
|
1172
|
-
var
|
|
1173
|
-
|
|
1174
|
-
/* @__PURE__ */ jsx7("
|
|
1175
|
-
/* @__PURE__ */ jsx7("path", { d: "
|
|
1171
|
+
var BookmarkIcon = () => /* @__PURE__ */ jsx7("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx7("path", { d: "M19 21 12 16l-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z" }) });
|
|
1172
|
+
var TrashIcon = () => /* @__PURE__ */ jsxs6("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1173
|
+
/* @__PURE__ */ jsx7("path", { d: "M3 6h18" }),
|
|
1174
|
+
/* @__PURE__ */ jsx7("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
1176
1175
|
] });
|
|
1177
|
-
var SecureShieldIcon = ({ className, size = 18 }) => /* @__PURE__ */ jsxs6(
|
|
1178
|
-
"svg",
|
|
1179
|
-
{
|
|
1180
|
-
className,
|
|
1181
|
-
width: size,
|
|
1182
|
-
height: size,
|
|
1183
|
-
viewBox: "0 0 24 24",
|
|
1184
|
-
fill: "none",
|
|
1185
|
-
stroke: "currentColor",
|
|
1186
|
-
strokeWidth: "2.5",
|
|
1187
|
-
strokeLinecap: "round",
|
|
1188
|
-
strokeLinejoin: "round",
|
|
1189
|
-
children: [
|
|
1190
|
-
/* @__PURE__ */ jsx7("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }),
|
|
1191
|
-
/* @__PURE__ */ jsx7("path", { d: "M12 11a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z" }),
|
|
1192
|
-
/* @__PURE__ */ jsx7("path", { d: "M12 11v4" })
|
|
1193
|
-
]
|
|
1194
|
-
}
|
|
1195
|
-
);
|
|
1196
1176
|
var PaperclipIcon = () => /* @__PURE__ */ jsx7("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx7("path", { d: "m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48" }) });
|
|
1197
1177
|
var MicIcon2 = () => /* @__PURE__ */ jsxs6("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1198
1178
|
/* @__PURE__ */ jsx7("path", { d: "M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3z" }),
|
|
@@ -1255,73 +1235,62 @@ function KikuPickerMenu({
|
|
|
1255
1235
|
"aria-label": "@kiku commands",
|
|
1256
1236
|
onMouseDown: (e) => e.preventDefault(),
|
|
1257
1237
|
children: [
|
|
1258
|
-
/* @__PURE__ */ jsxs6(
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
"button",
|
|
1267
|
-
{
|
|
1268
|
-
className: "hsk-kiku-picker-item",
|
|
1269
|
-
role: "menuitem",
|
|
1270
|
-
onClick: () => {
|
|
1271
|
-
onCapture(src);
|
|
1272
|
-
onDismiss();
|
|
1273
|
-
},
|
|
1274
|
-
children: [
|
|
1275
|
-
src.image ? /* @__PURE__ */ jsx7("img", { src: src.image, alt: src.name, className: "hsk-kiku-picker-img" }) : /* @__PURE__ */ jsx7("span", { className: "hsk-kiku-picker-img-placeholder", children: /* @__PURE__ */ jsx7(SecureShieldIcon, { size: 14 }) }),
|
|
1276
|
-
/* @__PURE__ */ jsxs6("span", { className: "hsk-kiku-picker-item-body", children: [
|
|
1277
|
-
/* @__PURE__ */ jsxs6("span", { className: "hsk-kiku-picker-item-name", children: [
|
|
1278
|
-
"\u{1F4CC} ",
|
|
1279
|
-
src.name
|
|
1280
|
-
] }),
|
|
1281
|
-
src.price && /* @__PURE__ */ jsxs6("span", { className: "hsk-kiku-picker-item-price", children: [
|
|
1282
|
-
src.currency ?? defaultCurrency,
|
|
1283
|
-
" ",
|
|
1284
|
-
parseFloat(String(src.price).replace(/[^0-9.]/g, "") || "0").toLocaleString()
|
|
1285
|
-
] })
|
|
1286
|
-
] })
|
|
1287
|
-
]
|
|
1238
|
+
discussed.map((src, i) => /* @__PURE__ */ jsxs6(
|
|
1239
|
+
"button",
|
|
1240
|
+
{
|
|
1241
|
+
className: "hsk-kiku-picker-item",
|
|
1242
|
+
role: "menuitem",
|
|
1243
|
+
onClick: () => {
|
|
1244
|
+
onCapture(src);
|
|
1245
|
+
onDismiss();
|
|
1288
1246
|
},
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1247
|
+
children: [
|
|
1248
|
+
/* @__PURE__ */ jsx7("span", { className: "hsk-kiku-picker-icon", children: src.image ? /* @__PURE__ */ jsx7("img", { src: src.image, alt: "" }) : /* @__PURE__ */ jsx7(BookmarkIcon, {}) }),
|
|
1249
|
+
/* @__PURE__ */ jsx7("span", { className: "hsk-kiku-picker-item-name", children: src.name }),
|
|
1250
|
+
src.price && /* @__PURE__ */ jsxs6("span", { className: "hsk-kiku-picker-item-price", children: [
|
|
1251
|
+
src.currency ?? defaultCurrency,
|
|
1252
|
+
" ",
|
|
1253
|
+
parseFloat(String(src.price).replace(/[^0-9.]/g, "") || "0").toLocaleString()
|
|
1254
|
+
] })
|
|
1255
|
+
]
|
|
1256
|
+
},
|
|
1257
|
+
src.id ?? i
|
|
1258
|
+
)),
|
|
1259
|
+
discussed.length > 1 && /* @__PURE__ */ jsxs6(
|
|
1260
|
+
"button",
|
|
1261
|
+
{
|
|
1262
|
+
className: "hsk-kiku-picker-item",
|
|
1263
|
+
role: "menuitem",
|
|
1264
|
+
onClick: () => {
|
|
1265
|
+
onCaptureAll(discussed);
|
|
1266
|
+
onDismiss();
|
|
1267
|
+
},
|
|
1268
|
+
children: [
|
|
1269
|
+
/* @__PURE__ */ jsx7("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ jsx7(BookmarkIcon, {}) }),
|
|
1270
|
+
/* @__PURE__ */ jsxs6("span", { className: "hsk-kiku-picker-item-name", children: [
|
|
1271
|
+
"Capture all (",
|
|
1302
1272
|
discussed.length,
|
|
1303
|
-
"
|
|
1304
|
-
] })
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
"
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
},
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
/* @__PURE__ */ jsx7(
|
|
1273
|
+
")"
|
|
1274
|
+
] })
|
|
1275
|
+
]
|
|
1276
|
+
}
|
|
1277
|
+
),
|
|
1278
|
+
discussed.length === 0 && /* @__PURE__ */ jsxs6(
|
|
1279
|
+
"button",
|
|
1280
|
+
{
|
|
1281
|
+
className: "hsk-kiku-picker-item",
|
|
1282
|
+
role: "menuitem",
|
|
1283
|
+
onClick: () => {
|
|
1284
|
+
onCapture({ name: "current page", id: void 0 });
|
|
1285
|
+
onDismiss();
|
|
1286
|
+
},
|
|
1287
|
+
children: [
|
|
1288
|
+
/* @__PURE__ */ jsx7("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ jsx7(BookmarkIcon, {}) }),
|
|
1289
|
+
/* @__PURE__ */ jsx7("span", { className: "hsk-kiku-picker-item-name", children: "Capture current page" })
|
|
1290
|
+
]
|
|
1291
|
+
}
|
|
1292
|
+
),
|
|
1293
|
+
/* @__PURE__ */ jsxs6(
|
|
1325
1294
|
"button",
|
|
1326
1295
|
{
|
|
1327
1296
|
className: "hsk-kiku-picker-item",
|
|
@@ -1330,10 +1299,13 @@ function KikuPickerMenu({
|
|
|
1330
1299
|
onViewHistory();
|
|
1331
1300
|
onDismiss();
|
|
1332
1301
|
},
|
|
1333
|
-
children:
|
|
1302
|
+
children: [
|
|
1303
|
+
/* @__PURE__ */ jsx7("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ jsx7(HistoryIcon, {}) }),
|
|
1304
|
+
/* @__PURE__ */ jsx7("span", { className: "hsk-kiku-picker-item-name", children: "What have you saved?" })
|
|
1305
|
+
]
|
|
1334
1306
|
}
|
|
1335
1307
|
),
|
|
1336
|
-
/* @__PURE__ */
|
|
1308
|
+
/* @__PURE__ */ jsxs6(
|
|
1337
1309
|
"button",
|
|
1338
1310
|
{
|
|
1339
1311
|
className: "hsk-kiku-picker-item",
|
|
@@ -1342,7 +1314,10 @@ function KikuPickerMenu({
|
|
|
1342
1314
|
onDelete();
|
|
1343
1315
|
onDismiss();
|
|
1344
1316
|
},
|
|
1345
|
-
children:
|
|
1317
|
+
children: [
|
|
1318
|
+
/* @__PURE__ */ jsx7("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ jsx7(TrashIcon, {}) }),
|
|
1319
|
+
/* @__PURE__ */ jsx7("span", { className: "hsk-kiku-picker-item-name", children: "Delete this" })
|
|
1320
|
+
]
|
|
1346
1321
|
}
|
|
1347
1322
|
)
|
|
1348
1323
|
]
|
|
@@ -1350,35 +1325,25 @@ function KikuPickerMenu({
|
|
|
1350
1325
|
);
|
|
1351
1326
|
}
|
|
1352
1327
|
function AtPickerMenu({ onSelect, onDismiss }) {
|
|
1353
|
-
return /* @__PURE__ */
|
|
1328
|
+
return /* @__PURE__ */ jsx7(
|
|
1354
1329
|
"div",
|
|
1355
1330
|
{
|
|
1356
1331
|
className: "hsk-kiku-picker",
|
|
1357
1332
|
role: "menu",
|
|
1358
1333
|
"aria-label": "Extensions",
|
|
1359
1334
|
onMouseDown: (e) => e.preventDefault(),
|
|
1360
|
-
children:
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
children: [
|
|
1373
|
-
/* @__PURE__ */ jsx7("span", { className: "hsk-kiku-picker-img-placeholder", style: { background: "color-mix(in srgb, var(--hsk-primary, #7c5cfc) 15%, transparent)", color: "var(--hsk-primary, #7c5cfc)" }, children: /* @__PURE__ */ jsx7(SparkleIcon2, {}) }),
|
|
1374
|
-
/* @__PURE__ */ jsxs6("span", { className: "hsk-kiku-picker-item-body", children: [
|
|
1375
|
-
/* @__PURE__ */ jsx7("span", { className: "hsk-kiku-picker-item-name", children: "@kiku" }),
|
|
1376
|
-
/* @__PURE__ */ jsx7("span", { className: "hsk-kiku-picker-item-price", style: { fontSize: "11px", whiteSpace: "normal", lineHeight: "1.3" }, children: "Ask Kiku to capture pages, remember items, or show your history" })
|
|
1377
|
-
] })
|
|
1378
|
-
]
|
|
1379
|
-
}
|
|
1380
|
-
)
|
|
1381
|
-
]
|
|
1335
|
+
children: /* @__PURE__ */ jsxs6(
|
|
1336
|
+
"button",
|
|
1337
|
+
{
|
|
1338
|
+
className: "hsk-kiku-picker-item",
|
|
1339
|
+
role: "menuitem",
|
|
1340
|
+
onClick: () => onSelect("@kiku"),
|
|
1341
|
+
children: [
|
|
1342
|
+
/* @__PURE__ */ jsx7("span", { className: "hsk-kiku-picker-icon hsk-kiku-picker-icon--accent", children: /* @__PURE__ */ jsx7(SparkleIcon2, {}) }),
|
|
1343
|
+
/* @__PURE__ */ jsx7("span", { className: "hsk-kiku-picker-item-name", children: "kiku \u2014 capture & remember" })
|
|
1344
|
+
]
|
|
1345
|
+
}
|
|
1346
|
+
)
|
|
1382
1347
|
}
|
|
1383
1348
|
);
|
|
1384
1349
|
}
|
|
@@ -1408,88 +1373,6 @@ function relativeTime(ts) {
|
|
|
1408
1373
|
const days = Math.floor(hrs / 24);
|
|
1409
1374
|
return `${days}d ago`;
|
|
1410
1375
|
}
|
|
1411
|
-
function CartContextCard({ cart, defaultCurrency }) {
|
|
1412
|
-
if (!cart.items || cart.items.length === 0) return null;
|
|
1413
|
-
const currency = cart.currency || defaultCurrency;
|
|
1414
|
-
const total = cart.total ?? cart.items.reduce((s, i) => s + i.price_numeric * i.quantity, 0);
|
|
1415
|
-
return /* @__PURE__ */ jsxs6("div", { className: "hsk-cart-card", children: [
|
|
1416
|
-
/* @__PURE__ */ jsxs6("div", { className: "hsk-cart-card-header", children: [
|
|
1417
|
-
/* @__PURE__ */ jsx7(ShoppingBagIcon, {}),
|
|
1418
|
-
/* @__PURE__ */ jsxs6("span", { children: [
|
|
1419
|
-
"Your cart \xB7 ",
|
|
1420
|
-
cart.item_count ?? cart.items.length,
|
|
1421
|
-
" item",
|
|
1422
|
-
(cart.item_count ?? cart.items.length) !== 1 ? "s" : ""
|
|
1423
|
-
] })
|
|
1424
|
-
] }),
|
|
1425
|
-
/* @__PURE__ */ jsx7("div", { className: "hsk-cart-items", children: cart.items.map((item) => /* @__PURE__ */ jsxs6("div", { className: "hsk-cart-item", children: [
|
|
1426
|
-
/* @__PURE__ */ jsxs6("div", { className: "hsk-cart-item-img-wrap", children: [
|
|
1427
|
-
item.image ? /* @__PURE__ */ jsx7("img", { className: "hsk-cart-item-img", src: item.image, alt: item.name, loading: "lazy" }) : /* @__PURE__ */ jsx7("div", { className: "hsk-cart-item-img-placeholder", children: /* @__PURE__ */ jsx7(ShoppingBagIcon, {}) }),
|
|
1428
|
-
item.quantity > 1 && /* @__PURE__ */ jsx7("span", { className: "hsk-cart-item-qty", children: item.quantity })
|
|
1429
|
-
] }),
|
|
1430
|
-
/* @__PURE__ */ jsxs6("div", { className: "hsk-cart-item-info", children: [
|
|
1431
|
-
/* @__PURE__ */ jsx7("div", { className: "hsk-cart-item-name", children: item.name }),
|
|
1432
|
-
/* @__PURE__ */ jsxs6("div", { className: "hsk-cart-item-price", children: [
|
|
1433
|
-
item.quantity > 1 && /* @__PURE__ */ jsxs6("span", { className: "hsk-cart-item-qty-label", children: [
|
|
1434
|
-
item.quantity,
|
|
1435
|
-
"\xD7 "
|
|
1436
|
-
] }),
|
|
1437
|
-
currency,
|
|
1438
|
-
" ",
|
|
1439
|
-
(item.price_numeric * item.quantity).toLocaleString()
|
|
1440
|
-
] })
|
|
1441
|
-
] })
|
|
1442
|
-
] }, item.id)) }),
|
|
1443
|
-
/* @__PURE__ */ jsxs6("div", { className: "hsk-cart-total", children: [
|
|
1444
|
-
/* @__PURE__ */ jsx7("span", { children: "Total" }),
|
|
1445
|
-
/* @__PURE__ */ jsxs6("span", { className: "hsk-cart-total-amount", children: [
|
|
1446
|
-
currency,
|
|
1447
|
-
" ",
|
|
1448
|
-
total.toLocaleString()
|
|
1449
|
-
] })
|
|
1450
|
-
] })
|
|
1451
|
-
] });
|
|
1452
|
-
}
|
|
1453
|
-
function ActionPills({ cart, actionType, onSend, loading }) {
|
|
1454
|
-
const hasItems = cart.items && cart.items.length > 0;
|
|
1455
|
-
const lastItem = hasItems ? cart.items[cart.items.length - 1] : null;
|
|
1456
|
-
const pills = [];
|
|
1457
|
-
if (hasItems && lastItem) {
|
|
1458
|
-
if (actionType === "add_to_cart") {
|
|
1459
|
-
const name = lastItem.name || "item";
|
|
1460
|
-
const shortName = name.split(" ")[0] || "item";
|
|
1461
|
-
pills.push({ emoji: "\u2795", label: "Add 1 more", query: `Add one more ${name} to my cart` });
|
|
1462
|
-
pills.push({ emoji: "\u{1F5D1}\uFE0F", label: `Remove ${shortName}`, query: `Remove the ${name} from my cart` });
|
|
1463
|
-
}
|
|
1464
|
-
if (cart.items.length > 1) {
|
|
1465
|
-
pills.push({ emoji: "\u{1F6D2}", label: "View cart", query: "Show me my cart" });
|
|
1466
|
-
}
|
|
1467
|
-
pills.push({ emoji: "\u{1F4B3}", label: "Checkout", query: "Proceed to checkout" });
|
|
1468
|
-
pills.push({ emoji: "\u{1F6CD}\uFE0F", label: "Keep shopping", query: "What else do you recommend?" });
|
|
1469
|
-
} else if (actionType === "clear_cart" || actionType === "remove_from_cart") {
|
|
1470
|
-
pills.push({ emoji: "\u{1F6CD}\uFE0F", label: "Continue shopping", query: "Show me popular products" });
|
|
1471
|
-
pills.push({ emoji: "\u{1F50D}", label: "Search again", query: "Help me find something" });
|
|
1472
|
-
} else if (actionType === "view_cart") {
|
|
1473
|
-
if (hasItems) {
|
|
1474
|
-
pills.push({ emoji: "\u{1F4B3}", label: "Checkout", query: "Proceed to checkout" });
|
|
1475
|
-
pills.push({ emoji: "\u{1F5D1}\uFE0F", label: "Clear cart", query: "Clear my cart" });
|
|
1476
|
-
}
|
|
1477
|
-
}
|
|
1478
|
-
if (pills.length === 0) return null;
|
|
1479
|
-
return /* @__PURE__ */ jsx7("div", { className: "hsk-action-pills", children: pills.map((pill) => /* @__PURE__ */ jsxs6(
|
|
1480
|
-
"button",
|
|
1481
|
-
{
|
|
1482
|
-
className: "hsk-action-pill",
|
|
1483
|
-
onClick: () => onSend(pill.query),
|
|
1484
|
-
disabled: loading,
|
|
1485
|
-
children: [
|
|
1486
|
-
/* @__PURE__ */ jsx7("span", { className: "hsk-pill-emoji", children: pill.emoji }),
|
|
1487
|
-
pill.label
|
|
1488
|
-
]
|
|
1489
|
-
},
|
|
1490
|
-
pill.query
|
|
1491
|
-
)) });
|
|
1492
|
-
}
|
|
1493
1376
|
function SourcesCarousel({ sources, defaultCurrency, onSelectSource, referencedIds = [] }) {
|
|
1494
1377
|
const client = useAkropolysContext3();
|
|
1495
1378
|
const isProperty = client?.vertical === "property";
|
|
@@ -1610,13 +1493,12 @@ function SmartContextPills({
|
|
|
1610
1493
|
query: `Compare the ${firstTwo[0]} and ${firstTwo[1]}`
|
|
1611
1494
|
});
|
|
1612
1495
|
}
|
|
1613
|
-
if (cheapest && !isProperty) {
|
|
1614
|
-
const
|
|
1615
|
-
const short = name.split(" ").slice(0, 3).join(" ");
|
|
1496
|
+
if (cheapest && !isProperty && cheapest.name) {
|
|
1497
|
+
const short = cheapest.name.split(" ").slice(0, 3).join(" ");
|
|
1616
1498
|
pills.push({
|
|
1617
|
-
emoji: "\u{
|
|
1618
|
-
label: `
|
|
1619
|
-
query: `
|
|
1499
|
+
emoji: "\u{1F4A1}",
|
|
1500
|
+
label: `More on ${short}`,
|
|
1501
|
+
query: `Tell me more about the ${cheapest.name}`
|
|
1620
1502
|
});
|
|
1621
1503
|
}
|
|
1622
1504
|
if (isProperty) {
|
|
@@ -1625,15 +1507,6 @@ function SmartContextPills({
|
|
|
1625
1507
|
pills.push({ emoji: "\u{1F4B0}", label: "Under KSh 20K", query: "Show me options under KSh 20,000" });
|
|
1626
1508
|
}
|
|
1627
1509
|
} else if (intent === "compare" && sources.length > 0) {
|
|
1628
|
-
if (cheapest && !isProperty) {
|
|
1629
|
-
const name = cheapest.name || "";
|
|
1630
|
-
const short = name.split(" ").slice(0, 3).join(" ");
|
|
1631
|
-
pills.push({
|
|
1632
|
-
emoji: "\u{1F6D2}",
|
|
1633
|
-
label: `Add ${short}`,
|
|
1634
|
-
query: `Add the ${name} to my cart`
|
|
1635
|
-
});
|
|
1636
|
-
}
|
|
1637
1510
|
if (firstName) {
|
|
1638
1511
|
pills.push({
|
|
1639
1512
|
emoji: "\u{1F50D}",
|
|
@@ -1644,9 +1517,6 @@ function SmartContextPills({
|
|
|
1644
1517
|
pills.push({ emoji: "\u{1F4A1}", label: "Which is best?", query: "Which one would you recommend and why?" });
|
|
1645
1518
|
} else if (intent === "specs" && sources.length > 0) {
|
|
1646
1519
|
if (firstName) {
|
|
1647
|
-
if (!isProperty) {
|
|
1648
|
-
pills.push({ emoji: "\u{1F6D2}", label: "Add to cart", query: `Add the ${firstName} to my cart` });
|
|
1649
|
-
}
|
|
1650
1520
|
pills.push({
|
|
1651
1521
|
emoji: "\u{1F504}",
|
|
1652
1522
|
label: "Find alternatives",
|
|
@@ -2243,7 +2113,7 @@ function ChatModal({
|
|
|
2243
2113
|
] });
|
|
2244
2114
|
})(),
|
|
2245
2115
|
isLast && lastIntent === "compare" && sources.length >= 2 && !replayMessages && /* @__PURE__ */ jsx7(ComparisonMatrix, { sources, defaultCurrency }),
|
|
2246
|
-
isLast && referencedIds.length > 0 && lastIntent !== "compare" && lastAction?.type !== "request_kiku_key" && lastAction?.type !== "
|
|
2116
|
+
isLast && referencedIds.length > 0 && lastIntent !== "compare" && lastAction?.type !== "request_kiku_key" && lastAction?.type !== "capture" && lastAction?.type !== "delete" && lastAction?.type !== "view_history" && /* @__PURE__ */ jsx7(
|
|
2247
2117
|
SourcesCarousel,
|
|
2248
2118
|
{
|
|
2249
2119
|
sources,
|
|
@@ -2252,23 +2122,11 @@ function ChatModal({
|
|
|
2252
2122
|
referencedIds
|
|
2253
2123
|
}
|
|
2254
2124
|
),
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
}
|
|
2261
|
-
),
|
|
2262
|
-
isLast && msg.cartSnapshot && !loading && /* @__PURE__ */ jsx7(
|
|
2263
|
-
ActionPills,
|
|
2264
|
-
{
|
|
2265
|
-
cart: msg.cartSnapshot,
|
|
2266
|
-
actionType: msg.actionType,
|
|
2267
|
-
onSend: handleSend,
|
|
2268
|
-
loading
|
|
2269
|
-
}
|
|
2270
|
-
),
|
|
2271
|
-
isLast && !loading && !msg.cartSnapshot && !replayMessages && /* @__PURE__ */ jsx7(
|
|
2125
|
+
isLast && !loading && lastAction?.url && /* @__PURE__ */ jsx7("div", { className: "hsk-action-pills", children: /* @__PURE__ */ jsxs6("a", { className: "hsk-action-pill", href: lastAction.url, children: [
|
|
2126
|
+
String(lastAction.type || "continue").replace(/_/g, " "),
|
|
2127
|
+
" \u2192"
|
|
2128
|
+
] }) }),
|
|
2129
|
+
isLast && !loading && !replayMessages && /* @__PURE__ */ jsx7(
|
|
2272
2130
|
SmartContextPills,
|
|
2273
2131
|
{
|
|
2274
2132
|
intent: lastIntent,
|