@frontera-sdk/chat-ui 1.52.48 → 1.53.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
  import { ChevronLeftIcon } from './chunk-CWAOLMFS.js';
3
- import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from './chunk-T5SANYSX.js';
4
- import { useIsMobile, useTranslation } from './chunk-IY27XSPQ.js';
5
- import { ToolCallItem, ProcessorIcon } from './chunk-LAELBWN2.js';
6
- import { describeToolRow, toolKindLabel, getToolMeta, Shimmer, Collapse, ToolGroupReasoningItem, SkillToolItem, DeviceDesktopIcon, WorldSearchIcon, FileTextIcon, useStreamdownPlugins, CircleXIcon, STREAMDOWN_LINK_SAFETY, Folder1Icon, AppIconFrame, AppIcon, Collapsible, CollapsibleTrigger, CollapsibleContent, SquareArrowTopRightIcon, Icon } from './chunk-4GXQI4E4.js';
3
+ import { MagnifyingGlassIcon, Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from './chunk-FZ3VSITY.js';
4
+ import { useIsMobile, useTranslation } from './chunk-ZKB77W6J.js';
5
+ import { ToolCallItem, ProcessorIcon } from './chunk-M6GWBAO2.js';
6
+ import { describeToolRow, toolKindLabel, getToolMeta, Shimmer, Collapse, ToolGroupReasoningItem, SkillToolItem, DeviceDesktopIcon, WorldSearchIcon, FileTextIcon, useStreamdownPlugins, CircleXIcon, STREAMDOWN_LINK_SAFETY, Folder1Icon, AppIconFrame, AppIcon, Collapsible, CollapsibleTrigger, CollapsibleContent, SquareArrowTopRightIcon, Icon } from './chunk-ITMOMVIV.js';
7
7
  import { ChevronDownMediumIcon, Button, Skeleton, buttonVariants } from './chunk-UWKO24VT.js';
8
8
  import { Dialog, DialogContent, DialogTitle, DialogDescription, DialogClose, CrossMediumIcon, DialogHeader, DialogFooter } from './chunk-2P4IEVOQ.js';
9
9
  import { zipSync } from './chunk-CDTES65T.js';
@@ -7861,9 +7861,9 @@ var require_cronstrue_i18n = __commonJS({
7861
7861
  return values.shift();
7862
7862
  });
7863
7863
  };
7864
- StringUtilities2.containsAny = function(text2, searchStrings) {
7864
+ StringUtilities2.containsAny = function(text3, searchStrings) {
7865
7865
  return searchStrings.some(function(c2) {
7866
- return text2.indexOf(c2) > -1;
7866
+ return text3.indexOf(c2) > -1;
7867
7867
  });
7868
7868
  };
7869
7869
  return StringUtilities2;
@@ -10071,8 +10071,8 @@ function treatyErrorMessage(err, fallback = "Request failed") {
10071
10071
  const m = readableText(body.message) ?? readableText(body.error) ?? readableText(body.summary);
10072
10072
  if (m) return m;
10073
10073
  }
10074
- const text2 = readableText(value);
10075
- if (text2) return text2;
10074
+ const text3 = readableText(value);
10075
+ if (text3) return text3;
10076
10076
  }
