@arcgis/ai-components 5.2.0-next.77 → 5.2.0-next.78

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.
Files changed (73) hide show
  1. package/dist/cdn/3LILAJUD.js +2 -0
  2. package/dist/cdn/{TYZ3FRGW.js → 3ORURUNE.js} +6 -6
  3. package/dist/cdn/4F7Y4RNW.js +2 -0
  4. package/dist/cdn/{B6CJG5UH.js → 6U4GTCLJ.js} +14 -14
  5. package/dist/cdn/ADJ63EDN.js +3 -0
  6. package/dist/cdn/ATFNWFKG.js +2 -0
  7. package/dist/cdn/{FZ4CURWW.js → BGD2CCRJ.js} +1 -1
  8. package/dist/cdn/{2SQKAJ73.js → BS3HNSXX.js} +1 -1
  9. package/dist/cdn/CZLLPKMS.js +2 -0
  10. package/dist/cdn/EBNVLMUU.js +2 -0
  11. package/dist/cdn/{GPZJANRQ.js → ERNYKCUJ.js} +1 -1
  12. package/dist/cdn/G5XE5D36.js +2 -0
  13. package/dist/cdn/{UB6PAQZ7.js → GAPKW32H.js} +1 -1
  14. package/dist/cdn/{U3XIDLHO.js → HPU6K67Y.js} +1 -1
  15. package/dist/cdn/{DOXBIASP.js → I7KCB7KE.js} +1 -1
  16. package/dist/cdn/{JSMNXHYG.js → IIIUSDQR.js} +1 -1
  17. package/dist/cdn/{EZYONVBU.js → J7OJABFU.js} +1 -1
  18. package/dist/cdn/LXQFE5PJ.js +2 -0
  19. package/dist/cdn/NLEBWLVV.js +2 -0
  20. package/dist/cdn/ORRMONGJ.js +2 -0
  21. package/dist/cdn/{GOKLRL6M.js → PBMQI4MV.js} +1 -1
  22. package/dist/cdn/{GZGDLURS.js → PKJY7FBV.js} +1 -1
  23. package/dist/cdn/QUMNJVKX.js +2 -0
  24. package/dist/cdn/{DUSILSNJ.js → XHGVCL22.js} +3 -3
  25. package/dist/cdn/XLHTQ7CF.js +2 -0
  26. package/dist/cdn/{H6IJRTHM.js → YWULKUQV.js} +1 -1
  27. package/dist/cdn/{RCFAXADI.js → YYSRYOHL.js} +1 -1
  28. package/dist/cdn/ZWBFTKHF.js +2 -0
  29. package/dist/cdn/agent-utils/index.js +1 -1
  30. package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
  31. package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
  32. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
  33. package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
  34. package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
  35. package/dist/cdn/index.js +1 -1
  36. package/dist/chunks/adapter.js +52 -55
  37. package/dist/chunks/converterUtils.js +66 -48
  38. package/dist/components/arcgis-assistant/customElement.d.ts +30 -1
  39. package/dist/components/arcgis-assistant/customElement.js +133 -135
  40. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
  41. package/dist/components/arcgis-assistant-interrupt/customElement.js +10 -11
  42. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +12 -8
  43. package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
  44. package/dist/components/arcgis-assistant-message/customElement.js +9 -8
  45. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +3 -0
  46. package/dist/components/arcgis-assistant-message-loading/customElement.js +11 -10
  47. package/dist/components/arcgis-assistant-message-text/customElement.js +4 -4
  48. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
  49. package/dist/components/arcgis-assistant-user-message/customElement.js +13 -10
  50. package/dist/docs/api.json +1 -1
  51. package/dist/docs/docs.json +1 -1
  52. package/dist/docs/vscode.html-custom-data.json +1 -1
  53. package/dist/docs/web-types.json +1 -1
  54. package/dist/loader.js +4 -4
  55. package/dist/types/lumina.d.ts +2 -2
  56. package/dist/types/preact.d.ts +2 -2
  57. package/dist/types/react.d.ts +2 -2
  58. package/dist/types/stencil.d.ts +2 -2
  59. package/package.json +5 -5
  60. package/dist/cdn/2GH3K5JP.js +0 -2
  61. package/dist/cdn/2Y4DTOGT.js +0 -2
  62. package/dist/cdn/3S5G5SIX.js +0 -2
  63. package/dist/cdn/5TI2F5XX.js +0 -2
  64. package/dist/cdn/DCSZPL7R.js +0 -2
  65. package/dist/cdn/FSGIG7UN.js +0 -2
  66. package/dist/cdn/GLBE7OW2.js +0 -2
  67. package/dist/cdn/KKLAQF3Z.js +0 -2
  68. package/dist/cdn/KLYNL2ZT.js +0 -2
  69. package/dist/cdn/LZP3OBKS.js +0 -3
  70. package/dist/cdn/OKMZQXBQ.js +0 -2
  71. package/dist/cdn/T4ECSHM7.js +0 -2
  72. package/dist/cdn/WSHWQDO2.js +0 -2
  73. package/dist/cdn/XRE5USHA.js +0 -2
