@rubytech/create-maxy 1.0.468 → 1.0.469
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/package.json +1 -1
- package/payload/platform/plugins/admin/mcp/dist/index.js +110 -0
- package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/admin/skills/public-agent-manager/skill.md +28 -4
- package/payload/server/public/assets/ChatInput-CzSLcXRP.css +1 -0
- package/payload/server/public/assets/{admin-BWFKvjFU.js → admin-BVJphQeS.js} +1 -1
- package/payload/server/public/assets/public-XYSRSOuh.js +5 -0
- package/payload/server/public/index.html +3 -3
- package/payload/server/public/public.html +3 -3
- package/payload/server/server.js +78 -8
- package/payload/server/public/assets/ChatInput-BZnIVDdt.css +0 -1
- package/payload/server/public/assets/public-Dqvygu4a.js +0 -5
- /package/payload/server/public/assets/{ChatInput-DobbViSh.js → ChatInput-CeYJrCR1.js} +0 -0
package/payload/server/server.js
CHANGED
|
@@ -4353,6 +4353,9 @@ function resolveAgentConfig(accountDir, agentName) {
|
|
|
4353
4353
|
let plugins = null;
|
|
4354
4354
|
let status = null;
|
|
4355
4355
|
let displayName = null;
|
|
4356
|
+
let image = null;
|
|
4357
|
+
let imageShape = null;
|
|
4358
|
+
let showAgentName = false;
|
|
4356
4359
|
let liveMemory = false;
|
|
4357
4360
|
let knowledgeKeywords = null;
|
|
4358
4361
|
let accessMode = "open";
|
|
@@ -4370,6 +4373,16 @@ function resolveAgentConfig(accountDir, agentName) {
|
|
|
4370
4373
|
plugins = Array.isArray(parsed.plugins) ? parsed.plugins : null;
|
|
4371
4374
|
status = typeof parsed.status === "string" ? parsed.status : null;
|
|
4372
4375
|
displayName = typeof parsed.displayName === "string" ? parsed.displayName : null;
|
|
4376
|
+
image = typeof parsed.image === "string" ? parsed.image : null;
|
|
4377
|
+
if (typeof parsed.imageShape === "string" && ["circle", "rounded"].includes(parsed.imageShape)) {
|
|
4378
|
+
imageShape = parsed.imageShape;
|
|
4379
|
+
}
|
|
4380
|
+
if (parsed.showAgentName === true) {
|
|
4381
|
+
showAgentName = true;
|
|
4382
|
+
}
|
|
4383
|
+
if (image || imageShape || showAgentName) {
|
|
4384
|
+
console.log(`[agent-config] ${agentName}: image=${image || "(none)"} imageShape=${imageShape || "(none)"} showAgentName=${showAgentName}`);
|
|
4385
|
+
}
|
|
4373
4386
|
if (typeof parsed.accessMode === "string" && ["gated", "paid"].includes(parsed.accessMode)) {
|
|
4374
4387
|
accessMode = parsed.accessMode;
|
|
4375
4388
|
}
|
|
@@ -4434,7 +4447,7 @@ function resolveAgentConfig(accountDir, agentName) {
|
|
|
4434
4447
|
total: identityTokens + soulTokens + knowledgeTokens
|
|
4435
4448
|
};
|
|
4436
4449
|
}
|
|
4437
|
-
return { model, plugins, status, displayName, knowledge, knowledgeBaked, liveMemory, knowledgeKeywords, budget, accessMode };
|
|
4450
|
+
return { model, plugins, status, displayName, image, imageShape, showAgentName, knowledge, knowledgeBaked, liveMemory, knowledgeKeywords, budget, accessMode };
|
|
4438
4451
|
}
|
|
4439
4452
|
function parsePluginFrontmatter(pluginDir) {
|
|
4440
4453
|
const pluginPath = resolve4(PLATFORM_ROOT3, "plugins", pluginDir, "PLUGIN.md");
|
|
@@ -7427,6 +7440,12 @@ async function POST(req) {
|
|
|
7427
7440
|
}
|
|
7428
7441
|
agentConfig = resolveAgentConfig(account.accountDir, agentSlug);
|
|
7429
7442
|
}
|
|
7443
|
+
const agentIdentity = agentConfig ? {
|
|
7444
|
+
...agentConfig.displayName ? { displayName: agentConfig.displayName } : {},
|
|
7445
|
+
...agentConfig.image ? { agentImage: agentConfig.image } : {},
|
|
7446
|
+
...agentConfig.imageShape ? { agentImageShape: agentConfig.imageShape } : {},
|
|
7447
|
+
...agentConfig.showAgentName ? { showAgentName: agentConfig.showAgentName } : {}
|
|
7448
|
+
} : {};
|
|
7430
7449
|
const branding = await fetchBranding(accountId).catch(() => null);
|
|
7431
7450
|
if (branding) {
|
|
7432
7451
|
writeBrandingCache(accountId, agentSlug, branding);
|
|
@@ -7446,7 +7465,8 @@ async function POST(req) {
|
|
|
7446
7465
|
agent_id: agentSlug,
|
|
7447
7466
|
resumed,
|
|
7448
7467
|
...resumed ? { messages: uiMessages } : {},
|
|
7449
|
-
...branding ? { branding } : {}
|
|
7468
|
+
...branding ? { branding } : {},
|
|
7469
|
+
...agentIdentity
|
|
7450
7470
|
});
|
|
7451
7471
|
}
|
|
7452
7472
|
console.log(`[session] stale session_key=${body.session_key.slice(0, 8)}\u2026 \u2014 trying cold resume`);
|
|
@@ -7457,8 +7477,8 @@ async function POST(req) {
|
|
|
7457
7477
|
Response.json({
|
|
7458
7478
|
auth_required: true,
|
|
7459
7479
|
agent_id: agentSlug,
|
|
7460
|
-
|
|
7461
|
-
...
|
|
7480
|
+
...branding ? { branding } : {},
|
|
7481
|
+
...agentIdentity
|
|
7462
7482
|
}),
|
|
7463
7483
|
null
|
|
7464
7484
|
// don't set cookie for gated agents
|
|
@@ -7488,7 +7508,8 @@ async function POST(req) {
|
|
|
7488
7508
|
agent_id: agentSlug,
|
|
7489
7509
|
resumed,
|
|
7490
7510
|
...resumed ? { messages: uiMessages } : {},
|
|
7491
|
-
...branding ? { branding } : {}
|
|
7511
|
+
...branding ? { branding } : {},
|
|
7512
|
+
...agentIdentity
|
|
7492
7513
|
}),
|
|
7493
7514
|
visitorId
|
|
7494
7515
|
);
|
|
@@ -7499,12 +7520,14 @@ async function POST(req) {
|
|
|
7499
7520
|
registerSession(sessionKey, "public", accountId, agentSlug);
|
|
7500
7521
|
ensureConversation(accountId, "public", sessionKey, newVisitorId, agentSlug).catch(() => {
|
|
7501
7522
|
});
|
|
7502
|
-
|
|
7523
|
+
const hasImage = agentConfig?.image ? "yes" : "no";
|
|
7524
|
+
console.log(`[session] new-session visitor=${newVisitorId.slice(0, 8)}\u2026 session=${sessionKey.slice(0, 8)}\u2026 agent=${agentSlug} image=${hasImage} showAgentName=${agentConfig?.showAgentName ?? false}`);
|
|
7503
7525
|
return respondWithCookie(
|
|
7504
7526
|
Response.json({
|
|
7505
7527
|
session_key: sessionKey,
|
|
7506
7528
|
agent_id: agentSlug,
|
|
7507
|
-
...branding ? { branding } : {}
|
|
7529
|
+
...branding ? { branding } : {},
|
|
7530
|
+
...agentIdentity
|
|
7508
7531
|
}),
|
|
7509
7532
|
newVisitorId
|
|
7510
7533
|
);
|
|
@@ -26450,7 +26473,8 @@ var PUBLIC_ALLOWED_PREFIXES = [
|
|
|
26450
26473
|
"/api/health",
|
|
26451
26474
|
"/api/telegram/",
|
|
26452
26475
|
"/assets/",
|
|
26453
|
-
"/brand/"
|
|
26476
|
+
"/brand/",
|
|
26477
|
+
"/agent-assets/"
|
|
26454
26478
|
];
|
|
26455
26479
|
var PUBLIC_ALLOWED_EXACT = ["/favicon.ico"];
|
|
26456
26480
|
var AGENT_SLUG_PATTERN = /^\/([a-z][a-z0-9-]{2,49})$/;
|
|
@@ -26746,6 +26770,52 @@ app.get(
|
|
|
26746
26770
|
"/api/admin/sessions/:id/messages",
|
|
26747
26771
|
(c) => GET10(c.req.raw, { params: Promise.resolve({ id: c.req.param("id") }) })
|
|
26748
26772
|
);
|
|
26773
|
+
var SAFE_SLUG_RE = /^[a-z][a-z0-9-]{2,49}$/;
|
|
26774
|
+
var SAFE_FILENAME_RE = /^[a-z0-9_][a-z0-9_.-]{0,99}$/i;
|
|
26775
|
+
var IMAGE_MIME = {
|
|
26776
|
+
".png": "image/png",
|
|
26777
|
+
".jpg": "image/jpeg",
|
|
26778
|
+
".jpeg": "image/jpeg",
|
|
26779
|
+
".gif": "image/gif",
|
|
26780
|
+
".webp": "image/webp",
|
|
26781
|
+
".svg": "image/svg+xml",
|
|
26782
|
+
".ico": "image/x-icon"
|
|
26783
|
+
};
|
|
26784
|
+
app.get("/agent-assets/:slug/:filename", (c) => {
|
|
26785
|
+
const slug = c.req.param("slug");
|
|
26786
|
+
const filename = c.req.param("filename");
|
|
26787
|
+
if (!SAFE_SLUG_RE.test(slug)) {
|
|
26788
|
+
console.error(`[agent-assets] invalid-slug slug=${slug}`);
|
|
26789
|
+
return c.text("Not found", 404);
|
|
26790
|
+
}
|
|
26791
|
+
if (!SAFE_FILENAME_RE.test(filename) || filename.includes("..")) {
|
|
26792
|
+
console.error(`[agent-assets] path-traversal-rejected slug=${slug} file=${filename}`);
|
|
26793
|
+
return c.text("Forbidden", 403);
|
|
26794
|
+
}
|
|
26795
|
+
const account = resolveAccount();
|
|
26796
|
+
if (!account) {
|
|
26797
|
+
console.error(`[agent-assets] no-account slug=${slug} file=${filename}`);
|
|
26798
|
+
return c.text("Not found", 404);
|
|
26799
|
+
}
|
|
26800
|
+
const filePath = resolve18(account.accountDir, "agents", slug, "assets", filename);
|
|
26801
|
+
const expectedDir = resolve18(account.accountDir, "agents", slug, "assets");
|
|
26802
|
+
if (!filePath.startsWith(expectedDir + "/")) {
|
|
26803
|
+
console.error(`[agent-assets] path-traversal-rejected slug=${slug} file=${filename}`);
|
|
26804
|
+
return c.text("Forbidden", 403);
|
|
26805
|
+
}
|
|
26806
|
+
if (!existsSync20(filePath)) {
|
|
26807
|
+
console.error(`[agent-assets] serve slug=${slug} file=${filename} status=404`);
|
|
26808
|
+
return c.text("Not found", 404);
|
|
26809
|
+
}
|
|
26810
|
+
const ext = "." + filename.split(".").pop()?.toLowerCase();
|
|
26811
|
+
const contentType = IMAGE_MIME[ext] || "application/octet-stream";
|
|
26812
|
+
console.log(`[agent-assets] serve slug=${slug} file=${filename} status=200`);
|
|
26813
|
+
const body = readFileSync20(filePath);
|
|
26814
|
+
return c.body(body, 200, {
|
|
26815
|
+
"Content-Type": contentType,
|
|
26816
|
+
"Cache-Control": "public, max-age=3600"
|
|
26817
|
+
});
|
|
26818
|
+
});
|
|
26749
26819
|
var htmlCache = /* @__PURE__ */ new Map();
|
|
26750
26820
|
var brandLogoPath = "/brand/maxy-monochrome.png";
|
|
26751
26821
|
var brandIconPath = "/brand/maxy-monochrome.png";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:300;src:url(/assets/cormorant-cyrillic-ext-300-normal-BXl3lXsi.woff2)format("woff2"),url(/assets/cormorant-cyrillic-ext-300-normal-DmxSOTe3.woff)format("woff");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:300;src:url(/assets/cormorant-cyrillic-300-normal-DFUoTmrg.woff2)format("woff2"),url(/assets/cormorant-cyrillic-300-normal-CzPHYadL.woff)format("woff");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:300;src:url(/assets/cormorant-vietnamese-300-normal-BVqIp_mg.woff2)format("woff2"),url(/assets/cormorant-vietnamese-300-normal-CEMS9Pw-.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:300;src:url(/assets/cormorant-latin-ext-300-normal-De3D72RL.woff2)format("woff2"),url(/assets/cormorant-latin-ext-300-normal-CkiUx0UG.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:300;src:url(/assets/cormorant-latin-300-normal-CJ5dfen0.woff2)format("woff2"),url(/assets/cormorant-latin-300-normal-DQZObO_3.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/cormorant-cyrillic-ext-400-normal-BlcaxZtM.woff2)format("woff2"),url(/assets/cormorant-cyrillic-ext-400-normal-Bgrpe4p1.woff)format("woff");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/cormorant-cyrillic-400-normal-C8QS47vb.woff2)format("woff2"),url(/assets/cormorant-cyrillic-400-normal-D3EsxgFc.woff)format("woff");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/cormorant-vietnamese-400-normal-C-RiYxEf.woff2)format("woff2"),url(/assets/cormorant-vietnamese-400-normal-DmUuA7Y2.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/cormorant-latin-ext-400-normal-DuQ88yz3.woff2)format("woff2"),url(/assets/cormorant-latin-ext-400-normal-DuXFa1Dr.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/cormorant-latin-400-normal-BGH8Vunh.woff2)format("woff2"),url(/assets/cormorant-latin-400-normal-C3_-2Ua-.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/cormorant-cyrillic-ext-500-normal-pZw22qtS.woff2)format("woff2"),url(/assets/cormorant-cyrillic-ext-500-normal-CdQuyvtc.woff)format("woff");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/cormorant-cyrillic-500-normal-BLlg2W5x.woff2)format("woff2"),url(/assets/cormorant-cyrillic-500-normal-B7dJQtg-.woff)format("woff");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/cormorant-vietnamese-500-normal-DsPuwQHi.woff2)format("woff2"),url(/assets/cormorant-vietnamese-500-normal-tGBW_mI7.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/cormorant-latin-ext-500-normal-AH9qog1s.woff2)format("woff2"),url(/assets/cormorant-latin-ext-500-normal-DAuUCO41.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Cormorant;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/cormorant-latin-500-normal-EBdSCOD3.woff2)format("woff2"),url(/assets/cormorant-latin-500-normal-Dj3SQ6fR.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/dm-sans-latin-ext-400-normal-BtiwyxMk.woff2)format("woff2"),url(/assets/dm-sans-latin-ext-400-normal-BjWJ59Pq.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/dm-sans-latin-400-normal-CW0RaeGs.woff2)format("woff2"),url(/assets/dm-sans-latin-400-normal-BwCSEQnW.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/dm-sans-latin-ext-500-normal-BJfUCQsA.woff2)format("woff2"),url(/assets/dm-sans-latin-ext-500-normal-DR84L5F-.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/dm-sans-latin-500-normal-B9HHJjqV.woff2)format("woff2"),url(/assets/dm-sans-latin-500-normal-Dr3UlScf.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}*,:before,:after{box-sizing:border-box;margin:0;padding:0}:root{--bg:#fafaf8;--bg-chat:#fff;--surface:#f5f2ed;--surface-cool:#eef1f4;--text:#1a1a1a;--text-secondary:#6b6b6b;--text-tertiary:#9a9a9a;--border:#0000000f;--border-strong:#0000001a;--sage:#7c8c72;--sage-hover:#6a7a62;--sage-subtle:#7c8c7214;--sage-glow:#7c8c7226;--maxy-bubble:#f5f2ed;--visitor-bubble:#e8ecf0;--shadow-sm:0 1px 2px #0000000a;--shadow-md:0 2px 8px #0000000f;--shadow-lg:0 4px 16px #00000014;--radius-sm:6px;--radius-md:12px;--radius-lg:20px;--radius-full:9999px;--danger:#b44;--danger-hover:#c44;--accent:#e8e8e8;--surface-hover:#ffffff0d;--font-display:"Cormorant", Georgia, serif;--font-body:"DM Sans", -apple-system, BlinkMacSystemFont, sans-serif}html{scroll-behavior:smooth;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{font-family:var(--font-body);color:var(--text);background:var(--bg);font-size:16px;line-height:1.6;overflow-x:hidden}a{color:var(--sage);text-decoration:none;transition:color .2s}a:hover{color:var(--sage-hover)}.chat-page{flex-direction:column;max-width:800px;height:100dvh;margin:0 auto;padding:0 20px;display:flex}.chat-header{text-align:center;flex-shrink:0;padding:48px 0 24px;position:relative}.chat-header-select{color:var(--text-tertiary);cursor:pointer;border-radius:var(--radius-sm);background:0 0;border:none;padding:6px;transition:color .15s,background .15s;position:absolute;top:16px;right:16px}.chat-header-select:hover{color:var(--text);background:var(--hover)}.chat-logo{object-fit:contain;width:64px;height:64px;margin-bottom:16px}.chat-tagline{font-family:var(--font-display);color:var(--text);letter-spacing:-.01em;margin-bottom:12px;font-size:clamp(28px,5vw,42px);font-weight:300;line-height:1.2}.chat-intro{color:var(--text-secondary);margin:0 0 12px;font-size:15px;line-height:1.6}.chat-trust{color:var(--text-tertiary);justify-content:center;align-items:center;gap:8px;font-size:13px;display:flex}.chat-trust-sep{opacity:.4}.chat-messages-wrap{flex:1;min-height:0;position:relative}@keyframes scrollBounce{0%,to{transform:translate(-50%)translateY(0)}40%{transform:translate(-50%)translateY(4px)}}.scroll-to-bottom{cursor:pointer;width:32px;height:32px;color:var(--text-secondary);opacity:.5;z-index:10;background:0 0;border:1px solid #0000;border-radius:50%;justify-content:center;align-items:center;transition:background .15s,color .15s,opacity .15s,border-color .15s,box-shadow .15s;animation:1.4s ease-in-out infinite scrollBounce;display:flex;position:absolute;bottom:12px;left:50%;transform:translate(-50%)}.scroll-to-bottom:hover{background:var(--bg);border-color:var(--border-strong);color:var(--sage);opacity:1;animation:none;box-shadow:0 2px 8px #00000014}.chat-messages{scrollbar-width:thin;scrollbar-color:var(--border-strong) transparent;flex-direction:column;gap:12px;height:100%;padding:16px 0;display:flex;overflow-y:auto}.chat-messages::-webkit-scrollbar{width:4px}.chat-messages::-webkit-scrollbar-track{background:0 0}.chat-messages::-webkit-scrollbar-thumb{background:var(--border-strong);border-radius:var(--radius-full)}.session-error{text-align:center;color:var(--text-secondary);flex:1;justify-content:center;align-items:center;padding:2rem;font-size:.95rem;line-height:1.5;display:flex}.idle-tips{flex-direction:column;justify-content:center;align-items:center;gap:16px;height:100%;padding:2rem;animation:.3s ease-out idle-tips-in;display:flex}@keyframes idle-tips-in{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.idle-tips-hint{color:var(--text-secondary);font-size:.95rem}.idle-tips-chips{flex-wrap:wrap;justify-content:center;gap:8px;display:flex}.idle-tip-chip{font-family:var(--font-body);border:1px solid var(--border-strong);border-radius:var(--radius-full);color:var(--text-secondary);cursor:pointer;background:0 0;padding:8px 16px;font-size:.85rem;transition:border-color .15s,color .15s,background .15s}.idle-tip-chip:hover,.idle-tip-chip:focus-visible{border-color:var(--sage);color:var(--sage);background:var(--sage-subtle)}.message-historical{opacity:.6}.resume-divider{color:var(--text-secondary);text-transform:uppercase;letter-spacing:.05em;align-items:center;gap:12px;padding:12px 16px;font-size:.75rem;display:flex}.resume-divider:before,.resume-divider:after{content:"";background:var(--border-default);flex:1;height:1px}body[data-drag-popout-active] .chat-messages{outline:2px dashed var(--sage);outline-offset:-2px;border-radius:8px;transition:outline-color .15s}.message{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:manipulation;animation:.3s ease-out messageIn;display:flex;position:relative}.admin-page .message,.chat-page .message{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}.message.maxy{flex-direction:column;align-items:flex-start}.message.visitor{justify-content:flex-end}.bubble{border-radius:var(--radius-lg);word-wrap:break-word;white-space:pre-wrap;max-width:85%;padding:12px 16px;font-size:15px;line-height:1.55;position:relative}.maxy-content-wrap{width:100%;min-width:0;position:relative}.message.maxy .bubble{background:var(--maxy-bubble);color:var(--text);border-bottom-left-radius:var(--radius-sm)}.message.visitor .bubble{background:var(--visitor-bubble);color:var(--text);border-bottom-right-radius:var(--radius-sm)}.bubble-content{position:relative}.bubble-content.clamped{max-height:4.65em;overflow:hidden}.bubble-content.clamped.overflowing:after{content:"";background:linear-gradient(to bottom, transparent, var(--visitor-bubble));pointer-events:none;height:1.55em;position:absolute;bottom:0;left:0;right:0}.bubble-expand{justify-content:center;padding-top:4px;display:flex}.bubble-expand .btn{transition:background .15s,opacity .15s,color .15s,transform .2s}.bubble-expand .btn.expanded{transform:rotate(180deg)}.typing-indicator{align-items:center;gap:4px;padding:14px 18px;display:flex}.typing-dot{background:var(--text-tertiary);border-radius:50%;width:6px;height:6px;animation:1.4s ease-in-out infinite typingPulse}.typing-dot:nth-child(2){animation-delay:.2s}.typing-dot:nth-child(3){animation-delay:.4s}.chat-suggestions{flex-wrap:wrap;gap:8px;padding:4px 0 8px;animation:.3s ease-out messageIn;display:flex}.chat-input-area{flex-shrink:0;padding:16px 0 24px}.chat-actions{align-items:center;gap:16px;padding:8px 4px 0;display:flex;position:relative}.chat-action{font-family:var(--font-body);color:var(--text-tertiary);cursor:pointer;background:0 0;border:none;align-items:center;gap:6px;padding:0;font-size:12px;transition:color .15s;display:inline-flex}.chat-action:hover{color:var(--text-secondary)}.burger-trigger{color:var(--text-tertiary);cursor:pointer;background:0 0;border:none;padding:2px;transition:color .15s;display:none}.burger-trigger:hover{color:var(--text-secondary)}.actions-menu-items{display:contents}.chat-resize-handle{cursor:row-resize;touch-action:none;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;height:12px;display:flex}.chat-resize-handle-bar{background:var(--border-strong);opacity:0;border-radius:2px;width:36px;height:3px;transition:opacity .15s}.chat-resize-handle:hover .chat-resize-handle-bar{opacity:1}.chat-form{background:var(--bg-chat);border:1px solid var(--border-strong);border-radius:var(--radius-full);align-items:end;gap:8px;padding:6px 6px 6px 20px;transition:border-color .2s,box-shadow .2s,border-radius .2s;display:flex}.chat-form[data-expanded=true]{border-radius:var(--radius-lg)}.chat-form>.btn--icon{margin:10px 0}.chat-form:focus-within{box-shadow:0 0 0 3px var(--sage-subtle);border-color:#7c8c724d}.chat-input{min-width:0;font-family:var(--font-body);color:var(--text);resize:none;word-wrap:break-word;background:0 0;border:none;outline:none;flex:1;padding-block:8px;font-size:15px;line-height:1.4;overflow-y:hidden}.chat-input::placeholder{color:var(--text-tertiary)}.chat-footer{text-align:center;flex-shrink:0;padding:0 0 20px}.chat-footer a{color:var(--text-tertiary);font-size:13px;transition:color .2s}.chat-footer a:hover{color:var(--sage)}.auth-retry-link{font-family:var(--font-body);color:var(--text-tertiary);margin-top:12px;font-size:13px;text-decoration:none}.auth-retry-link:hover{color:var(--sage)}.gate-wrap{flex-direction:column;flex:1;justify-content:center;align-items:center;min-height:0;padding:0 20px 40px;display:flex}.gate-card{text-align:center;width:100%;max-width:400px}.gate-title{font-family:var(--font-display);color:var(--text);letter-spacing:-.01em;margin-bottom:8px;font-size:clamp(22px,4vw,30px);font-weight:300;line-height:1.3}.gate-subtitle{color:var(--text-secondary);margin-bottom:24px;font-size:15px;line-height:1.5}.gate-expiry-badge{color:var(--sage);background:var(--sage-subtle);border-radius:var(--radius-full);margin-bottom:20px;padding:4px 10px;font-size:12px;display:inline-block}.gate-form{text-align:left}.gate-field{margin-bottom:14px}.gate-field label{color:var(--text-secondary);margin-bottom:6px;font-size:13px;font-weight:500;display:block}.gate-field input{border:1px solid var(--border-strong);width:100%;font-family:var(--font-body);color:var(--text);background:var(--bg);border-radius:8px;outline:none;padding:10px 12px;font-size:15px;transition:border-color .15s,box-shadow .15s}.gate-field input:focus{border-color:var(--sage);box-shadow:0 0 0 2px var(--sage-glow)}.gate-field input::placeholder{color:var(--text-tertiary)}.gate-pw-row{position:relative}.gate-pw-toggle{position:absolute;top:0;right:0}.gate-strength{color:var(--text-tertiary);flex-direction:column;gap:4px;margin-top:8px;font-size:12px;display:flex}.gate-strength-item{align-items:center;gap:6px;display:flex}.gate-strength-item.met{color:var(--sage)}.gate-submit{margin-top:20px}.gate-submit .btn{border-radius:10px;width:100%;padding:12px;font-size:15px;font-weight:500}.gate-error{color:var(--danger);text-align:center;margin-top:8px;font-size:13px}.gate-success{color:var(--sage);text-align:center;margin-top:8px;font-size:13px}.gate-link{color:var(--text-tertiary);cursor:pointer;font-size:13px;font-family:var(--font-body);text-underline-offset:2px;background:0 0;border:none;padding:0;text-decoration:underline;display:inline}.gate-link:hover{color:var(--sage)}.gate-hint{color:var(--text-tertiary);text-align:center;margin-top:16px;font-size:13px}.gate-actions{text-align:center;margin-top:16px}.gate-actions .btn{min-width:200px}.gate-icon{margin-bottom:12px;font-size:36px}.gate-otp-field{justify-content:center;align-items:center;gap:10px;margin:20px 0;display:flex}.gate-otp-field .pin-box{border-radius:8px;width:42px;height:48px;font-size:20px}.gate-otp-field .pin-box:focus{border-color:var(--sage);box-shadow:0 0 0 2px var(--sage-glow)}.gate-otp-field .pin-box-filled{border-color:var(--border-strong)}.gate-resend{text-align:center;margin-top:4px}.gate-divider{color:var(--text-tertiary);align-items:center;gap:12px;margin:16px 0;font-size:13px;display:flex}.gate-divider:before,.gate-divider:after{content:"";background:var(--border);flex:1;height:1px}.gate-loading{color:var(--text-tertiary);justify-content:center;align-items:center;gap:8px;padding:20px 0;font-size:14px;display:flex}.gate-loading .spinner{border:2px solid var(--border);border-top-color:var(--sage);border-radius:50%;width:16px;height:16px;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.admin-page .chat-header{text-align:left;border-bottom:1px solid var(--border);flex-direction:row;justify-content:space-between;align-items:center;gap:12px;padding:12px 0;display:flex}.admin-page .chat-logo{flex-shrink:0;width:36px;height:36px;margin-bottom:0}.admin-page .chat-header>div:not(.chat-burger-wrap){flex-direction:column;flex:1;gap:2px;display:flex}.chat-burger-wrap{flex:none;position:relative}.chat-burger{cursor:pointer;color:var(--text-secondary);background:0 0;border:none;border-radius:6px;align-items:center;padding:6px;transition:color .15s;animation:2.4s ease-in-out 3 iconHeartbeat;display:flex}.chat-burger:hover{color:var(--sage);animation:none}.chat-menu{background:var(--bg);border:1px solid var(--border);z-index:100;border-radius:8px;min-width:160px;position:absolute;top:calc(100% + 6px);right:0;overflow:hidden;box-shadow:0 4px 12px #00000014}.chat-menu-item{width:100%;color:var(--text-secondary);cursor:pointer;text-align:left;box-sizing:border-box;background:0 0;border:none;align-items:center;gap:8px;padding:9px 12px;font-size:13px;text-decoration:none;transition:background .12s,color .12s;display:flex}.chat-menu-item:hover{background:var(--surface);color:var(--text)}.chat-menu-divider{background:var(--border);height:1px;margin:2px 0}.chat-menu-agents{border-top:1px solid var(--border);max-height:264px;padding:4px 0;overflow-y:auto}.chat-menu .chat-menu-agent-item{align-items:flex-start;padding-left:20px}.chat-menu-agent-item .agent-status-dot{background:var(--text-muted);border-radius:50%;flex-shrink:0;width:6px;height:6px;margin-top:6px}.chat-menu-agent-item .agent-status-dot.active{background:#22c55e}.chat-menu-agent-item .agent-text{flex-direction:column;flex:1;min-width:0;display:flex}.chat-menu-agent-item .agent-display-name{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.chat-menu-agent-item .agent-slug{opacity:.5;font-size:11px}.chat-menu-agent-empty,.chat-menu-agent-error{color:var(--text-muted);padding:9px 20px;font-size:12px;display:block}.chat-menu-agent-error{color:var(--error)}.chat-menu-version{width:100%;color:var(--text-muted);cursor:pointer;text-align:left;box-sizing:border-box;background:0 0;border:none;align-items:center;gap:8px;padding:9px 12px;font-size:12px;transition:background .12s,color .12s;display:flex}.chat-menu-version:hover{background:var(--surface);color:var(--text-secondary)}.chat-menu-version-passive{cursor:default}.chat-menu-version-passive:hover{color:var(--text-muted);background:0 0}.version-installed{font-variant-numeric:tabular-nums;align-items:center;gap:5px;display:inline-flex}.version-update-dot{background:var(--accent);border-radius:50%;flex-shrink:0;width:6px;height:6px}.version-uptodate-dot{background:#22c55e;border-radius:50%;flex-shrink:0;width:6px;height:6px}.update-modal{min-width:240px;max-width:280px}.update-modal-body{padding:12px 0}.update-modal-versions{margin-bottom:12px}.update-version-new{color:var(--sage);font-weight:500}.update-modal-btn{background:var(--sage);color:#fff;cursor:pointer;border:none;border-radius:6px;width:calc(100% - 28px);margin:0 14px;padding:8px 0;font-size:12px;font-weight:500;transition:background .12s}.update-modal-btn:hover{background:var(--sage-hover)}.update-modal-progress-wrap{flex-direction:column;gap:8px;padding:0 14px;display:flex}.update-modal-progress-bar{background:var(--surface);border-radius:2px;width:100%;height:4px;overflow:hidden}.update-modal-progress-fill{background:var(--sage);border-radius:2px;height:100%;transition:width 1s linear}.update-modal-phase{color:var(--text-secondary);align-items:center;gap:6px;font-size:11px;display:flex}.update-modal-result{align-items:center;gap:8px;padding:0 14px;font-size:12px;display:flex}.update-success-icon{color:var(--sage);flex-shrink:0}.update-error-icon{color:var(--error);flex-shrink:0}.admin-page .chat-tagline{margin:0;font-size:16px;line-height:1.2}.admin-page .chat-intro{margin:0;font-size:12px;line-height:1.3}.admin-activity{flex-direction:column;gap:6px;max-width:100%;display:flex}.spin{animation:1s linear infinite spin}.tl-spinner{animation:1.2s linear infinite spin}.star-loader{color:var(--text-tertiary)}.star-frame-0{opacity:.5;transform:scale(.85)}.star-frame-1{opacity:.8;transform:scale(1)}.star-frame-2{opacity:1;transform:scale(1.15)}.star-frame-3{opacity:.9;transform:scale(1.05)}.tl-loading{color:var(--text-tertiary);align-items:center;gap:6px;padding:2px 0 4px;display:flex}.tl-elapsed{color:var(--text-tertiary);font-variant-numeric:tabular-nums;font-size:12px}.tl-thinking-typewriter{min-width:8.5em;font-size:12px;display:inline-block}.tl-steps{flex-direction:column;display:flex}.tl-step{align-items:stretch;gap:0;display:flex;position:relative}.tl-col{flex-direction:column;flex-shrink:0;align-items:center;width:20px;display:flex}.tl-line{background:var(--border-strong);flex-shrink:0;width:1px;min-height:6px}.tl-line-grow{flex:1}.tl-icon{flex-shrink:0;justify-content:center;align-items:center;width:20px;height:20px;display:flex}.tl-icon.tl-pending{color:var(--sage)}.tl-icon.tl-done{color:var(--text-tertiary)}.tl-icon.tl-success{color:#4d8c63}.tl-icon.tl-error{color:#c44}.tl-icon.tl-dim{color:#c87533;opacity:.8}.tl-body{flex:1;min-width:0;padding:0 0 0 6px}.tl-row{align-items:center;gap:6px;min-height:22px;padding:2px 0;display:flex}.tl-summary{color:var(--text-secondary);text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:12px;line-height:1.4;overflow:hidden}.tl-thinking-label{color:var(--text-tertiary);font-style:italic}.tl-step-tokens{color:var(--text-tertiary);font-variant-numeric:tabular-nums;opacity:.7;flex-shrink:0;align-items:center;gap:2px;font-size:11px;display:inline-flex}.tl-step-elapsed{color:var(--text-tertiary);font-variant-numeric:tabular-nums;flex-shrink:0;font-size:11px}.tl-chevron{color:var(--text-tertiary);flex-shrink:0;align-items:center;display:flex}.tl-summary-row{cursor:pointer}.tl-summary-row .tl-summary{color:var(--text-tertiary);font-size:11px}.tl-summary-row .tl-icon{color:var(--text-tertiary)}.tl-detail{white-space:pre-wrap;word-break:break-word;color:var(--text-secondary);background:#00000008;border-radius:4px;margin:2px 0 6px;padding:7px 9px;font-family:SF Mono,Fira Code,Consolas,monospace;font-size:11.5px;line-height:1.5;overflow-x:auto}.tl-row.tl-row-top{align-items:flex-start}.tl-thinking-col{flex-direction:column;flex:1;min-width:0;display:flex}.tl-thinking-body{color:var(--text-tertiary);word-break:break-word;border:1px solid #7c8c7240;border-radius:6px;max-height:90px;margin:0 0 4px;padding:4px 8px;font-size:12px;font-style:italic;line-height:1.5;overflow-y:auto}.tl-status{color:var(--text-tertiary);text-align:center;padding:2px 0 2px 4px;font-size:11px;font-style:italic}.tl-post-components{flex-direction:column;gap:12px;margin-top:12px;display:flex}.tl-footer{color:var(--text-tertiary);font-variant-numeric:tabular-nums;flex-wrap:wrap;align-items:center;gap:6px;padding:6px 0 2px;font-size:11px;display:flex}.tl-footer-sep{opacity:.5}.tl-footer-icon-stat{align-items:center;gap:3px;display:inline-flex}.tl-footer-est{opacity:.6}.tl-ctx-pct{font-variant-numeric:tabular-nums}.tl-ctx-pct.tl-ctx-mid{color:var(--warning,#b8860b)}.tl-ctx-pct.tl-ctx-high{color:var(--error,#c33)}.tl-ctx-compacted{opacity:.45;font-style:italic}.tl-footer-status{align-items:center;gap:4px;margin-left:6px;display:inline-flex}.expand-toggle{cursor:pointer;-webkit-backdrop-filter:blur(8px);border:1px solid var(--border-strong);z-index:10;background:#fafaf8bf;border-radius:50%;justify-content:center;align-items:center;width:32px;height:32px;transition:background .15s;animation:2.4s ease-in-out .4s 3 iconHeartbeat;display:flex;position:absolute;bottom:12px;right:12px;box-shadow:0 2px 8px #00000014}.expand-toggle-default{color:#c87533}.expand-toggle-default:hover{color:#a05e22;background:#c8753314;animation:none}.expand-toggle-all{color:#4a8fc4}.expand-toggle-all:hover{color:#2e6fa0;background:#4a8fc414;animation:none}.expand-toggle-off{color:var(--text-tertiary)}.expand-toggle-off:hover{color:var(--text-secondary);background:var(--surface);animation:none}.select-toggle{color:var(--text-tertiary);animation:none;right:52px}.select-toggle:hover{color:var(--text-secondary);background:var(--surface)}.markdown-message{color:var(--text);word-wrap:break-word;background:var(--maxy-bubble);border-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-sm);max-width:85%;padding:12px 16px;font-size:15px;line-height:1.65;position:relative}.bubble>.markdown-message{white-space:normal;background:0 0;border-radius:0;max-width:none;padding:0}.markdown-message .md-p{margin:0 0 10px}.markdown-message .md-p:last-child{margin-bottom:0}.markdown-message .md-heading{font-family:var(--font-body);color:var(--text);margin:14px 0 5px;font-weight:500;line-height:1.3}.markdown-message h1.md-heading{font-size:17px}.markdown-message h2.md-heading{font-size:15.5px}.markdown-message h3.md-heading{font-size:14.5px}.markdown-message .md-pre{border:1px solid var(--border);background:#0000000a;border-radius:5px;margin:8px 0;padding:10px 12px;overflow-x:auto}.markdown-message .md-pre code{white-space:pre;color:var(--text-secondary);background:0 0;border:none;border-radius:0;padding:0;font-family:SF Mono,Fira Code,Consolas,monospace;font-size:12px;line-height:1.5;display:block}.markdown-message .md-code{background:#0000000f;border-radius:3px;padding:1px 5px;font-family:SF Mono,Fira Code,Consolas,monospace;font-size:13px}.markdown-message .md-list{margin:4px 0 10px;padding-left:20px}.markdown-message .md-list-ordered{list-style-type:decimal}.markdown-message .md-list-item{margin-bottom:3px;font-size:15px;line-height:1.6}.markdown-message .md-list-item .md-p{margin:0}.markdown-message .md-hr{border:none;border-top:1px solid var(--border-strong);margin:12px 0}.markdown-message .md-strong{font-weight:500}.markdown-message .md-link{color:var(--sage);text-underline-offset:2px;-webkit-text-decoration:underline #7c8c7266;text-decoration:underline #7c8c7266}.markdown-message .md-img{object-fit:contain;cursor:pointer;border-radius:6px;max-width:100%;max-height:400px;margin:8px 0;display:block}.markdown-message .md-video{border-radius:6px;max-width:100%;margin:8px 0;display:block}.markdown-message .md-video-iframe{border-radius:6px;width:100%;margin:8px 0;padding-bottom:56.25%;position:relative;overflow:hidden}.markdown-message .md-video-iframe iframe{border:0;width:100%;height:100%;position:absolute;top:0;left:0}.markdown-message .md-table{border-collapse:collapse;width:100%;margin:10px 0;font-size:13px}.markdown-message .md-th,.markdown-message .md-td{border:1px solid var(--border-strong);text-align:left;padding:6px 10px}.markdown-message .md-thead .md-th{background:var(--sage-subtle);color:var(--text-secondary);font-size:12px;font-weight:600}.markdown-message .md-tr:nth-child(2n) td{background:#00000005}.message-meta{color:var(--text-tertiary);font-variant-numeric:tabular-nums;margin-top:6px;font-size:11px}@keyframes iconHeartbeat{0%,to{opacity:.55}50%{opacity:1}}@keyframes iconHeartbeatSubtle{0%,to{opacity:.7}50%{opacity:1}}.powered-by{color:var(--text-tertiary);cursor:pointer;-webkit-user-select:none;user-select:none;opacity:.7;align-items:center;gap:5px;margin-left:auto;font-size:10px;transition:opacity .15s;animation:2.4s ease-in-out .8s 3 iconHeartbeatSubtle;display:flex}.powered-by:hover{opacity:1;animation:none}.powered-by-icon{object-fit:contain;width:14px;height:14px}.claude-info-overlay{z-index:200;background:#00000073;justify-content:flex-end;align-items:flex-end;padding:0 0 56px;display:flex;position:fixed;inset:0}.claude-info-modal{background:var(--surface);border:1px solid var(--border);border-radius:10px;width:300px;max-width:calc(100% - 28px);margin-right:max(14px,50vw - 386px);overflow:hidden;box-shadow:0 8px 32px #0006}.claude-info-header{border-bottom:1px solid var(--border);color:var(--text-secondary);align-items:center;gap:8px;padding:12px 14px;font-size:12px;font-weight:500;display:flex}.claude-info-header img{object-fit:contain;width:14px;height:14px}.claude-info-close{color:var(--text-tertiary);cursor:pointer;background:0 0;border:none;margin-left:auto;padding:2px 4px;font-size:11px;line-height:1}.claude-info-close:hover{color:var(--text)}.claude-info-section{border-bottom:1px solid var(--border);padding:8px 0}.claude-info-section:last-child{border-bottom:none}.claude-info-row{justify-content:space-between;align-items:baseline;gap:12px;padding:4px 14px;font-size:11px;display:flex}.claude-info-label{color:var(--text-tertiary);flex-shrink:0}.claude-info-value{color:var(--text-secondary);font-family:var(--font-mono,monospace);text-align:right;text-overflow:ellipsis;white-space:nowrap;font-size:10.5px;overflow:hidden}.claude-info-toggle{cursor:pointer;transition:color .15s}.claude-info-toggle:hover,.claude-info-toggle:focus-visible{color:var(--text);text-decoration:underline}.claude-info-icon{object-fit:contain;width:14px;height:14px}.sessions-modal{flex-direction:column;max-height:90vh;display:flex}.sessions-list{flex:1;overflow-y:auto}.sessions-empty{color:var(--text-tertiary);justify-content:center;align-items:center;gap:6px;padding:24px 14px;font-size:12px;display:flex}.sessions-error{color:var(--error,#e55)}.sessions-row{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;gap:8px;padding:8px 14px;transition:background .12s;display:flex}.sessions-row:last-child{border-bottom:none}.sessions-row:hover{background:var(--surface)}.sessions-row-info{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.sessions-row-name{color:var(--text);white-space:nowrap;text-overflow:ellipsis;font-size:12px;overflow:hidden}.sessions-row-time{color:var(--text-tertiary);align-items:center;gap:4px;font-size:10px;display:flex}.sessions-row-actions{flex-shrink:0;align-items:center;gap:4px;display:flex}.sessions-action{width:28px;height:28px;color:var(--text-tertiary);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;transition:background .12s,color .12s;display:flex}.sessions-play:hover{background:var(--sage-faint,#88b0941f);color:var(--sage)}.sessions-delete:hover{color:var(--error,#e55);background:#e555551a}.pin-input-row{align-items:center;gap:8px;display:flex}.pin-field{border:1px solid var(--border-strong);background:var(--bg);border-radius:26px;flex:1;align-items:center;gap:8px;height:52px;padding:0 16px;transition:border-color .15s;display:flex}.pin-field:focus-within{border-color:var(--sage)}.pin-box{border:1.5px solid var(--border);text-align:center;width:28px;height:32px;color:var(--text-primary);caret-color:#0000;background:0 0;border-radius:6px;outline:none;flex-shrink:0;padding:0;font-size:10px;transition:border-color .15s,box-shadow .15s}.pin-box:focus{border-color:var(--sage);box-shadow:0 0 0 2px var(--sage-glow)}.pin-box-filled{border-color:var(--border-strong)}.pin-options{justify-content:space-between;align-items:center;display:flex}.admin-pin-error{color:#c44;white-space:pre-wrap;word-break:break-word;font-size:13px;font-family:var(--font-body);text-align:left;max-height:200px;overflow-y:auto}.connect-page{background:var(--bg);justify-content:center;align-items:center;min-height:100dvh;padding:40px 20px;display:flex}.connect-content{flex-direction:column;align-items:center;gap:24px;width:100%;max-width:420px;display:flex}.connect-logos{align-items:center;gap:28px;display:flex}.connect-logo-wrap{flex-direction:column;align-items:center;gap:10px;display:flex}.connect-logo{object-fit:contain;width:88px;height:88px}.connect-logo--maxy{width:110px;height:110px;margin:-11px}.connect-logo-label{font-family:var(--font-body);color:var(--text-secondary);letter-spacing:.02em;font-size:13px}.connect-arrow{width:48px;height:24px;color:var(--text-tertiary);flex-shrink:0;margin-bottom:22px}.connect-title{font-family:var(--font-display);color:var(--text);text-align:center;letter-spacing:-.01em;font-size:clamp(22px,4vw,28px);font-weight:300;line-height:1.3}.connect-subtitle{color:var(--text-secondary);text-align:center;margin-top:-8px;font-size:15px;line-height:1.5}.connect-content .btn--primary{min-width:200px}.connect-pin-form{flex-direction:column;gap:8px;width:100%;max-width:300px;display:flex}@keyframes messageIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes typingPulse{0%,60%,to{opacity:.3;transform:scale(.8)}30%{opacity:1;transform:scale(1)}}.attachment-strip{flex-wrap:wrap;gap:6px;padding:0 0 8px;display:flex}.attachment-chip{background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--radius-full);color:var(--text-secondary);align-items:center;gap:5px;max-width:200px;padding:4px 8px;font-size:12px;display:inline-flex}.attachment-chip-thumb{object-fit:cover;border-radius:3px;flex-shrink:0;width:20px;height:20px}.attachment-chip-name{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.attachment-chip-remove{cursor:pointer;color:var(--text-tertiary);background:0 0;border:none;flex-shrink:0;align-items:center;padding:0 0 0 2px;font-size:13px;line-height:1;display:flex}.attachment-chip-remove:hover{color:var(--text)}.message-attachments{flex-wrap:wrap;gap:5px;margin-top:8px;display:flex}.message-attachment-chip{border-radius:var(--radius-full);color:var(--text-secondary);cursor:pointer;background:#0000000f;border:none;align-items:center;gap:4px;padding:3px 10px;font-family:inherit;font-size:11px;display:inline-flex}.message-attachment-chip:hover{color:var(--text);background:#0000001a}.message-attachment-chip.no-action{cursor:default}.message-attachment-chip.no-action:hover{color:var(--text-secondary);background:#0000000f}.chat-form.drag-over{outline:2px dashed var(--sage);outline-offset:6px;border-radius:var(--radius-sm)}.attachment-lightbox{z-index:1000;background:#000000d9;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.attachment-lightbox img{object-fit:contain;border-radius:var(--radius-md);max-width:90vw;max-height:90vh}.attachment-lightbox-close{color:#ffffffb3;cursor:pointer;background:0 0;border:none;padding:4px;font-size:20px;line-height:1;position:absolute;top:20px;right:20px}.attachment-lightbox-close:hover{color:#fff}.attach-error{color:#e05252;margin:0 0 4px;padding:0 4px;font-size:12px}@media (width<=640px){.chat-header{padding:32px 0 16px}.bubble,.public-components{max-width:90%}.burger-trigger{align-items:center;display:flex}.actions-menu-items{background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--radius-sm,6px);opacity:0;visibility:hidden;pointer-events:none;flex-direction:column;gap:2px;min-width:170px;padding:4px 0;transition:opacity .15s,transform .15s,visibility .15s;display:flex;position:absolute;bottom:calc(100% + 6px);left:0;transform:translateY(4px);box-shadow:0 2px 8px #00000026}.actions-menu-items.actions-menu-open{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0)}.actions-menu-items .chat-action{width:100%;padding:8px 12px;font-size:13px}.actions-menu-items .chat-action:hover{background:var(--hover)}.actions-menu-items .action-label{display:inline}}.message-queue-list{flex-direction:column;gap:2px;padding:0 0 6px;display:flex}.queued-message-row{color:var(--text-secondary);background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--radius-sm,4px);justify-content:space-between;align-items:center;padding:3px 8px;font-size:12px;display:flex}.queued-message-text{text-overflow:ellipsis;white-space:nowrap;max-width:calc(100% - 24px);overflow:hidden}.queued-message-row button{cursor:pointer;color:var(--text-secondary);background:0 0;border:none;flex-shrink:0;padding:0 4px;font-size:1rem;line-height:1}.queued-message-row button:hover{color:var(--text-primary,#fff)}.message-timestamp{color:var(--text-tertiary,#555);text-align:right;-webkit-user-select:none;user-select:none;margin-top:4px;font-size:10px;display:block}.tl-msg-timestamp{color:var(--text-tertiary,#555);text-align:right;-webkit-user-select:none;user-select:none;margin-top:4px;padding-right:2px;font-size:10px;display:block}.bubble-queued{padding-right:28px;position:relative}.queued-bubble-delete{cursor:pointer;color:var(--text-secondary,#888);background:0 0;border:none;padding:0 2px;font-size:1rem;line-height:1;position:absolute;top:6px;right:6px}.queued-bubble-delete:hover{color:var(--danger)}.maxy-checkbox{cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:6px;display:flex;position:relative}.maxy-checkbox--disabled{opacity:.4;pointer-events:none}.maxy-checkbox input{opacity:0;pointer-events:none;width:0;height:0;position:absolute}.maxy-checkbox__box{border:1px solid var(--border-strong);color:#0000;border-radius:3px;flex-shrink:0;justify-content:center;align-items:center;width:14px;height:14px;font-size:10px;transition:border-color .15s,color .15s;display:flex}.maxy-checkbox input:checked+.maxy-checkbox__box{border-color:var(--sage);color:var(--sage)}.maxy-checkbox__label{font-family:var(--font-body);color:var(--text-secondary);font-size:13px}.selection-overlay-band{background:color-mix(in srgb, var(--bg) 85%, transparent);-webkit-backdrop-filter:blur(4px);border-left:1px solid var(--border-strong);z-index:10;pointer-events:none;width:64px;position:absolute;top:0;bottom:0;right:0}.tl-text-block{position:relative}.message-select-check,.tl-select-check{z-index:11;position:absolute;top:50%;right:10px;transform:translateY(-50%)}.message.selected .bubble,.message.selected .admin-activity{background:#7c8c7214}.selection-bar{justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;display:flex}.selection-cancel{font-family:var(--font-body);color:var(--text-secondary);cursor:pointer;background:0 0;border:none;font-size:14px}.selection-count{font-family:var(--font-body);color:var(--text);font-size:14px;font-weight:500}.selection-copy-wrap{position:relative}.selection-copy{color:var(--sage);font-family:var(--font-body);cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:manipulation;background:0 0;border:none;flex-direction:column;align-items:center;gap:2px;padding:0;font-size:11px;display:flex}.copy-menu{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-md);z-index:20;white-space:nowrap;animation:.15s ease-out messageIn;position:absolute;bottom:calc(100% + 8px);right:50%;overflow:hidden;transform:translate(50%)}.copy-menu-item{width:100%;font-family:var(--font-body);color:var(--text);text-align:left;cursor:pointer;background:0 0;border:none;padding:10px 16px;font-size:13px;display:block}.copy-menu-item:not(:last-child){border-bottom:1px solid var(--border)}.copy-menu-item:active{background:var(--hover)}.copy-toast{background:var(--text);color:var(--bg);font-family:var(--font-body);border-radius:var(--radius-full);z-index:100;pointer-events:none;padding:6px 16px;font-size:13px;animation:.2s ease-out messageIn;position:fixed;bottom:80px;left:50%;transform:translate(-50%)}.copy-toast-failed{background:var(--error,#c00);color:#fff}.component-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-sm);width:fit-content;max-width:100%;padding:14px 16px}.component-card--submitted{opacity:.6;pointer-events:none}.component-card__actions{justify-content:flex-end;align-items:center;gap:8px;padding-top:10px;display:flex}.component-card__done-label{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;font-style:italic}.output-style-selector{flex-direction:column;gap:0;max-width:320px;display:flex}.output-style-selector__row{border-radius:var(--radius-sm);cursor:pointer;-webkit-user-select:none;user-select:none;align-items:flex-start;gap:10px;padding:10px 8px;transition:background .15s;display:flex}.output-style-selector__row:hover,.output-style-selector__row--selected{background:var(--sage-subtle)}.output-style-selector__radio{border:2px solid var(--text-secondary);border-radius:50%;flex-shrink:0;width:16px;height:16px;margin-top:1px;transition:border-color .15s,box-shadow .15s}.output-style-selector__radio--checked{border-color:var(--text);box-shadow:inset 0 0 0 3px var(--surface), inset 0 0 0 8px var(--text)}.output-style-selector__info{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.output-style-selector__label{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500;line-height:1.3}.output-style-selector__desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.thinking-view-selector{flex-direction:column;gap:0;max-width:320px;display:flex}.thinking-view-selector__row{border-radius:var(--radius-sm);cursor:pointer;-webkit-user-select:none;user-select:none;align-items:flex-start;gap:10px;padding:10px 8px;transition:background .15s;display:flex}.thinking-view-selector__row:hover,.thinking-view-selector__row--selected{background:var(--sage-subtle)}.thinking-view-selector__radio{border:2px solid var(--text-secondary);border-radius:50%;flex-shrink:0;width:16px;height:16px;margin-top:1px;transition:border-color .15s,box-shadow .15s}.thinking-view-selector__radio--checked{border-color:var(--text);box-shadow:inset 0 0 0 3px var(--surface), inset 0 0 0 8px var(--text)}.thinking-view-selector__info{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.thinking-view-selector__label{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500;line-height:1.3}.thinking-view-selector__desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.plugin-selector{flex-direction:column;gap:10px;max-width:420px;display:flex}.plugin-selector__header{border-bottom:1px solid var(--border);padding-bottom:6px}.plugin-selector__list{flex-direction:column;gap:0;max-height:400px;display:flex;overflow-y:auto}.plugin-selector__row{border-radius:var(--radius-sm);cursor:pointer;-webkit-user-select:none;user-select:none;align-items:flex-start;gap:10px;padding:8px 6px;transition:background .15s;display:flex}.plugin-selector__row:hover{background:var(--sage-subtle)}.plugin-selector__info{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.plugin-selector__name{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500;line-height:1.3}.plugin-selector__recommended{font-family:var(--font-body);color:var(--sage);margin-left:6px;font-size:10px;font-weight:500}.plugin-selector__desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.single-select{flex-direction:column;gap:0;display:flex}.single-select__title{font-family:var(--font-body);color:var(--text);padding:0 8px 6px;font-size:13px;font-weight:600}.single-select__row{border-radius:var(--radius-sm);cursor:pointer;-webkit-user-select:none;user-select:none;align-items:flex-start;gap:10px;padding:10px 8px;transition:background .15s;display:flex}.single-select__row:hover,.single-select__row--selected{background:var(--sage-subtle)}.single-select__radio{border:2px solid var(--text-secondary);border-radius:50%;flex-shrink:0;width:16px;height:16px;margin-top:1px;transition:border-color .15s,box-shadow .15s}.single-select__radio--checked{border-color:var(--text);box-shadow:inset 0 0 0 3px var(--surface), inset 0 0 0 8px var(--text)}.single-select__info{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.single-select__icon{margin-right:6px}.single-select__label{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500;line-height:1.3}.single-select__desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.multi-select{flex-direction:column;gap:10px;display:flex}.multi-select__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:600}.multi-select__header{border-bottom:1px solid var(--border);padding-bottom:6px}.multi-select__list{flex-direction:column;gap:0;max-height:400px;display:flex;overflow-y:auto}.multi-select__row{border-radius:var(--radius-sm);cursor:pointer;-webkit-user-select:none;user-select:none;align-items:flex-start;gap:10px;padding:8px 6px;transition:background .15s;display:flex}.multi-select__row:hover{background:var(--sage-subtle)}.multi-select__info{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.multi-select__label{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500;line-height:1.3}.multi-select__badge{font-family:var(--font-body);color:var(--sage);margin-left:6px;font-size:10px;font-weight:500}.multi-select__desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.multi-select__group-header{font-family:var(--font-body);color:var(--text-secondary);text-transform:uppercase;letter-spacing:.04em;padding:10px 6px 4px;font-size:11px;font-weight:600}.multi-select__group-header:first-child{padding-top:0}.multi-select__row--locked{opacity:.6;cursor:default}.multi-select__row--locked:hover,.multi-select__row--locked:focus{background:0 0;outline:none}.public-components{flex-direction:column;gap:12px;max-width:85%;margin-top:8px;display:flex}@keyframes component-enter{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.public-component-enter{animation:.2s ease-out both component-enter}.single-select__row,.multi-select__row{min-height:44px}.single-select__row:focus,.multi-select__row:focus{outline:2px solid var(--accent,#7c9a82);outline-offset:-2px;border-radius:8px}@media (width<=480px){.component-card{border-radius:12px;width:100%}.multi-select__list{max-height:60vh}.browser-viewer__iframe{aspect-ratio:4/3;min-height:300px}}.confirm{flex-direction:column;gap:8px;max-width:380px;display:flex}.confirm__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:600;line-height:1.3}.confirm__desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.confirm__items{border-top:1px solid var(--border);flex-direction:column;gap:4px;padding:8px 0;display:flex}.confirm__item{justify-content:space-between;align-items:baseline;gap:12px;padding:2px 0;display:flex}.confirm__item-label{font-family:var(--font-body);color:var(--text-secondary);font-size:12px}.confirm__item-value{font-family:var(--font-body);color:var(--text);text-align:right;font-size:12px;font-weight:500}.info-card{flex-direction:column;gap:10px;max-width:380px;display:flex}.info-card__header{flex-direction:column;gap:2px;display:flex}.info-card__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:600;line-height:1.3}.info-card__subtitle{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.info-card__fields{flex-direction:column;gap:6px;display:flex}.info-card__field{border-bottom:1px solid var(--border);justify-content:space-between;align-items:baseline;gap:12px;padding:3px 0;display:flex}.info-card__field:last-child{border-bottom:none}.info-card__field-label{font-family:var(--font-body);color:var(--text-secondary);flex-shrink:0;font-size:12px}.info-card__field-value{font-family:var(--font-body);color:var(--text);text-align:right;font-size:12px;font-weight:500}.info-card__field-value--status{color:var(--sage)}.info-card__field-value a{color:var(--sage);text-decoration:none}.info-card__field-value a:hover{text-decoration:underline}.qr-code{flex-direction:column;align-items:center;gap:12px;padding:8px 0;display:flex}.qr-code--error{font-family:var(--font-body);color:var(--text-secondary);text-align:center;font-size:12px}.qr-code__canvas{color:#000;background:#fff;border-radius:12px;padding:16px}.qr-code__label{font-family:var(--font-body);color:var(--text-secondary);text-align:center;max-width:280px;font-size:12px;line-height:1.4}.action-list{flex-direction:column;gap:8px;max-width:460px;display:flex}.action-list__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:600}.action-list__items{flex-direction:column;gap:0;display:flex}.action-list__item{border-radius:var(--radius-sm);justify-content:space-between;align-items:center;gap:12px;padding:8px 6px;transition:background .15s;display:flex}.action-list__item:hover{background:var(--sage-subtle)}.action-list__item--acted{opacity:.5}.action-list__item-info{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.action-list__item-label{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500;line-height:1.3}.action-list__item-desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.action-list__item-right{flex-shrink:0;align-items:center;gap:8px;display:flex}.action-list__item-status{font-family:var(--font-body);color:var(--sage);white-space:nowrap;font-size:10px;font-weight:500}.action-list__item-actions{gap:4px;display:flex}.form-input{flex-direction:column;gap:10px;max-width:360px;display:flex}.form-input__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:600}.form-input__desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.form-input__fields{flex-direction:column;gap:12px;display:flex}.form-input__field{flex-direction:column;gap:4px;display:flex}.form-input__label{font-family:var(--font-body);color:var(--text);font-size:12px;font-weight:500}.form-input__required{color:var(--sage);margin-left:2px}.form-input__input,.form-input__textarea,.form-input__select{font-family:var(--font-body);color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);outline:none;padding:8px 10px;font-size:13px;transition:border-color .15s}.form-input__input:focus,.form-input__textarea:focus,.form-input__select:focus{border-color:var(--sage)}.form-input__input:disabled,.form-input__textarea:disabled,.form-input__select:disabled{opacity:.6;cursor:not-allowed}.form-input__textarea{resize:vertical;min-height:60px}.form-input__select{cursor:pointer}.form-input__field-desc{font-family:var(--font-body);color:var(--text-secondary);margin-top:-1px;font-size:11px;line-height:1.4}.form-input__list{flex-direction:column;gap:4px;display:flex}.form-input__list-item{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);justify-content:space-between;align-items:center;gap:8px;padding:6px 10px;display:flex}.form-input__list-item-text{font-family:var(--font-body);color:var(--text);text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:13px;overflow:hidden}.form-input__list-item-remove{color:var(--text-secondary);cursor:pointer;border-radius:var(--radius-sm);background:0 0;border:none;flex-shrink:0;padding:0 4px;font-size:16px;line-height:1;transition:color .15s}.form-input__list-item-remove:hover:not(:disabled){color:var(--text)}.form-input__list-item-remove:disabled{opacity:.6;cursor:not-allowed}.form-input__list-add{gap:6px;margin-top:2px;display:flex}.form-input__list-add .form-input__input{flex:1;min-width:0}.form-input__list-add-btn{font-family:var(--font-body);color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);cursor:pointer;flex-shrink:0;padding:8px 12px;font-size:12px;font-weight:500;transition:border-color .15s}.form-input__list-add-btn:hover:not(:disabled){border-color:var(--sage)}.form-input__list-add-btn:disabled{opacity:.6;cursor:not-allowed}.progress-tracker{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);max-width:380px;box-shadow:var(--shadow-sm);width:fit-content;padding:14px 16px}.progress-tracker--submitted{opacity:.6;pointer-events:none}.progress-tracker__title{font-family:var(--font-body);color:var(--text);padding-bottom:10px;font-size:13px;font-weight:600}.progress-tracker__steps{flex-direction:column;gap:2px;display:flex}.progress-tracker__step{border-radius:var(--radius-sm);align-items:flex-start;gap:10px;padding:6px 4px;display:flex}.progress-tracker__icon{text-align:center;flex-shrink:0;width:18px;font-size:13px;line-height:1.3}.progress-tracker__step--completed .progress-tracker__icon{color:var(--sage)}.progress-tracker__step--failed .progress-tracker__icon{color:#c44}.progress-tracker__step--active .progress-tracker__icon{color:var(--text);font-weight:700}.progress-tracker__step--pending .progress-tracker__icon,.progress-tracker__step--skipped .progress-tracker__icon{color:var(--text-tertiary)}.progress-tracker__step-info{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.progress-tracker__step-label{font-family:var(--font-body);color:var(--text);font-size:13px;line-height:1.3}.progress-tracker__step--pending .progress-tracker__step-label{color:var(--text-tertiary)}.progress-tracker__step--skipped .progress-tracker__step-label{color:var(--text-tertiary);text-decoration:line-through}.progress-tracker__step-desc{font-family:var(--font-body);color:var(--text-secondary);font-size:12px;line-height:1.4}.editor-base{background:var(--surface);border:1px solid var(--border);border-radius:10px;flex-direction:column;gap:10px;padding:12px;display:flex}.editor-base__bar{justify-content:space-between;align-items:center;padding:0 0 4px;display:flex}.editor-base__bar[draggable=true]{cursor:grab}.editor-base__bar[draggable=true] .editor-base__actions{cursor:default}.editor-base__icon{width:14px;height:14px;color:var(--text-secondary);flex-shrink:0;margin-right:6px}.editor-base__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500}.editor-base__actions{align-items:center;gap:4px;margin-left:auto;display:flex}.editor-base__status{font-family:var(--font-body);color:var(--text-tertiary);padding:2px 6px;font-size:12px}.editor-base--minimised{cursor:pointer;gap:0;padding:10px 14px}.editor-base--popout{padding:10px 14px}.editor-base-fullscreen{z-index:1000;background:var(--bg-chat);flex-direction:column;display:flex;position:fixed;inset:0}.editor-base-fullscreen__bar{border-bottom:1px solid var(--border);background:var(--surface);flex-shrink:0;justify-content:space-between;align-items:center;padding:8px 16px;display:flex}.editor-base-fullscreen__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500}.editor-base-fullscreen__body{flex:1;width:100%;max-width:800px;margin:0 auto;padding:24px;position:relative;overflow-y:auto}.doc-editor__body{background:var(--bg-chat);border:1px solid var(--border);border-radius:6px;max-height:500px;position:relative;overflow-y:auto}.doc-editor__content{font-family:var(--font-body);color:var(--text);outline:none;min-height:60px;padding:12px;font-size:15px;line-height:1.6}.doc-editor__content h1,.doc-editor__content h2,.doc-editor__content h3{margin-top:1.2em;margin-bottom:.4em;font-weight:600}.doc-editor__content h1{font-size:1.5em}.doc-editor__content h2{font-size:1.25em}.doc-editor__content h3{font-size:1.1em}.doc-editor__content p{margin:.4em 0}.doc-editor__content ul,.doc-editor__content ol{margin:.4em 0;padding-left:1.5em}.doc-editor__content code{background:var(--surface);border-radius:3px;padding:1px 4px;font-size:.9em}.doc-editor__content pre{background:var(--surface);border-radius:6px;margin:.6em 0;padding:12px;overflow-x:auto}.doc-editor__content pre code{background:0 0;padding:0}.doc-editor__content blockquote{border-left:3px solid var(--border-strong);color:var(--text-secondary);margin:.6em 0;padding-left:12px}.doc-editor__content a{color:var(--sage);text-decoration:underline}.doc-editor__content hr{border:none;border-top:1px solid var(--border);margin:1em 0}.doc-editor__content p.is-editor-empty:first-child:before{content:"Start typing or wait for content...";color:var(--text-tertiary);float:left;pointer-events:none;height:0;font-style:italic}.doc-editor__bubble-menu{background:var(--surface);border:1px solid var(--border);box-shadow:var(--shadow-sm);border-radius:8px;align-items:center;gap:4px;padding:6px;display:flex}.doc-editor__bubble-divider{background:var(--border-strong);width:1px;height:20px;margin:0 2px}.doc-editor__comment-highlight{background:var(--sage-glow);cursor:help;border-radius:2px}.doc-editor__comment-popover{z-index:10;background:var(--bg-chat);border:1px solid var(--border-strong);box-shadow:var(--shadow-md);border-radius:8px;flex-direction:column;gap:6px;max-width:280px;padding:8px;display:flex;position:absolute;top:8px;right:8px}.doc-editor__comment-input{font-family:var(--font-body);border:1px solid var(--border);background:var(--bg);color:var(--text);border-radius:6px;outline:none;width:100%;padding:6px 8px;font-size:13px}.doc-editor__comment-input:focus{border-color:var(--sage)}.doc-editor__comment-actions{justify-content:flex-end;gap:4px;display:flex}.doc-editor__fallback,.rich-editor__fallback{font-family:var(--font-body);color:var(--text);padding:12px;font-size:15px;line-height:1.6}.doc-editor__fallback ul,.doc-editor__fallback ol{margin:.4em 0;padding-left:1.5em}.doc-editor__preview{cursor:text;border-radius:6px;transition:background .15s}.doc-editor__preview:hover{background:#00000005}.rich-editor__body{background:var(--bg-chat);border:1px solid var(--border);border-radius:6px;max-height:500px;position:relative;overflow-y:auto}.rich-editor__content{font-family:var(--font-body);color:var(--text);outline:none;min-height:60px;padding:12px;font-size:15px;line-height:1.6}.rich-editor__content h1,.rich-editor__content h2,.rich-editor__content h3{margin-top:1.2em;margin-bottom:.4em;font-weight:600}.rich-editor__content h1{font-size:1.5em}.rich-editor__content h2{font-size:1.25em}.rich-editor__content h3{font-size:1.1em}.rich-editor__content p{margin:.4em 0}.rich-editor__content ul,.rich-editor__content ol{margin:.4em 0;padding-left:1.5em}.rich-editor__content img{cursor:pointer;border-radius:6px;max-width:100%;height:auto;transition:opacity .15s}.rich-editor__content img:hover{opacity:.85}.rich-editor__content a{color:var(--sage);text-decoration:underline}.rich-editor__content blockquote{border-left:3px solid var(--border-strong);color:var(--text-secondary);margin:.6em 0;padding-left:12px}.rich-editor__content p.is-editor-empty:first-child:before{content:"Start typing or wait for content...";color:var(--text-tertiary);float:left;pointer-events:none;height:0;font-style:italic}.grid-editor__body{background:var(--bg-chat);border:1px solid var(--border);border-radius:6px;max-height:500px;position:relative;overflow:auto}.grid-editor__table-wrap{min-width:100%;position:relative}.grid-editor__table{border-collapse:collapse;width:100%;font-family:var(--font-body);color:var(--text);font-size:13px}.grid-editor__col-header{background:var(--surface);text-align:left;border:1px solid var(--border);white-space:nowrap;-webkit-user-select:none;user-select:none;padding:6px 10px;font-size:12px;font-weight:600;position:relative}.grid-editor__row-header{background:var(--surface);border:1px solid var(--border);text-align:center;width:40px;min-width:40px;padding:4px;position:relative}.grid-editor__row-num{color:var(--text-tertiary);font-size:11px}.grid-editor__row-delete{color:var(--text-tertiary);cursor:pointer;background:0 0;border:none;border-radius:3px;padding:2px;display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.grid-editor__row-header:hover .grid-editor__row-num{display:none}.grid-editor__row-header:hover .grid-editor__row-delete{display:block}.grid-editor__row-delete:hover{color:var(--text);background:var(--sage-subtle)}.grid-editor__cell{border:1px solid var(--border);cursor:text;padding:0;position:relative}.grid-editor__cell--active{outline:2px solid var(--sage);outline-offset:-1px;z-index:1}.grid-editor__cell-text{white-space:nowrap;text-overflow:ellipsis;min-height:28px;padding:4px 8px;display:block;overflow:hidden}.grid-editor__cell-input{background:var(--bg-chat);width:100%;height:100%;min-height:28px;font-family:var(--font-body);color:var(--text);border:none;outline:none;padding:4px 8px;font-size:13px}.grid-editor__resize-handle{cursor:col-resize;z-index:2;width:5px;height:100%;position:absolute;top:0;right:-2px}.grid-editor__resize-handle:hover{background:var(--sage-glow)}.grid-editor__add-row{color:var(--text-tertiary);font-family:var(--font-body);cursor:pointer;background:0 0;border:none;align-items:center;gap:6px;width:100%;padding:6px 10px;font-size:12px;display:flex}.grid-editor__add-row:hover{background:var(--sage-subtle);color:var(--sage)}.grid-editor__comment-popover{z-index:10;background:var(--bg-chat);border:1px solid var(--border-strong);box-shadow:var(--shadow-md);border-radius:8px;flex-direction:column;gap:6px;max-width:280px;padding:8px;display:flex;position:absolute;top:8px;right:8px}.browser-viewer{background:var(--surface);border:1px solid var(--border);border-radius:10px;flex-direction:column;gap:10px;padding:12px;display:flex}.browser-viewer--submitted{opacity:.6;pointer-events:none;padding:10px 14px}.browser-viewer__bar{justify-content:space-between;align-items:center;padding:0 0 4px;display:flex}.browser-viewer__bar[draggable=true]{cursor:grab}.browser-viewer__bar[draggable=true] .browser-viewer__actions{cursor:default}.browser-viewer__icon{width:14px;height:14px;color:var(--text-secondary);flex-shrink:0;margin-right:6px}.browser-viewer__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500}.browser-viewer__actions{gap:4px;margin-left:auto;display:flex}.browser-viewer__iframe{border:1px solid var(--border);background:#111;border-radius:6px;width:100%;min-height:500px;display:block}.browser-viewer--minimised{cursor:pointer;border-left:3px solid var(--sage);background:var(--sage-subtle);gap:0;padding:10px 14px}.browser-viewer--minimised .browser-viewer__iframe{display:none}.browser-viewer--popout{border-left:3px solid var(--sage);background:var(--sage-subtle);padding:10px 14px}.browser-viewer__popout-label{font-family:var(--font-body);color:var(--text-tertiary);padding:2px 0;font-size:12px}.browser-viewer-fullscreen{z-index:1000;background:var(--surface,#111);flex-direction:column;display:flex;position:fixed;inset:0}.browser-viewer-fullscreen__bar{border-bottom:1px solid var(--border);background:var(--surface);flex-shrink:0;justify-content:space-between;align-items:center;padding:8px 12px;display:flex}.browser-viewer-fullscreen__title{font-family:var(--font-body);color:var(--text);font-size:13px;font-weight:500}.browser-viewer-fullscreen__actions{gap:4px;display:flex}.browser-viewer-fullscreen__iframe{background:#111;border:none;flex:1;width:100%}.browser-overlay-popout{z-index:1000;background:var(--surface);border:1px solid var(--border);border-radius:10px;align-items:center;gap:8px;padding:8px 14px;display:flex;position:fixed;bottom:16px;left:50%;transform:translate(-50%);box-shadow:0 2px 12px #00000026}.btn{font-family:var(--font-body);white-space:nowrap;cursor:pointer;-webkit-font-smoothing:antialiased;background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;padding:10px 16px;font-size:14px;font-weight:400;line-height:1;transition:background .15s,opacity .15s,color .15s;display:inline-flex;position:relative}.btn:disabled{opacity:.4;cursor:not-allowed}.btn__content{align-items:center;gap:6px;display:flex}.btn__spinner{justify-content:center;align-items:center;font-size:14px;animation:1.2s linear infinite spin;display:flex;position:absolute;inset:0}.btn--sm .btn__spinner{font-size:11px}.btn--lg .btn__spinner{font-size:17px}.btn--primary{background:var(--sage);color:#fff;border-radius:var(--radius-full)}.btn--primary:hover:not(:disabled){background:var(--sage-hover)}.btn--secondary{color:var(--text-secondary);border:1px solid var(--border-strong);border-radius:var(--radius-full);background:0 0}.btn--secondary:hover:not(:disabled){border-color:var(--sage)}.btn--ghost{color:var(--text-secondary);background:0 0;border:none;padding:0 2px}.btn--ghost:hover:not(:disabled){color:var(--sage)}.btn--danger{background:var(--danger);color:#fff;border-radius:var(--radius-full)}.btn--danger:hover:not(:disabled){background:var(--danger-hover)}.btn--send{background:var(--sage);color:#fff;border-radius:50%}.btn--send:hover:not(:disabled){background:var(--sage-hover)}.btn--send:active:not(:disabled){transform:scale(.95)}.btn--send svg{width:16px;height:16px}.btn--icon{color:var(--text-tertiary);background:0 0;border:none;padding:2px}.btn--icon:hover:not(:disabled){color:var(--text-secondary)}.btn--suggestion{color:var(--text-secondary);border:1px solid var(--border-strong);border-radius:var(--radius-full);background:0 0;font-size:13px}.btn--suggestion:hover:not(:disabled){border-color:var(--sage)}.btn--sm{padding:6px 10px;font-size:12px}.btn--lg{padding:12px 24px;font-size:15px}.btn--full{width:100%}.file-attachment{align-items:center;gap:10px;max-width:380px;display:flex}.file-attachment__icon{color:var(--text-secondary);flex-shrink:0}.file-attachment__info{flex:1;min-width:0}.file-attachment__name{font-family:var(--font-body);color:var(--text);text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;line-height:1.3;overflow:hidden}.file-attachment__meta{font-family:var(--font-body);color:var(--text-secondary);font-size:11px;line-height:1.4}.file-attachment__download{border:1px solid var(--border);width:32px;height:32px;color:var(--text-secondary);cursor:pointer;background:0 0;border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;transition:background .15s,color .15s;display:flex}.file-attachment__download:hover:not(:disabled){background:var(--bg-hover);color:var(--text)}.file-attachment__download:disabled{opacity:.4;cursor:not-allowed}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{C as e,D as t,S as n,T as r,_ as i,a,b as o,d as s,f as c,h as l,i as u,j as d,k as f,m as p,n as m,p as h,r as g,s as _,t as v,u as y,v as b,w as x,x as S,y as C}from"./ChatInput-DobbViSh.js";var w=t(),T=d(f(),1),E=`image/jpeg,image/png,image/gif,image/webp,application/pdf,text/plain,text/markdown,text/csv`,D=new Set(E.split(`,`)),O=20*1024*1024,k=typeof window<`u`&&/^(localhost|127\.0\.0\.1|[a-z0-9-]+\.local)(:|$)/.test(window.location.hostname);function A(){let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[...e].map(e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function j(){let e=window.location.pathname.match(/^\/([a-z][a-z0-9-]{2,49})$/);return e?e[1]:void 0}function M(e){return[{key:`length`,label:`At least 8 characters`,met:e.length>=8},{key:`number`,label:`Contains a number`,met:/\d/.test(e)},{key:`special`,label:`Contains a special character`,met:/[^A-Za-z0-9]/.test(e)},{key:`whitespace`,label:`No leading or trailing spaces`,met:e.length>0&&e===e.trim()}]}function N(e,t){if(t===`phone`)return e.length>4?e.slice(0,e.length-4).replace(/\d/g,`•`)+` `+e.slice(-4):e;let n=e.indexOf(`@`);return n<=2?e:e.slice(0,2)+`•••`+e.slice(n)}function P(e){let[t,n]=(0,T.useState)(null),[r,i]=(0,T.useState)(null),[a,o]=(0,T.useState)(`loading`),[s,c]=(0,T.useState)(``),[l,u]=(0,T.useState)(null),d=(0,T.useMemo)(()=>j(),[]),f=(0,T.useRef)(d||``),p=(0,T.useRef)(null),m=(0,T.useRef)(null),h=(0,T.useRef)(!1),g=(0,T.useRef)(null),[_,v]=(0,T.useState)(`sign-in`),[y,b]=(0,T.useState)(null),x=(0,T.useRef)(null),S=(0,T.useRef)(null);(0,T.useEffect)(()=>{try{let e=sessionStorage.getItem(`maxy_session`);e&&(S.current=e)}catch{}},[]);let C=(0,T.useCallback)(t=>{p.current=t,n(t);try{sessionStorage.setItem(`maxy_session`,t)}catch{}o(`chat`),e(t)},[e]),w=(0,T.useCallback)(()=>{p.current=null;try{sessionStorage.removeItem(`maxy_session`)}catch{}n(null),o(`auth-required`),v(`sign-in`)},[]),E=(0,T.useCallback)(async e=>{try{let t=f.current,n=await fetch(`/api/access/verify-token`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:e,agentSlug:t})}),r=await n.json();n.ok?(x.current=r.session_key,b(r.grant),v(`set-password`),window.history.replaceState({},``,window.location.pathname)):v(`link-expired`)}catch{v(`sign-in`)}},[]);return{sessionId:t,sessionKeyRef:p,sessionError:r,pageState:a,setPageState:o,agentDisplayName:s,agentSlug:d,branding:l,resolvedSlugRef:f,ensureSession:(0,T.useCallback)(async()=>{if(p.current)return p.current;if(m.current)return m.current;let e=(async()=>{try{let e=S.current,t=await fetch(`/api/session`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({session_id:A(),...d?{agent:d}:{},...e?{session_key:e}:{}})});if(!t.ok){let e=await t.json().catch(()=>({error:``}));return k&&console.error(`[session] POST /api/session failed: ${t.status} ${t.statusText}`,e),t.status===404?i(e.error||`Agent not found`):t.status===503&&i(e.error||`Service unavailable`),null}let r=await t.json();if(r.auth_required){r.agent_id&&(f.current=r.agent_id),c(r.displayName||``),r.branding&&u(r.branding),o(`auth-required`);let e=new URLSearchParams(window.location.search).get(`token`);return e?E(e):v(`sign-in`),null}p.current=r.session_key,n(r.session_key),r.branding&&u(r.branding),o(`chat`),r.resumed&&r.messages&&(h.current=!0,g.current=r.messages);try{sessionStorage.setItem(`maxy_session`,r.session_key)}catch{}return r.session_key}catch(e){return k&&console.error(`[session] fetch /api/session threw:`,e),i(`Unable to connect. Please check your connection and try again.`),null}finally{m.current=null}})();return m.current=e,e},[d,E]),enterChat:C,enterGate:w,resumedRef:h,resumeMessagesRef:g,gateState:_,setGateState:v,grantInfo:y,setGrantInfo:b,gateSessionKeyRef:x}}function F({sessionKeyRef:e,ensureSession:t,sessionError:n,pageState:r,inputRef:a}){let[o,s]=(0,T.useState)([]),[c,l]=(0,T.useState)(!1),u=(0,T.useRef)(!1),d=e=>{u.current=e,l(e)},f=(0,T.useCallback)(async o=>{if(!u.current){d(!0),s([{role:`maxy`,content:``,timestamp:Date.now()}]);try{let n=await fetch(`/api/chat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({greeting:!0,session_key:o})});if(n.status===401){e.current=null;try{sessionStorage.removeItem(`maxy_session`)}catch{}k&&console.warn(`[greeting] stale session, retrying with fresh session`);let r=await t();if(!r)return;n=await fetch(`/api/chat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({greeting:!0,session_key:r})})}if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||`Something went wrong`)}let r=``,a=``,c=()=>{a&&(r+=a,a=``,s(e=>{let t=[...e];return t[0]={...t[0],content:r},t}))},l=setInterval(c,60);try{for await(let e of i(n)){if(e.error)throw Object.assign(Error(e.error),{fromSSE:!0});e.text&&(a+=e.text),e.type===`component`&&(c(),s(t=>{let n=[...t],r={...n[0]},i=[...r.components||[]];return i.push({name:e.name,data:e.data,submitted:!1}),n[0]={...r,components:i},n}))}}finally{clearInterval(l),c()}}catch(e){if(k&&console.error(`[chat] greeting failed:`,e),r===`auth-required`)return;let t=e instanceof Error?e.message:String(e);s([{role:`maxy`,content:e instanceof Error&&e.fromSSE?t:n??`I'm having trouble connecting right now. Try refreshing the page.`,timestamp:Date.now()}])}finally{d(!1),r===`chat`&&a.current?.focus()}}},[e,t,n,r,a]),p=(0,T.useCallback)(async(o,c)=>{let l=c?.hidden??!1,f=c?.files??[];if(!o&&f.length===0||u.current)return;d(!0);let p=f.map(e=>({filename:e.name,mimeType:e.type})),m={role:`visitor`,content:o,attachments:p.length>0?p:void 0,timestamp:Date.now(),hidden:l},h;s(e=>{let t=[...e,m,{role:`maxy`,content:``,timestamp:Date.now()}];return h=t.length-1,t});try{let n=await t();if(!n)throw Error(`session`);let r=e=>{if(f.length>0){let t=new FormData;t.append(`message`,o),t.append(`session_key`,e);for(let e of f)t.append(`attachments`,e);return{body:t,headers:{}}}return{body:JSON.stringify({message:o,session_key:e}),headers:{"Content-Type":`application/json`}}},{body:a,headers:c}=r(n),l=await fetch(`/api/chat`,{method:`POST`,headers:c,body:a});if(l.status===401){e.current=null;try{sessionStorage.removeItem(`maxy_session`)}catch{}k&&console.warn(`[session-expired] stale key cleared, retrying with fresh session`);let n=await t();if(!n)throw Error(`session`);({body:a,headers:c}=r(n)),l=await fetch(`/api/chat`,{method:`POST`,headers:c,body:a})}if(!l.ok){let e=await l.json().catch(()=>({}));throw Error(e.error||`Something went wrong`)}let u=``,d=``,p=()=>{d&&(u+=d,d=``,s(e=>{let t=[...e];return t[h]={...t[h],content:u},t}))},m=setInterval(p,60);try{for await(let e of i(l)){if(e.error)throw Object.assign(Error(e.error),{fromSSE:!0});e.text&&(d+=e.text),e.type===`component`&&(p(),s(t=>{let n=[...t],r={...n[h]},i=[...r.components||[]];return i.push({name:e.name,data:e.data,submitted:!1}),n[h]={...r,components:i},n}))}}finally{clearInterval(m),p()}}catch(e){if(k&&console.error(`[chat] sendMessage failed:`,e),r===`auth-required`)return;let t=e instanceof Error?e.message:String(e),i=e instanceof Error&&e.fromSSE;s(e=>{let r=[...e];return r[h]={...r[h],content:i?t:t===`session`?n??`I'm having trouble connecting right now. Try refreshing the page.`:`Sorry, I hit a snag. Try again in a moment.`},r})}finally{d(!1),r===`chat`&&a.current?.focus()}},[e,t,n,r,a]);return{messages:o,setMessages:s,isStreaming:c,sendMessage:p,sendGreeting:f,handleComponentSubmit:(0,T.useCallback)((e,t,n)=>{s(n=>{let r=[...n],i={...r[e]},a=[...i.components||[]];return a[t]={...a[t],submitted:!0},r[e]={...i,components:a},r}),p(n,{hidden:!0})},[p])}}var I=c();function L({value:e,onChange:t,onComplete:n,disabled:r}){let i=(0,T.useRef)([]);function a(n,r){r.key===`Backspace`?(r.preventDefault(),e[n]?t(e.slice(0,n)+e.slice(n+1)):n>0&&(t(e.slice(0,n-1)+e.slice(n)),i.current[n-1]?.focus())):r.key===`ArrowLeft`&&n>0?i.current[n-1]?.focus():r.key===`ArrowRight`&&n<5&&i.current[n+1]?.focus()}function o(r,a){let o=a.nativeEvent.data;if(!o||!/^\d$/.test(o))return;let s=e.split(``);for(s[r]=o;s.length<r;)s.push(``);let c=s.join(``).replace(/\D/g,``).slice(0,6);t(c),c.length===6?n(c):r<5&&i.current[r+1]?.focus()}function s(e){e.preventDefault();let r=e.clipboardData.getData(`text`).replace(/\D/g,``).slice(0,6);r&&(t(r),r.length===6?n(r):i.current[r.length]?.focus())}return(0,I.jsx)(`div`,{className:`gate-otp-field`,children:Array.from({length:6}).map((t,n)=>(0,I.jsx)(`input`,{ref:e=>{i.current[n]=e},type:`text`,inputMode:`numeric`,className:`pin-box${e[n]?` pin-box-filled`:``}`,value:e[n]||``,onKeyDown:e=>a(n,e),onInput:e=>o(n,e),onPaste:s,onFocus:e=>e.target.select(),autoFocus:n===0,autoComplete:`off`,maxLength:1,disabled:r,"aria-label":`Code digit ${n+1}`},n))})}function R({gateState:e,setGateState:t,grantInfo:n,setGrantInfo:r,gateSessionKeyRef:i,resolvedSlugRef:a,onAuthenticated:o}){let[c,l]=(0,T.useState)(``),[u,d]=(0,T.useState)(``),[f,p]=(0,T.useState)(``),[m,h]=(0,T.useState)(!1),[g,_]=(0,T.useState)(``),[v,b]=(0,T.useState)(``),[x,S]=(0,T.useState)(!1),[C,w]=(0,T.useState)(null),[E,D]=(0,T.useState)(null),[O,k]=(0,T.useState)(!1);async function A(e){if(e.preventDefault(),!O){w(null),k(!0);try{let e=a.current,n=await fetch(`/api/access/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({contact:c,password:u,agentSlug:e})}),i=await n.json();n.ok?o(i.session_key):n.status===401?i.error?.includes(`setup not complete`)||i.error?.includes(`invitation link`)?(t(`private-agent`),w(null)):w(i.error||`Invalid credentials`):n.status===403?(t(`access-expired`),i.expiresAt&&r(e=>e?{...e,expiresAt:i.expiresAt}:{displayName:null,contactValue:c,contactMethod:`email`,expiresAt:i.expiresAt,status:`expired`})):n.status===429?w(i.error||`Too many attempts. Please try again later.`):w(i.error||`Something went wrong`)}catch{w(`Unable to connect. Please try again.`)}finally{k(!1)}}}async function j(e){if(!O){w(null),k(!0);try{let n=a.current,o=await fetch(`/api/access/verify-otp`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({phone:v,code:e,agentSlug:n})}),s=await o.json();o.ok?(i.current=s.session_key,r(s.grant),t(`set-password`)):o.status===429?t(`otp-failed`):(w(s.error||`Invalid code`),_(``))}catch{w(`Unable to connect. Please try again.`)}finally{k(!1)}}}async function P(e){if(e.preventDefault(),!O){if(w(null),u!==f){w(`Passwords do not match`);return}if(!M(u).every(e=>e.met)){w(`Password does not meet requirements`);return}k(!0);try{let e=i.current;if(!e){w(`Session expired. Please use your invitation link again.`);return}let t=await fetch(`/api/access/create-credentials`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({session_key:e,password:u})}),n=await t.json();t.ok?o(n.session_key):t.status===400&&n.requirements?w(n.requirements.filter(e=>!e.met).map(e=>e.label).join(`, `)):w(n.error||`Something went wrong`)}catch{w(`Unable to connect. Please try again.`)}finally{k(!1)}}}async function F(e){if(e.preventDefault(),!(O||!c)){w(null),k(!0);try{let e=a.current,t=await fetch(`/api/access/forgot-password`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({contact:c,agentSlug:e})});t.status===429?w((await t.json()).error||`Too many attempts. Please try again later.`):(D(`If an account exists, a reset link has been sent.`),setTimeout(()=>{S(!1),D(null)},4e3))}catch{w(`Unable to connect. Please try again.`)}finally{k(!1)}}}switch(e){case`set-password`:{let e=M(u),t=e.every(e=>e.met),r=u===f,i=t&&r&&f.length>0;return(0,I.jsx)(`div`,{className:`gate-wrap`,children:(0,I.jsxs)(`div`,{className:`gate-card`,children:[n?.expiresAt&&(0,I.jsxs)(`div`,{className:`gate-expiry-badge`,children:[`Access until `,new Date(n.expiresAt).toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`})]}),(0,I.jsxs)(`h2`,{className:`gate-title`,children:[`Welcome, `,n?.displayName||`there`]}),(0,I.jsx)(`p`,{className:`gate-subtitle`,children:`Create a password to access this agent in the future.`}),(0,I.jsxs)(`form`,{className:`gate-form`,onSubmit:P,children:[(0,I.jsxs)(`div`,{className:`gate-field`,children:[(0,I.jsx)(`label`,{htmlFor:`gate-display-name`,children:`Display name`}),(0,I.jsx)(`input`,{id:`gate-display-name`,type:`text`,value:n?.displayName||``,disabled:!0})]}),(0,I.jsxs)(`div`,{className:`gate-field gate-pw-row`,children:[(0,I.jsx)(`label`,{htmlFor:`gate-pw`,children:`Password`}),(0,I.jsx)(`div`,{className:`gate-pw-toggle`,children:(0,I.jsx)(s,{checked:m,onChange:h,label:`Show`})}),(0,I.jsx)(`input`,{id:`gate-pw`,type:m?`text`:`password`,value:u,onChange:e=>d(e.target.value),placeholder:`Your password`,autoFocus:!0,autoComplete:`new-password`}),u.length>0&&(0,I.jsx)(`div`,{className:`gate-strength`,children:e.map(e=>(0,I.jsxs)(`span`,{className:`gate-strength-item${e.met?` met`:``}`,children:[e.met?`✓`:`○`,` `,e.label]},e.key))})]}),(0,I.jsxs)(`div`,{className:`gate-field`,children:[(0,I.jsx)(`label`,{htmlFor:`gate-pw-confirm`,children:`Confirm password`}),(0,I.jsx)(`input`,{id:`gate-pw-confirm`,type:m?`text`:`password`,value:f,onChange:e=>p(e.target.value),placeholder:`Confirm your password`,autoComplete:`new-password`}),f.length>0&&!r&&(0,I.jsx)(`div`,{className:`gate-error`,children:`Passwords do not match`})]}),C&&(0,I.jsx)(`div`,{className:`gate-error`,children:C}),(0,I.jsx)(`div`,{className:`gate-submit`,children:(0,I.jsx)(y,{variant:`primary`,type:`submit`,fullWidth:!0,disabled:!i||O,loading:O,children:`Create account & enter chat`})})]})]})})}case`enter-otp`:return(0,I.jsx)(`div`,{className:`gate-wrap`,children:(0,I.jsxs)(`div`,{className:`gate-card`,children:[(0,I.jsx)(`h2`,{className:`gate-title`,children:`Enter your code`}),(0,I.jsxs)(`p`,{className:`gate-subtitle`,children:[`Enter the 6-digit code sent to `,N(v,`phone`)]}),(0,I.jsx)(L,{value:g,onChange:_,onComplete:j,disabled:O}),C&&(0,I.jsx)(`div`,{className:`gate-error`,children:C}),O&&(0,I.jsxs)(`div`,{className:`gate-loading`,children:[(0,I.jsx)(`span`,{className:`spinner`}),`Verifying...`]}),(0,I.jsx)(`div`,{className:`gate-resend`,children:(0,I.jsx)(`button`,{type:`button`,className:`gate-link`,onClick:()=>{t(`sign-in`),_(``),w(null)},children:`Use a different number`})})]})});case`sign-in`:case`private-agent`:return(0,I.jsx)(`div`,{className:`gate-wrap`,children:(0,I.jsxs)(`div`,{className:`gate-card`,children:[(0,I.jsx)(`h2`,{className:`gate-title`,children:e===`private-agent`?`Private Agent`:`Welcome back`}),(0,I.jsx)(`p`,{className:`gate-subtitle`,children:e===`private-agent`?`This agent is invitation-only. If you have an account, sign in below.`:`Sign in to continue your conversation.`}),x?(0,I.jsxs)(`form`,{className:`gate-form`,onSubmit:F,children:[(0,I.jsxs)(`div`,{className:`gate-field`,children:[(0,I.jsx)(`label`,{htmlFor:`gate-forgot-contact`,children:`Email or phone`}),(0,I.jsx)(`input`,{id:`gate-forgot-contact`,type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:`you@example.com`,autoFocus:!0,autoComplete:`email`})]}),C&&(0,I.jsx)(`div`,{className:`gate-error`,children:C}),E&&(0,I.jsx)(`div`,{className:`gate-success`,children:E}),(0,I.jsx)(`div`,{className:`gate-submit`,children:(0,I.jsx)(y,{variant:`primary`,type:`submit`,fullWidth:!0,disabled:!c.trim()||O,loading:O,children:`Send reset link`})}),(0,I.jsx)(`div`,{className:`gate-actions`,children:(0,I.jsx)(`button`,{type:`button`,className:`gate-link`,onClick:()=>{S(!1),w(null),D(null)},children:`Back to sign in`})})]}):(0,I.jsxs)(`form`,{className:`gate-form`,onSubmit:A,children:[(0,I.jsxs)(`div`,{className:`gate-field`,children:[(0,I.jsx)(`label`,{htmlFor:`gate-contact`,children:`Email or phone`}),(0,I.jsx)(`input`,{id:`gate-contact`,type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:`you@example.com`,autoFocus:!0,autoComplete:`email`})]}),(0,I.jsxs)(`div`,{className:`gate-field gate-pw-row`,children:[(0,I.jsx)(`label`,{htmlFor:`gate-login-pw`,children:`Password`}),(0,I.jsx)(`div`,{className:`gate-pw-toggle`,children:(0,I.jsx)(s,{checked:m,onChange:h,label:`Show`})}),(0,I.jsx)(`input`,{id:`gate-login-pw`,type:m?`text`:`password`,value:u,onChange:e=>d(e.target.value),placeholder:`Your password`,autoComplete:`current-password`})]}),C&&(0,I.jsx)(`div`,{className:`gate-error`,children:C}),(0,I.jsx)(`div`,{className:`gate-submit`,children:(0,I.jsx)(y,{variant:`primary`,type:`submit`,fullWidth:!0,disabled:!c.trim()||!u||O,loading:O,children:`Sign in`})}),(0,I.jsx)(`div`,{className:`gate-actions`,children:(0,I.jsx)(`button`,{type:`button`,className:`gate-link`,onClick:()=>{S(!0),w(null)},children:`Forgot password?`})})]}),e===`private-agent`&&(0,I.jsx)(`p`,{className:`gate-hint`,children:`No account? You need an invitation from the agent owner.`})]})});case`access-expired`:return(0,I.jsx)(`div`,{className:`gate-wrap`,children:(0,I.jsxs)(`div`,{className:`gate-card`,children:[(0,I.jsx)(`div`,{className:`gate-icon`,children:`⏰`}),(0,I.jsx)(`h2`,{className:`gate-title`,children:`Access expired`}),(0,I.jsxs)(`p`,{className:`gate-subtitle`,children:[n?.expiresAt?`Your access expired on ${new Date(n.expiresAt).toLocaleDateString(`en-GB`,{day:`numeric`,month:`long`,year:`numeric`})}.`:`Your access to this agent has expired.`,` `,`Contact the agent owner to renew.`]}),(0,I.jsx)(`div`,{className:`gate-actions`,children:(0,I.jsx)(y,{variant:`secondary`,onClick:()=>{t(`sign-in`),w(null),d(``)},children:`Sign in with a different account`})})]})});case`link-expired`:return(0,I.jsx)(`div`,{className:`gate-wrap`,children:(0,I.jsxs)(`div`,{className:`gate-card`,children:[(0,I.jsx)(`div`,{className:`gate-icon`,children:`⚠️`}),(0,I.jsx)(`h2`,{className:`gate-title`,children:`Link expired`}),(0,I.jsx)(`p`,{className:`gate-subtitle`,children:`This invitation link has expired or has already been used. If you already set your password, sign in below. Otherwise, ask the agent owner to send a new invitation.`}),(0,I.jsx)(`div`,{className:`gate-actions`,children:(0,I.jsx)(y,{variant:`primary`,onClick:()=>{t(`sign-in`),w(null)},children:`Go to sign in`})})]})});case`otp-failed`:return(0,I.jsx)(`div`,{className:`gate-wrap`,children:(0,I.jsxs)(`div`,{className:`gate-card`,children:[(0,I.jsx)(`div`,{className:`gate-icon`,children:`⛔`}),(0,I.jsx)(`h2`,{className:`gate-title`,children:`Too many attempts`}),(0,I.jsx)(`p`,{className:`gate-subtitle`,children:`You've entered the wrong code too many times. Ask the agent owner to send a new code.`}),(0,I.jsx)(`div`,{className:`gate-actions`,children:(0,I.jsx)(y,{variant:`secondary`,onClick:()=>{t(`sign-in`),w(null),_(``)},children:`Back to sign in`})})]})})}}var z={"single-select":a,"multi-select":u};function B({name:e,data:t,onSubmit:n,submitted:r}){let i=z[e];return i?(0,I.jsx)(i,{data:t,onSubmit:n,submitted:r}):(console.warn(`[PublicComponentRenderer] Unknown component: "${e}". Registered: ${Object.keys(z).join(`, `)}`),(0,I.jsx)(`div`,{className:`component-card component-card--error`,children:(0,I.jsxs)(`p`,{style:{fontFamily:`var(--font-body)`,fontSize:12,color:`var(--text-secondary)`},children:[`Component “`,e,`” is not available. This may require a platform update.`]})}))}function V({messages:t,isStreaming:i,sessionError:a,selectionMode:o,selectedItems:c,toggleSelectItem:l,onComponentSubmit:u,remainingSuggestions:d,onSuggestionClick:f,isAtBottom:p,setIsAtBottom:m}){let[h,v]=(0,T.useState)(new Set),[b,x]=(0,T.useState)(new Set),S=(0,T.useRef)(null),C=(0,T.useRef)(null),w=(0,T.useRef)(null),E=(0,T.useRef)(!1),D=(0,T.useRef)(!1),O=(0,T.useRef)(0),k=(0,T.useRef)(!1),A=(0,T.useRef)(new Map);k.current=i,(0,T.useEffect)(()=>{i&&!E.current&&p&&(D.current=!0)},[i,p]),(0,T.useEffect)(()=>{if(!D.current&&!p){E.current=i;return}if(E.current&&!i&&w.current&&C.current){let e=w.current;if(e.offsetHeight>C.current.clientHeight){D.current=!1,e.scrollIntoView({behavior:`smooth`,block:`start`}),E.current=i;return}}(p||D.current)&&S.current?.scrollIntoView({behavior:`smooth`}),E.current=i},[t,p,i]),(0,T.useEffect)(()=>{let e=C.current;if(!e)return;let t=()=>{let t=e.scrollTop;k.current&&t<O.current&&(D.current=!1),O.current=t,m(e.scrollHeight-e.scrollTop-e.clientHeight<80)};return e.addEventListener(`scroll`,t,{passive:!0}),t(),()=>e.removeEventListener(`scroll`,t)},[m]),(0,T.useEffect)(()=>{function e(){x(e=>{let t=new Set;return A.current.forEach((n,r)=>{n.isConnected&&(h.has(r)?e.has(r)&&t.add(r):n.scrollHeight>n.clientHeight+2&&t.add(r))}),e.size===t.size&&[...e].every(e=>t.has(e))?e:t})}e();let t=new ResizeObserver(e);return A.current.forEach(e=>t.observe(e)),()=>t.disconnect()},[t.length,h]);let j=t.reduce((e,t,n)=>t.role===`maxy`&&!t.hidden?n:e,-1);return(0,I.jsxs)(`div`,{className:`chat-messages-wrap`,children:[o&&(0,I.jsx)(`div`,{className:`selection-overlay-band`}),(0,I.jsxs)(`div`,{className:`chat-messages`,ref:C,children:[a&&t.length===0&&(0,I.jsx)(`div`,{className:`session-error`,children:(0,I.jsx)(`p`,{children:a})}),t.map((a,d)=>{if(a.hidden)return null;let f=i&&d===t.length-1,p=`${a.timestamp}_${a.role}`,m=c.has(p);return(0,I.jsxs)(`div`,{ref:d===j?w:void 0,className:`message ${a.role}${m?` selected`:``}`,children:[o&&!f&&(0,I.jsx)(`div`,{className:`message-select-check`,children:(0,I.jsx)(s,{checked:m,onChange:()=>l(p)})}),(0,I.jsxs)(`div`,{className:`bubble`,children:[a.role===`visitor`&&a.content?(()=>{let e=h.has(d),t=b.has(d);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{ref:e=>{e?A.current.set(d,e):A.current.delete(d)},className:e?`bubble-content`:`bubble-content clamped${t?` overflowing`:``}`,children:a.content}),t&&(0,I.jsx)(`div`,{className:`bubble-expand`,children:(0,I.jsx)(y,{variant:`icon`,className:e?`expanded`:``,onClick:()=>v(e=>{let t=new Set(e);return t.has(d)?t.delete(d):t.add(d),t}),"aria-label":e?`Collapse message`:`Expand message`,children:(0,I.jsx)(r,{size:14})})})]})})():a.content?(0,I.jsx)(_,{content:a.content,timestamp:g(a.timestamp)}):(0,I.jsxs)(`span`,{className:`typing-indicator`,children:[(0,I.jsx)(`span`,{className:`typing-dot`}),(0,I.jsx)(`span`,{className:`typing-dot`}),(0,I.jsx)(`span`,{className:`typing-dot`})]}),a.attachments&&a.attachments.length>0&&(0,I.jsx)(`div`,{className:`message-attachments`,children:a.attachments.map((t,r)=>(0,I.jsxs)(`span`,{className:`message-attachment-chip no-action`,children:[t.mimeType===`application/pdf`?(0,I.jsx)(n,{size:12}):t.mimeType.startsWith(`text/`)?(0,I.jsx)(e,{size:12}):null,(0,I.jsx)(`span`,{children:t.filename})]},r))}),a.role===`visitor`&&(0,I.jsx)(`span`,{className:`message-timestamp`,children:g(a.timestamp)})]}),a.role===`maxy`&&a.components&&a.components.length>0&&(0,I.jsx)(`div`,{className:`public-components`,children:a.components.map((e,t)=>(0,I.jsx)(`div`,{className:`public-component-enter`,children:(0,I.jsx)(B,{name:e.name,data:e.data,onSubmit:e=>u(d,t,e),submitted:e.submitted})},t))})]},d)}),!i&&d.length>0&&(0,I.jsx)(`div`,{className:`chat-suggestions`,children:d.map(e=>(0,I.jsx)(y,{variant:`suggestion`,onClick:()=>f(e),children:e},e))}),(0,I.jsx)(`div`,{ref:S})]}),!p&&(0,I.jsx)(`button`,{className:`scroll-to-bottom`,onClick:()=>S.current?.scrollIntoView({behavior:`smooth`}),"aria-label":`Scroll to bottom`})]})}function H({selectedItems:e,messages:t,copySelected:n,exitSelection:r,showCopyToast:i}){let[a,o]=(0,T.useState)(!1),s=(0,T.useRef)(null),c=(0,T.useRef)(!1);function l(e){let n=e.lastIndexOf(`_`),r=e.slice(0,n),i=e.slice(n+1),a=parseInt(r,10);return t.find(e=>e.timestamp===a&&e.role===i)?.content??``}function u(e,t){return parseInt(e.slice(0,e.lastIndexOf(`_`)),10)-parseInt(t.slice(0,t.lastIndexOf(`_`)),10)}function d(){let e=[...t].sort((e,t)=>e.timestamp-t.timestamp),n=[];for(let t of e){if(t.hidden||!t.content)continue;let e=t.role===`visitor`?`Visitor`:`Maxy`;n.push(`${e}:\n${t.content}`)}return n.join(`
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
`)}T.useEffect(()=>{if(!a)return;let e=e=>{e.target.closest(`.selection-copy-wrap`)||o(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[a]);function f(){s.current!==null&&(clearTimeout(s.current),s.current=null)}return(0,I.jsx)(`div`,{className:`chat-input-area`,children:(0,I.jsxs)(`div`,{className:`selection-bar`,children:[(0,I.jsxs)(`span`,{className:`selection-count`,children:[e.size,` Selected`]}),(0,I.jsxs)(`div`,{className:`selection-copy-wrap`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`selection-copy`,onPointerDown:()=>{if(a){o(!1);return}c.current=!1,s.current=setTimeout(()=>{c.current=!0,o(!0),s.current=null},500)},onPointerUp:f,onPointerLeave:f,onPointerCancel:f,onClick:async()=>{c.current||await n(l,u)},children:[(0,I.jsx)(x,{size:18}),(0,I.jsx)(`span`,{children:`Copy`})]}),a&&(0,I.jsx)(`div`,{className:`copy-menu`,children:(0,I.jsx)(`button`,{type:`button`,className:`copy-menu-item`,onClick:async()=>{let e=d();e&&i(await b(e)),r()},children:`Copy all`})})]}),(0,I.jsx)(`button`,{type:`button`,className:`selection-cancel`,onClick:r,children:`Cancel`})]})})}function U({input:t,setInput:r,isStreaming:i,pendingFiles:a,setPendingFiles:o,attachError:s,setAttachError:c,isDragOver:l,setIsDragOver:u,inputRef:d,onSubmit:f}){let p=(0,T.useRef)(null);function h(e){c(null);let t=e.find(e=>!D.has(e.type));if(t){c(`Unsupported file type: "${t.type}". Supported: images, PDF, plain text, markdown, CSV.`);return}let n=e.find(e=>e.size>O);if(n){c(`"${n.name}" exceeds the 20 MB limit.`);return}o(t=>[...t,...e].slice(0,5))}function g(e){e.preventDefault(),u(!0)}function _(){u(!1)}function b(e){e.preventDefault(),u(!1),h([...e.dataTransfer.files])}return(0,I.jsxs)(`div`,{className:`chat-input-area`,children:[(0,I.jsx)(`input`,{ref:p,type:`file`,multiple:!0,accept:E,style:{display:`none`},onChange:e=>{e.target.files&&h([...e.target.files]),e.target.value=``}}),a.length>0&&(0,I.jsx)(`div`,{className:`attachment-strip`,children:a.map((t,r)=>(0,I.jsxs)(`div`,{className:`attachment-chip`,children:[t.type.startsWith(`image/`)?(0,I.jsx)(`img`,{src:URL.createObjectURL(t),alt:t.name,className:`attachment-chip-thumb`}):t.type===`application/pdf`?(0,I.jsx)(n,{size:14}):(0,I.jsx)(e,{size:14}),(0,I.jsx)(`span`,{className:`attachment-chip-name`,children:t.name}),(0,I.jsx)(`button`,{type:`button`,className:`attachment-chip-remove`,onClick:()=>o(e=>e.filter((e,t)=>t!==r)),"aria-label":`Remove ${t.name}`,children:`×`})]},r))}),s&&(0,I.jsx)(`p`,{className:`attach-error`,children:s}),(0,I.jsx)(m,{inputRef:d}),(0,I.jsxs)(`form`,{className:`chat-form${l?` drag-over`:``}`,onSubmit:f,onDragOver:g,onDragLeave:_,onDrop:b,onPaste:e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of t){if(e.kind!==`file`)continue;let t=e.getAsFile();if(!t)continue;let r=t.type.split(`/`)[1]?.replace(`jpeg`,`jpg`)||`png`;n.push(new File([t],`pasted-image-${Date.now()}.${r}`,{type:t.type}))}n.length>0&&h(n)},children:[(0,I.jsx)(y,{variant:`icon`,type:`button`,onClick:()=>p.current?.click(),disabled:i,"aria-label":`Attach file`,children:(0,I.jsx)(S,{size:14})}),(0,I.jsx)(v,{ref:d,value:t,onChange:r,placeholder:`Type a message...`}),(0,I.jsx)(y,{variant:`send`,type:`submit`,disabled:i||!t.trim()&&a.length===0,"aria-label":`Send message`,children:(0,I.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,I.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,I.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})})]})]})}var W=[];function G(){let[e,t]=(0,T.useState)(``),[n,r]=(0,T.useState)([]),[i,a]=(0,T.useState)(!1),[s,c]=(0,T.useState)(null),[u,d]=(0,T.useState)(W),[f,m]=(0,T.useState)(!0),g=(0,T.useRef)(null),{selectionMode:_,selectedItems:v,copyToast:y,exitSelection:b,enterSelection:x,toggleSelectItem:S,copySelected:w,showCopyToast:E}=C(),D=(0,T.useRef)(()=>{}),O=P((0,T.useCallback)(e=>{D.current(e)},[])),{sessionId:k,sessionKeyRef:A,sessionError:j,pageState:M,agentDisplayName:N,branding:L,ensureSession:z,resumedRef:B,resumeMessagesRef:G}=O,{messages:K,setMessages:q,isStreaming:J,sendMessage:Y,sendGreeting:X,handleComponentSubmit:Z}=F({sessionKeyRef:A,ensureSession:z,sessionError:j,pageState:M,inputRef:g});(0,T.useEffect)(()=>{D.current=X},[X]),(0,T.useEffect)(()=>{let e=!1;return(async()=>{let t=await z();if(!e&&t){if(B.current&&G.current&&G.current.length>0){q(G.current.map(e=>({role:e.role,content:e.content,timestamp:e.timestamp}))),G.current=null;return}X(t)}})(),()=>{e=!0}},[]),(0,T.useEffect)(()=>{M===`chat`&&g.current?.focus()},[M]),(0,T.useEffect)(()=>{if(!L)return;let e=document.documentElement;if(L.primaryColor&&(e.style.setProperty(`--sage`,L.primaryColor),e.style.setProperty(`--sage-hover`,L.primaryColor),e.style.setProperty(`--sage-subtle`,L.primaryColor+`14`),e.style.setProperty(`--sage-glow`,L.primaryColor+`26`)),L.accentColor&&e.style.setProperty(`--visitor-bubble`,L.accentColor),L.backgroundColor&&e.style.setProperty(`--bg`,L.backgroundColor),document.title=L.name,L.primaryColor){let e=document.querySelector(`meta[name="theme-color"]`);e||(e=document.createElement(`meta`),e.name=`theme-color`,document.head.appendChild(e)),e.content=L.primaryColor}if(L.faviconUrl){let e=document.querySelector(`link[rel="icon"]`);e||(e=document.createElement(`link`),e.rel=`icon`,document.head.appendChild(e)),e.href=L.faviconUrl}},[L]),(0,T.useEffect)(()=>{function e(e){e.key===`Escape`&&_&&b()}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_,b]);function Q(e){if(!e&&n.length===0||J)return;q(e=>e.map(e=>e.components?.some(e=>!e.submitted)?{...e,components:e.components.map(e=>e.submitted?e:{...e,submitted:!0})}:e)),d(t=>t.filter(t=>t!==e)),m(!0);let i=[...n];t(``),r([]),c(null),Y(e,{files:i})}function $(t){t.preventDefault(),Q(e.trim()),g.current?.resetHeight()}return(0,I.jsxs)(`div`,{className:`chat-page`,children:[(0,I.jsxs)(`header`,{className:`chat-header`,children:[(0,I.jsx)(`img`,{src:L?.logoUrl||l,alt:L?.name||h.productName,className:`chat-logo`,onError:e=>{e.target.src=l}}),(0,I.jsx)(`h1`,{className:`chat-tagline`,children:N||L?.name||h.productName}),(0,I.jsx)(`p`,{className:`chat-intro`,children:L?.tagline||``}),M===`chat`&&!_&&(0,I.jsx)(`button`,{className:`chat-header-select`,onClick:x,title:`Select messages`,"aria-label":`Select messages`,children:(0,I.jsx)(o,{size:16})})]}),M===`loading`&&(0,I.jsx)(`div`,{className:`gate-wrap`,children:(0,I.jsx)(`div`,{className:`gate-loading`,children:(0,I.jsx)(`span`,{className:`spinner`})})}),M===`auth-required`&&(0,I.jsx)(R,{gateState:O.gateState,setGateState:O.setGateState,grantInfo:O.grantInfo,setGrantInfo:O.setGrantInfo,gateSessionKeyRef:O.gateSessionKeyRef,resolvedSlugRef:O.resolvedSlugRef,onAuthenticated:O.enterChat}),M===`chat`&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(V,{messages:K,isStreaming:J,sessionError:j,selectionMode:_,selectedItems:v,toggleSelectItem:S,onComponentSubmit:Z,remainingSuggestions:u,onSuggestionClick:Q,isAtBottom:f,setIsAtBottom:m}),_?(0,I.jsx)(H,{selectedItems:v,messages:K,copySelected:w,exitSelection:b,showCopyToast:E}):(0,I.jsx)(U,{input:e,setInput:t,isStreaming:J,pendingFiles:n,setPendingFiles:r,attachError:s,setAttachError:c,isDragOver:i,setIsDragOver:a,inputRef:g,onSubmit:$})]}),y&&(0,I.jsx)(`span`,{className:`copy-toast${y===`failed`?` copy-toast-failed`:``}`,children:y===`copied`?`Copied`:`Copy failed`}),(0,I.jsxs)(`footer`,{className:`chat-footer`,children:[(0,I.jsxs)(`a`,{href:p,children:[h.domain,` `,`↗`]}),k&&(0,I.jsxs)(`span`,{style:{opacity:.35,fontSize:`10px`,fontFamily:`monospace`,marginLeft:`1rem`},children:[`Session · `,k.slice(0,8)]})]})]})}(0,w.createRoot)(document.getElementById(`root`)).render((0,I.jsx)(G,{}));
|
|
File without changes
|