10077
10077
  if (err && typeof err === "object" && "message" in err) {
10078
10078
  const m = readableText(err.message);
@@ -11353,8 +11353,8 @@ function computeMessageParts(parts) {
11353
11353
  flushSteps();
11354
11354
  result.push({ kind: "artifact", part, index });
11355
11355
  } else if (part.type === "text") {
11356
- const text2 = typeof part.text === "string" ? part.text : "";
11357
- if (!text2.trim()) return;
11356
+ const text3 = typeof part.text === "string" ? part.text : "";
11357
+ if (!text3.trim()) return;
11358
11358
  flushSteps();
11359
11359
  result.push({ kind: "text", part, index });
11360
11360
  } else {
@@ -12272,9 +12272,9 @@ function summarizeRoutineTrigger(routine, options = {}) {
12272
12272
  if (routine.triggerType === "event") {
12273
12273
  return { kind: "event", text: options.locale === "id" ? "Dijeda \xB7 Pemicu lama tidak tersedia" : "Paused \xB7 Legacy trigger unavailable", timezone: null };
12274
12274
  }
12275
- const text2 = routine.cronExpression ? describeCronInWords(routine.cronExpression, options.locale ?? "en") : "";
12275
+ const text3 = routine.cronExpression ? describeCronInWords(routine.cronExpression, options.locale ?? "en") : "";
12276
12276
  const timezone = routine.timezone && routine.timezone !== (options.viewerTimezone ?? routine.timezone) ? routine.timezone : null;
12277
- return { kind: "schedule", text: text2, timezone };
12277
+ return { kind: "schedule", text: text3, timezone };
12278
12278
  }
12279
12279
  function formatRunDuration(ms) {
12280
12280
  if (ms == null || ms < 0) return null;
@@ -13982,16 +13982,16 @@ function OAuthClientSetupCard({
13982
13982
  );
13983
13983
  }
13984
13984
  }
13985
- for (const field of inboundFields) {
13985
+ for (const field2 of inboundFields) {
13986
13986
  const { error } = await c2.v1.workspaces({ workspaceId }).secrets.post({
13987
- name: field.name,
13988
- value: (values[field.name] ?? "").trim(),
13987
+ name: field2.name,
13988
+ value: (values[field2.name] ?? "").trim(),
13989
13989
  type: "custom",
13990
- description: `${kind} ${field.label}`
13990
+ description: `${kind} ${field2.label}`
13991
13991
  });
13992
13992
  if (error) {
13993
13993
  throw new Error(
13994
- error?.value?.message ?? `Failed to save ${field.label}`
13994
+ error?.value?.message ?? `Failed to save ${field2.label}`
13995
13995
  );
13996
13996
  }
13997
13997
  }
@@ -14057,12 +14057,12 @@ function OAuthClientSetupCard({
14057
14057
  ]
14058
14058
  }
14059
14059
  ) : null,
14060
- /* @__PURE__ */ jsx("div", { className: "space-y-2 mb-3", children: requiredSecrets.map((field) => /* @__PURE__ */ jsxs("div", { children: [
14060
+ /* @__PURE__ */ jsx("div", { className: "space-y-2 mb-3", children: requiredSecrets.map((field2) => /* @__PURE__ */ jsxs("div", { children: [
14061
14061
  /* @__PURE__ */ jsxs("label", { className: "block text-xs text-muted-foreground mb-1", children: [
14062
- field.label,
14062
+ field2.label,
14063
14063
  /* @__PURE__ */ jsxs("span", { className: "ml-1 font-mono text-foreground/60", children: [
14064
14064
  "(",
14065
- field.name,
14065
+ field2.name,
14066
14066
  ")"
14067
14067
  ] })
14068
14068
  ] }),
@@ -14070,8 +14070,8 @@ function OAuthClientSetupCard({
14070
14070
  "input",
14071
14071
  {
14072
14072
  type: "password",
14073
- value: values[field.name] ?? "",
14074
- onChange: (e) => setValues((v) => ({ ...v, [field.name]: e.target.value })),
14073
+ value: values[field2.name] ?? "",
14074
+ onChange: (e) => setValues((v) => ({ ...v, [field2.name]: e.target.value })),
14075
14075
  disabled: status === "saving",
14076
14076
  autoComplete: "off",
14077
14077
  spellCheck: false,
@@ -14079,8 +14079,8 @@ function OAuthClientSetupCard({
14079
14079
  placeholder: "Paste value"
14080
14080
  }
14081
14081
  ),
14082
- field.hint ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: field.hint }) : null
14083
- ] }, field.name)) }),
14082
+ field2.hint ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: field2.hint }) : null
14083
+ ] }, field2.name)) }),
14084
14084
  status === "error" && errorMessage2 ? /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive mb-2", children: errorMessage2 }) : null,
14085
14085
  /* @__PURE__ */ jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ jsx(
14086
14086
  Button,
@@ -14306,28 +14306,28 @@ function InboundSecretsCard(props) {
14306
14306
  const isWebhookSetup = retryTool === "verify_install";
14307
14307
  const single = requiredSecrets.length === 1;
14308
14308
  const canSubmit = requiredSecrets.every((s2) => (values[s2.suffix] ?? "").trim().length > 0) && phase !== "saving" && phase !== "saved";
14309
- function vaultNameFor(field) {
14310
- return field.vaultKey ?? (inboundVaultPrefix ? `${inboundVaultPrefix}_${field.suffix}` : field.suffix);
14309
+ function vaultNameFor(field2) {
14310
+ return field2.vaultKey ?? (inboundVaultPrefix ? `${inboundVaultPrefix}_${field2.suffix}` : field2.suffix);
14311
14311
  }
14312
14312
  async function save(allowReplace) {
14313
14313
  setPhase("saving");
14314
14314
  setErrorMessage(null);
14315
14315
  try {
14316
- for (const field of requiredSecrets) {
14317
- const value = (values[field.suffix] ?? "").trim();
14318
- const name = vaultNameFor(field);
14316
+ for (const field2 of requiredSecrets) {
14317
+ const value = (values[field2.suffix] ?? "").trim();
14318
+ const name = vaultNameFor(field2);
14319
14319
  try {
14320
14320
  await createSecret.mutateAsync({
14321
14321
  name,
14322
14322
  value,
14323
14323
  type: "custom",
14324
- description: `${kind} ${field.label}`
14324
+ description: `${kind} ${field2.label}`
14325
14325
  });
14326
14326
  } catch (err) {
14327
14327
  const routeError = readRouteError(err);
14328
14328
  const exists = routeError.status === 409 || /already exists/i.test(routeError.message);
14329
14329
  if (!exists) {
14330
- throw new Error(routeError.message || `Failed to save ${field.label}`);
14330
+ throw new Error(routeError.message || `Failed to save ${field2.label}`);
14331
14331
  }
14332
14332
  if (!allowReplace) {
14333
14333
  setConflictName(name);
@@ -14338,7 +14338,7 @@ function InboundSecretsCard(props) {
14338
14338
  await updateSecret.mutateAsync({ name, value });
14339
14339
  } catch (replaceErr) {
14340
14340
  throw new Error(
14341
- readRouteError(replaceErr).message || `Failed to replace ${field.label}`
14341
+ readRouteError(replaceErr).message || `Failed to replace ${field2.label}`
14342
14342
  );
14343
14343
  }
14344
14344
  }
@@ -14444,23 +14444,23 @@ function InboundSecretsCard(props) {
14444
14444
  " ",
14445
14445
  "Values are encrypted at rest and never sent to the assistant."
14446
14446
  ] }),
14447
- /* @__PURE__ */ jsx("div", { className: "space-y-2 mb-3", children: requiredSecrets.map((field) => /* @__PURE__ */ jsxs("div", { children: [
14447
+ /* @__PURE__ */ jsx("div", { className: "space-y-2 mb-3", children: requiredSecrets.map((field2) => /* @__PURE__ */ jsxs("div", { children: [
14448
14448
  /* @__PURE__ */ jsx(
14449
14449
  "label",
14450
14450
  {
14451
- htmlFor: `secret-${installId}-${field.suffix}`,
14451
+ htmlFor: `secret-${installId}-${field2.suffix}`,
14452
14452
  className: "block text-sm text-muted-foreground mb-1",
14453
- children: field.label
14453
+ children: field2.label
14454
14454
  }
14455
14455
  ),
14456
14456
  /* @__PURE__ */ jsxs("div", { className: "relative", children: [
14457
14457
  /* @__PURE__ */ jsx(
14458
14458
  "input",
14459
14459
  {
14460
- id: `secret-${installId}-${field.suffix}`,
14461
- type: revealed[field.suffix] ? "text" : "password",
14462
- value: values[field.suffix] ?? "",
14463
- onChange: (e) => setValues((v) => ({ ...v, [field.suffix]: e.target.value })),
14460
+ id: `secret-${installId}-${field2.suffix}`,
14461
+ type: revealed[field2.suffix] ? "text" : "password",
14462
+ value: values[field2.suffix] ?? "",
14463
+ onChange: (e) => setValues((v) => ({ ...v, [field2.suffix]: e.target.value })),
14464
14464
  disabled: phase === "saving",
14465
14465
  autoComplete: "off",
14466
14466
  spellCheck: false,
@@ -14474,22 +14474,22 @@ function InboundSecretsCard(props) {
14474
14474
  type: "button",
14475
14475
  onClick: () => setRevealed((r) => ({
14476
14476
  ...r,
14477
- [field.suffix]: !r[field.suffix]
14477
+ [field2.suffix]: !r[field2.suffix]
14478
14478
  })),
14479
- "aria-label": revealed[field.suffix] ? `Hide ${field.label}` : `Show ${field.label}`,
14479
+ "aria-label": revealed[field2.suffix] ? `Hide ${field2.label}` : `Show ${field2.label}`,
14480
14480
  className: "absolute right-1 top-1/2 -translate-y-1/2 rounded p-1.5 text-muted-foreground hover:text-foreground",
14481
- children: revealed[field.suffix] ? /* @__PURE__ */ jsx(EyeSlashIcon, { className: "size-4", "aria-hidden": true }) : /* @__PURE__ */ jsx(EyeOpenIcon, { className: "size-4", "aria-hidden": true })
14481
+ children: revealed[field2.suffix] ? /* @__PURE__ */ jsx(EyeSlashIcon, { className: "size-4", "aria-hidden": true }) : /* @__PURE__ */ jsx(EyeOpenIcon, { className: "size-4", "aria-hidden": true })
14482
14482
  }
14483
14483
  )
14484
14484
  ] }),
14485
- field.hint ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: field.hint }) : null,
14486
- field.vaultKey ? /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground mt-1", children: [
14485
+ field2.hint ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: field2.hint }) : null,
14486
+ field2.vaultKey ? /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground mt-1", children: [
14487
14487
  "Saved to the workspace vault as",
14488
14488
  " ",
14489
- /* @__PURE__ */ jsx("span", { className: "font-mono text-foreground/70", children: field.vaultKey }),
14489
+ /* @__PURE__ */ jsx("span", { className: "font-mono text-foreground/70", children: field2.vaultKey }),
14490
14490
  "."
14491
14491
  ] }) : null
14492
- ] }, field.suffix)) }),
14492
+ ] }, field2.suffix)) }),
14493
14493
  phase === "error" && errorMessage2 ? /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive mb-2", children: errorMessage2 }) : null,
14494
14494
  phase === "conflict" && conflictName ? /* @__PURE__ */ jsxs("p", { className: "text-sm text-foreground mb-2", children: [
14495
14495
  "A credential named",
@@ -15779,10 +15779,10 @@ var STATUSES = /* @__PURE__ */ new Set([
15779
15779
  ]);
15780
15780
  function parseMaybeJson(value) {
15781
15781
  if (typeof value !== "string") return value;
15782
- const text2 = value.trim();
15783
- if (!text2.startsWith("{")) return value;
15782
+ const text3 = value.trim();
15783
+ if (!text3.startsWith("{")) return value;
15784
15784
  try {
15785
- return JSON.parse(text2);
15785
+ return JSON.parse(text3);
15786
15786
  } catch {
15787
15787
  return value;
15788
15788
  }
@@ -18306,6 +18306,198 @@ function SearchedKnowledgeToolItem({
18306
18306
  }) }) }) })
