@esri/solutions-components 5.1.0-next.145 → 5.1.0-next.147

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 (140) hide show
  1. package/dist/cdn/{LL647FJR.js → 2IGILR4T.js} +1 -1
  2. package/dist/cdn/{BQE6IVEF.js → 3A2YSBVB.js} +1 -1
  3. package/dist/cdn/{ZHXREM2D.js → 3KYQE6O5.js} +1 -1
  4. package/dist/cdn/{MEZL3ZHS.js → 3MRR3HKE.js} +25 -25
  5. package/dist/cdn/{QKJJHBMB.js → 42GXADY4.js} +1 -1
  6. package/dist/cdn/{L3UI7EZZ.js → 4DAGSZIC.js} +1 -1
  7. package/dist/cdn/{7ADKNWWI.js → 4FRYNYQ6.js} +1 -1
  8. package/dist/cdn/{5OFQVDNK.js → 4MAZNAHZ.js} +1 -1
  9. package/dist/cdn/{7CLM77HQ.js → 4SBOBTOR.js} +1 -1
  10. package/dist/cdn/{3V2UWENT.js → 4YCLQ3RW.js} +1 -1
  11. package/dist/cdn/{CVRBLJ5O.js → 5MPDXVRM.js} +1 -1
  12. package/dist/cdn/{ULUJKWT5.js → 6AUKNSKW.js} +1 -1
  13. package/dist/cdn/{RIHOGDUV.js → 6IUKH3E3.js} +1 -1
  14. package/dist/cdn/6K3C5JX2.js +2 -0
  15. package/dist/cdn/6VCG2ITQ.js +2 -0
  16. package/dist/cdn/{NOXANMDF.js → 757HAEJS.js} +1 -1
  17. package/dist/cdn/{P4XNRWG7.js → 7Q5BT35O.js} +1 -1
  18. package/dist/cdn/{RSCBZIAN.js → 7WIFBTQF.js} +12 -1
  19. package/dist/cdn/{I7XBRB6B.js → 7WYPODAB.js} +1 -1
  20. package/dist/cdn/AH3PJQ6A.js +2 -0
  21. package/dist/cdn/{C5ZH23YO.js → B5MBF4JC.js} +13 -13
  22. package/dist/cdn/BG4LNU44.js +2 -0
  23. package/dist/cdn/{IEN3TA4W.js → BH42V5CR.js} +1 -1
  24. package/dist/cdn/DD2Y5NOB.js +2 -0
  25. package/dist/cdn/{J5K2SIY6.js → DMM5WA5Q.js} +3 -3
  26. package/dist/cdn/{UKQPYE7U.js → DQQTSOMQ.js} +1 -1
  27. package/dist/cdn/{Y4KGXRSD.js → FWLPMS4Q.js} +1 -1
  28. package/dist/cdn/{M4II4TSX.js → G3C6IL5Y.js} +1 -1
  29. package/dist/cdn/{3DCFUYKP.js → GG4IIHQE.js} +1 -1
  30. package/dist/cdn/{MHVLVLRA.js → HYQVSB6C.js} +1 -1
  31. package/dist/cdn/I46CXTVR.js +2 -0
  32. package/dist/cdn/{A27DLHRU.js → IFONVCBL.js} +1 -1
  33. package/dist/cdn/IZSM7ZJK.js +2 -0
  34. package/dist/cdn/{MIH5YMTN.js → JMBANG5V.js} +1 -1
  35. package/dist/cdn/{G3F52QRW.js → JOAEH3CI.js} +1 -1
  36. package/dist/cdn/KETYOYXQ.js +2 -0
  37. package/dist/cdn/{GJD7AOUI.js → KH5WPLZK.js} +1 -1
  38. package/dist/cdn/{IDEOFV22.js → LTLR4VF3.js} +1 -1
  39. package/dist/cdn/{NIHPHDXG.js → LWT3JEQ6.js} +21 -52
  40. package/dist/cdn/LZDMYPQ2.js +75 -0
  41. package/dist/cdn/{Y6QJCLML.js → M3NML7ZV.js} +1 -1
  42. package/dist/cdn/NQH7ZZWD.js +2 -0
  43. package/dist/cdn/{6MOTC6CE.js → NV2DLQDN.js} +1 -1
  44. package/dist/cdn/OANAQ6HY.js +2 -0
  45. package/dist/cdn/PQL3UL3P.js +2 -0
  46. package/dist/cdn/{L6P26BYB.js → Q2DJUFVO.js} +1 -1
  47. package/dist/cdn/{LCV5GKUD.js → Q35DDH7J.js} +123 -123
  48. package/dist/cdn/QDKHYQJB.js +2 -0
  49. package/dist/cdn/{HPWNNMVU.js → QU25YPPX.js} +1 -1
  50. package/dist/cdn/{5NQNJZTE.js → RMO244NW.js} +1 -1
  51. package/dist/cdn/{HLKEBN2O.js → RRD4QUQS.js} +1 -1
  52. package/dist/cdn/RY6KZ77P.js +2 -0
  53. package/dist/cdn/{PBGG3TGN.js → RYBSWXQQ.js} +1 -1
  54. package/dist/cdn/{2UMMLVCR.js → SYQ5E5TV.js} +1 -1
  55. package/dist/cdn/U56TK45K.js +113 -0
  56. package/dist/cdn/{UM3P3Q52.js → U6JZYJ4D.js} +1 -1
  57. package/dist/cdn/UBEU6ULP.js +2 -0
  58. package/dist/cdn/{MPCJZCL5.js → UTZUXO5F.js} +2 -2
  59. package/dist/cdn/UXKH44PB.js +2 -0
  60. package/dist/cdn/{34CZ4EWR.js → V3MSUKLX.js} +6 -4
  61. package/dist/cdn/{2PUK3PST.js → W7I22AW3.js} +1 -1
  62. package/dist/cdn/{72X4E4QW.js → WC37HMOI.js} +1 -1
  63. package/dist/cdn/{RUQ4RO4T.js → WUEJANIZ.js} +1 -1
  64. package/dist/cdn/{LJY6BB64.js → X6JL6SAH.js} +1 -1
  65. package/dist/cdn/{XGYNSCTA.js → Y37QLEAM.js} +1 -1
  66. package/dist/cdn/{XGWDWPRK.js → YFJZN5K5.js} +1 -1
  67. package/dist/cdn/{6T35OGRG.js → YTU2BYBP.js} +1 -1
  68. package/dist/cdn/{5LF6C3S5.js → YWALGZAG.js} +1 -1
  69. package/dist/cdn/{QFZK4TD4.js → Z23BVIGQ.js} +1 -1
  70. package/dist/cdn/{QQXQAU33.js → ZCPVOS4Q.js} +1 -1
  71. package/dist/cdn/{F26SXWZ5.js → ZNH7LRND.js} +1 -1
  72. package/dist/cdn/{BMMIXOTR.js → ZWQWBXHR.js} +1 -1
  73. package/dist/cdn/index.js +1 -1
  74. package/dist/chunks/Auth.js +1 -1
  75. package/dist/chunks/assessBuildRequest.js +116 -0
  76. package/dist/chunks/assessUpdateRequest.js +78 -0
  77. package/dist/chunks/assistantResponse.js +12 -1
  78. package/dist/chunks/classifyIntent.js +21 -52
  79. package/dist/chunks/deployFlowController.js +1 -1
  80. package/dist/chunks/designSolution.js +6 -4
  81. package/dist/chunks/helpers.js +47 -43
  82. package/dist/chunks/interfaces.js +105 -102
  83. package/dist/chunks/solution-builder-assistant.js +185 -121
  84. package/dist/chunks/solution-deploy-dialog.js +4 -4
  85. package/dist/chunks/solutions-deploy-app-nav.js +2 -2
  86. package/dist/chunks/templates.js +2 -2
  87. package/dist/chunks/updateDesign.js +1 -1
  88. package/dist/components/arcgis-solutions-assistant/customElement.js +340 -278
  89. package/dist/components/arcgis-solutions-assistant/index.js +1 -0
  90. package/dist/components/card-manager/customElement.js +8 -8
  91. package/dist/components/create-feature/customElement.js +107 -113
  92. package/dist/components/crowdsource-reporter/customElement.js +1 -1
  93. package/dist/components/layer-table/customElement.d.ts +3 -0
  94. package/dist/components/layer-table/customElement.js +110 -100
  95. package/dist/components/solution-configure-titles/customElement.js +11 -10
  96. package/dist/components/solution-delete-dialog/customElement.js +9 -8
  97. package/dist/components/solution-deploy-dialog/customElement.d.ts +6 -2
  98. package/dist/components/solution-deployed-card-panel/customElement.js +40 -37
  99. package/dist/components/solution-details-card/customElement.js +1 -1
  100. package/dist/components/solution-details-panel/customElement.js +78 -64
  101. package/dist/components/solution-item-diagram/customElement.js +321 -285
  102. package/dist/components/solution-resource-card/customElement.js +1 -1
  103. package/dist/components/solution-snapshot-gallery/customElement.js +1 -1
  104. package/dist/components/solutions-all-panel/customElement.js +5 -5
  105. package/dist/components/solutions-deploy-app/customElement.js +13 -15
  106. package/dist/components/solutions-deployed-panel/customElement.js +7 -7
  107. package/dist/components/solutions-deployed-shell/customElement.js +1 -1
  108. package/dist/components/solutions-filter-panel/customElement.js +1 -1
  109. package/dist/components/solutions-searchsort-toolbar/customElement.js +1 -1
  110. package/dist/docs/api.json +1 -1
  111. package/dist/docs/docs.json +1 -1
  112. package/dist/docs/vscode.html-custom-data.json +1 -1
  113. package/dist/docs/web-types.json +1 -1
  114. package/dist/solutions-components_commit.txt +5 -8
  115. package/dist/types/lumina.d.ts +1 -0
  116. package/dist/types/preact.d.ts +1 -0
  117. package/dist/types/react.d.ts +1 -0
  118. package/dist/types/stencil.d.ts +1 -0
  119. package/package.json +1 -1
  120. package/dist/cdn/25NZZKXC.js +0 -2
  121. package/dist/cdn/3JQ2RXVJ.js +0 -2
  122. package/dist/cdn/4JVDUPVW.js +0 -2
  123. package/dist/cdn/54AE7WD2.js +0 -2
  124. package/dist/cdn/56A5UMZG.js +0 -9
  125. package/dist/cdn/AZN2E5DL.js +0 -2
  126. package/dist/cdn/DFZZNKPK.js +0 -76
  127. package/dist/cdn/G3FTF6WH.js +0 -2
  128. package/dist/cdn/KDNGZ47C.js +0 -2
  129. package/dist/cdn/NIYB3TEW.js +0 -2
  130. package/dist/cdn/PBMTIFFX.js +0 -2
  131. package/dist/cdn/PECGJO2P.js +0 -2
  132. package/dist/cdn/Q5TICZRX.js +0 -15
  133. package/dist/cdn/QGCF64WY.js +0 -2
  134. package/dist/cdn/VO53567V.js +0 -2
  135. package/dist/cdn/WKS3TKDC.js +0 -2
  136. package/dist/cdn/YVIEKHQQ.js +0 -2
  137. package/dist/cdn/Z3B5KW2S.js +0 -2
  138. package/dist/chunks/initialAssessment.js +0 -79
  139. package/dist/chunks/responseOptionsBuilderExclusion.js +0 -12
  140. package/dist/chunks/responseOptionsDefault.js +0 -18
