@esri/solutions-components 5.1.0-next.146 → 5.1.0-next.148

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 (107) hide show
  1. package/dist/cdn/{BQE6IVEF.js → 3A2YSBVB.js} +1 -1
  2. package/dist/cdn/{QKJJHBMB.js → 42GXADY4.js} +1 -1
  3. package/dist/cdn/{L3UI7EZZ.js → 4DAGSZIC.js} +1 -1
  4. package/dist/cdn/{ULUJKWT5.js → 4FRYNYQ6.js} +1 -1
  5. package/dist/cdn/4RJURJQ5.js +2 -0
  6. package/dist/cdn/{7CLM77HQ.js → 4SBOBTOR.js} +1 -1
  7. package/dist/cdn/{CVRBLJ5O.js → 5MPDXVRM.js} +1 -1
  8. package/dist/cdn/{MPCJZCL5.js → 5O7LFBHI.js} +2 -2
  9. package/dist/cdn/{7ADKNWWI.js → 6AUKNSKW.js} +1 -1
  10. package/dist/cdn/{FSWG7SUT.js → 6K3C5JX2.js} +1 -1
  11. package/dist/cdn/6VCG2ITQ.js +2 -0
  12. package/dist/cdn/{NOXANMDF.js → 757HAEJS.js} +1 -1
  13. package/dist/cdn/{P4XNRWG7.js → 7Q5BT35O.js} +1 -1
  14. package/dist/cdn/{4NZDPHHF.js → 7WYPODAB.js} +1 -1
  15. package/dist/cdn/{463VANZI.js → BH42V5CR.js} +1 -1
  16. package/dist/cdn/DD2Y5NOB.js +2 -0
  17. package/dist/cdn/{J5K2SIY6.js → DMM5WA5Q.js} +3 -3
  18. package/dist/cdn/DO7NLLUV.js +2 -0
  19. package/dist/cdn/{UKQPYE7U.js → DQQTSOMQ.js} +1 -1
  20. package/dist/cdn/{Y4KGXRSD.js → FWLPMS4Q.js} +1 -1
  21. package/dist/cdn/{M4II4TSX.js → G3C6IL5Y.js} +1 -1
  22. package/dist/cdn/{3DCFUYKP.js → GG4IIHQE.js} +1 -1
  23. package/dist/cdn/GRQLB7ZG.js +2 -0
  24. package/dist/cdn/{5DEYOM7D.js → HQLA2AI4.js} +1 -1
  25. package/dist/cdn/{MHVLVLRA.js → HYQVSB6C.js} +1 -1
  26. package/dist/cdn/I46CXTVR.js +2 -0
  27. package/dist/cdn/{MIH5YMTN.js → JMBANG5V.js} +1 -1
  28. package/dist/cdn/KETYOYXQ.js +2 -0
  29. package/dist/cdn/{GJD7AOUI.js → KH5WPLZK.js} +1 -1
  30. package/dist/cdn/{IDEOFV22.js → LTLR4VF3.js} +1 -1
  31. package/dist/cdn/NQH7ZZWD.js +2 -0
  32. package/dist/cdn/OANAQ6HY.js +2 -0
  33. package/dist/cdn/{FAIQTEVJ.js → PP7EF7UU.js} +1 -1
  34. package/dist/cdn/{L6P26BYB.js → Q2DJUFVO.js} +1 -1
  35. package/dist/cdn/{LCV5GKUD.js → Q35DDH7J.js} +123 -123
  36. package/dist/cdn/{RIHOGDUV.js → QC4MO5BO.js} +1 -1
  37. package/dist/cdn/QDKHYQJB.js +2 -0
  38. package/dist/cdn/{FCJSMT5G.js → RMO244NW.js} +1 -1
  39. package/dist/cdn/RY6KZ77P.js +2 -0
  40. package/dist/cdn/{PBGG3TGN.js → RYBSWXQQ.js} +1 -1
  41. package/dist/cdn/{2UMMLVCR.js → SYQ5E5TV.js} +1 -1
  42. package/dist/cdn/{E6YCTW3S.js → TKOGOWYQ.js} +14 -14
  43. package/dist/cdn/UBEU6ULP.js +2 -0
  44. package/dist/cdn/UCQJWFUW.js +2 -0
  45. package/dist/cdn/{2PUK3PST.js → W7I22AW3.js} +1 -1
  46. package/dist/cdn/{RUQ4RO4T.js → WUEJANIZ.js} +1 -1
  47. package/dist/cdn/{BMMIXOTR.js → WXL7GVUU.js} +1 -1
  48. package/dist/cdn/{B5MBF4JC.js → XO54BFTC.js} +1 -1
  49. package/dist/cdn/{XGYNSCTA.js → Y37QLEAM.js} +1 -1
  50. package/dist/cdn/{O6ZQYZKL.js → YFJZN5K5.js} +1 -1
  51. package/dist/cdn/{6T35OGRG.js → YTU2BYBP.js} +1 -1
  52. package/dist/cdn/{5LF6C3S5.js → YWALGZAG.js} +1 -1
  53. package/dist/cdn/{F26SXWZ5.js → ZNH7LRND.js} +1 -1
  54. package/dist/cdn/index.js +1 -1
  55. package/dist/chunks/Auth.js +1 -1
  56. package/dist/chunks/deployFlowController.js +1 -1
  57. package/dist/chunks/helpers.js +47 -43
  58. package/dist/chunks/interfaces.js +105 -102
  59. package/dist/chunks/solution-builder-assistant.js +183 -119
  60. package/dist/chunks/solution-deploy-dialog.js +4 -4
  61. package/dist/chunks/solutions-deploy-app-nav.js +2 -2
  62. package/dist/chunks/validators.js +3 -3
  63. package/dist/components/arcgis-solutions-assistant/customElement.js +115 -101
  64. package/dist/components/arcgis-solutions-assistant/index.js +1 -0
  65. package/dist/components/card-manager/customElement.js +8 -8
  66. package/dist/components/create-feature/customElement.js +107 -113
  67. package/dist/components/crowdsource-reporter/customElement.js +1 -1
  68. package/dist/components/layer-table/customElement.d.ts +3 -0
  69. package/dist/components/layer-table/customElement.js +110 -100
  70. package/dist/components/solution-configure-titles/customElement.js +11 -10
  71. package/dist/components/solution-delete-dialog/customElement.js +9 -8
  72. package/dist/components/solution-deploy-dialog/customElement.d.ts +6 -2
  73. package/dist/components/solution-deployed-card-panel/customElement.js +41 -38
  74. package/dist/components/solution-details-card/customElement.js +1 -1
  75. package/dist/components/solution-details-panel/customElement.js +114 -100
  76. package/dist/components/solution-item-diagram/customElement.js +6 -6
  77. package/dist/components/solution-resource-card/customElement.js +1 -1
  78. package/dist/components/solution-snapshot-gallery/customElement.js +1 -1
  79. package/dist/components/solutions-all-panel/customElement.js +1 -1
  80. package/dist/components/solutions-deploy-app/customElement.js +9 -11
  81. package/dist/components/solutions-deployed-panel/customElement.js +7 -7
  82. package/dist/components/solutions-deployed-shell/customElement.js +1 -1
  83. package/dist/components/solutions-filter-panel/customElement.js +1 -1
  84. package/dist/components/solutions-searchsort-toolbar/customElement.js +1 -1
  85. package/dist/docs/api.json +1 -1
  86. package/dist/docs/docs.json +1 -1
  87. package/dist/docs/vscode.html-custom-data.json +1 -1
  88. package/dist/docs/web-types.json +1 -1
  89. package/dist/solutions-components_commit.txt +9 -6
  90. package/dist/types/lumina.d.ts +1 -0
  91. package/dist/types/preact.d.ts +1 -0
  92. package/dist/types/react.d.ts +1 -0
  93. package/dist/types/stencil.d.ts +1 -0
  94. package/package.json +1 -1
  95. package/dist/cdn/3JQ2RXVJ.js +0 -2
  96. package/dist/cdn/54AE7WD2.js +0 -2
  97. package/dist/cdn/7WD3GNG4.js +0 -2
  98. package/dist/cdn/D3XPV5W4.js +0 -2
  99. package/dist/cdn/KDNGZ47C.js +0 -2
  100. package/dist/cdn/KIPRPYME.js +0 -2
  101. package/dist/cdn/PBMTIFFX.js +0 -2
  102. package/dist/cdn/PECGJO2P.js +0 -2
  103. package/dist/cdn/QGCF64WY.js +0 -2
  104. package/dist/cdn/Z3B5KW2S.js +0 -2
  105. package/dist/cdn/ZM27FRZG.js +0 -2
  106. package/dist/cdn/ZUPXKH75.js +0 -2
  107. package/dist/cdn/ZYLKUZID.js +0 -2