18307
18307
  ] });
18308
18308
  }
18309
+ function BlankPagePortraitIcon(props) {
18310
+ return /* @__PURE__ */ jsxs(
18311
+ "svg",
18312
+ {
18313
+ "aria-hidden": "true",
18314
+ role: "img",
18315
+ "aria-label": "blank-page-portrait",
18316
+ width: "24px",
18317
+ height: "24px",
18318
+ viewBox: "0 0 24 24",
18319
+ fill: "none",
18320
+ xmlns: "http://www.w3.org/2000/svg",
18321
+ ...props,
18322
+ children: [
18323
+ /* @__PURE__ */ jsx(
18324
+ "path",
18325
+ {
18326
+ d: "M4.75 18.25V5.75C4.75 4.09315 6.09315 2.75 7.75 2.75H16.25C17.9069 2.75 19.25 4.09315 19.25 5.75V15.5972V15.9643C19.25 16.7267 19.0019 17.4686 18.5429 18.0786C17.0405 20.075 14.6826 21.25 12.1786 21.25H8H7.75C6.09315 21.25 4.75 19.9069 4.75 18.25Z",
18327
+ stroke: "currentColor",
18328
+ strokeWidth: "1.5",
18329
+ strokeLinejoin: "round"
18330
+ }
18331
+ ),
18332
+ /* @__PURE__ */ jsx(
18333
+ "path",
18334
+ {
18335
+ d: "M19.25 15.5977C19.25 18.1671 15.6406 18.1671 14.0938 17.1393L12.9892 18.2401C11.0552 20.1676 10.735 21.2504 8 21.2504",
18336
+ stroke: "currentColor",
18337
+ strokeWidth: "1.5",
18338
+ strokeLinejoin: "round"
18339
+ }
18340
+ )
18341
+ ]
18342
+ }
18343
+ );
18344
+ }
18345
+ function CirclePersonIcon(props) {
18346
+ return /* @__PURE__ */ jsxs(
18347
+ "svg",
18348
+ {
18349
+ "aria-hidden": "true",
18350
+ role: "img",
18351
+ "aria-label": "circle-person, accessibility, a11y",
18352
+ width: "24px",
18353
+ height: "24px",
18354
+ viewBox: "0 0 24 24",
18355
+ fill: "none",
18356
+ xmlns: "http://www.w3.org/2000/svg",
18357
+ ...props,
18358
+ children: [
18359
+ /* @__PURE__ */ jsx(
18360
+ "path",
18361
+ {
18362
+ d: "M12 21.25C17.1086 21.25 21.25 17.1086 21.25 12C21.25 6.89137 17.1086 2.75 12 2.75C6.89137 2.75 2.75 6.89137 2.75 12C2.75 17.1086 6.89137 21.25 12 21.25Z",
18363
+ stroke: "currentColor",
18364
+ strokeWidth: "1.5",
18365
+ strokeLinecap: "round",
18366
+ strokeLinejoin: "round"
18367
+ }
18368
+ ),
18369
+ /* @__PURE__ */ jsx(
18370
+ "path",
18371
+ {
18372
+ d: "M14.2485 16.25C12.7476 14.7408 11.9999 13.2338 11.9985 11.25",
18373
+ stroke: "currentColor",
18374
+ strokeWidth: "1.5",
18375
+ strokeLinecap: "round",
18376
+ strokeLinejoin: "round"
18377
+ }
18378
+ ),
18379
+ /* @__PURE__ */ jsx(
18380
+ "path",
18381
+ {
18382
+ d: "M9.75 16.25C11.2894 14.758 11.9998 13.2338 11.9984 11.25",
18383
+ stroke: "currentColor",
18384
+ strokeWidth: "1.5",
18385
+ strokeLinecap: "round",
18386
+ strokeLinejoin: "round"
18387
+ }
18388
+ ),
18389
+ /* @__PURE__ */ jsx(
18390
+ "path",
18391
+ {
18392
+ d: "M8.75 10.6912C8.75 10.6912 10.7206 10.9559 11.9996 10.9559C13.2787 10.9559 15.25 10.6912 15.25 10.6912",
18393
+ stroke: "currentColor",
18394
+ strokeWidth: "1.5",
18395
+ strokeLinecap: "round",
18396
+ strokeLinejoin: "round"
18397
+ }
18398
+ ),
18399
+ /* @__PURE__ */ jsx(
18400
+ "path",
18401
+ {
18402
+ d: "M12.75 8C12.75 8.41421 12.4142 8.75 12 8.75C11.5858 8.75 11.25 8.41421 11.25 8C11.25 7.58579 11.5858 7.25 12 7.25C12.4142 7.25 12.75 7.58579 12.75 8Z",
18403
+ stroke: "currentColor",
18404
+ strokeWidth: "1.5",
18405
+ strokeLinecap: "round",
18406
+ strokeLinejoin: "round"
18407
+ }
18408
+ )
18409
+ ]
18410
+ }
18411
+ );
18412
+ }
18413
+
18414
+ // ../chat/src/ui/chat/knowledge-reading-label.ts
18415
+ var KNOWLEDGE_READING_TOOLS = /* @__PURE__ */ new Set([
18416
+ "findKnowledgeDocuments",
18417
+ "readKnowledgeDocument",
18418
+ "lookupKnowledgeEntity",
18419
+ "viewKnowledgePage"
18420
+ ]);
18421
+ function isKnowledgeReadingTool(name) {
18422
+ return KNOWLEDGE_READING_TOOLS.has(name);
18423
+ }
18424
+ function field(input, key) {
18425
+ return input && typeof input === "object" ? input[key] : void 0;
18426
+ }
18427
+ function text2(value) {
18428
+ if (typeof value === "string") return value.replace(/\s+/g, " ").trim();
18429
+ if (typeof value === "number" && Number.isFinite(value)) return String(value);
18430
+ if (Array.isArray(value)) return joinAnd(value.map(text2).filter(Boolean));
18431
+ return "";
18432
+ }
18433
+ function joinAnd(items) {
18434
+ if (items.length <= 1) return items[0] ?? "";
18435
+ return `${items.slice(0, -1).join(", ")} and ${items[items.length - 1]}`;
18436
+ }
18437
+ function pageRange(value) {
18438
+ if (Array.isArray(value) && value.length === 2 && value.every((v) => typeof v === "number")) {
18439
+ return value[0] === value[1] ? String(value[0]) : `${value[0]}\u2013${value[1]}`;
18440
+ }
18441
+ return text2(value).replace(/\s*-\s*/g, "\u2013");
18442
+ }
18443
+ function readPart(input) {
18444
+ if (field(input, "outline") === true) return "outline";
18445
+ const section = text2(field(input, "section"));
18446
+ if (section) return `section ${section}`;
18447
+ const pages = pageRange(field(input, "pages"));
18448
+ if (pages) return /[–,]|\band\b/.test(pages) ? `pages ${pages}` : `page ${pages}`;
18449
+ const table = text2(field(input, "table"));
18450
+ if (table) return `table ${table}`;
18451
+ return "";
18452
+ }
18453
+ function knowledgeStepHeader(tool, input, phase) {
18454
+ switch (tool) {
18455
+ case "findKnowledgeDocuments": {
18456
+ const query = text2(field(input, "query"));
18457
+ const verb = phase === "failed" ? "Could not look for documents" : phase === "running" ? "Looking for documents" : "Looked for documents";
18458
+ return query ? `${verb}: ${query}` : verb;
18459
+ }
18460
+ case "readKnowledgeDocument": {
18461
+ const part = readPart(input);
18462
+ const verb = phase === "failed" ? "Could not read the document" : phase === "running" ? "Reading a document" : "Read a document";
18463
+ return part ? `${verb}: ${part}` : verb;
18464
+ }
18465
+ case "lookupKnowledgeEntity": {
18466
+ const name = text2(field(input, "name"));
18467
+ const other = text2(field(input, "with"));
18468
+ const who = [name, other].filter(Boolean).join(" and ");
18469
+ const verb = phase === "failed" ? "Could not look up" : phase === "running" ? "Looking up" : "Looked up";
18470
+ return who ? `${verb} ${who}` : `${verb} a name`;
18471
+ }
18472
+ case "viewKnowledgePage": {
18473
+ const page = text2(field(input, "page"));
18474
+ const verb = phase === "failed" ? "Could not look at" : phase === "running" ? "Looking at" : "Looked at";
18475
+ return page ? `${verb} page ${page}` : `${verb} a page`;
18476
+ }
18477
+ }
18478
+ }
18479
+ var RUNNING_STATES4 = /* @__PURE__ */ new Set([
18480
+ "input-streaming",
18481
+ "partial-call",
18482
+ "input-available",
18483
+ "call"
18484
+ ]);
18485
+ var TIMELINE_ICON_BEAD3 = "flex w-4 h-7 shrink-0 items-center justify-center rounded-full bg-surface-chat";
18486
+ var ICONS = {
18487
+ findKnowledgeDocuments: MagnifyingGlassIcon,
18488
+ readKnowledgeDocument: FileTextIcon,
18489
+ lookupKnowledgeEntity: CirclePersonIcon,
18490
+ viewKnowledgePage: BlankPagePortraitIcon
18491
+ };
18492
+ function KnowledgeReadingToolItem({ toolName, state, input }) {
18493
+ const phase = state === "output-error" || state === "error" ? "failed" : RUNNING_STATES4.has(state) ? "running" : "done";
18494
+ const header = knowledgeStepHeader(toolName, input, phase);
18495
+ const StepIcon = ICONS[toolName];
18496
+ return /* @__PURE__ */ jsx("div", { className: "relative z-10 py-0.5", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full min-w-0 items-center gap-2 text-left text-sm text-muted-foreground", children: [
18497
+ /* @__PURE__ */ jsx("span", { className: TIMELINE_ICON_BEAD3, children: /* @__PURE__ */ jsx(StepIcon, { className: "size-4 opacity-90" }) }),
18498
+ phase === "running" ? /* @__PURE__ */ jsx(Shimmer, { as: "span", className: "min-w-0 truncate text-sm", children: `${header}\u2026` }) : /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", title: header, children: header })
18499
+ ] }) });
18500
+ }
18309
18501
  function parseDeck(content) {
18310
18502
  try {
18311
18503
  const d = JSON.parse(content || "{}");
@@ -18682,12 +18874,12 @@ function ImageGenPlaceholder({
18682
18874
  }
18683
18875
  var GENERATED_IMAGE_TOOLS = /* @__PURE__ */ new Set(["createImage", "createInfographic"]);
18684
18876
  var REDACTED_REASONING = "[REDACTED]";
18685
- function hasVisibleReasoningText(text2) {
18686
- if (typeof text2 !== "string") return false;
18877
+ function hasVisibleReasoningText(text3) {
18878
+ if (typeof text3 !== "string") return false;
18687
18879
  const nonWhitespace = /\S/g;
18688
18880
  let match;
18689
- while (match = nonWhitespace.exec(text2)) {
18690
- if (text2.startsWith(REDACTED_REASONING, match.index)) {
18881
+ while (match = nonWhitespace.exec(text3)) {
18882
+ if (text3.startsWith(REDACTED_REASONING, match.index)) {
18691
18883
  nonWhitespace.lastIndex = match.index + REDACTED_REASONING.length;
18692
18884
  continue;
18693
18885
  }
@@ -18695,10 +18887,10 @@ function hasVisibleReasoningText(text2) {
18695
18887
  }
18696
18888
  return false;
18697
18889
  }
18698
- function passagesByUrl(text2) {
18890
+ function passagesByUrl(text3) {
18699
18891
  const out = /* @__PURE__ */ new Map();
18700
- if (typeof text2 !== "string" || !text2) return out;
18701
- for (const section of text2.split(/\n\n---\n\n/)) {
18892
+ if (typeof text3 !== "string" || !text3) return out;
18893
+ for (const section of text3.split(/\n\n---\n\n/)) {
18702
18894
  const match = /^Source \[\d+\]\(([^)]+)\):[^\n]*\n([\s\S]*)$/.exec(section.trim());
18703
18895
  if (!match) continue;
18704
18896
  const [, url, body] = match;
@@ -18953,12 +19145,12 @@ var MessageStepsGroup = memo(function MessageStepsGroup2({
18953
19145
  ).length;
18954
19146
  const renderStepItem = (item) => {
18955
19147
  if (item.type === "reasoning") {
18956
- const text2 = item.part.text;
18957
- if (!hasVisibleReasoningText(text2)) return null;
19148
+ const text3 = item.part.text;
19149
+ if (!hasVisibleReasoningText(text3)) return null;
18958
19150
  return /* @__PURE__ */ jsx(
18959
19151
  ToolGroupReasoningItem,
18960
19152
  {
18961
- text: text2,
19153
+ text: text3,
18962
19154
  isStreaming: item.part.state === "streaming"
18963
19155
  },
18964
19156
  `${messageId}-r-${item.index}`
@@ -18967,12 +19159,12 @@ var MessageStepsGroup = memo(function MessageStepsGroup2({
18967
19159
  if (getToolName(item.part) === "think") {
18968
19160
  const thinkInput = getToolInput(item.part);
18969
19161
  const thinkOutput = getToolOutput(item.part);
18970
- const text2 = thinkInput?.thought ?? thinkOutput?.thought;
18971
- if (!hasVisibleReasoningText(text2)) return null;
19162
+ const text3 = thinkInput?.thought ?? thinkOutput?.thought;
19163
+ if (!hasVisibleReasoningText(text3)) return null;
18972
19164
  return /* @__PURE__ */ jsx(
18973
19165
  ToolGroupReasoningItem,
18974
19166
  {
18975
- text: text2,
19167
+ text: text3,
18976
19168
  isStreaming: getToolState(item.part) === "input-streaming"
18977
19169
  },
18978
19170
  `${messageId}-r-${item.index}`
@@ -19014,6 +19206,18 @@ var MessageStepsGroup = memo(function MessageStepsGroup2({
19014
19206
  `${messageId}-kb-${item.index}`
19015
19207
  );
19016
19208
  }
19209
+ const knowledgeTool = getToolName(item.part);
19210
+ if (isKnowledgeReadingTool(knowledgeTool)) {
19211
+ return /* @__PURE__ */ jsx(
19212
+ KnowledgeReadingToolItem,
19213
+ {
19214
+ toolName: knowledgeTool,
19215
+ state: getToolState(item.part),
19216
+ input: getToolInput(item.part)
19217
+ },
19218
+ `${messageId}-kbr-${item.index}`
19219
+ );
19220
+ }
19017
19221
  if (isDelegationTool(getToolName(item.part))) {
19018
19222
  const input = getToolInput(item.part);
19019
19223
  const output = getToolOutput(item.part);
@@ -20065,7 +20269,7 @@ function walkSlide(doc, win = window) {
20065
20269
  const hasBg = solidBg || !!grad && grad.alpha > 0.02;
20066
20270
  const bw = parseFloat(s2.borderWidth) || 0;
20067
20271
  const fullBorder = bw >= 1 && !TRANSPARENT(s2.borderColor);
20068
- const text2 = (el.textContent || "").replace(/\s+/g, " ").trim();
20272
+ const text3 = (el.textContent || "").replace(/\s+/g, " ").trim();
20069
20273
  if (hasBg || fullBorder) {
20070
20274
  out.elements.push({
20071
20275
  type: "shape",
@@ -20089,7 +20293,7 @@ function walkSlide(doc, win = window) {
20089
20293
  out.elements.push({ type: "shape", shape: "rect", ...bar, fill: rgbToHex(col), opacity: 1 });
20090
20294
  }
20091
20295
  }
20092
- if (text2 && !hasBlockTextChild(el)) {
20296
+ if (text3 && !hasBlockTextChild(el)) {
20093
20297
  Array.from(el.children).forEach((c2) => {
20094
20298
  if (!(c2.textContent || "").trim()) visit(c2);
20095
20299
  });
@@ -20111,7 +20315,7 @@ function walkSlide(doc, win = window) {
20111
20315
  tx = tr.x;
20112
20316
  }
20113
20317
  const isHeading = fs >= 40;
20114
- const nowrap = singleLine || !/\s/.test(text2) || isHeading;
20318
+ const nowrap = singleLine || !/\s/.test(text3) || isHeading;
20115
20319
  if (nowrap) {
20116
20320
  const pad2 = Math.round(fs * 0.7 + (tr ? tr.w : tw) * 0.18);
20117
20321
  if (align === "center") {
@@ -33143,7 +33347,7 @@ function threshold() {
33143
33347
  // ../../node_modules/d3-time/src/interval.js
33144
33348
  var t0 = /* @__PURE__ */ new Date();
33145
33349
  var t1 = /* @__PURE__ */ new Date();
33146
- function timeInterval(floori, offseti, count, field) {
33350
+ function timeInterval(floori, offseti, count, field2) {
33147
33351
  function interval(date2) {
33148
33352
  return floori(date2 = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+date2)), date2;
33149
33353
  }
@@ -33195,7 +33399,7 @@ function timeInterval(floori, offseti, count, field) {
33195
33399
  };
33196
33400
  interval.every = (step) => {
33197
33401
  step = Math.floor(step);
33198
- return !isFinite(step) || !(step > 0) ? null : !(step > 1) ? interval : interval.filter(field ? (d) => field(d) % step === 0 : (d) => interval.count(0, d) % step === 0);
33402
+ return !isFinite(step) || !(step > 0) ? null : !(step > 1) ? interval : interval.filter(field2 ? (d) => field2(d) % step === 0 : (d) => interval.count(0, d) % step === 0);
33199
33403
  };
33200
33404
  }
33201
33405
  return interval;
@@ -37555,16 +37759,16 @@ var SPAN_STYLE = {
37555
37759
  whiteSpace: "pre"
37556
37760
  };
37557
37761
  var MEASUREMENT_SPAN_ID = "recharts_measurement_span";
37558
- function createCacheKey(text2, style) {
37762
+ function createCacheKey(text3, style) {
37559
37763
  var fontSize = style.fontSize || "";
37560
37764
  var fontFamily = style.fontFamily || "";
37561
37765
  var fontWeight = style.fontWeight || "";
37562
37766
  var fontStyle = style.fontStyle || "";
37563
37767
  var letterSpacing = style.letterSpacing || "";
37564
37768
  var textTransform = style.textTransform || "";
37565
- return "".concat(text2, "|").concat(fontSize, "|").concat(fontFamily, "|").concat(fontWeight, "|").concat(fontStyle, "|").concat(letterSpacing, "|").concat(textTransform);
37769
+ return "".concat(text3, "|").concat(fontSize, "|").concat(fontFamily, "|").concat(fontWeight, "|").concat(fontStyle, "|").concat(letterSpacing, "|").concat(textTransform);
37566
37770
  }
37567
- var measureTextWithDOM = (text2, style) => {
37771
+ var measureTextWithDOM = (text3, style) => {
37568
37772
  try {
37569
37773
  var measurementSpan = document.getElementById(MEASUREMENT_SPAN_ID);
37570
37774
  if (!measurementSpan) {
@@ -37574,7 +37778,7 @@ var measureTextWithDOM = (text2, style) => {
37574
37778
  document.body.appendChild(measurementSpan);
37575
37779
  }
37576
37780
  Object.assign(measurementSpan.style, SPAN_STYLE, style);
37577
- measurementSpan.textContent = "".concat(text2);
37781
+ measurementSpan.textContent = "".concat(text3);
37578
37782
  var rect = measurementSpan.getBoundingClientRect();
37579
37783
  return {
37580
37784
  width: rect.width,
@@ -37587,23 +37791,23 @@ var measureTextWithDOM = (text2, style) => {
37587
37791
  };
37588
37792
  }
37589
37793
  };
37590
- var getStringSize = function getStringSize2(text2) {
37794
+ var getStringSize = function getStringSize2(text3) {
37591
37795
  var style = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
37592
- if (text2 === void 0 || text2 === null || Global.isSsr) {
37796
+ if (text3 === void 0 || text3 === null || Global.isSsr) {
37593
37797
  return {
37594
37798
  width: 0,
37595
37799
  height: 0
37596
37800
  };
37597
37801
  }
37598
37802
  if (!currentConfig.enableCache) {
37599
- return measureTextWithDOM(text2, style);
37803
+ return measureTextWithDOM(text3, style);
37600
37804
  }
37601
- var cacheKey = createCacheKey(text2, style);
37805
+ var cacheKey = createCacheKey(text3, style);
37602
37806
  var cachedResult = stringCache.get(cacheKey);
37603
37807
  if (cachedResult) {
37604
37808
  return cachedResult;
37605
37809
  }
37606
- var result = measureTextWithDOM(text2, style);
37810
+ var result = measureTextWithDOM(text3, style);
37607
37811
  stringCache.set(cacheKey, result);
37608
37812
  return result;
37609
37813
  };
@@ -37929,8 +38133,8 @@ var calculate = (words, lineWidth, spaceWidth, scaleToFit) => words.reduce((resu
37929
38133
  }, []);
37930
38134
  var findLongestLine = (words) => words.reduce((a2, b) => a2.width > b.width ? a2 : b);
37931
38135
  var suffix = "\u2026";
37932
- var checkOverflow = (text2, index, breakAll, style, maxLines, lineWidth, spaceWidth, scaleToFit) => {
37933
- var tempText = text2.slice(0, index);
38136
+ var checkOverflow = (text3, index, breakAll, style, maxLines, lineWidth, spaceWidth, scaleToFit) => {
38137
+ var tempText = text3.slice(0, index);
37934
38138
  var words = calculateWordWidths({
37935
38139
  breakAll,
37936
38140
  style,
@@ -37946,7 +38150,7 @@ var checkOverflow = (text2, index, breakAll, style, maxLines, lineWidth, spaceWi
37946
38150
  var calculateWordsByLines = (_ref3, initialWordsWithComputedWith, spaceWidth, lineWidth, scaleToFit) => {
37947
38151
  var maxLines = _ref3.maxLines, children = _ref3.children, style = _ref3.style, breakAll = _ref3.breakAll;
37948
38152
  var shouldLimitLines = isNumber(maxLines);
37949
- var text2 = String(children);
38153
+ var text3 = String(children);
37950
38154
  var originalResult = calculate(initialWordsWithComputedWith, lineWidth, spaceWidth, scaleToFit);
37951
38155
  if (!shouldLimitLines || scaleToFit) {
37952
38156
  return originalResult;
@@ -37956,14 +38160,14 @@ var calculateWordsByLines = (_ref3, initialWordsWithComputedWith, spaceWidth, li
37956
38160
  return originalResult;
37957
38161
  }
37958
38162
  var start = 0;
37959
- var end = text2.length - 1;
38163
+ var end = text3.length - 1;
37960
38164
  var iterations = 0;
37961
38165
  var trimmedResult;
37962
- while (start <= end && iterations <= text2.length - 1) {
38166
+ while (start <= end && iterations <= text3.length - 1) {
37963
38167
  var middle = Math.floor((start + end) / 2);
37964
38168
  var prev = middle - 1;
37965
- var _checkOverflow = checkOverflow(text2, prev, breakAll, style, maxLines, lineWidth, spaceWidth, scaleToFit), _checkOverflow2 = _slicedToArray14(_checkOverflow, 2), doesPrevOverflow = _checkOverflow2[0], result = _checkOverflow2[1];
37966
- var _checkOverflow3 = checkOverflow(text2, middle, breakAll, style, maxLines, lineWidth, spaceWidth, scaleToFit), _checkOverflow4 = _slicedToArray14(_checkOverflow3, 1), doesMiddleOverflow = _checkOverflow4[0];
38169
+ var _checkOverflow = checkOverflow(text3, prev, breakAll, style, maxLines, lineWidth, spaceWidth, scaleToFit), _checkOverflow2 = _slicedToArray14(_checkOverflow, 2), doesPrevOverflow = _checkOverflow2[0], result = _checkOverflow2[1];
38170
+ var _checkOverflow3 = checkOverflow(text3, middle, breakAll, style, maxLines, lineWidth, spaceWidth, scaleToFit), _checkOverflow4 = _slicedToArray14(_checkOverflow3, 1), doesMiddleOverflow = _checkOverflow4[0];
37967
38171
  if (!doesPrevOverflow && !doesMiddleOverflow) {
37968
38172
  start = middle + 1;
37969
38173
  }
@@ -49777,8 +49981,8 @@ function encodingOf(spec) {
49777
49981
  function seriesField(spec) {
49778
49982
  const enc = encodingOf(spec);
49779
49983
  const color2 = enc && isObj2(enc.color) ? enc.color : null;
49780
- const field = color2?.field;
49781
- return typeof field === "string" ? field : null;
49984
+ const field2 = color2?.field;
49985
+ return typeof field2 === "string" ? field2 : null;
49782
49986
  }
49783
49987
  function inlineValues(spec) {
49784
49988
  const data = isObj2(spec.data) ? spec.data : null;
@@ -49788,12 +49992,12 @@ function inlineValues(spec) {
49788
49992
  function categoryCount(spec) {
49789
49993
  const enc = encodingOf(spec);
49790
49994
  const x2 = enc && isObj2(enc.x) ? enc.x : null;
49791
- const field = typeof x2?.field === "string" ? x2.field : null;
49995
+ const field2 = typeof x2?.field === "string" ? x2.field : null;
49792
49996
  const type = typeof x2?.type === "string" ? x2.type : null;
49793
- if (!field || type === "quantitative" || type === "temporal") return 0;
49997
+ if (!field2 || type === "quantitative" || type === "temporal") return 0;
49794
49998
  const seen = /* @__PURE__ */ new Set();
49795
49999
  for (const row of inlineValues(spec)) {
49796
- const v = row[field];
50000
+ const v = row[field2];
49797
50001
  if (v != null) seen.add(String(v));
49798
50002
  }
49799
50003
  return seen.size;
@@ -49911,17 +50115,17 @@ function summarize(spec) {
49911
50115
  };
49912
50116
  }
49913
50117
  var DIMMED_OPACITY = 0.18;
49914
- function channelType(enc, field) {
50118
+ function channelType(enc, field2) {
49915
50119
  for (const def of Object.values(enc)) {
49916
- if (isObj2(def) && def.field === field && typeof def.type === "string") {
50120
+ if (isObj2(def) && def.field === field2 && typeof def.type === "string") {
49917
50121
  return def.type;
49918
50122
  }
49919
50123
  }
49920
50124
  return null;
49921
50125
  }
49922
- function selectionTest(enc, field, value) {
49923
- const ref = `datum[${JSON.stringify(field)}]`;
49924
- if (channelType(enc, field) === "temporal") {
50126
+ function selectionTest(enc, field2, value) {
50127
+ const ref = `datum[${JSON.stringify(field2)}]`;
50128
+ if (channelType(enc, field2) === "temporal") {
49925
50129
  const ms = Date.parse(value);
49926
50130
  if (!Number.isNaN(ms)) return `time(${ref}) === ${ms}`;
49927
50131
  }
@@ -49935,7 +50139,7 @@ function markType(target) {
49935
50139
  }
49936
50140
  var BACKDROP_OPACITY = 0.28;
49937
50141
  var SPANNING_MARKS = /* @__PURE__ */ new Set(["line", "area", "trail"]);
49938
- function withOpacity(target, field, value) {
50142
+ function withOpacity(target, field2, value) {
49939
50143
  const enc = isObj2(target.encoding) ? target.encoding : null;
49940
50144
  if (!enc) return target;
49941
50145
  if (Array.isArray(target.params) && target.params.length > 0) return target;
@@ -49943,21 +50147,21 @@ function withOpacity(target, field, value) {
49943
50147
  const condition = existing && isObj2(existing.condition) ? existing.condition : null;
49944
50148
  if (condition && typeof condition.param === "string") return target;
49945
50149
  const opacity = SPANNING_MARKS.has(markType(target) ?? "") ? { value: BACKDROP_OPACITY } : {
49946
- condition: { test: selectionTest(enc, field, value), value: 1 },
50150
+ condition: { test: selectionTest(enc, field2, value), value: 1 },
49947
50151
  value: DIMMED_OPACITY
49948
50152
  };
49949
50153
  return { ...target, encoding: { ...enc, opacity } };
49950
50154
  }
49951
- function highlightSelection(spec, field, value) {
50155
+ function highlightSelection(spec, field2, value) {
49952
50156
  if (Array.isArray(spec.layer)) {
49953
50157
  return {
49954
50158
  ...spec,
49955
50159
  layer: spec.layer.map(
49956
- (l) => isObj2(l) ? withOpacity(l, field, value) : l
50160
+ (l) => isObj2(l) ? withOpacity(l, field2, value) : l
49957
50161
  )
49958
50162
  };
49959
50163
  }
49960
- return withOpacity(spec, field, value);
50164
+ return withOpacity(spec, field2, value);
49961
50165
  }
49962
50166
  function adaptSpecForMobile(spec, landscape = false, cardChrome = false) {
49963
50167
  const categories = categoryCount(spec);
@@ -50073,18 +50277,18 @@ function keyCandidates(v) {
50073
50277
  var datumMatches = (value, key) => keyCandidates(value).includes(key);
50074
50278
  function keyForDatum(datum, summary) {
50075
50279
  if (summary.kind === "composition") {
50076
- const field2 = summary.seriesField;
50077
- if (field2 && datum[field2] != null) {
50078
- const hit = summary.series.find((name) => datumMatches(datum[field2], name));
50280
+ const field3 = summary.seriesField;
50281
+ if (field3 && datum[field3] != null) {
50282
+ const hit = summary.series.find((name) => datumMatches(datum[field3], name));
50079
50283
  if (hit) return hit;
50080
50284
  }
50081
50285
  return summary.series.find(
50082
50286
  (name) => Object.values(datum).some((v) => datumMatches(v, name))
50083
50287
  );
50084
50288
  }
50085
- const field = summary.bucketField;
50086
- if (field && datum[field] != null) {
50087
- const hit = summary.buckets.find((b) => datumMatches(datum[field], b.key));
50289
+ const field2 = summary.bucketField;
50290
+ if (field2 && datum[field2] != null) {
50291
+ const hit = summary.buckets.find((b) => datumMatches(datum[field2], b.key));
50088
50292
  if (hit) return hit.key;
50089
50293
  }
50090
50294
  return summary.buckets.find(
@@ -50715,10 +50919,10 @@ function applyFoldTransforms(values, transforms) {
50715
50919
  const foldFields = t.fold;
50716
50920
  const [keyAs, valueAs] = Array.isArray(t.as) ? t.as : ["key", "value"];
50717
50921
  rows = rows.flatMap((row) => {
50718
- return foldFields.map((field) => {
50922
+ return foldFields.map((field2) => {
50719
50923
  const { ...rest } = row;
50720
50924
  for (const f of foldFields) delete rest[f];
50721
- return { ...rest, [keyAs]: field, [valueAs]: row[field] };
50925
+ return { ...rest, [keyAs]: field2, [valueAs]: row[field2] };
50722
50926
  });
50723
50927
  });
50724
50928
  }
@@ -51021,14 +51225,14 @@ function sanitizeSpec(spec) {
51021
51225
  continue;
51022
51226
  }
51023
51227
  const e = { ...enc };
51024
- const field = e.field;
51025
- if (field && keys.has(field)) {
51026
- const sampleValue = sampleRow[field];
51228
+ const field2 = e.field;
51229
+ if (field2 && keys.has(field2)) {
51230
+ const sampleValue = sampleRow[field2];
51027
51231
  if (sampleValue !== void 0 && typeof sampleValue === "string" && e.type === "quantitative") {
51028
51232
  e.type = "nominal";
51029
51233
  }
51030
- } else if (field && !keys.has(field)) {
51031
- const match = findClosestField(field, keys, sampleRow, e.type);
51234
+ } else if (field2 && !keys.has(field2)) {
51235
+ const match = findClosestField(field2, keys, sampleRow, e.type);
51032
51236
  if (match) {
51033
51237
  e.field = match;
51034
51238
  const matchedValue = sampleRow[match];
@@ -51104,10 +51308,10 @@ function sanitizeSpec(spec) {
51104
51308
  if (ch === "x") {
51105
51309
  if (!updated.timeUnit) updated.timeUnit = "yearmonth";
51106
51310
  updated.scale = { ...updated.scale ?? {}, nice: false };
51107
- const field = updated.field;
51108
- if (field && values && updated.timeUnit === "yearmonth") {
51311
+ const field2 = updated.field;
51312
+ if (field2 && values && updated.timeUnit === "yearmonth") {
51109
51313
  const midpoints = Array.from(
51110
- new Set(values.map((r) => r[field]).filter((v) => v != null))
51314
+ new Set(values.map((r) => r[field2]).filter((v) => v != null))
51111
51315
  ).map((v) => {
51112
51316
  const d = new Date(String(v));
51113
51317
  if (isNaN(d.getTime())) return v;
@@ -51915,8 +52119,8 @@ function VegaChartBlockInner({
51915
52119
  const title = useMemo(() => parsed ? chartTitle(parsed) : null, [parsed]);
51916
52120
  const highlight = useMemo(() => {
51917
52121
  if (!selected || !summary) return null;
51918
- const field = summary.kind === "composition" ? summary.seriesField : summary.bucketField;
51919
- return field ? { field, value: selected } : null;
52122
+ const field2 = summary.kind === "composition" ? summary.seriesField : summary.bucketField;
52123
+ return field2 ? { field: field2, value: selected } : null;
51920
52124
  }, [selected, summary]);
51921
52125
  useEffect(() => setSelected(null), [parsed]);
51922
52126
  const useCard = isMobile && !!summary;