@arcgis/ai-components 5.1.0-next.131 → 5.1.0-next.133

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/agent-utils/LLMAgent.js +1 -0
  2. package/dist/cdn/42PRJS7D.js +16 -0
  3. package/dist/cdn/4EALV6QJ.js +2 -0
  4. package/dist/cdn/4YMVC2WQ.js +2 -0
  5. package/dist/cdn/{IFB2ASIW.js → 6BG6KRX4.js} +1 -1
  6. package/dist/cdn/{GNCV7JCL.js → 7WSTR3WA.js} +1 -1
  7. package/dist/cdn/A5BFXA66.js +2 -0
  8. package/dist/cdn/{WRKGKKWT.js → AINP73E3.js} +1 -1
  9. package/dist/cdn/{NKL6PVCN.js → CB4Y7HDN.js} +1 -1
  10. package/dist/cdn/DZ5GEWTT.js +2 -0
  11. package/dist/cdn/E2FJS7ZW.js +2 -0
  12. package/dist/cdn/FJDGBPFY.js +2 -0
  13. package/dist/cdn/FWLEC33J.js +3 -0
  14. package/dist/cdn/JZ4W322Q.js +2 -0
  15. package/dist/cdn/MMCPSWGL.js +2 -0
  16. package/dist/cdn/MXPGGYZ5.js +2 -0
  17. package/dist/cdn/{QXWL4WLO.js → NSSLQWSK.js} +5 -5
  18. package/dist/cdn/P5VYRL3F.js +2 -0
  19. package/dist/cdn/{7HKOEG6B.js → PYT575RW.js} +1 -1
  20. package/dist/cdn/R3WQHSCZ.js +3 -0
  21. package/dist/cdn/RXUGYIPT.js +2 -0
  22. package/dist/cdn/TCS3JLFM.js +2 -0
  23. package/dist/cdn/{SOCUKQVO.js → TRZURWLQ.js} +1 -1
  24. package/dist/cdn/TSI4RYTU.js +2 -0
  25. package/dist/cdn/UUC47SR5.js +2 -0
  26. package/dist/cdn/VEF7ZQXR.js +2 -0
  27. package/dist/cdn/WAKZBZN6.js +4 -0
  28. package/dist/cdn/WALWNGLA.js +2 -0
  29. package/dist/cdn/{3352JWU3.js → WAUIIVEJ.js} +1 -1
  30. package/dist/cdn/{MGPLH2PO.js → XNFGWZME.js} +1 -1
  31. package/dist/cdn/XOLAHK4S.js +2 -0
  32. package/dist/cdn/{DZWRIK64.js → ZYK5DJQB.js} +18 -18
  33. package/dist/cdn/agent-utils/index.js +1 -1
  34. package/dist/cdn/index.js +1 -1
  35. package/dist/chunks/adapter.js +77 -76
  36. package/dist/chunks/arcgisKnowledgeGraph.js +3 -2
  37. package/dist/chunks/dataExplorationGraph.js +3 -2
  38. package/dist/chunks/generateLayerDescriptions.js +180 -178
  39. package/dist/chunks/helpGraph.js +3 -2
  40. package/dist/chunks/layerStylingGraph.js +1 -0
  41. package/dist/chunks/navigationGraph.js +3 -2
  42. package/dist/chunks/orchestrator.js +49 -48
  43. package/dist/chunks/toolCallResponse.js +10 -9
  44. package/dist/components/arcgis-assistant/customElement.js +54 -48
  45. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +3 -2
  46. package/dist/components/arcgis-assistant-help-agent/customElement.js +1 -0
  47. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +4 -3
  48. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +1 -0
  49. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +1 -0
  50. package/dist/docs/api.json +1 -1
  51. package/dist/docs/docs.json +1 -1
  52. package/dist/docs/web-types.json +1 -1
  53. package/package.json +5 -5
  54. package/dist/cdn/43BXVTTX.js +0 -3
  55. package/dist/cdn/45WQFXC6.js +0 -2
  56. package/dist/cdn/5BWAWCMA.js +0 -2
  57. package/dist/cdn/6HIZCLMG.js +0 -2
  58. package/dist/cdn/6MS2XN27.js +0 -2
  59. package/dist/cdn/COFOUGFJ.js +0 -4
  60. package/dist/cdn/CY2AOS7J.js +0 -2
  61. package/dist/cdn/DPCBYJAM.js +0 -2
  62. package/dist/cdn/DQIMHH5V.js +0 -2
  63. package/dist/cdn/DXWRFET6.js +0 -2
  64. package/dist/cdn/F2QU4HAK.js +0 -2
  65. package/dist/cdn/H4ENPGSI.js +0 -2
  66. package/dist/cdn/HFQQORS4.js +0 -2
  67. package/dist/cdn/HWSIV5DK.js +0 -2
  68. package/dist/cdn/I6AHJA2A.js +0 -16
  69. package/dist/cdn/IFDBNTW2.js +0 -3
  70. package/dist/cdn/MDZ3PTNT.js +0 -2
  71. package/dist/cdn/P7EGIU6K.js +0 -2
  72. package/dist/cdn/VVG5FDCY.js +0 -2
  73. package/dist/cdn/ZR5WU3UB.js +0 -2
@@ -3,6 +3,7 @@ import { StateGraph as b, START as $, END as C } from "@langchain/langgraph/web"
3
3
  import { k as F, m as R, n as L, o as M, p as A, u as _, v as I, w as q, x as Z, g as T, y as k, t as j, f as u, r as P, N as w } from "./adapter.js";
4
4
  import "@arcgis/core/identity/IdentityManager.js";
5
5
  import "@arcgis/core/portal/Portal.js";
6
+ import "@arcgis/toolkit/string";
6
7
  import { h as V, i as z } from "./generateLayerDescriptions.js";
7
8
  import "@langchain/core/messages";
8
9
  import "@langchain/core/callbacks/dispatch/web";