@@ -2,22 +2,22 @@
2
2
  import { c as _e } from "../../chunks/runtime.js";
3
3
  import { u as Te } from "../../chunks/useT9n.js";
4
4
  import { LitElement as ke, createEvent as X, nothing as Z } from "@arcgis/lumina";
5
- import { css as Ee, html as E } from "lit";
5
+ import { css as Ee, html as I } from "lit";
6
6
  import { unsafeHTML as Ae } from "lit/directives/unsafe-html.js";
7
7
  import { useContextConsumer as ee } from "@arcgis/lumina/context";
8
8
  import { c as Le, b as Re } from "../../chunks/deployAppContexts.js";
9
9
  import { T as De } from "../../chunks/interfaces.js";
10
- import { l as Fe } from "../../chunks/helpers.js";
10
+ import { m as Fe } from "../../chunks/helpers.js";
11
11
  import te from "@arcgis/core/config.js";
12
12
  import { createRef as $e, ref as Me } from "lit-html/directives/ref.js";
13
13
  import { Annotation as b, StateGraph as O, START as z, END as v, NodeInterrupt as ne } from "@langchain/langgraph/web";
14
- import { createAgentRuntimeState as j, sendTraceMessage as w, invokeStructuredPrompt as _, getEmbeddings as Be, cosineSimilarity as Ne, invokeTextPrompt as qe } from "@arcgis/ai-orchestrator";
14
+ import { createAgentRuntimeState as j, sendTraceMessage as w, invokeStructuredPrompt as T, getEmbeddings as Ne, cosineSimilarity as Be, invokeTextPrompt as Pe } from "@arcgis/ai-orchestrator";
15
15
  import r, { z as D } from "zod";
16
16
  import * as J from "@esri/arcgis-rest-portal";
17
- import { applyPatch as Pe } from "fast-json-patch";
17
+ import { applyPatch as qe } from "fast-json-patch";
18
18
  import "@langchain/core/messages";
19
19
  import { C as ie } from "../../chunks/converter.js";
20
- import { t as oe, g as B, c as ae, r as re, d as L } from "../../chunks/templates.js";
20
+ import { t as oe, g as N, c as ae, r as re, d as L } from "../../chunks/templates.js";
21
21
  import Ue from "@arcgis/core/portal/Portal.js";
22
22
  import Oe from "@arcgis/core/portal/PortalItem.js";
