@arcgis/portal-components 5.2.0-next.50 → 5.2.0-next.52

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,45 +1,45 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { c as ct } from "../../chunks/runtime.js";
3
- import { LitElement as mt, createEvent as dt } from "@arcgis/lumina";
4
- import { css as pt, render as gt, html as G } from "lit";
5
- import { createRef as M, ref as A } from "lit/directives/ref.js";
6
- import { u as ht } from "../../chunks/useT9n.js";
7
- import { a as T, t as ft, b as yt } from "../../chunks/functionalities.js";
8
- import { NodeInterrupt as J, Annotation as h, StateGraph as C, START as P, END as f } from "@langchain/langgraph/web";
9
- import { sendTraceMessage as g, invokeStructuredPrompt as b, sendUXSuggestion as E, createAgentRuntimeStateWithSharedState as N, createChatModel as D } from "@arcgis/ai-components/utils/index.js";
2
+ import { c as ut } from "../../chunks/runtime.js";
3
+ import { LitElement as ct, createEvent as pt } from "@arcgis/lumina";
4
+ import { css as dt, render as mt, html as M } from "lit";
5
+ import { createRef as G, ref as A } from "lit/directives/ref.js";
6
+ import { u as gt } from "../../chunks/useT9n.js";
7
+ import { a as T, t as ht, b as ft } from "../../chunks/functionalities.js";
8
+ import { NodeInterrupt as J, Annotation as h, StateGraph as C, START as N, END as f } from "@langchain/langgraph/web";
9
+ import { sendTraceMessage as g, invokeStructuredPrompt as b, sendUXSuggestion as $, createAgentRuntimeStateWithSharedState as P, createChatModel as E } from "@arcgis/ai-components/utils/index.js";
10
10
  import r from "zod";
11
- import { a as wt, c as bt, q as It } from "../../chunks/groups2.js";
12
- import xt from "@arcgis/core/identity/IdentityManager.js";
11
+ import { a as yt, c as wt, q as bt } from "../../chunks/groups2.js";
12
+ import vt from "@arcgis/core/identity/IdentityManager.js";
13
13
  import O from "@arcgis/core/request.js";
14
- import { ChatPromptTemplate as z } from "@langchain/core/prompts";
14
+ import { ChatPromptTemplate as D } from "@langchain/core/prompts";
15
15
  import { createAgent as U } from "langchain";
16
16
  import { tool as W } from "@langchain/core/tools";