@@ -1,26 +1,26 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import { c as Ce } from "../../chunks/runtime.js";
3
- import { u as _e } from "../../chunks/useT9n.js";
2
+ import { c as _e } from "../../chunks/runtime.js";
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 Te, html as k } from "lit";
6
- import { unsafeHTML as Ee } from "lit/directives/unsafe-html.js";
5
+ import { css as Ee, html as I } from "lit";
6
+ import { unsafeHTML as Ae } from "lit/directives/unsafe-html.js";
7
7
  import { useContextConsumer as ee } from "@arcgis/lumina/context";
8
- import { c as Ae, b as Le } from "../../chunks/deployAppContexts.js";
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
- import { createRef as $e, ref as Re } from "lit-html/directives/ref.js";
13
- import { Annotation as b, StateGraph as z, START as j, END as x, NodeInterrupt as ne } from "@langchain/langgraph/web";
14
- import { createAgentRuntimeState as J, sendTraceMessage as v, invokeStructuredPrompt as E, getEmbeddings as Me, cosineSimilarity as Ne, invokeTextPrompt as Pe } from "@arcgis/ai-orchestrator";
15
- import r, { z as L } from "zod";
16
- import * as G from "@esri/arcgis-rest-portal";
17
- import { applyPatch as Be } from "fast-json-patch";
12
+ import { createRef as $e, ref as Me } from "lit-html/directives/ref.js";
13
+ import { Annotation as b, StateGraph as O, START as z, END as x, NodeInterrupt as ne } from "@langchain/langgraph/web";
14
+ import { createAgentRuntimeState as j, sendTraceMessage as w, invokeStructuredPrompt as T, getEmbeddings as Be, cosineSimilarity as Ne, invokeTextPrompt as Pe } from "@arcgis/ai-orchestrator";
15
+ import r, { z as D } from "zod";
16
+ import * as J from "@esri/arcgis-rest-portal";
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 { g as N, t as oe, r as ae, c as qe, d as D } from "../../chunks/templates.js";
20
+ import { t as oe, g as B, 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
- const ze = Te`: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)}`;
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)}`;
24
24
  async function y(t, e) {
25
25
  const s = Object.entries(t).find(
26
26
  ([n]) => n.endsWith(`/${e}.md`)
@@ -34,10 +34,10 @@ ${Object.keys(t).join(`
34
34
  );
35
35
  return await s[1]();
36
36
  }
37
- function B(t) {
37
+ function N(t) {
38
38
  return t?.configurable?.context?.translations;
39
39
  }
40
- function re(t) {
40
+ function le(t) {
41
41
  if (typeof window > "u" || t.length <= 1)
42
42
  return;
43
43
  const e = t.map((n) => n.solution.id), s = t.map((n) => n.solution.title);
@@ -59,7 +59,7 @@ function re(t) {
59
59
  }
60
60
  }));
61
61
  }