23
23
  const ze = Ee`:host{display:block;height:100%}.margin-lg{margin:var(--calcite-spacing-lg)}.display-flex-row{display:flex;flex-direction:row}.assistant-split-container{display:flex;width:100%;height:calc(100vh - 78px);overflow:hidden;border-radius:10px}.assistant-panel{display:flex;flex-direction:column;height:100%;border:1px solid var(--calcite-color-surface-3);background-color:var(--calcite-color-surface-2);overflow:hidden}.chat-panel{min-width:320px}.builder-panel{min-width:320px;max-width:100%;border-left:1px solid var(--calcite-color-surface-3)}.panel-actions{display:flex;gap:8px;padding:6px;align-items:center}.builder-header,.builder-footer{padding:10px;background:var(--calcite-color-surface-1);border-bottom:1px solid var(--calcite-color-surface-3)}.builder-content{flex:1;overflow:auto;padding:12px}.builder-content pre{white-space:pre-wrap;word-wrap:break-word;max-height:100%;overflow:auto}.builder-actions{display:flex;gap:6px;align-items:center}.padding-left-10{padding-left:10px}.chat-container{display:flex;flex-direction:column;gap:0px;max-width:600px;height:75%;background-color:var(--calcite-color-surface-4);padding:1px}.chat-container_expanded{display:flex;flex-direction:column;gap:0px;max-width:100%;height:95%;background-color:var(--calcite-color-surface-1);border-radius:10px;padding:10px}.chat-panel{--calcite-color-focus: var(--calcite-color-brand);--calcite-panel-border-color: var(--calcite-color-border-2);--calcite-internal-panel-header-vertical-padding: 0px;--calcite-panel-header-content-space: 0px;border:var(--calcite-border-width-sm) solid var(--calcite-color-border-2);height:100%}.header-content{display:flex;align-items:center;gap:var(--calcite-spacing-sm);height:65px;box-sizing:border-box;padding-inline-start:var(--calcite-space-2xl)}.header-title{font-size:var(--calcite-font-size-md);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.beta-chip{--calcite-chip-corner-radius: var(--calcite-corner-radius-half)}.chat-panel calcite-card,.chat-panel calcite-text-area,.chat-panel calcite-button,.chat-panel .chat-messages,.chat-panel .chat-input{--calcite-color-focus: var(--calcite-color-brand)}.assistant-followup-chip:focus{outline:2px solid var(--calcite-color-brand)}.chat-panel-heading{font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-surface-1, var(--calcite-color-text-1))}.chat-messages{display:flex;flex-direction:column;gap:20px;padding:4px;height:100%;overflow-y:auto}.user-message{align-self:flex-end;background:var(--calcite-color-brand);border-radius:8px;max-width:90%;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-brand);--calcite-card-border-color: var(--calcite-color-brand);color:var(--calcite-color-text-inverse);text-align:left}.system-message{align-self:flex-start;background:var(--calcite-color-surface-3);border-radius:8px;max-width:90%;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-surface-4);--calcite-card-border-color: var(--calcite-color-surface-4);color:var(--calcite-color-inverse);text-align:left}.loader-message{align-self:flex-start;background:var(--calcite-color-surface-4);border-radius:8px;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-surface-4);--calcite-card-border-color: var(--calcite-color-surface-4)}.message-content{padding:0;font-size:14px}.response-message.message-content>p:first-of-type{margin-top:0}.message-content img{max-width:100%;height:auto;display:block;object-fit:contain}.message-content-pad{padding-bottom:10px;font-size:14px}.message-content-summary{padding-bottom:14px}.message-content-alignment{display:flex;align-items:center;gap:var(--calcite-spacing-md);font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-1)}.padding-top-10{padding-top:10px}.padding-right-8{padding-right:8px}.padding-left-right-5{padding-right:5px;padding-left:5px}.chip-content{padding:5px 5px 5px 0}.chat-input{display:flex;flex-direction:row;flex-grow:1}.table-cell{--calcite-table-cell-background: var(--calcite-color-surface-4)}.cursor-pointer{cursor:pointer}.notice-border-color{--temp-initial-brand: var(--calcite-color-brand)}.notice-border-color calcite-notice{--calcite-color-brand: #ddd;--calcite-icon-color: var(--temp-initial-brand)}.notice-border-color calcite-notice *{--calcite-color-brand: var(--temp-initial-brand)}.solution-card{padding:5px 0;text-decoration:none;display:block;width:100%;cursor:pointer}.solution-card calcite-card{display:flex;flex-direction:column;max-width:520px;overflow:hidden;--calcite-card-corner-radius: var(--calcite-corner-radius-round) !important;--calcite-card-shadow: var(--calcite-shadow-sm);--calcite-card-background-color: var(--calcite-card-background-color) }.solution-card div[slot=thumbnail]{max-height:100%;width:100%;position:relative;&:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;transition:all .15s ease-in-out}}.solution-card div[slot=thumbnail] img{max-height:100%;width:100%;object-fit:cover}.solution-card span[slot=description]{padding-top:10px}.solution-card calcite-chip{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);visibility:hidden;pointer-events:none;opacity:0;transition:all .15s ease-in-out;z-index:9999}.solution-card:hover calcite-chip{visibility:visible;opacity:1}.solution-card:hover div[slot=thumbnail]:after{background-color:#00000080}.solution-card:hover h3{text-decoration:underline}.solution-card:focus{outline:2px solid var(--calcite-color-brand)}.references-container{padding-top:10px;display:block}.references-container.collapsed{display:none}.width-100{width:100%}.disclaimer-div{display:flex;align-items:center;gap:var(--calcite-spacing-sm);font-size:var(--calcite-font-size--0);color:var(--calcite-color-text-1)}.display-none{display:none}.chat-messages calcite-fab{position:absolute;bottom:16px;left:50%;transform:translate(-50%);z-index:999}.icon-color-background{--calcite-button-icon-color: var(--calcite-color-surface-1)}#closeAssistantButton{--calcite-action-text-color: var(--calcite-color-text-1)}.icon-color-background:focus{--calcite-color-focus: var(--calcite-color-surface-1)}@media(max-width:430px){.solution-card .solution-snippet{display:none}}.height-32-flex-auto{height:32px;flex:0 0 auto}.margin-top-0.message-content>p:first-of-type{margin-top:0}a:not(.solution-card){color:var(--calcite-link-text-color, var(--calcite-color-text-link));cursor:pointer;text-decoration:none;line-height:inherit;background-image:linear-gradient(currentColor,currentColor),linear-gradient(var(--calcite-color-brand-underline),var(--calcite-color-brand-underline));background-position-x:0%,100%;background-position-y:min(1.5em,100%);background-repeat:no-repeat,no-repeat;background-size:0% 1px,100% 1px;transition-property:background-size,color;transition-duration:var(--calcite-animation-timing, .15s);transition-timing-function:ease-in-out;outline-color:transparent;position:relative}a:not(.solution-card):hover{background-size:100% 1px,100% 1px}a:not(.solution-card):focus{outline:2px solid var(--calcite-color-brand);outline-offset:2px;outline-color:var(--calcite-color-brand)}a:not(.solution-card):active{color:var(--calcite-color-brand-press)}`;