17
- import { s as vt, a as St } from "../../chunks/item.js";
18
- import { Annotation as Gt } from "@langchain/langgraph";
19
- import { c as Mt, d as At, i as Tt, b as Ct, g as Pt } from "../../chunks/groups.js";
20
- const Y = (e) => {
21
- const { portal: t, user: s } = e ?? {};
22
- return !!e && !!t && !!s;
17
+ import { s as It, a as xt } from "../../chunks/item.js";
18
+ import { Annotation as St } from "@langchain/langgraph";
19
+ import { c as Mt, d as Gt, i as At, b as Tt, g as Ct } from "../../chunks/groups.js";
20
+ const Y = (s) => {
21
+ const { portal: t, user: e } = s ?? {};
22
+ return !!s && !!t && !!e;
23
23
  };
24
- function I(e) {
25
- if (!Y(e))
24
+ function v(s) {
25
+ if (!Y(s))
26
26
  throw new Error("Invalid context: PortalAssistantContext with portal and user is required.");
27
27
  }
28
- const Nt = (e) => e.map((t) => `"${t}"`).join(", "), qt = r.object({
28
+ const Nt = (s) => s.map((t) => `"${t}"`).join(", "), Pt = r.object({
29
29
  successMessage: r.string().default("")
30
- }), j = "portal-group-creation", V = "approveAddMembers", $t = async (e, t) => {
31
- if (e.intentParams.intent !== "addMembers")
30
+ }), V = "portal-group-creation", j = "approveAddMembers", kt = async (s, t) => {
31
+ if (s.intentParams.intent !== "addMembers")
32
32
  return {
33
33
  status: "success",
34
34
  outputMessage: "Use @mention usernames for the members you want to add."
35
35
  };
36
- const s = e.agentExecutionContext.sharedState.createdGroupId?.value;
37
- if (!s)
36
+ const e = s.agentExecutionContext.sharedState.createdGroupId?.value;
37
+ if (!e)
38
38
  return {
39
39
  status: "success",
40
40
  outputMessage: "Create a group first, then add members using @mention usernames."
41
41
  };
42
- const a = e.intentParams.memberInfo.memberIdentifiers.map((d) => d.trim()).filter(Boolean);
42
+ const a = s.intentParams.memberInfo.memberIdentifiers.map((d) => d.trim()).filter(Boolean);
43
43
  if (!a.length)
44
44
  return {
45
45
  status: "success",
@@ -50,22 +50,22 @@ const Nt = (e) => e.map((t) => `"${t}"`).join(", "), qt = r.object({
50
50
  ${a.map((d) => `- **@${d}**`).join(`
51
51
  `)}
52
52
 
53
- Do you want to continue?`, { hitlResponse: l } = t?.configurable ?? {};
54
- if (l?.agentId !== j || l.id !== V) {
53
+ Do you want to continue?`, { hitlResponse: u } = t?.configurable ?? {};
54
+ if (u?.agentId !== V || u.id !== j) {
55
55
  const d = {
56
- agentId: j,
57
- id: V,
56
+ agentId: V,
57
+ id: j,
58
58
  kind: "booleanChoice",
59
59
  message: i,
60
60
  metadata: {
61
61
  action: "addMembers",
62
- groupId: s,
62
+ groupId: e,
63
63
  members: [...a]
64
64
  }
65
65
  };
66
66
  throw new J(d);
67
67
  }
68
- if (l.payload !== !0)
68
+ if (u.payload !== !0)
69
69
  return {
70
70
  status: "success",
71
71
  outputMessage: "Okay, I cancelled adding members to the group."
@@ -74,24 +74,24 @@ Do you want to continue?`, { hitlResponse: l } = t?.configurable ?? {};
74
74
  { text: `Adding members ${Nt(a)}...`, agentName: "group-creation" },
75
75
  t
76
76
  );
77
- const u = t?.configurable?.context;
78
- I(u);
79
- const { result: c, error: n } = await wt(u.portal, s, a);
77
+ const l = t?.configurable?.context;
78
+ v(l);
79
+ const { result: c, error: n } = await yt(l.portal, e, a);
80
80
  if (n || !c)
81
81
  return {
82
82
  status: "success",
83
83
  outputMessage: "I could not add members to that group. Please confirm group access and user accounts, then try again."
84
84
  };
85
- const { addedUsernames: m, notAddedUsers: p } = c;
85
+ const { addedUsernames: p, notAddedUsers: m } = c;
86
86
  try {
87
87
  const y = (await b({
88
- promptText: kt,
89
- schema: qt,
88
+ promptText: qt,
89
+ schema: Pt,
90
90
  modelTier: "fast",
91
91
  inputVariables: {
92
- addedMembers: m.join(", "),
92
+ addedMembers: p.join(", "),
93
93
  notAddedMembers: JSON.stringify(
94
- p.map((v) => ({ username: v.username, reason: v.error.message }))
94
+ m.map((x) => ({ username: x.username, reason: x.error.message }))
95
95
  )
96
96
  }
97
97
  })).successMessage;
@@ -101,7 +101,7 @@ Do you want to continue?`, { hitlResponse: l } = t?.configurable ?? {};
101
101
  console.error("Error generating add-members success message:", d);
102
102
  }
103
103
  return {};
104
- }, kt = `
104
+ }, qt = `
105
105
  Write a concise, friendly success message for adding members to a group.
106
106
 
107
107
  Rules:
@@ -116,32 +116,32 @@ Added members:
116
116
 
117
117
  Not added members:
118
118
  {notAddedMembers}
119
- `, B = "portal-group-creation", Q = "approveCreateGroup", Et = r.object({
119
+ `, L = "portal-group-creation", B = "approveCreateGroup", zt = r.object({
120
120
  successMessage: r.string().default("")
121
- }), Dt = r.object({
121
+ }), $t = r.object({
122
122
  failureMessage: r.string().default("")
123
- }), zt = async (e, t) => {
124
- if (e.intentParams.intent !== "create")
123
+ }), Et = async (s, t) => {
124
+ if (s.intentParams.intent !== "create")
125
125
  return {
126
126
  status: "success",
127
127
  outputMessage: "Tell me the group title you want to use."
128
128
  };
129
- const s = e.intentParams.title.trim();
130
- if (!s)
129
+ const e = s.intentParams.title.trim();
130
+ if (!e)
131
131
  return {
132
132
  status: "success",
133
133
  outputMessage: "What title would you like for the new group?"
134
134
  };
135
- const a = `A group with the title **${s}** will be created. Do you want to continue?`, { hitlResponse: o } = t?.configurable;
136
- if (o?.agentId !== B || o.id !== Q) {
135
+ const a = `A group with the title **${e}** will be created. Do you want to continue?`, { hitlResponse: o } = t?.configurable;
136
+ if (o?.agentId !== L || o.id !== B) {
137
137
  const n = {
138
- agentId: B,
139
- id: Q,
138
+ agentId: L,
139
+ id: B,
140
140
  kind: "booleanChoice",
141
141
  message: a,
142
142
  metadata: {
143
143
  action: "createGroup",
144
- title: s,
144
+ title: e,
145
145
  access: "private"
146
146
  }
147
147
  };
@@ -150,54 +150,54 @@ Not added members:
150
150
  if (o.payload !== !0)
151
151
  return {
152
152
  status: "success",
153
- outputMessage: `Okay, I cancelled creating **${s}**.`
153
+ outputMessage: `Okay, I cancelled creating **${e}**.`
154
154
  };
155
- await g({ text: `Creating group "${s}"...`, agentName: "group-creation" }, t);
155
+ await g({ text: `Creating group "${e}"...`, agentName: "group-creation" }, t);
156
156
  const i = t?.configurable?.context;
157
- I(i);
158
- const { result: l, error: u } = await bt(i.portal, {
159
- title: s,
157
+ v(i);
158
+ const { result: u, error: l } = await wt(i.portal, {
159
+ title: e,
160
160
  access: "private"
161
161
  });
162
- if (u || !l) {
163
- const n = u?.message?.trim() || "No additional details were provided.";
162
+ if (l || !u) {
163
+ const n = l?.message?.trim() || "No additional details were provided.";
164
164
  try {
165
- const p = (await b({
166
- promptText: Rt,
167
- schema: Dt,
165
+ const m = (await b({
166
+ promptText: Ut,
167
+ schema: $t,
168
168
  modelTier: "fast",
169
169
  inputVariables: {
170
- groupTitle: s,
170
+ groupTitle: e,
171
171
  failureReason: n
172
172
  }
173
173
  })).failureMessage.trim();
174
- if (p)
174
+ if (m)
175
175
  return {
176
176
  status: "success",
177
- outputMessage: p
177
+ outputMessage: m
178
178
  };
179
- } catch (m) {
180
- console.error("Error generating create-group failure message:", m);
179
+ } catch (p) {
180
+ console.error("Error generating create-group failure message:", p);
181
181
  }
182
182
  return {
183
183
  status: "success",
184
184
  outputMessage: "I could not create that group. Please confirm your permissions and try again with the group title."
185
185
  };
186
186
  }
187
- const c = l.id;
187
+ const c = u.id;
188
188
  try {
189
- const m = (await b({
190
- promptText: Ut,
191
- schema: Et,
189
+ const p = (await b({
190
+ promptText: Dt,
191
+ schema: zt,
192
192
  modelTier: "fast",
193
193
  inputVariables: {
194
- groupTitle: s
194
+ groupTitle: e
195
195
  }
196
196
  })).successMessage.trim();
197
- if (m)
197
+ if (p)
198
198
  return {
199
199
  status: "success",
200
- outputMessage: m,
200
+ outputMessage: p,
201
201
  sharedStatePatch: { createdGroupId: { value: c } },
202
202
  createdGroupId: c
203
203
  };
@@ -205,7 +205,7 @@ Not added members:
205
205
  console.error("Error generating create-group success message:", n);
206
206
  }
207
207
  return {};
208
- }, Ut = `
208
+ }, Dt = `
209
209
  Write a concise, friendly success message after creating a portal group.
210
210
 
211
211
  Rules:
@@ -216,7 +216,7 @@ Rules:
216
216
 
217
217
  Group title:
218
218
  {groupTitle}
219
- `, Rt = `
219
+ `, Ut = `
220
220
  Write a concise, friendly failure message after an attempt to create a portal group.
221
221
 
222
222
  Rules:
@@ -231,12 +231,12 @@ Group title:
231
231
 
232
232
  Failure reason:
233
233
  {failureReason}
234
- `, x = (e) => {
235
- for (let t = e.length - 1; t >= 0; t -= 1) {
236
- const s = e[t];
237
- if (s.type !== "human")
234
+ `, I = (s) => {
235
+ for (let t = s.length - 1; t >= 0; t -= 1) {
236
+ const e = s[t];
237
+ if (e.type !== "human")
238
238
  continue;
239
- const a = s.content;
239
+ const a = e.content;
240
240
  if (typeof a == "string")
241
241
  return a;
242
242
  if (Array.isArray(a))
@@ -245,25 +245,25 @@ Failure reason:
245
245
  ).join(" ").trim();
246
246
  }
247
247
  return "";
248
- }, Ft = r.object({
248
+ }, Rt = r.object({
249
249
  intent: r.enum(["clarify", "create", "addMembers"]).default("clarify"),
250
250
  title: r.string().default(""),
251
251
  memberIdentifiers: r.array(r.string()).default([]),
252
252
  clarifyMessage: r.string().default("")
253
- }), Ot = async (e, t) => {
253
+ }), Ft = async (s, t) => {
254
254
  await g({ text: "Thinking about groups...", agentName: "group-creation" }, t);
255
- const s = x(e.agentExecutionContext.messages).trim(), a = await b({
256
- promptText: jt,
257
- schema: Ft,
255
+ const e = I(s.agentExecutionContext.messages).trim(), a = await b({
256
+ promptText: Ot,
257
+ schema: Rt,
258
258
  modelTier: "default",
259
- inputVariables: { userMessage: s }
260
- }), o = a.title.trim(), i = a.memberIdentifiers.filter(Boolean), l = a.clarifyMessage.trim(), u = a.intent === "create" && !!o, c = a.intent === "addMembers" && i.length > 0;
259
+ inputVariables: { userMessage: e }
260
+ }), o = a.title.trim(), i = a.memberIdentifiers.filter(Boolean), u = a.clarifyMessage.trim(), l = a.intent === "create" && !!o, c = a.intent === "addMembers" && i.length > 0;
261
261
  return {
262
- intentParams: u ? { intent: "create", title: o } : c ? { intent: "addMembers", memberInfo: { memberIdentifiers: i } } : { intent: "clarify" },
262
+ intentParams: l ? { intent: "create", title: o } : c ? { intent: "addMembers", memberInfo: { memberIdentifiers: i } } : { intent: "clarify" },
263
263
  status: "success",
264
- outputMessage: !u && !c ? l : ""
264
+ outputMessage: !l && !c ? u : ""
265
265
  };
266
- }, jt = `
266
+ }, Ot = `
267
267
  You classify whether a user is asking to create a new ArcGIS Portal group or add members to an existing group.
268
268
 
269
269
  Rules:
@@ -289,16 +289,25 @@ Examples:
289
289
 
290
290
  User message:
291
291
  {userMessage}
292
- `, Vt = r.discriminatedUnion("destinationType", [
293
- r.object({
294
- destinationType: r.literal("portal-content")
295
- }),
296
- r.object({
297
- destinationType: r.literal("portal-groups")
298
- }),
299
- r.object({
300
- destinationType: r.literal("portal-settings-security")
301
- }),
292
+ `, Vt = r.enum([
293
+ "portal-content",
294
+ "portal-content-favorites",
295
+ "portal-content-group",
296
+ "portal-content-living-atlas",
297
+ "portal-content-organization",
298
+ "portal-gallery",
299
+ "portal-groups",
300
+ "portal-groups-featured",
301
+ "portal-groups-my",
302
+ "portal-groups-organization",
303
+ "portal-map-viewer",
304
+ "portal-notebooks",
305
+ "portal-scene-viewer",
306
+ "portal-settings-security"
307
+ ]), jt = r.object({
308
+ destinationType: Vt
309
+ }), Lt = r.union([
310
+ jt,
302
311
  r.object({
303
312
  destinationType: r.literal("portal-item"),
304
313
  itemId: r.string().trim().min(1)
@@ -307,23 +316,23 @@ User message:
307
316
  destinationType: r.literal("portal-group"),
308
317
  groupId: r.string().trim().min(1)
309
318
  })
310
- ]), _ = "portal-navigation", R = async (e, t) => {
311
- const s = t?.configurable?.context;
312
- !Y(s) || !s.navigationTargetMap?.[e.destinationType] || await E({ type: _, data: { ...e } }, t);
313
- }, Bt = async (e, t) => {
314
- const s = e.createdGroupId ?? e.agentExecutionContext.sharedState.createdGroupId?.value;
315
- return s ? (await g({ text: "Preparing navigation...", agentName: "group-creation" }, t), await R({ destinationType: "portal-group", groupId: s }, t), {}) : {};
316
- }, L = (e, t) => t ?? e, H = h.Root({
317
- ...N(),
319
+ ]), _ = "portal-navigation", R = async (s, t) => {
320
+ const e = t?.configurable?.context;
321
+ !Y(e) || !e.navigationTargetMap?.[s.destinationType] || await $({ type: _, data: { ...s } }, t);
322
+ }, Bt = async (s, t) => {
323
+ const e = s.createdGroupId ?? s.agentExecutionContext.sharedState.createdGroupId?.value;
324
+ return e ? (await g({ text: "Preparing navigation...", agentName: "group-creation" }, t), await R({ destinationType: "portal-group", groupId: e }, t), {}) : {};
325
+ }, Q = (s, t) => t ?? s, H = h.Root({
326
+ ...P(),
318
327
  // * Shared state between nodes (but not persisted to the agent execution context)
319
328
  /** Parameters related to the user's intent for group creation actions */
320
- intentParams: h({ reducer: L, default: () => ({ intent: "clarify" }) }),
329
+ intentParams: h({ reducer: Q, default: () => ({ intent: "clarify" }) }),
321
330
  /** The ID of the group that was created
322
331
  * even though we already have this in the shared state
323
332
  * we still need it here to also share between nodes
324
333
  */
325
- createdGroupId: h({ reducer: L, default: () => "" })
326
- }), Qt = () => new C(H).addNode("detectGroupCreationIntent", Ot).addNode("createPortalGroup", zt).addNode("addMembersToPortalGroup", $t).addNode("suggestCreatedGroupNavigation", Bt).addEdge(P, "detectGroupCreationIntent").addConditionalEdges("detectGroupCreationIntent", (t) => {
334
+ createdGroupId: h({ reducer: Q, default: () => "" })
335
+ }), Qt = () => new C(H).addNode("detectGroupCreationIntent", Ft).addNode("createPortalGroup", Et).addNode("addMembersToPortalGroup", kt).addNode("suggestCreatedGroupNavigation", Bt).addEdge(N, "detectGroupCreationIntent").addConditionalEdges("detectGroupCreationIntent", (t) => {
327
336
  switch (t.intentParams.intent) {
328
337
  case "create":
329
338
  return "createPortalGroup";
@@ -332,80 +341,80 @@ User message:
332
341
  default:
333
342
  return f;
334
343
  }
335
- }).addEdge("createPortalGroup", "suggestCreatedGroupNavigation").addEdge("addMembersToPortalGroup", "suggestCreatedGroupNavigation").addEdge("suggestCreatedGroupNavigation", f), Lt = String.raw`- **portal-group-creation** - Portal group creation assistant:
344
+ }).addEdge("createPortalGroup", "suggestCreatedGroupNavigation").addEdge("addMembersToPortalGroup", "suggestCreatedGroupNavigation").addEdge("suggestCreatedGroupNavigation", f), Kt = String.raw`- **portal-group-creation** - Portal group creation assistant:
336
345
  - creates a new ArcGIS Portal group for the signed-in user
337
346
  - adds users to the newly created group using @mention usernames
338
- `, Kt = {
347
+ `, Jt = {
339
348
  id: "portal-group-creation",
340
349
  name: "Portal Group Creation",
341
- description: Lt,
350
+ description: Kt,
342
351
  createGraph: Qt,
343
352
  workspace: H
344
- }, X = "portalDocAssistantMemory", Jt = () => ({ conversationId: "" }), Wt = (e) => {
345
- const t = e?.[X]?.value;
353
+ }, X = "portalDocAssistantMemory", Wt = () => ({ conversationId: "" }), Yt = (s) => {
354
+ const t = s?.[X]?.value;
346
355
  if (!t || typeof t != "object")
347
- return Jt();
348
- const s = t;
356
+ return Wt();
357
+ const e = t;
349
358
  return {
350
- conversationId: typeof s.conversationId == "string" ? s.conversationId : ""
359
+ conversationId: typeof e.conversationId == "string" ? e.conversationId : ""
351
360
  };
352
- }, Yt = (e) => ({
353
- [X]: { value: e }
361
+ }, _t = (s) => ({
362
+ [X]: { value: s }
354
363
  });
355
- async function _t({
356
- portal: e,
364
+ async function Ht({
365
+ portal: s,
357
366
  question: t,
358
- persona: s,
367
+ persona: e,
359
368
  previousConversationId: a,
360
369
  signal: o,
361
370
  skillId: i
362
371
  }) {
363
372
  i ??= "doc_ai_assistant";
364
- const u = await Ht({
365
- portal: e,
373
+ const l = await Xt({
374
+ portal: s,
366
375
  skillId: i,
367
376
  message: t,
368
377
  options: { context: {
369
378
  kind: "DocAIAssistantRequest",
370
- filters: { persona: { persona: s } }
379
+ filters: { persona: { persona: e } }
371
380
  }, previousConversationId: a, signal: o }
372
381
  });
373
382
  return {
374
- reply: Xt(u, i),
375
- conversationId: u[0]?.conversationId ?? ""
383
+ reply: Zt(l, i),
384
+ conversationId: l[0]?.conversationId ?? ""
376
385
  };
377
386
  }
378
- async function Ht({
379
- portal: e,
387
+ async function Xt({
388
+ portal: s,
380
389
  skillId: t,
381
- message: s,
390
+ message: e,
382
391
  options: a
383
392
  }) {
384
- const i = `${e.helperServices.aiAssistantServices.url}/skills/${t}/chat`, l = {
393
+ const i = `${s.helperServices.aiAssistantServices.url}/skills/${t}/chat`, u = {
385
394
  "Content-Type": "application/json",
386
- token: xt.findCredential(e.url)?.token ?? ""
387
- }, u = await O(i, {
395
+ token: vt.findCredential(s.url)?.token ?? ""
396
+ }, l = await O(i, {
388
397
  method: "post",
389
398
  body: JSON.stringify({
390
- message: s,
399
+ message: e,
391
400
  context: a.context,
392
401
  conversationId: a.previousConversationId
393
402
  }),
394
- headers: l,
403
+ headers: u,
395
404
  signal: a.signal
396
405
  });
397
- if (u.httpStatus !== 200)
398
- throw new Error(`Doc assistant chat failed (${u.httpStatus})`, {
399
- cause: u.data
406
+ if (l.httpStatus !== 200)
407
+ throw new Error(`Doc assistant chat failed (${l.httpStatus})`, {
408
+ cause: l.data
400
409
  });
401
- const c = u.data, n = [c], { conversationId: m, inquiryId: p } = c, d = async (y, v) => {
402
- if (!v)
410
+ const c = l.data, n = [c], { conversationId: p, inquiryId: m } = c, d = async (y, x) => {
411
+ if (!x)
403
412
  return;
404
- await ft(1e3);
413
+ await ht(1e3);
405
414
  const w = await O(i, {
406
415
  method: "post",
407
- body: JSON.stringify({ conversationId: m, inquiryId: p, ackSequenceNumber: y }),
408
- headers: l,
416
+ body: JSON.stringify({ conversationId: p, inquiryId: m, ackSequenceNumber: y }),
417
+ headers: u,
409
418
  signal: a.signal
410
419
  });
411
420
  if (w.httpStatus !== 200)
@@ -417,13 +426,13 @@ async function Ht({
417
426
  };
418
427
  return c.hasMore && await d(c.sequenceNumber, c.hasMore), n;
419
428
  }
420
- function Xt(e, t) {
429
+ function Zt(s, t) {
421
430
  switch (t) {
422
431
  case "doc_chat":
423
- return e.find((s) => s.message != null)?.message ?? "";
432
+ return s.find((e) => e.message != null)?.message ?? "";
424
433
  case "doc_ai_assistant":
425
- for (let s = e.length - 1; s >= 0; s -= 1) {
426
- const a = e[s];
434
+ for (let e = s.length - 1; e >= 0; e -= 1) {
435
+ const a = s[e];
427
436
  if (a.context?.kind === "DocAIAssistantContext") {
428
437
  const o = a.context.results?.[0]?.reply;
429
438
  if (o)
@@ -435,19 +444,19 @@ function Xt(e, t) {
435
444
  return T(t);
436
445
  }
437
446
  }
438
- const Zt = async (e, t) => {
447
+ const te = async (s, t) => {
439
448
  await g({ text: "Asking documentation assistant...", agentName: "doc-assistant" }, t);
440
- const s = x(e.agentExecutionContext.messages).trim();
441
- if (!s)
449
+ const e = I(s.agentExecutionContext.messages).trim();
450
+ if (!e)
442
451
  return {
443
452
  status: "success",
444
453
  outputMessage: "Please share your question and I can help with ArcGIS and Portal documentation."
445
454
  };
446
455
  const a = t?.configurable?.context;
447
- I(a);
448
- const o = Wt(e.agentExecutionContext.sharedState), { reply: i, conversationId: l } = await _t({
456
+ v(a);
457
+ const o = Yt(s.agentExecutionContext.sharedState), { reply: i, conversationId: u } = await Ht({
449
458
  portal: a.portal,
450
- question: s,
459
+ question: e,
451
460
  previousConversationId: o.conversationId || void 0,
452
461
  skillId: "doc_ai_assistant",
453
462
  persona: "developers"
@@ -455,19 +464,19 @@ const Zt = async (e, t) => {
455
464
  return {
456
465
  status: "success",
457
466
  outputMessage: i.trim() || "I could not retrieve a response from the documentation assistant.",
458
- sharedStatePatch: Yt({
459
- conversationId: l || o.conversationId
467
+ sharedStatePatch: _t({
468
+ conversationId: u || o.conversationId
460
469
  })
461
470
  };
462
471
  }, Z = W(
463
- async ({ groupTitle: e }, t) => {
464
- const s = e.trim();
465
- if (!s)
472
+ async ({ groupTitle: s }, t) => {
473
+ const e = s.trim();
474
+ if (!e)
466
475
  return null;
467
476
  const a = t?.configurable?.context;
468
- I(a);
477
+ v(a);
469
478
  try {
470
- return (await It(a.portal, { query: `title:${s}`, num: 1 }))?.results[0]?.id || null;
479
+ return (await bt(a.portal, { query: `title:${e}`, num: 1 }))?.results[0]?.id || null;
471
480
  } catch (o) {
472
481
  return console.error("Error searching for portal group by title:", o), null;
473
482
  }
@@ -480,13 +489,13 @@ const Zt = async (e, t) => {
480
489
  })
481
490
  }
482
491
  ), tt = W(
483
- async ({ itemTitle: e }, t) => {
484
- const s = e.trim();
485
- if (!s)
492
+ async ({ itemTitle: s }, t) => {
493
+ const e = s.trim();
494
+ if (!e)
486
495
  return null;
487
496
  const a = t?.configurable?.context;
488
- I(a);
489
- const { result: o, error: i } = await vt(a.portal, s, { num: 1 });
497
+ v(a);
498
+ const { result: o, error: i } = await It(a.portal, e, { num: 1 });
490
499
  return i && console.error("Error searching for portal item by title:", i), o?.results[0]?.id || null;
491
500
  },
492
501
  {
@@ -502,6 +511,31 @@ const Zt = async (e, t) => {
502
511
  hints: ["My content", "Content"],
503
512
  scope: "root"
504
513
  },
514
+ "portal-content-favorites": {
515
+ description: "The My favorites view under Content in the portal.",
516
+ hints: ["My favorites", "Favorites", "Content favorites"],
517
+ scope: "collection"
518
+ },
519
+ "portal-content-group": {
520
+ description: "The My groups view under Content in the portal.",
521
+ hints: ["Content my groups", "My groups content", "Group content"],
522
+ scope: "collection"
523
+ },
524
+ "portal-content-living-atlas": {
525
+ description: "The Living Atlas view under Content in the portal.",
526
+ hints: ["Living Atlas", "Content Living Atlas"],
527
+ scope: "collection"
528
+ },
529
+ "portal-content-organization": {
530
+ description: "The My organization view under Content in the portal.",
531
+ hints: ["My organization content", "Organization content", "Content organization"],
532
+ scope: "collection"
533
+ },
534
+ "portal-gallery": {
535
+ description: "The gallery page of the portal.",
536
+ hints: ["Gallery", "Featured content", "Maps and apps"],
537
+ scope: "collection"
538
+ },
505
539
  "portal-group": {
506
540
  description: "A specific group page in the portal.",
507
541
  hints: ["Group", "group page"],
@@ -512,27 +546,56 @@ const Zt = async (e, t) => {
512
546
  hints: ["My groups", "Groups"],
513
547
  scope: "collection"
514
548
  },
549
+ "portal-groups-featured": {
550
+ description: "The Featured groups view under Groups in the portal.",
551
+ hints: ["Featured groups", "Groups featured"],
552
+ scope: "collection"
553
+ },
554
+ "portal-groups-my": {
555
+ description: "The My groups view under Groups in the portal.",
556
+ hints: ["My groups", "Groups my"],
557
+ scope: "collection"
558
+ },
559
+ "portal-groups-organization": {
560
+ description: "The My organization's groups view under Groups in the portal.",
561
+ hints: ["Organization's groups", "My organization's groups", "Groups organization"],
562
+ scope: "collection"
563
+ },
515
564
  "portal-item": {
516
565
  description: "A specific item page in the portal.",
517
566
  hints: ["Item", "item page"],
518
567
  scope: "entity"
519
568
  },
569
+ "portal-map-viewer": {
570
+ description: "The Map Viewer app of the portal.",
571
+ hints: ["Map Viewer", "Map", "Open map"],
572
+ scope: "entity"
573
+ },
574
+ "portal-notebooks": {
575
+ description: "The Notebooks home page of the portal.",
576
+ hints: ["Notebooks", "Notebook home", "My notebooks"],
577
+ scope: "collection"
578
+ },
579
+ "portal-scene-viewer": {
580
+ description: "The Scene Viewer app of the portal.",
581
+ hints: ["Scene Viewer", "Scene", "3D scene"],
582
+ scope: "entity"
583
+ },
520
584
  "portal-settings-security": {
521
585
  description: "The Organization > Settings > Security page of the portal.",
522
586
  hints: ["Organization settings", "Security", "Organization > Settings > Security"],
523
587
  scope: "entity"
524
588
  }
525
- }, st = yt(et), te = st.map((e) => {
526
- const { description: t, hints: s, scope: a } = et[e];
527
- return ` - ${e}: ${t} (scope: ${a}; hints: ${s.join(", ")})`;
528
- }).join(`
529
- `), ee = `
589
+ }, ee = ft(et), se = Object.entries(et).map(
590
+ ([s, { description: t, hints: e, scope: a }]) => ` - ${s}: ${t} (scope: ${a}; hints: ${e.join(", ")})`
591
+ ).join(`
592
+ `), ae = `
530
593
  You decide whether the assistant response should include a navigation action to ArcGIS Portal.
531
594
 
532
595
  Given the user question and assistant response:
533
596
  - Decide if a navigation action would help the user complete the task.
534
597
  - If yes, choose one destination type:
535
- ${te}
598
+ ${se}
536
599
 
537
600
  Rules:
538
601
  - Only suggest navigation when you are highly confident the destination will help complete the user's task.
@@ -557,81 +620,90 @@ Assistant response:
557
620
  {response}
558
621
  `, K = r.object({
559
622
  shouldSuggestNavigation: r.boolean().default(!1),
560
- destinationType: r.enum(["none", ...st]).default("none"),
623
+ destinationType: r.enum(["none", ...ee]).default("none"),
561
624
  itemId: r.string().default(""),
562
625
  groupId: r.string().default(""),
563
626
  confidence: r.number().min(0).max(1).default(0)
564
- }), se = async (e, t) => {
627
+ }), oe = async (s, t) => {
565
628
  await g({ text: "Extracting navigation intent...", agentName: "doc-assistant" }, t);
566
- const s = e.outputMessage.trim();
567
- if (!s)
629
+ const e = s.outputMessage.trim();
630
+ if (!e)
568
631
  return {};
569
- const a = x(e.agentExecutionContext.messages).trim(), o = await z.fromTemplate(ee).format({
632
+ const a = I(s.agentExecutionContext.messages).trim(), o = await D.fromTemplate(ae).format({
570
633
  question: a,
571
- response: s
572
- }), l = await U({
573
- model: await D({ modelTier: "default" }),
634
+ response: e
635
+ }), u = await U({
636
+ model: await E({ modelTier: "default" }),
574
637
  tools: [tt, Z],
575
638
  systemPrompt: o,
576
639
  responseFormat: K,
577
640
  checkpointer: !0
578
- }).invoke({ messages: e.agentExecutionContext.messages }, t), u = K.parse(l.structuredResponse ?? {});
579
- if (!u.shouldSuggestNavigation || u.destinationType === "none")
641
+ }).invoke({ messages: s.agentExecutionContext.messages }, t), l = K.parse(u.structuredResponse ?? {});
642
+ if (!l.shouldSuggestNavigation || l.destinationType === "none")
580
643
  return {};
581
- const c = ae(u);
644
+ const c = re(l);
582
645
  return c ? (await R(c, t), {}) : {};
583
646
  };
584
- function ae({
585
- destinationType: e,
647
+ function re({
648
+ destinationType: s,
586
649
  itemId: t,
587
- groupId: s
650
+ groupId: e
588
651
  }) {
589
- switch (e) {
652
+ switch (s) {
590
653
  case "portal-content":
591
- return { destinationType: "portal-content" };
654
+ case "portal-content-favorites":
655
+ case "portal-content-group":
656
+ case "portal-content-living-atlas":
657
+ case "portal-content-organization":
658
+ case "portal-gallery":
592
659
  case "portal-groups":
593
- return { destinationType: "portal-groups" };
660
+ case "portal-groups-featured":
661
+ case "portal-groups-my":
662
+ case "portal-groups-organization":
663
+ case "portal-map-viewer":
664
+ case "portal-notebooks":
665
+ case "portal-scene-viewer":
594
666
  case "portal-settings-security":
595
- return { destinationType: "portal-settings-security" };
667
+ return { destinationType: s };
596
668
  case "portal-item":
597
669
  return t ? { destinationType: "portal-item", itemId: t } : null;
598
670
  case "portal-group":
599
- return s ? { destinationType: "portal-group", groupId: s } : null;
671
+ return e ? { destinationType: "portal-group", groupId: e } : null;
600
672
  case "none":
601
673
  return null;
602
674
  default:
603
- return T(e);
675
+ return T(s);
604
676
  }
605
677
  }
606
- const at = Gt.Root({
607
- ...N()
608
- }), oe = () => new C(at).addNode("answerDocQuestion", Zt).addNode("extractNavigationIntent", se).addEdge(P, "answerDocQuestion").addEdge("answerDocQuestion", "extractNavigationIntent").addEdge("extractNavigationIntent", f), re = String.raw`- **portal-doc-assistant** - General ArcGIS documentation and Portal help assistant:
678
+ const st = St.Root({
679
+ ...P()
680
+ }), ne = () => new C(st).addNode("answerDocQuestion", te).addNode("extractNavigationIntent", oe).addEdge(N, "answerDocQuestion").addEdge("answerDocQuestion", "extractNavigationIntent").addEdge("extractNavigationIntent", f), ie = String.raw`- **portal-doc-assistant** - General ArcGIS documentation and Portal help assistant:
609
681
  - answers general ArcGIS, Portal, Enterprise, and JavaScript SDK questions
610
682
  - acts as a fallback when specialized agents are not applicable
611
- `, ne = {
683
+ `, le = {
612
684
  id: "portal-doc-assistant",
613
685
  name: "Portal Doc Assistant",
614
- description: re,
615
- createGraph: oe,
616
- workspace: at
617
- }, ot = `
686
+ description: ie,
687
+ createGraph: ne,
688
+ workspace: st
689
+ }, at = `
618
690
  Shared markdown formatting rules:
619
691
  - Use clear markdown headings (##) to separate sections.
620
692
  - Use concise bullet points for lists of facts, counts, or signals.
621
693
  - Emphasize key metrics with bold labels (for example: **Recent items:** 4).
622
694
  - Keep wording direct and analytical; avoid filler language but make sure the language is friendly.
623
695
  - Do not include raw internal IDs unless explicitly requested.
624
- `, ie = () => ({ latestGroupId: null, memory: {} }), q = (e) => {
625
- const t = e?.agentExecutionContext.sharedState.portalGroupSummaryMemory?.value;
626
- return t ? { latestGroupId: t.latestGroupId, memory: t.memory } : ie();
627
- }, ue = async (e, t) => {
696
+ `, ue = () => ({ latestGroupId: null, memory: {} }), k = (s) => {
697
+ const t = s?.agentExecutionContext.sharedState.portalGroupSummaryMemory?.value;
698
+ return t ? { latestGroupId: t.latestGroupId, memory: t.memory } : ue();
699
+ }, ce = async (s, t) => {
628
700
  await g({ text: "Answering group follow-up...", agentName: "group-analytics" }, t);
629
- const s = q(e), a = e.groupSummaryGroupId ?? s.latestGroupId, o = a ? s.memory[a] : void 0, i = e.groupSummaryQuestion || x(e.agentExecutionContext.messages);
701
+ const e = k(s), a = s.groupSummaryGroupId ?? e.latestGroupId, o = a ? e.memory[a] : void 0, i = s.groupSummaryQuestion || I(s.agentExecutionContext.messages);
630
702
  return o ? {
631
703
  status: "success",
632
704
  outputMessage: (await b({
633
- promptText: ce,
634
- schema: le,
705
+ promptText: de,
706
+ schema: pe,
635
707
  modelTier: "default",
636
708
  inputVariables: {
637
709
  summary: o.summary,
@@ -643,13 +715,13 @@ Shared markdown formatting rules:
643
715
  status: "success",
644
716
  outputMessage: "I do not have group analytics context yet. Ask me to analyze a group first with analyze group <group id>."
645
717
  };
646
- }, le = r.object({
718
+ }, pe = r.object({
647
719
  answer: r.string(),
648
720
  isRelevant: r.boolean()
649
- }), ce = `
721
+ }), de = `
650
722
  You answer follow-up questions about ArcGIS group analytics.
651
723
 
652
- ${ot}
724
+ ${at}
653
725
 
654
726
  Ground your answer in the provided group analytics summary and context.
655
727
  If the answer is not available from the provided context, state that clearly and suggest what to check next.
@@ -671,30 +743,30 @@ Group full context:
671
743
 
672
744
  Question:
673
745
  {question}
674
- `, me = async (e, t) => {
746
+ `, me = async (s, t) => {
675
747
  await g({ text: "Analyzing group-analytics intent...", agentName: "group-analytics" }, t);
676
- const s = x(e.agentExecutionContext.messages), a = !!q(e).latestGroupId, o = await z.fromTemplate(pe).format({
677
- userMessage: s,
748
+ const e = I(s.agentExecutionContext.messages), a = !!k(s).latestGroupId, o = await D.fromTemplate(he).format({
749
+ userMessage: e,
678
750
  hasAnalyticsContext: String(a)
679
- }), l = await U({
680
- model: await D({ modelTier: "fast" }),
751
+ }), u = await U({
752
+ model: await E({ modelTier: "fast" }),
681
753
  tools: [Z],
682
754
  systemPrompt: o,
683
- responseFormat: de,
755
+ responseFormat: ge,
684
756
  checkpointer: !0
685
- }).invoke({ messages: e.agentExecutionContext.messages }, t), { intent: u, groupId: c, question: n } = l.structuredResponse, m = u === "summarize" && !c, p = u === "followUp" && !(n ?? "").trim(), d = u === "clarify" || m || p;
757
+ }).invoke({ messages: s.agentExecutionContext.messages }, t), { intent: l, groupId: c, question: n } = u.structuredResponse, p = l === "summarize" && !c, m = l === "followUp" && !(n ?? "").trim(), d = l === "clarify" || p || m;
686
758
  return {
687
- groupSummaryIntent: d ? "clarify" : u,
759
+ groupSummaryIntent: d ? "clarify" : l,
688
760
  groupSummaryGroupId: c || null,
689
761
  groupSummaryQuestion: n || "",
690
762
  status: "success",
691
763
  outputMessage: d ? "Please clarify with a group id or title" : ""
692
764
  };
693
- }, de = r.object({
765
+ }, ge = r.object({
694
766
  intent: r.enum(["summarize", "followUp", "navigation", "clarify"]),
695
767
  groupId: r.string().default(""),
696
768
  question: r.string().default("")
697
- }), pe = `
769
+ }), he = `
698
770
  Classify the user's request for ArcGIS Portal group analytics.
699
771
 
700
772
  Rules:
@@ -723,35 +795,35 @@ hasAnalyticsContext:
723
795
 
724
796
  User message:
725
797
  {userMessage}
726
- `, ge = async (e, t) => {
727
- const s = q(e), a = e.groupSummaryGroupId ?? s.latestGroupId;
798
+ `, fe = async (s, t) => {
799
+ const e = k(s), a = s.groupSummaryGroupId ?? e.latestGroupId;
728
800
  return await g({ text: "Preparing navigation...", agentName: "group-analytics" }, t), await R(
729
801
  a ? { destinationType: "portal-group", groupId: a } : { destinationType: "portal-groups" },
730
802
  t
731
803
  ), { status: "success" };
732
804
  };
733
- function rt({ timestamp: e, now: t, windowMs: s }) {
734
- return e ? t - e <= s : !1;
805
+ function ot({ timestamp: s, now: t, windowMs: e }) {
806
+ return s ? t - s <= e : !1;
735
807
  }
736
- const he = 720 * 60 * 60 * 1e3;
737
- function fe(e) {
738
- const t = Mt(e);
808
+ const ye = 720 * 60 * 60 * 1e3;
809
+ function we(s) {
810
+ const t = Mt(s);
739
811
  return {
740
- id: e.id ?? "",
741
- title: e.title ?? "",
742
- description: e.description ?? "",
743
- snippet: e.snippet ?? "",
744
- access: e.access ?? null,
745
- owner: e.owner ?? "",
746
- tags: e.tags ?? [],
747
- created: e.created?.getTime(),
748
- modified: e.modified?.getTime(),
749
- isInvitationOnly: e.isInvitationOnly,
812
+ id: s.id ?? "",
813
+ title: s.title ?? "",
814
+ description: s.description ?? "",
815
+ snippet: s.snippet ?? "",
816
+ access: s.access ?? null,
817
+ owner: s.owner ?? "",
818
+ tags: s.tags ?? [],
819
+ created: s.created?.getTime(),
820
+ modified: s.modified?.getTime(),
821
+ isInvitationOnly: s.isInvitationOnly,
750
822
  sourceSignals: {
751
- capabilities: Pt(e),
752
- membershipAccess: Ct(e),
753
- isOpenData: Tt(e),
754
- isDistributedCollaborationGroup: At(e),
823
+ capabilities: Ct(s),
824
+ membershipAccess: Tt(s),
825
+ isOpenData: At(s),
826
+ isDistributedCollaborationGroup: Gt(s),
755
827
  orgId: t.orgId,
756
828
  hiddenMembers: t.hiddenMembers,
757
829
  isViewOnly: t.isViewOnly,
@@ -760,16 +832,16 @@ function fe(e) {
760
832
  }
761
833
  };
762
834
  }
763
- async function ye(e) {
764
- const t = { owner: e.owner ?? "", admins: [], users: [] };
835
+ async function be(s) {
836
+ const t = { owner: s.owner ?? "", admins: [], users: [] };
765
837
  try {
766
- return await e.fetchMembers();
767
- } catch (s) {
768
- return console.warn("Unable to fetch group members for analytics context", s), t;
838
+ return await s.fetchMembers();
839
+ } catch (e) {
840
+ return console.warn("Unable to fetch group members for analytics context", e), t;
769
841
  }
770
842
  }
771
- function we(e) {
772
- return e.map((t) => ({
843
+ function ve(s) {
844
+ return s.map((t) => ({
773
845
  id: t.id ?? "",
774
846
  title: t.title ?? "Untitled",
775
847
  type: t.type ?? "Unknown",
@@ -778,87 +850,87 @@ function we(e) {
778
850
  modified: t.modified?.getTime()
779
851
  }));
780
852
  }
781
- function be(e, t) {
782
- return e.filter(
783
- (s) => s.modified ? rt({ timestamp: s.modified, now: t, windowMs: he }) : !1
853
+ function Ie(s, t) {
854
+ return s.filter(
855
+ (e) => e.modified ? ot({ timestamp: e.modified, now: t, windowMs: ye }) : !1
784
856
  );
785
857
  }
786
- function Ie(e) {
858
+ function xe(s) {
787
859
  const t = /* @__PURE__ */ new Map();
788
- for (const s of e)
789
- t.set(s.type, (t.get(s.type) ?? 0) + 1);
790
- return [...t.entries()].sort((s, a) => a[1] - s[1] || s[0].localeCompare(a[0])).slice(0, 6).map(([s, a]) => ({ type: s, count: a }));
860
+ for (const e of s)
861
+ t.set(e.type, (t.get(e.type) ?? 0) + 1);
862
+ return [...t.entries()].sort((e, a) => a[1] - e[1] || e[0].localeCompare(a[0])).slice(0, 6).map(([e, a]) => ({ type: e, count: a }));
791
863
  }
792
- async function xe(e) {
793
- const t = await e.queryItems({ num: 20, sortField: "modified", sortOrder: "desc" }), s = we(t.results), a = Date.now();
864
+ async function Se(s) {
865
+ const t = await s.queryItems({ num: 20, sortField: "modified", sortOrder: "desc" }), e = ve(t.results), a = Date.now();
794
866
  return {
795
867
  total: t.total,
796
- topItems: s,
797
- recentlyModifiedItems: be(s, a),
798
- topItemTypes: Ie(s)
868
+ topItems: e,
869
+ recentlyModifiedItems: Ie(e, a),
870
+ topItemTypes: xe(e)
799
871
  };
800
872
  }
801
- async function ve(e, t) {
873
+ async function Me(s, t) {
802
874
  if (!t)
803
875
  return { error: { code: "missingGroupId", message: "Group id is required." } };
804
876
  try {
805
- const a = (await e.queryGroups({ query: `id:${t}`, num: 1 })).results[0];
877
+ const a = (await s.queryGroups({ query: `id:${t}`, num: 1 })).results[0];
806
878
  if (!a)
807
879
  return { error: { code: "groupNotFound", message: `No group found for id: ${t}` } };
808
- const o = fe(a), i = await ye(a), l = await xe(a);
809
- return { result: { group: o, members: i, items: l } };
810
- } catch (s) {
811
- return console.error("Error fetching portal group analytics context:", s), { error: { code: "unhandledError" } };
880
+ const o = we(a), i = await be(a), u = await Se(a);
881
+ return { result: { group: o, members: i, items: u } };
882
+ } catch (e) {
883
+ return console.error("Error fetching portal group analytics context:", e), { error: { code: "unhandledError" } };
812
884
  }
813
885
  }
814
- const Se = 2160 * 60 * 60 * 1e3, Ge = async (e, t) => {
815
- const s = e.groupSummaryGroupId;
816
- if (!s)
886
+ const Ge = 2160 * 60 * 60 * 1e3, Ae = async (s, t) => {
887
+ const e = s.groupSummaryGroupId;
888
+ if (!e)
817
889
  return {
818
890
  status: "success",
819
891
  outputMessage: 'Please clarify with analyze group <group id>, analyze group $<title>, or analyze group $"<title with spaces>".'
820
892
  };
821
- await g({ text: `Analyzing group ${s}...`, agentName: "group-analytics" }, t);
893
+ await g({ text: `Analyzing group ${e}...`, agentName: "group-analytics" }, t);
822
894
  const a = t?.configurable?.context;
823
- I(a);
824
- const { result: o, error: i } = await ve(a.portal, s);
895
+ v(a);
896
+ const { result: o, error: i } = await Me(a.portal, e);
825
897
  if (i || !o)
826
898
  return await g({ text: "Failed to fetch group context", agentName: "group-analytics" }, t), {
827
899
  status: "success",
828
900
  outputMessage: "Unable to retrieve group context for analytics."
829
901
  };
830
- const { group: l, items: u } = o, c = Date.now(), n = l.modified, m = n ? rt({ timestamp: n, now: c, windowMs: Se }) : !1, p = u.recentlyModifiedItems.length, d = p > 0, y = m || d, v = await b({
831
- promptText: Ae,
832
- schema: Me,
902
+ const { group: u, items: l } = o, c = Date.now(), n = u.modified, p = n ? ot({ timestamp: n, now: c, windowMs: Ge }) : !1, m = l.recentlyModifiedItems.length, d = m > 0, y = p || d, x = await b({
903
+ promptText: Ce,
904
+ schema: Te,
833
905
  modelTier: "default",
834
906
  inputVariables: {
835
907
  context: JSON.stringify(o),
836
908
  deterministicSignals: JSON.stringify({
837
909
  isGroupActive: y,
838
- isGroupRecentlyModified: m,
910
+ isGroupRecentlyModified: p,
839
911
  hasRecentlyAddedOrUpdatedContent: d,
840
- recentItemCount: p
912
+ recentItemCount: m
841
913
  })
842
914
  }
843
- }), { followUpQuestions: w, summary: S } = v, ut = q(e), lt = {
844
- latestGroupId: s,
915
+ }), { followUpQuestions: w, summary: S } = x, it = k(s), lt = {
916
+ latestGroupId: e,
845
917
  memory: {
846
- ...ut.memory,
847
- [s]: { summary: S, followUpQuestions: w, fullContext: o }
918
+ ...it.memory,
919
+ [e]: { summary: S, followUpQuestions: w, fullContext: o }
848
920
  }
849
921
  };
850
- return w.length && await E({ type: "suggested-prompts", data: { prompts: w } }, t), {
922
+ return w.length && await $({ type: "suggested-prompts", data: { prompts: w } }, t), {
851
923
  status: "success",
852
924
  outputMessage: S,
853
925
  sharedStatePatch: { portalGroupSummaryMemory: { value: lt } }
854
926
  };
855
- }, Me = r.object({
927
+ }, Te = r.object({
856
928
  summary: r.string(),
857
929
  followUpQuestions: r.array(r.string()).default([])
858
- }), Ae = `
930
+ }), Ce = `
859
931
  You summarize ArcGIS Portal groups based on structured context and deterministic activity signals.
860
932
 
861
- ${ot}
933
+ ${at}
862
934
 
863
935
  Output format requirements:
864
936
  - Return concise markdown with clear sections in this order:
@@ -894,45 +966,45 @@ Group context:
894
966
 
895
967
  Deterministic signals:
896
968
  {deterministicSignals}
897
- `, $ = (e, t) => t ?? e, nt = h.Root({
898
- ...N(),
969
+ `, q = (s, t) => t ?? s, rt = h.Root({
970
+ ...P(),
899
971
  groupSummaryIntent: h({
900
- reducer: $,
972
+ reducer: q,
901
973
  default: () => "clarify"
902
974
  }),
903
975
  groupSummaryGroupId: h({
904
- reducer: $,
976
+ reducer: q,
905
977
  default: () => null
906
978
  }),
907
979
  groupSummaryQuestion: h({
908
- reducer: $,
980
+ reducer: q,
909
981
  default: () => ""
910
982
  })
911
- }), Te = () => new C(nt).addNode("detectGroupSummaryIntent", me).addNode("summarizePortalGroup", Ge).addNode("answerGroupSummaryFollowUp", ue).addNode("suggestGroupSummaryNavigation", ge).addEdge(P, "detectGroupSummaryIntent").addConditionalEdges("detectGroupSummaryIntent", (t) => t.groupSummaryIntent === "summarize" ? "summarizePortalGroup" : t.groupSummaryIntent === "followUp" ? "answerGroupSummaryFollowUp" : t.groupSummaryIntent === "navigation" ? "suggestGroupSummaryNavigation" : f).addEdge("summarizePortalGroup", f).addEdge("answerGroupSummaryFollowUp", f).addEdge("suggestGroupSummaryNavigation", f), Ce = String.raw`- **portal-group-analytics** - Portal group analytics assistant:
983
+ }), Ne = () => new C(rt).addNode("detectGroupSummaryIntent", me).addNode("summarizePortalGroup", Ae).addNode("answerGroupSummaryFollowUp", ce).addNode("suggestGroupSummaryNavigation", fe).addEdge(N, "detectGroupSummaryIntent").addConditionalEdges("detectGroupSummaryIntent", (t) => t.groupSummaryIntent === "summarize" ? "summarizePortalGroup" : t.groupSummaryIntent === "followUp" ? "answerGroupSummaryFollowUp" : t.groupSummaryIntent === "navigation" ? "suggestGroupSummaryNavigation" : f).addEdge("summarizePortalGroup", f).addEdge("answerGroupSummaryFollowUp", f).addEdge("suggestGroupSummaryNavigation", f), Pe = String.raw`- **portal-group-analytics** - Portal group analytics assistant:
912
984
  - summarizes ArcGIS portal groups from group context and sourceJSON details
913
985
  - answers follow-up questions grounded in the summarized group
914
986
  - suggests navigation to groups when relevant
915
- `, Pe = {
987
+ `, ke = {
916
988
  id: "portal-group-analytics",
917
989
  name: "Portal Group Analytics",
918
- description: Ce,
919
- createGraph: Te,
920
- workspace: nt
921
- }, Ne = () => ({ latestItemId: null, memory: {} }), F = (e) => {
922
- const t = e?.agentExecutionContext.sharedState.portalItemAnalyticsSummaryMemory?.value;
923
- return t ? { latestItemId: t.latestItemId, memory: t.memory } : Ne();
924
- }, qe = r.object({
990
+ description: Pe,
991
+ createGraph: Ne,
992
+ workspace: rt
993
+ }, qe = () => ({ latestItemId: null, memory: {} }), F = (s) => {
994
+ const t = s?.agentExecutionContext.sharedState.portalItemAnalyticsSummaryMemory?.value;
995
+ return t ? { latestItemId: t.latestItemId, memory: t.memory } : qe();
996
+ }, ze = r.object({
925
997
  intent: r.enum(["summarize", "followUp", "clarify"]),
926
998
  itemId: r.string().default(""),
927
999
  question: r.string().default("")
928
- }), $e = r.object({ summary: r.string(), followUpQuestions: r.array(r.string()).default([]) }), ke = r.object({ answer: r.string(), isRelevant: r.boolean() }), Ee = async (e, t) => {
1000
+ }), $e = r.object({ summary: r.string(), followUpQuestions: r.array(r.string()).default([]) }), Ee = r.object({ answer: r.string(), isRelevant: r.boolean() }), De = async (s, t) => {
929
1001
  await g({ text: "Answering follow-up...", agentName: "analytics" }, t);
930
- const s = F(e), a = e.analyticsItemId ?? s.latestItemId, o = a ? s.memory[a] : void 0, i = e.analyticsQuestion || x(e.agentExecutionContext.messages);
1002
+ const e = F(s), a = s.analyticsItemId ?? e.latestItemId, o = a ? e.memory[a] : void 0, i = s.analyticsQuestion || I(s.agentExecutionContext.messages);
931
1003
  return o ? {
932
1004
  status: "success",
933
1005
  outputMessage: (await b({
934
- promptText: De,
935
- schema: ke,
1006
+ promptText: Ue,
1007
+ schema: Ee,
936
1008
  modelTier: "default",
937
1009
  inputVariables: {
938
1010
  summary: o.summary,
@@ -944,7 +1016,7 @@ Deterministic signals:
944
1016
  status: "success",
945
1017
  outputMessage: "I don't have enough information yet. Please ask me to summarize the item first using summarize item <item id>."
946
1018
  };
947
- }, De = `
1019
+ }, Ue = `
948
1020
  You answer follow-up questions about an ArcGIS item.
949
1021
 
950
1022
  Ground your answer in the provided item context.
@@ -964,27 +1036,27 @@ Item full context
964
1036
 
965
1037
  Question:
966
1038
  {question}
967
- `, ze = async (e, t) => {
1039
+ `, Re = async (s, t) => {
968
1040
  await g({ text: "Analyzing intent...", agentName: "analytics" }, t);
969
- const s = x(e.agentExecutionContext.messages), a = !!F(e).latestItemId, o = await z.fromTemplate(Ue).format({
970
- userMessage: s,
1041
+ const e = I(s.agentExecutionContext.messages), a = !!F(s).latestItemId, o = await D.fromTemplate(Fe).format({
1042
+ userMessage: e,
971
1043
  hasSummaryContext: String(a)
972
- }), l = await U({
973
- model: await D({ modelTier: "fast" }),
1044
+ }), u = await U({
1045
+ model: await E({ modelTier: "fast" }),
974
1046
  tools: [tt],
975
1047
  systemPrompt: o,
976
- responseFormat: qe,
1048
+ responseFormat: ze,
977
1049
  checkpointer: !0
978
- }).invoke({ messages: e.agentExecutionContext.messages }, t), { intent: u, itemId: c, question: n } = l.structuredResponse, d = u === "clarify" || u === "summarize" && !c || u === "followUp" && !n;
1050
+ }).invoke({ messages: s.agentExecutionContext.messages }, t), { intent: l, itemId: c, question: n } = u.structuredResponse, d = l === "clarify" || l === "summarize" && !c || l === "followUp" && !n;
979
1051
  return {
980
- agentExecutionContext: { ...e.agentExecutionContext },
981
- analyticsIntent: d ? "clarify" : u,
1052
+ agentExecutionContext: { ...s.agentExecutionContext },
1053
+ analyticsIntent: d ? "clarify" : l,
982
1054
  analyticsItemId: c || null,
983
1055
  analyticsQuestion: n || "",
984
1056
  status: "success",
985
1057
  outputMessage: d ? 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".' : ""
986
1058
  };
987
- }, Ue = `
1059
+ }, Fe = `
988
1060
  Classify the user analytics request.
989
1061
 
990
1062
  Rules:
@@ -1014,40 +1086,40 @@ hasSummaryContext:
1014
1086
 
1015
1087
  User message:
1016
1088
  {userMessage}
1017
- `, Re = async (e, t) => {
1018
- const s = e.analyticsItemId;
1019
- if (!s)
1089
+ `, Oe = async (s, t) => {
1090
+ const e = s.analyticsItemId;
1091
+ if (!e)
1020
1092
  return {
1021
1093
  status: "success",
1022
1094
  outputMessage: 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".'
1023
1095
  };
1024
- await g({ text: `Summarizing item ${s}...`, agentName: "analytics" }, t);
1096
+ await g({ text: `Summarizing item ${e}...`, agentName: "analytics" }, t);
1025
1097
  const a = t?.configurable?.context;
1026
- I(a);
1027
- const { portal: o, user: i } = a, { result: l, error: u } = await St(i, o, s);
1028
- if (u || !l)
1098
+ v(a);
1099
+ const { portal: o, user: i } = a, { result: u, error: l } = await xt(i, o, e);
1100
+ if (l || !u)
1029
1101
  return await g({ text: "Failed to get item context for summarization", agentName: "analytics" }, t), {
1030
1102
  status: "success",
1031
1103
  outputMessage: "Unable to retrieve item context for summarization."
1032
1104
  };
1033
- const { context: c } = l, n = await b({
1034
- promptText: Fe,
1105
+ const { context: c } = u, n = await b({
1106
+ promptText: Ve,
1035
1107
  schema: $e,
1036
1108
  modelTier: "default",
1037
1109
  inputVariables: { context: JSON.stringify(c) }
1038
- }), { followUpQuestions: m, summary: p } = n, d = F(e), y = {
1039
- latestItemId: s,
1110
+ }), { followUpQuestions: p, summary: m } = n, d = F(s), y = {
1111
+ latestItemId: e,
1040
1112
  memory: {
1041
1113
  ...d.memory,
1042
- [s]: { summary: p, followUpQuestions: m, fullContext: c }
1114
+ [e]: { summary: m, followUpQuestions: p, fullContext: c }
1043
1115
  }
1044
1116
  };
1045
- return m.length && await E({ type: "suggested-prompts", data: { prompts: m } }, t), {
1117
+ return p.length && await $({ type: "suggested-prompts", data: { prompts: p } }, t), {
1046
1118
  status: "success",
1047
- outputMessage: p,
1119
+ outputMessage: m,
1048
1120
  sharedStatePatch: { portalItemAnalyticsSummaryMemory: { value: y } }
1049
1121
  };
1050
- }, Fe = `
1122
+ }, Ve = `
1051
1123
  You are a item summary tool for ArcGIS. Your job is to summarize an item's info based on the provided context.
1052
1124
  Summary rules:
1053
1125
  - The summary should be concise markdown, make sure to format the output nicely so it's easy to read.
@@ -1062,110 +1134,145 @@ Do not include internal identifiers.
1062
1134
  If the user asks for a detailed summary, you may expand the response up to 300 words.
1063
1135
  Item context:
1064
1136
  {context}
1065
- `, k = (e, t) => t ?? e, it = h.Root({
1066
- ...N(),
1137
+ `, z = (s, t) => t ?? s, nt = h.Root({
1138
+ ...P(),
1067
1139
  // States shared only across nodes in the graph, not between invocations
1068
1140
  analyticsIntent: h({
1069
- reducer: k,
1141
+ reducer: z,
1070
1142
  default: () => "clarify"
1071
1143
  }),
1072
1144
  analyticsItemId: h({
1073
- reducer: k,
1145
+ reducer: z,
1074
1146
  default: () => null
1075
1147
  }),
1076
1148
  analyticsQuestion: h({
1077
- reducer: k,
1149
+ reducer: z,
1078
1150
  default: () => ""
1079
1151
  })
1080
- }), Oe = () => new C(it).addNode("detectAnalyticsIntent", ze).addNode("summarizePortalItem", Re).addNode("answerAnalyticsFollowUp", Ee).addEdge(P, "detectAnalyticsIntent").addConditionalEdges("detectAnalyticsIntent", (t) => t.analyticsIntent === "summarize" ? "summarizePortalItem" : t.analyticsIntent === "followUp" ? "answerAnalyticsFollowUp" : f).addEdge("summarizePortalItem", f).addEdge("answerAnalyticsFollowUp", f), je = String.raw`- **portal-item-analytics** - Portal item analytics assistant:
1081
- - summarizes ArcGIS portal items from item context
1082
- - suggests follow-up prompts grounded in the item
1083
- `, Ve = {
1152
+ }), je = () => new C(nt).addNode("detectAnalyticsIntent", Re).addNode("summarizePortalItem", Oe).addNode("answerAnalyticsFollowUp", De).addEdge(N, "detectAnalyticsIntent").addConditionalEdges("detectAnalyticsIntent", (t) => t.analyticsIntent === "summarize" ? "summarizePortalItem" : t.analyticsIntent === "followUp" ? "answerAnalyticsFollowUp" : f).addEdge("summarizePortalItem", f).addEdge("answerAnalyticsFollowUp", f), Le = String.raw`- **portal-item-analytics** - Portal item analytics assistant:
1153
+ - answers questions about one specific ArcGIS portal item when item context is present
1154
+ - summarizes item details, metadata, and context grounded in that item
1155
+ - suggests follow-up prompts grounded in the same item
1156
+ - use for item-specific requests, not for gallery browsing, featured content, or opening Map Viewer
1157
+ `, Be = {
1084
1158
  id: "portal-item-analytics",
1085
1159
  name: "Portal Item Analytics",
1086
- description: je,
1087
- createGraph: Oe,
1088
- workspace: it
1089
- }, Be = pt`:host{height:100%;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);display:block;width:100%;--tw-shadow: 0 1px 6px -1px rgba(0, 0, 0, .16), 0 1px 2px -1px rgba(0, 0, 0, .08);--tw-shadow-colored: 0 1px 6px -1px var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.chat-entry{display:flex;flex-direction:column;gap:.75rem;width:100%}.chat-actions{display:flex;justify-content:flex-end;gap:.5rem}.header-actions{display:flex;gap:.5rem;padding-inline-start:.75rem}.navigation-block{display:flex;flex-direction:column;align-items:stretch;gap:.35rem;margin-top:.5rem}.navigation-button{width:100%;margin-block:.25rem}.navigation-block-description{font-size:.75rem;color:var(--calcite-color-text-3)}`;
1090
- function Qe(e, t) {
1160
+ description: Le,
1161
+ createGraph: je,
1162
+ workspace: nt
1163
+ }, Qe = dt`:host{height:100%;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);display:block;width:100%;--tw-shadow: 0 1px 6px -1px rgba(0, 0, 0, .16), 0 1px 2px -1px rgba(0, 0, 0, .08);--tw-shadow-colored: 0 1px 6px -1px var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.chat-entry{display:flex;flex-direction:column;gap:.75rem;width:100%}.chat-actions{display:flex;justify-content:flex-end;gap:.5rem}.header-actions{display:flex;gap:.5rem;padding-inline-start:.75rem}.navigation-block{display:flex;flex-direction:column;align-items:stretch;gap:.35rem;margin-top:.5rem}.navigation-button{width:100%;margin-block:.25rem}.navigation-block-description{font-size:.75rem;color:var(--calcite-color-text-3)}`;
1164
+ function Ke(s, t) {
1091
1165
  if (!t)
1092
1166
  return;
1093
- const { destinationType: s } = e;
1094
- switch (s) {
1167
+ const { destinationType: e } = s;
1168
+ switch (e) {
1095
1169
  case "portal-content":
1170
+ case "portal-content-favorites":
1171
+ case "portal-content-group":
1172
+ case "portal-content-living-atlas":
1173
+ case "portal-content-organization":
1174
+ case "portal-gallery":
1096
1175
  case "portal-groups":
1176
+ case "portal-groups-featured":
1177
+ case "portal-groups-my":
1178
+ case "portal-groups-organization":
1179
+ case "portal-map-viewer":
1180
+ case "portal-notebooks":
1181
+ case "portal-scene-viewer":
1097
1182
  case "portal-settings-security":
1098
- return t[s];
1183
+ return t[e];
1099
1184
  case "portal-item":
1100
- return t[s]?.(e.itemId);
1185
+ return t[e]?.(s.itemId);
1101
1186
  case "portal-group":
1102
- return t[s]?.(e.groupId);
1187
+ return t[e]?.(s.groupId);
1103
1188
  default:
1104
- return T(s);
1189
+ return T(e);
1105
1190
  }
1106
1191
  }
1107
- function Le(e) {
1108
- const t = Vt.safeParse(e);
1192
+ function Je(s) {
1193
+ const t = Lt.safeParse(s);
1109
1194
  return t.success ? t.data : void 0;
1110
1195
  }
1111
- class Ke extends mt {
1196
+ class We extends ct {
1112
1197
  constructor() {
1113
- super(...arguments), this.t9n = ht({ blocking: !0 }), this.assistantEl = M(), this.formEl = M(), this.voiceInputEl = M(), this.inputEl = M(), this.navigationSlotElements = /* @__PURE__ */ new Map(), this.handleSlottableRequest = (t) => {
1114
- const s = t.detail, a = s.data?.block;
1198
+ super(...arguments), this.t9n = gt({ blocking: !0 }), this.assistantEl = G(), this.formEl = G(), this.voiceInputEl = G(), this.inputEl = G(), this.navigationSlotElements = /* @__PURE__ */ new Map(), this.handleSlottableRequest = (t) => {
1199
+ const e = t.detail, a = e.data?.block;
1115
1200
  if (!a)
1116
1201
  return;
1117
1202
  const o = this.getNavigationAction(a);
1118
- o && this.upsertNavigationSlotElement(s.slotName, o);
1119
- }, this.inputText = "", this.showVoiceInput = !0, this.isListening = !1, this.isVoiceInputDisabled = !1, this.interrupt = null, this.autoDestroyDisabled = !1, this.defaultClosed = !1, this.arcgisPortalNavigationRequest = dt();
1203
+ o && this.upsertNavigationSlotElement(e.slotName, o);
1204
+ }, this.inputText = "", this.showVoiceInput = !0, this.isListening = !1, this.isVoiceInputDisabled = !1, this.interrupt = null, this.autoDestroyDisabled = !1, this.defaultClosed = !1, this.arcgisPortalNavigationRequest = pt();
1120
1205
  }
1121
1206
  static {
1122
1207
  this.properties = { inputText: 16, showVoiceInput: 16, isListening: 16, isVoiceInputDisabled: 16, interrupt: 16, autoDestroyDisabled: 5, portal: 0, user: 0, config: 0, navigationTargetMap: 0, defaultClosed: 5 };
1123
1208
  }
1124
1209
  static {
1125
- this.styles = Be;
1210
+ this.styles = Qe;
1126
1211
  }
1127
1212
  getNavigationAction(t) {
1128
1213
  if (t?.type !== _)
1129
1214
  return;
1130
- const s = Le(t.data);
1131
- if (!s)
1215
+ const e = Je(t.data);
1216
+ if (!e)
1132
1217
  return;
1133
- const a = Qe(s, this.navigationTargetMap);
1218
+ const a = Ke(e, this.navigationTargetMap);
1134
1219
  if (a)
1135
- return { href: a, targetDetail: s, label: this.getNavigationText(s.destinationType) };
1220
+ return { href: a, targetDetail: e, label: this.getNavigationText(e.destinationType) };
1136
1221
  }
1137
- upsertNavigationSlotElement(t, s) {
1222
+ upsertNavigationSlotElement(t, e) {
1138
1223
  const a = this.assistantEl.value;
1139
1224
  if (!a)
1140
1225
  return;
1141
1226
  let o = this.navigationSlotElements.get(t);
1142
- o || (o = document.createElement("div"), o.slot = t, this.navigationSlotElements.set(t, o), a.append(o)), gt(G`<div><calcite-button class="navigation-button" appearance=outline width=full .href=${s.href} icon-end=launch @click=${(i) => {
1227
+ o || (o = document.createElement("div"), o.slot = t, this.navigationSlotElements.set(t, o), a.append(o)), mt(M`<div><calcite-button class="navigation-button" appearance=outline width=full .href=${e.href} icon-end=launch @click=${(i) => {
1143
1228
  i.preventDefault(), this.arcgisPortalNavigationRequest.emit({
1144
- href: s.href,
1145
- targetDetail: s.targetDetail
1229
+ href: e.href,
1230
+ targetDetail: e.targetDetail
1146
1231
  });
1147
- }}>${s.label}</calcite-button>${s.description ? G`<div class="navigation-block-description">${s.description}</div>` : null}</div>`, o);
1232
+ }}>${e.label}</calcite-button>${e.description ? M`<div class="navigation-block-description">${e.description}</div>` : null}</div>`, o);
1148
1233
  }
1149
1234
  getNavigationText(t) {
1150
- const s = this.t9n.navigation;
1235
+ const e = this.t9n.navigation;
1151
1236
  switch (t) {
1152
1237
  case "portal-content":
1153
- return s.openContent;
1238
+ return e.openContent;
1239
+ case "portal-content-favorites":
1240
+ return e.openContentFavorites;
1241
+ case "portal-content-group":
1242
+ return e.openContentGroup;
1243
+ case "portal-content-living-atlas":
1244
+ return e.openContentLivingAtlas;
1245
+ case "portal-content-organization":
1246
+ return e.openContentOrganization;
1247
+ case "portal-gallery":
1248
+ return e.openGallery;
1154
1249
  case "portal-groups":
1155
- return s.openGroups;
1250
+ return e.openGroups;
1251
+ case "portal-groups-featured":
1252
+ return e.openGroupsFeatured;
1253
+ case "portal-groups-my":
1254
+ return e.openGroupsMy;
1255
+ case "portal-groups-organization":
1256
+ return e.openGroupsOrganization;
1257
+ case "portal-map-viewer":
1258
+ return e.openMapViewer;
1259
+ case "portal-notebooks":
1260
+ return e.openNotebooks;
1261
+ case "portal-scene-viewer":
1262
+ return e.openSceneViewer;
1156
1263
  case "portal-settings-security":
1157
- return s.openOrganizationSettingsSecurity;
1264
+ return e.openOrganizationSettingsSecurity;
1158
1265
  case "portal-item":
1159
- return s.openItem;
1266
+ return e.openItem;
1160
1267
  case "portal-group":
1161
- return s.openGroup;
1268
+ return e.openGroup;
1162
1269
  default:
1163
1270
  return T(t);
1164
1271
  }
1165
1272
  }
1166
1273
  render() {
1167
- const { t9n: t, inputText: s, portal: a, user: o, navigationTargetMap: i, showVoiceInput: l, isListening: u, isVoiceInputDisabled: c } = this;
1168
- return G`<arcgis-assistant log-enabled keep-suggested-prompts .heading=${t.heading} .entryMessage=${t.entryMessage} @arcgisSlottableRequest=${this.handleSlottableRequest} @arcgisInterrupt=${({ detail: n }) => {
1274
+ const { t9n: t, inputText: e, portal: a, user: o, navigationTargetMap: i, showVoiceInput: u, isListening: l, isVoiceInputDisabled: c } = this;
1275
+ return M`<arcgis-assistant log-enabled keep-suggested-prompts .heading=${t.heading} .entryMessage=${t.entryMessage} @arcgisSlottableRequest=${this.handleSlottableRequest} @arcgisInterrupt=${({ detail: n }) => {
1169
1276
  this.interrupt = n;
1170
1277
  }} @arcgisInterruptCancel=${() => {
1171
1278
  this.interrupt = null;
@@ -1177,9 +1284,9 @@ class Ke extends mt {
1177
1284
  });
1178
1285
  }} ${A(this.assistantEl)}><div slot=header-actions-start class="header-actions"><calcite-icon icon=effects></calcite-icon></div><form slot=chat-entry class="chat-entry" @submit=${(n) => {
1179
1286
  n.preventDefault();
1180
- const m = s.trim();
1181
- m && (this.assistantEl.value?.submitMessage(m), this.inputText = "");
1182
- }} ${A(this.formEl)}><arcgis-portal-mentionable-text-area .portal=${a} .user=${o} rows=3 .popoverListLabel=${t.mentionEntities} .placeholder=${t.placeholder} .value=${s} @arcgisUserMentionableTextAreaKeyDown=${({ detail: n }) => {
1287
+ const p = e.trim();
1288
+ p && (this.assistantEl.value?.submitMessage(p), this.inputText = "");
1289
+ }} ${A(this.formEl)}><arcgis-portal-mentionable-text-area .portal=${a} .user=${o} rows=3 .popoverListLabel=${t.mentionEntities} .placeholder=${t.placeholder} .value=${e} @arcgisUserMentionableTextAreaKeyDown=${({ detail: n }) => {
1183
1290
  n.key === "Enter" && !n.shiftKey && (n.preventDefault(), this.formEl.value?.requestSubmit());
1184
1291
  }} @arcgisUserMentionableTextAreaChange=${({ detail: n }) => {
1185
1292
  this.inputText = n ?? "";
@@ -1191,18 +1298,18 @@ class Ke extends mt {
1191
1298
  n.detail.errorCode === "not-supported" && (this.showVoiceInput = !1);
1192
1299
  }} @arcgisVoiceInputInterimTranscription=${(n) => {
1193
1300
  this.inputText = n.detail.text;
1194
- }} ${A(this.voiceInputEl)}></arcgis-portal-voice-input>${l && G`<calcite-button icon-start=microphone .label=${t.voiceInput} round .disabled=${c} .appearance=${u ? "solid" : "outline-fill"} @click=${async () => {
1301
+ }} ${A(this.voiceInputEl)}></arcgis-portal-voice-input>${u && M`<calcite-button icon-start=microphone .label=${t.voiceInput} round .disabled=${c} .appearance=${l ? "solid" : "outline-fill"} @click=${async () => {
1195
1302
  this.isVoiceInputDisabled = !0;
1196
1303
  const n = this.voiceInputEl.value;
1197
- u ? await n?.stopListening() : await n?.startListening();
1198
- }}></calcite-button>` || ""}<calcite-button type=submit icon-start=send round .disabled=${!s.trim()} .label=${t.send}>${t.send}</calcite-button></div></form><arcgis-assistant-agent .agent=${Ve} .context=${{ portal: a, user: o, navigationTargetMap: i }}></arcgis-assistant-agent><arcgis-assistant-agent .agent=${Kt} .context=${{ portal: a, user: o, navigationTargetMap: i }}></arcgis-assistant-agent><arcgis-assistant-agent .agent=${ne} .context=${{ portal: a, user: o, navigationTargetMap: i }}></arcgis-assistant-agent><arcgis-assistant-agent .agent=${Pe} .context=${{ portal: a, user: o, navigationTargetMap: i }}></arcgis-assistant-agent>${this.interrupt && G`<arcgis-portal-ai-assistant-interrupt slot=interrupt .type=${this.interrupt.type} .message=${this.interrupt.message} .options=${this.interrupt.options} @arcgisSubmit=${({ detail: n }) => {
1304
+ l ? await n?.stopListening() : await n?.startListening();
1305
+ }}></calcite-button>` || ""}<calcite-button type=submit icon-start=send round .disabled=${!e.trim()} .label=${t.send}>${t.send}</calcite-button></div></form><arcgis-assistant-agent .agent=${Be} .context=${{ portal: a, user: o, navigationTargetMap: i }}></arcgis-assistant-agent><arcgis-assistant-agent .agent=${Jt} .context=${{ portal: a, user: o, navigationTargetMap: i }}></arcgis-assistant-agent><arcgis-assistant-agent .agent=${le} .context=${{ portal: a, user: o, navigationTargetMap: i }}></arcgis-assistant-agent><arcgis-assistant-agent .agent=${ke} .context=${{ portal: a, user: o, navigationTargetMap: i }}></arcgis-assistant-agent>${this.interrupt && M`<arcgis-portal-ai-assistant-interrupt slot=interrupt .type=${this.interrupt.type} .message=${this.interrupt.message} .options=${this.interrupt.options} @arcgisSubmit=${({ detail: n }) => {
1199
1306
  this.assistantEl.value?.submitInterrupt(n);
1200
1307
  }} @arcgisCancel=${() => {
1201
1308
  this.assistantEl.value?.cancelInterrupt();
1202
1309
  }}></arcgis-portal-ai-assistant-interrupt>` || ""}</arcgis-assistant>`;
1203
1310
  }
1204
1311
  }
1205
- ct("arcgis-portal-ai-assistant", Ke);
1312
+ ut("arcgis-portal-ai-assistant", We);
1206
1313
  export {
1207
- Ke as ArcgisPortalAiAssistant
1314
+ We as ArcgisPortalAiAssistant
1208
1315
  };