@@ -37,8 +37,8 @@ import { ToolNode as ze } from "@langchain/langgraph/prebuilt";
37
37
  import { clearFiltersTool as ke } from "../agents/tools/filter/clearFilters/adapter.js";
38
38
  import { resetMapTool as Ae } from "../agents/tools/filter/resetMap/adapter.js";
39
39
  import { setFeatureEffectTool as qe } from "../agents/tools/filter/setFeatureEffect/adapter.js";
40
- import { getAttributeTool as Me } from "../agents/tools/query/getAttribute/adapter.js";
41
- import { getStatisticsTool as Ne } from "../agents/tools/query/getStatistics/adapter.js";
40
+ import { getAttributeTool as Ne } from "../agents/tools/query/getAttribute/adapter.js";
41
+ import { getStatisticsTool as Me } from "../agents/tools/query/getStatistics/adapter.js";
42
42
  import { getTopFeaturesTool as De } from "../agents/tools/query/getTopFeatures/adapter.js";
43
43
  import { queryFeaturesTool as Le } from "../agents/tools/query/queryFeatures/adapter.js";
44
44
  import Ge from "@arcgis/core/WebLinkChart.js";
@@ -779,7 +779,7 @@ async function qr({
779
779
  return `Error applying size-age renderer: ${p instanceof Error ? p.message : String(p)}`;
780
780
  }
781
781
  }