@@ -34,7 +34,7 @@ ${Object.keys(t).join(`
34
34
  );
35
35
  return await s[1]();
36
36
  }
37
- function N(t) {
37
+ function B(t) {
38
38
  return t?.configurable?.context?.translations;
39
39
  }
40
40
  function le(t) {
@@ -79,18 +79,19 @@ function Ge(t, e) {
79
79
  const s = [];
80
80
  return (e?.configurable?.context?.configContext.allCards ?? []).forEach((i) => {
81
81
  const o = i.title;
82
- if (t.toLowerCase().includes(o.toLowerCase())) {
83
- const a = `<a href="" target="solutionId:${i.deployCommonId}">${o}</a>`, l = new RegExp(o, "gi");
84
- t = t.replace(l, a), s.push({
85
- solution: {
86
- title: i.title,
87
- id: i.deployCommonId,
88
- snippet: i.snippet,
89
- description: i.description
90
- },
91
- score: 100
92
- });
93
- }
82
+ if (!o)
83
+ return;
84
+ const a = new RegExp(`(?<![\\p{L}\\p{N}])${o}(?![\\p{L}\\p{N}])`, "giu");
85
+ let l = !1;
86
+ t = t.replace(a, () => (l = !0, `<a href="" target="solutionId:${i.deployCommonId}">${o}</a>`)), l && s.push({
87
+ solution: {
88
+ title: i.title,
89
+ id: i.deployCommonId,
90
+ snippet: i.snippet,
91
+ description: i.description
92
+ },
93
+ score: 100
94
+ });
94
95
  }), { source: t, allMatches: s };
95
96
  }
96
97
  function Ve(t) {
@@ -149,7 +150,7 @@ const He = (t) => new Promise((e) => setTimeout(e, t)), We = b.Root({
149
150
  } };
150
151
  n && (a.conversationId = n), U(a, i, e ?? "");
151
152
  }, Qe = async (t, e) => {
152
- const s = N(e), n = t.documentSkillUrl;
153
+ const s = B(e), n = t.documentSkillUrl;
153
154
  let i = [];
154
155
  await w(
155
156
  { text: s.agentProgress.explorerAgentSearching },
@@ -188,7 +189,7 @@ const He = (t) => new Promise((e) => setTimeout(e, t)), We = b.Root({
188
189
  l = A.source, i = [
189
190
  ...i,
190
191
  ...A.allMatches.filter(
191
- (T) => !i.some((k) => k.solution.id === T.solution.id)
192
+ (k) => !i.some((E) => E.solution.id === k.solution.id)
192
193
  )
193
194
  ];
194
195
  }
@@ -549,7 +550,7 @@ const ot = r.object({
549
550
  promptModules: o
550
551
  } = t;
551
552
  try {
552
- return (await _({
553
+ return (await T({
553
554
  promptText: await y(o, "explainValidationFailure"),
554
555
  modelTier: "fast",
555
556
  temperature: 0,
@@ -568,8 +569,8 @@ const ot = r.object({
568
569
  ), i;
569
570
  }
570
571
  }, V = (t) => t in L, yt = 5, xt = 0.8, vt = 0.15, wt = "Web Mapping Application", St = "Embeddings";
571
- let F = null, P = null, $ = null, M = null;
572
- const It = "Build", I = /* @__PURE__ */ Object.assign({
572
+ let F = null, q = null, $ = null, M = null;
573
+ const It = "Build", C = /* @__PURE__ */ Object.assign({
573
574
  "./prompts/assessBuildRequest.md": () => import("../../chunks/assessBuildRequest.js").then((t) => t.default),
574
575
  "./prompts/assessUpdateRequest.md": () => import("../../chunks/assessUpdateRequest.js").then((t) => t.default),
575
576
  "./prompts/description.md": () => import("../../chunks/description2.js").then((t) => t.default),
@@ -577,7 +578,7 @@ const It = "Build", I = /* @__PURE__ */ Object.assign({
577
578
  "./prompts/explainValidationFailure.md": () => import("../../chunks/explainValidationFailure.js").then((t) => t.default),
578
579
  "./prompts/findExistingSolution.md": () => import("../../chunks/findExistingSolution.js").then((t) => t.default),
579
580
  "./prompts/updateDesign.md": () => import("../../chunks/updateDesign.js").then((t) => t.default)
580
- }), Ct = nt.builderMessages, h = (t, e, s) => N(e)?.builderMessages?.[t] ?? Ct[t], ge = (t) => {
581
+ }), Ct = nt.builderMessages, h = (t, e, s) => B(e)?.builderMessages?.[t] ?? Ct[t], ge = (t) => {
581
582
  typeof window < "u" && window.dispatchEvent(new CustomEvent("arcgis-solution-design-update", {
582
583
  detail: t
583
584
  }));
@@ -622,7 +623,7 @@ const kt = async (t, e, s) => {
622
623
  } catch {
623
624
  return null;
624
625
  }
625
- }, C = (t, e = {}) => {
626
+ }, _ = (t, e = {}) => {
626
627
  let s = t;
627
628
  return "itemId" in e && (s = {
628
629
  ...s,
@@ -653,8 +654,8 @@ const kt = async (t, e, s) => {
653
654
  };
654
655
  }
655
656
  }, H = async (t) => {
656
- if (P) {
657
- Object.entries(P).forEach(([a, l]) => {
657
+ if (q) {
658
+ Object.entries(q).forEach(([a, l]) => {
658
659
  L[a] && (L[a].initialTemplate = l);
659
660
  });
660
661
  return;
@@ -681,7 +682,7 @@ const kt = async (t, e, s) => {
681
682
  ...l,
682
683
  buildSolution: m
683
684
  };
684
- o[u] = C(
685
+ o[u] = _(
685
686
  new ie(d).dumpToLlmTemplate(),
686
687
  {
687
688
  itemId: a.id,
@@ -692,7 +693,7 @@ const kt = async (t, e, s) => {
692
693
  ...l,
693
694
  initialTemplate: o[u]
694
695
  };
695
- })), P = o;
696
+ })), q = o;
696
697
  }, fe = (t) => {
697
698
  const e = t?.configurable?.context?.token;
698
699
  return typeof e != "string" || !e.trim() ? null : e;
@@ -733,14 +734,14 @@ Description: ${e.description}`).join(`
733
734
  if (typeof e != "string" || !e.trim())
734
735
  return null;
735
736
  try {
736
- const s = JSON.parse(e), n = C(
737
+ const s = JSON.parse(e), n = _(
737
738
  { response: "", ...s },
738
739
  { itemId: s?.solution?.itemId ?? null }
739
740
  ), i = G.safeParse(n);
740
741
  if (!i.success)
741
742
  return null;
742
743
  const { response: o, ...a } = i.data, l = s.templateId, u = typeof l == "string" && V(l) ? l : null;
743
- return C(
744
+ return _(
744
745
  a,
745
746
  {
746
747
  sourceBuildSolution: s.sourceBuildSolution,
@@ -793,8 +794,8 @@ Description: ${e.description}`).join(`
793
794
  return JSON.stringify(t.currentDesign) !== JSON.stringify(s) && (i.currentDesign = s), n && t.selectedTemplate !== n && (i.selectedTemplate = n), i;
794
795
  }, $t = async (t, e) => {
795
796
  await w({ text: h("understandingRequest", e) }, e), await xe(e);
796
- const s = t.agentExecutionContext.userRequest, n = Lt(), i = t.agentExecutionContext.messages.slice(-11), o = await _({
797
- promptText: await y(I, "assessBuildRequest"),
797
+ const s = t.agentExecutionContext.userRequest, n = Lt(), i = t.agentExecutionContext.messages.slice(-11), o = await T({
798
+ promptText: await y(C, "assessBuildRequest"),
798
799
  modelTier: "advanced",
799
800
  temperature: 0,
800
801
  schema: ht,
@@ -819,7 +820,7 @@ Description: ${e.description}`).join(`
819
820
  summary: e,
820
821
  status: "success"
821
822
  };
822
- }, Bt = async (t, e) => {
823
+ }, Nt = async (t, e) => {
823
824
  const { currentDesign: s } = t;
824
825
  if (!s)
825
826
  return {
@@ -831,8 +832,8 @@ Description: ${e.description}`).join(`
831
832
  await w({ text: h("understandingRequest", e) }, e);
832
833
  const n = t.agentExecutionContext.userRequest, i = t.agentExecutionContext.messages.slice(-11);
833
834
  return {
834
- updateAssessment: await _({
835
- promptText: await y(I, "assessUpdateRequest"),
835
+ updateAssessment: await T({
836
+ promptText: await y(C, "assessUpdateRequest"),
836
837
  modelTier: "advanced",
837
838
  temperature: 0,
838
839
  schema: pt,
@@ -843,14 +844,14 @@ Description: ${e.description}`).join(`
843
844
  }
844
845
  })
845
846
  };
846
- }, Nt = (t, e) => {
847
+ }, Bt = (t, e) => {
847
848
  const s = t.updateAssessment?.assistantResponse ?? h("applyChangeFailed", e);
848
849
  return {
849
850
  outputMessage: s,
850
851
  summary: s,
851
852
  status: "success"
852
853
  };
853
- }, qt = (t, e) => {
854
+ }, Pt = (t, e) => {
854
855
  const { hitlResponse: s } = e.configurable, n = "selectTemplate", i = t.assessment?.matchedTemplates.filter(
855
856
  (c) => V(c.templateId)
856
857
  ) ?? [], o = i.map((c) => `${c.templateDescription}`);
@@ -868,16 +869,16 @@ Description: ${e.description}`).join(`
868
869
  return {
869
870
  selectedTemplate: (l >= 0 ? i[l] : void 0)?.templateId ?? i[0]?.templateId ?? null
870
871
  };
871
- }, Pt = async (t, e) => {
872
+ }, qt = async (t, e) => {
872
873
  await w({ text: h("searchingExistingSolutions", e) }, e);
873
874
  const s = t.agentExecutionContext.userRequest, n = tt(t.agentExecutionContext.messages) || s, i = await ve(e);
874
875
  if (!i)
875
876
  return console.warn("Solutions Search: failed to load solution embeddings cache; skipping search."), { existingMatches: [] };
876
877
  if (!i.length)
877
878
  return { existingMatches: [] };
878
- const [o] = await Be([n]), a = i.map((d) => ({
879
+ const [o] = await Ne([n]), a = i.map((d) => ({
879
880
  solution: d,
880
- score: Ne(o, d.embedding)
881
+ score: Be(o, d.embedding)
881
882
  }));
882
883
  a.sort((d, g) => g.score - d.score);
883
884
  const l = a.slice(0, yt);
@@ -888,8 +889,8 @@ Snippet: ${d.snippet}
888
889
  Description: ${d.description}`).join(`
889
890
 
890
891
  `), c = t.agentExecutionContext.messages.slice(-11);
891
- return { existingMatches: (await _({
892
- promptText: await y(I, "findExistingSolution"),
892
+ return { existingMatches: (await T({
893
+ promptText: await y(C, "findExistingSolution"),
893
894
  modelTier: "fast",
894
895
  temperature: 0,
895
896
  schema: mt,
@@ -925,18 +926,18 @@ Description: ${d.description}`).join(`
925
926
  await xe(e);
926
927
  const { currentDesign: s } = t, n = t.agentExecutionContext.userRequest;
927
928
  await w({ text: h("creatingDesign", e) }, e);
928
- let i = B(t.selectedTemplate);
929
- if (i?.initialTemplate || (await H(e), i = B(t.selectedTemplate)), !i?.initialTemplate)
929
+ let i = N(t.selectedTemplate);
930
+ if (i?.initialTemplate || (await H(e), i = N(t.selectedTemplate)), !i?.initialTemplate)
930
931
  throw new Error("No hydrated templates are available for solution design.");
931
- const o = C(
932
+ const o = _(
932
933
  s ?? i.initialTemplate,
933
934
  {
934
935
  itemId: (s ?? i.initialTemplate)?.solution?.itemId ?? null,
935
936
  sourceBuildSolution: s?.sourceBuildSolution ?? i.initialTemplate.sourceBuildSolution,
936
937
  params: s?.params ?? i.initialTemplate.params ?? null
937
938
  }
938
- ), a = t.agentExecutionContext.messages.slice(-11), l = await _({
939
- promptText: await y(I, "designSolution"),
939
+ ), a = t.agentExecutionContext.messages.slice(-11), l = await T({
940
+ promptText: await y(C, "designSolution"),
940
941
  modelTier: "advanced",
941
942
  temperature: 0,
942
943
  schema: G,
@@ -949,7 +950,7 @@ Description: ${d.description}`).join(`
949
950
  }), { response: u, featureLayer: c, ...m } = l, f = re(
950
951
  c,
951
952
  o.featureLayer
952
- ), d = C(
953
+ ), d = _(
953
954
  { ...m, featureLayer: f },
954
955
  {
955
956
  itemId: o?.solution?.itemId,
@@ -965,16 +966,16 @@ Description: ${d.description}`).join(`
965
966
  ), {
966
967
  outputMessage: h("createDesignFailed", e)
967
968
  };
968
- const A = d.sourceBuildSolution, T = he(d, A);
969
- if (!T.ok) {
969
+ const A = d.sourceBuildSolution, k = he(d, A);
970
+ if (!k.ok) {
970
971
  console.warn(
971
972
  "[SolutionBuilder] designSolution Esri JSON conversion failed:",
972
- { error: T.error, llmResponse: l, design: d }
973
+ { error: k.error, llmResponse: l, design: d }
973
974
  );
974
- const k = h("createDesignFailed", e);
975
+ const E = h("createDesignFailed", e);
975
976
  return {
976
- outputMessage: k,
977
- summary: k,
977
+ outputMessage: E,
978
+ summary: E,
978
979
  status: "success"
979
980
  };
980
981
  }
@@ -992,8 +993,8 @@ Description: ${d.description}`).join(`
992
993
  await w({ text: h("updatingDesign", e) }, e);
993
994
  let o;
994
995
  try {
995
- o = await _({
996
- promptText: await y(I, "updateDesign"),
996
+ o = await T({
997
+ promptText: await y(C, "updateDesign"),
997
998
  modelTier: "advanced",
998
999
  temperature: 0,
999
1000
  schema: dt,
@@ -1055,7 +1056,7 @@ Description: ${d.description}`).join(`
1055
1056
  ae(s)
1056
1057
  );
1057
1058
  try {
1058
- Pe(f, m, !0);
1059
+ qe(f, m, !0);
1059
1060
  } catch (p) {
1060
1061
  console.warn(
1061
1062
  "[SolutionBuilder] updateDesign JSON patch failed:",
@@ -1068,7 +1069,7 @@ Description: ${d.description}`).join(`
1068
1069
  status: "success"
1069
1070
  };
1070
1071
  }
1071
- const d = C(
1072
+ const d = _(
1072
1073
  { response: "", ...f },
1073
1074
  { itemId: s.solution?.itemId ?? null }
1074
1075
  ), g = G.safeParse(d);
@@ -1084,11 +1085,11 @@ Description: ${d.description}`).join(`
1084
1085
  status: "success"
1085
1086
  };
1086
1087
  }
1087
- const { response: A, featureLayer: T, ...k } = g.data, Ie = re(
1088
- T,
1088
+ const { response: A, featureLayer: k, ...E } = g.data, Ie = re(
1089
+ k,
1089
1090
  s.featureLayer
1090
- ), S = C(
1091
- { ...k, featureLayer: Ie },
1091
+ ), S = _(
1092
+ { ...E, featureLayer: Ie },
1092
1093
  {
1093
1094
  itemId: s.solution?.itemId,
1094
1095
  sourceBuildSolution: s.sourceBuildSolution,
@@ -1096,21 +1097,21 @@ Description: ${d.description}`).join(`
1096
1097
  params: s.params ?? null
1097
1098
  }
1098
1099
  );
1099
- let R = B(t.selectedTemplate);
1100
- if (R?.initialTemplate || (await H(e), R = B(t.selectedTemplate)), !R?.initialTemplate)
1100
+ let R = N(t.selectedTemplate);
1101
+ if (R?.initialTemplate || (await H(e), R = N(t.selectedTemplate)), !R?.initialTemplate)
1101
1102
  throw new Error("No hydrated templates are available for solution design.");
1102
- const q = new me(S, R.initialTemplate, !1);
1103
- if (!q.isValid) {
1103
+ const P = new me(S, R.initialTemplate, !1);
1104
+ if (!P.isValid) {
1104
1105
  console.warn(
1105
1106
  "[SolutionBuilder] updateDesign validation failed:",
1106
- { issues: q.issues, llmResponse: o, patchedDesign: S }
1107
+ { issues: P.issues, llmResponse: o, patchedDesign: S }
1107
1108
  );
1108
1109
  const p = await bt({
1109
1110
  query: n,
1110
- validationIssues: q.issues,
1111
+ validationIssues: P.issues,
1111
1112
  recentMessages: i,
1112
1113
  fallbackMessage: h("applyChangeFailed", e),
1113
- promptModules: I
1114
+ promptModules: C
1114
1115
  });
1115
1116
  return {
1116
1117
  outputMessage: p,
@@ -1137,7 +1138,7 @@ Description: ${d.description}`).join(`
1137
1138
  status: "success",
1138
1139
  currentDesign: S
1139
1140
  };
1140
- }, jt = (t) => t.currentDesign !== null ? "assessUpdateRequest" : "assessBuildRequest", Jt = (t) => !t.updateAssessment || !t.updateAssessment.isValidUpdate ? "invalidUpdateExit" : "updateDesign", Gt = (t) => !t.assessment || !t.assessment.isValidUseCase ? "invalidBuildExit" : !t.selectedTemplate && t.assessment.matchedTemplates.length > 1 ? "selectTemplateHIL" : "findExistingSolutions", Vt = (t) => t.existingMatches.length > 0 ? "confirmContinueBuildingHIL" : "designSolution", Ht = (t) => t.continueBuilding === !1 ? "declineContinueBuildingExit" : "designSolution", Wt = () => new O(Dt).addNode("syncCurrentDesignFromContext", Ft).addNode("assessBuildRequest", $t).addNode("assessUpdateRequest", Bt).addNode("invalidBuildExit", Mt).addNode("invalidUpdateExit", Nt).addNode("selectTemplateHIL", qt).addNode("findExistingSolutions", Pt).addNode("confirmContinueBuildingHIL", Ut).addNode("declineContinueBuildingExit", Ot).addNode("designSolution", we).addNode("updateDesign", zt).addEdge(z, "syncCurrentDesignFromContext").addConditionalEdges("syncCurrentDesignFromContext", jt, {
1141
+ }, jt = (t) => t.currentDesign !== null ? "assessUpdateRequest" : "assessBuildRequest", Jt = (t) => !t.updateAssessment || !t.updateAssessment.isValidUpdate ? "invalidUpdateExit" : "updateDesign", Gt = (t) => !t.assessment || !t.assessment.isValidUseCase ? "invalidBuildExit" : !t.selectedTemplate && t.assessment.matchedTemplates.length > 1 ? "selectTemplateHIL" : "findExistingSolutions", Vt = (t) => t.existingMatches.length > 0 ? "confirmContinueBuildingHIL" : "designSolution", Ht = (t) => t.continueBuilding === !1 ? "declineContinueBuildingExit" : "designSolution", Wt = () => new O(Dt).addNode("syncCurrentDesignFromContext", Ft).addNode("assessBuildRequest", $t).addNode("assessUpdateRequest", Nt).addNode("invalidBuildExit", Mt).addNode("invalidUpdateExit", Bt).addNode("selectTemplateHIL", Pt).addNode("findExistingSolutions", qt).addNode("confirmContinueBuildingHIL", Ut).addNode("declineContinueBuildingExit", Ot).addNode("designSolution", we).addNode("updateDesign", zt).addEdge(z, "syncCurrentDesignFromContext").addConditionalEdges("syncCurrentDesignFromContext", jt, {
1141
1142
  assessUpdateRequest: "assessUpdateRequest",
1142
1143
  assessBuildRequest: "assessBuildRequest"
1143
1144
  }).addConditionalEdges("assessUpdateRequest", Jt, {
@@ -1154,7 +1155,7 @@ Description: ${d.description}`).join(`
1154
1155
  declineContinueBuildingExit: "declineContinueBuildingExit",
1155
1156
  designSolution: "designSolution"
1156
1157
  }).addEdge("declineContinueBuildingExit", v).addEdge("designSolution", v).addEdge("updateDesign", v);
1157
- await y(I, "description");
1158
+ await y(C, "description");
1158
1159
  const Kt = D.object({
1159
1160
  tool: D.enum(["explorer", "builder", "other"]).describe("The selected tool based on the user's query."),
1160
1161
  confidence: D.number().min(0).max(1).describe("A confidence score (0.00–1.00)."),
@@ -1163,11 +1164,11 @@ const Kt = D.object({
1163
1164
  "./prompts/assistantResponse.md": () => import("../../chunks/assistantResponse.js").then((t) => t.default),
1164
1165
  "./prompts/classifyIntent.md": () => import("../../chunks/classifyIntent.js").then((t) => t.default),
1165
1166
  "./prompts/description.md": () => import("../../chunks/description.js").then((t) => t.default)
1166
- }), K = () => {
1167
- const t = new CustomEvent("assistantProcessing", {
1168
- detail: !1
1167
+ }), K = (t) => {
1168
+ const e = new CustomEvent("assistantProcessing", {
1169
+ detail: { finished: !0, agent: t }
1169
1170
  });
1170
- window.dispatchEvent(t);
1171
+ window.dispatchEvent(e);
1171
1172
  }, Se = b.Root({
1172
1173
  ...j(),
1173
1174
  selectedTool: b({
@@ -1179,7 +1180,7 @@ const Kt = D.object({
1179
1180
  default: () => null
1180
1181
  })
1181
1182
  }), Qt = async (t, e) => {
1182
- const s = N(e);
1183
+ const s = B(e);
1183
1184
  await w(
1184
1185
  { text: s?.builderMessages.understandingRequest },
1185
1186
  e
@@ -1192,7 +1193,7 @@ const Kt = D.object({
1192
1193
  } catch {
1193
1194
  a = !1;
1194
1195
  }
1195
- const l = await y(W, "classifyIntent"), u = await _({
1196
+ const l = await y(W, "classifyIntent"), u = await T({
1196
1197
  promptText: l,
1197
1198
  modelTier: "advanced",
1198
1199
  temperature: 0,
@@ -1206,24 +1207,24 @@ const Kt = D.object({
1206
1207
  };
1207
1208
  }, Yt = async (t, e) => {
1208
1209
  const n = await Ke().compile().invoke(t, e);
1209
- return K(), n;
1210
+ return K("explorer"), n;
1210
1211
  }, Xt = async (t, e) => {
1211
1212
  const n = await Wt().compile().invoke(t, e);
1212
- return K(), n;
1213
+ return K("builder"), n;
1213
1214
  }, Zt = async (t, e) => {
1214
- const s = N(e), n = t.agentExecutionContext.userRequest, i = t.intentRationale ?? "No rationale available.";
1215
+ const s = B(e), n = t.agentExecutionContext.userRequest, i = t.intentRationale ?? "No rationale available.";
1215
1216
  await w(
1216
1217
  { text: s?.executingSolutionsAssistantAgent },
1217
1218
  e
1218
1219
  );
1219
- const o = await y(W, "assistantResponse"), a = t.agentExecutionContext.messages.slice(-11), l = await qe({
1220
+ const o = await y(W, "assistantResponse"), a = t.agentExecutionContext.messages.slice(-11), l = await Pe({
1220
1221
  promptText: o,
1221
1222
  modelTier: "advanced",
1222
1223
  temperature: 0,
1223
1224
  messages: a,
1224
1225
  inputVariables: { query: n, rationale: i }
1225
1226
  });
1226
- return K(), {
1227
+ return K("assistant"), {
1227
1228
  outputMessage: l,
1228
1229
  summary: l,
1229
1230
  status: "success"
@@ -1245,7 +1246,7 @@ class as extends ke {
1245
1246
  aiAssistantsEnabled: !1,
1246
1247
  blockBetaApps: !0,
1247
1248
  colocateCompute: !1
1248
- }, this._suggestedPrompts = [], this._hasInteracted = !1, this._isMobile = window.innerWidth <= 800, this._translations = Te({ name: "arcgis-solutions-assistant", blocking: !0 }), this._builderWidth = 48, this._solutionDesignJson = '{ "solution": null }', this._isAssistantBusy = !1, this._isBuilderBusy = !1, this._preChatCheck = !1, this._assistantRef = $e(), this._configContextConsumer = ee({
1249
+ }, this._suggestedPrompts = [], this._hasInteracted = !1, this._isMobile = window.innerWidth <= 800, this._translations = Te({ name: "arcgis-solutions-assistant", blocking: !0 }), this._builderWidth = 48, this._solutionDesignJson = '{ "solution": null }', this._isAssistantBusy = !1, this._isBuilderBusy = !1, this._preChatCheck = !1, this._showNewChatConfirm = !1, this._assistantRef = $e(), this._configContextConsumer = ee({
1249
1250
  context: Le,
1250
1251
  subscribe: !0,
1251
1252
  callback: (e) => {
@@ -1259,6 +1260,17 @@ class as extends ke {
1259
1260
  }
1260
1261
  }), this._handleResize = () => {
1261
1262
  this._isMobile = window.innerWidth <= 800;
1263
+ }, this._chatStartTime = null, this._handleAssistantProcessingFinished = (e) => {
1264
+ const s = e;
1265
+ if (s.detail?.finished && this._chatStartTime !== null) {
1266
+ const n = Fe(this._chatStartTime);
1267
+ this._telemetry?.logEvent({
1268
+ category: De.ASSISTANT,
1269
+ action: "Chat",
1270
+ dimensions: [s.detail.agent],
1271
+ metrics: [n]
1272
+ }), this._chatStartTime = null, this.assistantProcessing.emit(!1);
1273
+ }
1262
1274
  }, this.closeAssistant = X(), this.assistantProcessing = X(), this._handleAssistantLinkClick = (e) => {
1263
1275
  const s = e.composedPath().find((n) => n instanceof HTMLAnchorElement);
1264
1276
  if (s?.href)
@@ -1277,10 +1289,12 @@ class as extends ke {
1277
1289
  }, this.listenOn(window, "arcgisFeedback", (e) => {
1278
1290
  const s = e.detail, { agentPicked: n, taskAssigned: i, userMessage: o } = this._parseAgentPickedAndTask(s);
1279
1291
  this._sendFeedback(s.content, o ?? i ?? "", s.feedback?.positive ? "Good" : s.feedback?.positive == "Bad" ? "Bad" : "N/A", n ?? "");
1292
+ }), this.listenOn(window, "clearAssistantConversation", () => {
1293
+ this._clearConversation();
1280
1294
  });
1281
1295
  }
1282
1296
  static {
1283
- this.properties = { open: 5, userFirstName: 1, builderVisible: 5, hasActiveBuilderDesign: 5, _conversationId: 16, _orgSettings: 16, _suggestedPrompts: 16, _hasInteracted: 16, _isMobile: 16, _translations: 16, _builderWidth: 16, _solutionDesignJson: 16, _isAssistantBusy: 16, _isBuilderBusy: 16, _preChatCheck: 16 };
1297
+ this.properties = { open: 5, userFirstName: 1, builderVisible: 5, hasActiveBuilderDesign: 5, _conversationId: 16, _orgSettings: 16, _suggestedPrompts: 16, _hasInteracted: 16, _isMobile: 16, _translations: 16, _builderWidth: 16, _solutionDesignJson: 16, _isAssistantBusy: 16, _isBuilderBusy: 16, _preChatCheck: 16, _showNewChatConfirm: 16 };
1284
1298
  }
1285
1299
  static {
1286
1300
  this.styles = ze;
@@ -1289,10 +1303,10 @@ class as extends ke {
1289
1303
  return this._configContextConsumer.value?.telemetrySession;
1290
1304
  }
1291
1305
  connectedCallback() {
1292
- super.connectedCallback(), window.addEventListener("arcgis-solution-design-update", this._onSolutionDesignUpdate), this.el.addEventListener("click", this._handleAssistantLinkClick), window.addEventListener("resize", this._handleResize), this._builderDesignContextConsumer;
1306
+ super.connectedCallback(), window.addEventListener("arcgis-solution-design-update", this._onSolutionDesignUpdate), this.el.addEventListener("click", this._handleAssistantLinkClick), window.addEventListener("resize", this._handleResize), window.addEventListener("assistantProcessing", this._handleAssistantProcessingFinished), this._builderDesignContextConsumer;
1293
1307
  }
1294
1308
  disconnectedCallback() {
1295
- window.removeEventListener("arcgis-solution-design-update", this._onSolutionDesignUpdate), this.el.removeEventListener("click", this._handleAssistantLinkClick), window.removeEventListener("resize", this._handleResize), super.disconnectedCallback();
1309
+ window.removeEventListener("arcgis-solution-design-update", this._onSolutionDesignUpdate), this.el.removeEventListener("click", this._handleAssistantLinkClick), window.removeEventListener("resize", this._handleResize), window.removeEventListener("assistantProcessing", this._handleAssistantProcessingFinished), super.disconnectedCallback();
1296
1310
  }
1297
1311
  loaded() {
1298
1312
  this._checkURLOpenParameter();
@@ -1307,24 +1321,17 @@ class as extends ke {
1307
1321
  e.has("open") && this.open && window.dispatchEvent(new CustomEvent("openAssistant")), this._configContextConsumer.value?.authentication && this._configContextConsumer.value?.userSession?.token && (this._preChatCheck || (ue(this._configContextConsumer.value?.authentication.Portal, this._configContextConsumer.value?.userSession?.token, this._configContextConsumer.value?.locale ?? "en"), this._preChatCheck = !0)), this._configContextConsumer.value?.userSession?.token && this._configContextConsumer.value?.authentication?.CanUseAI;
1308
1322
  }
1309
1323
  _renderNoSign() {
1310
- return E`<calcite-notice class="margin-lg" open scale=m icon=effects kind=info><div slot=message>${this._translations.signInMessage}</div><calcite-link @click=${this._handleSignIn} slot=link title=${this._translations.signInMessage ?? Z} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`;
1324
+ return I`<calcite-notice class="margin-lg" open scale=m icon=effects kind=info><div slot=message>${this._translations.signInMessage}</div><calcite-link @click=${this._handleSignIn} slot=link title=${this._translations.signInMessage ?? Z} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`;
1311
1325
  }
1312
1326
  _renderNoPermission() {
1313
- return E`<calcite-notice open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Ae(this._translations.noPermissionMessage.replace("{{orgUrl}}", is).replace("{{configAI}}", os))}</div></calcite-notice>`;
1327
+ return I`<calcite-notice open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Ae(this._translations.noPermissionMessage.replace("{{orgUrl}}", is).replace("{{configAI}}", os))}</div></calcite-notice>`;
1314
1328
  }
1315
1329
  render() {
1316
1330
  let e = this._suggestedPrompts.length > 0 ? this._suggestedPrompts : this._hasInteracted ? [] : Object.values(this._translations.defaultFollowUpQuestions);
1317
- return this._suggestedPrompts.length > 0 ? e = this._suggestedPrompts : this._hasInteracted || (e = [...Object.values(this._translations.defaultFollowUpQuestions)]), E`<calcite-panel class="chat-panel"><div class="header-content" slot=header-content><span class="header-title">${this._translations.solutionAssistantTitle}</span></div>${this._configContextConsumer.value?.userSession?.token ? this._configContextConsumer.value?.authentication?.CanUseAI ? E`${!this._isMobile && E`<calcite-action id=solutionBuilderAction icon=pencil-square .text=${this._translations.tooltips.builder} text-enabled .indicator=${this.hasActiveBuilderDesign} .disabled=${!this.hasActiveBuilderDesign} .active=${this.builderVisible} selection-appearance=highlight @click=${() => {
1331
+ return this._suggestedPrompts.length > 0 ? e = this._suggestedPrompts : this._hasInteracted || (e = [...Object.values(this._translations.defaultFollowUpQuestions)]), I`<calcite-panel class="chat-panel"><div class="header-content" slot=header-content><span class="header-title">${this._translations.solutionAssistantTitle}</span></div>${this._configContextConsumer.value?.userSession?.token ? this._configContextConsumer.value?.authentication?.CanUseAI ? I`${!this._isMobile && I`<calcite-action id=solutionBuilderAction icon=pencil-square .text=${this._translations.tooltips.builder} text-enabled .indicator=${this.hasActiveBuilderDesign} .disabled=${!this.hasActiveBuilderDesign} .active=${this.builderVisible} selection-appearance=highlight @click=${() => {
1318
1332
  window.dispatchEvent(new CustomEvent("toggleSolutionBuilder"));
1319
- }} scale=m slot=header-actions-end></calcite-action>` || ""}${!this._isMobile && E`<calcite-tooltip placement=bottom reference-element=solutionBuilderAction><span>${this._translations.tooltips.solutionBuilder}</span></calcite-tooltip>` || ""}<arcgis-assistant reference-element copy-enabled feedback-enabled heading description entry-message=${this._translations.defaultStartUpMessage ?? Z} .suggestedPrompts=${e} @arcgisSubmit=${(s) => {
1320
- console.log("arcgis submit: ", s.detail), this._suggestedPrompts = [], e = [], this._hasInteracted = !0;
1321
- const n = Date.now(), i = Fe(n), o = s.detail || "Unknown";
1322
- this._telemetry?.logEvent({
1323
- category: De.ASSISTANT,
1324
- action: "Chat",
1325
- dimensions: [o],
1326
- metrics: [i]
1327
- }), this.assistantProcessing.emit(!0);
1333
+ }} scale=m slot=header-actions-end></calcite-action>` || ""}${!this._isMobile && I`<calcite-tooltip placement=bottom reference-element=solutionBuilderAction><span>${this._translations.tooltips.solutionBuilder}</span></calcite-tooltip>` || ""}<arcgis-assistant reference-element copy-enabled feedback-enabled heading description entry-message=${this._translations.defaultStartUpMessage ?? Z} .suggestedPrompts=${e} @arcgisSubmit=${(s) => {
1334
+ console.log("arcgis submit: ", s.detail), this._suggestedPrompts = [], e = [], this._hasInteracted = !0, this._chatStartTime = Date.now(), this.assistantProcessing.emit(!0);
1328
1335
  }} @arcgisFeedback=${(s) => {
1329
1336
  s.detail;
1330
1337
  }} @arcgisInterrupt=${() => {
@@ -1334,7 +1341,7 @@ class as extends ke {
1334
1341
  }} @arcgisInterruptSubmit=${() => {
1335
1342
  this._queryElementInShadowDom(this.el, ".footer-container", !1);
1336
1343
  }} ${Me(this._assistantRef)}><calcite-button appearance=transparent id=newChatButton icon-start=speech-bubble-plus kind=neutral .label=${this._translations.tooltips.newChat} @click=${() => {
1337
- this._conversationId = void 0, this._suggestedPrompts = [], this._hasInteracted = !1, this._assistantRef.value?.clearChatHistory(), this._queryElementInShadowDom(this.el, ".footer-container", !1);
1344
+ this.hasActiveBuilderDesign ? this._showNewChatConfirm = !0 : this._clearConversation();
1338
1345
  }} round scale=m slot=entry-actions-start>${this._translations.tooltips.newChat}</calcite-button><arcgis-assistant-agent .agent=${ns} .context=${{
1339
1346
  token: this._configContextConsumer.value?.userSession?.token,
1340
1347
  configContext: this._configContextConsumer.value,
@@ -1349,10 +1356,17 @@ class as extends ke {
1349
1356
  clearSuggestedPrompts: () => {
1350
1357
  this._suggestedPrompts = [];
1351
1358
  }
1352
- }}></arcgis-assistant-agent></arcgis-assistant><div slot=footer class="disclaimer-div width-100"><calcite-chip class="beta-chip" appearance=solid kind=neutral .label=${this._translations.betaTag} scale=s>${this._translations.betaTag}</calcite-chip><span>${this._translations.disclaimerMessage} <a href=https://links.esri.com/solutions/security-concern rel="noopener noreferrer" target=_blank>${this._translations.reportConcern}</a></span></div>` : this._renderNoPermission() : this._renderNoSign()}<calcite-action icon=x id=closeAssistantButton .label=${this._translations.tooltips.close} @click=${() => {
1359
+ }}></arcgis-assistant-agent></arcgis-assistant><div slot=footer class="disclaimer-div width-100"><calcite-chip class="beta-chip" appearance=solid kind=neutral .label=${this._translations.betaTag} scale=s>${this._translations.betaTag}</calcite-chip><span>${this._translations.disclaimerMessage} <a href=https://links.esri.com/solutions/security-concern rel="noopener noreferrer" target=_blank>${this._translations.reportConcern}</a></span></div>` : this._renderNoPermission() : this._renderNoSign()}${this._showNewChatConfirm && I`<calcite-dialog close-disabled escape-disabled heading="Start new conversation" modal open>${this._translations.builderMessages.discardMessage}<calcite-button appearance=outline @click=${() => {
1360
+ this._showNewChatConfirm = !1;
1361
+ }} slot=footer-end>\r\n Cancel</calcite-button><calcite-button appearance=solid kind=danger @click=${() => {
1362
+ this._showNewChatConfirm = !1, window.dispatchEvent(new CustomEvent("requestBuilderDiscard"));
1363
+ }} slot=footer-end>\r\n Discard</calcite-button></calcite-dialog>` || ""}<calcite-action icon=x id=closeAssistantButton .label=${this._translations.tooltips.close} @click=${() => {
1353
1364
  this.closeAssistant.emit(!0);
1354
1365
  }} slot=header-actions-end .text=${this._translations.tooltips.close}></calcite-action><calcite-tooltip placement=bottom reference-element=closeAssistantButton><span>${this._translations.tooltips.close}</span></calcite-tooltip></calcite-panel>`;
1355
1366
  }
1367
+ _clearConversation() {
1368
+ this._conversationId = void 0, this._suggestedPrompts = [], this._hasInteracted = !1, this._assistantRef.value?.clearChatHistory(), this._queryElementInShadowDom(this.el, ".footer-container", !1);
1369
+ }
1356
1370
  _sendFeedback(e, s, n, i) {
1357
1371
  const o = `https://survey123.arcgis.com/share/6e349a50b4504ca6b6107216d568db5f?field:_source=${encodeURIComponent("Solutions Assistant")}&field:user_evaluation=${encodeURIComponent(n)}&field:question=${encodeURIComponent(s)}&field:answer=${encodeURIComponent(e)}&field:context=${encodeURIComponent(JSON.stringify({ agent: i }))}&field:version=${encodeURIComponent("v2")}`;
1358
1372
  window.open(o, "_blank");
@@ -7,4 +7,5 @@ import "@arcgis/ai-components/components/arcgis-assistant";
7
7
  import "@esri/calcite-components/components/calcite-button";
8
8
  import "@arcgis/ai-components/components/arcgis-assistant-agent";
9
9
  import "@esri/calcite-components/components/calcite-chip";
10
+ import "@esri/calcite-components/components/calcite-dialog";
10
11
  export * from "./customElement.js";