@superinterface/react 2.23.0 → 2.24.1
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.cjs +715 -442
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -2
- package/dist/index.d.ts +17 -2
- package/dist/index.js +654 -381
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
package/dist/index.js
CHANGED
|
@@ -414,9 +414,9 @@ var SuperinterfaceProvider = function(param) {
|
|
|
414
414
|
});
|
|
415
415
|
};
|
|
416
416
|
// src/components/threads/Thread/Messages/index.tsx
|
|
417
|
-
import { Flex as
|
|
417
|
+
import { Flex as Flex17 } from "@radix-ui/themes";
|
|
418
418
|
// src/components/threads/Thread/Messages/Content/index.tsx
|
|
419
|
-
import { useEffect } from "react";
|
|
419
|
+
import { useEffect as useEffect2 } from "react";
|
|
420
420
|
// src/hooks/messages/useMessages/index.tsx
|
|
421
421
|
import { useMemo } from "react";
|
|
422
422
|
import { useInfiniteQuery, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
@@ -787,9 +787,9 @@ var UserAvatar = function() {
|
|
|
787
787
|
});
|
|
788
788
|
};
|
|
789
789
|
// src/components/threads/Thread/Messages/Content/MessageGroup/Content/index.tsx
|
|
790
|
-
import { Flex as
|
|
790
|
+
import { Flex as Flex15 } from "@radix-ui/themes";
|
|
791
791
|
// src/components/threads/Thread/Message/index.tsx
|
|
792
|
-
import { useMemo as
|
|
792
|
+
import { useMemo as useMemo6, Fragment } from "react";
|
|
793
793
|
import { isEmpty } from "radash";
|
|
794
794
|
import { Box as Box10 } from "@radix-ui/themes";
|
|
795
795
|
// src/components/skeletons/StartingContentSkeleton/index.tsx
|
|
@@ -1217,7 +1217,7 @@ import { useContext as useContext7 } from "react";
|
|
|
1217
1217
|
// src/contexts/markdown/MarkdownContext/index.ts
|
|
1218
1218
|
import { createContext as createContext9 } from "react";
|
|
1219
1219
|
// src/contexts/markdown/MarkdownContext/lib/components/index.tsx
|
|
1220
|
-
import { Heading } from "@radix-ui/themes";
|
|
1220
|
+
import { Heading, Table } from "@radix-ui/themes";
|
|
1221
1221
|
// src/contexts/markdown/MarkdownContext/lib/components/Paragraph.tsx
|
|
1222
1222
|
import { Box as Box4, Text as Text4 } from "@radix-ui/themes";
|
|
1223
1223
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
@@ -1322,13 +1322,250 @@ var Code3 = function(param) {
|
|
|
1322
1322
|
children: children
|
|
1323
1323
|
});
|
|
1324
1324
|
};
|
|
1325
|
-
// src/contexts/markdown/MarkdownContext/lib/components/Img.
|
|
1326
|
-
import
|
|
1325
|
+
// src/contexts/markdown/MarkdownContext/lib/components/Img/lib/isVideoSrc.ts
|
|
1326
|
+
import videoExtensions from "video-extensions";
|
|
1327
|
+
var isVideoSrc = function(param) {
|
|
1328
|
+
var src = param.src;
|
|
1329
|
+
return videoExtensions.includes(src.split(".").pop() || "");
|
|
1330
|
+
};
|
|
1331
|
+
// src/contexts/markdown/MarkdownContext/lib/components/Img/lib/isAudioSrc.ts
|
|
1332
|
+
var isAudioSrc = function(param) {
|
|
1333
|
+
var src = param.src;
|
|
1334
|
+
return src.endsWith(".mp3") || src.endsWith(".wav");
|
|
1335
|
+
};
|
|
1336
|
+
// src/contexts/markdown/MarkdownContext/lib/components/Img/Video/index.tsx
|
|
1337
|
+
import { Flex as Flex11 } from "@radix-ui/themes";
|
|
1338
|
+
import "@vidstack/react/player/styles/base.css";
|
|
1339
|
+
import { MediaPlayer, MediaProvider, Controls } from "@vidstack/react";
|
|
1340
|
+
// src/components/media/PlayButton.tsx
|
|
1341
|
+
import { PlayButton as VidstackPlayButton, useMediaState } from "@vidstack/react";
|
|
1342
|
+
import { IconButton } from "@radix-ui/themes";
|
|
1343
|
+
import { PlayIcon, PauseIcon } from "@radix-ui/react-icons";
|
|
1327
1344
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1328
|
-
var
|
|
1329
|
-
|
|
1345
|
+
var PlayButton = function() {
|
|
1346
|
+
var isPaused = useMediaState("paused");
|
|
1347
|
+
return /* @__PURE__ */ jsx34(IconButton, {
|
|
1348
|
+
variant: "ghost",
|
|
1349
|
+
asChild: true,
|
|
1350
|
+
children: /* @__PURE__ */ jsx34(VidstackPlayButton, {
|
|
1351
|
+
children: isPaused ? /* @__PURE__ */ jsx34(PlayIcon, {}) : /* @__PURE__ */ jsx34(PauseIcon, {})
|
|
1352
|
+
})
|
|
1353
|
+
});
|
|
1354
|
+
};
|
|
1355
|
+
// src/components/media/VolumeButton.tsx
|
|
1356
|
+
import { MuteButton, useMediaState as useMediaState2, useMediaRemote } from "@vidstack/react";
|
|
1357
|
+
import { IconButton as IconButton2, HoverCard, Slider } from "@radix-ui/themes";
|
|
1358
|
+
import { SpeakerModerateIcon, SpeakerOffIcon } from "@radix-ui/react-icons";
|
|
1359
|
+
import { jsx as jsx35, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1360
|
+
var VolumeButton = function() {
|
|
1361
|
+
var volume = useMediaState2("volume");
|
|
1362
|
+
var isMuted = useMediaState2("muted");
|
|
1363
|
+
var remote = useMediaRemote();
|
|
1364
|
+
return /* @__PURE__ */ jsxs10(HoverCard.Root, {
|
|
1365
|
+
children: [
|
|
1366
|
+
/* @__PURE__ */ jsx35(HoverCard.Trigger, {
|
|
1367
|
+
children: /* @__PURE__ */ jsx35(IconButton2, {
|
|
1368
|
+
variant: "ghost",
|
|
1369
|
+
asChild: true,
|
|
1370
|
+
children: /* @__PURE__ */ jsx35(MuteButton, {
|
|
1371
|
+
children: isMuted || volume === 0 ? /* @__PURE__ */ jsx35(SpeakerOffIcon, {}) : /* @__PURE__ */ jsx35(SpeakerModerateIcon, {})
|
|
1372
|
+
})
|
|
1373
|
+
})
|
|
1374
|
+
}),
|
|
1375
|
+
/* @__PURE__ */ jsx35(HoverCard.Content, {
|
|
1376
|
+
size: "1",
|
|
1377
|
+
side: "top",
|
|
1378
|
+
height: "100px",
|
|
1379
|
+
children: /* @__PURE__ */ jsx35(Slider, {
|
|
1380
|
+
size: "1",
|
|
1381
|
+
variant: "soft",
|
|
1382
|
+
orientation: "vertical",
|
|
1383
|
+
value: [
|
|
1384
|
+
volume * 100
|
|
1385
|
+
],
|
|
1386
|
+
onValueChange: function(param) {
|
|
1387
|
+
var _param = _sliced_to_array(param, 1), value = _param[0];
|
|
1388
|
+
return remote.changeVolume(value / 100);
|
|
1389
|
+
}
|
|
1390
|
+
})
|
|
1391
|
+
})
|
|
1392
|
+
]
|
|
1393
|
+
});
|
|
1394
|
+
};
|
|
1395
|
+
// src/components/media/Time.tsx
|
|
1396
|
+
import { useState, useEffect, useMemo as useMemo5 } from "react";
|
|
1397
|
+
import { useMediaState as useMediaState3, useMediaRemote as useMediaRemote2 } from "@vidstack/react";
|
|
1398
|
+
import { Slider as Slider2 } from "@radix-ui/themes";
|
|
1399
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1400
|
+
var Time = function() {
|
|
1401
|
+
var time = useMediaState3("currentTime");
|
|
1402
|
+
var duration = useMediaState3("duration");
|
|
1403
|
+
var seeking = useMediaState3("seeking");
|
|
1404
|
+
var canSeek = useMediaState3("canSeek");
|
|
1405
|
+
var remote = useMediaRemote2();
|
|
1406
|
+
var _useState = _sliced_to_array(useState(0), 2), value = _useState[0], setValue = _useState[1];
|
|
1407
|
+
useEffect(function() {
|
|
1408
|
+
if (seeking) return;
|
|
1409
|
+
setValue(time / duration * 100);
|
|
1410
|
+
}, [
|
|
1411
|
+
time,
|
|
1412
|
+
duration,
|
|
1413
|
+
seeking
|
|
1414
|
+
]);
|
|
1415
|
+
var step = useMemo5(function() {
|
|
1416
|
+
return 1 / duration * 100;
|
|
1417
|
+
}, [
|
|
1418
|
+
duration
|
|
1419
|
+
]);
|
|
1420
|
+
return /* @__PURE__ */ jsx36(Slider2, {
|
|
1421
|
+
size: "1",
|
|
1422
|
+
variant: "soft",
|
|
1423
|
+
value: [
|
|
1424
|
+
value
|
|
1425
|
+
],
|
|
1426
|
+
disabled: !canSeek,
|
|
1427
|
+
step: Number.isFinite(step) ? step : 1,
|
|
1428
|
+
onValueChange: function(param) {
|
|
1429
|
+
var _param = _sliced_to_array(param, 1), value2 = _param[0];
|
|
1430
|
+
setValue(value2);
|
|
1431
|
+
remote.seeking(value2 / 100 * duration);
|
|
1432
|
+
},
|
|
1433
|
+
onValueCommit: function(param) {
|
|
1434
|
+
var _param = _sliced_to_array(param, 1), value2 = _param[0];
|
|
1435
|
+
remote.seek(value2 / 100 * duration);
|
|
1436
|
+
}
|
|
1437
|
+
});
|
|
1438
|
+
};
|
|
1439
|
+
// src/components/media/MediaContainer.tsx
|
|
1440
|
+
import { Card, Inset } from "@radix-ui/themes";
|
|
1441
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
1442
|
+
var MediaContainer = function(param) {
|
|
1443
|
+
var children = param.children;
|
|
1444
|
+
return /* @__PURE__ */ jsx37(Card, {
|
|
1445
|
+
mb: "3",
|
|
1446
|
+
children: /* @__PURE__ */ jsx37(Inset, {
|
|
1447
|
+
clip: "padding-box",
|
|
1448
|
+
style: {
|
|
1449
|
+
display: "flex",
|
|
1450
|
+
flexDirection: "column"
|
|
1451
|
+
},
|
|
1452
|
+
children: children
|
|
1453
|
+
})
|
|
1454
|
+
});
|
|
1455
|
+
};
|
|
1456
|
+
// src/contexts/markdown/MarkdownContext/lib/components/Img/Video/FullscreenButton.tsx
|
|
1457
|
+
import { FullscreenButton as VidstackFullscreenButton, useMediaState as useMediaState4 } from "@vidstack/react";
|
|
1458
|
+
import { IconButton as IconButton3 } from "@radix-ui/themes";
|
|
1459
|
+
import { EnterFullScreenIcon, ExitFullScreenIcon } from "@radix-ui/react-icons";
|
|
1460
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
1461
|
+
var FullscreenButton = function() {
|
|
1462
|
+
var isFullscreen = useMediaState4("fullscreen");
|
|
1463
|
+
return /* @__PURE__ */ jsx38(IconButton3, {
|
|
1464
|
+
variant: "ghost",
|
|
1465
|
+
asChild: true,
|
|
1466
|
+
children: /* @__PURE__ */ jsx38(VidstackFullscreenButton, {
|
|
1467
|
+
children: isFullscreen ? /* @__PURE__ */ jsx38(ExitFullScreenIcon, {}) : /* @__PURE__ */ jsx38(EnterFullScreenIcon, {})
|
|
1468
|
+
})
|
|
1469
|
+
});
|
|
1470
|
+
};
|
|
1471
|
+
// src/contexts/markdown/MarkdownContext/lib/components/Img/Video/index.tsx
|
|
1472
|
+
import { jsx as jsx39, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1473
|
+
var Video = function(param) {
|
|
1474
|
+
var src = param.src;
|
|
1475
|
+
return /* @__PURE__ */ jsx39(MediaContainer, {
|
|
1476
|
+
children: /* @__PURE__ */ jsxs11(MediaPlayer, {
|
|
1477
|
+
src: src,
|
|
1478
|
+
playsInline: true,
|
|
1479
|
+
hideControlsOnMouseLeave: true,
|
|
1480
|
+
crossOrigin: true,
|
|
1481
|
+
children: [
|
|
1482
|
+
/* @__PURE__ */ jsx39(MediaProvider, {}),
|
|
1483
|
+
/* @__PURE__ */ jsx39("style", {
|
|
1484
|
+
children: "\n .superinterface-video-controls {\n opacity: 0;\n transition: opacity 0.2s ease-out;\n }\n\n .superinterface-video-controls[data-visible] {\n opacity: 1;\n }\n "
|
|
1485
|
+
}),
|
|
1486
|
+
/* @__PURE__ */ jsx39(Flex11, {
|
|
1487
|
+
asChild: true,
|
|
1488
|
+
position: "absolute",
|
|
1489
|
+
bottom: "0",
|
|
1490
|
+
left: "0",
|
|
1491
|
+
right: "0",
|
|
1492
|
+
className: "superinterface-video-controls",
|
|
1493
|
+
p: "3",
|
|
1494
|
+
style: {
|
|
1495
|
+
zIndex: 10,
|
|
1496
|
+
background: "var(--accent-4)"
|
|
1497
|
+
},
|
|
1498
|
+
children: /* @__PURE__ */ jsx39(Controls.Root, {
|
|
1499
|
+
children: /* @__PURE__ */ jsx39(Flex11, {
|
|
1500
|
+
asChild: true,
|
|
1501
|
+
align: "center",
|
|
1502
|
+
gap: "3",
|
|
1503
|
+
flexGrow: "1",
|
|
1504
|
+
children: /* @__PURE__ */ jsxs11(Controls.Group, {
|
|
1505
|
+
children: [
|
|
1506
|
+
/* @__PURE__ */ jsx39(PlayButton, {}),
|
|
1507
|
+
/* @__PURE__ */ jsx39(Time, {}),
|
|
1508
|
+
/* @__PURE__ */ jsx39(VolumeButton, {}),
|
|
1509
|
+
/* @__PURE__ */ jsx39(FullscreenButton, {})
|
|
1510
|
+
]
|
|
1511
|
+
})
|
|
1512
|
+
})
|
|
1513
|
+
})
|
|
1514
|
+
})
|
|
1515
|
+
]
|
|
1516
|
+
})
|
|
1517
|
+
});
|
|
1518
|
+
};
|
|
1519
|
+
// src/contexts/markdown/MarkdownContext/lib/components/Img/Audio/index.tsx
|
|
1520
|
+
import { Flex as Flex12 } from "@radix-ui/themes";
|
|
1521
|
+
import "@vidstack/react/player/styles/base.css";
|
|
1522
|
+
import { MediaPlayer as MediaPlayer2, MediaProvider as MediaProvider2, Controls as Controls2 } from "@vidstack/react";
|
|
1523
|
+
import { jsx as jsx40, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1524
|
+
var Audio = function(param) {
|
|
1525
|
+
var src = param.src;
|
|
1526
|
+
return /* @__PURE__ */ jsx40(MediaContainer, {
|
|
1527
|
+
children: /* @__PURE__ */ jsxs12(MediaPlayer2, {
|
|
1528
|
+
src: src,
|
|
1529
|
+
viewType: "audio",
|
|
1530
|
+
crossOrigin: true,
|
|
1531
|
+
playsInline: true,
|
|
1532
|
+
children: [
|
|
1533
|
+
/* @__PURE__ */ jsx40(MediaProvider2, {}),
|
|
1534
|
+
/* @__PURE__ */ jsx40(Flex12, {
|
|
1535
|
+
asChild: true,
|
|
1536
|
+
p: "3",
|
|
1537
|
+
flexGrow: "1",
|
|
1538
|
+
style: {
|
|
1539
|
+
zIndex: 10,
|
|
1540
|
+
background: "var(--accent-4)"
|
|
1541
|
+
},
|
|
1542
|
+
children: /* @__PURE__ */ jsx40(Controls2.Root, {
|
|
1543
|
+
children: /* @__PURE__ */ jsx40(Flex12, {
|
|
1544
|
+
asChild: true,
|
|
1545
|
+
align: "center",
|
|
1546
|
+
gap: "3",
|
|
1547
|
+
flexGrow: "1",
|
|
1548
|
+
children: /* @__PURE__ */ jsxs12(Controls2.Group, {
|
|
1549
|
+
children: [
|
|
1550
|
+
/* @__PURE__ */ jsx40(PlayButton, {}),
|
|
1551
|
+
/* @__PURE__ */ jsx40(Time, {}),
|
|
1552
|
+
/* @__PURE__ */ jsx40(VolumeButton, {})
|
|
1553
|
+
]
|
|
1554
|
+
})
|
|
1555
|
+
})
|
|
1556
|
+
})
|
|
1557
|
+
})
|
|
1558
|
+
]
|
|
1559
|
+
})
|
|
1560
|
+
});
|
|
1561
|
+
};
|
|
1562
|
+
// src/contexts/markdown/MarkdownContext/lib/components/Img/ImageComponent.tsx
|
|
1563
|
+
import { Box as Box9 } from "@radix-ui/themes";
|
|
1564
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
1565
|
+
var ImageComponent = function(props) {
|
|
1566
|
+
return /* @__PURE__ */ jsx41(Box9, {
|
|
1330
1567
|
pb: "3",
|
|
1331
|
-
children: /* @__PURE__ */
|
|
1568
|
+
children: /* @__PURE__ */ jsx41("img", _object_spread_props(_object_spread({}, props), {
|
|
1332
1569
|
style: {
|
|
1333
1570
|
maxWidth: "100%",
|
|
1334
1571
|
height: "auto"
|
|
@@ -1336,28 +1573,49 @@ var Img = function(props) {
|
|
|
1336
1573
|
}))
|
|
1337
1574
|
});
|
|
1338
1575
|
};
|
|
1576
|
+
// src/contexts/markdown/MarkdownContext/lib/components/Img/index.tsx
|
|
1577
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
1578
|
+
var Img = function(props) {
|
|
1579
|
+
if (!props.src) {
|
|
1580
|
+
return /* @__PURE__ */ jsx42(ImageComponent, _object_spread({}, props));
|
|
1581
|
+
} else if (isVideoSrc({
|
|
1582
|
+
src: props.src
|
|
1583
|
+
})) {
|
|
1584
|
+
return /* @__PURE__ */ jsx42(Video, {
|
|
1585
|
+
src: props.src
|
|
1586
|
+
});
|
|
1587
|
+
} else if (isAudioSrc({
|
|
1588
|
+
src: props.src
|
|
1589
|
+
})) {
|
|
1590
|
+
return /* @__PURE__ */ jsx42(Audio, {
|
|
1591
|
+
src: props.src
|
|
1592
|
+
});
|
|
1593
|
+
} else {
|
|
1594
|
+
return /* @__PURE__ */ jsx42(ImageComponent, _object_spread({}, props));
|
|
1595
|
+
}
|
|
1596
|
+
};
|
|
1339
1597
|
// src/contexts/markdown/MarkdownContext/lib/components/Annotation/index.tsx
|
|
1340
1598
|
import { QuoteIcon } from "@radix-ui/react-icons";
|
|
1341
1599
|
// src/contexts/markdown/MarkdownContext/lib/components/Annotation/AnnotationBase.tsx
|
|
1342
|
-
import { IconButton, Popover as Popover4, Flex as
|
|
1343
|
-
import { jsx as
|
|
1600
|
+
import { IconButton as IconButton4, Popover as Popover4, Flex as Flex13, Text as Text5 } from "@radix-ui/themes";
|
|
1601
|
+
import { jsx as jsx43, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1344
1602
|
var AnnotationBase = function(param) {
|
|
1345
1603
|
var icon = param.icon, content = param.content;
|
|
1346
|
-
return /* @__PURE__ */
|
|
1604
|
+
return /* @__PURE__ */ jsxs13(Popover4.Root, {
|
|
1347
1605
|
children: [
|
|
1348
|
-
/* @__PURE__ */
|
|
1349
|
-
children: /* @__PURE__ */
|
|
1606
|
+
/* @__PURE__ */ jsx43(Popover4.Trigger, {
|
|
1607
|
+
children: /* @__PURE__ */ jsx43(IconButton4, {
|
|
1350
1608
|
variant: "soft",
|
|
1351
1609
|
color: "gray",
|
|
1352
1610
|
size: "1",
|
|
1353
1611
|
children: icon
|
|
1354
1612
|
})
|
|
1355
1613
|
}),
|
|
1356
|
-
/* @__PURE__ */
|
|
1614
|
+
/* @__PURE__ */ jsx43(Popover4.Content, {
|
|
1357
1615
|
size: "1",
|
|
1358
|
-
children: /* @__PURE__ */
|
|
1616
|
+
children: /* @__PURE__ */ jsx43(Flex13, {
|
|
1359
1617
|
direction: "column",
|
|
1360
|
-
children: /* @__PURE__ */
|
|
1618
|
+
children: /* @__PURE__ */ jsx43(Text5, {
|
|
1361
1619
|
size: "1",
|
|
1362
1620
|
color: "gray",
|
|
1363
1621
|
children: content
|
|
@@ -1368,12 +1626,12 @@ var AnnotationBase = function(param) {
|
|
|
1368
1626
|
});
|
|
1369
1627
|
};
|
|
1370
1628
|
// src/contexts/markdown/MarkdownContext/lib/components/Annotation/FilePathAnnotation.tsx
|
|
1371
|
-
import { jsx as
|
|
1629
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
1372
1630
|
var FilePathAnnotation = function(param) {
|
|
1373
1631
|
var annotation = param.annotation, children = param.children;
|
|
1374
1632
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
1375
1633
|
var nextSearchParams = new URLSearchParams(superinterfaceContext.variables);
|
|
1376
|
-
return /* @__PURE__ */
|
|
1634
|
+
return /* @__PURE__ */ jsx44(Link, {
|
|
1377
1635
|
href: "".concat(superinterfaceContext.baseUrl, "/files/").concat(annotation.file_path.file_id, "/contents?").concat(nextSearchParams),
|
|
1378
1636
|
target: "_self",
|
|
1379
1637
|
download: true,
|
|
@@ -1381,16 +1639,16 @@ var FilePathAnnotation = function(param) {
|
|
|
1381
1639
|
});
|
|
1382
1640
|
};
|
|
1383
1641
|
// src/contexts/markdown/MarkdownContext/lib/components/Annotation/index.tsx
|
|
1384
|
-
import { jsx as
|
|
1642
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
1385
1643
|
var Annotation = function(param) {
|
|
1386
1644
|
var annotation = param.annotation, children = param.children;
|
|
1387
1645
|
if (annotation.type === "file_citation") {
|
|
1388
|
-
return /* @__PURE__ */
|
|
1389
|
-
icon: /* @__PURE__ */
|
|
1646
|
+
return /* @__PURE__ */ jsx45(AnnotationBase, {
|
|
1647
|
+
icon: /* @__PURE__ */ jsx45(QuoteIcon, {}),
|
|
1390
1648
|
content: "File cited."
|
|
1391
1649
|
});
|
|
1392
1650
|
} else if (annotation.type === "file_path") {
|
|
1393
|
-
return /* @__PURE__ */
|
|
1651
|
+
return /* @__PURE__ */ jsx45(FilePathAnnotation, {
|
|
1394
1652
|
annotation: annotation,
|
|
1395
1653
|
children: children
|
|
1396
1654
|
});
|
|
@@ -1398,7 +1656,7 @@ var Annotation = function(param) {
|
|
|
1398
1656
|
return null;
|
|
1399
1657
|
};
|
|
1400
1658
|
// src/contexts/markdown/MarkdownContext/lib/components/index.tsx
|
|
1401
|
-
import { jsx as
|
|
1659
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
1402
1660
|
var components = {
|
|
1403
1661
|
p: Paragraph,
|
|
1404
1662
|
a: Link,
|
|
@@ -1411,47 +1669,60 @@ var components = {
|
|
|
1411
1669
|
img: Img,
|
|
1412
1670
|
annotation: Annotation,
|
|
1413
1671
|
h1: function(props) {
|
|
1414
|
-
return /* @__PURE__ */
|
|
1672
|
+
return /* @__PURE__ */ jsx46(Heading, {
|
|
1415
1673
|
as: "h1",
|
|
1416
1674
|
children: props.children
|
|
1417
1675
|
});
|
|
1418
1676
|
},
|
|
1419
1677
|
h2: function(props) {
|
|
1420
|
-
return /* @__PURE__ */
|
|
1678
|
+
return /* @__PURE__ */ jsx46(Heading, {
|
|
1421
1679
|
as: "h2",
|
|
1422
1680
|
size: "5",
|
|
1423
1681
|
children: props.children
|
|
1424
1682
|
});
|
|
1425
1683
|
},
|
|
1426
1684
|
h3: function(props) {
|
|
1427
|
-
return /* @__PURE__ */
|
|
1685
|
+
return /* @__PURE__ */ jsx46(Heading, {
|
|
1428
1686
|
as: "h3",
|
|
1429
1687
|
size: "4",
|
|
1430
1688
|
children: props.children
|
|
1431
1689
|
});
|
|
1432
1690
|
},
|
|
1433
1691
|
h4: function(props) {
|
|
1434
|
-
return /* @__PURE__ */
|
|
1692
|
+
return /* @__PURE__ */ jsx46(Heading, {
|
|
1435
1693
|
as: "h4",
|
|
1436
1694
|
size: "3",
|
|
1437
1695
|
children: props.children
|
|
1438
1696
|
});
|
|
1439
1697
|
},
|
|
1440
1698
|
h5: function(props) {
|
|
1441
|
-
return /* @__PURE__ */
|
|
1699
|
+
return /* @__PURE__ */ jsx46(Heading, {
|
|
1442
1700
|
as: "h5",
|
|
1443
1701
|
size: "3",
|
|
1444
1702
|
children: props.children
|
|
1445
1703
|
});
|
|
1446
1704
|
},
|
|
1447
1705
|
h6: function(props) {
|
|
1448
|
-
return /* @__PURE__ */
|
|
1706
|
+
return /* @__PURE__ */ jsx46(Heading, {
|
|
1449
1707
|
as: "h6",
|
|
1450
1708
|
size: "3",
|
|
1451
1709
|
children: props.children
|
|
1452
1710
|
});
|
|
1453
|
-
}
|
|
1711
|
+
},
|
|
1712
|
+
table: function(props) {
|
|
1713
|
+
return /* @__PURE__ */ jsx46(Table.Root, _object_spread_props(_object_spread({}, props), {
|
|
1714
|
+
variant: "surface",
|
|
1715
|
+
mb: "3"
|
|
1716
|
+
}));
|
|
1717
|
+
},
|
|
1718
|
+
thead: Table.Header,
|
|
1719
|
+
tbody: Table.Body,
|
|
1720
|
+
tr: Table.Row,
|
|
1721
|
+
td: Table.Cell,
|
|
1722
|
+
th: Table.ColumnHeaderCell
|
|
1454
1723
|
};
|
|
1724
|
+
// src/contexts/markdown/MarkdownContext/lib/getRemarkPlugins.ts
|
|
1725
|
+
import remarkGfm from "remark-gfm";
|
|
1455
1726
|
// src/lib/remark/remarkAnnotation.ts
|
|
1456
1727
|
import { isNumber } from "radash";
|
|
1457
1728
|
import flatMap from "unist-util-flatmap";
|
|
@@ -1618,7 +1889,8 @@ var getRemarkPlugins = function(param) {
|
|
|
1618
1889
|
return [
|
|
1619
1890
|
remarkAnnotation({
|
|
1620
1891
|
content: content
|
|
1621
|
-
})
|
|
1892
|
+
}),
|
|
1893
|
+
remarkGfm
|
|
1622
1894
|
];
|
|
1623
1895
|
};
|
|
1624
1896
|
// src/contexts/markdown/MarkdownContext/index.ts
|
|
@@ -1631,13 +1903,13 @@ var useMarkdownContext = function() {
|
|
|
1631
1903
|
return useContext7(MarkdownContext);
|
|
1632
1904
|
};
|
|
1633
1905
|
// src/components/threads/Thread/Message/TextContent.tsx
|
|
1634
|
-
import { jsx as
|
|
1906
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
1635
1907
|
var TextContent = function(param) {
|
|
1636
1908
|
var content = param.content;
|
|
1637
1909
|
var _useMarkdownContext = useMarkdownContext(), getRemarkPlugins2 = _useMarkdownContext.getRemarkPlugins, rest = _object_without_properties(_useMarkdownContext, [
|
|
1638
1910
|
"getRemarkPlugins"
|
|
1639
1911
|
]);
|
|
1640
|
-
return /* @__PURE__ */
|
|
1912
|
+
return /* @__PURE__ */ jsx47(Markdown, _object_spread_props(_object_spread({}, rest), {
|
|
1641
1913
|
remarkPlugins: getRemarkPlugins2({
|
|
1642
1914
|
content: content
|
|
1643
1915
|
}),
|
|
@@ -1645,21 +1917,21 @@ var TextContent = function(param) {
|
|
|
1645
1917
|
}));
|
|
1646
1918
|
};
|
|
1647
1919
|
// src/components/threads/Thread/Message/Attachments/index.tsx
|
|
1648
|
-
import { Flex as
|
|
1920
|
+
import { Flex as Flex14, Badge } from "@radix-ui/themes";
|
|
1649
1921
|
import { FileIcon } from "@radix-ui/react-icons";
|
|
1650
|
-
import { jsx as
|
|
1922
|
+
import { jsx as jsx48, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1651
1923
|
var Attachments = function(param) {
|
|
1652
1924
|
var message = param.message;
|
|
1653
1925
|
var _message_attachments;
|
|
1654
1926
|
if (!((_message_attachments = message.attachments) === null || _message_attachments === void 0 ? void 0 : _message_attachments.length)) return null;
|
|
1655
|
-
return /* @__PURE__ */
|
|
1927
|
+
return /* @__PURE__ */ jsx48(Flex14, {
|
|
1656
1928
|
align: "start",
|
|
1657
1929
|
pb: "1",
|
|
1658
|
-
children: /* @__PURE__ */
|
|
1930
|
+
children: /* @__PURE__ */ jsxs14(Badge, {
|
|
1659
1931
|
color: "gray",
|
|
1660
1932
|
variant: "surface",
|
|
1661
1933
|
children: [
|
|
1662
|
-
/* @__PURE__ */
|
|
1934
|
+
/* @__PURE__ */ jsx48(FileIcon, {}),
|
|
1663
1935
|
message.attachments.length,
|
|
1664
1936
|
" file",
|
|
1665
1937
|
message.attachments.length > 1 ? "s" : ""
|
|
@@ -1668,10 +1940,10 @@ var Attachments = function(param) {
|
|
|
1668
1940
|
});
|
|
1669
1941
|
};
|
|
1670
1942
|
// src/components/threads/Thread/Message/index.tsx
|
|
1671
|
-
import { jsx as
|
|
1943
|
+
import { jsx as jsx49, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1672
1944
|
var Message = function(param) {
|
|
1673
1945
|
var message = param.message;
|
|
1674
|
-
var
|
|
1946
|
+
var _useMemo6 = _sliced_to_array(useMemo6(function() {
|
|
1675
1947
|
if (!message.runSteps.length) return [
|
|
1676
1948
|
[],
|
|
1677
1949
|
[]
|
|
@@ -1702,9 +1974,9 @@ var Message = function(param) {
|
|
|
1702
1974
|
];
|
|
1703
1975
|
}, [
|
|
1704
1976
|
message
|
|
1705
|
-
]), 2), olderRunSteps =
|
|
1977
|
+
]), 2), olderRunSteps = _useMemo6[0], laterRunSteps = _useMemo6[1];
|
|
1706
1978
|
var isMutatingMessage = useIsMutatingMessage();
|
|
1707
|
-
var isInProgress =
|
|
1979
|
+
var isInProgress = useMemo6(function() {
|
|
1708
1980
|
if (!isMutatingMessage) return false;
|
|
1709
1981
|
if (message.status === "in_progress") return true;
|
|
1710
1982
|
return message.runSteps.some(function(rs) {
|
|
@@ -1713,68 +1985,68 @@ var Message = function(param) {
|
|
|
1713
1985
|
}, [
|
|
1714
1986
|
message
|
|
1715
1987
|
]);
|
|
1716
|
-
return /* @__PURE__ */
|
|
1988
|
+
return /* @__PURE__ */ jsx49(Provider, {
|
|
1717
1989
|
value: {
|
|
1718
1990
|
message: message
|
|
1719
1991
|
},
|
|
1720
|
-
children: /* @__PURE__ */
|
|
1992
|
+
children: /* @__PURE__ */ jsxs15(Box10, {
|
|
1721
1993
|
children: [
|
|
1722
|
-
/* @__PURE__ */
|
|
1994
|
+
/* @__PURE__ */ jsx49(RunSteps, {
|
|
1723
1995
|
runSteps: olderRunSteps
|
|
1724
1996
|
}),
|
|
1725
|
-
/* @__PURE__ */
|
|
1997
|
+
/* @__PURE__ */ jsxs15(Box10, {
|
|
1726
1998
|
children: [
|
|
1727
|
-
/* @__PURE__ */
|
|
1999
|
+
/* @__PURE__ */ jsx49(Attachments, {
|
|
1728
2000
|
message: message
|
|
1729
2001
|
}),
|
|
1730
2002
|
message.content.map(function(content, index) {
|
|
1731
|
-
return /* @__PURE__ */
|
|
1732
|
-
children: content.type === "text" && /* @__PURE__ */
|
|
2003
|
+
return /* @__PURE__ */ jsx49(Fragment, {
|
|
2004
|
+
children: content.type === "text" && /* @__PURE__ */ jsx49(TextContent, {
|
|
1733
2005
|
content: content
|
|
1734
2006
|
})
|
|
1735
2007
|
}, index);
|
|
1736
2008
|
}),
|
|
1737
|
-
isInProgress && isEmpty(laterRunSteps) && /* @__PURE__ */
|
|
2009
|
+
isInProgress && isEmpty(laterRunSteps) && /* @__PURE__ */ jsx49(StartingContentSkeleton, {})
|
|
1738
2010
|
]
|
|
1739
2011
|
}),
|
|
1740
|
-
/* @__PURE__ */
|
|
2012
|
+
/* @__PURE__ */ jsx49(RunSteps, {
|
|
1741
2013
|
runSteps: laterRunSteps
|
|
1742
2014
|
}),
|
|
1743
|
-
isInProgress && !isEmpty(laterRunSteps) && /* @__PURE__ */
|
|
1744
|
-
children: /* @__PURE__ */
|
|
2015
|
+
isInProgress && !isEmpty(laterRunSteps) && /* @__PURE__ */ jsx49(Box10, {
|
|
2016
|
+
children: /* @__PURE__ */ jsx49(StartingContentSkeleton, {})
|
|
1745
2017
|
})
|
|
1746
2018
|
]
|
|
1747
2019
|
})
|
|
1748
2020
|
});
|
|
1749
2021
|
};
|
|
1750
2022
|
// src/components/threads/Thread/Messages/Content/MessageGroup/Content/index.tsx
|
|
1751
|
-
import { jsx as
|
|
2023
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
1752
2024
|
var Content3 = function(param) {
|
|
1753
2025
|
var messageGroup = param.messageGroup;
|
|
1754
|
-
return /* @__PURE__ */
|
|
2026
|
+
return /* @__PURE__ */ jsx50(Flex15, {
|
|
1755
2027
|
direction: "column-reverse",
|
|
1756
2028
|
children: messageGroup.messages.map(function(message) {
|
|
1757
|
-
return /* @__PURE__ */
|
|
2029
|
+
return /* @__PURE__ */ jsx50(Message, {
|
|
1758
2030
|
message: message
|
|
1759
2031
|
}, message.id);
|
|
1760
2032
|
})
|
|
1761
2033
|
});
|
|
1762
2034
|
};
|
|
1763
2035
|
// src/components/threads/Thread/Messages/Content/MessageGroup/index.tsx
|
|
1764
|
-
import { jsx as
|
|
2036
|
+
import { jsx as jsx51, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1765
2037
|
var MessageGroup = function(param) {
|
|
1766
2038
|
var messageGroup = param.messageGroup;
|
|
1767
2039
|
var assistantNameContext = useContext8(AssistantNameContext);
|
|
1768
|
-
return /* @__PURE__ */
|
|
2040
|
+
return /* @__PURE__ */ jsxs16(MessageGroupBase, {
|
|
1769
2041
|
children: [
|
|
1770
|
-
messageGroup.role === "user" ? /* @__PURE__ */
|
|
1771
|
-
/* @__PURE__ */
|
|
2042
|
+
messageGroup.role === "user" ? /* @__PURE__ */ jsx51(UserAvatar, {}) : /* @__PURE__ */ jsx51(AssistantAvatar, {}),
|
|
2043
|
+
/* @__PURE__ */ jsxs16(Box11, {
|
|
1772
2044
|
flexGrow: "1",
|
|
1773
2045
|
children: [
|
|
1774
|
-
/* @__PURE__ */
|
|
2046
|
+
/* @__PURE__ */ jsx51(Name, {
|
|
1775
2047
|
children: messageGroup.role === "user" ? "You" : assistantNameContext
|
|
1776
2048
|
}),
|
|
1777
|
-
/* @__PURE__ */
|
|
2049
|
+
/* @__PURE__ */ jsx51(Content3, {
|
|
1778
2050
|
messageGroup: messageGroup
|
|
1779
2051
|
})
|
|
1780
2052
|
]
|
|
@@ -1783,14 +2055,14 @@ var MessageGroup = function(param) {
|
|
|
1783
2055
|
});
|
|
1784
2056
|
};
|
|
1785
2057
|
// src/components/threads/Thread/Messages/Content/index.tsx
|
|
1786
|
-
import { Fragment as Fragment2, jsx as
|
|
2058
|
+
import { Fragment as Fragment2, jsx as jsx52 } from "react/jsx-runtime";
|
|
1787
2059
|
var Content4 = function() {
|
|
1788
2060
|
var _useMessages = useMessages(), messages2 = _useMessages.messages, isLoading = _useMessages.isLoading, isLoadingError = _useMessages.isLoadingError;
|
|
1789
2061
|
var addToast = useToasts().addToast;
|
|
1790
2062
|
var _useMessageGroups = useMessageGroups({
|
|
1791
2063
|
messages: messages2
|
|
1792
2064
|
}), messageGroups2 = _useMessageGroups.messageGroups;
|
|
1793
|
-
|
|
2065
|
+
useEffect2(function() {
|
|
1794
2066
|
if (isLoadingError) {
|
|
1795
2067
|
addToast({
|
|
1796
2068
|
type: "error",
|
|
@@ -1802,45 +2074,45 @@ var Content4 = function() {
|
|
|
1802
2074
|
addToast
|
|
1803
2075
|
]);
|
|
1804
2076
|
if (isLoading || isLoadingError) {
|
|
1805
|
-
return /* @__PURE__ */
|
|
2077
|
+
return /* @__PURE__ */ jsx52(MessagesSkeleton, {});
|
|
1806
2078
|
}
|
|
1807
|
-
return /* @__PURE__ */
|
|
2079
|
+
return /* @__PURE__ */ jsx52(Fragment2, {
|
|
1808
2080
|
children: messageGroups2.map(function(messageGroup) {
|
|
1809
|
-
return /* @__PURE__ */
|
|
2081
|
+
return /* @__PURE__ */ jsx52(MessageGroup, {
|
|
1810
2082
|
messageGroup: messageGroup
|
|
1811
2083
|
}, messageGroup.id);
|
|
1812
2084
|
})
|
|
1813
2085
|
});
|
|
1814
2086
|
};
|
|
1815
2087
|
// src/components/threads/Thread/Messages/Progress/index.tsx
|
|
1816
|
-
import { useMemo as
|
|
2088
|
+
import { useMemo as useMemo8 } from "react";
|
|
1817
2089
|
// src/components/skeletons/StartingSkeleton/index.tsx
|
|
1818
2090
|
import { useContext as useContext9 } from "react";
|
|
1819
2091
|
import { Box as Box12 } from "@radix-ui/themes";
|
|
1820
|
-
import { jsx as
|
|
2092
|
+
import { jsx as jsx53, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1821
2093
|
var StartingSkeleton = function(param) {
|
|
1822
2094
|
var children = param.children;
|
|
1823
2095
|
var assistantNameContext = useContext9(AssistantNameContext);
|
|
1824
|
-
return /* @__PURE__ */
|
|
2096
|
+
return /* @__PURE__ */ jsxs17(MessageGroupBase, {
|
|
1825
2097
|
children: [
|
|
1826
|
-
/* @__PURE__ */
|
|
1827
|
-
/* @__PURE__ */
|
|
2098
|
+
/* @__PURE__ */ jsx53(AssistantAvatar, {}),
|
|
2099
|
+
/* @__PURE__ */ jsxs17(Box12, {
|
|
1828
2100
|
children: [
|
|
1829
|
-
/* @__PURE__ */
|
|
2101
|
+
/* @__PURE__ */ jsx53(Name, {
|
|
1830
2102
|
children: assistantNameContext
|
|
1831
2103
|
}),
|
|
1832
2104
|
children,
|
|
1833
|
-
/* @__PURE__ */
|
|
2105
|
+
/* @__PURE__ */ jsx53(StartingContentSkeleton, {})
|
|
1834
2106
|
]
|
|
1835
2107
|
})
|
|
1836
2108
|
]
|
|
1837
2109
|
});
|
|
1838
2110
|
};
|
|
1839
2111
|
// src/hooks/messages/useLatestMessage/index.ts
|
|
1840
|
-
import { useMemo as
|
|
2112
|
+
import { useMemo as useMemo7 } from "react";
|
|
1841
2113
|
var useLatestMessage = function() {
|
|
1842
2114
|
var props = useMessages();
|
|
1843
|
-
return
|
|
2115
|
+
return useMemo7(function() {
|
|
1844
2116
|
return _object_spread_props(_object_spread({}, props), {
|
|
1845
2117
|
latestMessage: props.messages[0] || null
|
|
1846
2118
|
});
|
|
@@ -1855,11 +2127,11 @@ var isOptimistic = function(param) {
|
|
|
1855
2127
|
return _4.startsWith(id, "-");
|
|
1856
2128
|
};
|
|
1857
2129
|
// src/components/threads/Thread/Messages/Progress/index.tsx
|
|
1858
|
-
import { jsx as
|
|
2130
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
1859
2131
|
var Progress = function() {
|
|
1860
2132
|
var latestMessage = useLatestMessage().latestMessage;
|
|
1861
2133
|
var isMutatingMessage = useIsMutatingMessage();
|
|
1862
|
-
var isVisible =
|
|
2134
|
+
var isVisible = useMemo8(function() {
|
|
1863
2135
|
if (!latestMessage) return false;
|
|
1864
2136
|
if (latestMessage.role !== "user") return false;
|
|
1865
2137
|
if (latestMessage.status === "in_progress") return false;
|
|
@@ -1873,16 +2145,16 @@ var Progress = function() {
|
|
|
1873
2145
|
isMutatingMessage
|
|
1874
2146
|
]);
|
|
1875
2147
|
if (!isVisible) return null;
|
|
1876
|
-
return /* @__PURE__ */
|
|
2148
|
+
return /* @__PURE__ */ jsx54(StartingSkeleton, {});
|
|
1877
2149
|
};
|
|
1878
2150
|
// src/components/threads/Thread/Messages/Root/index.tsx
|
|
1879
|
-
import { Flex as
|
|
2151
|
+
import { Flex as Flex16 } from "@radix-ui/themes";
|
|
1880
2152
|
// src/hooks/misc/useInfiniteScroll/index.tsx
|
|
1881
2153
|
import { useRef as useRef3 } from "react";
|
|
1882
2154
|
import { useInView } from "react-intersection-observer";
|
|
1883
2155
|
// src/hooks/misc/useThrottledEffect/index.tsx
|
|
1884
2156
|
import _5 from "lodash";
|
|
1885
|
-
import { useRef as useRef2, useEffect as
|
|
2157
|
+
import { useRef as useRef2, useEffect as useEffect3, useCallback } from "react";
|
|
1886
2158
|
var useThrottledEffect = function(cb, delay, additionalDeps) {
|
|
1887
2159
|
var _cbRef;
|
|
1888
2160
|
var cbRef = useRef2(cb);
|
|
@@ -1897,10 +2169,10 @@ var useThrottledEffect = function(cb, delay, additionalDeps) {
|
|
|
1897
2169
|
}), [
|
|
1898
2170
|
delay
|
|
1899
2171
|
]);
|
|
1900
|
-
|
|
2172
|
+
useEffect3(function() {
|
|
1901
2173
|
cbRef.current = cb;
|
|
1902
2174
|
});
|
|
1903
|
-
|
|
2175
|
+
useEffect3(throttledCb, [
|
|
1904
2176
|
throttledCb
|
|
1905
2177
|
].concat(_to_consumable_array(additionalDeps)));
|
|
1906
2178
|
};
|
|
@@ -1931,7 +2203,7 @@ var useInfiniteScroll = function(param) {
|
|
|
1931
2203
|
};
|
|
1932
2204
|
};
|
|
1933
2205
|
// src/components/threads/Thread/Messages/Root/index.tsx
|
|
1934
|
-
import { jsx as
|
|
2206
|
+
import { jsx as jsx55, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1935
2207
|
var Root2 = function(param) {
|
|
1936
2208
|
var children = param.children, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
|
|
1937
2209
|
var _useMessages = useMessages(), isFetchingNextPage = _useMessages.isFetchingNextPage, hasNextPage = _useMessages.hasNextPage, fetchNextPage = _useMessages.fetchNextPage;
|
|
@@ -1940,7 +2212,7 @@ var Root2 = function(param) {
|
|
|
1940
2212
|
hasNextPage: hasNextPage,
|
|
1941
2213
|
fetchNextPage: fetchNextPage
|
|
1942
2214
|
}), containerRef = _useInfiniteScroll.containerRef, loaderRef = _useInfiniteScroll.loaderRef;
|
|
1943
|
-
return /* @__PURE__ */
|
|
2215
|
+
return /* @__PURE__ */ jsxs18(Flex16, {
|
|
1944
2216
|
ref: containerRef,
|
|
1945
2217
|
direction: "column-reverse",
|
|
1946
2218
|
flexGrow: "1",
|
|
@@ -1949,10 +2221,10 @@ var Root2 = function(param) {
|
|
|
1949
2221
|
}),
|
|
1950
2222
|
children: [
|
|
1951
2223
|
children,
|
|
1952
|
-
hasNextPage && /* @__PURE__ */
|
|
2224
|
+
hasNextPage && /* @__PURE__ */ jsx55(Flex16, {
|
|
1953
2225
|
ref: loaderRef
|
|
1954
2226
|
}),
|
|
1955
|
-
/* @__PURE__ */
|
|
2227
|
+
/* @__PURE__ */ jsx55(Flex16, {
|
|
1956
2228
|
flexShrink: "0",
|
|
1957
2229
|
flexGrow: "1"
|
|
1958
2230
|
})
|
|
@@ -1960,30 +2232,30 @@ var Root2 = function(param) {
|
|
|
1960
2232
|
});
|
|
1961
2233
|
};
|
|
1962
2234
|
// src/components/threads/Thread/Messages/NextPageSkeleton.tsx
|
|
1963
|
-
import { jsx as
|
|
2235
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
1964
2236
|
var NextPageSkeleton = function() {
|
|
1965
2237
|
var hasNextPage = useMessages().hasNextPage;
|
|
1966
2238
|
if (!hasNextPage) {
|
|
1967
2239
|
return null;
|
|
1968
2240
|
}
|
|
1969
|
-
return /* @__PURE__ */
|
|
2241
|
+
return /* @__PURE__ */ jsx56(MessagesSkeleton, {});
|
|
1970
2242
|
};
|
|
1971
2243
|
// src/components/threads/Thread/Messages/index.tsx
|
|
1972
|
-
import { jsx as
|
|
2244
|
+
import { jsx as jsx57, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1973
2245
|
var Messages = function(param) {
|
|
1974
2246
|
var children = param.children, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
|
|
1975
|
-
return /* @__PURE__ */
|
|
2247
|
+
return /* @__PURE__ */ jsxs19(Root2, {
|
|
1976
2248
|
style: style,
|
|
1977
2249
|
children: [
|
|
1978
|
-
/* @__PURE__ */
|
|
2250
|
+
/* @__PURE__ */ jsx57(Flex17, {
|
|
1979
2251
|
flexShrink: "0",
|
|
1980
2252
|
height: "var(--space-3)"
|
|
1981
2253
|
}),
|
|
1982
|
-
/* @__PURE__ */
|
|
2254
|
+
/* @__PURE__ */ jsx57(Progress, {}),
|
|
1983
2255
|
children,
|
|
1984
|
-
/* @__PURE__ */
|
|
1985
|
-
/* @__PURE__ */
|
|
1986
|
-
/* @__PURE__ */
|
|
2256
|
+
/* @__PURE__ */ jsx57(Content4, {}),
|
|
2257
|
+
/* @__PURE__ */ jsx57(NextPageSkeleton, {}),
|
|
2258
|
+
/* @__PURE__ */ jsx57(Flex17, {
|
|
1987
2259
|
flexShrink: "0",
|
|
1988
2260
|
flexGrow: "1",
|
|
1989
2261
|
minHeight: "var(--space-5)"
|
|
@@ -1996,7 +2268,7 @@ Messages.Message = Message;
|
|
|
1996
2268
|
Messages.NextPageSkeleton = NextPageSkeleton;
|
|
1997
2269
|
// src/components/threads/Thread/MessageForm/Submit/index.tsx
|
|
1998
2270
|
import { ArrowUpIcon, StopIcon } from "@radix-ui/react-icons";
|
|
1999
|
-
import { IconButton as
|
|
2271
|
+
import { IconButton as IconButton5, Flex as Flex18 } from "@radix-ui/themes";
|
|
2000
2272
|
// src/hooks/messages/useMessageFormContext/index.ts
|
|
2001
2273
|
import { useContext as useContext10 } from "react";
|
|
2002
2274
|
// src/contexts/messages/MessageFormContext/index.ts
|
|
@@ -2014,10 +2286,10 @@ var useMessageFormContext = function() {
|
|
|
2014
2286
|
return useContext10(MessageFormContext);
|
|
2015
2287
|
};
|
|
2016
2288
|
// src/components/threads/Thread/MessageForm/Submit/index.tsx
|
|
2017
|
-
import { jsx as
|
|
2289
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
2018
2290
|
var Root3 = function(param) {
|
|
2019
2291
|
var children = param.children;
|
|
2020
|
-
return /* @__PURE__ */
|
|
2292
|
+
return /* @__PURE__ */ jsx58(Flex18, {
|
|
2021
2293
|
flexShrink: "0",
|
|
2022
2294
|
align: "end",
|
|
2023
2295
|
children: children
|
|
@@ -2027,31 +2299,31 @@ var Button2 = function() {
|
|
|
2027
2299
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
2028
2300
|
var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading, isFileLoading = _useMessageFormContext.isFileLoading;
|
|
2029
2301
|
if (isLoading) {
|
|
2030
|
-
return /* @__PURE__ */
|
|
2302
|
+
return /* @__PURE__ */ jsx58(IconButton5, {
|
|
2031
2303
|
type: "button",
|
|
2032
2304
|
onClick: function() {
|
|
2033
2305
|
var _superinterfaceContext_createMessageAbortControllerRef_current;
|
|
2034
2306
|
return (_superinterfaceContext_createMessageAbortControllerRef_current = superinterfaceContext.createMessageAbortControllerRef.current) === null || _superinterfaceContext_createMessageAbortControllerRef_current === void 0 ? void 0 : _superinterfaceContext_createMessageAbortControllerRef_current.abort();
|
|
2035
2307
|
},
|
|
2036
|
-
children: /* @__PURE__ */
|
|
2308
|
+
children: /* @__PURE__ */ jsx58(StopIcon, {})
|
|
2037
2309
|
});
|
|
2038
2310
|
}
|
|
2039
|
-
return /* @__PURE__ */
|
|
2311
|
+
return /* @__PURE__ */ jsx58(IconButton5, {
|
|
2040
2312
|
type: "submit",
|
|
2041
2313
|
disabled: isDisabled || isFileLoading,
|
|
2042
|
-
children: /* @__PURE__ */
|
|
2314
|
+
children: /* @__PURE__ */ jsx58(ArrowUpIcon, {})
|
|
2043
2315
|
});
|
|
2044
2316
|
};
|
|
2045
2317
|
var Submit = function() {
|
|
2046
|
-
return /* @__PURE__ */
|
|
2047
|
-
children: /* @__PURE__ */
|
|
2318
|
+
return /* @__PURE__ */ jsx58(Root3, {
|
|
2319
|
+
children: /* @__PURE__ */ jsx58(Button2, {})
|
|
2048
2320
|
});
|
|
2049
2321
|
};
|
|
2050
2322
|
Submit.Root = Root3;
|
|
2051
2323
|
Submit.Button = Button2;
|
|
2052
2324
|
// src/components/threads/Thread/MessageForm/Root/index.tsx
|
|
2053
2325
|
import { useQueryClient as useQueryClient4 } from "@tanstack/react-query";
|
|
2054
|
-
import { useMemo as
|
|
2326
|
+
import { useMemo as useMemo9, useState as useState2 } from "react";
|
|
2055
2327
|
import { useForm, FormProvider } from "react-hook-form";
|
|
2056
2328
|
import { Box as Box13 } from "@radix-ui/themes";
|
|
2057
2329
|
// src/hooks/messages/useCreateMessage/index.ts
|
|
@@ -2821,10 +3093,10 @@ var createMessageDefaultOnError = function(param) {
|
|
|
2821
3093
|
};
|
|
2822
3094
|
};
|
|
2823
3095
|
// src/components/threads/Thread/MessageForm/Root/index.tsx
|
|
2824
|
-
import { jsx as
|
|
3096
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
2825
3097
|
var Root4 = function(param) {
|
|
2826
3098
|
var children = param.children, onSubmitArg = param.onSubmit, isDisabledArg = param.isDisabled;
|
|
2827
|
-
var
|
|
3099
|
+
var _useState2 = _sliced_to_array(useState2([]), 2), files = _useState2[0], setFiles = _useState2[1];
|
|
2828
3100
|
var formProps = useForm(formOptions);
|
|
2829
3101
|
var handleSubmit = formProps.handleSubmit, isSubmitting = formProps.formState.isSubmitting, reset = formProps.reset, watch = formProps.watch;
|
|
2830
3102
|
var addToast = useToasts().addToast;
|
|
@@ -2838,7 +3110,7 @@ var Root4 = function(param) {
|
|
|
2838
3110
|
})
|
|
2839
3111
|
}).createMessage;
|
|
2840
3112
|
var isMutatingMessage = useIsMutatingMessage();
|
|
2841
|
-
var isFileLoading =
|
|
3113
|
+
var isFileLoading = useMemo9(function() {
|
|
2842
3114
|
return files.some(function(file) {
|
|
2843
3115
|
return isOptimistic({
|
|
2844
3116
|
id: file.id
|
|
@@ -2847,14 +3119,14 @@ var Root4 = function(param) {
|
|
|
2847
3119
|
}, [
|
|
2848
3120
|
files
|
|
2849
3121
|
]);
|
|
2850
|
-
var isLoading =
|
|
3122
|
+
var isLoading = useMemo9(function() {
|
|
2851
3123
|
return isMutatingMessage || isSubmitting;
|
|
2852
3124
|
}, [
|
|
2853
3125
|
isMutatingMessage,
|
|
2854
3126
|
isSubmitting
|
|
2855
3127
|
]);
|
|
2856
3128
|
var latestMessage = useLatestMessage().latestMessage;
|
|
2857
|
-
var isDisabled =
|
|
3129
|
+
var isDisabled = useMemo9(function() {
|
|
2858
3130
|
var // @ts-ignore-next-line
|
|
2859
3131
|
_latestMessage_metadata;
|
|
2860
3132
|
return (latestMessage === null || latestMessage === void 0 ? void 0 : (_latestMessage_metadata = latestMessage.metadata) === null || _latestMessage_metadata === void 0 ? void 0 : _latestMessage_metadata.isBlocking) || isDisabledArg;
|
|
@@ -2914,7 +3186,7 @@ var Root4 = function(param) {
|
|
|
2914
3186
|
};
|
|
2915
3187
|
}();
|
|
2916
3188
|
var content = watch("content");
|
|
2917
|
-
return /* @__PURE__ */
|
|
3189
|
+
return /* @__PURE__ */ jsx59(MessageFormContext.Provider, {
|
|
2918
3190
|
value: {
|
|
2919
3191
|
isDisabled: isDisabled,
|
|
2920
3192
|
isLoading: isLoading,
|
|
@@ -2923,11 +3195,11 @@ var Root4 = function(param) {
|
|
|
2923
3195
|
isFileLoading: isFileLoading,
|
|
2924
3196
|
content: content
|
|
2925
3197
|
},
|
|
2926
|
-
children: /* @__PURE__ */
|
|
2927
|
-
children: /* @__PURE__ */
|
|
3198
|
+
children: /* @__PURE__ */ jsx59(FormProvider, _object_spread_props(_object_spread({}, formProps), {
|
|
3199
|
+
children: /* @__PURE__ */ jsx59(Box13, {
|
|
2928
3200
|
asChild: true,
|
|
2929
3201
|
flexShrink: "0",
|
|
2930
|
-
children: /* @__PURE__ */
|
|
3202
|
+
children: /* @__PURE__ */ jsx59("form", {
|
|
2931
3203
|
onSubmit: handleSubmit(onSubmit),
|
|
2932
3204
|
children: children
|
|
2933
3205
|
})
|
|
@@ -2937,32 +3209,32 @@ var Root4 = function(param) {
|
|
|
2937
3209
|
};
|
|
2938
3210
|
// src/components/threads/Thread/MessageForm/Field/index.tsx
|
|
2939
3211
|
import { useFormContext as useFormContext2 } from "react-hook-form";
|
|
2940
|
-
import { Container as RadixContainer, Flex as
|
|
3212
|
+
import { Container as RadixContainer, Flex as Flex22 } from "@radix-ui/themes";
|
|
2941
3213
|
// src/components/threads/Thread/MessageForm/Field/Control.tsx
|
|
2942
|
-
import { Flex as
|
|
3214
|
+
import { Flex as Flex19 } from "@radix-ui/themes";
|
|
2943
3215
|
import { useFormContext } from "react-hook-form";
|
|
2944
3216
|
// src/hooks/misc/usePrevious.ts
|
|
2945
|
-
import { useEffect as
|
|
3217
|
+
import { useEffect as useEffect4, useRef as useRef4 } from "react";
|
|
2946
3218
|
var usePrevious = function(state) {
|
|
2947
3219
|
var ref = useRef4();
|
|
2948
|
-
|
|
3220
|
+
useEffect4(function() {
|
|
2949
3221
|
ref.current = state;
|
|
2950
3222
|
});
|
|
2951
3223
|
return ref.current;
|
|
2952
3224
|
};
|
|
2953
3225
|
// src/components/threads/Thread/MessageForm/Field/Control.tsx
|
|
2954
|
-
import { useContext as useContext11, useMemo as
|
|
3226
|
+
import { useContext as useContext11, useMemo as useMemo10, useRef as useRef5, useEffect as useEffect5 } from "react";
|
|
2955
3227
|
// src/components/textareas/TextareaBase/index.tsx
|
|
2956
3228
|
import { forwardRef as forwardRef3 } from "react";
|
|
2957
3229
|
import TextareaAutosize from "react-textarea-autosize";
|
|
2958
|
-
import { Fragment as Fragment3, jsx as
|
|
3230
|
+
import { Fragment as Fragment3, jsx as jsx60, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2959
3231
|
var TextareaBase = forwardRef3(function TextareaBase2(props, ref) {
|
|
2960
|
-
return /* @__PURE__ */
|
|
3232
|
+
return /* @__PURE__ */ jsxs20(Fragment3, {
|
|
2961
3233
|
children: [
|
|
2962
|
-
/* @__PURE__ */
|
|
3234
|
+
/* @__PURE__ */ jsx60("style", {
|
|
2963
3235
|
children: ".superinterface-textarea { min-height: inherit; height: 30px; }\n.superinterface-textarea::placeholder { color: var(--gray-a10); }"
|
|
2964
3236
|
}),
|
|
2965
|
-
/* @__PURE__ */
|
|
3237
|
+
/* @__PURE__ */ jsx60(TextareaAutosize, _object_spread({
|
|
2966
3238
|
ref: ref,
|
|
2967
3239
|
className: "rt-reset superinterface-textarea",
|
|
2968
3240
|
style: {
|
|
@@ -2979,10 +3251,10 @@ var TextareaBase = forwardRef3(function TextareaBase2(props, ref) {
|
|
|
2979
3251
|
});
|
|
2980
3252
|
});
|
|
2981
3253
|
// src/components/threads/Thread/MessageForm/Field/Control.tsx
|
|
2982
|
-
import { jsx as
|
|
3254
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
2983
3255
|
var Root5 = function(param) {
|
|
2984
3256
|
var children = param.children;
|
|
2985
|
-
return /* @__PURE__ */
|
|
3257
|
+
return /* @__PURE__ */ jsx61(Flex19, {
|
|
2986
3258
|
flexGrow: "1",
|
|
2987
3259
|
pt: "4px",
|
|
2988
3260
|
children: children
|
|
@@ -2992,7 +3264,7 @@ var Input = function() {
|
|
|
2992
3264
|
var assistantNameContext = useContext11(AssistantNameContext);
|
|
2993
3265
|
var register = useFormContext().register;
|
|
2994
3266
|
var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading;
|
|
2995
|
-
var isSubmitDisabled =
|
|
3267
|
+
var isSubmitDisabled = useMemo10(function() {
|
|
2996
3268
|
return isDisabled || isLoading;
|
|
2997
3269
|
}, [
|
|
2998
3270
|
isDisabled,
|
|
@@ -3001,7 +3273,7 @@ var Input = function() {
|
|
|
3001
3273
|
var isDisabledPrevious = usePrevious(isDisabled);
|
|
3002
3274
|
var textareaRef = useRef5(null);
|
|
3003
3275
|
var textareaProps = register("content");
|
|
3004
|
-
|
|
3276
|
+
useEffect5(function() {
|
|
3005
3277
|
if (isDisabled) return;
|
|
3006
3278
|
if (!isDisabledPrevious) return;
|
|
3007
3279
|
if (!textareaRef.current) return;
|
|
@@ -3011,7 +3283,7 @@ var Input = function() {
|
|
|
3011
3283
|
isDisabledPrevious,
|
|
3012
3284
|
textareaProps
|
|
3013
3285
|
]);
|
|
3014
|
-
return /* @__PURE__ */
|
|
3286
|
+
return /* @__PURE__ */ jsx61(TextareaBase, _object_spread_props(_object_spread({
|
|
3015
3287
|
minRows: 1,
|
|
3016
3288
|
placeholder: "Message ".concat(assistantNameContext, "..."),
|
|
3017
3289
|
disabled: isDisabled,
|
|
@@ -3031,51 +3303,51 @@ var Input = function() {
|
|
|
3031
3303
|
}));
|
|
3032
3304
|
};
|
|
3033
3305
|
var Control = function() {
|
|
3034
|
-
return /* @__PURE__ */
|
|
3035
|
-
children: /* @__PURE__ */
|
|
3306
|
+
return /* @__PURE__ */ jsx61(Root5, {
|
|
3307
|
+
children: /* @__PURE__ */ jsx61(Input, {})
|
|
3036
3308
|
});
|
|
3037
3309
|
};
|
|
3038
3310
|
Control.Root = Root5;
|
|
3039
3311
|
Control.Input = Input;
|
|
3040
3312
|
// src/components/threads/Thread/MessageForm/Field/Files/Preview.tsx
|
|
3041
|
-
import { Flex as
|
|
3313
|
+
import { Flex as Flex20, Card as Card2, Spinner, Text as Text6, IconButton as IconButton6 } from "@radix-ui/themes";
|
|
3042
3314
|
import { FileIcon as FileIcon2, Cross2Icon } from "@radix-ui/react-icons";
|
|
3043
|
-
import { jsx as
|
|
3315
|
+
import { jsx as jsx62, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3044
3316
|
var Preview = function() {
|
|
3045
3317
|
var _useMessageFormContext = useMessageFormContext(), files = _useMessageFormContext.files, setFiles = _useMessageFormContext.setFiles;
|
|
3046
3318
|
if (!files.length) {
|
|
3047
3319
|
return null;
|
|
3048
3320
|
}
|
|
3049
|
-
return /* @__PURE__ */
|
|
3321
|
+
return /* @__PURE__ */ jsx62(Flex20, {
|
|
3050
3322
|
flexBasis: "100%",
|
|
3051
3323
|
direction: "column",
|
|
3052
3324
|
pb: "2",
|
|
3053
3325
|
gap: "1",
|
|
3054
3326
|
children: files.map(function(file) {
|
|
3055
|
-
return /* @__PURE__ */
|
|
3327
|
+
return /* @__PURE__ */ jsx62(Card2, {
|
|
3056
3328
|
variant: "ghost",
|
|
3057
|
-
children: /* @__PURE__ */
|
|
3329
|
+
children: /* @__PURE__ */ jsxs21(Flex20, {
|
|
3058
3330
|
align: "center",
|
|
3059
3331
|
justify: "between",
|
|
3060
3332
|
gap: "1",
|
|
3061
3333
|
children: [
|
|
3062
|
-
/* @__PURE__ */
|
|
3334
|
+
/* @__PURE__ */ jsxs21(Flex20, {
|
|
3063
3335
|
align: "center",
|
|
3064
3336
|
gap: "1",
|
|
3065
3337
|
flexShrink: "1",
|
|
3066
3338
|
minWidth: "0",
|
|
3067
3339
|
maxWidth: "250px",
|
|
3068
3340
|
children: [
|
|
3069
|
-
/* @__PURE__ */
|
|
3341
|
+
/* @__PURE__ */ jsx62(Flex20, {
|
|
3070
3342
|
flexShrink: "0",
|
|
3071
|
-
children: /* @__PURE__ */
|
|
3343
|
+
children: /* @__PURE__ */ jsx62(Spinner, {
|
|
3072
3344
|
loading: isOptimistic({
|
|
3073
3345
|
id: file.id
|
|
3074
3346
|
}),
|
|
3075
|
-
children: /* @__PURE__ */
|
|
3347
|
+
children: /* @__PURE__ */ jsx62(FileIcon2, {})
|
|
3076
3348
|
})
|
|
3077
3349
|
}),
|
|
3078
|
-
/* @__PURE__ */
|
|
3350
|
+
/* @__PURE__ */ jsx62(Text6, {
|
|
3079
3351
|
size: "2",
|
|
3080
3352
|
truncate: true,
|
|
3081
3353
|
wrap: "nowrap",
|
|
@@ -3083,9 +3355,9 @@ var Preview = function() {
|
|
|
3083
3355
|
})
|
|
3084
3356
|
]
|
|
3085
3357
|
}),
|
|
3086
|
-
/* @__PURE__ */
|
|
3358
|
+
/* @__PURE__ */ jsx62(Flex20, {
|
|
3087
3359
|
flexShrink: "0",
|
|
3088
|
-
children: /* @__PURE__ */
|
|
3360
|
+
children: /* @__PURE__ */ jsx62(IconButton6, {
|
|
3089
3361
|
onClick: function() {
|
|
3090
3362
|
return setFiles(function(prev) {
|
|
3091
3363
|
return prev.filter(function(prevFile) {
|
|
@@ -3096,7 +3368,7 @@ var Preview = function() {
|
|
|
3096
3368
|
color: "gray",
|
|
3097
3369
|
variant: "ghost",
|
|
3098
3370
|
size: "1",
|
|
3099
|
-
children: /* @__PURE__ */
|
|
3371
|
+
children: /* @__PURE__ */ jsx62(Cross2Icon, {})
|
|
3100
3372
|
})
|
|
3101
3373
|
})
|
|
3102
3374
|
]
|
|
@@ -3110,7 +3382,7 @@ import { useCallback as useCallback2 } from "react";
|
|
|
3110
3382
|
import { omit as omit4 } from "radash";
|
|
3111
3383
|
import dayjs2 from "dayjs";
|
|
3112
3384
|
import { FilePlusIcon } from "@radix-ui/react-icons";
|
|
3113
|
-
import { IconButton as
|
|
3385
|
+
import { IconButton as IconButton7, Flex as Flex21 } from "@radix-ui/themes";
|
|
3114
3386
|
// src/hooks/files/useCreateFile/index.ts
|
|
3115
3387
|
import { useMutation as useMutation2, useQueryClient as useQueryClient5 } from "@tanstack/react-query";
|
|
3116
3388
|
// src/hooks/files/useCreateFile/lib/mutationOptions/mutationFn/body/formData.ts
|
|
@@ -3221,7 +3493,7 @@ var useCreateFile = function() {
|
|
|
3221
3493
|
});
|
|
3222
3494
|
};
|
|
3223
3495
|
// src/components/threads/Thread/MessageForm/Field/Files/Control.tsx
|
|
3224
|
-
import { jsx as
|
|
3496
|
+
import { jsx as jsx63, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3225
3497
|
var accept = ".c,text/x-c,\n.cs,text/x-csharp,\n.cpp,text/x-c++,\n.doc,application/msword,\n.docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document,\n.html,text/html,\n.java,text/x-java,\n.json,application/json,\n.md,text/markdown,\n.pdf,application/pdf,\n.php,text/x-php,\n.pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation,\n.py,text/x-python,\n.py,text/x-script.python,\n.rb,text/x-ruby,\n.tex,text/x-tex,\n.txt,text/plain,\n.css,text/css,\n.js,text/javascript,\n.sh,application/x-sh,\n.ts,application/typescript";
|
|
3226
3498
|
var Control2 = function() {
|
|
3227
3499
|
var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading, setFiles = _useMessageFormContext.setFiles;
|
|
@@ -3395,11 +3667,11 @@ var Control2 = function() {
|
|
|
3395
3667
|
createFile,
|
|
3396
3668
|
setFiles
|
|
3397
3669
|
]);
|
|
3398
|
-
return /* @__PURE__ */
|
|
3670
|
+
return /* @__PURE__ */ jsx63(Flex21, {
|
|
3399
3671
|
pt: "2",
|
|
3400
3672
|
pr: "2",
|
|
3401
3673
|
flexGrow: "0",
|
|
3402
|
-
children: /* @__PURE__ */
|
|
3674
|
+
children: /* @__PURE__ */ jsxs22(IconButton7, {
|
|
3403
3675
|
type: "button",
|
|
3404
3676
|
variant: "ghost",
|
|
3405
3677
|
color: "gray",
|
|
@@ -3409,8 +3681,8 @@ var Control2 = function() {
|
|
|
3409
3681
|
overflow: "hidden"
|
|
3410
3682
|
},
|
|
3411
3683
|
children: [
|
|
3412
|
-
/* @__PURE__ */
|
|
3413
|
-
/* @__PURE__ */
|
|
3684
|
+
/* @__PURE__ */ jsx63(FilePlusIcon, {}),
|
|
3685
|
+
/* @__PURE__ */ jsx63("input", {
|
|
3414
3686
|
type: "file",
|
|
3415
3687
|
multiple: true,
|
|
3416
3688
|
accept: accept,
|
|
@@ -3435,20 +3707,20 @@ var Files = {
|
|
|
3435
3707
|
Control: Control2
|
|
3436
3708
|
};
|
|
3437
3709
|
// src/components/threads/Thread/MessageForm/Field/index.tsx
|
|
3438
|
-
import { jsx as
|
|
3710
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
3439
3711
|
var Root6 = function(param) {
|
|
3440
3712
|
var children = param.children;
|
|
3441
3713
|
var _useFormContext2 = useFormContext2(), errors = _useFormContext2.formState.errors;
|
|
3442
|
-
return /* @__PURE__ */
|
|
3714
|
+
return /* @__PURE__ */ jsx64(RadixContainer, {
|
|
3443
3715
|
size: "2",
|
|
3444
3716
|
flexGrow: "0",
|
|
3445
|
-
children: /* @__PURE__ */
|
|
3717
|
+
children: /* @__PURE__ */ jsx64(Flex22, {
|
|
3446
3718
|
direction: "column",
|
|
3447
3719
|
flexShrink: "0",
|
|
3448
|
-
children: /* @__PURE__ */
|
|
3720
|
+
children: /* @__PURE__ */ jsx64(Flex22, {
|
|
3449
3721
|
direction: "column",
|
|
3450
3722
|
flexShrink: "0",
|
|
3451
|
-
children: /* @__PURE__ */
|
|
3723
|
+
children: /* @__PURE__ */ jsx64(Flex22, {
|
|
3452
3724
|
style: _object_spread({
|
|
3453
3725
|
borderRadius: "var(--radius-2)",
|
|
3454
3726
|
borderWidth: "1px",
|
|
@@ -3472,13 +3744,13 @@ var Field = {
|
|
|
3472
3744
|
Files: Files
|
|
3473
3745
|
};
|
|
3474
3746
|
// src/components/threads/Thread/MessageForm/index.tsx
|
|
3475
|
-
import { jsx as
|
|
3747
|
+
import { jsx as jsx65, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3476
3748
|
var MessageForm = function() {
|
|
3477
|
-
return /* @__PURE__ */
|
|
3478
|
-
children: /* @__PURE__ */
|
|
3749
|
+
return /* @__PURE__ */ jsx65(Root4, {
|
|
3750
|
+
children: /* @__PURE__ */ jsxs23(Field.Root, {
|
|
3479
3751
|
children: [
|
|
3480
|
-
/* @__PURE__ */
|
|
3481
|
-
/* @__PURE__ */
|
|
3752
|
+
/* @__PURE__ */ jsx65(Field.Control, {}),
|
|
3753
|
+
/* @__PURE__ */ jsx65(Submit, {})
|
|
3482
3754
|
]
|
|
3483
3755
|
})
|
|
3484
3756
|
});
|
|
@@ -3487,35 +3759,35 @@ MessageForm.Root = Root4;
|
|
|
3487
3759
|
MessageForm.Field = Field;
|
|
3488
3760
|
MessageForm.Submit = Submit;
|
|
3489
3761
|
// src/components/threads/Thread/Root/index.tsx
|
|
3490
|
-
import { Flex as
|
|
3762
|
+
import { Flex as Flex24 } from "@radix-ui/themes";
|
|
3491
3763
|
// src/components/threads/Thread/Provider/index.tsx
|
|
3492
3764
|
var Provider2 = SuperinterfaceProvider;
|
|
3493
3765
|
// src/components/toasts/ToastsProvider/index.tsx
|
|
3494
|
-
import { useState as
|
|
3766
|
+
import { useState as useState3, useCallback as useCallback3 } from "react";
|
|
3495
3767
|
import * as Toast2 from "@radix-ui/react-toast";
|
|
3496
3768
|
// src/components/toasts/ToastsProvider/CustomToast.tsx
|
|
3497
3769
|
import * as Toast from "@radix-ui/react-toast";
|
|
3498
|
-
import { Card as
|
|
3770
|
+
import { Card as Card3, Text as Text7, Flex as Flex23 } from "@radix-ui/themes";
|
|
3499
3771
|
import { CheckCircledIcon as CheckCircledIcon2, CrossCircledIcon } from "@radix-ui/react-icons";
|
|
3500
|
-
import { jsx as
|
|
3772
|
+
import { jsx as jsx66, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3501
3773
|
var CustomToast = function(param) {
|
|
3502
3774
|
var toast = param.toast;
|
|
3503
|
-
return /* @__PURE__ */
|
|
3504
|
-
children: /* @__PURE__ */
|
|
3505
|
-
children: /* @__PURE__ */
|
|
3506
|
-
children: /* @__PURE__ */
|
|
3775
|
+
return /* @__PURE__ */ jsx66(Toast.Root, {
|
|
3776
|
+
children: /* @__PURE__ */ jsx66(Card3, {
|
|
3777
|
+
children: /* @__PURE__ */ jsx66(Toast.Title, {
|
|
3778
|
+
children: /* @__PURE__ */ jsxs24(Flex23, {
|
|
3507
3779
|
children: [
|
|
3508
|
-
/* @__PURE__ */
|
|
3780
|
+
/* @__PURE__ */ jsx66(Flex23, {
|
|
3509
3781
|
pr: "2",
|
|
3510
3782
|
height: "14px",
|
|
3511
3783
|
align: "center",
|
|
3512
|
-
children: toast.type === "success" ? /* @__PURE__ */
|
|
3784
|
+
children: toast.type === "success" ? /* @__PURE__ */ jsx66(CheckCircledIcon2, {
|
|
3513
3785
|
color: "var(--accent-9)"
|
|
3514
|
-
}) : /* @__PURE__ */
|
|
3786
|
+
}) : /* @__PURE__ */ jsx66(CrossCircledIcon, {
|
|
3515
3787
|
color: "var(--red-9)"
|
|
3516
3788
|
})
|
|
3517
3789
|
}),
|
|
3518
|
-
/* @__PURE__ */
|
|
3790
|
+
/* @__PURE__ */ jsx66(Text7, {
|
|
3519
3791
|
weight: "medium",
|
|
3520
3792
|
size: "1",
|
|
3521
3793
|
children: toast.message
|
|
@@ -3527,10 +3799,10 @@ var CustomToast = function(param) {
|
|
|
3527
3799
|
});
|
|
3528
3800
|
};
|
|
3529
3801
|
// src/components/toasts/ToastsProvider/index.tsx
|
|
3530
|
-
import { jsx as
|
|
3802
|
+
import { jsx as jsx67, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3531
3803
|
var ToastsProvider = function(param) {
|
|
3532
3804
|
var children = param.children, _param_bottom = param.bottom, bottom = _param_bottom === void 0 ? 0 : _param_bottom;
|
|
3533
|
-
var
|
|
3805
|
+
var _useState3 = _sliced_to_array(useState3([]), 2), toasts = _useState3[0], setToasts = _useState3[1];
|
|
3534
3806
|
var addToast = useCallback3(function(toast) {
|
|
3535
3807
|
return setToasts(function(prevToasts) {
|
|
3536
3808
|
return _to_consumable_array(prevToasts).concat([
|
|
@@ -3538,20 +3810,20 @@ var ToastsProvider = function(param) {
|
|
|
3538
3810
|
]);
|
|
3539
3811
|
});
|
|
3540
3812
|
}, []);
|
|
3541
|
-
return /* @__PURE__ */
|
|
3813
|
+
return /* @__PURE__ */ jsx67(ToastsContext.Provider, {
|
|
3542
3814
|
value: {
|
|
3543
3815
|
toasts: toasts,
|
|
3544
3816
|
addToast: addToast
|
|
3545
3817
|
},
|
|
3546
|
-
children: /* @__PURE__ */
|
|
3818
|
+
children: /* @__PURE__ */ jsxs25(Toast2.Provider, {
|
|
3547
3819
|
children: [
|
|
3548
3820
|
children,
|
|
3549
3821
|
Array.from(toasts).map(function(toast, index) {
|
|
3550
|
-
return /* @__PURE__ */
|
|
3822
|
+
return /* @__PURE__ */ jsx67(CustomToast, {
|
|
3551
3823
|
toast: toast
|
|
3552
3824
|
}, index);
|
|
3553
3825
|
}),
|
|
3554
|
-
/* @__PURE__ */
|
|
3826
|
+
/* @__PURE__ */ jsx67(Toast2.Viewport, {
|
|
3555
3827
|
style: {
|
|
3556
3828
|
position: "absolute",
|
|
3557
3829
|
bottom: bottom,
|
|
@@ -3573,15 +3845,15 @@ var ToastsProvider = function(param) {
|
|
|
3573
3845
|
});
|
|
3574
3846
|
};
|
|
3575
3847
|
// src/components/threads/Thread/Root/index.tsx
|
|
3576
|
-
import { jsx as
|
|
3848
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
3577
3849
|
var Root8 = function(_param) {
|
|
3578
3850
|
var children = _param.children, rest = _object_without_properties(_param, [
|
|
3579
3851
|
"children"
|
|
3580
3852
|
]);
|
|
3581
|
-
return /* @__PURE__ */
|
|
3853
|
+
return /* @__PURE__ */ jsx68(ToastsProvider, {
|
|
3582
3854
|
bottom: "var(--space-9)",
|
|
3583
|
-
children: /* @__PURE__ */
|
|
3584
|
-
children: /* @__PURE__ */
|
|
3855
|
+
children: /* @__PURE__ */ jsx68(Provider2, _object_spread_props(_object_spread({}, rest), {
|
|
3856
|
+
children: /* @__PURE__ */ jsx68(Flex24, {
|
|
3585
3857
|
direction: "column",
|
|
3586
3858
|
flexGrow: "1",
|
|
3587
3859
|
children: children
|
|
@@ -3590,12 +3862,12 @@ var Root8 = function(_param) {
|
|
|
3590
3862
|
});
|
|
3591
3863
|
};
|
|
3592
3864
|
// src/components/threads/Thread/index.tsx
|
|
3593
|
-
import { jsx as
|
|
3865
|
+
import { jsx as jsx69, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3594
3866
|
var Thread = function(props) {
|
|
3595
|
-
return /* @__PURE__ */
|
|
3867
|
+
return /* @__PURE__ */ jsxs26(Root8, _object_spread_props(_object_spread({}, props), {
|
|
3596
3868
|
children: [
|
|
3597
|
-
/* @__PURE__ */
|
|
3598
|
-
/* @__PURE__ */
|
|
3869
|
+
/* @__PURE__ */ jsx69(Messages, {}),
|
|
3870
|
+
/* @__PURE__ */ jsx69(MessageForm, {})
|
|
3599
3871
|
]
|
|
3600
3872
|
}));
|
|
3601
3873
|
};
|
|
@@ -3608,7 +3880,7 @@ var useMessageContext = function() {
|
|
|
3608
3880
|
return useContext12(MessageContext);
|
|
3609
3881
|
};
|
|
3610
3882
|
// src/hooks/assistants/useAssistant/index.ts
|
|
3611
|
-
import { useMemo as
|
|
3883
|
+
import { useMemo as useMemo11 } from "react";
|
|
3612
3884
|
import { useQuery } from "@tanstack/react-query";
|
|
3613
3885
|
// src/hooks/assistants/useAssistant/lib/queryOptions/index.ts
|
|
3614
3886
|
import { queryOptions as tanstackQueryOptions } from "@tanstack/react-query";
|
|
@@ -3697,7 +3969,7 @@ var useAssistant = function(param) {
|
|
|
3697
3969
|
assistantId: assistantId,
|
|
3698
3970
|
superinterfaceContext: superinterfaceContext
|
|
3699
3971
|
}));
|
|
3700
|
-
return
|
|
3972
|
+
return useMemo11(function() {
|
|
3701
3973
|
return _object_spread_props(_object_spread({}, props), {
|
|
3702
3974
|
assistant: props.data ? props.data.assistant : null
|
|
3703
3975
|
});
|
|
@@ -3706,7 +3978,7 @@ var useAssistant = function(param) {
|
|
|
3706
3978
|
]);
|
|
3707
3979
|
};
|
|
3708
3980
|
// src/components/threads/ThreadDialog/Provider/index.tsx
|
|
3709
|
-
import { useState as
|
|
3981
|
+
import { useState as useState4 } from "react";
|
|
3710
3982
|
// src/contexts/threads/ThreadDialogContext/index.ts
|
|
3711
3983
|
import { createContext as createContext11 } from "react";
|
|
3712
3984
|
var ThreadDialogContext = createContext11({
|
|
@@ -3719,12 +3991,12 @@ var useThreadDialogContext = function() {
|
|
|
3719
3991
|
return useContext13(ThreadDialogContext);
|
|
3720
3992
|
};
|
|
3721
3993
|
// src/components/threads/ThreadDialog/Provider/index.tsx
|
|
3722
|
-
import { jsx as
|
|
3994
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
3723
3995
|
var Provider4 = function(param) {
|
|
3724
3996
|
var children = param.children;
|
|
3725
3997
|
var threadDialogContext = useThreadDialogContext();
|
|
3726
|
-
var
|
|
3727
|
-
return /* @__PURE__ */
|
|
3998
|
+
var _useState4 = _sliced_to_array(useState4(threadDialogContext.isOpen), 2), isOpen = _useState4[0], setIsOpen = _useState4[1];
|
|
3999
|
+
return /* @__PURE__ */ jsx70(ThreadDialogContext.Provider, {
|
|
3728
4000
|
value: {
|
|
3729
4001
|
isOpen: isOpen,
|
|
3730
4002
|
setIsOpen: setIsOpen
|
|
@@ -3733,32 +4005,32 @@ var Provider4 = function(param) {
|
|
|
3733
4005
|
});
|
|
3734
4006
|
};
|
|
3735
4007
|
// src/components/threads/ThreadDialog/Root/index.tsx
|
|
3736
|
-
import { jsx as
|
|
4008
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
3737
4009
|
var Root9 = function(param) {
|
|
3738
4010
|
var children = param.children;
|
|
3739
|
-
return /* @__PURE__ */
|
|
4011
|
+
return /* @__PURE__ */ jsx71(Provider4, {
|
|
3740
4012
|
children: children
|
|
3741
4013
|
});
|
|
3742
4014
|
};
|
|
3743
4015
|
// src/components/threads/ThreadDialog/Trigger/index.tsx
|
|
3744
|
-
import { Flex as
|
|
4016
|
+
import { Flex as Flex25 } from "@radix-ui/themes";
|
|
3745
4017
|
// src/components/threads/ThreadDialog/Trigger/Button.tsx
|
|
3746
|
-
import { IconButton as
|
|
4018
|
+
import { IconButton as IconButton8 } from "@radix-ui/themes";
|
|
3747
4019
|
import { ChatBubbleIcon } from "@radix-ui/react-icons";
|
|
3748
|
-
import { jsx as
|
|
4020
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
3749
4021
|
var Button3 = function() {
|
|
3750
|
-
return /* @__PURE__ */
|
|
4022
|
+
return /* @__PURE__ */ jsx72(IconButton8, {
|
|
3751
4023
|
size: "4",
|
|
3752
4024
|
radius: "full",
|
|
3753
|
-
children: /* @__PURE__ */
|
|
4025
|
+
children: /* @__PURE__ */ jsx72(ChatBubbleIcon, {})
|
|
3754
4026
|
});
|
|
3755
4027
|
};
|
|
3756
4028
|
// src/components/threads/ThreadDialog/Trigger/index.tsx
|
|
3757
|
-
import { jsx as
|
|
4029
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
3758
4030
|
var Root10 = function(param) {
|
|
3759
4031
|
var children = param.children, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
|
|
3760
4032
|
var _useThreadDialogContext = useThreadDialogContext(), setIsOpen = _useThreadDialogContext.setIsOpen, isOpen = _useThreadDialogContext.isOpen;
|
|
3761
|
-
return /* @__PURE__ */
|
|
4033
|
+
return /* @__PURE__ */ jsx73(Flex25, {
|
|
3762
4034
|
display: {
|
|
3763
4035
|
initial: isOpen ? "none" : "flex",
|
|
3764
4036
|
sm: "flex"
|
|
@@ -3782,21 +4054,21 @@ var Root10 = function(param) {
|
|
|
3782
4054
|
});
|
|
3783
4055
|
};
|
|
3784
4056
|
var Trigger = function(args) {
|
|
3785
|
-
return /* @__PURE__ */
|
|
3786
|
-
children: /* @__PURE__ */
|
|
4057
|
+
return /* @__PURE__ */ jsx73(Root10, _object_spread_props(_object_spread({}, args), {
|
|
4058
|
+
children: /* @__PURE__ */ jsx73(Button3, {})
|
|
3787
4059
|
}));
|
|
3788
4060
|
};
|
|
3789
4061
|
Trigger.Root = Root10;
|
|
3790
4062
|
Trigger.Button = Button3;
|
|
3791
4063
|
// src/components/threads/ThreadDialog/Content/index.tsx
|
|
3792
|
-
import { Card as
|
|
4064
|
+
import { Card as Card4, Inset as Inset2, Flex as Flex27 } from "@radix-ui/themes";
|
|
3793
4065
|
// src/components/threads/ThreadDialog/Close/index.tsx
|
|
3794
4066
|
import { Cross1Icon } from "@radix-ui/react-icons";
|
|
3795
|
-
import { IconButton as
|
|
3796
|
-
import { jsx as
|
|
4067
|
+
import { IconButton as IconButton9, Flex as Flex26 } from "@radix-ui/themes";
|
|
4068
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
3797
4069
|
var Close = function() {
|
|
3798
4070
|
var _useThreadDialogContext = useThreadDialogContext(), setIsOpen = _useThreadDialogContext.setIsOpen, isOpen = _useThreadDialogContext.isOpen;
|
|
3799
|
-
return /* @__PURE__ */
|
|
4071
|
+
return /* @__PURE__ */ jsx74(Flex26, {
|
|
3800
4072
|
display: {
|
|
3801
4073
|
initial: isOpen ? "flex" : "none",
|
|
3802
4074
|
sm: "none"
|
|
@@ -3816,20 +4088,20 @@ var Close = function() {
|
|
|
3816
4088
|
style: {
|
|
3817
4089
|
zIndex: 9999999999
|
|
3818
4090
|
},
|
|
3819
|
-
children: /* @__PURE__ */
|
|
4091
|
+
children: /* @__PURE__ */ jsx74(IconButton9, {
|
|
3820
4092
|
size: "2",
|
|
3821
4093
|
variant: "soft",
|
|
3822
|
-
children: /* @__PURE__ */
|
|
4094
|
+
children: /* @__PURE__ */ jsx74(Cross1Icon, {})
|
|
3823
4095
|
})
|
|
3824
4096
|
});
|
|
3825
4097
|
};
|
|
3826
4098
|
// src/components/threads/ThreadDialog/Content/index.tsx
|
|
3827
|
-
import { jsx as
|
|
4099
|
+
import { jsx as jsx75, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3828
4100
|
var Root11 = function(param) {
|
|
3829
4101
|
var children = param.children, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
|
|
3830
4102
|
var isOpen = useThreadDialogContext().isOpen;
|
|
3831
4103
|
if (!isOpen) return null;
|
|
3832
|
-
return /* @__PURE__ */
|
|
4104
|
+
return /* @__PURE__ */ jsx75(Flex27, {
|
|
3833
4105
|
direction: "column",
|
|
3834
4106
|
justify: "end",
|
|
3835
4107
|
position: "fixed",
|
|
@@ -3857,7 +4129,7 @@ var Root11 = function(param) {
|
|
|
3857
4129
|
style: _object_spread({
|
|
3858
4130
|
zIndex: 9999999999
|
|
3859
4131
|
}, style),
|
|
3860
|
-
children: /* @__PURE__ */
|
|
4132
|
+
children: /* @__PURE__ */ jsxs27(Card4, {
|
|
3861
4133
|
mb: {
|
|
3862
4134
|
initial: void 0,
|
|
3863
4135
|
sm: "3"
|
|
@@ -3868,7 +4140,7 @@ var Root11 = function(param) {
|
|
|
3868
4140
|
flexGrow: 1
|
|
3869
4141
|
},
|
|
3870
4142
|
children: [
|
|
3871
|
-
/* @__PURE__ */
|
|
4143
|
+
/* @__PURE__ */ jsx75(Inset2, {
|
|
3872
4144
|
clip: "padding-box",
|
|
3873
4145
|
side: "all",
|
|
3874
4146
|
pb: "current",
|
|
@@ -3878,13 +4150,13 @@ var Root11 = function(param) {
|
|
|
3878
4150
|
},
|
|
3879
4151
|
children: children
|
|
3880
4152
|
}),
|
|
3881
|
-
/* @__PURE__ */
|
|
4153
|
+
/* @__PURE__ */ jsx75(Close, {})
|
|
3882
4154
|
]
|
|
3883
4155
|
})
|
|
3884
4156
|
});
|
|
3885
4157
|
};
|
|
3886
4158
|
var Messages2 = function() {
|
|
3887
|
-
return /* @__PURE__ */
|
|
4159
|
+
return /* @__PURE__ */ jsx75(Thread.Messages, {
|
|
3888
4160
|
style: {
|
|
3889
4161
|
paddingTop: "var(--space-5)",
|
|
3890
4162
|
paddingRight: "var(--space-5)",
|
|
@@ -3894,7 +4166,7 @@ var Messages2 = function() {
|
|
|
3894
4166
|
};
|
|
3895
4167
|
var FormContainer = function(param) {
|
|
3896
4168
|
var children = param.children;
|
|
3897
|
-
return /* @__PURE__ */
|
|
4169
|
+
return /* @__PURE__ */ jsx75(Flex27, {
|
|
3898
4170
|
direction: "column",
|
|
3899
4171
|
pl: "5",
|
|
3900
4172
|
pr: "5",
|
|
@@ -3905,13 +4177,13 @@ var FormContainer = function(param) {
|
|
|
3905
4177
|
};
|
|
3906
4178
|
var Content5 = function(param) {
|
|
3907
4179
|
var _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
|
|
3908
|
-
return /* @__PURE__ */
|
|
4180
|
+
return /* @__PURE__ */ jsx75(Root11, {
|
|
3909
4181
|
style: style,
|
|
3910
|
-
children: /* @__PURE__ */
|
|
4182
|
+
children: /* @__PURE__ */ jsxs27(Thread.Root, {
|
|
3911
4183
|
children: [
|
|
3912
|
-
/* @__PURE__ */
|
|
3913
|
-
/* @__PURE__ */
|
|
3914
|
-
children: /* @__PURE__ */
|
|
4184
|
+
/* @__PURE__ */ jsx75(Messages2, {}),
|
|
4185
|
+
/* @__PURE__ */ jsx75(FormContainer, {
|
|
4186
|
+
children: /* @__PURE__ */ jsx75(Thread.MessageForm, {})
|
|
3915
4187
|
})
|
|
3916
4188
|
]
|
|
3917
4189
|
})
|
|
@@ -3921,12 +4193,12 @@ Content5.Root = Root11;
|
|
|
3921
4193
|
Content5.Messages = Messages2;
|
|
3922
4194
|
Content5.FormContainer = FormContainer;
|
|
3923
4195
|
// src/components/threads/ThreadDialog/index.tsx
|
|
3924
|
-
import { jsx as
|
|
4196
|
+
import { jsx as jsx76, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3925
4197
|
var ThreadDialog = function() {
|
|
3926
|
-
return /* @__PURE__ */
|
|
4198
|
+
return /* @__PURE__ */ jsxs28(Root9, {
|
|
3927
4199
|
children: [
|
|
3928
|
-
/* @__PURE__ */
|
|
3929
|
-
/* @__PURE__ */
|
|
4200
|
+
/* @__PURE__ */ jsx76(Content5, {}),
|
|
4201
|
+
/* @__PURE__ */ jsx76(Trigger, {})
|
|
3930
4202
|
]
|
|
3931
4203
|
});
|
|
3932
4204
|
};
|
|
@@ -3934,7 +4206,7 @@ ThreadDialog.Root = Root9;
|
|
|
3934
4206
|
ThreadDialog.Trigger = Trigger;
|
|
3935
4207
|
ThreadDialog.Content = Content5;
|
|
3936
4208
|
// src/components/threads/AudioThread/Root/index.tsx
|
|
3937
|
-
import { Flex as
|
|
4209
|
+
import { Flex as Flex28 } from "@radix-ui/themes";
|
|
3938
4210
|
// src/contexts/threads/AudioThreadContext/index.ts
|
|
3939
4211
|
import { createContext as createContext12 } from "react";
|
|
3940
4212
|
var AudioThreadContext = createContext12({
|
|
@@ -3993,7 +4265,7 @@ var AudioThreadContext = createContext12({
|
|
|
3993
4265
|
}
|
|
3994
4266
|
});
|
|
3995
4267
|
// src/hooks/misc/usePermission/index.ts
|
|
3996
|
-
import { useEffect as
|
|
4268
|
+
import { useEffect as useEffect6, useState as useState5 } from "react";
|
|
3997
4269
|
// src/hooks/misc/usePermission/util.ts
|
|
3998
4270
|
var noop = function() {};
|
|
3999
4271
|
function on(obj) {
|
|
@@ -4016,8 +4288,8 @@ function off(obj) {
|
|
|
4016
4288
|
}
|
|
4017
4289
|
// src/hooks/misc/usePermission/index.ts
|
|
4018
4290
|
var usePermission = function(permissionDesc) {
|
|
4019
|
-
var
|
|
4020
|
-
|
|
4291
|
+
var _useState5 = _sliced_to_array(useState5(""), 2), state = _useState5[0], setState = _useState5[1];
|
|
4292
|
+
useEffect6(function() {
|
|
4021
4293
|
var mounted = true;
|
|
4022
4294
|
var permissionStatus = null;
|
|
4023
4295
|
var onChange = function() {
|
|
@@ -4055,11 +4327,11 @@ var blobToData = function(blob) {
|
|
|
4055
4327
|
});
|
|
4056
4328
|
};
|
|
4057
4329
|
// src/hooks/audioThreads/useStatus/index.ts
|
|
4058
|
-
import { useMemo as
|
|
4330
|
+
import { useMemo as useMemo12 } from "react";
|
|
4059
4331
|
var useStatus = function(param) {
|
|
4060
4332
|
var messageAudioProps = param.messageAudioProps, recorderProps = param.recorderProps, createMessageProps = param.createMessageProps;
|
|
4061
4333
|
var latestMessageProps = useLatestMessage();
|
|
4062
|
-
var status =
|
|
4334
|
+
var status = useMemo12(function() {
|
|
4063
4335
|
var _latestMessageProps_latestMessage;
|
|
4064
4336
|
if (recorderProps.status === "recording") return "recording";
|
|
4065
4337
|
if (createMessageProps.isPending) return "creatingMessage";
|
|
@@ -4083,16 +4355,16 @@ var useStatus = function(param) {
|
|
|
4083
4355
|
// src/hooks/audioThreads/useRecorder/index.ts
|
|
4084
4356
|
import dayjs3 from "dayjs";
|
|
4085
4357
|
import { useAudioCapture } from "use-audio-capture";
|
|
4086
|
-
import { useMemo as
|
|
4358
|
+
import { useMemo as useMemo13, useRef as useRef7, useState as useState6, useCallback as useCallback4, useEffect as useEffect8 } from "react";
|
|
4087
4359
|
import { useAudioPlayer } from "react-use-audio-player";
|
|
4088
4360
|
// src/hooks/misc/useInterval.ts
|
|
4089
|
-
import { useEffect as
|
|
4361
|
+
import { useEffect as useEffect7, useRef as useRef6 } from "react";
|
|
4090
4362
|
var useInterval = function(callback, delay) {
|
|
4091
4363
|
var savedCallback = useRef6(function() {});
|
|
4092
|
-
|
|
4364
|
+
useEffect7(function() {
|
|
4093
4365
|
savedCallback.current = callback;
|
|
4094
4366
|
});
|
|
4095
|
-
|
|
4367
|
+
useEffect7(function() {
|
|
4096
4368
|
if (delay !== null) {
|
|
4097
4369
|
var interval = setInterval(function() {
|
|
4098
4370
|
return savedCallback.current();
|
|
@@ -4109,14 +4381,14 @@ var useInterval = function(callback, delay) {
|
|
|
4109
4381
|
// src/hooks/audioThreads/useRecorder/index.ts
|
|
4110
4382
|
var useRecorder = function(param) {
|
|
4111
4383
|
var isStopOnSilence = param.isStopOnSilence, onStart = param.onStart, onStop = param.onStop;
|
|
4112
|
-
var
|
|
4113
|
-
var
|
|
4114
|
-
var
|
|
4115
|
-
var
|
|
4384
|
+
var _useState6 = _sliced_to_array(useState6(null), 2), silenceStart = _useState6[0], setSilenceStart = _useState6[1];
|
|
4385
|
+
var _useState61 = _sliced_to_array(useState6(null), 2), noiseStart = _useState61[0], setNoiseStart = _useState61[1];
|
|
4386
|
+
var _useState62 = _sliced_to_array(useState6(null), 2), mediaStream = _useState62[0], setMediaStream = _useState62[1];
|
|
4387
|
+
var _useState63 = _sliced_to_array(useState6("idle"), 2), status = _useState63[0], setStatus = _useState63[1];
|
|
4116
4388
|
var startAudioPlayer = useAudioPlayer();
|
|
4117
4389
|
var endAudioPlayer = useAudioPlayer();
|
|
4118
|
-
var
|
|
4119
|
-
|
|
4390
|
+
var _useState64 = _sliced_to_array(useState6(false), 2), isLoaded = _useState64[0], setIsLoaded = _useState64[1];
|
|
4391
|
+
useEffect8(function() {
|
|
4120
4392
|
if (isLoaded) return;
|
|
4121
4393
|
setIsLoaded(true);
|
|
4122
4394
|
}, [
|
|
@@ -4174,9 +4446,9 @@ var useRecorder = function(param) {
|
|
|
4174
4446
|
setNoiseStart(null);
|
|
4175
4447
|
}
|
|
4176
4448
|
});
|
|
4177
|
-
var
|
|
4449
|
+
var _useState65 = _sliced_to_array(useState6(null), 2), audioEngine = _useState65[0], setAudioEngine = _useState65[1];
|
|
4178
4450
|
var isInited = useRef7(false);
|
|
4179
|
-
|
|
4451
|
+
useEffect8(function() {
|
|
4180
4452
|
if (!mediaStream) return;
|
|
4181
4453
|
if (isInited.current) return;
|
|
4182
4454
|
isInited.current = true;
|
|
@@ -4189,7 +4461,7 @@ var useRecorder = function(param) {
|
|
|
4189
4461
|
isInited,
|
|
4190
4462
|
mediaStream
|
|
4191
4463
|
]);
|
|
4192
|
-
var visualizationAnalyser =
|
|
4464
|
+
var visualizationAnalyser = useMemo13(function() {
|
|
4193
4465
|
if (!audioEngine) return null;
|
|
4194
4466
|
var result = audioEngine.audioContext.createAnalyser();
|
|
4195
4467
|
audioEngine.source.connect(result);
|
|
@@ -4197,7 +4469,7 @@ var useRecorder = function(param) {
|
|
|
4197
4469
|
}, [
|
|
4198
4470
|
audioEngine
|
|
4199
4471
|
]);
|
|
4200
|
-
var silenceAnalyser =
|
|
4472
|
+
var silenceAnalyser = useMemo13(function() {
|
|
4201
4473
|
if (!audioEngine) return null;
|
|
4202
4474
|
var result = audioEngine.audioContext.createAnalyser();
|
|
4203
4475
|
result.minDecibels = -60;
|
|
@@ -4229,7 +4501,7 @@ var useRecorder = function(param) {
|
|
|
4229
4501
|
setNoiseStart,
|
|
4230
4502
|
setSilenceStart
|
|
4231
4503
|
]);
|
|
4232
|
-
|
|
4504
|
+
useEffect8(function() {
|
|
4233
4505
|
if (!isStopOnSilence) return;
|
|
4234
4506
|
requestAnimationFrame(function() {
|
|
4235
4507
|
return handleSilence();
|
|
@@ -4252,7 +4524,7 @@ var useRecorder = function(param) {
|
|
|
4252
4524
|
});
|
|
4253
4525
|
};
|
|
4254
4526
|
// src/hooks/audioThreads/useMessageAudio/index.ts
|
|
4255
|
-
import { useMemo as
|
|
4527
|
+
import { useMemo as useMemo14, useRef as useRef8, useState as useState7, useEffect as useEffect9 } from "react";
|
|
4256
4528
|
import nlp from "compromise";
|
|
4257
4529
|
import { Howler } from "howler";
|
|
4258
4530
|
import { useAudioPlayer as useAudioPlayer2 } from "react-use-audio-player";
|
|
@@ -4290,15 +4562,15 @@ var getMessageSentences = function(param) {
|
|
|
4290
4562
|
};
|
|
4291
4563
|
var useMessageAudio = function(param) {
|
|
4292
4564
|
var onEnd = param.onEnd;
|
|
4293
|
-
var
|
|
4294
|
-
var
|
|
4295
|
-
var
|
|
4565
|
+
var _useState7 = _sliced_to_array(useState7(false), 2), isAudioPlayed = _useState7[0], setIsAudioPlayed = _useState7[1];
|
|
4566
|
+
var _useState71 = _sliced_to_array(useState7([]), 2), stoppedMessageIds = _useState71[0], setStoppedMessageIds = _useState71[1];
|
|
4567
|
+
var _useState72 = _sliced_to_array(useState7([]), 2), playedMessageSentences = _useState72[0], setPlayedMessageSentences = _useState72[1];
|
|
4296
4568
|
var audioPlayer = useAudioPlayer2();
|
|
4297
4569
|
var nextAudioPlayer = useAudioPlayer2();
|
|
4298
4570
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
4299
|
-
var
|
|
4571
|
+
var _useState73 = _sliced_to_array(useState7(false), 2), isPlaying = _useState73[0], setIsPlaying = _useState73[1];
|
|
4300
4572
|
var latestMessageProps = useLatestMessage();
|
|
4301
|
-
var unplayedMessageSentences =
|
|
4573
|
+
var unplayedMessageSentences = useMemo14(function() {
|
|
4302
4574
|
if (!latestMessageProps.latestMessage) return [];
|
|
4303
4575
|
if (latestMessageProps.latestMessage.role !== "assistant") return [];
|
|
4304
4576
|
if (stoppedMessageIds.includes(latestMessageProps.latestMessage.id)) return [];
|
|
@@ -4319,7 +4591,7 @@ var useMessageAudio = function(param) {
|
|
|
4319
4591
|
latestMessageProps,
|
|
4320
4592
|
playedMessageSentences
|
|
4321
4593
|
]);
|
|
4322
|
-
|
|
4594
|
+
useEffect9(function() {
|
|
4323
4595
|
if (isPlaying) return;
|
|
4324
4596
|
if (audioPlayer.playing) return;
|
|
4325
4597
|
if (!latestMessageProps.latestMessage) return;
|
|
@@ -4387,7 +4659,7 @@ var useMessageAudio = function(param) {
|
|
|
4387
4659
|
playedMessageSentences,
|
|
4388
4660
|
onEnd
|
|
4389
4661
|
]);
|
|
4390
|
-
|
|
4662
|
+
useEffect9(function() {
|
|
4391
4663
|
if (isHtmlAudioSupported) {
|
|
4392
4664
|
var _Howler__howls___sounds_, _Howler__howls_;
|
|
4393
4665
|
if (!(Howler === null || Howler === void 0 ? void 0 : (_Howler__howls_ = Howler._howls[0]) === null || _Howler__howls_ === void 0 ? void 0 : (_Howler__howls___sounds_ = _Howler__howls_._sounds[0]) === null || _Howler__howls___sounds_ === void 0 ? void 0 : _Howler__howls___sounds_._node)) return;
|
|
@@ -4396,9 +4668,9 @@ var useMessageAudio = function(param) {
|
|
|
4396
4668
|
}, [
|
|
4397
4669
|
audioPlayer
|
|
4398
4670
|
]);
|
|
4399
|
-
var
|
|
4671
|
+
var _useState74 = _sliced_to_array(useState7(null), 2), audioEngine = _useState74[0], setAudioEngine = _useState74[1];
|
|
4400
4672
|
var isAudioEngineInited = useRef8(false);
|
|
4401
|
-
|
|
4673
|
+
useEffect9(function() {
|
|
4402
4674
|
if (!audioPlayer.playing) return;
|
|
4403
4675
|
if (isAudioEngineInited.current) return;
|
|
4404
4676
|
isAudioEngineInited.current = true;
|
|
@@ -4419,7 +4691,7 @@ var useMessageAudio = function(param) {
|
|
|
4419
4691
|
audioPlayer,
|
|
4420
4692
|
isAudioEngineInited
|
|
4421
4693
|
]);
|
|
4422
|
-
var visualizationAnalyser =
|
|
4694
|
+
var visualizationAnalyser = useMemo14(function() {
|
|
4423
4695
|
if (!audioEngine) return null;
|
|
4424
4696
|
var result = audioEngine.audioContext.createAnalyser();
|
|
4425
4697
|
audioEngine.source.connect(audioEngine.audioContext.destination);
|
|
@@ -4428,7 +4700,7 @@ var useMessageAudio = function(param) {
|
|
|
4428
4700
|
}, [
|
|
4429
4701
|
audioEngine
|
|
4430
4702
|
]);
|
|
4431
|
-
var isPending =
|
|
4703
|
+
var isPending = useMemo14(function() {
|
|
4432
4704
|
return isPlaying || unplayedMessageSentences.length > 0;
|
|
4433
4705
|
}, [
|
|
4434
4706
|
isPlaying,
|
|
@@ -4443,7 +4715,7 @@ var useMessageAudio = function(param) {
|
|
|
4443
4715
|
};
|
|
4444
4716
|
// src/components/threads/AudioThread/Root/index.tsx
|
|
4445
4717
|
import { useQueryClient as useQueryClient6 } from "@tanstack/react-query";
|
|
4446
|
-
import { jsx as
|
|
4718
|
+
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
4447
4719
|
var Content6 = function(param) {
|
|
4448
4720
|
var children = param.children;
|
|
4449
4721
|
var addToast = useToasts().addToast;
|
|
@@ -4513,13 +4785,13 @@ var Content6 = function(param) {
|
|
|
4513
4785
|
createMessageProps: createMessageProps,
|
|
4514
4786
|
messageAudioProps: messageAudioProps
|
|
4515
4787
|
}).status;
|
|
4516
|
-
return /* @__PURE__ */
|
|
4788
|
+
return /* @__PURE__ */ jsx77(AudioThreadContext.Provider, {
|
|
4517
4789
|
value: {
|
|
4518
4790
|
status: status,
|
|
4519
4791
|
recorderProps: recorderProps,
|
|
4520
4792
|
messageAudioProps: messageAudioProps
|
|
4521
4793
|
},
|
|
4522
|
-
children: /* @__PURE__ */
|
|
4794
|
+
children: /* @__PURE__ */ jsx77(Flex28, {
|
|
4523
4795
|
direction: "column",
|
|
4524
4796
|
flexGrow: "1",
|
|
4525
4797
|
p: "9",
|
|
@@ -4529,16 +4801,16 @@ var Content6 = function(param) {
|
|
|
4529
4801
|
};
|
|
4530
4802
|
var Root12 = function(param) {
|
|
4531
4803
|
var children = param.children;
|
|
4532
|
-
return /* @__PURE__ */
|
|
4533
|
-
children: /* @__PURE__ */
|
|
4804
|
+
return /* @__PURE__ */ jsx77(ToastsProvider, {
|
|
4805
|
+
children: /* @__PURE__ */ jsx77(Content6, {
|
|
4534
4806
|
children: children
|
|
4535
4807
|
})
|
|
4536
4808
|
});
|
|
4537
4809
|
};
|
|
4538
4810
|
// src/components/threads/AudioThread/Visualization/index.tsx
|
|
4539
|
-
import { useContext as useContext15, useState as
|
|
4811
|
+
import { useContext as useContext15, useState as useState9, useCallback as useCallback6, useEffect as useEffect11 } from "react";
|
|
4540
4812
|
import _9 from "lodash";
|
|
4541
|
-
import { Flex as
|
|
4813
|
+
import { Flex as Flex30 } from "@radix-ui/themes";
|
|
4542
4814
|
// src/hooks/threads/useAudioThreadContext/index.ts
|
|
4543
4815
|
import { useContext as useContext14 } from "react";
|
|
4544
4816
|
var useAudioThreadContext = function() {
|
|
@@ -4546,14 +4818,14 @@ var useAudioThreadContext = function() {
|
|
|
4546
4818
|
};
|
|
4547
4819
|
// src/components/threads/AudioThread/BarsVisualizer/index.tsx
|
|
4548
4820
|
import _8 from "lodash";
|
|
4549
|
-
import { Flex as
|
|
4550
|
-
import { useState as
|
|
4821
|
+
import { Flex as Flex29, Grid } from "@radix-ui/themes";
|
|
4822
|
+
import { useState as useState8, useEffect as useEffect10, useCallback as useCallback5 } from "react";
|
|
4551
4823
|
import { cluster } from "radash";
|
|
4552
|
-
import { jsx as
|
|
4824
|
+
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
4553
4825
|
var barCount = 4;
|
|
4554
4826
|
var BarsVisualizer = function(param) {
|
|
4555
4827
|
var visualizationAnalyser = param.visualizationAnalyser, backgroundColor = param.backgroundColor, height = param.height, barWidth = param.barWidth;
|
|
4556
|
-
var
|
|
4828
|
+
var _useState8 = _sliced_to_array(useState8([]), 2), barHeights = _useState8[0], setBarHeights = _useState8[1];
|
|
4557
4829
|
var draw = useCallback5(function(param) {
|
|
4558
4830
|
var visualizationAnalyser2 = param.visualizationAnalyser;
|
|
4559
4831
|
if (!visualizationAnalyser2) {
|
|
@@ -4572,7 +4844,7 @@ var BarsVisualizer = function(param) {
|
|
|
4572
4844
|
});
|
|
4573
4845
|
});
|
|
4574
4846
|
}, []);
|
|
4575
|
-
|
|
4847
|
+
useEffect10(function() {
|
|
4576
4848
|
draw({
|
|
4577
4849
|
visualizationAnalyser: visualizationAnalyser
|
|
4578
4850
|
});
|
|
@@ -4580,7 +4852,7 @@ var BarsVisualizer = function(param) {
|
|
|
4580
4852
|
draw,
|
|
4581
4853
|
visualizationAnalyser
|
|
4582
4854
|
]);
|
|
4583
|
-
return /* @__PURE__ */
|
|
4855
|
+
return /* @__PURE__ */ jsx78(Grid, {
|
|
4584
4856
|
columns: "".concat(barCount),
|
|
4585
4857
|
gap: "1",
|
|
4586
4858
|
width: "auto",
|
|
@@ -4589,12 +4861,12 @@ var BarsVisualizer = function(param) {
|
|
|
4589
4861
|
gridTemplateColumns: "repeat(4, minmax(0, 1fr))"
|
|
4590
4862
|
},
|
|
4591
4863
|
children: barHeights.map(function(barHeight, index) {
|
|
4592
|
-
return /* @__PURE__ */
|
|
4864
|
+
return /* @__PURE__ */ jsx78(Flex29, {
|
|
4593
4865
|
direction: "column",
|
|
4594
4866
|
align: "center",
|
|
4595
4867
|
justify: "center",
|
|
4596
4868
|
height: height,
|
|
4597
|
-
children: /* @__PURE__ */
|
|
4869
|
+
children: /* @__PURE__ */ jsx78(Flex29, {
|
|
4598
4870
|
minHeight: "50%",
|
|
4599
4871
|
maxHeight: "100%",
|
|
4600
4872
|
height: "".concat(barHeight + 20, "%"),
|
|
@@ -4609,11 +4881,11 @@ var BarsVisualizer = function(param) {
|
|
|
4609
4881
|
});
|
|
4610
4882
|
};
|
|
4611
4883
|
// src/components/threads/AudioThread/Visualization/index.tsx
|
|
4612
|
-
import { jsx as
|
|
4884
|
+
import { jsx as jsx79, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
4613
4885
|
var Visualization = function() {
|
|
4614
4886
|
var audioThreadContext = useAudioThreadContext();
|
|
4615
4887
|
var assistantNameContext = useContext15(AssistantNameContext);
|
|
4616
|
-
var
|
|
4888
|
+
var _useState9 = _sliced_to_array(useState9(0), 2), scale = _useState9[0], setScale = _useState9[1];
|
|
4617
4889
|
var draw = useCallback6(function(param) {
|
|
4618
4890
|
var visualizationAnalyser = param.visualizationAnalyser;
|
|
4619
4891
|
if (!visualizationAnalyser) {
|
|
@@ -4629,7 +4901,7 @@ var Visualization = function() {
|
|
|
4629
4901
|
});
|
|
4630
4902
|
});
|
|
4631
4903
|
}, []);
|
|
4632
|
-
|
|
4904
|
+
useEffect11(function() {
|
|
4633
4905
|
draw({
|
|
4634
4906
|
visualizationAnalyser: audioThreadContext.recorderProps.visualizationAnalyser
|
|
4635
4907
|
});
|
|
@@ -4637,14 +4909,14 @@ var Visualization = function() {
|
|
|
4637
4909
|
draw,
|
|
4638
4910
|
audioThreadContext
|
|
4639
4911
|
]);
|
|
4640
|
-
return /* @__PURE__ */
|
|
4912
|
+
return /* @__PURE__ */ jsxs29(Flex30, {
|
|
4641
4913
|
direction: "column",
|
|
4642
4914
|
align: "center",
|
|
4643
4915
|
justify: "center",
|
|
4644
4916
|
mb: "3",
|
|
4645
4917
|
flexGrow: "1",
|
|
4646
4918
|
children: [
|
|
4647
|
-
/* @__PURE__ */
|
|
4919
|
+
/* @__PURE__ */ jsx79(Flex30, {
|
|
4648
4920
|
align: "center",
|
|
4649
4921
|
justify: "center",
|
|
4650
4922
|
height: "200px",
|
|
@@ -4654,20 +4926,20 @@ var Visualization = function() {
|
|
|
4654
4926
|
borderRadius: "9999px",
|
|
4655
4927
|
scale: scale
|
|
4656
4928
|
},
|
|
4657
|
-
children: /* @__PURE__ */
|
|
4929
|
+
children: /* @__PURE__ */ jsx79(BarsVisualizer, {
|
|
4658
4930
|
visualizationAnalyser: audioThreadContext.messageAudioProps.visualizationAnalyser,
|
|
4659
4931
|
backgroundColor: audioThreadContext.status === "playing" ? "var(--accent-11)" : "var(--gray-11)",
|
|
4660
4932
|
height: "40px",
|
|
4661
4933
|
barWidth: "24px"
|
|
4662
4934
|
})
|
|
4663
4935
|
}),
|
|
4664
|
-
/* @__PURE__ */
|
|
4936
|
+
/* @__PURE__ */ jsxs29(Flex30, {
|
|
4665
4937
|
ml: "-22.5px",
|
|
4666
4938
|
gap: "3",
|
|
4667
4939
|
pt: "5",
|
|
4668
4940
|
children: [
|
|
4669
|
-
/* @__PURE__ */
|
|
4670
|
-
/* @__PURE__ */
|
|
4941
|
+
/* @__PURE__ */ jsx79(AssistantAvatar, {}),
|
|
4942
|
+
/* @__PURE__ */ jsx79(Name, {
|
|
4671
4943
|
children: assistantNameContext
|
|
4672
4944
|
})
|
|
4673
4945
|
]
|
|
@@ -4676,8 +4948,8 @@ var Visualization = function() {
|
|
|
4676
4948
|
});
|
|
4677
4949
|
};
|
|
4678
4950
|
// src/components/threads/AudioThread/Status/StatusMessages.tsx
|
|
4679
|
-
import { Flex as
|
|
4680
|
-
import { jsx as
|
|
4951
|
+
import { Flex as Flex31, Text as Text8 } from "@radix-ui/themes";
|
|
4952
|
+
import { jsx as jsx80, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
4681
4953
|
var html = function(param) {
|
|
4682
4954
|
var texts = param.texts;
|
|
4683
4955
|
return "\n .status-messages-texts:after {\n content: '".concat(texts[0], "';\n animation: texts ").concat(texts.length * 5, "s linear infinite;\n }\n\n @keyframes texts {\n ").concat(texts.map(function(_10, i) {
|
|
@@ -4686,17 +4958,17 @@ var html = function(param) {
|
|
|
4686
4958
|
};
|
|
4687
4959
|
var StatusMessages = function(param) {
|
|
4688
4960
|
var texts = param.texts;
|
|
4689
|
-
return /* @__PURE__ */
|
|
4961
|
+
return /* @__PURE__ */ jsxs30(Flex31, {
|
|
4690
4962
|
justify: "center",
|
|
4691
4963
|
pb: "5",
|
|
4692
4964
|
children: [
|
|
4693
|
-
/* @__PURE__ */
|
|
4965
|
+
/* @__PURE__ */ jsx80(Text8, {
|
|
4694
4966
|
size: "2",
|
|
4695
4967
|
weight: "regular",
|
|
4696
4968
|
color: "gray",
|
|
4697
4969
|
className: "status-messages-texts"
|
|
4698
4970
|
}),
|
|
4699
|
-
/* @__PURE__ */
|
|
4971
|
+
/* @__PURE__ */ jsx80("style", {
|
|
4700
4972
|
dangerouslySetInnerHTML: {
|
|
4701
4973
|
__html: html({
|
|
4702
4974
|
texts: texts
|
|
@@ -4707,11 +4979,11 @@ var StatusMessages = function(param) {
|
|
|
4707
4979
|
});
|
|
4708
4980
|
};
|
|
4709
4981
|
// src/components/threads/AudioThread/Status/index.tsx
|
|
4710
|
-
import { jsx as
|
|
4982
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
4711
4983
|
var Status = function() {
|
|
4712
4984
|
var audioThreadContext = useAudioThreadContext();
|
|
4713
4985
|
if (audioThreadContext.status === "recording") {
|
|
4714
|
-
return /* @__PURE__ */
|
|
4986
|
+
return /* @__PURE__ */ jsx81(StatusMessages, {
|
|
4715
4987
|
texts: [
|
|
4716
4988
|
"Start speaking",
|
|
4717
4989
|
"Listening",
|
|
@@ -4725,31 +4997,31 @@ var Status = function() {
|
|
|
4725
4997
|
"idle",
|
|
4726
4998
|
"playerPaused"
|
|
4727
4999
|
].includes(audioThreadContext.status)) {
|
|
4728
|
-
return /* @__PURE__ */
|
|
5000
|
+
return /* @__PURE__ */ jsx81(StatusMessages, {
|
|
4729
5001
|
texts: [
|
|
4730
5002
|
"Click the button below to activate"
|
|
4731
5003
|
]
|
|
4732
5004
|
});
|
|
4733
5005
|
}
|
|
4734
5006
|
if (audioThreadContext.status === "playing") {
|
|
4735
|
-
return /* @__PURE__ */
|
|
5007
|
+
return /* @__PURE__ */ jsx81(StatusMessages, {
|
|
4736
5008
|
texts: [
|
|
4737
5009
|
"Click the button below to interrupt"
|
|
4738
5010
|
]
|
|
4739
5011
|
});
|
|
4740
5012
|
}
|
|
4741
|
-
return /* @__PURE__ */
|
|
5013
|
+
return /* @__PURE__ */ jsx81(StatusMessages, {
|
|
4742
5014
|
texts: [
|
|
4743
5015
|
"Thinking"
|
|
4744
5016
|
]
|
|
4745
5017
|
});
|
|
4746
5018
|
};
|
|
4747
5019
|
// src/components/threads/AudioThread/Form/index.tsx
|
|
4748
|
-
import { Flex as
|
|
5020
|
+
import { Flex as Flex33 } from "@radix-ui/themes";
|
|
4749
5021
|
// src/components/threads/AudioThread/Form/MicIcon.tsx
|
|
4750
|
-
import { jsx as
|
|
5022
|
+
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
4751
5023
|
var MicIcon = function(props) {
|
|
4752
|
-
return /* @__PURE__ */
|
|
5024
|
+
return /* @__PURE__ */ jsx82("svg", _object_spread_props(_object_spread({
|
|
4753
5025
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4754
5026
|
fill: "currentColor",
|
|
4755
5027
|
stroke: "currentColor",
|
|
@@ -4758,54 +5030,54 @@ var MicIcon = function(props) {
|
|
|
4758
5030
|
height: "15",
|
|
4759
5031
|
width: "15"
|
|
4760
5032
|
}, props), {
|
|
4761
|
-
children: /* @__PURE__ */
|
|
5033
|
+
children: /* @__PURE__ */ jsx82("path", {
|
|
4762
5034
|
stroke: "none",
|
|
4763
5035
|
d: "M192 0c-53 0-96 43-96 96v160c0 53 43 96 96 96s96-43 96-96V96c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 89.1 66.2 162.7 152 174.4V464h-48c-13.3 0-24 10.7-24 24s10.7 24 24 24h144c13.3 0 24-10.7 24-24s-10.7-24-24-24h-48v-33.6c85.8-11.7 152-85.3 152-174.4v-40c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 70.7-57.3 128-128 128S64 326.7 64 256v-40z"
|
|
4764
5036
|
})
|
|
4765
5037
|
}));
|
|
4766
5038
|
};
|
|
4767
5039
|
// src/components/threads/AudioThread/Form/ActionButton/index.tsx
|
|
4768
|
-
import { Flex as
|
|
4769
|
-
import { StopIcon as StopIcon2, PauseIcon, ArrowUpIcon as ArrowUpIcon2, ResumeIcon } from "@radix-ui/react-icons";
|
|
4770
|
-
import { jsx as
|
|
5040
|
+
import { Flex as Flex32, IconButton as IconButton10 } from "@radix-ui/themes";
|
|
5041
|
+
import { StopIcon as StopIcon2, PauseIcon as PauseIcon2, ArrowUpIcon as ArrowUpIcon2, ResumeIcon } from "@radix-ui/react-icons";
|
|
5042
|
+
import { jsx as jsx83, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
4771
5043
|
var ActionButton = function() {
|
|
4772
5044
|
var audioThreadContext = useAudioThreadContext();
|
|
4773
5045
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
4774
5046
|
if (audioThreadContext.status === "recording") {
|
|
4775
|
-
return /* @__PURE__ */
|
|
5047
|
+
return /* @__PURE__ */ jsxs31(Flex32, {
|
|
4776
5048
|
align: "center",
|
|
4777
5049
|
children: [
|
|
4778
|
-
/* @__PURE__ */
|
|
5050
|
+
/* @__PURE__ */ jsx83(Flex32, {
|
|
4779
5051
|
mr: "3",
|
|
4780
5052
|
ml: "-7",
|
|
4781
|
-
children: /* @__PURE__ */
|
|
5053
|
+
children: /* @__PURE__ */ jsx83(IconButton10, {
|
|
4782
5054
|
onClick: audioThreadContext.recorderProps.pause,
|
|
4783
5055
|
color: "gray",
|
|
4784
5056
|
variant: "soft",
|
|
4785
5057
|
size: "1",
|
|
4786
|
-
children: /* @__PURE__ */
|
|
5058
|
+
children: /* @__PURE__ */ jsx83(PauseIcon2, {})
|
|
4787
5059
|
})
|
|
4788
5060
|
}),
|
|
4789
|
-
/* @__PURE__ */
|
|
5061
|
+
/* @__PURE__ */ jsx83(IconButton10, {
|
|
4790
5062
|
onClick: audioThreadContext.recorderProps.stop,
|
|
4791
5063
|
highContrast: true,
|
|
4792
5064
|
variant: "soft",
|
|
4793
5065
|
size: "4",
|
|
4794
|
-
children: /* @__PURE__ */
|
|
5066
|
+
children: /* @__PURE__ */ jsx83(ArrowUpIcon2, {})
|
|
4795
5067
|
})
|
|
4796
5068
|
]
|
|
4797
5069
|
});
|
|
4798
5070
|
}
|
|
4799
5071
|
if (audioThreadContext.status === "recorderPaused") {
|
|
4800
|
-
return /* @__PURE__ */
|
|
5072
|
+
return /* @__PURE__ */ jsx83(IconButton10, {
|
|
4801
5073
|
onClick: audioThreadContext.recorderProps.resume,
|
|
4802
5074
|
color: "red",
|
|
4803
5075
|
size: "4",
|
|
4804
|
-
children: /* @__PURE__ */
|
|
5076
|
+
children: /* @__PURE__ */ jsx83(ResumeIcon, {})
|
|
4805
5077
|
});
|
|
4806
5078
|
}
|
|
4807
5079
|
if (audioThreadContext.status === "idle") {
|
|
4808
|
-
return /* @__PURE__ */
|
|
5080
|
+
return /* @__PURE__ */ jsx83(IconButton10, {
|
|
4809
5081
|
onClick: function() {
|
|
4810
5082
|
return audioThreadContext.recorderProps.start();
|
|
4811
5083
|
},
|
|
@@ -4814,7 +5086,7 @@ var ActionButton = function() {
|
|
|
4814
5086
|
});
|
|
4815
5087
|
}
|
|
4816
5088
|
if (audioThreadContext.status === "playing") {
|
|
4817
|
-
return /* @__PURE__ */
|
|
5089
|
+
return /* @__PURE__ */ jsx83(IconButton10, {
|
|
4818
5090
|
onClick: function() {
|
|
4819
5091
|
var _superinterfaceContext_createMessageAbortControllerRef_current;
|
|
4820
5092
|
audioThreadContext.messageAudioProps.stop();
|
|
@@ -4824,54 +5096,54 @@ var ActionButton = function() {
|
|
|
4824
5096
|
size: "4",
|
|
4825
5097
|
color: "gray",
|
|
4826
5098
|
variant: "soft",
|
|
4827
|
-
children: /* @__PURE__ */
|
|
5099
|
+
children: /* @__PURE__ */ jsx83(StopIcon2, {})
|
|
4828
5100
|
});
|
|
4829
5101
|
}
|
|
4830
5102
|
if (audioThreadContext.status === "playerPaused") {
|
|
4831
|
-
return /* @__PURE__ */
|
|
5103
|
+
return /* @__PURE__ */ jsx83(IconButton10, {
|
|
4832
5104
|
onClick: function() {
|
|
4833
5105
|
return audioThreadContext.messageAudioProps.play();
|
|
4834
5106
|
},
|
|
4835
5107
|
size: "4",
|
|
4836
|
-
children: /* @__PURE__ */
|
|
5108
|
+
children: /* @__PURE__ */ jsx83(ResumeIcon, {})
|
|
4837
5109
|
});
|
|
4838
5110
|
}
|
|
4839
|
-
return /* @__PURE__ */
|
|
5111
|
+
return /* @__PURE__ */ jsx83(IconButton10, {
|
|
4840
5112
|
size: "4",
|
|
4841
5113
|
variant: "soft",
|
|
4842
5114
|
disabled: true
|
|
4843
5115
|
});
|
|
4844
5116
|
};
|
|
4845
5117
|
// src/components/threads/AudioThread/Form/index.tsx
|
|
4846
|
-
import { jsx as
|
|
5118
|
+
import { jsx as jsx84, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
4847
5119
|
var Form = function() {
|
|
4848
5120
|
var audioThreadContext = useAudioThreadContext();
|
|
4849
|
-
return /* @__PURE__ */
|
|
5121
|
+
return /* @__PURE__ */ jsxs32(Flex33, {
|
|
4850
5122
|
direction: "column",
|
|
4851
5123
|
align: "center",
|
|
4852
5124
|
children: [
|
|
4853
|
-
/* @__PURE__ */
|
|
5125
|
+
/* @__PURE__ */ jsxs32(Flex33, {
|
|
4854
5126
|
pb: "3",
|
|
4855
5127
|
align: "center",
|
|
4856
5128
|
children: [
|
|
4857
|
-
/* @__PURE__ */
|
|
5129
|
+
/* @__PURE__ */ jsx84(Flex33, {
|
|
4858
5130
|
ml: "-22.5px",
|
|
4859
5131
|
mr: "2",
|
|
4860
5132
|
align: "center",
|
|
4861
|
-
children: /* @__PURE__ */
|
|
5133
|
+
children: /* @__PURE__ */ jsx84(MicIcon, {
|
|
4862
5134
|
style: {
|
|
4863
5135
|
color: audioThreadContext.status === "recording" ? "var(--accent-11)" : "var(--gray-11)"
|
|
4864
5136
|
}
|
|
4865
5137
|
})
|
|
4866
5138
|
}),
|
|
4867
|
-
/* @__PURE__ */
|
|
5139
|
+
/* @__PURE__ */ jsx84(Flex33, {
|
|
4868
5140
|
px: "2",
|
|
4869
5141
|
py: "1",
|
|
4870
5142
|
style: {
|
|
4871
5143
|
backgroundColor: audioThreadContext.status === "recording" ? "var(--accent-4)" : "var(--gray-4)",
|
|
4872
5144
|
borderRadius: "var(--radius-6)"
|
|
4873
5145
|
},
|
|
4874
|
-
children: /* @__PURE__ */
|
|
5146
|
+
children: /* @__PURE__ */ jsx84(BarsVisualizer, {
|
|
4875
5147
|
visualizationAnalyser: audioThreadContext.recorderProps.visualizationAnalyser,
|
|
4876
5148
|
backgroundColor: audioThreadContext.status === "recording" ? "var(--accent-11)" : "var(--gray-11)",
|
|
4877
5149
|
height: "20px",
|
|
@@ -4880,33 +5152,34 @@ var Form = function() {
|
|
|
4880
5152
|
})
|
|
4881
5153
|
]
|
|
4882
5154
|
}),
|
|
4883
|
-
/* @__PURE__ */
|
|
5155
|
+
/* @__PURE__ */ jsx84(ActionButton, {})
|
|
4884
5156
|
]
|
|
4885
5157
|
});
|
|
4886
5158
|
};
|
|
4887
5159
|
// src/components/threads/AudioThread/index.tsx
|
|
4888
|
-
import { jsx as
|
|
5160
|
+
import { jsx as jsx85, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4889
5161
|
var AudioThread = function(props) {
|
|
4890
|
-
return /* @__PURE__ */
|
|
5162
|
+
return /* @__PURE__ */ jsxs33(Root12, _object_spread_props(_object_spread({}, props), {
|
|
4891
5163
|
children: [
|
|
4892
|
-
/* @__PURE__ */
|
|
4893
|
-
/* @__PURE__ */
|
|
4894
|
-
/* @__PURE__ */
|
|
5164
|
+
/* @__PURE__ */ jsx85(Visualization, {}),
|
|
5165
|
+
/* @__PURE__ */ jsx85(Status, {}),
|
|
5166
|
+
/* @__PURE__ */ jsx85(Form, {})
|
|
4895
5167
|
]
|
|
4896
5168
|
}));
|
|
4897
5169
|
};
|
|
4898
5170
|
AudioThread.Root = Root12;
|
|
4899
5171
|
AudioThread.Visualization = Visualization;
|
|
5172
|
+
AudioThread.Status = Status;
|
|
4900
5173
|
AudioThread.Form = Form;
|
|
4901
5174
|
// src/components/threads/AudioThreadDialog/index.tsx
|
|
4902
|
-
import { jsx as
|
|
5175
|
+
import { jsx as jsx86, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4903
5176
|
var AudioThreadDialog = function() {
|
|
4904
|
-
return /* @__PURE__ */
|
|
5177
|
+
return /* @__PURE__ */ jsxs34(Root9, {
|
|
4905
5178
|
children: [
|
|
4906
|
-
/* @__PURE__ */
|
|
4907
|
-
children: /* @__PURE__ */
|
|
5179
|
+
/* @__PURE__ */ jsx86(Content5.Root, {
|
|
5180
|
+
children: /* @__PURE__ */ jsx86(AudioThread, {})
|
|
4908
5181
|
}),
|
|
4909
|
-
/* @__PURE__ */
|
|
5182
|
+
/* @__PURE__ */ jsx86(Trigger, {})
|
|
4910
5183
|
]
|
|
4911
5184
|
});
|
|
4912
5185
|
};
|
|
@@ -4914,17 +5187,17 @@ AudioThreadDialog.Root = Root9;
|
|
|
4914
5187
|
AudioThreadDialog.Trigger = Trigger;
|
|
4915
5188
|
AudioThreadDialog.Content = Content5;
|
|
4916
5189
|
// src/components/suggestions/Suggestions/index.tsx
|
|
4917
|
-
import { useMemo as
|
|
5190
|
+
import { useMemo as useMemo16 } from "react";
|
|
4918
5191
|
// src/components/suggestions/Suggestions/Content.tsx
|
|
4919
|
-
import { useMemo as
|
|
5192
|
+
import { useMemo as useMemo15 } from "react";
|
|
4920
5193
|
import { isEmpty as isEmpty3 } from "radash";
|
|
4921
5194
|
import { onlyText } from "react-children-utilities";
|
|
4922
|
-
import { Flex as
|
|
5195
|
+
import { Flex as Flex34 } from "@radix-ui/themes";
|
|
4923
5196
|
// src/components/suggestions/Suggestions/Item.tsx
|
|
4924
5197
|
import { ArrowUpIcon as ArrowUpIcon3 } from "@radix-ui/react-icons";
|
|
4925
5198
|
import { Text as Text9, Button as Button4, Spinner as Spinner2 } from "@radix-ui/themes";
|
|
4926
5199
|
import { useQueryClient as useQueryClient7 } from "@tanstack/react-query";
|
|
4927
|
-
import { jsx as
|
|
5200
|
+
import { jsx as jsx87, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
4928
5201
|
var Item = function(param) {
|
|
4929
5202
|
var suggestion = param.suggestion, isDisabled = param.isDisabled;
|
|
4930
5203
|
var addToast = useToasts().addToast;
|
|
@@ -4937,7 +5210,7 @@ var Item = function(param) {
|
|
|
4937
5210
|
threadContext: threadContext
|
|
4938
5211
|
})
|
|
4939
5212
|
}), createMessage = _useCreateMessage.createMessage, isPending = _useCreateMessage.isPending;
|
|
4940
|
-
return /* @__PURE__ */
|
|
5213
|
+
return /* @__PURE__ */ jsx87(Content7, {
|
|
4941
5214
|
onClick: function() {
|
|
4942
5215
|
createMessage({
|
|
4943
5216
|
// @ts-ignore-next-line
|
|
@@ -4951,7 +5224,7 @@ var Item = function(param) {
|
|
|
4951
5224
|
};
|
|
4952
5225
|
var Content7 = function(param) {
|
|
4953
5226
|
var onClick = param.onClick, isDisabled = param.isDisabled, isPending = param.isPending, children = param.children;
|
|
4954
|
-
return /* @__PURE__ */
|
|
5227
|
+
return /* @__PURE__ */ jsxs35(Button4, {
|
|
4955
5228
|
variant: "soft",
|
|
4956
5229
|
onClick: onClick,
|
|
4957
5230
|
disabled: isDisabled,
|
|
@@ -4961,14 +5234,14 @@ var Content7 = function(param) {
|
|
|
4961
5234
|
flexShrink: 1
|
|
4962
5235
|
},
|
|
4963
5236
|
children: [
|
|
4964
|
-
/* @__PURE__ */
|
|
5237
|
+
/* @__PURE__ */ jsx87(Text9, {
|
|
4965
5238
|
size: "1",
|
|
4966
5239
|
weight: "regular",
|
|
4967
5240
|
children: children
|
|
4968
5241
|
}),
|
|
4969
|
-
/* @__PURE__ */
|
|
5242
|
+
/* @__PURE__ */ jsx87(Spinner2, {
|
|
4970
5243
|
loading: isPending,
|
|
4971
|
-
children: /* @__PURE__ */
|
|
5244
|
+
children: /* @__PURE__ */ jsx87(ArrowUpIcon3, {
|
|
4972
5245
|
style: {
|
|
4973
5246
|
flexShrink: 0
|
|
4974
5247
|
}
|
|
@@ -4979,11 +5252,11 @@ var Content7 = function(param) {
|
|
|
4979
5252
|
};
|
|
4980
5253
|
Item.Content = Content7;
|
|
4981
5254
|
// src/components/suggestions/Suggestions/Content.tsx
|
|
4982
|
-
import { jsx as
|
|
5255
|
+
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
4983
5256
|
var Content8 = function(param) {
|
|
4984
5257
|
var children = param.children;
|
|
4985
5258
|
var isMutatingMessage = useIsMutatingMessage();
|
|
4986
|
-
var suggestions =
|
|
5259
|
+
var suggestions = useMemo15(function() {
|
|
4987
5260
|
return onlyText(children).split(/\r?\n/).filter(function(c) {
|
|
4988
5261
|
return !isEmpty3(c);
|
|
4989
5262
|
}).map(function(c) {
|
|
@@ -4993,12 +5266,12 @@ var Content8 = function(param) {
|
|
|
4993
5266
|
children
|
|
4994
5267
|
]);
|
|
4995
5268
|
if (isEmpty3(suggestions)) return null;
|
|
4996
|
-
return /* @__PURE__ */
|
|
5269
|
+
return /* @__PURE__ */ jsx88(Flex34, {
|
|
4997
5270
|
gap: "2",
|
|
4998
5271
|
py: "2",
|
|
4999
5272
|
wrap: "wrap",
|
|
5000
5273
|
children: suggestions.map(function(suggestion) {
|
|
5001
|
-
return /* @__PURE__ */
|
|
5274
|
+
return /* @__PURE__ */ jsx88(Item, {
|
|
5002
5275
|
suggestion: suggestion,
|
|
5003
5276
|
isDisabled: isMutatingMessage
|
|
5004
5277
|
}, suggestion);
|
|
@@ -5006,11 +5279,11 @@ var Content8 = function(param) {
|
|
|
5006
5279
|
});
|
|
5007
5280
|
};
|
|
5008
5281
|
// src/components/suggestions/Suggestions/index.tsx
|
|
5009
|
-
import { jsx as
|
|
5282
|
+
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
5010
5283
|
var Suggestions = function(param) {
|
|
5011
5284
|
var children = param.children;
|
|
5012
5285
|
var latestMessageProps = useLatestMessage();
|
|
5013
|
-
var isDisabled =
|
|
5286
|
+
var isDisabled = useMemo16(function() {
|
|
5014
5287
|
var // @ts-ignore-next-line
|
|
5015
5288
|
_latestMessageProps_latestMessage_metadata, _latestMessageProps_latestMessage;
|
|
5016
5289
|
return (_latestMessageProps_latestMessage = latestMessageProps.latestMessage) === null || _latestMessageProps_latestMessage === void 0 ? void 0 : (_latestMessageProps_latestMessage_metadata = _latestMessageProps_latestMessage.metadata) === null || _latestMessageProps_latestMessage_metadata === void 0 ? void 0 : _latestMessageProps_latestMessage_metadata.isBlocking;
|
|
@@ -5019,26 +5292,26 @@ var Suggestions = function(param) {
|
|
|
5019
5292
|
]);
|
|
5020
5293
|
if (latestMessageProps.isLoading) return null;
|
|
5021
5294
|
if (isDisabled) return null;
|
|
5022
|
-
return /* @__PURE__ */
|
|
5295
|
+
return /* @__PURE__ */ jsx89(Content8, {
|
|
5023
5296
|
children: children
|
|
5024
5297
|
});
|
|
5025
5298
|
};
|
|
5026
5299
|
Suggestions.Item = Item;
|
|
5027
5300
|
// src/components/markdown/MarkdownProvider/index.tsx
|
|
5028
|
-
import { useMemo as
|
|
5029
|
-
import { jsx as
|
|
5301
|
+
import { useMemo as useMemo17 } from "react";
|
|
5302
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
5030
5303
|
var MarkdownProvider = function(_param) {
|
|
5031
5304
|
var children = _param.children, rest = _object_without_properties(_param, [
|
|
5032
5305
|
"children"
|
|
5033
5306
|
]);
|
|
5034
5307
|
var prevMarkdownContext = useMarkdownContext();
|
|
5035
|
-
var value =
|
|
5308
|
+
var value = useMemo17(function() {
|
|
5036
5309
|
return merge(prevMarkdownContext, rest);
|
|
5037
5310
|
}, [
|
|
5038
5311
|
rest,
|
|
5039
5312
|
prevMarkdownContext
|
|
5040
5313
|
]);
|
|
5041
|
-
return /* @__PURE__ */
|
|
5314
|
+
return /* @__PURE__ */ jsx90(MarkdownContext.Provider, {
|
|
5042
5315
|
value: value,
|
|
5043
5316
|
children: children
|
|
5044
5317
|
});
|
|
@@ -5097,11 +5370,11 @@ var optimizedSrc = function(param) {
|
|
|
5097
5370
|
}));
|
|
5098
5371
|
};
|
|
5099
5372
|
// src/components/imageAvatars/ImageAvatar/index.tsx
|
|
5100
|
-
import { jsx as
|
|
5373
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
5101
5374
|
var ImageAvatar = function(param) {
|
|
5102
5375
|
var imageAvatar = param.imageAvatar, size = param.size;
|
|
5103
5376
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
5104
|
-
return /* @__PURE__ */
|
|
5377
|
+
return /* @__PURE__ */ jsx91(Avatar4, {
|
|
5105
5378
|
fallback: "",
|
|
5106
5379
|
src: optimizedSrc({
|
|
5107
5380
|
imageAvatar: imageAvatar,
|
|
@@ -5112,84 +5385,84 @@ var ImageAvatar = function(param) {
|
|
|
5112
5385
|
});
|
|
5113
5386
|
};
|
|
5114
5387
|
// src/components/iconAvatars/IconAvatar.tsx
|
|
5115
|
-
import { useMemo as
|
|
5388
|
+
import { useMemo as useMemo18 } from "react";
|
|
5116
5389
|
import { Avatar as Avatar5 } from "@radix-ui/themes";
|
|
5117
5390
|
// src/lib/iconAvatars/iconAvatarComponents.ts
|
|
5118
5391
|
import { BackpackIcon, RocketIcon, MagicWandIcon, CubeIcon, TargetIcon, DiscIcon, GlobeIcon, StarIcon, LightningBoltIcon as LightningBoltIcon2, FaceIcon, PersonIcon as PersonIcon2, HeartIcon } from "@radix-ui/react-icons";
|
|
5119
5392
|
var _obj;
|
|
5120
5393
|
var iconAvatarComponents = (_obj = {}, _define_property(_obj, "BACKPACK" /* BACKPACK */ , BackpackIcon), _define_property(_obj, "ROCKET" /* ROCKET */ , RocketIcon), _define_property(_obj, "MAGIC_WAND" /* MAGIC_WAND */ , MagicWandIcon), _define_property(_obj, "CUBE" /* CUBE */ , CubeIcon), _define_property(_obj, "TARGET" /* TARGET */ , TargetIcon), _define_property(_obj, "DISC" /* DISC */ , DiscIcon), _define_property(_obj, "GLOBE" /* GLOBE */ , GlobeIcon), _define_property(_obj, "STAR" /* STAR */ , StarIcon), _define_property(_obj, "LIGHTNING_BOLT" /* LIGHTNING_BOLT */ , LightningBoltIcon2), _define_property(_obj, "FACE" /* FACE */ , FaceIcon), _define_property(_obj, "PERSON" /* PERSON */ , PersonIcon2), _define_property(_obj, "HEART" /* HEART */ , HeartIcon), _obj);
|
|
5121
5394
|
// src/components/iconAvatars/IconAvatar.tsx
|
|
5122
|
-
import { jsx as
|
|
5395
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
5123
5396
|
var IconAvatar = function(param) {
|
|
5124
5397
|
var iconAvatar = param.iconAvatar, size = param.size;
|
|
5125
|
-
var Component =
|
|
5398
|
+
var Component = useMemo18(function() {
|
|
5126
5399
|
return iconAvatarComponents[iconAvatar.name];
|
|
5127
5400
|
}, [
|
|
5128
5401
|
iconAvatar
|
|
5129
5402
|
]);
|
|
5130
|
-
return /* @__PURE__ */
|
|
5403
|
+
return /* @__PURE__ */ jsx92(Avatar5, {
|
|
5131
5404
|
size: size,
|
|
5132
|
-
fallback: Component ? /* @__PURE__ */
|
|
5405
|
+
fallback: Component ? /* @__PURE__ */ jsx92(Component, {}) : ""
|
|
5133
5406
|
});
|
|
5134
5407
|
};
|
|
5135
5408
|
// src/components/avatars/Avatar.tsx
|
|
5136
|
-
import { jsx as
|
|
5409
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
5137
5410
|
var Avatar6 = function(param) {
|
|
5138
5411
|
var avatar = param.avatar, _param_size = param.size, size = _param_size === void 0 ? "1" : _param_size;
|
|
5139
5412
|
if (avatar) {
|
|
5140
5413
|
if (avatar.type === "IMAGE" /* IMAGE */ && avatar.imageAvatar) {
|
|
5141
|
-
return /* @__PURE__ */
|
|
5414
|
+
return /* @__PURE__ */ jsx93(ImageAvatar, {
|
|
5142
5415
|
imageAvatar: avatar.imageAvatar,
|
|
5143
5416
|
size: size
|
|
5144
5417
|
});
|
|
5145
5418
|
}
|
|
5146
5419
|
if (avatar.type === "ICON" /* ICON */ && avatar.iconAvatar) {
|
|
5147
|
-
return /* @__PURE__ */
|
|
5420
|
+
return /* @__PURE__ */ jsx93(IconAvatar, {
|
|
5148
5421
|
iconAvatar: avatar.iconAvatar,
|
|
5149
5422
|
size: size
|
|
5150
5423
|
});
|
|
5151
5424
|
}
|
|
5152
5425
|
}
|
|
5153
|
-
return /* @__PURE__ */
|
|
5426
|
+
return /* @__PURE__ */ jsx93(RadixAvatar, {
|
|
5154
5427
|
fallback: "",
|
|
5155
5428
|
size: size
|
|
5156
5429
|
});
|
|
5157
5430
|
};
|
|
5158
5431
|
// src/components/components/ComponentsProvider.tsx
|
|
5159
|
-
import { useMemo as
|
|
5432
|
+
import { useMemo as useMemo19 } from "react";
|
|
5160
5433
|
// src/hooks/components/useComponents.ts
|
|
5161
5434
|
import { useContext as useContext16 } from "react";
|
|
5162
5435
|
var useComponents = function() {
|
|
5163
5436
|
return useContext16(ComponentsContext);
|
|
5164
5437
|
};
|
|
5165
5438
|
// src/components/components/ComponentsProvider.tsx
|
|
5166
|
-
import { jsx as
|
|
5439
|
+
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
5167
5440
|
var ComponentsProvider = function(_param) {
|
|
5168
5441
|
var children = _param.children, rest = _object_without_properties(_param, [
|
|
5169
5442
|
"children"
|
|
5170
5443
|
]);
|
|
5171
5444
|
var prevComponents = useComponents();
|
|
5172
|
-
var value =
|
|
5445
|
+
var value = useMemo19(function() {
|
|
5173
5446
|
return merge(prevComponents, rest);
|
|
5174
5447
|
}, [
|
|
5175
5448
|
rest,
|
|
5176
5449
|
prevComponents
|
|
5177
5450
|
]);
|
|
5178
|
-
return /* @__PURE__ */
|
|
5451
|
+
return /* @__PURE__ */ jsx94(ComponentsContext.Provider, {
|
|
5179
5452
|
value: value,
|
|
5180
5453
|
children: children
|
|
5181
5454
|
});
|
|
5182
5455
|
};
|
|
5183
5456
|
// src/components/assistants/AssistantProvider/index.tsx
|
|
5184
|
-
import { useMemo as
|
|
5457
|
+
import { useMemo as useMemo21 } from "react";
|
|
5185
5458
|
import { Theme } from "@radix-ui/themes";
|
|
5186
5459
|
// src/components/assistants/AssistantProvider/Code.tsx
|
|
5187
|
-
import { useMemo as
|
|
5188
|
-
import { jsx as
|
|
5460
|
+
import { useMemo as useMemo20 } from "react";
|
|
5461
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
5189
5462
|
var Code4 = function(param) {
|
|
5190
5463
|
var children = param.children, className = param.className, markdownContext = param.markdownContext;
|
|
5191
5464
|
var messageContext = useMessageContext();
|
|
5192
|
-
var isAssistantMessage =
|
|
5465
|
+
var isAssistantMessage = useMemo20(function() {
|
|
5193
5466
|
var _messageContext_message;
|
|
5194
5467
|
return ((_messageContext_message = messageContext.message) === null || _messageContext_message === void 0 ? void 0 : _messageContext_message.role) === "assistant";
|
|
5195
5468
|
}, [
|
|
@@ -5201,12 +5474,12 @@ var Code4 = function(param) {
|
|
|
5201
5474
|
className: className
|
|
5202
5475
|
});
|
|
5203
5476
|
}
|
|
5204
|
-
return /* @__PURE__ */
|
|
5477
|
+
return /* @__PURE__ */ jsx95(Suggestions, {
|
|
5205
5478
|
children: children
|
|
5206
5479
|
});
|
|
5207
5480
|
};
|
|
5208
5481
|
// src/components/assistants/AssistantProvider/index.tsx
|
|
5209
|
-
import { jsx as
|
|
5482
|
+
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
5210
5483
|
var AssistantProvider = function(param) {
|
|
5211
5484
|
var children = param.children;
|
|
5212
5485
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
@@ -5214,11 +5487,11 @@ var AssistantProvider = function(param) {
|
|
|
5214
5487
|
assistantId: superinterfaceContext.variables.assistantId
|
|
5215
5488
|
}).assistant;
|
|
5216
5489
|
var markdownContext = useMarkdownContext();
|
|
5217
|
-
var components2 =
|
|
5490
|
+
var components2 = useMemo21(function() {
|
|
5218
5491
|
return {
|
|
5219
5492
|
code: function(props) {
|
|
5220
5493
|
return(// @ts-ignore-next-line
|
|
5221
|
-
/* @__PURE__ */
|
|
5494
|
+
/* @__PURE__ */ jsx96(Code4, _object_spread_props(_object_spread({}, props), {
|
|
5222
5495
|
markdownContext: markdownContext
|
|
5223
5496
|
})));
|
|
5224
5497
|
}
|
|
@@ -5229,7 +5502,7 @@ var AssistantProvider = function(param) {
|
|
|
5229
5502
|
if (!assistant) {
|
|
5230
5503
|
return null;
|
|
5231
5504
|
}
|
|
5232
|
-
return /* @__PURE__ */
|
|
5505
|
+
return /* @__PURE__ */ jsx96(Theme, {
|
|
5233
5506
|
accentColor: assistant.theme.accentColor,
|
|
5234
5507
|
grayColor: assistant.theme.grayColor,
|
|
5235
5508
|
radius: assistant.theme.radius,
|
|
@@ -5237,13 +5510,13 @@ var AssistantProvider = function(param) {
|
|
|
5237
5510
|
scaling: assistant.theme.scaling,
|
|
5238
5511
|
panelBackground: "solid",
|
|
5239
5512
|
hasBackground: false,
|
|
5240
|
-
children: /* @__PURE__ */
|
|
5513
|
+
children: /* @__PURE__ */ jsx96(AssistantNameContext.Provider, {
|
|
5241
5514
|
value: assistant.name,
|
|
5242
|
-
children: /* @__PURE__ */
|
|
5243
|
-
value: /* @__PURE__ */
|
|
5515
|
+
children: /* @__PURE__ */ jsx96(AssistantAvatarContext.Provider, {
|
|
5516
|
+
value: /* @__PURE__ */ jsx96(Avatar6, {
|
|
5244
5517
|
avatar: assistant.avatar
|
|
5245
5518
|
}),
|
|
5246
|
-
children: /* @__PURE__ */
|
|
5519
|
+
children: /* @__PURE__ */ jsx96(MarkdownProvider, {
|
|
5247
5520
|
components: components2,
|
|
5248
5521
|
children: children
|
|
5249
5522
|
})
|