@blank-utils/llm 0.3.17 → 0.3.18
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/{chunk-CU46QZJ4.js → chunk-VJDH5U3G.js} +76 -76
- package/dist/index.css +360 -545
- package/dist/index.js +1 -1
- package/dist/react/index.css +360 -545
- package/dist/react/index.js +1 -1
- package/package.json +1 -1
|
@@ -1006,7 +1006,7 @@ ${newText}` : newText);
|
|
|
1006
1006
|
return /* @__PURE__ */ jsxs2(
|
|
1007
1007
|
"div",
|
|
1008
1008
|
{
|
|
1009
|
-
className: `relative flex flex-col bg-
|
|
1009
|
+
className: `relative flex flex-col bg-[#fafafa] dark:bg-black border-2 border-black dark:border-white rounded-none focus-within:ring-0 focus-within:border-black dark:focus-within:border-white transition-none p-4 font-mono ${className}`,
|
|
1010
1010
|
onDragOver: (e) => {
|
|
1011
1011
|
e.preventDefault();
|
|
1012
1012
|
setIsDragging(true);
|
|
@@ -1014,9 +1014,9 @@ ${newText}` : newText);
|
|
|
1014
1014
|
onDragLeave: () => setIsDragging(false),
|
|
1015
1015
|
onDrop: handleDrop,
|
|
1016
1016
|
children: [
|
|
1017
|
-
isDragging && /* @__PURE__ */ jsxs2("div", { className: "absolute inset-0 bg-
|
|
1018
|
-
/* @__PURE__ */ jsx2(ImagePlus, { className: "w-
|
|
1019
|
-
/* @__PURE__ */ jsx2("span", { className: "text-
|
|
1017
|
+
isDragging && /* @__PURE__ */ jsxs2("div", { className: "absolute inset-x-0 inset-y-0 bg-[#fafafa]/90 dark:bg-black/90 flex flex-col items-center justify-center z-20 border-4 border-dashed border-black dark:border-white rounded-none mx-2 my-2", children: [
|
|
1018
|
+
/* @__PURE__ */ jsx2(ImagePlus, { className: "w-10 h-10 text-black dark:text-white mb-4" }),
|
|
1019
|
+
/* @__PURE__ */ jsx2("span", { className: "text-black dark:text-white font-bold tracking-widest uppercase text-lg", children: "Drop file to attach" })
|
|
1020
1020
|
] }),
|
|
1021
1021
|
/* @__PURE__ */ jsx2(
|
|
1022
1022
|
"input",
|
|
@@ -1029,15 +1029,15 @@ ${newText}` : newText);
|
|
|
1029
1029
|
onChange: handleFileSelect
|
|
1030
1030
|
}
|
|
1031
1031
|
),
|
|
1032
|
-
images.length > 0 && /* @__PURE__ */ jsx2("div", { className: "flex flex-wrap gap-
|
|
1033
|
-
/* @__PURE__ */ jsx2("img", { src: img.dataUrl, alt: "attachment", className: "w-full h-full object-cover transition-
|
|
1032
|
+
images.length > 0 && /* @__PURE__ */ jsx2("div", { className: "flex flex-wrap gap-3 mb-4 px-2 mt-2", children: images.map((img) => /* @__PURE__ */ jsxs2("div", { className: "relative w-20 h-20 overflow-hidden border-2 border-black dark:border-white rounded-none group select-none", children: [
|
|
1033
|
+
/* @__PURE__ */ jsx2("img", { src: img.dataUrl, alt: "attachment", className: "w-full h-full object-cover grayscale transition-all group-hover:grayscale-0" }),
|
|
1034
1034
|
/* @__PURE__ */ jsx2(
|
|
1035
1035
|
"button",
|
|
1036
1036
|
{
|
|
1037
1037
|
type: "button",
|
|
1038
|
-
className: "absolute top-
|
|
1038
|
+
className: "absolute top-0 right-0 w-6 h-6 bg-black text-white dark:bg-white dark:text-black border-l-2 border-b-2 border-black dark:border-white rounded-none flex items-center justify-center opacity-0 group-hover:opacity-100 transition-none",
|
|
1039
1039
|
onClick: () => onImageRemove?.(img.id),
|
|
1040
|
-
children: /* @__PURE__ */ jsx2(X, { className: "w-
|
|
1040
|
+
children: /* @__PURE__ */ jsx2(X, { className: "w-4 h-4" })
|
|
1041
1041
|
}
|
|
1042
1042
|
)
|
|
1043
1043
|
] }, img.id)) }),
|
|
@@ -1052,45 +1052,45 @@ ${newText}` : newText);
|
|
|
1052
1052
|
placeholder,
|
|
1053
1053
|
disabled: disabled && !isGenerating,
|
|
1054
1054
|
rows: 1,
|
|
1055
|
-
className: "w-full min-h-[24px] max-h-[200px] resize-none border-none outline-none bg-transparent text-
|
|
1055
|
+
className: "w-full min-h-[24px] max-h-[200px] resize-none border-none outline-none bg-transparent text-black dark:text-white text-base font-mono leading-relaxed px-2 py-1 m-0 placeholder:text-black/30 dark:placeholder:text-white/30 placeholder:uppercase placeholder:tracking-widest scrollbar-thin scrollbar-thumb-black dark:scrollbar-thumb-white scrollbar-track-transparent"
|
|
1056
1056
|
}
|
|
1057
1057
|
),
|
|
1058
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-end justify-between mt-
|
|
1059
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-
|
|
1058
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-end justify-between mt-6 px-2", children: [
|
|
1059
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-3", children: [
|
|
1060
1060
|
modelSelector && /* @__PURE__ */ jsx2("div", { className: "mr-2", children: modelSelector }),
|
|
1061
1061
|
/* @__PURE__ */ jsx2(
|
|
1062
1062
|
"button",
|
|
1063
1063
|
{
|
|
1064
1064
|
type: "button",
|
|
1065
|
-
className: "flex items-center justify-center w-
|
|
1065
|
+
className: "flex items-center justify-center w-10 h-10 border-2 border-black dark:border-white rounded-none text-black dark:text-white hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black transition-colors",
|
|
1066
1066
|
onClick: () => fileInputRef.current?.click(),
|
|
1067
1067
|
title: "Attach image or PDF (Ctrl+V to paste)",
|
|
1068
|
-
children: /* @__PURE__ */ jsx2(ImagePlus, { className: "w-
|
|
1068
|
+
children: /* @__PURE__ */ jsx2(ImagePlus, { className: "w-5 h-5" })
|
|
1069
1069
|
}
|
|
1070
1070
|
),
|
|
1071
1071
|
actions
|
|
1072
1072
|
] }),
|
|
1073
|
-
/* @__PURE__ */ jsx2("div", { className: "flex items-center gap-
|
|
1073
|
+
/* @__PURE__ */ jsx2("div", { className: "flex items-center gap-3", children: isGenerating ? /* @__PURE__ */ jsxs2(
|
|
1074
1074
|
"button",
|
|
1075
1075
|
{
|
|
1076
1076
|
type: "button",
|
|
1077
|
-
className: "flex items-center justify-center h-
|
|
1077
|
+
className: "flex items-center justify-center h-10 px-6 rounded-none border-2 border-red-500 bg-red-50 dark:bg-red-950/20 text-red-600 dark:text-red-400 hover:bg-red-500 hover:text-white font-bold uppercase tracking-widest transition-colors gap-2 cursor-pointer shadow-none",
|
|
1078
1078
|
onClick: onStop,
|
|
1079
1079
|
children: [
|
|
1080
|
-
/* @__PURE__ */ jsx2(Square, { className: "w-
|
|
1081
|
-
"
|
|
1080
|
+
/* @__PURE__ */ jsx2(Square, { className: "w-4 h-4 fill-current" }),
|
|
1081
|
+
" STOP"
|
|
1082
1082
|
]
|
|
1083
1083
|
}
|
|
1084
1084
|
) : /* @__PURE__ */ jsxs2(
|
|
1085
1085
|
"button",
|
|
1086
1086
|
{
|
|
1087
1087
|
type: "button",
|
|
1088
|
-
className: `flex items-center justify-center h-
|
|
1088
|
+
className: `flex items-center justify-center h-10 px-6 rounded-none border-2 font-bold uppercase tracking-widest transition-none gap-2 ${canSend ? "border-black dark:border-white bg-black dark:bg-white text-[#fafafa] dark:text-black hover:bg-transparent hover:text-black dark:hover:bg-transparent dark:hover:text-white cursor-pointer" : "border-black/20 dark:border-white/20 bg-transparent text-black/20 dark:text-white/20 cursor-not-allowed"}`,
|
|
1089
1089
|
onClick: onSend,
|
|
1090
1090
|
disabled: !canSend,
|
|
1091
1091
|
children: [
|
|
1092
|
-
"
|
|
1093
|
-
/* @__PURE__ */ jsx2(Send, { className: "w-
|
|
1092
|
+
"SEND ",
|
|
1093
|
+
/* @__PURE__ */ jsx2(Send, { className: "w-4 h-4" })
|
|
1094
1094
|
]
|
|
1095
1095
|
}
|
|
1096
1096
|
) })
|
|
@@ -1166,20 +1166,20 @@ function isVisionModel2(modelId) {
|
|
|
1166
1166
|
return lower.includes("vl") || lower.includes("vision") || lower.includes("moondream");
|
|
1167
1167
|
}
|
|
1168
1168
|
var markdownComponents = {
|
|
1169
|
-
h1: ({ children }) => /* @__PURE__ */ jsx3("h1", { className: "text-3xl font-bold tracking-tight mt-
|
|
1170
|
-
h2: ({ children }) => /* @__PURE__ */ jsx3("h2", { className: "text-2xl font-
|
|
1171
|
-
h3: ({ children }) => /* @__PURE__ */ jsx3("h3", { className: "text-xl font-
|
|
1172
|
-
h4: ({ children }) => /* @__PURE__ */ jsx3("h4", { className: "text-lg font-
|
|
1173
|
-
p: ({ children }) => /* @__PURE__ */ jsx3("p", { className: "leading-
|
|
1174
|
-
ul: ({ children }) => /* @__PURE__ */ jsx3("ul", { className: "my-
|
|
1175
|
-
ol: ({ children }) => /* @__PURE__ */ jsx3("ol", { className: "my-
|
|
1169
|
+
h1: ({ children }) => /* @__PURE__ */ jsx3("h1", { className: "text-3xl font-bold uppercase tracking-tight mt-8 mb-4 text-black dark:text-white border-b-2 border-black dark:border-white pb-2", children }),
|
|
1170
|
+
h2: ({ children }) => /* @__PURE__ */ jsx3("h2", { className: "text-2xl font-bold uppercase tracking-tight mt-8 mb-4 text-black dark:text-white border-b-2 border-black dark:border-white pb-2", children }),
|
|
1171
|
+
h3: ({ children }) => /* @__PURE__ */ jsx3("h3", { className: "text-xl font-bold uppercase tracking-tight mt-6 mb-3 text-black dark:text-white", children }),
|
|
1172
|
+
h4: ({ children }) => /* @__PURE__ */ jsx3("h4", { className: "text-lg font-bold uppercase tracking-tight mt-4 mb-2 text-black dark:text-white", children }),
|
|
1173
|
+
p: ({ children }) => /* @__PURE__ */ jsx3("p", { className: "leading-relaxed [&:not(:first-child)]:mt-5 text-black dark:text-white text-base font-mono", children }),
|
|
1174
|
+
ul: ({ children }) => /* @__PURE__ */ jsx3("ul", { className: "my-5 ml-6 list-square [&>li]:mt-2 text-black dark:text-white font-mono", children }),
|
|
1175
|
+
ol: ({ children }) => /* @__PURE__ */ jsx3("ol", { className: "my-5 ml-6 list-decimal [&>li]:mt-2 text-black dark:text-white font-mono", children }),
|
|
1176
1176
|
li: ({ children }) => /* @__PURE__ */ jsx3("li", { children }),
|
|
1177
|
-
blockquote: ({ children }) => /* @__PURE__ */ jsx3("blockquote", { className: "mt-
|
|
1178
|
-
a: ({ href, children }) => /* @__PURE__ */ jsx3("a", { href, className: "font-
|
|
1179
|
-
table: ({ children }) => /* @__PURE__ */ jsx3("div", { className: "my-
|
|
1180
|
-
tr: ({ children }) => /* @__PURE__ */ jsx3("tr", { className: "m-0 border-
|
|
1181
|
-
th: ({ children }) => /* @__PURE__ */ jsx3("th", { className: "border border-
|
|
1182
|
-
td: ({ children }) => /* @__PURE__ */ jsx3("td", { className: "border border-
|
|
1177
|
+
blockquote: ({ children }) => /* @__PURE__ */ jsx3("blockquote", { className: "mt-5 border-l-4 border-black dark:border-white pl-4 italic text-black dark:text-white font-mono", children }),
|
|
1178
|
+
a: ({ href, children }) => /* @__PURE__ */ jsx3("a", { href, className: "font-bold underline text-black dark:text-white hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black transition-colors", target: "_blank", rel: "noopener noreferrer", children }),
|
|
1179
|
+
table: ({ children }) => /* @__PURE__ */ jsx3("div", { className: "my-5 w-full overflow-y-auto border-2 border-black dark:border-white", children: /* @__PURE__ */ jsx3("table", { className: "w-full text-base font-mono", children }) }),
|
|
1180
|
+
tr: ({ children }) => /* @__PURE__ */ jsx3("tr", { className: "m-0 border-b-2 border-black dark:border-white p-0 even:bg-black/5 dark:even:bg-white/5", children }),
|
|
1181
|
+
th: ({ children }) => /* @__PURE__ */ jsx3("th", { className: "border-r-2 last:border-r-0 border-black dark:border-white bg-black dark:bg-white text-white dark:text-black px-4 py-2 font-bold uppercase text-left", children }),
|
|
1182
|
+
td: ({ children }) => /* @__PURE__ */ jsx3("td", { className: "border-r-2 last:border-r-0 border-black dark:border-white px-4 py-2 text-left text-black dark:text-white", children })
|
|
1183
1183
|
};
|
|
1184
1184
|
function ModelSelector({
|
|
1185
1185
|
currentModel,
|
|
@@ -1205,27 +1205,27 @@ function ModelSelector({
|
|
|
1205
1205
|
}
|
|
1206
1206
|
return label;
|
|
1207
1207
|
}, [currentModel]);
|
|
1208
|
-
return /* @__PURE__ */ jsxs3("div", { className: "relative", ref, children: [
|
|
1208
|
+
return /* @__PURE__ */ jsxs3("div", { className: "relative font-mono", ref, children: [
|
|
1209
1209
|
/* @__PURE__ */ jsxs3(
|
|
1210
1210
|
"button",
|
|
1211
1211
|
{
|
|
1212
1212
|
type: "button",
|
|
1213
|
-
className: "flex items-center gap-
|
|
1213
|
+
className: "flex items-center gap-2 px-3 py-1.5 border-2 border-black dark:border-white bg-transparent text-black dark:text-white hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black text-xs font-bold uppercase tracking-widest transition-colors",
|
|
1214
1214
|
onClick: () => setIsOpen(!isOpen),
|
|
1215
1215
|
children: [
|
|
1216
1216
|
/* @__PURE__ */ jsx3("span", { children: displayModel }),
|
|
1217
|
-
/* @__PURE__ */ jsx3(ChevronDown, { className: "w-
|
|
1217
|
+
/* @__PURE__ */ jsx3(ChevronDown, { className: "w-4 h-4" })
|
|
1218
1218
|
]
|
|
1219
1219
|
}
|
|
1220
1220
|
),
|
|
1221
|
-
isOpen && /* @__PURE__ */ jsxs3("div", { className: "absolute top-[calc(100%+8px)] left-0 w-72 max-h-[300px] overflow-y-auto bg-
|
|
1222
|
-
/* @__PURE__ */ jsx3("div", { className: "px-3 py-
|
|
1221
|
+
isOpen && /* @__PURE__ */ jsxs3("div", { className: "absolute top-[calc(100%+8px)] left-0 w-72 max-h-[300px] overflow-y-auto bg-[#fafafa] dark:bg-black border-2 border-black dark:border-white z-50 p-2 scrollbar-none", children: [
|
|
1222
|
+
/* @__PURE__ */ jsx3("div", { className: "px-3 py-2 text-[10px] font-bold text-black/50 dark:text-white/50 uppercase tracking-widest border-b-2 border-black/10 dark:border-white/10 mb-1", children: "WebLLM" }),
|
|
1223
1223
|
Object.entries(WEBLLM_MODELS).map(([key, value]) => /* @__PURE__ */ jsxs3(
|
|
1224
1224
|
"button",
|
|
1225
1225
|
{
|
|
1226
1226
|
className: cn(
|
|
1227
|
-
"block w-full text-left px-3 py-2 text-xs font-
|
|
1228
|
-
currentModel === value ? "bg-
|
|
1227
|
+
"block w-full text-left px-3 py-2.5 text-xs font-bold uppercase tracking-wider truncate transition-colors",
|
|
1228
|
+
currentModel === value ? "bg-black text-white dark:bg-white dark:text-black" : "text-black dark:text-white hover:bg-black/10 dark:hover:bg-white/10"
|
|
1229
1229
|
),
|
|
1230
1230
|
onClick: () => {
|
|
1231
1231
|
onSelect(value);
|
|
@@ -1234,18 +1234,18 @@ function ModelSelector({
|
|
|
1234
1234
|
children: [
|
|
1235
1235
|
key,
|
|
1236
1236
|
" ",
|
|
1237
|
-
isVisionModel2(value) && /* @__PURE__ */ jsx3("span", { className: "ml-
|
|
1237
|
+
isVisionModel2(value) && /* @__PURE__ */ jsx3("span", { className: "ml-2 px-1.5 py-0.5 border border-current text-[9px]", children: "VISION" })
|
|
1238
1238
|
]
|
|
1239
1239
|
},
|
|
1240
1240
|
key
|
|
1241
1241
|
)),
|
|
1242
|
-
/* @__PURE__ */ jsx3("div", { className: "px-3 py-
|
|
1242
|
+
/* @__PURE__ */ jsx3("div", { className: "px-3 py-2 text-[10px] font-bold text-black/50 dark:text-white/50 uppercase tracking-widest mt-4 border-b-2 border-black/10 dark:border-white/10 mb-1", children: "Transformers.js" }),
|
|
1243
1243
|
Object.entries(TRANSFORMERS_MODELS).map(([key, value]) => /* @__PURE__ */ jsxs3(
|
|
1244
1244
|
"button",
|
|
1245
1245
|
{
|
|
1246
1246
|
className: cn(
|
|
1247
|
-
"block w-full text-left px-3 py-2 text-xs font-
|
|
1248
|
-
currentModel === value ? "bg-
|
|
1247
|
+
"block w-full text-left px-3 py-2.5 text-xs font-bold uppercase tracking-wider truncate transition-colors",
|
|
1248
|
+
currentModel === value ? "bg-black text-white dark:bg-white dark:text-black" : "text-black dark:text-white hover:bg-black/10 dark:hover:bg-white/10"
|
|
1249
1249
|
),
|
|
1250
1250
|
onClick: () => {
|
|
1251
1251
|
onSelect(value);
|
|
@@ -1254,7 +1254,7 @@ function ModelSelector({
|
|
|
1254
1254
|
children: [
|
|
1255
1255
|
key,
|
|
1256
1256
|
" ",
|
|
1257
|
-
isVisionModel2(value) && /* @__PURE__ */ jsx3("span", { className: "ml-
|
|
1257
|
+
isVisionModel2(value) && /* @__PURE__ */ jsx3("span", { className: "ml-2 px-1.5 py-0.5 border border-current text-[9px]", children: "VISION" })
|
|
1258
1258
|
]
|
|
1259
1259
|
},
|
|
1260
1260
|
key
|
|
@@ -1397,65 +1397,65 @@ ${systemPrompt}` : systemPrompt;
|
|
|
1397
1397
|
setStreamingText("");
|
|
1398
1398
|
}
|
|
1399
1399
|
};
|
|
1400
|
-
return /* @__PURE__ */ jsxs3("div", { className: cn("flex flex-col bg-
|
|
1401
|
-
showHeader && /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-
|
|
1400
|
+
return /* @__PURE__ */ jsxs3("div", { className: cn("flex flex-col bg-[#fafafa] dark:bg-black border-2 border-black dark:border-white font-mono rounded-none overflow-hidden", className), style: { maxHeight, height: "100%" }, children: [
|
|
1401
|
+
showHeader && /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-5 border-b-2 border-black dark:border-white bg-[#fafafa] dark:bg-black", children: [
|
|
1402
1402
|
onModelChange ? /* @__PURE__ */ jsx3(
|
|
1403
1403
|
ModelSelector,
|
|
1404
1404
|
{
|
|
1405
1405
|
currentModel: modelId,
|
|
1406
1406
|
onSelect: onModelChange
|
|
1407
1407
|
}
|
|
1408
|
-
) : /* @__PURE__ */ jsxs3("div", { className: "px-
|
|
1409
|
-
/* @__PURE__ */ jsx3("span", { className: "text-
|
|
1410
|
-
modelId && isVisionModel2(modelId) && /* @__PURE__ */ jsx3("span", { className: "px-
|
|
1408
|
+
) : /* @__PURE__ */ jsxs3("div", { className: "px-4 py-1.5 border-2 border-black dark:border-white flex items-center gap-3", children: [
|
|
1409
|
+
/* @__PURE__ */ jsx3("span", { className: "text-sm font-bold uppercase tracking-widest text-black dark:text-white", children: modelId?.split("/").pop() }),
|
|
1410
|
+
modelId && isVisionModel2(modelId) && /* @__PURE__ */ jsx3("span", { className: "px-2 py-0.5 border border-black dark:border-white text-[10px] font-bold uppercase tracking-widest text-black dark:text-white bg-transparent", children: "VISION" })
|
|
1411
1411
|
] }),
|
|
1412
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-
|
|
1413
|
-
/* @__PURE__ */ jsx3("span", { className: "text-xs font-
|
|
1412
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3", children: [
|
|
1413
|
+
/* @__PURE__ */ jsx3("span", { className: "text-xs font-bold tracking-widest text-black dark:text-white uppercase", children: error ? "ERR" : isReady ? "RDY" : isLoading ? "LOD" : "IDL" }),
|
|
1414
1414
|
/* @__PURE__ */ jsx3("div", { className: cn(
|
|
1415
|
-
"w-
|
|
1416
|
-
error ? "bg-red-500" : isReady ? "bg-
|
|
1415
|
+
"w-3 h-3 border border-black dark:border-white rounded-none",
|
|
1416
|
+
error ? "bg-red-500" : isReady ? "bg-black dark:bg-white" : "bg-transparent animate-pulse"
|
|
1417
1417
|
) })
|
|
1418
1418
|
] })
|
|
1419
1419
|
] }),
|
|
1420
|
-
showProgress && isLoading && loadProgress && /* @__PURE__ */ jsxs3("div", { className: "px-
|
|
1421
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex justify-between items-center mb-
|
|
1422
|
-
/* @__PURE__ */ jsx3("span", { className: "text-
|
|
1423
|
-
/* @__PURE__ */ jsxs3("span", { className: "
|
|
1420
|
+
showProgress && isLoading && loadProgress && /* @__PURE__ */ jsxs3("div", { className: "px-6 py-4 border-b-2 border-black dark:border-white bg-[#fafafa] dark:bg-black", children: [
|
|
1421
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex justify-between items-center mb-2 font-mono uppercase tracking-widest text-xs", children: [
|
|
1422
|
+
/* @__PURE__ */ jsx3("span", { className: "text-black dark:text-white font-bold truncate pr-4", children: loadProgress.status }),
|
|
1423
|
+
/* @__PURE__ */ jsxs3("span", { className: "font-bold text-black dark:text-white", children: [
|
|
1424
1424
|
Math.round(loadProgress.progress),
|
|
1425
1425
|
"%"
|
|
1426
1426
|
] })
|
|
1427
1427
|
] }),
|
|
1428
|
-
/* @__PURE__ */ jsx3("div", { className: "h-
|
|
1428
|
+
/* @__PURE__ */ jsx3("div", { className: "h-4 w-full border-2 border-black dark:border-white bg-transparent rounded-none overflow-hidden relative", children: /* @__PURE__ */ jsx3(
|
|
1429
1429
|
"div",
|
|
1430
1430
|
{
|
|
1431
|
-
className: "h-full bg-
|
|
1431
|
+
className: "h-full bg-black dark:bg-white transition-all duration-300 ease-out",
|
|
1432
1432
|
style: { width: `${Math.min(100, loadProgress.progress)}%` }
|
|
1433
1433
|
}
|
|
1434
1434
|
) })
|
|
1435
1435
|
] }),
|
|
1436
|
-
error && /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between mx-
|
|
1437
|
-
/* @__PURE__ */ jsx3("span", { className: "text-sm text-red-
|
|
1436
|
+
error && /* @__PURE__ */ jsxs3("div", { className: "flex flex-col sm:flex-row items-start sm:items-center justify-between mx-6 mt-6 p-4 border-2 border-red-500 bg-red-50 dark:bg-red-950/20 rounded-none gap-4", children: [
|
|
1437
|
+
/* @__PURE__ */ jsx3("span", { className: "text-sm text-red-600 dark:text-red-400 font-bold uppercase tracking-wider", children: error.message }),
|
|
1438
1438
|
/* @__PURE__ */ jsxs3(
|
|
1439
1439
|
"button",
|
|
1440
1440
|
{
|
|
1441
|
-
className: "flex items-center gap-
|
|
1441
|
+
className: "flex items-center gap-2 px-4 py-2 bg-red-500 text-white border-2 border-red-500 hover:bg-transparent hover:text-red-600 dark:hover:text-red-400 transition-colors rounded-none text-xs font-bold uppercase tracking-widest",
|
|
1442
1442
|
onClick: reload,
|
|
1443
1443
|
children: [
|
|
1444
|
-
/* @__PURE__ */ jsx3(RotateCcw, { className: "w-
|
|
1445
|
-
"
|
|
1444
|
+
/* @__PURE__ */ jsx3(RotateCcw, { className: "w-4 h-4" }),
|
|
1445
|
+
" REBOOT"
|
|
1446
1446
|
]
|
|
1447
1447
|
}
|
|
1448
1448
|
)
|
|
1449
1449
|
] }),
|
|
1450
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex-1 overflow-y-auto p-
|
|
1451
|
-
!isLoading && messages.length === 0 && !error && /* @__PURE__ */ jsxs3("div", { className: "flex-1 flex flex-col items-center justify-center text-center
|
|
1452
|
-
/* @__PURE__ */ jsx3("div", { className: "w-
|
|
1453
|
-
/* @__PURE__ */ jsx3("h3", { className: "text-
|
|
1454
|
-
/* @__PURE__ */ jsx3("p", { className: "text-
|
|
1450
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex-1 overflow-y-auto p-6 flex flex-col gap-8 scrollbar-thin scrollbar-thumb-black dark:scrollbar-thumb-white scrollbar-track-transparent", children: [
|
|
1451
|
+
!isLoading && messages.length === 0 && !error && /* @__PURE__ */ jsxs3("div", { className: "flex-1 flex flex-col items-center justify-center text-center mt-12 mb-8 p-8 border-2 border-black dark:border-white", children: [
|
|
1452
|
+
/* @__PURE__ */ jsx3("div", { className: "w-20 h-20 border-4 border-black dark:border-white mb-6 flex items-center justify-center text-3xl font-black bg-black text-white dark:bg-white dark:text-black", children: "//" }),
|
|
1453
|
+
/* @__PURE__ */ jsx3("h3", { className: "text-3xl font-black uppercase tracking-widest text-black dark:text-white mb-4", children: "SYSTEM READY" }),
|
|
1454
|
+
/* @__PURE__ */ jsx3("p", { className: "text-black/70 dark:text-white/70 max-w-sm uppercase text-sm leading-relaxed tracking-wider font-bold", children: "[ MARKDOWN | MATH | MERMAID ] INITIALIZED. AWAITING INPUT." })
|
|
1455
1455
|
] }),
|
|
1456
|
-
messages.map((msg, i) => /* @__PURE__ */ jsx3("div", { className: cn("flex flex-col max-w-[
|
|
1457
|
-
msg.images && msg.images.length > 0 && /* @__PURE__ */ jsx3("div", { className: "flex flex-wrap gap-
|
|
1458
|
-
/* @__PURE__ */ jsx3("div", { className: "prose prose-
|
|
1456
|
+
messages.map((msg, i) => /* @__PURE__ */ jsx3("div", { className: cn("flex flex-col max-w-[90%]", msg.role === "user" ? "self-end" : "self-start w-full"), children: msg.role === "user" ? /* @__PURE__ */ jsxs3("div", { className: "bg-black text-[#fafafa] dark:bg-white dark:text-black px-6 py-5 border-2 border-black dark:border-white rounded-none", children: [
|
|
1457
|
+
msg.images && msg.images.length > 0 && /* @__PURE__ */ jsx3("div", { className: "flex flex-wrap gap-3 mb-4", children: msg.images.map((img) => /* @__PURE__ */ jsx3("img", { src: img.dataUrl, className: "w-32 h-32 object-cover border-2 border-current shadow-none", alt: "attachment" }, img.id)) }),
|
|
1458
|
+
/* @__PURE__ */ jsx3("div", { className: "prose prose-base dark:prose-invert max-w-none font-mono", children: /* @__PURE__ */ jsx3(
|
|
1459
1459
|
Streamdown,
|
|
1460
1460
|
{
|
|
1461
1461
|
plugins: { code, mermaid, math },
|
|
@@ -1468,7 +1468,7 @@ ${systemPrompt}` : systemPrompt;
|
|
|
1468
1468
|
children: msg.content
|
|
1469
1469
|
}
|
|
1470
1470
|
) })
|
|
1471
|
-
] }) : /* @__PURE__ */ jsx3("div", { className: "prose prose-
|
|
1471
|
+
] }) : /* @__PURE__ */ jsx3("div", { className: "prose prose-base dark:prose-invert max-w-none p-6 w-full min-w-0 font-mono border-2 border-black dark:border-white bg-[#fafafa] dark:bg-black", children: /* @__PURE__ */ jsx3(
|
|
1472
1472
|
Streamdown,
|
|
1473
1473
|
{
|
|
1474
1474
|
plugins: { code, mermaid, math },
|
|
@@ -1481,7 +1481,7 @@ ${systemPrompt}` : systemPrompt;
|
|
|
1481
1481
|
children: msg.content
|
|
1482
1482
|
}
|
|
1483
1483
|
) }) }, i)),
|
|
1484
|
-
streamingText && /* @__PURE__ */ jsx3("div", { className: "flex flex-col self-start w-full max-w-[
|
|
1484
|
+
streamingText && /* @__PURE__ */ jsx3("div", { className: "flex flex-col self-start w-full max-w-[90%]", children: /* @__PURE__ */ jsx3("div", { className: "prose prose-base dark:prose-invert max-w-none p-6 w-full min-w-0 font-mono border-2 border-black dark:border-white bg-[#fafafa] dark:bg-black", children: /* @__PURE__ */ jsx3(
|
|
1485
1485
|
Streamdown,
|
|
1486
1486
|
{
|
|
1487
1487
|
plugins: { code, mermaid, math },
|
|
@@ -1497,7 +1497,7 @@ ${systemPrompt}` : systemPrompt;
|
|
|
1497
1497
|
) }) }),
|
|
1498
1498
|
/* @__PURE__ */ jsx3("div", { ref: messagesEndRef, className: "h-4" })
|
|
1499
1499
|
] }),
|
|
1500
|
-
/* @__PURE__ */ jsx3("div", { className: "p-
|
|
1500
|
+
/* @__PURE__ */ jsx3("div", { className: "p-6 bg-[#fafafa] dark:bg-black border-t-2 border-black dark:border-white", children: /* @__PURE__ */ jsx3(
|
|
1501
1501
|
ChatInput,
|
|
1502
1502
|
{
|
|
1503
1503
|
value: input,
|