62
- function le(t) {
62
+ function ce(t) {
63
63
  if (typeof window > "u" || !t)
64
64
  return;
65
65
  const e = new CustomEvent("solutionIDFromAssistant", {
@@ -96,10 +96,10 @@ function Ge(t, e) {
96
96
  function Ve(t) {
97
97
  return t && t.helperServices.aiAssistantServices ? `${t.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/chat` : null;
98
98
  }
99
- function ce(t) {
99
+ function de(t) {
100
100
  return t && t.helperServices.aiAssistantServices ? `${t.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/api/pre-chat` : null;
101
101
  }
102
- async function O(t, e, s) {
102
+ async function U(t, e, s) {
103
103
  const n = await fetch(e, {
104
104
  method: "POST",
105
105
  headers: {
@@ -117,7 +117,7 @@ const He = (t) => new Promise((e) => setTimeout(e, t)), We = b.Root({
117
117
  // channels with the orchestrator's standard reducers/defaults so the
118
118
  // sub-agent reports back through the same shape the orchestrator
119
119
  // persists into priorSteps.
120
- ...J(),
120
+ ...j(),
121
121
  solutionResponse: b({
122
122
  reducer: (t, e) => e ?? null,
123
123
  default: () => null
@@ -133,9 +133,9 @@ const He = (t) => new Promise((e) => setTimeout(e, t)), We = b.Root({
133
133
  reducer: (t, e) => e ?? t,
134
134
  default: () => null
135
135
  })
136
- }), Ke = () => new z(We).addNode("initializeAgent", Ye).addNode("askSolutionsQuestions", Qe).addEdge(j, "initializeAgent").addEdge("initializeAgent", "askSolutionsQuestions").addEdge("askSolutionsQuestions", x), de = async (t, e, s, n) => {
136
+ }), Ke = () => new O(We).addNode("initializeAgent", Ye).addNode("askSolutionsQuestions", Qe).addEdge(z, "initializeAgent").addEdge("initializeAgent", "askSolutionsQuestions").addEdge("askSolutionsQuestions", x), ue = async (t, e, s, n) => {
137
137
  if (!t) return;
138
- const i = ce(t);
138
+ const i = de(t);
139
139
  if (!i) return;
140
140
  const a = { context: {
141
141
  kind: "DocAIAssistantRequest",
@@ -147,15 +147,15 @@ const He = (t) => new Promise((e) => setTimeout(e, t)), We = b.Root({
147
147
  }
148
148
  }
149
149
  } };
150
- n && (a.conversationId = n), O(a, i, e ?? "");
150
+ n && (a.conversationId = n), U(a, i, e ?? "");
151
151
  }, Qe = async (t, e) => {
152
- const s = B(e), n = t.documentSkillUrl;
152
+ const s = N(e), n = t.documentSkillUrl;
153
153
  let i = [];
154
- await v(
154
+ await w(
155
155
  { text: s.agentProgress.explorerAgentSearching },
156
156
  e
157
157
  );
158
- let o = await O(
158
+ let o = await U(
159
159
  {
160
160
  message: t.agentExecutionContext.userRequest,
161
161
  conversationId: e?.configurable?.context?.convoId ?? void 0,
@@ -182,24 +182,24 @@ const He = (t) => new Promise((e) => setTimeout(e, t)), We = b.Root({
182
182
  inquiryId: o.inquiryId
183
183
  }, l = "";
184
184
  const u = async (m) => {
185
- const h = m.context?.results?.[0]?.reply ?? "";
186
- if (h !== "") {
187
- const g = Je(h), A = Ge(g, e);
185
+ const f = m.context?.results?.[0]?.reply ?? "";
186
+ if (f !== "") {
187
+ const g = Je(f), A = Ge(g, e);
188
188
  l = A.source, i = [
189
189
  ...i,
190
190
  ...A.allMatches.filter(
191
- (C) => !i.some((_) => _.solution.id === C.solution.id)
191
+ (k) => !i.some((E) => E.solution.id === k.solution.id)
192
192
  )
193
193
  ];
194
194
  }
195
195
  const d = m.context?.results?.[0]?.status?.currentStatusStep;
196
196
  if (d) {
197
197
  let g = "";
198
- d === 1 ? g = s.agentProgress.explorerAgentReading : d === 2 ? g = s.agentProgress.explorerAgentReviewing : d === 3 && (g = s.agentProgress.explorerAgentPreparing), await v({ text: g }, e);
198
+ d === 1 ? g = s.agentProgress.explorerAgentReading : d === 2 ? g = s.agentProgress.explorerAgentReviewing : d === 3 && (g = s.agentProgress.explorerAgentPreparing), await w({ text: g }, e);
199
199
  }
200
200
  };
201
201
  for (await u(o); a.hasMore; )
202
- await He(500), o = await O(
202
+ await He(500), o = await U(
203
203
  {
204
204
  conversationId: a.conversationId,
205
205
  ackSequenceNumber: a.ackSequenceNumber,
@@ -214,12 +214,12 @@ const He = (t) => new Promise((e) => setTimeout(e, t)), We = b.Root({
214
214
  ackSequenceNumber: o.sequenceNumber,
215
215
  inquiryId: o.inquiryId
216
216
  }, await u(o);
217
- return ce(e?.configurable?.context.portal) && de(
217
+ return de(e?.configurable?.context.portal) && ue(
218
218
  e?.configurable?.context.portal,
219
219
  e?.configurable?.context.token ?? "",
220
220
  e?.configurable?.context.configContext.locale ?? "en",
221
221
  a.conversationId
222
- ), i.length && (i.length === 1 ? le(i[0].solution.id) : re(i)), {
222
+ ), i.length && (i.length === 1 ? ce(i[0].solution.id) : le(i)), {
223
223
  outputMessage: l,
224
224
  summary: l,
225
225
  status: "success",
@@ -233,7 +233,7 @@ const He = (t) => new Promise((e) => setTimeout(e, t)), We = b.Root({
233
233
  };
234
234
  };
235
235
  await y(je, "solutions_explorer_description");
236
- const ue = (t) => {
236
+ const pe = (t) => {
237
237
  if (t && Array.isArray(t.id) && t.id.length > 0)
238
238
  return t.id[t.id.length - 1].replace("Message", "").toLowerCase();
239
239
  if (t && typeof t._getType == "function")
@@ -244,7 +244,7 @@ const ue = (t) => {
244
244
  }
245
245
  return "human";
246
246
  }, Xe = (t) => {
247
- const e = ue(t);
247
+ const e = pe(t);
248
248
  if (t && t.kwargs)
249
249
  return {
250
250
  role: e,
@@ -259,7 +259,7 @@ const ue = (t) => {
259
259
  return t.id && (s.id = t.id), t.name && (s.name = t.name), t.additional_kwargs && (s.additional_kwargs = t.additional_kwargs), t.response_metadata && (s.response_metadata = t.response_metadata), s;
260
260
  }
261
261
  return { role: "human", content: String(t) };
262
- }, Ze = (t) => ue(t) === "human", et = (t, e = 3) => t.filter((s) => Ze(s)).slice(-e).map(Xe), tt = (t, e = " ") => et(t).map((i) => i.content).join(e).trim(), st = { understandingRequest: "Understanding your request...", selectTemplatePrompt: "This use case could be supported in a few different ways. Choose the option that best matches what you want to accomplish.", searchingExistingSolutions: "Searching for existing solutions...", existingSolutionMatch: "I found one or more existing solutions that match your use case. These are ready-to-use solutions that may already meet your needs and can be deployed now. Do you want to continue building your own solution?", continueBuildingYes: "Yes, I want to build a new solution", continueBuildingNo: "No, I’ll review existing solutions", continueBuildingDeclined: "Sounds good. We can focus on existing solutions. Let me know if I can help answer any questions or provide more details.", creatingDesign: "Generating solution design...", updatingDesign: "Updating solution design...", applyChangeFailed: "I wasn't able to apply that change. The design was not modified. Please try rephrasing your request.", createDesignFailed: "I wasn't able to create a solution design from that request. Please try rephrasing and try again.", discardMessage: "Are you sure you want to discard your solution?", discardForNewSolution: "I can help you build a new solution, but I will need to discard your current solution design. Do you want to continue?" }, nt = {
262
+ }, Ze = (t) => pe(t) === "human", et = (t, e = 3) => t.filter((s) => Ze(s)).slice(-e).map(Xe), tt = (t, e = " ") => et(t).map((i) => i.content).join(e).trim(), st = { understandingRequest: "Understanding your request...", selectTemplatePrompt: "This use case could be supported in a few different ways. Choose the option that best matches what you want to accomplish.", searchingExistingSolutions: "Searching for existing solutions...", existingSolutionMatch: "I found one or more existing solutions that match your use case. These are ready-to-use solutions that may already meet your needs and can be deployed now. Do you want to continue building your own solution?", continueBuildingYes: "Yes, I want to build a new solution", continueBuildingNo: "No, I’ll review existing solutions", continueBuildingDeclined: "Sounds good. We can focus on existing solutions. Let me know if I can help answer any questions or provide more details.", creatingDesign: "Generating solution design...", updatingDesign: "Updating solution design...", applyChangeFailed: "I wasn't able to apply that change. The design was not modified. Please try rephrasing your request.", createDesignFailed: "I wasn't able to create a solution design from that request. Please try rephrasing and try again.", discardMessage: "Are you sure you want to discard your solution?", discardForNewSolution: "I can help you build a new solution, but I will need to discard your current solution design. Do you want to continue?" }, nt = {
263
263
  builderMessages: st
264
264
  }, it = /* @__PURE__ */ new Set([
265
265
  "add",
@@ -326,7 +326,7 @@ const ue = (t) => {
326
326
  "view",
327
327
  "where"
328
328
  ]);
329
- class pe {
329
+ class me {
330
330
  constructor(e, s, n = !0) {
331
331
  this.isValid = !0, this.issues = [], this.fieldNameRegistry = null, this.response = e, this.template = s, this.newDesign = n, this.validate();
332
332
  }
@@ -414,7 +414,7 @@ class pe {
414
414
  ...e.customFields,
415
415
  ...e.requiredFields,
416
416
  ...c
417
- ].map((h) => h.name);
417
+ ].map((f) => f.name);
418
418
  m.length !== new Set(m).size && this.logIssue(`Layer '${e.name}' has duplicate fields: ${JSON.stringify(m)}.`);
419
419
  }
420
420
  const l = e.systemFields ?? [], u = [...e.customFields, ...e.requiredFields, ...l].map((c) => c.name.toLowerCase());
@@ -504,7 +504,7 @@ const ot = r.object({
504
504
  itemId: r.string().describe("ArcGIS item id for the feature layer."),
505
505
  addLayers: r.boolean().describe("Indicates whether new layers can be added during solution design."),
506
506
  layers: r.array(rt)
507
- }), V = r.object({
507
+ }), G = r.object({
508
508
  response: r.string().describe("Conversational response to the user's query."),
509
509
  solution: r.object({
510
510
  itemId: r.string().nullable().describe("ArcGIS item id of the source Solution template used for deployment. Preserve the existing value exactly when known; otherwise use null."),
@@ -526,17 +526,21 @@ const ot = r.object({
526
526
  }), ut = r.object({
527
527
  response: r.string().describe("Short, user-friendly explanation of why the requested update was not applied.")
528
528
  }), pt = r.object({
529
- matchedTitles: r.array(r.string()).describe("Titles of solutions that match the user's request. Empty array if no strong match.")
529
+ assistantResponse: r.string().describe("Natural-language response for the user."),
530
+ isValidUpdate: r.boolean().describe("True only when the request is in scope for supported design updates.")
530
531
  }), mt = r.object({
532
+ matchedTitles: r.array(r.string()).describe("Titles of solutions that match the user's request. Empty array if no strong match.")
533
+ }), gt = r.object({
531
534
  templateId: r.string().min(1).describe("Template id from the available template list."),
532
535
  confidence: r.number().min(0).max(1).describe("Confidence score from 0 to 1 for this template match."),
533
- templateDescription: r.string().min(1).describe("Short description this template in the user's use case/workflow.")
534
- }), gt = r.object({
535
- assistantResponse: r.string().describe("Natural-language response for the user."),
536
+ templateDescription: r.string().min(1).describe("Short action‑oriented description of the template in the user's use case/workflow, starting with a verb.")
537
+ }), ht = r.object({
538
+ assistantResponse: r.string().nullable().describe("Natural-language response for the user."),
536
539
  isValidUseCase: r.boolean().describe("True only when the request is concrete, appropriate, and has at least one matching template."),
537
- matchedTemplates: r.array(mt).describe("Ordered list of matching templates, best match first. Empty when no valid match exists.")
538
- }), ht = (t) => t.length ? t.map((e, s) => `${s + 1}. ${e}`).join(`
539
- `) : "No validation errors were provided.", ft = async (t) => {
540
+ matchedTemplates: r.array(gt).describe("Ordered list of matching templates, best match first. Empty when no valid match exists."),
541
+ rationale: r.string().min(1).describe("A brief rationale for the choice for isValidUseCase and matchedTemplates (≤140 characters)")
542
+ }), ft = (t) => t.length ? t.map((e, s) => `${s + 1}. ${e}`).join(`
543
+ `) : "No validation errors were provided.", bt = async (t) => {
540
544
  const {
541
545
  query: e,
542
546
  validationIssues: s,
@@ -545,7 +549,7 @@ const ot = r.object({
545
549
  promptModules: o
546
550
  } = t;
547
551
  try {
548
- return (await E({
552
+ return (await T({
549
553
  promptText: await y(o, "explainValidationFailure"),
550
554
  modelTier: "fast",
551
555
  temperature: 0,
@@ -554,7 +558,7 @@ const ot = r.object({
554
558
  inputVariables: {
555
559
  query: e,
556
560
  validationIssueCount: String(s.length),
557
- validationIssues: ht(s)
561
+ validationIssues: ft(s)
558
562
  }
559
563
  })).response?.trim() || i;
560
564
  } catch (a) {
@@ -563,32 +567,33 @@ const ot = r.object({
563
567
  { error: a }
564
568
  ), i;
565
569
  }
566
- }, H = (t) => t in D, bt = 5, yt = 0.8, xt = 0.15, vt = "Web Mapping Application", wt = "Embeddings";
567
- let $ = null, U = null, R = null, M = null;
568
- const St = "Build", T = /* @__PURE__ */ Object.assign({
570
+ }, V = (t) => t in L, yt = 5, vt = 0.8, xt = 0.15, wt = "Web Mapping Application", St = "Embeddings";
571
+ let F = null, q = null, $ = null, M = null;
572
+ const It = "Build", C = /* @__PURE__ */ Object.assign({
573
+ "./prompts/assessBuildRequest.md": () => import("../../chunks/assessBuildRequest.js").then((t) => t.default),
574
+ "./prompts/assessUpdateRequest.md": () => import("../../chunks/assessUpdateRequest.js").then((t) => t.default),
569
575
  "./prompts/description.md": () => import("../../chunks/description2.js").then((t) => t.default),
570
576
  "./prompts/designSolution.md": () => import("../../chunks/designSolution.js").then((t) => t.default),
571
577
  "./prompts/explainValidationFailure.md": () => import("../../chunks/explainValidationFailure.js").then((t) => t.default),
572
578
  "./prompts/findExistingSolution.md": () => import("../../chunks/findExistingSolution.js").then((t) => t.default),
573
- "./prompts/initialAssessment.md": () => import("../../chunks/initialAssessment.js").then((t) => t.default),
574
579
  "./prompts/updateDesign.md": () => import("../../chunks/updateDesign.js").then((t) => t.default)
575
- }), It = nt.builderMessages, f = (t, e, s) => B(e)?.builderMessages?.[t] ?? It[t], me = (t) => {
580
+ }), Ct = nt.builderMessages, h = (t, e, s) => N(e)?.builderMessages?.[t] ?? Ct[t], ge = (t) => {
576
581
  typeof window < "u" && window.dispatchEvent(new CustomEvent("arcgis-solution-design-update", {
577
582
  detail: t
578
583
  }));
579
- }, Ct = async (t, e, s) => {
584
+ }, _t = async (t, e, s) => {
580
585
  if (!t) return null;
581
- const n = `type:"${vt}" AND typekeywords:${wt} AND group:${t}`;
582
- return (await G.searchItems({
586
+ const n = `type:"${wt}" AND typekeywords:${St} AND group:${t}`;
587
+ return (await J.searchItems({
583
588
  q: n,
584
589
  params: e ? { token: e } : void 0,
585
590
  portal: s,
586
591
  num: 1
587
592
  }))?.results?.[0] ?? null;
588
593
  };
589
- async function _t(t, e, s) {
594
+ async function Tt(t, e, s) {
590
595
  try {
591
- const n = await Ct(t, e, s);
596
+ const n = await _t(t, e, s);
592
597
  if (!n) return null;
593
598
  const i = new Oe({ id: n.id });
594
599
  return await i.load(), await i.fetchData("json");
@@ -598,16 +603,16 @@ async function _t(t, e, s) {
598
603
  }
599
604
  const kt = async (t, e, s) => {
600
605
  if (!t) return [];
601
- const n = `type:Solution AND typekeywords:${St} AND group:${t}`;
602
- return (await G.searchItems({
606
+ const n = `type:Solution AND typekeywords:${It} AND group:${t}`;
607
+ return (await J.searchItems({
603
608
  q: n,
604
609
  params: e ? { token: e } : void 0,
605
610
  portal: s,
606
611
  num: 100
607
612
  }))?.results ?? [];
608
- }, Tt = async (t, e, s) => {
613
+ }, Et = async (t, e, s) => {
609
614
  try {
610
- const n = await G.getItemData(t, {
615
+ const n = await J.getItemData(t, {
611
616
  params: e ? { token: e } : void 0,
612
617
  portal: s
613
618
  }), i = n?.buildSolution;
@@ -617,7 +622,7 @@ const kt = async (t, e, s) => {
617
622
  } catch {
618
623
  return null;
619
624
  }
620
- }, I = (t, e = {}) => {
625
+ }, _ = (t, e = {}) => {
621
626
  let s = t;
622
627
  return "itemId" in e && (s = {
623
628
  ...s,
@@ -635,7 +640,7 @@ const kt = async (t, e, s) => {
635
640
  ...s,
636
641
  templateId: e.templateId ?? null
637
642
  }), s;
638
- }, ge = (t, e) => {
643
+ }, he = (t, e) => {
639
644
  if (t == null || e == null)
640
645
  return { ok: !1, error: "design or sourceBuildSolution is null/undefined" };
641
646
  try {
@@ -647,14 +652,14 @@ const kt = async (t, e, s) => {
647
652
  error: s instanceof Error ? s.stack ?? s.message : String(s)
648
653
  };
649
654
  }
650
- }, W = async (t) => {
651
- if (U) {
652
- Object.entries(U).forEach(([a, l]) => {
653
- D[a] && (D[a].initialTemplate = l);
655
+ }, H = async (t) => {
656
+ if (q) {
657
+ Object.entries(q).forEach(([a, l]) => {
658
+ L[a] && (L[a].initialTemplate = l);
654
659
  });
655
660
  return;
656
661
  }
657
- const e = t?.configurable?.context?.token, s = fe(t), n = be(t);
662
+ const e = t?.configurable?.context?.token, s = be(t), n = ye(t);
658
663
  if (!s) {
659
664
  console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping live template hydration.");
660
665
  return;
@@ -665,9 +670,9 @@ const kt = async (t, e, s) => {
665
670
  if (!l || typeof l != "object") return;
666
671
  const u = l.id;
667
672
  if (typeof u != "string" || o[u]) return;
668
- const c = await Tt(a.id, e, n);
673
+ const c = await Et(a.id, e, n);
669
674
  if (!c) return;
670
- const { buildSolution: m, params: h } = c;
675
+ const { buildSolution: m, params: f } = c;
671
676
  if (typeof m == "object" && m !== null && "solution" in m) {
672
677
  const g = m.solution;
673
678
  g.thumbnailUrl = a.thumbnail ? `${n ?? "https://www.arcgis.com/sharing/rest"}/content/items/${a.id}/info/${a.thumbnail}` : void 0, g.item = a;
@@ -676,66 +681,66 @@ const kt = async (t, e, s) => {
676
681
  ...l,
677
682
  buildSolution: m
678
683
  };
679
- o[u] = I(
684
+ o[u] = _(
680
685
  new ie(d).dumpToLlmTemplate(),
681
686
  {
682
687
  itemId: a.id,
683
688
  sourceBuildSolution: structuredClone(m),
684
- params: h ? structuredClone(h) : null
689
+ params: f ? structuredClone(f) : null
685
690
  }
686
- ), D[u] = {
691
+ ), L[u] = {
687
692
  ...l,
688
693
  initialTemplate: o[u]
689
694
  };
690
- })), U = o;
691
- }, he = (t) => {
695
+ })), q = o;
696
+ }, fe = (t) => {
692
697
  const e = t?.configurable?.context?.token;
693
698
  return typeof e != "string" || !e.trim() ? null : e;
694
- }, fe = (t) => {
699
+ }, be = (t) => {
695
700
  const e = t?.configurable?.context?.configContext?.primarySolutionsGroupId;
696
701
  return typeof e != "string" || !e.trim() ? null : e;
697
- }, be = (t) => {
702
+ }, ye = (t) => {
698
703
  const e = t?.configurable?.context?.configContext?.portalURL;
699
704
  if (!(typeof e != "string" || !e.trim()))
700
705
  return `${e.replace(/\/+$/, "")}/sharing/rest`;
701
- }, Et = async (t) => {
706
+ }, At = async (t) => {
702
707
  await Promise.all([
703
708
  xe(t),
704
- W(t)
709
+ H(t)
705
710
  ]);
706
- }, ye = async (t) => {
707
- const e = he(t);
708
- (!R || e && e !== M) && (M = e ?? M, R = Et(t).catch((n) => {
709
- throw R = null, M = null, n;
710
- })), await R;
711
+ }, ve = async (t) => {
712
+ const e = fe(t);
713
+ (!$ || e && e !== M) && (M = e ?? M, $ = At(t).catch((n) => {
714
+ throw $ = null, M = null, n;
715
+ })), await $;
711
716
  };
712
717
  async function xe(t) {
713
- if ($) return $;
714
- const e = fe(t);
718
+ if (F) return F;
719
+ const e = be(t);
715
720
  if (!e)
716
721
  return console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping embeddings load."), null;
717
- const s = be(t), n = t?.configurable?.context?.configContext?.portalURL;
722
+ const s = ye(t), n = t?.configurable?.context?.configContext?.portalURL;
718
723
  await new Ue(n ? { url: n } : void 0).load();
719
- const o = he(t) ?? void 0, a = await _t(e, o, s);
720
- return a ? ($ = a.items, $) : null;
724
+ const o = fe(t) ?? void 0, a = await Tt(e, o, s);
725
+ return a ? (F = a.items, F) : null;
721
726
  }
722
- const At = () => Object.entries(D).map(([t, e]) => `ID: ${t}
727
+ const Lt = () => Object.entries(L).map(([t, e]) => `ID: ${t}
723
728
  Label: ${e.label}
724
729
  Description: ${e.description}`).join(`
725
730
 
726
- `), Lt = (t) => {
731
+ `), Rt = (t) => {
727
732
  const e = t?.configurable?.context?.solutionDesignJson;
728
733
  if (typeof e != "string" || !e.trim())
729
734
  return null;
730
735
  try {
731
- const s = JSON.parse(e), n = I(
736
+ const s = JSON.parse(e), n = _(
732
737
  { response: "", ...s },
733
738
  { itemId: s?.solution?.itemId ?? null }
734
- ), i = V.safeParse(n);
739
+ ), i = G.safeParse(n);
735
740
  if (!i.success)
736
741
  return null;
737
- const { response: o, ...a } = i.data, l = s.templateId, u = typeof l == "string" && H(l) ? l : null;
738
- return I(
742
+ const { response: o, ...a } = i.data, l = s.templateId, u = typeof l == "string" && V(l) ? l : null;
743
+ return _(
739
744
  a,
740
745
  {
741
746
  sourceBuildSolution: s.sourceBuildSolution,
@@ -747,7 +752,7 @@ Description: ${e.description}`).join(`
747
752
  return null;
748
753
  }
749
754
  }, Dt = b.Root({
750
- ...J(),
755
+ ...j(),
751
756
  /** Optional human-readable template description retained for UI use. */
752
757
  templateDescription: b({
753
758
  reducer: (t, e) => typeof e == "string" || e === null ? e : t ?? null,
@@ -768,6 +773,11 @@ Description: ${e.description}`).join(`
768
773
  reducer: (t = null, e) => e === void 0 ? t : e ?? null,
769
774
  default: () => null
770
775
  }),
776
+ /** Update request assessment produced when an active design exists. */
777
+ updateAssessment: b({
778
+ reducer: (t = null, e) => e === void 0 ? t : e ?? null,
779
+ default: () => null
780
+ }),
771
781
  /** Existing solution matches surfaced before building a new solution. */
772
782
  existingMatches: b({
773
783
  reducer: (t = [], e) => e === void 0 ? t : e ?? [],
@@ -779,46 +789,77 @@ Description: ${e.description}`).join(`
779
789
  default: () => null
780
790
  })
781
791
  }), Ft = (t, e) => {
782
- const s = Lt(e), n = s?.templateId ?? null, i = {};
792
+ const s = Rt(e), n = s?.templateId ?? null, i = {};
783
793
  return JSON.stringify(t.currentDesign) !== JSON.stringify(s) && (i.currentDesign = s), n && t.selectedTemplate !== n && (i.selectedTemplate = n), i;
784
794
  }, $t = async (t, e) => {
785
- await v({ text: f("understandingRequest", e) }, e), await ye(e);
786
- const s = t.agentExecutionContext.userRequest, n = At(), i = t.agentExecutionContext.messages.slice(-11), o = await E({
787
- promptText: await y(T, "initialAssessment"),
795
+ await w({ text: h("understandingRequest", e) }, e), await ve(e);
796
+ const s = t.agentExecutionContext.userRequest, n = Lt(), i = t.agentExecutionContext.messages.slice(-11), o = await T({
797
+ promptText: await y(C, "assessBuildRequest"),
788
798
  modelTier: "advanced",
789
799
  temperature: 0,
790
- schema: gt,
800
+ schema: ht,
791
801
  messages: i,
792
802
  inputVariables: { query: s, availableTemplates: n }
793
803
  }), a = o.matchedTemplates.filter(
794
- (d) => H(d.templateId)
804
+ (d) => V(d.templateId)
795
805
  ), l = {
796
806
  ...o,
797
807
  matchedTemplates: a
798
- }, [u, c] = a, h = !!u && u.confidence >= yt && (c === void 0 || u.confidence - c.confidence >= xt) ? u.templateId : null;
808
+ }, [u, c] = a, f = !!u && u.confidence >= vt && (c === void 0 || u.confidence - c.confidence >= xt) ? u.templateId : null;
799
809
  return {
800
810
  assessment: l,
801
- selectedTemplate: h,
811
+ selectedTemplate: f,
802
812
  existingMatches: [],
803
813
  continueBuilding: null
804
814
  };
805
- }, Rt = (t) => {
815
+ }, Mt = (t) => {
806
816
  const e = t.assessment?.assistantResponse ?? "";
807
817
  return {
808
818
  outputMessage: e,
809
819
  summary: e,
810
820
  status: "success"
811
821
  };
812
- }, Mt = (t, e) => {
822
+ }, Bt = async (t, e) => {
823
+ const { currentDesign: s } = t;
824
+ if (!s)
825
+ return {
826
+ updateAssessment: {
827
+ assistantResponse: "",
828
+ isValidUpdate: !0
829
+ }
830
+ };
831
+ await w({ text: h("understandingRequest", e) }, e);
832
+ const n = t.agentExecutionContext.userRequest, i = t.agentExecutionContext.messages.slice(-11);
833
+ return {
834
+ updateAssessment: await T({
835
+ promptText: await y(C, "assessUpdateRequest"),
836
+ modelTier: "advanced",
837
+ temperature: 0,
838
+ schema: pt,
839
+ messages: i,
840
+ inputVariables: {
841
+ currentDesign: JSON.stringify(oe(s)),
842
+ query: n
843
+ }
844
+ })
845
+ };
846
+ }, Nt = (t, e) => {
847
+ const s = t.updateAssessment?.assistantResponse ?? h("applyChangeFailed", e);
848
+ return {
849
+ outputMessage: s,
850
+ summary: s,
851
+ status: "success"
852
+ };
853
+ }, Pt = (t, e) => {
813
854
  const { hitlResponse: s } = e.configurable, n = "selectTemplate", i = t.assessment?.matchedTemplates.filter(
814
- (c) => H(c.templateId)
855
+ (c) => V(c.templateId)
815
856
  ) ?? [], o = i.map((c) => `${c.templateDescription}`);
816
857
  if (s?.agentId !== "solutionBuilder" || s.id !== n) {
817
858
  const c = {
818
859
  agentId: "solutionBuilder",
819
860
  id: n,
820
861
  kind: "singleSelection",
821
- message: f("selectTemplatePrompt", e),
862
+ message: h("selectTemplatePrompt", e),
822
863
  metadata: [...o]
823
864
  };
824
865
  throw new ne(c);
@@ -827,19 +868,19 @@ Description: ${e.description}`).join(`
827
868
  return {
828
869
  selectedTemplate: (l >= 0 ? i[l] : void 0)?.templateId ?? i[0]?.templateId ?? null
829
870
  };
830
- }, Nt = async (t, e) => {
831
- await v({ text: f("searchingExistingSolutions", e) }, e);
871
+ }, qt = async (t, e) => {
872
+ await w({ text: h("searchingExistingSolutions", e) }, e);
832
873
  const s = t.agentExecutionContext.userRequest, n = tt(t.agentExecutionContext.messages) || s, i = await xe(e);
833
874
  if (!i)
834
875
  return console.warn("Solutions Search: failed to load solution embeddings cache; skipping search."), { existingMatches: [] };
835
876
  if (!i.length)
836
877
  return { existingMatches: [] };
837
- const [o] = await Me([n]), a = i.map((d) => ({
878
+ const [o] = await Be([n]), a = i.map((d) => ({
838
879
  solution: d,
839
880
  score: Ne(o, d.embedding)
840
881
  }));
841
882
  a.sort((d, g) => g.score - d.score);
842
- const l = a.slice(0, bt);
883
+ const l = a.slice(0, yt);
843
884
  if (!l.length)
844
885
  return { existingMatches: [] };
845
886
  const u = l.map(({ solution: d }) => `${d.title}
@@ -847,21 +888,21 @@ Snippet: ${d.snippet}
847
888
  Description: ${d.description}`).join(`
848
889
 
849
890
  `), c = t.agentExecutionContext.messages.slice(-11);
850
- return { existingMatches: (await E({
851
- promptText: await y(T, "findExistingSolution"),
891
+ return { existingMatches: (await T({
892
+ promptText: await y(C, "findExistingSolution"),
852
893
  modelTier: "fast",
853
894
  temperature: 0,
854
- schema: pt,
895
+ schema: mt,
855
896
  messages: c,
856
897
  inputVariables: { query: s, candidates: u }
857
898
  })).matchedTitles.map((d) => l.find(({ solution: g }) => g.title === d)).filter((d) => d !== void 0) };
858
- }, Pt = (t, e) => {
899
+ }, Ut = (t, e) => {
859
900
  const { existingMatches: s } = t, { hitlResponse: n } = e.configurable, i = `confirmExistingSolution:${s[0].solution.id}`;
860
901
  if (n?.agentId !== "solutionBuilder" || n.id !== i) {
861
- s.length === 1 ? le(s[0].solution.id) : re(s);
862
- const u = f("existingSolutionMatch", e), c = [
863
- f("continueBuildingYes", e),
864
- f("continueBuildingNo", e)
902
+ s.length === 1 ? ce(s[0].solution.id) : le(s);
903
+ const u = h("existingSolutionMatch", e), c = [
904
+ h("continueBuildingYes", e),
905
+ h("continueBuildingNo", e)
865
906
  ], m = {
866
907
  agentId: "solutionBuilder",
867
908
  id: i,
@@ -871,95 +912,107 @@ Description: ${d.description}`).join(`
871
912
  };
872
913
  throw new ne(m);
873
914
  }
874
- const o = String(n.payload ?? "").trim(), a = f("continueBuildingNo", e);
915
+ const o = String(n.payload ?? "").trim(), a = h("continueBuildingNo", e);
875
916
  return { continueBuilding: o !== a };
876
- }, Bt = (t, e) => {
877
- const s = f("continueBuildingDeclined", e);
917
+ }, Ot = (t, e) => {
918
+ const s = h("continueBuildingDeclined", e);
878
919
  return {
879
920
  outputMessage: s,
880
921
  summary: s,
881
922
  status: "success"
882
923
  };
883
- }, ve = async (t, e) => {
884
- await ye(e);
924
+ }, we = async (t, e) => {
925
+ await ve(e);
885
926
  const { currentDesign: s } = t, n = t.agentExecutionContext.userRequest;
886
- await v({ text: f("creatingDesign", e) }, e);
887
- let i = N(t.selectedTemplate);
888
- if (i?.initialTemplate || (await W(e), i = N(t.selectedTemplate)), !i?.initialTemplate)
927
+ 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)
889
930
  throw new Error("No hydrated templates are available for solution design.");
890
- const o = I(
931
+ const o = _(
891
932
  s ?? i.initialTemplate,
892
933
  {
893
934
  itemId: (s ?? i.initialTemplate)?.solution?.itemId ?? null,
894
935
  sourceBuildSolution: s?.sourceBuildSolution ?? i.initialTemplate.sourceBuildSolution,
895
936
  params: s?.params ?? i.initialTemplate.params ?? null
896
937
  }
897
- ), a = t.agentExecutionContext.messages.slice(-11), l = await E({
898
- promptText: await y(T, "designSolution"),
938
+ ), a = t.agentExecutionContext.messages.slice(-11), l = await T({
939
+ promptText: await y(C, "designSolution"),
899
940
  modelTier: "advanced",
900
941
  temperature: 0,
901
- schema: V,
942
+ schema: G,
902
943
  messages: a,
903
944
  inputVariables: {
904
- currentDesign: JSON.stringify(oe(o)),
945
+ currentDesign: JSON.stringify(ae(o)),
905
946
  templateInstructions: i.instructions,
906
947
  query: n
907
948
  }
908
- }), { response: u, featureLayer: c, ...m } = l, h = ae(
949
+ }), { response: u, featureLayer: c, ...m } = l, f = re(
909
950
  c,
910
951
  o.featureLayer
911
- ), d = I(
912
- { ...m, featureLayer: h },
952
+ ), d = _(
953
+ { ...m, featureLayer: f },
913
954
  {
914
955
  itemId: o?.solution?.itemId,
915
956
  sourceBuildSolution: o.sourceBuildSolution,
916
957
  templateId: t.selectedTemplate ?? null,
917
958
  params: o.params ?? null
918
959
  }
919
- ), g = new pe(d, i.initialTemplate);
960
+ ), g = new me(d, i.initialTemplate);
920
961
  if (!g.isValid)
921
962
  return console.warn(
922
963
  "[SolutionBuilder] designSolution validation failed:",
923
964
  { issues: g.issues, llmResponse: l }
924
965
  ), {
925
- outputMessage: f("createDesignFailed", e)
966
+ outputMessage: h("createDesignFailed", e)
926
967
  };
927
- const A = d.sourceBuildSolution, C = ge(d, A);
928
- if (!C.ok) {
968
+ const A = d.sourceBuildSolution, k = he(d, A);
969
+ if (!k.ok) {
929
970
  console.warn(
930
971
  "[SolutionBuilder] designSolution Esri JSON conversion failed:",
931
- { error: C.error, llmResponse: l, design: d }
972
+ { error: k.error, llmResponse: l, design: d }
932
973
  );
933
- const _ = f("createDesignFailed", e);
974
+ const E = h("createDesignFailed", e);
934
975
  return {
935
- outputMessage: _,
936
- summary: _,
976
+ outputMessage: E,
977
+ summary: E,
937
978
  status: "success"
938
979
  };
939
980
  }
940
- return me(d), {
981
+ return ge(d), {
941
982
  outputMessage: u,
942
983
  summary: u,
943
984
  status: "success",
944
985
  currentDesign: d
945
986
  };
946
- }, qt = async (t, e) => {
987
+ }, zt = async (t, e) => {
947
988
  const { currentDesign: s } = t;
948
989
  if (!s)
949
- return ve(t, e);
990
+ return we(t, e);
950
991
  const n = t.agentExecutionContext.userRequest, i = t.agentExecutionContext.messages.slice(-11);
951
- await v({ text: f("updatingDesign", e) }, e);
952
- const o = await E({
953
- promptText: await y(T, "updateDesign"),
954
- modelTier: "advanced",
955
- temperature: 0,
956
- schema: dt,
957
- messages: i,
958
- inputVariables: {
959
- currentDesign: JSON.stringify(qe(s)),
960
- query: n
961
- }
962
- }), { response: a, patches: l } = o;
992
+ await w({ text: h("updatingDesign", e) }, e);
993
+ let o;
994
+ try {
995
+ o = await T({
996
+ promptText: await y(C, "updateDesign"),
997
+ modelTier: "advanced",
998
+ temperature: 0,
999
+ schema: dt,
1000
+ messages: i,
1001
+ inputVariables: {
1002
+ currentDesign: JSON.stringify(oe(s)),
1003
+ query: n
1004
+ }
1005
+ });
1006
+ } catch (p) {
1007
+ console.warn("[SolutionBuilder] updateDesign structured prompt failed:", p);
1008
+ const v = h("applyChangeFailed", e);
1009
+ return {
1010
+ outputMessage: v,
1011
+ summary: v,
1012
+ status: "success"
1013
+ };
1014
+ }
1015
+ const { response: a, patches: l } = o;
963
1016
  if (!l || l.length === 0)
964
1017
  return {
965
1018
  outputMessage: a,
@@ -970,7 +1023,7 @@ Description: ${d.description}`).join(`
970
1023
  try {
971
1024
  return JSON.parse(p);
972
1025
  } catch {
973
- const S = p.replace(/[\u0000-\u001F]/g, (Y) => {
1026
+ const v = p.replace(/[\u0000-\u001F]/g, (Y) => {
974
1027
  switch (Y) {
975
1028
  case "\b":
976
1029
  return "\\b";
@@ -988,7 +1041,7 @@ Description: ${d.description}`).join(`
988
1041
  }
989
1042
  });
990
1043
  try {
991
- return JSON.parse(S);
1044
+ return JSON.parse(v);
992
1045
  } catch {
993
1046
  return p;
994
1047
  }
@@ -998,44 +1051,44 @@ Description: ${d.description}`).join(`
998
1051
  path: p.path.replace(/\/+$/, ""),
999
1052
  ...p.value != null && p.value !== "" ? { value: u(p.value) } : {},
1000
1053
  ...p.from != null && p.from !== "" ? { from: p.from } : {}
1001
- }))].sort((p, S) => p.op !== "remove" || S.op !== "remove" ? 0 : S.path.localeCompare(p.path, void 0, { numeric: !0 })), h = structuredClone(
1002
- oe(s)
1054
+ }))].sort((p, v) => p.op !== "remove" || v.op !== "remove" ? 0 : v.path.localeCompare(p.path, void 0, { numeric: !0 })), f = structuredClone(
1055
+ ae(s)
1003
1056
  );
1004
1057
  try {
1005
- Be(h, m, !0);
1058
+ qe(f, m, !0);
1006
1059
  } catch (p) {
1007
1060
  console.warn(
1008
1061
  "[SolutionBuilder] updateDesign JSON patch failed:",
1009
- { error: p, llmResponse: o, patches: m, patchTarget: h }
1062
+ { error: p, llmResponse: o, patches: m, patchTarget: f }
1010
1063
  );
1011
- const S = f("applyChangeFailed", e);
1064
+ const v = h("applyChangeFailed", e);
1012
1065
  return {
1013
- outputMessage: S,
1014
- summary: S,
1066
+ outputMessage: v,
1067
+ summary: v,
1015
1068
  status: "success"
1016
1069
  };
1017
1070
  }
1018
- const d = I(
1019
- { response: "", ...h },
1071
+ const d = _(
1072
+ { response: "", ...f },
1020
1073
  { itemId: s.solution?.itemId ?? null }
1021
- ), g = V.safeParse(d);
1074
+ ), g = G.safeParse(d);
1022
1075
  if (!g.success) {
1023
1076
  console.warn(
1024
1077
  "[SolutionBuilder] updateDesign schema validation failed:",
1025
1078
  { errors: g.error.issues, llmResponse: o, patchedDesign: d }
1026
1079
  );
1027
- const p = f("applyChangeFailed", e);
1080
+ const p = h("applyChangeFailed", e);
1028
1081
  return {
1029
1082
  outputMessage: p,
1030
1083
  summary: p,
1031
1084
  status: "success"
1032
1085
  };
1033
1086
  }
1034
- const { response: A, featureLayer: C, ..._ } = g.data, Se = ae(
1035
- C,
1087
+ const { response: A, featureLayer: k, ...E } = g.data, Ie = re(
1088
+ k,
1036
1089
  s.featureLayer
1037
- ), w = I(
1038
- { ..._, featureLayer: Se },
1090
+ ), S = _(
1091
+ { ...E, featureLayer: Ie },
1039
1092
  {
1040
1093
  itemId: s.solution?.itemId,
1041
1094
  sourceBuildSolution: s.sourceBuildSolution,
@@ -1043,21 +1096,21 @@ Description: ${d.description}`).join(`
1043
1096
  params: s.params ?? null
1044
1097
  }
1045
1098
  );
1046
- let F = N(t.selectedTemplate);
1047
- if (F?.initialTemplate || (await W(e), F = N(t.selectedTemplate)), !F?.initialTemplate)
1099
+ let R = B(t.selectedTemplate);
1100
+ if (R?.initialTemplate || (await H(e), R = B(t.selectedTemplate)), !R?.initialTemplate)
1048
1101
  throw new Error("No hydrated templates are available for solution design.");
1049
- const q = new pe(w, F.initialTemplate, !1);
1050
- if (!q.isValid) {
1102
+ const P = new me(S, R.initialTemplate, !1);
1103
+ if (!P.isValid) {
1051
1104
  console.warn(
1052
1105
  "[SolutionBuilder] updateDesign validation failed:",
1053
- { issues: q.issues, llmResponse: o, patchedDesign: w }
1106
+ { issues: P.issues, llmResponse: o, patchedDesign: S }
1054
1107
  );
1055
- const p = await ft({
1108
+ const p = await bt({
1056
1109
  query: n,
1057
- validationIssues: q.issues,
1110
+ validationIssues: P.issues,
1058
1111
  recentMessages: i,
1059
- fallbackMessage: f("applyChangeFailed", e),
1060
- promptModules: T
1112
+ fallbackMessage: h("applyChangeFailed", e),
1113
+ promptModules: C
1061
1114
  });
1062
1115
  return {
1063
1116
  outputMessage: p,
@@ -1065,58 +1118,58 @@ Description: ${d.description}`).join(`
1065
1118
  status: "success"
1066
1119
  };
1067
1120
  }
1068
- const Ie = w.sourceBuildSolution, Q = ge(w, Ie);
1121
+ const Ce = S.sourceBuildSolution, Q = he(S, Ce);
1069
1122
  if (!Q.ok) {
1070
1123
  console.warn(
1071
1124
  "[SolutionBuilder] updateDesign Esri JSON conversion failed:",
1072
- { error: Q.error, llmResponse: o, design: w }
1125
+ { error: Q.error, llmResponse: o, design: S }
1073
1126
  );
1074
- const p = f("applyChangeFailed", e);
1127
+ const p = h("applyChangeFailed", e);
1075
1128
  return {
1076
1129
  outputMessage: p,
1077
1130
  summary: p,
1078
1131
  status: "success"
1079
1132
  };
1080
1133
  }
1081
- return me(w), {
1134
+ return ge(S), {
1082
1135
  outputMessage: a,
1083
1136
  summary: a,
1084
1137
  status: "success",
1085
- currentDesign: w
1138
+ currentDesign: S
1086
1139
  };
1087
- }, Ut = (t) => t.currentDesign !== null ? "updateDesign" : "assessInitialRequest", Ot = (t) => !t.assessment || !t.assessment.isValidUseCase ? "invalidUseCaseExit" : !t.selectedTemplate && t.assessment.matchedTemplates.length > 1 ? "selectTemplateHIL" : "findExistingSolutions", zt = (t) => t.existingMatches.length > 0 ? "confirmContinueBuildingHIL" : "designSolution", jt = (t) => t.continueBuilding === !1 ? "declineContinueBuildingExit" : "designSolution", Jt = () => new z(Dt).addNode("syncCurrentDesignFromContext", Ft).addNode("assessInitialRequest", $t).addNode("invalidUseCaseExit", Rt).addNode("selectTemplateHIL", Mt).addNode("findExistingSolutions", Nt).addNode("confirmContinueBuildingHIL", Pt).addNode("declineContinueBuildingExit", Bt).addNode("designSolution", ve).addNode("updateDesign", qt).addEdge(j, "syncCurrentDesignFromContext").addConditionalEdges("syncCurrentDesignFromContext", Ut, {
1088
- updateDesign: "updateDesign",
1089
- assessInitialRequest: "assessInitialRequest"
1090
- }).addConditionalEdges("assessInitialRequest", Ot, {
1091
- invalidUseCaseExit: "invalidUseCaseExit",
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", Pt).addNode("findExistingSolutions", qt).addNode("confirmContinueBuildingHIL", Ut).addNode("declineContinueBuildingExit", Ot).addNode("designSolution", we).addNode("updateDesign", zt).addEdge(z, "syncCurrentDesignFromContext").addConditionalEdges("syncCurrentDesignFromContext", jt, {
1141
+ assessUpdateRequest: "assessUpdateRequest",
1142
+ assessBuildRequest: "assessBuildRequest"
1143
+ }).addConditionalEdges("assessUpdateRequest", Jt, {
1144
+ invalidUpdateExit: "invalidUpdateExit",
1145
+ updateDesign: "updateDesign"
1146
+ }).addConditionalEdges("assessBuildRequest", Gt, {
1147
+ invalidBuildExit: "invalidBuildExit",
1092
1148
  selectTemplateHIL: "selectTemplateHIL",
1093
1149
  findExistingSolutions: "findExistingSolutions"
1094
- }).addEdge("invalidUseCaseExit", x).addEdge("selectTemplateHIL", "findExistingSolutions").addConditionalEdges("findExistingSolutions", zt, {
1150
+ }).addEdge("invalidBuildExit", x).addEdge("invalidUpdateExit", x).addEdge("selectTemplateHIL", "findExistingSolutions").addConditionalEdges("findExistingSolutions", Vt, {
1095
1151
  confirmContinueBuildingHIL: "confirmContinueBuildingHIL",
1096
1152
  designSolution: "designSolution"
1097
- }).addConditionalEdges("confirmContinueBuildingHIL", jt, {
1153
+ }).addConditionalEdges("confirmContinueBuildingHIL", Ht, {
1098
1154
  declineContinueBuildingExit: "declineContinueBuildingExit",
1099
1155
  designSolution: "designSolution"
1100
1156
  }).addEdge("declineContinueBuildingExit", x).addEdge("designSolution", x).addEdge("updateDesign", x);
1101
- await y(T, "description");
1102
- const Gt = L.object({
1103
- tool: L.enum(["explorer", "builder", "other"]).describe("The selected tool based on the user's query."),
1104
- confidence: L.number().min(0).max(1).describe("A confidence score (0.00–1.00)."),
1105
- rationale: L.string().min(1).describe("A brief rationale for the tool choice (≤140 characters)"),
1106
- builderExclusion: L.boolean().describe("True only when tool is other specifically due to Builder Exclusion Override.")
1107
- }), P = /* @__PURE__ */ Object.assign({
1157
+ await y(C, "description");
1158
+ const Kt = D.object({
1159
+ tool: D.enum(["explorer", "builder", "other"]).describe("The selected tool based on the user's query."),
1160
+ confidence: D.number().min(0).max(1).describe("A confidence score (0.00–1.00)."),
1161
+ rationale: D.string().min(1).describe("A brief rationale for the tool choice (≤140 characters)")
1162
+ }), W = /* @__PURE__ */ Object.assign({
1108
1163
  "./prompts/assistantResponse.md": () => import("../../chunks/assistantResponse.js").then((t) => t.default),
1109
1164
  "./prompts/classifyIntent.md": () => import("../../chunks/classifyIntent.js").then((t) => t.default),
1110
- "./prompts/description.md": () => import("../../chunks/description.js").then((t) => t.default),
1111
- "./prompts/responseOptionsBuilderExclusion.md": () => import("../../chunks/responseOptionsBuilderExclusion.js").then((t) => t.default),
1112
- "./prompts/responseOptionsDefault.md": () => import("../../chunks/responseOptionsDefault.js").then((t) => t.default)
1113
- }), K = () => {
1114
- const t = new CustomEvent("assistantProcessing", {
1115
- detail: !1
1165
+ "./prompts/description.md": () => import("../../chunks/description.js").then((t) => t.default)
1166
+ }), K = (t) => {
1167
+ const e = new CustomEvent("assistantProcessing", {
1168
+ detail: { finished: !0, agent: t }
1116
1169
  });
1117
- window.dispatchEvent(t);
1118
- }, we = b.Root({
1119
- ...J(),
1170
+ window.dispatchEvent(e);
1171
+ }, Se = b.Root({
1172
+ ...j(),
1120
1173
  selectedTool: b({
1121
1174
  reducer: (t, e) => e ?? null,
1122
1175
  default: () => null
@@ -1124,14 +1177,10 @@ const Gt = L.object({
1124
1177
  intentRationale: b({
1125
1178
  reducer: (t, e) => e ?? null,
1126
1179
  default: () => null
1127
- }),
1128
- builderExclusion: b({
1129
- reducer: (t, e) => e ?? !1,
1130
- default: () => !1
1131
1180
  })
1132
- }), Vt = async (t, e) => {
1133
- const s = B(e);
1134
- await v(
1181
+ }), Qt = async (t, e) => {
1182
+ const s = N(e);
1183
+ await w(
1135
1184
  { text: s?.builderMessages.understandingRequest },
1136
1185
  e
1137
1186
  );
@@ -1143,77 +1192,84 @@ const Gt = L.object({
1143
1192
  } catch {
1144
1193
  a = !1;
1145
1194
  }
1146
- const l = await y(P, "classifyIntent"), u = await E({
1195
+ const l = await y(W, "classifyIntent"), u = await T({
1147
1196
  promptText: l,
1148
1197
  modelTier: "advanced",
1149
1198
  temperature: 0,
1150
- schema: Gt,
1199
+ schema: Kt,
1151
1200
  messages: i,
1152
1201
  inputVariables: { query: n, activeSolutionDesign: a }
1153
1202
  });
1154
1203
  return {
1155
1204
  selectedTool: u.tool,
1156
- intentRationale: u.rationale,
1157
- builderExclusion: u.builderExclusion
1205
+ intentRationale: u.rationale
1158
1206
  };
1159
- }, Ht = async (t, e) => {
1207
+ }, Yt = async (t, e) => {
1160
1208
  const n = await Ke().compile().invoke(t, e);
1161
- return K(), n;
1162
- }, Wt = async (t, e) => {
1163
- const n = await Jt().compile().invoke(t, e);
1164
- return K(), n;
1165
- }, Kt = async (t, e) => {
1166
- const s = B(e), n = t.agentExecutionContext.userRequest, i = t.intentRationale ?? "No rationale available.", o = t.builderExclusion ? "responseOptionsBuilderExclusion" : "responseOptionsDefault";
1167
- await v(
1209
+ return K("explorer"), n;
1210
+ }, Xt = async (t, e) => {
1211
+ const n = await Wt().compile().invoke(t, e);
1212
+ return K("builder"), n;
1213
+ }, Zt = async (t, e) => {
1214
+ const s = N(e), n = t.agentExecutionContext.userRequest, i = t.intentRationale ?? "No rationale available.";
1215
+ await w(
1168
1216
  { text: s?.executingSolutionsAssistantAgent },
1169
1217
  e
1170
1218
  );
1171
- const a = await y(P, "assistantResponse"), l = await y(
1172
- P,
1173
- o
1174
- ), u = t.agentExecutionContext.messages.slice(-11), c = await Pe({
1175
- promptText: a,
1219
+ const o = await y(W, "assistantResponse"), a = t.agentExecutionContext.messages.slice(-11), l = await Pe({
1220
+ promptText: o,
1176
1221
  modelTier: "advanced",
1177
1222
  temperature: 0,
1178
- messages: u,
1179
- inputVariables: { query: n, rationale: i, responseOptions: l }
1223
+ messages: a,
1224
+ inputVariables: { query: n, rationale: i }
1180
1225
  });
1181
- return K(), {
1182
- outputMessage: c,
1183
- summary: c,
1226
+ return K("assistant"), {
1227
+ outputMessage: l,
1228
+ summary: l,
1184
1229
  status: "success"
1185
1230
  };
1186
- }, Qt = (t) => t.selectedTool ?? "other", Yt = () => new z(we).addNode("classifyIntent", Vt).addNode("routeToExplorer", Ht).addNode("routeToBuilder", Wt).addNode("assistantResponse", Kt).addEdge(j, "classifyIntent").addConditionalEdges("classifyIntent", Qt, {
1231
+ }, es = (t) => t.selectedTool ?? "other", ts = () => new O(Se).addNode("classifyIntent", Qt).addNode("routeToExplorer", Yt).addNode("routeToBuilder", Xt).addNode("assistantResponse", Zt).addEdge(z, "classifyIntent").addConditionalEdges("classifyIntent", es, {
1187
1232
  explorer: "routeToExplorer",
1188
1233
  builder: "routeToBuilder",
1189
1234
  other: "assistantResponse"
1190
- }).addEdge("routeToExplorer", x).addEdge("routeToBuilder", x).addEdge("assistantResponse", x), Xt = await y(P, "description"), Zt = {
1235
+ }).addEdge("routeToExplorer", x).addEdge("routeToBuilder", x).addEdge("assistantResponse", x), ss = await y(W, "description"), ns = {
1191
1236
  id: "solutionsAssistant",
1192
1237
  name: "Solutions Assistant Agent",
1193
- description: Xt,
1194
- createGraph: Yt,
1195
- workspace: we
1196
- }, es = "https://links.esri.com/solutions/agol-organizational-account", ts = "https://links.esri.com/solutions/configure-assistants";
1197
- class ss extends ke {
1238
+ description: ss,
1239
+ createGraph: ts,
1240
+ workspace: Se
1241
+ }, is = "https://links.esri.com/solutions/agol-organizational-account", os = "https://links.esri.com/solutions/configure-assistants";
1242
+ class as extends ke {
1198
1243
  constructor() {
1199
1244
  super(), this.open = !1, this.userFirstName = "", this.builderVisible = !1, this.hasActiveBuilderDesign = !1, this._conversationId = void 0, this._orgSettings = {
1200
1245
  aiAssistantsEnabled: !1,
1201
1246
  blockBetaApps: !0,
1202
1247
  colocateCompute: !1
1203
- }, this._suggestedPrompts = [], this._hasInteracted = !1, this._isMobile = window.innerWidth <= 800, this._translations = _e({ 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({
1204
- context: Ae,
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._showNewChatConfirm = !1, this._assistantRef = $e(), this._configContextConsumer = ee({
1249
+ context: Le,
1205
1250
  subscribe: !0,
1206
1251
  callback: (e) => {
1207
1252
  e?.portalURL && (te.portalUrl = e.portalURL), e?.userSession && !this.userFirstName && this._loadUserFirstName(), e?.authentication?.PortalSubset?.orgSettings && (this._orgSettings = e?.authentication?.PortalSubset?.orgSettings);
1208
1253
  }
1209
1254
  }), this._builderDesignContextConsumer = ee({
1210
- context: Le,
1255
+ context: Re,
1211
1256
  subscribe: !0,
1212
1257
  callback: (e) => {
1213
1258
  e?.design && (this._solutionDesignJson = JSON.stringify(e.design, null, 2));
1214
1259
  }
1215
1260
  }), this._handleResize = () => {
1216
1261
  this._isMobile = window.innerWidth <= 800;
1262
+ }, this._chatStartTime = null, this._handleAssistantProcessingFinished = (e) => {
1263
+ const s = e;
1264
+ if (s.detail?.finished && this._chatStartTime !== null) {
1265
+ const n = Fe(this._chatStartTime);
1266
+ this._telemetry?.logEvent({
1267
+ category: De.ASSISTANT,
1268
+ action: "Chat",
1269
+ dimensions: [s.detail.agent],
1270
+ metrics: [n]
1271
+ }), this._chatStartTime = null, this.assistantProcessing.emit(!1);
1272
+ }
1217
1273
  }, this.closeAssistant = X(), this.assistantProcessing = X(), this._handleAssistantLinkClick = (e) => {
1218
1274
  const s = e.composedPath().find((n) => n instanceof HTMLAnchorElement);
1219
1275
  if (s?.href)
@@ -1232,10 +1288,12 @@ class ss extends ke {
1232
1288
  }, this.listenOn(window, "arcgisFeedback", (e) => {
1233
1289
  const s = e.detail, { agentPicked: n, taskAssigned: i, userMessage: o } = this._parseAgentPickedAndTask(s);
1234
1290
  this._sendFeedback(s.content, o ?? i ?? "", s.feedback?.positive ? "Good" : s.feedback?.positive == "Bad" ? "Bad" : "N/A", n ?? "");
1291
+ }), this.listenOn(window, "clearAssistantConversation", () => {
1292
+ this._clearConversation();
1235
1293
  });
1236
1294
  }
1237
1295
  static {
1238
- 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 };
1296
+ 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 };
1239
1297
  }
1240
1298
  static {
1241
1299
  this.styles = ze;
@@ -1244,10 +1302,10 @@ class ss extends ke {
1244
1302
  return this._configContextConsumer.value?.telemetrySession;
1245
1303
  }
1246
1304
  connectedCallback() {
1247
- super.connectedCallback(), window.addEventListener("arcgis-solution-design-update", this._onSolutionDesignUpdate), this.el.addEventListener("click", this._handleAssistantLinkClick), window.addEventListener("resize", this._handleResize), this._builderDesignContextConsumer;
1305
+ 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;
1248
1306
  }
1249
1307
  disconnectedCallback() {
1250
- window.removeEventListener("arcgis-solution-design-update", this._onSolutionDesignUpdate), this.el.removeEventListener("click", this._handleAssistantLinkClick), window.removeEventListener("resize", this._handleResize), super.disconnectedCallback();
1308
+ 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();
1251
1309
  }
1252
1310
  loaded() {
1253
1311
  this._checkURLOpenParameter();
@@ -1259,27 +1317,20 @@ class ss extends ke {
1259
1317
  this._loadUserFirstName();
1260
1318
  }
1261
1319
  willUpdate(e) {
1262
- e.has("open") && this.open && window.dispatchEvent(new CustomEvent("openAssistant")), this._configContextConsumer.value?.authentication && this._configContextConsumer.value?.userSession?.token && (this._preChatCheck || (de(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;
1320
+ 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;
1263
1321
  }
1264
1322
  _renderNoSign() {
1265
- return k`<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>`;
1323
+ 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>`;
1266
1324
  }
1267
1325
  _renderNoPermission() {
1268
- return k`<calcite-notice open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Ee(this._translations.noPermissionMessage.replace("{{orgUrl}}", es).replace("{{configAI}}", ts))}</div></calcite-notice>`;
1326
+ 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>`;
1269
1327
  }
1270
1328
  render() {
1271
1329
  let e = this._suggestedPrompts.length > 0 ? this._suggestedPrompts : this._hasInteracted ? [] : Object.values(this._translations.defaultFollowUpQuestions);
1272
- return this._suggestedPrompts.length > 0 ? e = this._suggestedPrompts : this._hasInteracted || (e = [...Object.values(this._translations.defaultFollowUpQuestions)]), k`<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 ? k`${!this._isMobile && k`<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=${() => {
1330
+ 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=${() => {
1273
1331
  window.dispatchEvent(new CustomEvent("toggleSolutionBuilder"));
1274
- }} scale=m slot=header-actions-end></calcite-action>` || ""}${!this._isMobile && k`<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) => {
1275
- console.log("arcgis submit: ", s.detail), this._suggestedPrompts = [], e = [], this._hasInteracted = !0;
1276
- const n = Date.now(), i = Fe(n), o = s.detail || "Unknown";
1277
- this._telemetry?.logEvent({
1278
- category: De.ASSISTANT,
1279
- action: "Chat",
1280
- dimensions: [o],
1281
- metrics: [i]
1282
- }), this.assistantProcessing.emit(!0);
1332
+ }} 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) => {
1333
+ console.log("arcgis submit: ", s.detail), this._suggestedPrompts = [], e = [], this._hasInteracted = !0, this._chatStartTime = Date.now(), this.assistantProcessing.emit(!0);
1283
1334
  }} @arcgisFeedback=${(s) => {
1284
1335
  s.detail;
1285
1336
  }} @arcgisInterrupt=${() => {
@@ -1288,9 +1339,9 @@ class ss extends ke {
1288
1339
  this._queryElementInShadowDom(this.el, ".footer-container", !1);
1289
1340
  }} @arcgisInterruptSubmit=${() => {
1290
1341
  this._queryElementInShadowDom(this.el, ".footer-container", !1);
1291
- }} ${Re(this._assistantRef)}><calcite-button appearance=transparent id=newChatButton icon-start=speech-bubble-plus kind=neutral .label=${this._translations.tooltips.newChat} @click=${() => {
1292
- this._conversationId = void 0, this._suggestedPrompts = [], this._hasInteracted = !1, this._assistantRef.value?.clearChatHistory(), this._queryElementInShadowDom(this.el, ".footer-container", !1);
1293
- }} round scale=m slot=entry-actions-start>${this._translations.tooltips.newChat}</calcite-button><arcgis-assistant-agent .agent=${Zt} .context=${{
1342
+ }} ${Me(this._assistantRef)}><calcite-button appearance=transparent id=newChatButton icon-start=speech-bubble-plus kind=neutral .label=${this._translations.tooltips.newChat} @click=${() => {
1343
+ this.hasActiveBuilderDesign ? this._showNewChatConfirm = !0 : this._clearConversation();
1344
+ }} round scale=m slot=entry-actions-start>${this._translations.tooltips.newChat}</calcite-button><arcgis-assistant-agent .agent=${ns} .context=${{
1294
1345
  token: this._configContextConsumer.value?.userSession?.token,
1295
1346
  configContext: this._configContextConsumer.value,
1296
1347
  convoId: this._conversationId,
@@ -1304,10 +1355,21 @@ class ss extends ke {
1304
1355
  clearSuggestedPrompts: () => {
1305
1356
  this._suggestedPrompts = [];
1306
1357
  }
1307
- }}></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=${() => {
1358
+ }}></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=${() => {
1359
+ this._showNewChatConfirm = !1;
1360
+ }} slot=footer-end>\r\n Cancel</calcite-button><calcite-button appearance=solid kind=danger @click=${() => {
1361
+ this._showNewChatConfirm = !1, window.dispatchEvent(new CustomEvent("requestBuilderDiscard"));
1362
+ }} slot=footer-end>\r\n Discard</calcite-button></calcite-dialog>` || ""}<calcite-action icon=x id=closeAssistantButton .label=${this._translations.tooltips.close} @click=${() => {
1308
1363
  this.closeAssistant.emit(!0);
1309
1364
  }} 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>`;
1310
1365
  }
1366
+ _clearConversation() {
1367
+ this._conversationId = void 0, this._suggestedPrompts = [], this._hasInteracted = !1, this._assistantRef.value?.clearChatHistory(), this._queryElementInShadowDom(this.el, ".footer-container", !1), console.log("[arcgis-solutions-assistant] Conversation after clear:", {
1368
+ conversationId: this._conversationId,
1369
+ suggestedPrompts: this._suggestedPrompts,
1370
+ hasInteracted: this._hasInteracted
1371
+ });
1372
+ }
1311
1373
  _sendFeedback(e, s, n, i) {
1312
1374
  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")}`;
1313
1375
  window.open(o, "_blank");
@@ -1329,8 +1391,8 @@ class ss extends ke {
1329
1391
  const u = /Agent picked:\s*(.*?)\s*(?:\\n|\r?\n)\s*Task Assigned:\s*([\s\S]*)$/i, c = l.match(u);
1330
1392
  if (!c)
1331
1393
  return { agentPicked: null, taskAssigned: null, userMessage: a };
1332
- const m = c[1].trim(), h = c[2].trim();
1333
- return { agentPicked: m, taskAssigned: h, userMessage: a };
1394
+ const m = c[1].trim(), f = c[2].trim();
1395
+ return { agentPicked: m, taskAssigned: f, userMessage: a };
1334
1396
  }
1335
1397
  _emitItemIdFromAI(e) {
1336
1398
  const s = new CustomEvent("solutionIDFromAssistant", {
@@ -1363,7 +1425,7 @@ class ss extends ke {
1363
1425
  });
1364
1426
  }
1365
1427
  }
1366
- Ce("arcgis-solutions-assistant", ss);
1428
+ _e("arcgis-solutions-assistant", as);
1367
1429
  export {
1368
- ss as ArcgisSolutionsAssistant
1430
+ as as ArcgisSolutionsAssistant
1369
1431
  };