@@ -258,7 +259,7 @@ ${r.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
258
259
  _Example: “Center the map on San Francisco at scale 50000”_
259
260
  _Example: “Zoom to the features in the schools layer where city = 'Austin'”_
260
261
  _Example: “Go to the Downtown bookmark”_
261
- _Example: “Where is Mount Rainier?”_`, ye = {
262
+ _Example: “Where is Mount Rainier?”_`, ve = {
262
263
  id: "navigation",
263
264
  name: "Navigation Agent",
264
265
  description: Y,
@@ -266,5 +267,5 @@ ${r.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
266
267
  workspace: w
267
268
  };
268
269
  export {
269
- ye as N
270
+ ve as N
270
271
  };
@@ -3,12 +3,13 @@ import R from "@arcgis/core/identity/IdentityManager.js";
3
3
  import C from "@arcgis/core/portal/Portal.js";
4
4
  import { n as I, o as v, D as k, p as A, q as M, W as F } from "./generateLayerDescriptions.js";
5
5
  import { isGraphInterrupt as D, StateGraph as L, START as W, END as $, MemorySaver as j } from "@langchain/langgraph/web";
6
- import { HumanMessage as q, AIMessage as H } from "@langchain/core/messages";
6
+ import { generateGuid as q } from "@arcgis/toolkit/string";
7
+ import { HumanMessage as H, AIMessage as P } from "@langchain/core/messages";
7
8
  import { s as l } from "./index.js";
8
- import * as P from "@arcgis/core/core/reactiveUtils.js";
9
- import U from "@arcgis/core/layers/FeatureLayer.js";
10
- import O from "@arcgis/core/request.js";
11
- const T = async (t) => {
9
+ import * as O from "@arcgis/core/core/reactiveUtils.js";
10
+ import T from "@arcgis/core/layers/FeatureLayer.js";
11
+ import U from "@arcgis/core/request.js";
12
+ const G = async (t) => {
12
13
  const e = await N(), r = await I("default"), s = C.getDefault(), a = (await R.getCredential(`${s.url}/sharing`)).token, i = {
13
14
  type: "generateEmbeddings",
14
15
  webmapEmbeddings: t,
@@ -27,17 +28,17 @@ const T = async (t) => {
27
28
  const t = (await import("./embeddings.worker.js")).default;
28
29
  return new t();
29
30
  }
30
- }, G = (t) => {
31
+ }, _ = (t) => {
31
32
  t.currentIntent = "none";
32
- }, _ = async (t, e) => {
33
+ }, V = async (t, e) => {
33
34
  const r = v(e);
34
35
  if (t.agentExecutionContext.userRequest) {
35
- const n = new q(t.agentExecutionContext.userRequest.trim());
36
- t.agentExecutionContext.messages = [...t.agentExecutionContext.messages, n], G(t);
36
+ const n = new H(t.agentExecutionContext.userRequest.trim());
37
+ t.agentExecutionContext.messages = [...t.agentExecutionContext.messages, n], _(t);
37
38
  }
38
39
  const s = r?.services.agentRegistry.list().map((n) => n.agent.id) ?? [];
39
40
  return await l({ text: `Available agents: ${[...s].join(", ")}` }, e), await l({ text: "Analyzing user input" }, e), t;
40
- }, V = async (t, e) => (await l({ text: "Exiting..." }, e), t), w = (t) => typeof t == "object" && t !== null && !Array.isArray(t), z = (t, e) => {
41
+ }, z = async (t, e) => (await l({ text: "Exiting..." }, e), t), w = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Q = (t, e) => {
41
42
  if (!w(t)) {
42
43
  t !== void 0 && console.warn(`Agent "${e}" returned invalid sharedStatePatch. Ignoring it.`);
43
44
  return;
@@ -53,7 +54,7 @@ const T = async (t) => {
53
54
  r[s] = { value: n.value };
54
55
  }
55
56
  return r;
56
- }, Q = (t) => {
57
+ }, B = (t) => {
57
58
  const { previousSharedState: e, patch: r, agentId: s } = t;
58
59
  if (!r)
59
60
  return e;
@@ -74,7 +75,7 @@ const T = async (t) => {
74
75
  return;
75
76
  const e = t.trim();
76
77
  return e || void 0;
77
- }, B = (t) => {
78
+ }, J = (t) => {
78
79
  switch (t) {
79
80
  case "failed":
80
81
  return "Agent failed without a summary.";
@@ -85,17 +86,17 @@ const T = async (t) => {
85
86
  default:
86
87
  return "Agent completed without a summary.";
87
88
  }
88
- }, J = (t, e) => {
89
+ }, K = (t, e) => {
89
90
  const r = f(e?.outputMessage), s = f(e?.summary), n = e?.status, a = n === "success" || n === "failed" ? n : "unknown";
90
91
  a === "unknown" && console.warn(`Agent "${t}" returned missing/invalid status. Defaulting to "unknown".`);
91
- const i = z(e?.sharedStatePatch, t);
92
+ const i = Q(e?.sharedStatePatch, t);
92
93
  return {
93
94
  outputMessage: r,
94
- summary: s ?? r ?? B(a),
95
+ summary: s ?? r ?? J(a),
95
96
  status: a,
96
97
  sharedStatePatch: i
97
98
  };
98
- }, E = 4e3, K = async (t, e) => {
99
+ }, E = 4e3, X = async (t, e) => {
99
100
  const r = v(e);
100
101
  if (r?.abortSignal?.aborted)
101
102
  return await l({ text: "Run cancelled; skipping agent execution" }, e), {
@@ -130,7 +131,7 @@ const T = async (t) => {
130
131
  },
131
132
  a
132
133
  );
133
- i = J(n.agent.name, o), await l({ text: `Finished executing registered agent: ${n.agent.name}` }, e);
134
+ i = K(n.agent.name, o), await l({ text: `Finished executing registered agent: ${n.agent.name}` }, e);
134
135
  } catch (o) {
135
136
  if (D(o))
136
137
  throw o;
@@ -145,7 +146,7 @@ const T = async (t) => {
145
146
  if (c) {
146
147
  const o = c.length > E ? `${c.slice(0, E - 14)}
147
148
  [truncated]` : c;
148
- d.push(new H(o));
149
+ d.push(new P(o));
149
150
  }
150
151
  return {
151
152
  ...t,
@@ -165,18 +166,18 @@ const T = async (t) => {
165
166
  status: i?.status || "unknown"
166
167
  }
167
168
  ],
168
- sharedState: Q({
169
+ sharedState: B({
169
170
  previousSharedState: t.agentExecutionContext.sharedState,
170
171
  patch: i.sharedStatePatch,
171
172
  agentId: n.agent.id
172
173
  })
173
174
  }
174
175
  };
175
- }, X = 3, Y = () => new L(k).addNode("ingestInput", _).addNode("intentLLM", A).addNode("executeRegisteredAgent", K).addNode("exit", V).addEdge(W, "ingestInput").addEdge("ingestInput", "intentLLM").addConditionalEdges("intentLLM", (e) => e.currentIntent === "none" || e.currentIntent === e.lastExecutedAgent ? "exit" : "executeRegisteredAgent").addConditionalEdges(
176
+ }, Y = 3, Z = () => new L(k).addNode("ingestInput", V).addNode("intentLLM", A).addNode("executeRegisteredAgent", X).addNode("exit", z).addEdge(W, "ingestInput").addEdge("ingestInput", "intentLLM").addConditionalEdges("intentLLM", (e) => e.currentIntent === "none" || e.currentIntent === e.lastExecutedAgent ? "exit" : "executeRegisteredAgent").addConditionalEdges(
176
177
  "executeRegisteredAgent",
177
- (e) => e.stepCount >= X || !e.requiresFollowUp ? "exit" : "intentLLM"
178
+ (e) => e.stepCount >= Y || !e.requiresFollowUp ? "exit" : "intentLLM"
178
179
  ).addEdge("exit", $);
179
- class Z {
180
+ class ee {
180
181
  constructor() {
181
182
  this.agentRegistry = /* @__PURE__ */ new Map();
182
183
  }
@@ -193,7 +194,7 @@ class Z {
193
194
  return [...this.agentRegistry.values()];
194
195
  }
195
196
  }
196
- class ee {
197
+ class te {
197
198
  /**
198
199
  * Create a new InterruptHandler tied to a specific compiled graph and config.
199
200
  */
@@ -240,7 +241,7 @@ class ee {
240
241
  this.rejectWait && (this.rejectWait(new Error("Request cancelled by user.")), this.resolveWait = void 0, this.rejectWait = void 0);
241
242
  }
242
243
  }
243
- const te = async (t) => {
244
+ const re = async (t) => {
244
245
  try {
245
246
  return await (await M()).embedDocuments(t);
246
247
  } catch (e) {
@@ -250,10 +251,10 @@ const te = async (t) => {
250
251
  const r = e.get(t);
251
252
  if (r)
252
253
  return r;
253
- const s = await te([t]);
254
+ const s = await re([t]);
254
255
  return e.set(t, s[0]), s[0];
255
256
  };
256
- async function re(t, e, r, s) {
257
+ async function ne(t, e, r, s) {
257
258
  const n = `req-${Date.now()}`, i = {
258
259
  type: "layerSearch",
259
260
  precomputedEmbedding: s ? await b(t, s) : void 0,
@@ -267,7 +268,7 @@ async function re(t, e, r, s) {
267
268
  e.addEventListener("message", d, { once: !0 }), e.postMessage(i);
268
269
  });
269
270
  }
270
- function ne(t) {
271
+ function se(t) {
271
272
  const { worker: e } = t;
272
273
  return {
273
274
  async searchLayers({
@@ -275,11 +276,11 @@ function ne(t) {
275
276
  minScore: s,
276
277
  embeddingCache: n
277
278
  }) {
278
- return await re(r, e, s, n);
279
+ return await ne(r, e, s, n);
279
280
  }
280
281
  };
281
282
  }
282
- const se = async ({
283
+ const ae = async ({
283
284
  combinedQuery: t,
284
285
  layerIds: e,
285
286
  embeddingsWorker: r,
@@ -308,11 +309,11 @@ const se = async ({
308
309
  r.addEventListener("message", g, { once: !0 }), r.postMessage(d);
309
310
  });
310
311
  };
311
- function ae(t) {
312
+ function ie(t) {
312
313
  const { worker: e } = t;
313
314
  return {
314
315
  async searchFields({ text: r, layerIds: s, minScore: n, topResults: a, embeddingCache: i }) {
315
- return await se({
316
+ return await ae({
316
317
  combinedQuery: r,
317
318
  layerIds: s,
318
319
  embeddingsWorker: e,
@@ -323,15 +324,15 @@ function ae(t) {
323
324
  }
324
325
  };
325
326
  }
326
- const ie = (t) => {
327
+ const oe = (t) => {
327
328
  const e = F.safeParse(t);
328
329
  if (!e.success)
329
330
  throw new Error("Embeddings response validation failed. Regenerate embeddings.");
330
331
  return e.data;
331
- }, oe = (t, e) => {
332
+ }, ce = (t, e) => {
332
333
  const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
333
334
  if (e.allLayers.forEach((n) => {
334
- n instanceof U && s.set(n.id, n);
335
+ n instanceof T && s.set(n.id, n);
335
336
  }), t.length !== s.size)
336
337
  throw new Error("Layer count mismatch during registry restoration. Regenerate embeddings.");
337
338
  for (const n of t) {
@@ -370,27 +371,27 @@ const ie = (t) => {
370
371
  });
371
372
  }
372
373
  return r;
373
- }, ce = async (t) => {
374
+ }, de = async (t) => {
374
375
  try {
375
- return (await O(t, {
376
+ return (await U(t, {
376
377
  responseType: "json"
377
378
  })).data;
378
379
  } catch (e) {
379
380
  throw new Error(`Failed to fetch data from ${t}: ${String(e)}`);
380
381
  }
381
- }, de = async (t) => {
382
+ }, ue = async (t) => {
382
383
  const e = t.map;
383
384
  if (!e?.portalItem)
384
385
  throw new Error("WebMap portal item is missing.");
385
386
  const { resources: r } = await e.portalItem.fetchResources(), s = r.find((i) => i.resource.path === "embeddings-v01.json");
386
387
  if (!s?.resource.url)
387
388
  throw new Error("Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.");
388
- const n = await ce(s.resource.url);
389
- return ie(n);
389
+ const n = await de(s.resource.url);
390
+ return oe(n);
390
391
  };
391
392
  class x {
392
393
  constructor() {
393
- this.orchestratorReady = !1, this.chatHistory = [], this.priorSteps = [], this.sharedState = {}, this.agentRegistry = new Z(), this.activeRunId = "", this.cancelledRunIds = /* @__PURE__ */ new Set(), this.streamEpoch = 0;
394
+ this.orchestratorReady = !1, this.chatHistory = [], this.priorSteps = [], this.sharedState = {}, this.agentRegistry = new ee(), this.activeRunId = "", this.cancelledRunIds = /* @__PURE__ */ new Set(), this.streamEpoch = 0;
394
395
  }
395
396
  /**
396
397
  * Creates and returns an AI-ready Orchestrator instance.
@@ -401,12 +402,12 @@ class x {
401
402
  const r = new x();
402
403
  try {
403
404
  if (e.view?.map) {
404
- await P.whenOnce(() => e.view.ready);
405
- const s = await de(e.view), n = oe(
405
+ await O.whenOnce(() => e.view.ready);
406
+ const s = await ue(e.view), n = ce(
406
407
  s.layers,
407
408
  e.view.map
408
409
  );
409
- r.layersAndFieldsRegistry = n, r.embeddingsWorker = await T(s);
410
+ r.layersAndFieldsRegistry = n, r.embeddingsWorker = await G(s);
410
411
  }
411
412
  return e.agents?.forEach((s) => {
412
413
  r.agentRegistry.register(s);
@@ -430,9 +431,9 @@ class x {
430
431
  throw new Error("Orchestrator has no registered agents.");
431
432
  if (++this.streamEpoch, !e.trim())
432
433
  return;
433
- const r = crypto.randomUUID();
434
- this.activeRunId = r, this.activeAbortController = new AbortController(), this.graph || (this.graph = Y().compile({ checkpointer: new j() }));
435
- const s = this.embeddingsWorker ? ne({ worker: this.embeddingsWorker }) : void 0, n = this.embeddingsWorker ? ae({ worker: this.embeddingsWorker }) : void 0, a = /* @__PURE__ */ new Map(), c = {
434
+ const r = q();
435
+ this.activeRunId = r, this.activeAbortController = new AbortController(), this.graph || (this.graph = Z().compile({ checkpointer: new j() }));
436
+ const s = this.embeddingsWorker ? se({ worker: this.embeddingsWorker }) : void 0, n = this.embeddingsWorker ? ie({ worker: this.embeddingsWorker }) : void 0, a = /* @__PURE__ */ new Map(), c = {
436
437
  version: "v2",
437
438
  streamMode: "custom",
438
439
  configurable: {
@@ -472,7 +473,7 @@ class x {
472
473
  const m = (await this.graph.getState(c, { subgraphs: !0 })).tasks.find((h) => h.interrupts.length > 0)?.interrupts[0]?.value;
473
474
  if (!m)
474
475
  break;
475
- this.currentInterrupt = m, this.interruptHandler = new ee(this.graph, c), yield { runId: r, timestamp: Date.now(), type: "interrupt", interrupt: m };
476
+ this.currentInterrupt = m, this.interruptHandler = new te(this.graph, c), yield { runId: r, timestamp: Date.now(), type: "interrupt", interrupt: m };
476
477
  try {
477
478
  const h = await this.interruptHandler.waitForUser(), S = ++this.streamEpoch;
478
479
  yield* this.pipeStream(h, S, r);
@@ -564,5 +565,5 @@ class x {
564
565
  }
565
566
  export {
566
567
  x as O,
567
- te as g
568
+ re as g
568
569
  };
@@ -2,30 +2,31 @@
2
2
  import "@arcgis/core/identity/IdentityManager.js";
3
3
  import "@arcgis/core/portal/Portal.js";
4
4
  import "@langchain/langgraph/web";
5
+ import "@arcgis/toolkit/string";
5
6
  import "./generateLayerDescriptions.js";
6
7
  import "@langchain/core/messages";
7
- import { s as r } from "./index.js";
8
+ import { s as a } from "./index.js";
8
9
  import "@langchain/openai";
9
10
  import "@arcgis/core/config.js";
10
11
  import "@arcgis/core/core/reactiveUtils.js";
11
12
  import "@arcgis/core/layers/FeatureLayer.js";
12
13
  import "@arcgis/core/request.js";
13
14
  import "@langchain/core/prompts";
14
- const y = async (t, o) => {
15
- const a = t.tool_calls ?? [];
16
- if (a.length === 0) {
17
- await r({ text: `LLM did not request any tool calls: ${String(t?.content)}` }, o);
15
+ const L = async (t, o) => {
16
+ const i = t.tool_calls ?? [];
17
+ if (i.length === 0) {
18
+ await a({ text: `LLM did not request any tool calls: ${String(t?.content)}` }, o);
18
19
  return;
19
20
  }
20
21
  await Promise.all(
21
- a.map(
22
- async (i) => await r(
23
- { text: `LLM invoked ${i.name} tool with arguments: ${JSON.stringify(i.args, null, 2)}` },
22
+ i.map(
23
+ async (r) => await a(
24
+ { text: `LLM invoked ${r.name} tool with arguments: ${JSON.stringify(r.args, null, 2)}` },
24
25
  o
25
26
  )
26
27
  )
27
28
  );
28
29
  };
29
30
  export {
30
- y as h
31
+ L as h
31
32
  };
@@ -1,34 +1,36 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
2
  import { c as $ } from "../../chunks/runtime.js";
3
- import { css as C, html as l } from "lit";
4
- import I from "@arcgis/core/core/Collection.js";
5
- import { whenOnce as P, watch as A, when as x } from "@arcgis/core/core/reactiveUtils.js";
6
- import L from "@arcgis/core/portal/Portal.js";
7
- import { LitElement as R, createEvent as g, nothing as k } from "@arcgis/lumina";
3
+ import { css as I, html as l } from "lit";
4
+ import C from "@arcgis/core/core/Collection.js";
5
+ import { whenOnce as P, watch as A, when as L } from "@arcgis/core/core/reactiveUtils.js";
6
+ import x from "@arcgis/core/portal/Portal.js";
7
+ import { LitElement as R, createEvent as p, nothing as k } from "@arcgis/lumina";
8
+ import * as M from "@arcgis/toolkit/log";
8
9
  import { rethrowError as O } from "@arcgis/toolkit/log";
9
10
  import { createRef as _, ref as v } from "lit/directives/ref.js";
10
- import { u as M } from "../../chunks/useT9n.js";
11
- import { O as D } from "../../chunks/orchestrator.js";
11
+ import { u as D } from "../../chunks/useT9n.js";
12
+ import { O as T } from "../../chunks/orchestrator.js";
12
13
  import "@langchain/core/callbacks/dispatch/web";
13
14
  import "@langchain/core/prompts";
14
15
  import "@langchain/openai";
15
- import T from "@arcgis/core/identity/IdentityManager.js";
16
+ import N from "@arcgis/core/identity/IdentityManager.js";
17
+ import "@arcgis/toolkit/string";
16
18
  import "@arcgis/core/config.js";
17
19
  import "@langchain/core/messages";
18
20
  import "@arcgis/core/layers/FeatureLayer.js";
19
21
  import "../../chunks/generateLayerDescriptions.js";
20
22
  import "@langchain/langgraph/web";
21
- import N from "@arcgis/core/core/Accessor.js";
23
+ import z from "@arcgis/core/core/Accessor.js";
22
24
  import { property as b, subclass as B } from "@arcgis/core/core/accessorSupport/decorators.js";
23
25
  import { g as V } from "../../chunks/utils3.js";
24
26
  import { g as w } from "../../chunks/slottableRequestUtils.js";
25
- const z = C`:host{display:block;width:var(--arcgis-internal-panel-width, 100%);height:var(--arcgis-internal-expand-max-height, 100%);--calcite-panel-content-bottom-space: 0}.footer-container{display:flex;flex-direction:column;flex:1 1 0;gap:var(--calcite-spacing-md)}.content-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0;position:relative;overflow:auto}.suggested-prompts-container{display:flex;justify-content:center;width:100%;background:var(--calcite-panel-background-color, var(--calcite-color-background))}.suggested-prompts{display:block;padding:var(--calcite-spacing-md);max-width:100%;box-sizing:border-box}.error-notice{padding:var(--calcite-spacing-sm)}.interrupt-waiting-message{font-style:italic;color:var(--calcite-color-text-2)}`;
26
- var H = Object.defineProperty, j = Object.getOwnPropertyDescriptor, m = (c, t, e, i) => {
27
- for (var r = i > 1 ? void 0 : i ? j(t, e) : t, n = c.length - 1, s; n >= 0; n--)
27
+ const q = I`:host{display:block;width:var(--arcgis-internal-panel-width, 100%);height:var(--arcgis-internal-expand-max-height, 100%);--calcite-panel-content-bottom-space: 0}.footer-container{display:flex;flex-direction:column;flex:1 1 0;gap:var(--calcite-spacing-md)}.content-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0;position:relative;overflow:auto}.suggested-prompts-container{display:flex;justify-content:center;width:100%;background:var(--calcite-panel-background-color, var(--calcite-color-background))}.suggested-prompts{display:block;padding:var(--calcite-spacing-md);max-width:100%;box-sizing:border-box}.error-notice{padding:var(--calcite-spacing-sm)}.interrupt-waiting-message{font-style:italic;color:var(--calcite-color-text-2)}`;
28
+ var H = Object.defineProperty, U = Object.getOwnPropertyDescriptor, m = (c, t, e, i) => {
29
+ for (var r = i > 1 ? void 0 : i ? U(t, e) : t, n = c.length - 1, s; n >= 0; n--)
28
30
  (s = c[n]) && (r = (i ? s(t, e, r) : s(r)) || r);
29
31
  return i && r && H(t, e, r), r;
30
32
  };
31
- const q = async (c) => await new Promise((t) => setTimeout(t, c));
33
+ const j = async (c) => await new Promise((t) => setTimeout(t, c));
32
34
  async function* F(c, {
33
35
  chunkSize: t = 5,
34
36
  // chars per "token"
@@ -37,7 +39,7 @@ async function* F(c, {
37
39
  } = {}) {
38
40
  let i = 0;
39
41
  for (; i < c.length; )
40
- yield c.slice(i, i + t), i += t, await q(e);
42
+ yield c.slice(i, i + t), i += t, await j(e);
41
43
  }
42
44
  async function* E(c, t, e, i) {
43
45
  for await (const r of F(c)) {
@@ -48,7 +50,7 @@ async function* E(c, t, e, i) {
48
50
  yield { type: "block-data", blockType: "text", data: { content: r }, runId: t };
49
51
  }
50
52
  }
51
- let d = class extends N {
53
+ let d = class extends z {
52
54
  constructor(c) {
53
55
  super(c), this.view = null, this.loading = !1, this.processing = !1, this.processingStep = "";
54
56
  }
@@ -66,7 +68,7 @@ let d = class extends N {
66
68
  async _initialize() {
67
69
  this.removeHandles(), await Promise.all([this.portal.load(), this.view?.when()]), this.view && await P(() => !this.view.updating), this._set(
68
70
  "orchestrator",
69
- await D.init({
71
+ await T.init({
70
72
  agents: [...this.agents],
71
73
  view: this.view ?? void 0
72
74
  })
@@ -104,8 +106,8 @@ let d = class extends N {
104
106
  yield { type: "completed", error: "No response received.", log: e, runId: s };
105
107
  return;
106
108
  }
107
- const p = a.content;
108
- if (yield { type: "block-start", blockType: "text", runId: s }, yield* E(p, s, e, t), yield { type: "block-end", blockType: "text", runId: s }, h)
109
+ const g = a.content;
110
+ if (yield { type: "block-start", blockType: "text", runId: s }, yield* E(g, s, e, t), yield { type: "block-end", blockType: "text", runId: s }, h)
109
111
  for (const f of i) {
110
112
  if (t?.aborted) {
111
113
  yield { type: "cancelled", log: e, runId: s };
@@ -119,7 +121,7 @@ let d = class extends N {
119
121
  yield { type: "block-data", blockType: u, data: y, runId: s };
120
122
  yield { type: "block-end", blockType: u, runId: s };
121
123
  }
122
- yield { type: "completed", response: p, blocks: i, log: e, runId: s };
124
+ yield { type: "completed", response: g, blocks: i, log: e, runId: s };
123
125
  return;
124
126
  }
125
127
  case "ux-suggestion": {
@@ -128,18 +130,18 @@ let d = class extends N {
128
130
  break;
129
131
  }
130
132
  case "interrupt": {
131
- const { kind: a, message: o, metadata: h } = n.interrupt, p = Array.isArray(h) ? h.filter((u) => typeof u == "string") : [], f = (() => {
133
+ const { kind: a, message: o, metadata: h } = n.interrupt, g = Array.isArray(h) ? h.filter((u) => typeof u == "string") : [], f = (() => {
132
134
  switch (a) {
133
135
  case "booleanChoice":
134
- return { type: "boolean-choice", message: o, options: p };
136
+ return { type: "boolean-choice", message: o, options: g };
135
137
  case "singleSelection":
136
- return { type: "single-select", message: o, options: p };
138
+ return { type: "single-select", message: o, options: g };
137
139
  case "multipleSelection":
138
- return { type: "multi-select", message: o, options: p };
140
+ return { type: "multi-select", message: o, options: g };
139
141
  case "textInput":
140
142
  return { type: "text-input", message: o };
141
143
  default:
142
- return { type: a, message: o, options: p };
144
+ return { type: a, message: o, options: g };
143
145
  }
144
146
  })();
145
147
  this._set("processingStep", "Waiting for user input..."), yield { type: "interrupt", payload: f, runId: s };
@@ -194,10 +196,10 @@ m([
194
196
  d = m([
195
197
  B("OrchestratorController")
196
198
  ], d);
197
- const G = "Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.", U = "Embeddings not found for this web map.", W = "https://developers.arcgis.com/javascript/latest/agentic-apps/ai-webmap-setup/#embeddings";
198
- class Y extends R {
199
+ const G = "Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.", W = "Embeddings not found for this web map.", Y = "https://developers.arcgis.com/javascript/latest/agentic-apps/ai-webmap-setup/#embeddings";
200
+ class J extends R {
199
201
  constructor() {
200
- super(...arguments), this._messages = M({ blocking: !0 }), this.#t = _(), this.#n = _(), this.#s = _(), this.#e = null, this.#o = /* @__PURE__ */ new Map(), this.#i = L.getDefault(), this.#r = (t) => {
202
+ super(...arguments), this._messages = D({ blocking: !0 }), this.#t = _(), this.#n = _(), this.#s = _(), this.#e = null, this.#o = /* @__PURE__ */ new Map(), this.#i = x.getDefault(), this.#r = (t) => {
201
203
  t.stopPropagation(), this.cancelInterrupt();
202
204
  }, this.#a = (t) => {
203
205
  t.stopPropagation();
@@ -217,19 +219,19 @@ class Y extends R {
217
219
  t.stopPropagation();
218
220
  const e = t.detail;
219
221
  this.arcgisFeedback.emit(e);
220
- }, this.#p = (t) => {
222
+ }, this.#g = (t) => {
221
223
  t.stopPropagation();
222
224
  const e = t.detail;
223
225
  this._inputValue = e.prompt, this.arcgisPromptSelect.emit(e);
224
- }, this.#g = (t) => {
226
+ }, this.#p = (t) => {
225
227
  this.arcgisSlottableRequest.emit(t.detail);
226
- }, this._orchestratorController = null, this._interrupt = null, this._interruptDetails = [], this._error = null, this._inputValue = "", this._isAnswering = !1, this._canceling = !1, this.messages = new I([]), this.referenceElement = null, this.suggestedPrompts = [], this.feedbackEnabled = !1, this.keepSuggestedPrompts = !1, this.logEnabled = !1, this.copyEnabled = !1, this.voiceInputEnabled = !1, this.readAloudEnabled = !1, this.assistantAvatarEnabled = !1, this.arcgisCancel = g(), this.arcgisError = g(), this.arcgisFeedback = g(), this.arcgisInterrupt = g(), this.arcgisInterruptCancel = g(), this.arcgisInterruptSubmit = g(), this.arcgisPromptSelect = g(), this.arcgisReady = g(), this.arcgisSubmit = g(), this.arcgisSlottableRequest = g({ bubbles: !1, composed: !1 }), this.arcgisResponse = g();
228
+ }, this._orchestratorController = null, this._interrupt = null, this._interruptDetails = [], this._error = null, this._inputValue = "", this._isAnswering = !1, this._canceling = !1, this.messages = new C([]), this.referenceElement = null, this.suggestedPrompts = [], this.feedbackEnabled = !1, this.keepSuggestedPrompts = !1, this.logEnabled = !1, this.copyEnabled = !1, this.voiceInputEnabled = !1, this.readAloudEnabled = !1, this.assistantAvatarEnabled = !1, this.arcgisCancel = p(), this.arcgisError = p(), this.arcgisFeedback = p(), this.arcgisInterrupt = p(), this.arcgisInterruptCancel = p(), this.arcgisInterruptSubmit = p(), this.arcgisPromptSelect = p(), this.arcgisReady = p(), this.arcgisSubmit = p(), this.arcgisSlottableRequest = p({ bubbles: !1, composed: !1 }), this.arcgisResponse = p();
227
229
  }
228
230
  static {
229
- this.properties = { _orchestratorController: 16, _interrupt: 16, _interruptDetails: 16, _error: 16, _inputValue: 16, _isAnswering: 16, _canceling: 16, _user: 16, awaitingResponse: 32, awaitingResponseStep: 32, interrupt: 32, messages: 0, orchestrator: 32, entryMessage: 1, heading: 1, description: 1, referenceElement: 1, suggestedPrompts: 0, feedbackEnabled: 5, keepSuggestedPrompts: 5, logEnabled: 5, copyEnabled: 5, voiceInputEnabled: 5, readAloudEnabled: 5, assistantAvatarEnabled: 5 };
231
+ this.properties = { _orchestratorController: 16, _interrupt: 16, _interruptDetails: 16, _error: 16, _inputValue: 16, _isAnswering: 16, _signedInUserId: 16, _canceling: 16, _isSignedIn: 16, _user: 16, awaitingResponse: 32, awaitingResponseStep: 32, interrupt: 32, messages: 0, orchestrator: 32, entryMessage: 1, heading: 1, description: 1, referenceElement: 1, suggestedPrompts: 0, feedbackEnabled: 5, keepSuggestedPrompts: 5, logEnabled: 5, copyEnabled: 5, voiceInputEnabled: 5, readAloudEnabled: 5, assistantAvatarEnabled: 5 };
230
232
  }
231
233
  static {
232
- this.styles = z;
234
+ this.styles = q;
233
235
  }
234
236
  #t;
235
237
  #n;
@@ -242,14 +244,14 @@ class Y extends R {
242
244
  #l;
243
245
  #c;
244
246
  #h;
245
- #p;
246
247
  #g;
248
+ #p;
247
249
  async #d() {
248
250
  try {
249
251
  const t = V(this.el, this.referenceElement);
250
252
  await t?.componentOnReady();
251
253
  const e = [...this.#o.values()];
252
- return e.length ? (this._orchestratorController = new d({
254
+ return e.length ? (this._orchestratorController?.destroy(), this._orchestratorController = new d({
253
255
  agents: e,
254
256
  portal: this.#i,
255
257
  view: t?.view
@@ -258,6 +260,9 @@ class Y extends R {
258
260
  return this._error = t?.message ?? "Error initializing orchestrator.", O(this)(t), !1;
259
261
  }
260
262
  }
263
+ get _isSignedIn() {
264
+ return !!this.#i?.user || !!this._signedInUserId;
265
+ }
261
266
  get _user() {
262
267
  return this.#i?.user?.fullName || this.#i?.user?.username;
263
268
  }
@@ -315,14 +320,14 @@ class Y extends R {
315
320
  case "block-data": {
316
321
  if (s?.role !== "assistant" || s?.id !== n)
317
322
  break;
318
- const a = [...s.blocks ?? []], o = a[a.length - 1], { blockType: h, data: p } = r;
323
+ const a = [...s.blocks ?? []], o = a[a.length - 1], { blockType: h, data: g } = r;
319
324
  if (o?.type !== h || !o.isPending)
320
325
  break;
321
326
  if (h === "text") {
322
- const f = typeof o.data?.content == "string" ? o.data.content : "", u = typeof p?.content == "string" ? p.content : "";
327
+ const f = typeof o.data?.content == "string" ? o.data.content : "", u = typeof g?.content == "string" ? g.content : "";
323
328
  a[a.length - 1] = { ...o, data: { ...o.data, content: f + u } };
324
329
  } else
325
- a[a.length - 1] = { ...o, data: { ...o.data, ...p ?? {} } };
330
+ a[a.length - 1] = { ...o, data: { ...o.data, ...g ?? {} } };
326
331
  this.messages.splice(-1, 1, { ...s, blocks: a });
327
332
  break;
328
333
  }
@@ -382,8 +387,8 @@ class Y extends R {
382
387
  }
383
388
  loaded() {
384
389
  this.manager.onLifecycle(() => {
385
- this.#t.value?.addEventListener("arcgisPromptSelect", this.#p), this.#t.value?.addEventListener("arcgisSubmit", this.#l), this.#t.value?.addEventListener("arcgisCancel", this.#c), this.#t.value?.addEventListener("arcgisFeedback", this.#h);
386
- const t = x(() => !!this._interrupt && !!this.#s.value, () => {
390
+ this.#t.value?.addEventListener("arcgisPromptSelect", this.#g), this.#t.value?.addEventListener("arcgisSubmit", this.#l), this.#t.value?.addEventListener("arcgisCancel", this.#c), this.#t.value?.addEventListener("arcgisFeedback", this.#h);
391
+ const t = L(() => !!this._interrupt && !!this.#s.value, () => {
387
392
  const i = this.#s.value;
388
393
  i.removeEventListener("arcgisSubmit", this.#a), i.removeEventListener("arcgisCancel", this.#r), i.addEventListener("arcgisSubmit", this.#a, { once: !0 }), i.addEventListener("arcgisCancel", this.#r, { once: !0 });
389
394
  }), e = this.messages.on("after-add", (i) => {
@@ -395,36 +400,37 @@ class Y extends R {
395
400
  i ? this.arcgisReady.emit() : this._error && this.arcgisError.emit(new Error(this._error));
396
401
  });
397
402
  }), () => {
398
- t.remove(), e.remove(), this.#t.value?.removeEventListener("arcgisPromptSelect", this.#p), this.#s.value?.removeEventListener("arcgisSubmit", this.#a), this.#s.value?.removeEventListener("arcgisCancel", this.#r), this.#t.value?.removeEventListener("arcgisSubmit", this.#l), this.#t.value?.removeEventListener("arcgisCancel", this.#c), this.#t.value?.removeEventListener("arcgisFeedback", this.#h), this._orchestratorController?.destroy(), this._orchestratorController = null;
403
+ t.remove(), e.remove(), this.#t.value?.removeEventListener("arcgisPromptSelect", this.#g), this.#s.value?.removeEventListener("arcgisSubmit", this.#a), this.#s.value?.removeEventListener("arcgisCancel", this.#r), this.#t.value?.removeEventListener("arcgisSubmit", this.#l), this.#t.value?.removeEventListener("arcgisCancel", this.#c), this.#t.value?.removeEventListener("arcgisFeedback", this.#h), this._orchestratorController?.destroy(), this._orchestratorController = null;
399
404
  };
400
405
  });
401
406
  }
402
407
  _reset() {
403
- this._orchestratorController?.cancel(), this.#e?.abort(), this._interrupt = null, this.messages.removeAll(), this._error = null, this._inputValue = "";
408
+ this._orchestratorController?.cancel(), this.#e?.abort(), this._interrupt = null, this.messages.removeAll(), this._error = null, this._inputValue = "", this._signedInUserId = void 0;
404
409
  }
405
410
  _renderEntryMessage() {
406
- return !this._user ? this._renderSignInNotice() : this._error ? this._renderErrorNotice() : this.entryMessage ? this.messages.length > 0 ? null : l`<calcite-notice open kind=brand closable icon width=full><div slot=message>${this.entryMessage}</div></calcite-notice>` : l`<slot name=entry-message></slot>`;
411
+ return this._isSignedIn ? this._error ? this._renderErrorNotice() : this.entryMessage ? this.messages.length > 0 ? null : l`<calcite-notice open kind=brand closable icon width=full><div slot=message>${this.entryMessage}</div></calcite-notice>` : l`<slot name=entry-message></slot>` : this._renderSignInNotice();
407
412
  }
408
413
  _renderSignInNotice() {
409
414
  const t = this.#i;
410
415
  return l`<calcite-notice slot=entry-message open kind=brand icon width=full><div slot=message>You need to sign in to use the assistant chat.</div>${t ? l`<calcite-link slot=link @click=${async () => {
411
416
  try {
412
- await T.getCredential(t.url), this._error = null, await this.#d(), this.arcgisReady.emit();
417
+ const e = await N.getCredential(`${t.url}/sharing`);
418
+ this._signedInUserId = e.userId, this._error = null, this.requestUpdate(), await this.#d() ? this.arcgisReady.emit() : this._error && this.arcgisError.emit(new Error(this._error));
413
419
  } catch (e) {
414
- console.error("Error signing in:", e);
420
+ this._error = e?.message ?? "Error signing in.", this.arcgisError.emit(new Error(this._error)), M.log("error", this, "Error signing in:", { detail: { error: e } });
415
421
  }
416
422
  }} target=_blank title="Sign in to ArcGIS Online">Sign in</calcite-link>` : l`<div slot=link>No portal information available</div>`}</calcite-notice>`;
417
423
  }
418
424
  _renderErrorNotice() {
419
- return this._error ? l`<calcite-notice slot=entry-message open kind=brand icon width=full>${this._error === G ? l`<div slot=message>${U}</div><calcite-link slot=link .href=${W} target=_blank title="Learn about web map embeddings">Read more</calcite-link>` : l`<div slot=message>${this._error}</div>`}</calcite-notice>` : null;
425
+ return this._error ? l`<calcite-notice slot=entry-message open kind=brand icon width=full>${this._error === G ? l`<div slot=message>${W}</div><calcite-link slot=link .href=${Y} target=_blank title="Learn about web map embeddings">Read more</calcite-link>` : l`<div slot=message>${this._error}</div>`}</calcite-notice>` : null;
420
426
  }
421
427
  render() {
422
- return l`<calcite-panel .loading=${!this._orchestratorController && !this._error || this._orchestratorController?.loading} .heading=${this.heading ?? this._messages.assistantLabel} .description=${this.description} ${v(this.#t)}><slot name=header-actions-start slot=header-actions-start></slot><slot name=header-actions-end slot=header-actions-end></slot><div class="content-container"><arcgis-assistant-chat .loading=${this.awaitingResponse} .messages=${this.messages} .interrupt=${this._interrupt}><slot name=message-starter slot=message-starter></slot><slot name=messages slot=messages>${this.messages.map((t) => t.role === "assistant" ? l`<arcgis-assistant-message .message=${t} .feedbackEnabled=${this.feedbackEnabled} .logEnabled=${this.logEnabled} .copyEnabled=${this.copyEnabled} .readAloudEnabled=${this.readAloudEnabled} @arcgisSlottableRequest=${this.#g} .assistantAvatarEnabled=${this.assistantAvatarEnabled}>${t.blocks?.map((e, i) => l`<slot name=${w(t.id, i) ?? k} slot=${w(t.id, i) ?? k}><arcgis-assistant-message-block .block=${e}></arcgis-assistant-message-block></slot>`)}</arcgis-assistant-message>` : l`<arcgis-assistant-user-message .message=${t} .user=${this._user}></arcgis-assistant-user-message>`)}</slot>${this._interrupt ? l`<div slot=message-loading><div class="interrupt-waiting-message">waiting for user input...</div> // TODO: use t9n strings</div>` : l`<slot name=message-loading slot=message-loading><arcgis-assistant-message-loading .loading=${this.awaitingResponse} .loadingMessage=${this.awaitingResponseStep} .assistantAvatarEnabled=${this.assistantAvatarEnabled} .interrupts=${this._interruptDetails}></arcgis-assistant-message-loading></slot>`}</arcgis-assistant-chat></div>${this._interrupt ? l`<arcgis-assistant-interrupt slot=content-bottom .type=${this._interrupt.type} .message=${this._interrupt.message} .options=${this._interrupt.options} ${v(this.#s)}></arcgis-assistant-interrupt>` : this.suggestedPrompts?.length ? l`<div class="suggested-prompts-container" slot=content-bottom><arcgis-assistant-suggested-prompts class="suggested-prompts" .prompts=${this.suggestedPrompts}></arcgis-assistant-suggested-prompts></div>` : null}<div class="footer-container" slot=footer>${this._renderEntryMessage()}<slot name=chat-entry><arcgis-assistant-chat-entry .awaitingResponse=${this.awaitingResponse || this._isAnswering} .inputValue=${this._inputValue} .messages=${this.messages} .voiceInputEnabled=${this.voiceInputEnabled} .disabled=${this._canceling || !this._user || !!this._interrupt} ${v(this.#n)}><slot name=entry-actions-start slot=entry-actions-start></slot><slot name=entry-actions-end slot=entry-actions-end><calcite-button .iconStart=${this.awaitingResponse || this._isAnswering ? "circle-stop" : "send"} @click=${() => {
428
+ return l`<calcite-panel .loading=${!this._orchestratorController && !this._error || this._orchestratorController?.loading} .heading=${this.heading ?? this._messages.assistantLabel} .description=${this.description} ${v(this.#t)}><slot name=header-actions-start slot=header-actions-start></slot><slot name=header-actions-end slot=header-actions-end></slot><div class="content-container"><arcgis-assistant-chat .loading=${this.awaitingResponse} .messages=${this.messages} .interrupt=${this._interrupt}><slot name=message-starter slot=message-starter></slot><slot name=messages slot=messages>${this.messages.map((t) => t.role === "assistant" ? l`<arcgis-assistant-message .message=${t} .feedbackEnabled=${this.feedbackEnabled} .logEnabled=${this.logEnabled} .copyEnabled=${this.copyEnabled} .readAloudEnabled=${this.readAloudEnabled} @arcgisSlottableRequest=${this.#p} .assistantAvatarEnabled=${this.assistantAvatarEnabled}>${t.blocks?.map((e, i) => l`<slot name=${w(t.id, i) ?? k} slot=${w(t.id, i) ?? k}><arcgis-assistant-message-block .block=${e}></arcgis-assistant-message-block></slot>`)}</arcgis-assistant-message>` : l`<arcgis-assistant-user-message .message=${t} .user=${this._user}></arcgis-assistant-user-message>`)}</slot>${this._interrupt ? l`<div slot=message-loading><div class="interrupt-waiting-message">waiting for user input...</div></div>` : l`<slot name=message-loading slot=message-loading><arcgis-assistant-message-loading .loading=${this.awaitingResponse} .loadingMessage=${this.awaitingResponseStep} .assistantAvatarEnabled=${this.assistantAvatarEnabled} .interrupts=${this._interruptDetails}></arcgis-assistant-message-loading></slot>`}</arcgis-assistant-chat></div>${this._interrupt ? l`<slot name=interrupt><arcgis-assistant-interrupt slot=content-bottom .type=${this._interrupt.type} .message=${this._interrupt.message} .options=${this._interrupt.options} ${v(this.#s)}></arcgis-assistant-interrupt></slot>` : this.suggestedPrompts?.length ? l`<div class="suggested-prompts-container" slot=content-bottom><arcgis-assistant-suggested-prompts class="suggested-prompts" .prompts=${this.suggestedPrompts}></arcgis-assistant-suggested-prompts></div>` : null}<div class="footer-container" slot=footer>${this._renderEntryMessage()}<slot name=chat-entry><arcgis-assistant-chat-entry .awaitingResponse=${this.awaitingResponse || this._isAnswering} .inputValue=${this._inputValue} .messages=${this.messages} .voiceInputEnabled=${this.voiceInputEnabled} .disabled=${this._canceling || !this._isSignedIn || !!this._interrupt} ${v(this.#n)}><slot name=entry-actions-start slot=entry-actions-start></slot><slot name=entry-actions-end slot=entry-actions-end><calcite-button .iconStart=${this.awaitingResponse || this._isAnswering ? "circle-stop" : "send"} @click=${() => {
423
429
  this.#n.value?.submitMessage();
424
430
  }} round>${this.awaitingResponse || this._isAnswering ? this._messages.stopButtonLabel : this._messages.askButtonLabel}</calcite-button></slot></arcgis-assistant-chat-entry></slot><slot name=footer-content></slot></div></calcite-panel>`;
425
431
  }
426
432
  }
427
- $("arcgis-assistant", Y);
433
+ $("arcgis-assistant", J);
428
434
  export {
429
- Y as ArcgisAssistant
435
+ J as ArcgisAssistant
430
436
  };