782
- async function Mr({
782
+ async function Nr({
783
783
  layerId: e,
784
784
  fields: t,
785
785
  colorSchemes: r,
@@ -795,19 +795,19 @@ async function Mr({
795
795
  theme: a
796
796
  });
797
797
  }
798
- const Nr = c.object({
798
+ const Mr = c.object({
799
799
  layerId: c.string().describe("The id of the layer to apply the size-age renderer to"),
800
800
  fields: c.array(c.string()).describe("The field(s) to use for the size-age renderer (temporal data with size)"),
801
801
  colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
802
802
  theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the size ramp")
803
- }), qa = g(Mr, {
803
+ }), qa = g(Nr, {
804
804
  name: "size-age",
805
805
  description: `Label: Age (size)
806
806
  Description: Vary symbol sizes along a continuous ramp to represent the age of features. Age reflects the length of time from a start date to an end date.
807
807
  Keywords: since, age, how old, how long
808
808
  Example: Change the size of features so older features are larger than new features.
809
809
  Fields: This style requires at least one field with a date type.`,
810
- schema: Nr
810
+ schema: Mr
811
811
  });
812
812
  function Dr(e) {
813
813
  const { fields: t, layer: r, view: a } = e;
@@ -873,7 +873,7 @@ const Fr = c.object({
873
873
  fields: c.array(c.string()).describe("The field(s) to use for the size renderer (numeric data)"),
874
874
  colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
875
875
  theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the size ramp")
876
- }), Ma = g(jr, {
876
+ }), Na = g(jr, {
877
877
  name: "size",
878
878
  description: `Label: Counts and Amounts (size)
879
879
  Description: Vary symbol sizes along a continuous ramp to represent numeric or ranked data.
@@ -955,7 +955,7 @@ const Kr = c.object({
955
955
  fields: c.array(c.string()).describe("The field(s) to use for the type renderer (categorical data)"),
956
956
  colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
957
957
  theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color scheme")
958
- }), Na = g(Or, {
958
+ }), Ma = g(Or, {
959
959
  name: "type",
960
960
  description: `Label: Types (unique symbols)
961
961
  Description: Represent features as categories with different symbol colors or shapes. Examples include type of tree, road class, or province name.
@@ -979,7 +979,7 @@ Fields: This style requires a single field which may be a string, number, or dat
979
979
  reducer: ee,
980
980
  default: () => []
981
981
  })
982
- }), Vr = [Me, Ne, De, Le], Ga = [qe, Ae, ke], Wr = new ze(Vr, { handleToolErrors: !1 });
982
+ }), Vr = [Ne, Me, De, Le], Ga = [qe, Ae, ke], Wr = new ze(Vr, { handleToolErrors: !1 });
983
983
  async function ja(e, t) {
984
984
  const { messages: r } = await Wr.invoke({ messages: e.dataExplorationMessages }, t), a = [], o = [];
985
985
  for (const i of r) {
@@ -1046,10 +1046,10 @@ function W(e) {
1046
1046
  throw new Error("The Knowledge Agent currently only supports maps with exactly one Knowledge Graph Layer.");
1047
1047
  }
1048
1048
  function x(e) {
1049
- return !!e?.map && !("activeLinkChartLayer" in e.map);
1049
+ return !!e?.map && "activeLinkChartLayer" in e.map;
1050
1050
  }
1051
1051
  async function j(e) {
1052
- !e || x(e) || !e.map?.diagramNodesExtent || await e.goTo(e.map.diagramNodesExtent);
1052
+ !x(e) || !e.map.diagramNodesExtent || await e.goTo(e.map.diagramNodesExtent);
1053
1053
  }
1054
1054
  function q(e) {
1055
1055
  const r = e?.configurable?.context;
@@ -1067,9 +1067,9 @@ function Qa(e) {
1067
1067
  if (te(e) === "knowledgeGraph")
1068
1068
  return "knowledgeGraph";
1069
1069
  const o = r.view;
1070
- return x(o) ? (W(o), "map") : "linkChart";
1070
+ return x(o) ? "linkChart" : (W(o), "map");
1071
1071
  }
1072
- async function M(e) {
1072
+ async function N(e) {
1073
1073
  const r = e?.configurable?.context;
1074
1074
  if (te(e) === "knowledgeGraph")
1075
1075
  return r;
@@ -1591,7 +1591,7 @@ async function ie({
1591
1591
  includeReturnEntityAndRelationshipContext: a = !1
1592
1592
  }) {
1593
1593
  const o = [e];
1594
- if (a && o.push(ne), !x(t) && t.map) {
1594
+ if (a && o.push(ne), x(t)) {
1595
1595
  const d = await L("arcgis_knowledge_current_lc_context"), u = ot(t.map, r);
1596
1596
  return o.push(d), {
1597
1597
  enhancedPrompt: o.join(`
@@ -1653,16 +1653,16 @@ async function ct(e, t, r, a, o, i) {
1653
1653
  text: `Query Results parsed into ${u.length} unique relationships and entities. Atempting to add to link chart...`
1654
1654
  },
1655
1655
  i
1656
- ), !x(s) && s?.map ? (await s.map.addRecords(u), await j(s), { generatedQuery: l, explanation: p, addedIdTypePairs: u }) : (await s?.map?.allLayers.find(
1656
+ ), x(s) ? (await s.map.addRecords(u), await j(s), { generatedQuery: l, explanation: p, addedIdTypePairs: u }) : (await s?.map?.allLayers.find(
1657
1657
  (f) => f.type === "knowledge-graph"
1658
1658
  )?.addRecords(u), { generatedQuery: l, explanation: p, addedIdTypePairs: u });
1659
1659
  }
1660
- const N = "addRecords", pt = c.object({
1660
+ const M = "addRecords", pt = c.object({
1661
1661
  prompt: c.string().describe(
1662
1662
  "The user's inquiry and context required in order to generate a cypher query that will be used to add records to the link chart."
1663
1663
  )
1664
1664
  }), dt = async ({ prompt: e }, t) => {
1665
- const { knowledgeGraph: r } = await M(t), a = q(t), { view: o } = a, s = P.getDefault().helperServices, {
1665
+ const { knowledgeGraph: r } = await N(t), a = q(t), { view: o } = a, s = P.getDefault().helperServices, {
1666
1666
  enhancedPrompt: n,
1667
1667
  bindParameters: l,
1668
1668
  allNamedTypesFullyDynamic: p
@@ -1674,7 +1674,7 @@ const N = "addRecords", pt = c.object({
1674
1674
  });
1675
1675
  if (p)
1676
1676
  return {
1677
- toolName: N,
1677
+ toolName: M,
1678
1678
  status: "success",
1679
1679
  summary: "No records have been added to the map because all data in the knowledge graph is contained in the map.",
1680
1680
  details: {
@@ -1693,7 +1693,7 @@ const N = "addRecords", pt = c.object({
1693
1693
  t
1694
1694
  );
1695
1695
  return {
1696
- toolName: N,
1696
+ toolName: M,
1697
1697
  status: "success",
1698
1698
  summary: `Records added successfully. Cypher Query used: ${d}
1699
1699
 
@@ -1707,14 +1707,14 @@ Number of records added: ${h.length}`,
1707
1707
  } catch (d) {
1708
1708
  const u = E(d);
1709
1709
  return {
1710
- toolName: N,
1710
+ toolName: M,
1711
1711
  status: "error",
1712
1712
  errorMessage: `Failed to add records to the link chart. ${u}`,
1713
1713
  error: d
1714
1714
  };
1715
1715
  }
1716
1716
  }, Ia = g(dt, {
1717
- name: N,
1717
+ name: M,
1718
1718
  description: `Adds records (entities or relationships) to the current link chart visualization from an inquiry into the knowledge graph data. The inquiry will retrieve data from the graph database that will serve as the basis for the records to be added to the link chart. The user should have explicitly requested to add records to the current link chart from their prompt. "add to new link chart" is not a valid prompt for this tool.
1719
1719
 
1720
1720
  example prompts:
@@ -1747,14 +1747,7 @@ const _ = "applyLayout", ht = c.object({
1747
1747
  )
1748
1748
  }), yt = async ({ layout: e }, t) => {
1749
1749
  const { view: r } = q(t);
1750
- if (x(r))
1751
- return {
1752
- toolName: _,
1753
- status: "error",
1754
- errorMessage: "The applyLayout tool can only be used with a LinkChartView.",
1755
- error: new Error()
1756
- };
1757
- {
1750
+ if (x(r)) {
1758
1751
  const { appliedLayout: a } = await ut(e, r);
1759
1752
  return {
1760
1753
  toolName: _,
@@ -1764,7 +1757,13 @@ const _ = "applyLayout", ht = c.object({
1764
1757
  appliedLayout: a
1765
1758
  }
1766
1759
  };
1767
- }
1760
+ } else
1761
+ return {
1762
+ toolName: _,
1763
+ status: "error",
1764
+ errorMessage: "The applyLayout tool can only be used with a LinkChartView.",
1765
+ error: new Error()
1766
+ };
1768
1767
  }, Oa = g(yt, {
1769
1768
  name: _,
1770
1769
  description: "Apply a diagram layout to the link chart",
@@ -1777,14 +1776,7 @@ const Q = "changeNonspatialVisibility", gt = c.object({
1777
1776
  setting: c.enum(["hidden", "visible"]).describe("The setting of nonspatial visibility")
1778
1777
  }), ft = async ({ setting: e }, t) => {
1779
1778
  const { view: r } = q(t);
1780
- if (x(r))
1781
- return {
1782
- toolName: Q,
1783
- status: "error",
1784
- errorMessage: "The changeNonspatialVisibility tool can only be used with a LinkChartView.",
1785
- error: new Error()
1786
- };
1787
- {
1779
+ if (x(r)) {
1788
1780
  const { appliedNonspatialDataDisplayMode: a } = await mt(e, r);
1789
1781
  return {
1790
1782
  toolName: Q,
@@ -1794,7 +1786,13 @@ const Q = "changeNonspatialVisibility", gt = c.object({
1794
1786
  appliedNonspatialDataDisplayMode: a
1795
1787
  }
1796
1788
  };
1797
- }
1789
+ } else
1790
+ return {
1791
+ toolName: Q,
1792
+ status: "error",
1793
+ errorMessage: "The changeNonspatialVisibility tool can only be used with a LinkChartView.",
1794
+ error: new Error()
1795
+ };
1798
1796
  }, Ka = g(ft, {
1799
1797
  name: Q,
1800
1798
  description: "Change whether or not nonspatial data is visible in the link chart. The value must be either 'hidden' or 'visible'.",
@@ -1857,15 +1855,8 @@ const D = "createLinkChart", bt = c.object({
1857
1855
  "The user's inquiry and context required in order to generate a cypher query that will be used to create a link chart visualization. Only include information relevant to generating a cypher query. Do not suggest entity types, relationship types or properties. Do not include limits or formatting instructions for the query results unless specifically requested by the user. The prompt should be focused on the data the user wants to see in the link chart, not how to generate it."
1858
1856
  )
1859
1857
  }), Tt = async ({ prompt: e }, t) => {
1860
- const { knowledgeGraph: r } = await M(t), { view: a } = q(t);
1861
- if (x(a))
1862
- return {
1863
- toolName: D,
1864
- status: "error",
1865
- errorMessage: "The createLinkChart tool can only be used with a LinkChartView.",
1866
- error: new Error()
1867
- };
1868
- {
1858
+ const { knowledgeGraph: r } = await N(t), { view: a } = q(t);
1859
+ if (x(a)) {
1869
1860
  const i = P.getDefault().helperServices, s = await wt(
1870
1861
  `${e}
1871
1862
 
@@ -1895,7 +1886,13 @@ Explanation: ${l}`,
1895
1886
  explanation: l
1896
1887
  }
1897
1888
  };
1898
- }
1889
+ } else
1890
+ return {
1891
+ toolName: D,
1892
+ status: "error",
1893
+ errorMessage: "The createLinkChart tool can only be used with a LinkChartView.",
1894
+ error: new Error()
1895
+ };
1899
1896
  }, Va = g(Tt, {
1900
1897
  name: D,
1901
1898
  description: "Creates a new link chart visualization from an inquiry into the knowledge graph data. The inquiry will retrieve data from the graph database that will serve as the basis for the new link chart. The user should have explicitly requested the creation of a new link chart from their prompt using language like 'create new link chart' or 'add to new link chart'.",
@@ -1905,7 +1902,7 @@ Explanation: ${l}`,
1905
1902
  "The user's inquiry into the knowledge graph, from which a cypher query will be generated and executed to answer the inquiry. Only include entity types, relationship types or properties if they are provided in the user prompt or prior steps. Do not suggest entity types, relationship types or properties. Do not include limits, information on what to return, instructions on how to write the query, or formatting instructions for the query results unless specifically requested by the user."
1906
1903
  )
1907
1904
  }), vt = async ({ prompt: e }, t) => {
1908
- const { knowledgeGraph: r } = await M(t), o = P.getDefault().helperServices;
1905
+ const { knowledgeGraph: r } = await N(t), o = P.getDefault().helperServices;
1909
1906
  let i = e, s = null, n = null;
1910
1907
  try {
1911
1908
  ({ view: n } = q(t));
@@ -1982,7 +1979,7 @@ ${w.length > y ? `Showing top ${y} results:
1982
1979
  }), O = "generateCypher", Rt = c.object({
1983
1980
  prompt: c.string().describe("The user's inquiry into the knowledge graph that needs to be translated into a cypher query.")
1984
1981
  }), xt = async ({ prompt: e }, t) => {
1985
- const { knowledgeGraph: r } = await M(t), o = P.getDefault().helperServices;
1982
+ const { knowledgeGraph: r } = await N(t), o = P.getDefault().helperServices;
1986
1983
  try {
1987
1984
  const { graphQuery: i, explanation: s } = await Xr(
1988
1985
  e,
@@ -2062,7 +2059,7 @@ const K = "searchGraphData", Pt = c.object({
2062
2059
  "The user's inquiry into the knowledge graph, from which a lucene search query will be generated and executed against the graph to return relevant results."
2063
2060
  )
2064
2061
  }), Et = async ({ prompt: e }, t) => {
2065
- const { knowledgeGraph: r } = await M(t);
2062
+ const { knowledgeGraph: r } = await N(t);
2066
2063
  await T({ text: "Generating search query for the user inquiry" }, t);
2067
2064
  const a = await $t(e, r, t);
2068
2065
  await T({ text: "Executing graph search with generated search query" }, t);
@@ -2138,7 +2135,7 @@ export {
2138
2135
  Ia as e,
2139
2136
  Qa as f,
2140
2137
  L as g,
2141
- M as h,
2138
+ N as h,
2142
2139
  _a as i,
2143
2140
  xa as j,
2144
2141
  Ca as k,
@@ -2153,8 +2150,8 @@ export {
2153
2150
  Ie as t,
2154
2151
  Aa as u,
2155
2152
  qa as v,
2156
- Ma as w,
2157
- Na as x,
2153
+ Na as w,
2154
+ Ma as x,
2158
2155
  Ga as y,
2159
2156
  Vr as z
2160
2157
  };
@@ -1,12 +1,12 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import g from "@esri/arcgis-html-sanitizer";
2
+ import w from "@esri/arcgis-html-sanitizer";
3
3
  import { marked as S } from "marked";
4
4
  S.use({
5
5
  gfm: !0,
6
6
  breaks: !0,
7
7
  async: !1
8
8
  });
9
- const C = new g(
9
+ const C = new w(
10
10
  {
11
11
  whiteList: {
12
12
  // LLMs sometimes return lists like "- 2) Foo". `marked` parses that into a nested ordered list
@@ -17,6 +17,7 @@ const C = new g(
17
17
  "calcite-table-row": ["slot", "class"],
18
18
  "calcite-table-header": ["heading", "alignment", "description", "class"],
19
19
  "calcite-table-cell": ["alignment", "colspan", "rowspan", "class"],
20
+ "calcite-link": ["href", "target", "rel", "title"],
20
21
  // Allow markdown code blocks to render as <pre><code>…</code></pre>.
21
22
  pre: ["class"],
22
23
  code: ["class"]
@@ -27,98 +28,115 @@ const C = new g(
27
28
  function T(e) {
28
29
  return C.sanitize(e);
29
30
  }
31
+ function k(e) {
32
+ if (!e || typeof DOMParser > "u")
33
+ return e;
34
+ try {
35
+ const t = new DOMParser().parseFromString(e, "text/html");
36
+ return t.querySelectorAll("a").forEach((r) => {
37
+ const n = t.createElement("calcite-link");
38
+ for (const l of ["href", "target", "rel", "title"]) {
39
+ const a = r.getAttribute(l);
40
+ a !== null && n.setAttribute(l, a);
41
+ }
42
+ n.append(...r.childNodes), r.replaceWith(n);
43
+ }), t.body.innerHTML;
44
+ } catch {
45
+ return e;
46
+ }
47
+ }
30
48
  function A(e, t) {
31
- const r = e.indexOf("{", t), a = e.indexOf("[", t);
32
- return r === -1 ? a : a === -1 ? r : Math.min(r, a);
49
+ const r = e.indexOf("{", t), n = e.indexOf("[", t);
50
+ return r === -1 ? n : n === -1 ? r : Math.min(r, n);
33
51
  }
34
52
  function x(e) {
35
53
  if (e.trimStart().startsWith("```"))
36
54
  return null;
37
55
  for (let r = A(e, 0); r !== -1; r = A(e, r + 1)) {
38
- let a = 0, c = 0;
39
- for (let n = r; n < e.length; n++) {
40
- const l = e[n];
41
- if (l === "{" ? a++ : l === "}" ? a-- : l === "[" ? c++ : l === "]" && c--, a < 0 || c < 0)
56
+ let n = 0, l = 0;
57
+ for (let a = r; a < e.length; a++) {
58
+ const c = e[a];
59
+ if (c === "{" ? n++ : c === "}" ? n-- : c === "[" ? l++ : c === "]" && l--, n < 0 || l < 0)
42
60
  break;
43
- if (a === 0 && c === 0 && n > r)
44
- return e.slice(r, n + 1);
61
+ if (n === 0 && l === 0 && a > r)
62
+ return e.slice(r, a + 1);
45
63
  }
46
64
  }
47
65
  return null;
48
66
  }
49
- function O(e) {
67
+ function z(e) {
50
68
  if (!e)
51
69
  return "";
52
70
  let t = e;
53
71
  const r = x(e);
54
72
  if (r)
55
73
  try {
56
- const c = JSON.parse(r), l = `
74
+ const l = JSON.parse(r), c = `
57
75
 
58
76
  \`\`\`json
59
- ${JSON.stringify(c, null, 2)}
77
+ ${JSON.stringify(l, null, 2)}
60
78
  \`\`\`
61
79
 
62
80
  `;
63
- t = e.replace(r, l);
81
+ t = e.replace(r, c);
64
82
  } catch {
65
83
  }
66
- const a = E(t);
67
- return q(a);
84
+ const n = q(t);
85
+ return M(n);
68
86
  }
69
- function q(e) {
87
+ function M(e) {
70
88
  if (!e)
71
89
  return "";
72
- const t = M(e);
73
- return T(t);
90
+ const t = E(e), r = k(t);
91
+ return T(r);
74
92
  }
75
- function E(e) {
93
+ function q(e) {
76
94
  return e ? S.parse(e, { async: !1 }) : "";
77
95
  }
78
- function M(e) {
96
+ function E(e) {
79
97
  if (!e || typeof DOMParser > "u")
80
98
  return e;
81
99
  try {
82
100
  const t = new DOMParser().parseFromString(e, "text/html");
83
- return Array.from(t.querySelectorAll("table")).forEach((a, c) => {
84
- const n = t.createElement("calcite-table");
85
- n.setAttribute("caption", `Table ${c + 1}`), n.setAttribute("striped", "true");
86
- const l = a.querySelector("thead");
87
- if (l) {
88
- const d = Array.from(l.querySelectorAll("tr"));
89
- for (const u of d) {
101
+ return Array.from(t.querySelectorAll("table")).forEach((n, l) => {
102
+ const a = t.createElement("calcite-table");
103
+ a.setAttribute("caption", `Table ${l + 1}`), a.setAttribute("striped", "true");
104
+ const c = n.querySelector("thead");
105
+ if (c) {
106
+ const f = Array.from(c.querySelectorAll("tr"));
107
+ for (const u of f) {
90
108
  const o = t.createElement("calcite-table-row");
91
109
  o.setAttribute("slot", "table-header");
92
- const f = Array.from(u.querySelectorAll("th, td"));
93
- for (const h of f) {
94
- const s = (h.textContent ?? "").trim(), i = t.createElement("calcite-table-header");
95
- i.setAttribute("heading", s), o.appendChild(i);
110
+ const d = Array.from(u.querySelectorAll("th, td"));
111
+ for (const h of d) {
112
+ const i = (h.textContent ?? "").trim(), s = t.createElement("calcite-table-header");
113
+ s.setAttribute("heading", i), o.appendChild(s);
96
114
  }
97
- n.appendChild(o);
115
+ a.appendChild(o);
98
116
  }
99
117
  }
100
- const b = a.querySelector("tbody");
101
- (b ? Array.from(b.querySelectorAll("tr")) : Array.from(a.querySelectorAll("tr")).filter((d) => !l?.contains(d))).forEach((d, u) => {
102
- const o = t.createElement("calcite-table-row"), f = !l && u === 0 && d.querySelectorAll("th").length > 0;
103
- f && o.setAttribute("slot", "table-header");
104
- const h = Array.from(d.querySelectorAll("th, td"));
105
- for (const s of h) {
106
- if (f && s.localName === "th") {
107
- const w = (s.textContent ?? "").trim(), y = t.createElement("calcite-table-header");
108
- y.setAttribute("heading", w), o.appendChild(y);
118
+ const b = n.querySelector("tbody");
119
+ (b ? Array.from(b.querySelectorAll("tr")) : Array.from(n.querySelectorAll("tr")).filter((f) => !c?.contains(f))).forEach((f, u) => {
120
+ const o = t.createElement("calcite-table-row"), d = !c && u === 0 && f.querySelectorAll("th").length > 0;
121
+ d && o.setAttribute("slot", "table-header");
122
+ const h = Array.from(f.querySelectorAll("th, td"));
123
+ for (const i of h) {
124
+ if (d && i.localName === "th") {
125
+ const g = (i.textContent ?? "").trim(), y = t.createElement("calcite-table-header");
126
+ y.setAttribute("heading", g), o.appendChild(y);
109
127
  return;
110
128
  }
111
- const i = t.createElement("calcite-table-cell"), p = s.getAttribute("colspan"), m = s.getAttribute("rowspan");
112
- p && i.setAttribute("colspan", p), m && i.setAttribute("rowspan", m), i.innerHTML = s.innerHTML, o.appendChild(i);
129
+ const s = t.createElement("calcite-table-cell"), p = i.getAttribute("colspan"), m = i.getAttribute("rowspan");
130
+ p && s.setAttribute("colspan", p), m && s.setAttribute("rowspan", m), s.innerHTML = i.innerHTML, o.appendChild(s);
113
131
  }
114
- n.appendChild(o);
115
- }), a.replaceWith(n);
132
+ a.appendChild(o);
133
+ }), n.replaceWith(a);
116
134
  }), t.body.innerHTML;
117
135
  } catch {
118
136
  return e;
119
137
  }
120
138
  }
121
139
  export {
122
- q as a,
123
- O as p
140
+ M as a,
141
+ z as p
124
142
  };
@@ -89,13 +89,35 @@ export abstract class ArcgisAssistant extends LitElement {
89
89
  assistantLabel: string;
90
90
  stopButtonLabel: string;
91
91
  askButtonLabel: string;
92
+ stoppedByUserLabel: string;
93
+ noAgentsFoundMessage: string;
94
+ orchestratorInitializationErrorMessage: string;
95
+ signInErrorMessage: string;
96
+ signInRequiredMessage: string;
97
+ signInLabel: string;
98
+ signInToArcGISOnlineLabel: string;
99
+ noPortalInformationMessage: string;
100
+ readMoreLabel: string;
101
+ learnAboutWebMapEmbeddingsLabel: string;
102
+ waitingForUserInputMessage: string;
92
103
  } & T9nMeta<{
93
104
  assistantLabel: string;
94
105
  stopButtonLabel: string;
95
106
  askButtonLabel: string;
107
+ stoppedByUserLabel: string;
108
+ noAgentsFoundMessage: string;
109
+ orchestratorInitializationErrorMessage: string;
110
+ signInErrorMessage: string;
111
+ signInRequiredMessage: string;
112
+ signInLabel: string;
113
+ signInToArcGISOnlineLabel: string;
114
+ noPortalInformationMessage: string;
115
+ readMoreLabel: string;
116
+ learnAboutWebMapEmbeddingsLabel: string;
117
+ waitingForUserInputMessage: string;
96
118
  }>;
97
119
  /**
98
- * When `true`, disables the assistant avatar in the chat interface.
120
+ * When `true`, displays the assistant avatar in the chat interface.
99
121
  *
100
122
  * @default false
101
123
  * @since 5.1
@@ -310,6 +332,13 @@ export abstract class ArcgisAssistant extends LitElement {
310
332
  * ```
311
333
  */
312
334
  accessor suggestedPrompts: string[];
335
+ /**
336
+ * When `true`, displays the user avatar in the chat interface.
337
+ *
338
+ * @default false
339
+ * @since 5.2
340
+ */
341
+ accessor userAvatarEnabled: boolean;
313
342
  /**
314
343
  * Cancels the active interrupt, if one is pending.
315
344
  *