@arcgis/coding-components 4.34.0-next.28 → 4.34.0-next.29

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 (82) hide show
  1. package/dist/addons/arcade-coding-assistant/temporary-strings.d.ts +7 -0
  2. package/dist/addons/arcade-coding-assistant/useArcadeAssistant.d.ts +7 -7
  3. package/dist/addons.js +6 -6
  4. package/dist/cdn/{475IPMML.js → 27GAK4UA.js} +2 -2
  5. package/dist/cdn/{BEGL3FU7.js → 32K7GHV2.js} +2 -2
  6. package/dist/cdn/{2XDZB5UQ.js → 3AJQCXP5.js} +2 -2
  7. package/dist/cdn/{S3MY5WE5.js → 3TTOOYTP.js} +2 -2
  8. package/dist/cdn/{BESGGIO2.js → 4L2UN6XN.js} +2 -2
  9. package/dist/cdn/4WAWANVL.js +4 -0
  10. package/dist/cdn/{G73IWMPI.js → 4ZYQLPBS.js} +2 -2
  11. package/dist/cdn/{2RPPBG3Z.js → 5WJIHGZ5.js} +2 -2
  12. package/dist/cdn/{YGJF52HO.js → 7MFY7SVP.js} +1 -1
  13. package/dist/cdn/AGG36YCW.js +6 -0
  14. package/dist/cdn/{2MRF3P66.js → C7VT5PS7.js} +2 -2
  15. package/dist/cdn/{IWQ72COU.js → CKIDAKUH.js} +2 -2
  16. package/dist/cdn/{OID2MENS.js → D73FQPYU.js} +2 -2
  17. package/dist/cdn/{7OYCH4TQ.js → EOGVGYOI.js} +2 -2
  18. package/dist/cdn/{DVW2PHRK.js → FGGZ6ITK.js} +2 -2
  19. package/dist/cdn/{U67EU75G.js → FWPZ2HNP.js} +4 -4
  20. package/dist/cdn/{M5Z3T5DX.js → GEIN3UXC.js} +2 -2
  21. package/dist/cdn/{LCPAYQJH.js → GRHTPUFF.js} +2 -2
  22. package/dist/cdn/{NE5OHGXE.js → HE7YSJQA.js} +1 -1
  23. package/dist/cdn/{QZPLC65Q.js → HRCFDZ46.js} +2 -2
  24. package/dist/cdn/{2UGQ3C7G.js → I6DHVCQY.js} +2 -2
  25. package/dist/cdn/{JO42YVEQ.js → I6FI33WX.js} +2 -2
  26. package/dist/cdn/{P5LZEBRO.js → IFLZLMBW.js} +2 -2
  27. package/dist/cdn/{JMJU7ABX.js → IO3D7ZCK.js} +2 -2
  28. package/dist/cdn/{KEOVPOJO.js → LFCFEBJK.js} +2 -2
  29. package/dist/cdn/{6C7FMEHE.js → LMWKAIC2.js} +2 -2
  30. package/dist/cdn/{63N6PP7R.js → MYYKZ75Z.js} +2 -2
  31. package/dist/cdn/{YHB3E7ZD.js → MZOXERQS.js} +2 -2
  32. package/dist/cdn/{X7Y3VVYJ.js → PHDE4DM7.js} +1 -1
  33. package/dist/cdn/{RRH2REKM.js → RKKERKA3.js} +2 -2
  34. package/dist/cdn/{WOUFKDRM.js → RQVDIT3M.js} +2 -2
  35. package/dist/cdn/{R6Q7EZ6N.js → TI34SVE6.js} +2 -2
  36. package/dist/cdn/{F4MFO2LZ.js → TJMELLUB.js} +1 -1
  37. package/dist/cdn/{DRMPQJGQ.js → TM64TRP3.js} +2 -2
  38. package/dist/cdn/{QPJMKT5M.js → UGTGDJNO.js} +2 -2
  39. package/dist/cdn/{AN2QOF3Y.js → VCTTJHKC.js} +2 -2
  40. package/dist/cdn/{LUFE3TRU.js → W2ED67UR.js} +2 -2
  41. package/dist/cdn/{GDS7XWPX.js → W2HPJPLQ.js} +2 -2
  42. package/dist/cdn/{GYFWXEV4.js → XJYQ6UUX.js} +2 -2
  43. package/dist/cdn/{X5DEZZPE.js → Y4QDA25T.js} +3 -3
  44. package/dist/cdn/{IDMILG4V.js → Z7QKSUKG.js} +2 -2
  45. package/dist/cdn/assets/code-editor/sql-expr.worker.js +29320 -29298
  46. package/dist/cdn/index.js +2 -2
  47. package/dist/chunks/arcade-defaults.js +1 -1
  48. package/dist/chunks/arcade-executor.js +1 -1
  49. package/dist/chunks/arcade-mode.js +1 -1
  50. package/dist/chunks/arcade-service-accessors.js +1 -1
  51. package/dist/chunks/editor.js +1 -1
  52. package/dist/chunks/fields.js +1 -1
  53. package/dist/chunks/language-defaults-base.js +1 -1
  54. package/dist/chunks/markdown.js +1 -1
  55. package/dist/chunks/monaco-importer.js +1 -1
  56. package/dist/chunks/runtime.js +1 -1
  57. package/dist/chunks/setup-monaco.js +1 -1
  58. package/dist/chunks/sql-expr-contribution.js +1 -1
  59. package/dist/chunks/sql-expr-defaults.js +1 -1
  60. package/dist/chunks/sql-expr-mode.js +1 -1
  61. package/dist/chunks/useT9n.js +1 -1
  62. package/dist/components/arcgis-arcade-coding-assistant/customElement.d.ts +1 -1
  63. package/dist/components/arcgis-arcade-coding-assistant/customElement.js +198 -168
  64. package/dist/components/arcgis-arcade-coding-assistant/functional.d.ts +4 -4
  65. package/dist/components/arcgis-arcade-coding-assistant/index.d.ts +0 -2
  66. package/dist/components/arcgis-arcade-coding-assistant/index.js +0 -2
  67. package/dist/components/arcgis-arcade-editor/customElement.js +1 -1
  68. package/dist/components/arcgis-arcade-results/customElement.js +1 -1
  69. package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
  70. package/dist/components/arcgis-code-editor/customElement.js +2 -2
  71. package/dist/components/arcgis-editor-variables/customElement.js +1 -1
  72. package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
  73. package/dist/components/arcgis-sql-expression-editor/customElement.js +1 -1
  74. package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
  75. package/dist/docs/api.json +2 -2
  76. package/dist/docs/docs.json +2 -2
  77. package/dist/docs/web-types.json +1 -1
  78. package/dist/index.js +1 -1
  79. package/dist/loader.js +4 -4
  80. package/package.json +5 -5
  81. package/dist/cdn/UAAKRZ52.js +0 -6
  82. package/dist/cdn/WTROCBGZ.js +0 -4
@@ -1,33 +1,33 @@
1
- import { c as B } from "../../chunks/runtime.js";
2
- import { nothing as R, LitElement as H } from "@arcgis/lumina";
3
- import { ref as L, createRef as j } from "lit/directives/ref.js";
1
+ import { c as V } from "../../chunks/runtime.js";
2
+ import { nothing as C, LitElement as L } from "@arcgis/lumina";
3
+ import { ref as B, createRef as j } from "lit/directives/ref.js";
4
4
  import W from "@arcgis/core/identity/IdentityManager.js";
5
5
  import { u as Q } from "../../chunks/useT9n.js";
6
- import { b as M } from "../../chunks/arcade-defaults.js";
6
+ import { b as E } from "../../chunks/arcade-defaults.js";
7
7
  import { css as G } from "@lit/reactive-element/css-tag.js";
8
- import { html as C } from "lit";
9
- import q from "@arcgis/core/request.js";
8
+ import { html as w } from "lit";
9
+ import T from "@arcgis/core/request.js";
10
10
  import { e as J, a as Y } from "../../chunks/monaco-importer.js";
11
- import { html as r } from "lit-html";
12
- import { repeat as D } from "lit-html/directives/repeat.js";
13
- import "@arcgis/components-utils";
14
- import { unsafeHTML as S } from "lit/directives/unsafe-html.js";
15
- import K from "@arcgis/core/layers/FeatureLayer.js";
16
- import X from "@arcgis/core/Graphic.js";
17
- import { b as Z } from "../../chunks/language-defaults-base.js";
11
+ import { html as n } from "lit-html";
12
+ import { repeat as F } from "lit-html/directives/repeat.js";
13
+ import { generateGuid as K } from "@arcgis/components-utils";
14
+ import { unsafeHTML as k } from "lit/directives/unsafe-html.js";
15
+ import X from "@arcgis/core/layers/FeatureLayer.js";
16
+ import Z from "@arcgis/core/Graphic.js";
17
+ import { b as ee } from "../../chunks/language-defaults-base.js";
18
18
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
19
19
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
20
- v4.34.0-next.28 */
21
- const ee = G`:host(:not([closed])){--calcite-block-border-color: var(--calcite-color-transparent);flex:1 0 auto;border-inline-start:var(--arcgis-coding-components-border);box-sizing:border-box;max-width:var(--arcgis-coding-components-side-panel-max-w);width:var(--arcgis-coding-components-side-panel-w);.submission-actions-wrapper{display:flex;flex-direction:column;width:100%;gap:.75rem}.submission-actions{display:flex;flex-direction:row;gap:.5rem;justify-content:space-between}.gaps{display:flex;gap:.25rem}.align-inline-end{margin-inline-start:auto}.action .error-display{display:flex;flex-direction:row;gap:.5rem;justify-content:space-between}.context-popover p{padding:0 .5rem;font-size:var(--calcite-font-size-sm)}.prompt-list calcite-list-item{margin-block-end:.5rem;border-radius:var(--calcite-corner-radius-round);--calcite-color-border-3: transparent;overflow:hidden}.feedback-content{padding:1rem;display:flex;flex-direction:column;gap:.75rem}.feedback-sheet{--calcite-sheet-height: auto;--calcite-sheet-max-height: auto;--calcite-sheet-min-height: auto}calcite-chip[slot=header-actions-end]{align-self:center;margin-inline-end:.5rem}calcite-list-item:focus calcite-button{position:relative;top:-2px}.prompt-list calcite-list-item:last-of-type{margin-block-end:0}calcite-list{--calcite-color-foreground-1: transparent;background-color:transparent}calcite-list-item{--calcite-color-foreground-1: white}calcite-flow-item calcite-shell{background:transparent}calcite-block{width:100%;max-width:100%;align-self:flex-end;background-color:transparent;margin-block:0}calcite-sheet{--calcite-sheet-scrim-background: rgba(200, 200, 200, .5)}.type-suggestion{--calcite-color-foreground-1: var(--calcite-color-foreground-current);--calcite-color-text-3: var(--calcite-color-text-2);--calcite-icon-color: var(--calcite-color-brand)}.type-history{--calcite-icon-color: var(--calcite-color-text-2)}.type-response{--calcite-icon-color: var(--calcite-color-brand);--calcite-font-family: monospace}.block-response{align-self:flex-start;margin-block-end:4rem;border-block-end:0;--calcite-block-text-color: var(--calcite-color-brand)}calcite-list-item calcite-button{margin-inline-end:.25rem}.type-docs{--calcite-color-foreground-1: var(--calcite-color-foreground-3);--calcite-icon-color: var(--calcite-color-text-1)}.type-error{--calcite-icon-color: var(--calcite-color-status-danger);--calcite-font-family: monospace;border:1px solid var(--calcite-color-status-danger)}#thumbs-up{margin-inline-start:auto;--calcite-icon-color: var(--calcite-color-border-input)}#thumbs-down{--calcite-icon-color: var(--calcite-color-border-input)}calcite-flow-item calcite-shell calcite-notice{margin-block:1rem}.no-space-block,.no-space-block[open]{margin:0}calcite-block[open]:last-of-type{border-block-end:0}.text-area-wrapper{display:flex;border-radius:var(--calcite-corner-radius-round);margin:.75rem;overflow:hidden;--calcite-color-border-input: transparent;position:sticky;box-shadow:var(--calcite-shadow-sm);flex:none}calcite-text-area{height:auto;min-height:5.75rem;overflow:hidden;border-radius:var(--calcite-corner-radius-round) var(--calcite-corner-radius-round) 0 0;--calcite-font-weight-normal: 500;font-weight:500;line-height:1.2}calcite-tooltip{--calcite-tooltip-z-index: 1000}.standalone-list{margin:1rem;width:calc(100% - 2rem)}.result-disclaimer{display:block;width:24rem;max-width:90%;margin:1rem auto;text-align:center;line-height:1.125rem;font-size:.875rem;font-style:italic}calcite-flow{height:100%}calcite-popover calcite-list{--calcite-list-background-color: transparent;--calcite-input-border-color: transparent}calcite-popover calcite-list calcite-filter{--calcite-spacing-sm: 0}.break-spaces{white-space:break-spaces}.feedback-button-container{margin-inline-start:auto;gap:0}.info-heading{font-size:var(--calcite-font-size-1);color:var(--calcite-color-text-1)}.unstyled-h3{margin:unset;font-size:var(--calcite-font-size-md)}.unstyled-shell{position:unset;inset:unset;display:unset;block-size:unset;inline-size:unset}.suggestion-chips{--calcite-chip-background-color: var(--calcite-color-foreground-current);--calcite-chip-text-color: var(--calcite-color-brand);calcite-chip{cursor:pointer}}.info-block{max-width:450px}#result-block{calcite-card-group{--calcite-card-group-gap: 1.25rem}calcite-card{--calcite-card-corner-radius: var(--calcite-corner-radius-round);--calcite-card-background-color: white;--calcite-card-border-color: transparent;width:100%}.positioned-code-content{display:flex;flex-direction:row;gap:.5rem;padding:.5rem}calcite-card [slot=title] calcite-chip{margin-block-start:.25rem}.code-response-wrapper{position:relative;background:var(--calcite-color-foreground-2);border-radius:var(--calcite-corner-radius-round);margin-top:-1.5rem}.prior-prompt{margin:.25rem 0 .75rem;max-width:90%;overflow-y:hidden;overflow-x:auto;padding:0}code{white-space:pre;font-size:12px;margin:0;overflow-x:auto;font-family:Fira Mono,Consolas,Menlo,monospace;display:block;max-height:12rem;position:relative;padding:.5rem}.code-collapse{margin-inline-start:auto}.copy-button{margin-left:.5rem}.add-to-editor-button{--calcite-internal-button-border-color: unset}}.collapsible-code{padding:.5rem}.collapsible-code summary{cursor:pointer;font-weight:500;color:var(--calcite-color-brand);outline:none;padding:.25rem 0}.collapsible-code[open] summary{color:var(--calcite-color-text-2)}.collapsible-error{padding:.5rem}.collapsible-error summary{cursor:pointer;font-weight:500;color:var(--calcite-color-status-danger);outline:none;padding:.25rem 0}.collapsible-error[open] summary{color:var(--calcite-color-text-2)}.response-error-container{padding:.5rem;background:color-mix(in srgb,var(--calcite-color-status-danger) 10%,transparent);border-radius:var(--calcite-corner-radius-round);margin:1rem 0;font-size:var(--calcite-font-size--2);border:var(--calcite-color-status-danger) solid 1px}.response-error-container p{margin:0 0 0 1em}}:host([closed]){display:none}`;
20
+ v4.34.0-next.29 */
21
+ const te = G`:host(:not([closed])){--calcite-block-border-color: var(--calcite-color-transparent);flex:1 0 auto;border-inline-start:var(--arcgis-coding-components-border);box-sizing:border-box;max-width:var(--arcgis-coding-components-side-panel-max-w);width:var(--arcgis-coding-components-side-panel-w);.submission-actions-wrapper{display:flex;flex-direction:column;width:100%;gap:.75rem}.submission-actions{display:flex;flex-direction:row;gap:.5rem;justify-content:space-between}.gaps{display:flex;gap:.25rem}.align-inline-end{margin-inline-start:auto}.action .error-display{display:flex;flex-direction:row;gap:.5rem;justify-content:space-between}.context-popover p{padding:0 .5rem;font-size:var(--calcite-font-size-sm)}.prompt-list calcite-list-item{margin-block-end:.5rem;border-radius:var(--calcite-corner-radius-round);--calcite-color-border-3: transparent;overflow:hidden}.feedback-content{padding:1rem;display:flex;flex-direction:column;gap:.75rem}.feedback-sheet{--calcite-sheet-height: auto;--calcite-sheet-max-height: auto;--calcite-sheet-min-height: auto}calcite-chip[slot=header-actions-end]{align-self:center;margin-inline-end:.5rem}calcite-list-item:focus calcite-button{position:relative;top:-2px}.prompt-list calcite-list-item:last-of-type{margin-block-end:0}calcite-list{--calcite-color-foreground-1: transparent;background-color:transparent}calcite-list-item{--calcite-color-foreground-1: white}calcite-flow-item calcite-shell{background:transparent}calcite-block{width:100%;max-width:100%;align-self:flex-end;background-color:transparent;margin-block:0}calcite-sheet{--calcite-sheet-scrim-background: rgba(200, 200, 200, .5)}.type-suggestion{--calcite-color-foreground-1: var(--calcite-color-foreground-current);--calcite-color-text-3: var(--calcite-color-text-2);--calcite-icon-color: var(--calcite-color-brand)}.type-history{--calcite-icon-color: var(--calcite-color-text-2)}.type-response{--calcite-icon-color: var(--calcite-color-brand);--calcite-font-family: monospace}.block-response{align-self:flex-start;margin-block-end:4rem;border-block-end:0;--calcite-block-text-color: var(--calcite-color-brand)}calcite-list-item calcite-button{margin-inline-end:.25rem}.type-docs{--calcite-color-foreground-1: var(--calcite-color-foreground-3);--calcite-icon-color: var(--calcite-color-text-1)}.type-error{--calcite-icon-color: var(--calcite-color-status-danger);--calcite-font-family: monospace;border:1px solid var(--calcite-color-status-danger)}#thumbs-up{margin-inline-start:auto;--calcite-icon-color: var(--calcite-color-border-input)}#thumbs-down{--calcite-icon-color: var(--calcite-color-border-input)}calcite-flow-item calcite-shell calcite-notice{margin-block:1rem}.no-space-block,.no-space-block[open]{margin:0}calcite-block[open]:last-of-type{border-block-end:0}.text-area-wrapper{display:flex;border-radius:var(--calcite-corner-radius-round);margin:.75rem;overflow:hidden;--calcite-color-border-input: transparent;position:sticky;box-shadow:var(--calcite-shadow-sm);flex:none}calcite-text-area{height:auto;min-height:5.75rem;overflow:hidden;border-radius:var(--calcite-corner-radius-round) var(--calcite-corner-radius-round) 0 0;--calcite-font-weight-normal: 500;font-weight:500;line-height:1.2}calcite-tooltip{--calcite-tooltip-z-index: 1000}.standalone-list{margin:1rem;width:calc(100% - 2rem)}.result-disclaimer{display:block;width:24rem;max-width:90%;margin:1rem auto;text-align:center;line-height:1.125rem;font-size:.875rem;font-style:italic}calcite-flow{height:100%}calcite-popover calcite-list{--calcite-list-background-color: transparent;--calcite-input-border-color: transparent}calcite-popover calcite-list calcite-filter{--calcite-spacing-sm: 0}.break-spaces{white-space:break-spaces}.feedback-button-container{margin-inline-start:auto;gap:0}.info-heading{font-size:var(--calcite-font-size-1);color:var(--calcite-color-text-1)}.unstyled-h3{margin:unset;font-size:var(--calcite-font-size-md)}.unstyled-shell{position:unset;inset:unset;display:unset;block-size:unset;inline-size:unset}.suggestion-button{font-weight:var(--calcite-font-weight-medium)}.info-block{max-width:450px}#result-block{calcite-card-group{--calcite-card-group-gap: 1.25rem}calcite-card{--calcite-card-corner-radius: var(--calcite-corner-radius-round);--calcite-card-background-color: white;--calcite-card-border-color: transparent;width:100%}.positioned-code-content{display:flex;flex-direction:row;gap:.5rem;padding:.5rem}calcite-card [slot=title] calcite-chip{margin-block-start:.25rem}.code-response-wrapper{position:relative;background:var(--calcite-color-foreground-2);border-radius:var(--calcite-corner-radius-round);margin-top:-1.5rem}.prior-prompt{display:flex;flex-direction:row;padding:0;overflow-y:hidden;overflow-x:auto;margin:.25rem 0 .75rem;align-items:center;max-width:100%;span{overflow-x:auto;overflow-y:hidden}}.copy-feedback{display:none}.copy-prompt-button{align-self:flex-start;margin-inline-start:auto}.response-secondary-action-button[data-copied]+.copy-feedback,.copy-prompt-button[data-copied]+.copy-feedback{display:block;span{padding:.75rem 1rem;font-size:var(--calcite-font-size--2);line-height:1.375;color:var(--calcite-color-text--2);font-weight:var(--calcite-font-weight-medium)}}.copy-prompt-button[data-copied]~.copy-tooltip,.response-secondary-action-button[data-copied]~.copy-tooltip{display:none}code{white-space:pre;font-size:12px;margin:0;overflow-x:auto;font-family:Fira Mono,Consolas,Menlo,monospace;display:block;max-height:12rem;position:relative;padding:.5rem}.code-collapse{margin-inline-start:auto}.response-secondary-action-button{margin-left:.5rem}.add-to-editor-button{--calcite-internal-button-border-color: unset}}.collapsible-code{padding:.5rem}.collapsible-code summary{cursor:pointer;font-weight:500;color:var(--calcite-color-brand);outline:none;padding:.25rem 0}.collapsible-code[open] summary{color:var(--calcite-color-text-2)}.collapsible-error{padding:.5rem}.collapsible-error summary{cursor:pointer;font-weight:500;color:var(--calcite-color-status-danger);outline:none;padding:.25rem 0}.collapsible-error[open] summary{color:var(--calcite-color-text-2)}.response-error-container{padding:.5rem;background:color-mix(in srgb,var(--calcite-color-status-warning) 10%,transparent);border-radius:var(--calcite-corner-radius-round);margin:1rem 0;font-size:var(--calcite-font-size--2);--calcite-input-message-icon-color: var(--calcite-color-status-warning)}.response-error-chip{--calcite-internal-chip-background-color: var(--calcite-color-status-warning);--calcite-chip-icon-color: var(--calcite-color-foreground-1);--calcite-chip-border-color: var(--calcite-color-transparent)}.feedback-actions{gap:unset}}:host([closed]){display:none}`;
22
22
  class $ extends Error {
23
23
  constructor({
24
24
  message: e,
25
25
  code: t,
26
26
  subCode: o,
27
- details: a,
28
- source: s
27
+ details: r,
28
+ source: c
29
29
  }) {
30
- super(e), this.name = "ArcadeAssistantError", this.code = t, this.subCode = o, this.details = a, this.source = s;
30
+ super(e), this.name = "ArcadeAssistantError", this.code = t, this.subCode = o, this.details = r, this.source = c;
31
31
  }
32
32
  }
33
33
  function P(i) {
@@ -43,65 +43,65 @@ function P(i) {
43
43
  return;
44
44
  }
45
45
  }
46
- async function te(i) {
47
- const { baseUrl: e, skillId: t, message: o, authToken: a, previousConversationId: s, context: p } = i, c = t ? `${e}/skills/${t}/chat` : `${e}/chat`, n = [], h = {
46
+ async function ie(i) {
47
+ const { baseUrl: e, skillId: t, message: o, authToken: r, previousConversationId: c, context: h } = i, d = t ? `${e}/skills/${t}/chat` : `${e}/chat`, s = [], m = {
48
48
  message: o,
49
- context: p
49
+ context: h
50
50
  };
51
- s && (h.conversation_id = s);
52
- let f;
51
+ c && (m.conversation_id = c);
52
+ let a;
53
53
  try {
54
- f = await q(c, {
54
+ a = await T(d, {
55
55
  method: "post",
56
56
  headers: {
57
57
  "Content-Type": "application/json",
58
- token: a
58
+ token: r
59
59
  },
60
- body: JSON.stringify(h),
60
+ body: JSON.stringify(m),
61
61
  responseType: "json"
62
62
  });
63
- } catch (g) {
64
- const v = g, A = v.details?.rawResponse || v.message || String(g), k = P(A);
65
- throw k ? new $(k) : g;
63
+ } catch (b) {
64
+ const g = b, x = g.details?.rawResponse || g.message || String(b), v = P(x);
65
+ throw v ? new $(v) : b;
66
66
  }
67
- const b = f.data;
68
- n.push(b);
69
- const y = b.conversationId, l = b.inquiryId;
70
- let u = b.sequenceNumber;
71
- async function w() {
72
- let g = 0;
73
- const v = 25;
74
- for (; g < v; ) {
75
- await new Promise((x) => setTimeout(x, 1e3));
76
- const A = ie(y, u, l);
77
- let k;
67
+ const l = a.data;
68
+ s.push(l);
69
+ const p = l.conversationId, _ = l.inquiryId;
70
+ let S = l.sequenceNumber;
71
+ async function z() {
72
+ let b = 0;
73
+ const g = 25;
74
+ for (; b < g; ) {
75
+ await new Promise((y) => setTimeout(y, 1e3));
76
+ const x = oe(p, S, _);
77
+ let v;
78
78
  try {
79
- k = await q(c, {
79
+ v = await T(d, {
80
80
  method: "post",
81
81
  headers: {
82
82
  "Content-Type": "application/json",
83
- token: a
83
+ token: r
84
84
  },
85
- body: JSON.stringify(A),
85
+ body: JSON.stringify(x),
86
86
  responseType: "json"
87
87
  });
88
- } catch (x) {
89
- const T = x, V = T.details?.rawResponse || T.message || String(x), E = P(V);
90
- throw E ? new $(E) : x;
88
+ } catch (y) {
89
+ const R = y, H = R.details?.rawResponse || R.message || String(y), I = P(H);
90
+ throw I ? new $(I) : y;
91
91
  }
92
- const m = k.data;
93
- if (m.context && m.context.kind === "ArcgisErrorAsContext" && m.context.error)
92
+ const f = v.data;
93
+ if (f.context && f.context.kind === "ArcgisErrorAsContext" && f.context.error)
94
94
  throw new $({
95
- message: m.context.error.message || "ArcGIS Assistant error",
96
- code: m.context.error.code,
97
- subCode: m.context.error.subCode,
98
- details: m.context.error.details,
95
+ message: f.context.error.message || "ArcGIS Assistant error",
96
+ code: f.context.error.code,
97
+ subCode: f.context.error.subCode,
98
+ details: f.context.error.details,
99
99
  source: "polling-response"
100
100
  });
101
- if (n.push(m), u = m.sequenceNumber, g++, !m.hasMore)
101
+ if (s.push(f), S = f.sequenceNumber, b++, !f.hasMore)
102
102
  break;
103
103
  }
104
- if (g === v)
104
+ if (b === g)
105
105
  throw new $({
106
106
  message: "Request timed out",
107
107
  code: "TIMEOUT",
@@ -110,10 +110,10 @@ async function te(i) {
110
110
  }
111
111
  const O = 2 * 60 * 1e3;
112
112
  return await Promise.race([
113
- w(),
113
+ z(),
114
114
  new Promise(
115
- (g, v) => setTimeout(
116
- () => v(
115
+ (b, g) => setTimeout(
116
+ () => g(
117
117
  new $({
118
118
  message: "Request timed out",
119
119
  code: "TIMEOUT",
@@ -123,68 +123,79 @@ async function te(i) {
123
123
  O
124
124
  )
125
125
  )
126
- ]), n;
126
+ ]), s;
127
127
  }
128
- function ie(i, e, t) {
128
+ function oe(i, e, t) {
129
129
  return {
130
130
  conversationId: i,
131
131
  inquiryId: t,
132
132
  ackSequenceNumber: e
133
133
  };
134
134
  }
135
- function oe(i) {
135
+ function ae(i) {
136
136
  return i.message.match(/Error in prompt shield/u) ? "I'm having trouble with this request. Try again by rephrasing the question." : i.code === "TIMEOUT" ? "I'm having trouble with this request. Try again by re-asking the same question or rephrasing it." : i.message;
137
137
  }
138
- const ae = (i) => {
139
- const e = i.value.length, t = 72, o = 180, a = i.offsetWidth, p = Math.max(1, Math.floor(a / 8)), c = Math.ceil(e / p), n = t + (c - 2) * 24;
140
- i.style.setProperty("--calcite-text-area-min-height", `${Math.min(n, o)}px`);
138
+ const se = (i) => {
139
+ const e = i.value.length, t = 72, o = 180, r = i.offsetWidth, h = Math.max(1, Math.floor(r / 8)), d = Math.ceil(e / h), s = t + (d - 2) * 24;
140
+ i.style.setProperty("--calcite-text-area-min-height", `${Math.min(s, o)}px`);
141
141
  };
142
- function se({ messages: i }) {
143
- return r`<calcite-chip slot=header-actions-end scale=s appearance=outline-fill .label=${i.beta ?? "Beta"}>${i.beta ?? "Beta"}</calcite-chip>`;
142
+ function re({ messages: i }) {
143
+ return n`<calcite-chip slot=header-actions-end scale=s appearance=outline-fill .label=${i.beta ?? "Beta"}>${i.beta ?? "Beta"}</calcite-chip>`;
144
144
  }
145
- function re({ popoverContent: i }) {
146
- return r`<calcite-action icon=information slot=header-actions-end id=legal-disclaimer text></calcite-action><calcite-popover reference-element=legal-disclaimer overlay-positioning=fixed label=legal-disclaimer placement=bottom auto-close>${i}</calcite-popover>`;
145
+ function ce({ popoverContent: i }) {
146
+ return n`<calcite-action icon=information slot=header-actions-end id=legal-disclaimer text></calcite-action><calcite-popover reference-element=legal-disclaimer overlay-positioning=fixed label=legal-disclaimer placement=bottom auto-close>${i}</calcite-popover>`;
147
147
  }
148
- function z({ errorMessage: i, slot: e }) {
149
- return r`<div class="error-display"><calcite-input-message id=error-message status=invalid icon=exclamation-mark-triangle scale=m slot=${e ?? R}>${i}</calcite-input-message></div>`;
148
+ function D({ errorMessage: i, slot: e }) {
149
+ return n`<div class="error-display"><calcite-input-message id=error-message status=invalid icon=exclamation-mark-triangle scale=m slot=${e ?? C}>${i}</calcite-input-message></div>`;
150
150
  }
151
- function ce({ active: i, setActive: e, messages: t }) {
152
- return r`<calcite-alert slot=alerts .open=${i} placement=bottom kind=success icon=check-circle-f auto-close @calciteAlertClose=${() => e(!1)} .label=${t.expressionapplied ?? "Expression applied"}><div slot=message>${t.expressionapplied ?? "Expression applied to editor."}</div></calcite-alert>`;
151
+ function ne({ active: i, setActive: e, messages: t }) {
152
+ return n`<calcite-alert slot=alerts .open=${i} placement=bottom kind=success icon=check-circle-f auto-close @calciteAlertClose=${() => e(!1)} .label=${t.expressionapplied ?? "Expression applied"}><div slot=message>${t.expressionapplied ?? "Expression applied to editor."}</div></calcite-alert>`;
153
153
  }
154
- function ne({ context: i, messages: e }) {
155
- return i ? r`<div class="gaps">${i.profileName && r`<calcite-popover auto-close placement=top .label=${e.profilecontextlabel.replace("{profileName}", i.profileName)} reference-element=profile-context-button class="context-popover"><p>${e.profilecontextlabel.replace("{profileName}", i.profileName)}</p></calcite-popover><calcite-button round kind=neutral icon-start=map-information id=profile-context-button></calcite-button>` || ""}${i.layerName && r`<calcite-popover auto-close placement=top .label=${e.layercontextlabel.replace("{layerName}", i.layerName)} reference-element=layer-context-button class="context-popover"><p>${e.layercontextlabel.replace("{layerName}", i.layerName)}</p></calcite-popover><calcite-button round kind=neutral icon-start=layers id=layer-context-button></calcite-button>` || ""}</div>` : null;
154
+ function le({ context: i, messages: e }) {
155
+ return i ? n`<div class="gaps">${i.profileName && n`<calcite-popover auto-close placement=top .label=${e.profilecontextlabel.replace("{profileName}", i.profileName)} reference-element=profile-context-button class="context-popover"><p>${e.profilecontextlabel.replace("{profileName}", i.profileName)}</p></calcite-popover><calcite-button round kind=neutral icon-start=map-information id=profile-context-button></calcite-button>` || ""}${i.layerName && n`<calcite-popover auto-close placement=top .label=${e.layercontextlabel.replace("{layerName}", i.layerName)} reference-element=layer-context-button class="context-popover"><p>${e.layercontextlabel.replace("{layerName}", i.layerName)}</p></calcite-popover><calcite-button round kind=neutral icon-start=layers id=layer-context-button></calcite-button>` || ""}</div>` : null;
156
156
  }
157
- function le({ isDisabled: i, isReadOnly: e, setQuestion: t, setIsViewingResult: o, textAreaRef: a, question: s, errorMessage: p, setErrorMessage: c, submitQuestion: n, messages: h, mode: f, context: b }) {
158
- return r`<div class="text-area-wrapper"><calcite-text-area resize=vertical .readOnly=${i || e} class="styled-text-area" .placeholder=${h.askaquestion ?? `Specify the calculation or logic you need in an Arcade expression. (e.g., 'Return "Yes" if value > 10')`} .value=${s} @calciteTextAreaInput=${(y) => {
159
- ae(y.target), t(y.target.value);
160
- }} ${L(a)}><div class="submission-actions-wrapper" slot=footer-start>${p && z({ errorMessage: p, slot: "footer-start" }) || ""}<div class="submission-actions">${ne({ context: b, messages: h })}<div class="align-inline-end gaps"><calcite-button round kind=neutral .hidden=${f !== "refine"} icon-start=arrow-left appearance=solid .disabled=${i} @click=${async () => {
157
+ function de({ isDisabled: i, isReadOnly: e, setQuestion: t, setIsViewingResult: o, textAreaRef: r, question: c, errorMessage: h, setErrorMessage: d, submitQuestion: s, messages: m, mode: a, context: l }) {
158
+ return n`<div class="text-area-wrapper"><calcite-text-area resize=vertical .readOnly=${i || e} class="styled-text-area" .placeholder=${m.askaquestion ?? `Specify the calculation or logic you need in an Arcade expression. (e.g., 'Return "Yes" if value > 10')`} .value=${c} @calciteTextAreaInput=${(p) => {
159
+ se(p.target), t(p.target.value);
160
+ }} ${B(r)}><div class="submission-actions-wrapper" slot=footer-start>${h && D({ errorMessage: h, slot: "footer-start" }) || ""}<div class="submission-actions">${le({ context: l, messages: m })}<div class="align-inline-end gaps"><calcite-button round kind=neutral .hidden=${a !== "refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid .disabled=${i} @click=${async () => {
161
161
  o(!1), t("");
162
- }}>${h.startover ?? "Start Over"}</calcite-button><calcite-button round icon-end=effects appearance=solid .loading=${i} .disabled=${i} @click=${async () => {
163
- c(s ? "" : h.enteraprompt ?? "Please enter a prompt"), await n();
164
- }}>${f === "prompt" ? h.ask ?? "Generate" : h.refine ?? "Refine"}</calcite-button></div></div></div></calcite-text-area></div>`;
162
+ }}>${m.startover ?? "Start Over"}</calcite-button><calcite-button round icon-end=effects appearance=solid .loading=${i} .disabled=${i} @click=${async () => {
163
+ d(c ? "" : m.enteraprompt ?? "Please enter a prompt"), await s();
164
+ }}>${a === "prompt" ? m.ask ?? "Generate" : m.refine ?? "Refine"}</calcite-button></div></div></div></calcite-text-area></div>`;
165
165
  }
166
- const de = "https://www.esri.com/en-us/privacy/privacy-statements/privacy-statement", pe = "https://www.esri.com/en-us/privacy/privacy-statements/privacy-supplement";
167
- function ue({ setOpen: i, messages: e, feedback: t, setFeedback: o, onSubmit: a }) {
168
- return r`<calcite-sheet class="feedback-sheet" .label=${e.feedback ?? "Feedback"} slot=sheets display-mode=float position=block-end .open=${t.active} @calciteSheetClose=${() => i(!1)}><calcite-panel .heading=${e.providefeedback ?? "Provide feedback"} .description=${e.experiencehelps ?? "Your experience helps guide future improvements"}><div class="feedback-content"><calcite-label>${e.experiencehelpful ?? "Was the assistant helpful?"}<calcite-segmented-control scale=l><calcite-segmented-control-item icon-start=thumbs-up .checked=${t.value === "good"} @click=${() => o({ ...t, value: "good" })}></calcite-segmented-control-item><calcite-segmented-control-item icon-start=thumbs-down .checked=${t.value === "bad"} @click=${() => o({ ...t, value: "bad" })}></calcite-segmented-control-item></calcite-segmented-control></calcite-label><calcite-label>${e.describeexperience ?? "Describe your experience"}<calcite-text-area resize=vertical .value=${t.text} @calciteTextAreaInput=${(s) => o({ ...t, text: s.target.value })}></calcite-text-area></calcite-label><calcite-label layout=inline scale=s><calcite-checkbox scale=l .checked=${t.termsAccepted} @calciteCheckboxChange=${(s) => {
169
- o({ ...t, termsAccepted: s.target.checked });
170
- }}></calcite-checkbox><span>${S(e.agreement?.replace("{EsriPrivacyStatement}", `<calcite-link href=${de} target="_blank">${e.esriprivacystatement ?? "Esri Privacy Statement"}</calcite-link>`).replace("{Supplement}", `<calcite-link href=${pe} target="_blank">${e.supplement ?? "Supplement"}</calcite-link>`))}</span></calcite-label></div><calcite-button slot=footer width=full @click=${a} .disabled=${!t.termsAccepted || t.submitting} .loading=${t.submitting}>${e.submitfeedback ?? "Submit Feedback"}</calcite-button></calcite-panel></calcite-sheet>`;
166
+ const pe = "https://www.esri.com/en-us/privacy/privacy-statements/privacy-statement", ue = "https://www.esri.com/en-us/privacy/privacy-statements/privacy-supplement";
167
+ function he({ setOpen: i, messages: e, feedback: t, setFeedback: o, onSubmit: r }) {
168
+ return n`<calcite-sheet class="feedback-sheet" .label=${e.feedback ?? "Feedback"} slot=sheets display-mode=float position=block-end .open=${t.active} @calciteSheetClose=${() => i(!1)}><calcite-panel .heading=${e.providefeedback ?? "Provide feedback"} .description=${e.experiencehelps ?? "Your experience helps guide future improvements"}><div class="feedback-content"><calcite-label>${e.experiencehelpful ?? "Was the assistant helpful?"}<calcite-segmented-control scale=l><calcite-segmented-control-item icon-start=thumbs-up .checked=${t.value === "good"} @click=${() => o({ ...t, value: "good" })}></calcite-segmented-control-item><calcite-segmented-control-item icon-start=thumbs-down .checked=${t.value === "bad"} @click=${() => o({ ...t, value: "bad" })}></calcite-segmented-control-item></calcite-segmented-control></calcite-label><calcite-label>${e.describeexperience ?? "Describe your experience"}<calcite-text-area resize=vertical .value=${t.text} @calciteTextAreaInput=${(c) => o({ ...t, text: c.target.value })}></calcite-text-area></calcite-label><calcite-label layout=inline scale=s><calcite-checkbox scale=l .checked=${t.termsAccepted} @calciteCheckboxChange=${(c) => {
169
+ o({ ...t, termsAccepted: c.target.checked });
170
+ }}></calcite-checkbox><span>${k(e.agreement?.replace("{EsriPrivacyStatement}", `<calcite-link href=${pe} target="_blank">${e.esriprivacystatement ?? "Esri Privacy Statement"}</calcite-link>`).replace("{Supplement}", `<calcite-link href=${ue} target="_blank">${e.supplement ?? "Supplement"}</calcite-link>`))}</span></calcite-label></div><calcite-button slot=footer width=full @click=${r} .disabled=${!t.termsAccepted || t.submitting} .loading=${t.submitting}>${e.submitfeedback ?? "Submit Feedback"}</calcite-button></calcite-panel></calcite-sheet>`;
171
171
  }
172
- function N({ assistantsEnabled: i, messages: e, slot: t, assistantHelpUrl: o, helpTopicUrl: a }) {
173
- return r`<calcite-block .label=${e.assistantinformation ?? "Assistant information"} slot=${t ?? R} expanded class="info-block"><calcite-chip .label=${e.new ?? "new"} kind=brand>${e.new}</calcite-chip><h1 class="info-heading">${e.introducing}</h1><p>${e.capabilities}</p>${i ? r`<p>${e.keepinmind ?? "Keep in mind the following:"}<ul><li>${e.beconsise ?? "Be concise, but also clear in your request"}</li><li>${e.avoidambiguity ?? "Avoid ambiguity and vagueness"}</li><li>${e.moredetails ?? "you do not need to use exact field names in your instructions, but more detail is generally better"}</li></ul>${S((e.seedocumentation ?? "Please see the {documentation} for more information, including limitations and additional resources.").replace("{documentation}", `<calcite-link href=${a} target="_blank">${e.documentation ?? "documentation"}</calcite-link>`))}</p>` : r`<p>${S(e.useofassistant?.replace("{aiassistants}", `<strong>${e.aiassistants ?? "Ai Assistants"}</strong>`))}<calcite-link .href=${o} target=_blank icon-end=launch-2>${e.opensettings ?? "Open Settings"}</calcite-link></p>`}</calcite-block>`;
172
+ function q({ assistantsEnabled: i, messages: e, slot: t, assistantHelpUrl: o, helpTopicUrl: r }) {
173
+ return n`<calcite-block .label=${e.assistantinformation ?? "Assistant information"} slot=${t ?? C} expanded class="info-block"><calcite-chip .label=${e.new ?? "new"} kind=brand>${e.new}</calcite-chip><h1 class="info-heading">${e.introducing}</h1><p>${e.capabilities}</p>${i ? n`<p>${e.keepinmind ?? "Keep in mind the following:"}<ul><li>${e.beconsise ?? "Be concise, but also clear in your request"}</li><li>${e.avoidambiguity ?? "Avoid ambiguity and vagueness"}</li><li>${e.moredetails ?? "you do not need to use exact field names in your instructions, but more detail is generally better"}</li></ul>${k((e.seedocumentation ?? "Please see the {documentation} for more information, including limitations and additional resources.").replace("{documentation}", `<calcite-link href=${r} target="_blank">${e.documentation ?? "documentation"}</calcite-link>`))}</p>` : n`<p>${k(e.useofassistant?.replace("{aiassistants}", `<strong>${e.aiassistants ?? "Ai Assistants"}</strong>`))}<calcite-link .href=${o} target=_blank icon-end=launch-2>${e.opensettings ?? "Open Settings"}</calcite-link></p>`}</calcite-block>`;
174
174
  }
175
- function he({ messages: i, onProceed: e, onExit: t, helpTopicUrl: o }) {
176
- return r`<calcite-dialog close-disabled placement=top .heading=${i.welcome} slot=dialogs open width-scale=m id=welcome-dialog><h3 class="unstyled-h3">${i.beforeyougetstarted}</h3><ul><li>${i.maybeincorrect}</li><li>${S(i.pleasereadhelp.replace("{helpTopic}", `<calcite-link href=${o} target="_blank">${i.helptopic}</calcite-link>`))}</li></ul><calcite-button id=welcome-proceed slot=footer-end @click=${e}>${i.proceed}</calcite-button><calcite-button id=welcome-decline slot=footer-start @click=${t} kind=neutral>${i.exit}</calcite-button></calcite-dialog>`;
175
+ function me({ messages: i, onProceed: e, onExit: t, helpTopicUrl: o }) {
176
+ return n`<calcite-dialog close-disabled placement=top .heading=${i.welcome} slot=dialogs open width-scale=m id=welcome-dialog><h3 class="unstyled-h3">${i.beforeyougetstarted}</h3><ul><li>${i.maybeincorrect}</li><li>${k(i.pleasereadhelp.replace("{helpTopic}", `<calcite-link href=${o} target="_blank">${i.helptopic}</calcite-link>`))}</li></ul><calcite-button id=welcome-proceed slot=footer-end @click=${e}>${i.proceed}</calcite-button><calcite-button id=welcome-decline slot=footer-start @click=${t} kind=neutral>${i.exit}</calcite-button></calcite-dialog>`;
177
177
  }
178
- function me({ messages: i, suggestions: e, onSuggestionClick: t }) {
179
- return r`<calcite-block .heading=${i.promptsuggestions} expanded collapsible id=suggestion-block><calcite-chip-group .label=${i.promptsuggestions} class="suggestion-chips">${D(e, (o) => o, (o) => r`<calcite-chip .label=${i.promptsuggestion} .value=${o} icon=effects @click=${() => t?.(o)}>${o}</calcite-chip>`)}</calcite-chip-group></calcite-block>`;
178
+ function fe({ messages: i, suggestions: e, onSuggestionClick: t }) {
179
+ return n`<calcite-block .heading=${i.promptsuggestions} expanded collapsible id=suggestion-block><calcite-chip-group class="suggestions" .label=${i.promptsuggestions ?? "Prompt Suggestions"}>${F(e, (o) => o, (o) => n`<calcite-button round appearance=outline-fill kind=neutral .label=${i.promptsuggestion} class="suggestion-button" @click=${() => t?.(o)}>${o}</calcite-button>`)}</calcite-chip-group></calcite-block>`;
180
180
  }
181
- function U({ hidden: i = !1, expanded: e = !1, messages: t, cards: o, heading: a, collapsible: s = !1, showEffectsIcon: p = !1, editorInsertMode: c = "add", setEditorInsertMode: n, copySuccessConversationId: h }) {
182
- const f = c === "replace", b = f ? t.replaceineditor ?? "Replace in editor" : t.addtoeditor ?? "Add to editor", y = f ? t.addtoeditor ?? "Add to editor" : t.replaceineditor ?? "Replace in editor";
183
- return r`<calcite-block .hidden=${i} id=result-block .heading=${a ?? t.besteffort ?? "Here is the assistant's best effort"} .expanded=${e} .collapsible=${s}>${p && r`<calcite-chip .label=${t.assistantresponses} slot=content-start icon=effects scale=m class="suggestion-chips"></calcite-chip>` || ""}<calcite-card-group .label=${t.assistantresponses}>${D(o, (l) => l.conversationId, (l) => r`<calcite-card><div slot=heading><div class="prior-prompt">${l.priorPrompt}</div>${l.message && r`<div class="collapsible-error response-error-container"><div class="error-display">${z({ errorMessage: r`<details open><summary>Error</summary><p>${l.message}</p></details>` })}</div></div>` || ""}</div><div><div class="code-response-wrapper"><div class="positioned-code-content">${l.chips?.map((u, w) => r`${u.tooltip && r`<calcite-tooltip .referenceElement=${`response-chip-${u.conversationId}-${w}`} placement=top-start>${u.tooltip}</calcite-tooltip>` || ""}<calcite-chip .label=${u.label} .scale=${u.scale ?? "s"} .appearance=${u.appearance ?? "outline"} .icon=${u.icon} .id=${`response-chip-${u.conversationId}-${w}`}>${u.label}</calcite-chip>`)}</div><details class="collapsible-code" open><summary>Code response</summary><code>${l.code}</code></details></div></div><div slot=footer-start><calcite-split-button primary-text=${b ?? R} appearance=outline-fill class="add-to-editor-button" @calciteSplitButtonPrimaryClick=${() => l.onAddToEditor()} overlay-positioning=fixed><calcite-dropdown-item @calciteDropdownItemSelect=${() => {
184
- n?.(f ? "add" : "replace");
185
- }}>${y}</calcite-dropdown-item></calcite-split-button><calcite-button round icon-start=copy-to-clipboard kind=neutral @click=${() => l.onCopy(l.conversationId)} class="copy-button">${l.conversationId === h ? t.copied ?? "copied" : ""}</calcite-button></div><div slot=footer-end class="feedback-actions"><calcite-action .text=${t.thumbsup} scale=s icon=thumbs-up @click=${l.onThumbsUp}></calcite-action><calcite-action .text=${t.thumbsdown} scale=s icon=thumbs-down @click=${l.onThumbsDown}></calcite-action></div></calcite-card>`)}</calcite-card-group></calcite-block>`;
181
+ function M({ hidden: i = !1, expanded: e = !1, messages: t, cards: o, heading: r, collapsible: c = !1, showEffectsIcon: h = !1, onCopyCode: d, standalone: s }) {
182
+ const m = t.addtoeditor ?? "Add to editor";
183
+ return n`<calcite-block .hidden=${i} id=result-block .heading=${r ?? t.besteffort ?? "Here is the assistant's best effort"} .expanded=${e} .collapsible=${c}>${h && n`<calcite-chip .label=${t.assistantresponses} slot=content-start icon=effects scale=m class="suggestion-chips"></calcite-chip>` || ""}<calcite-card-group .label=${t.assistantresponses}>${F(o, (a) => a.conversationId, (a) => n`<calcite-card><div slot=heading><div class="prior-prompt"><span>${a.priorPrompt}</span><calcite-action icon=duplicate scale=s slot=actions-end class="copy-prompt-button" text .id=${`copy-prompt-${a.conversationId}-${s ? "standalone" : "list"}`} @click=${(l) => {
184
+ const p = l.currentTarget;
185
+ navigator.clipboard.writeText(a.priorPrompt).then(() => {
186
+ p.setAttribute("data-copied", "true"), setTimeout(() => p.removeAttribute("data-copied"), 1500);
187
+ });
188
+ }}></calcite-action><calcite-popover .referenceElement=${`copy-prompt-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start class="copy-feedback" .label=${t.copiedsuccessfully ?? "copied successfully"} open trigger-disabled><span>${t.copiedsuccessfully ?? "copied successfully"}</span></calcite-popover><calcite-tooltip .referenceElement=${`copy-prompt-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start class="copy-tooltip">${t.copyprompttoclipboard}</calcite-tooltip></div>${a.message && s && n`<div class="response-error-container">${D({ errorMessage: a.message })}</div>` || ""}</div><div><div class="code-response-wrapper"><div class="positioned-code-content"><calcite-chip-group .label=${t.responsecontext ?? "Response Context"} scale=s>${a.message && !s && n`<calcite-tooltip .referenceElement=${`response-chip-${a.conversationId}-error`} placement=top-start overlay-positioning=fixed>${a.message}</calcite-tooltip><calcite-chip .id=${`response-chip-${a.conversationId}-error`} .label=${t.error ?? "Error"} scale=s appearance=outline icon=exclamation-mark-triangle-f class="response-error-chip"></calcite-chip>` || ""}${a.chips?.map((l) => {
189
+ const p = K();
190
+ return n`${l.tooltip && n`<calcite-tooltip .referenceElement=${`response-chip-${l.conversationId}-${p}`} placement=top-start overlay-positioning=fixed>${l.tooltip}</calcite-tooltip>` || ""}<calcite-chip .label=${l.label} .scale=${l.scale ?? "s"} .appearance=${l.appearance ?? "outline"} .icon=${l.icon} .id=${`response-chip-${l.conversationId}-${p}`}>${l.label}</calcite-chip>`;
191
+ })}</calcite-chip-group></div><details class="collapsible-code" open><summary>Code response</summary><code>${a.code}</code></details></div></div><div slot=footer-start class="feedback-actions"><calcite-button primary-text=${m ?? C} class="add-to-editor-button" @click=${() => a.onAddToEditor("add")} overlay-positioning=fixed scale=s icon-start=plus round>${t.addtoeditor ?? "Add to editor"}</calcite-button><calcite-button round icon-start=file-code kind=neutral scale=s @click=${() => a.onAddToEditor("replace")} class="response-secondary-action-button" .id=${`replace-${a.conversationId}-${s ? "standalone" : "list"}`}></calcite-button><calcite-tooltip .referenceElement=${`replace-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start><span>${t.replaceineditor ?? "Replace all code in editor"}</span></calcite-tooltip><calcite-button round icon-start=copy-to-clipboard kind=neutral scale=s @click=${(l) => {
192
+ const p = l.currentTarget;
193
+ d(a.code).then(() => {
194
+ p.setAttribute("data-copied", "true"), setTimeout(() => p.removeAttribute("data-copied"), 1500);
195
+ });
196
+ }} class="response-secondary-action-button" .id=${`copy-response-${a.conversationId}-${s ? "standalone" : "list"}`}></calcite-button><calcite-popover .referenceElement=${`copy-response-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start class="copy-feedback" .label=${t.copiedsuccessfully ?? "copied successfully"} open trigger-disabled><span>${t.copiedsuccessfully ?? "copied successfully"}</span></calcite-popover><calcite-tooltip .referenceElement=${`copy-response-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start class="copy-tooltip">${t.copytoclipboard}</calcite-tooltip></div><div slot=footer-end class="feedback-actions"><calcite-action .text=${t.thumbsup} scale=s icon=thumbs-up @click=${a.onThumbsUp} .id=${`thumbs-up-${a.conversationId}-${s ? "standalone" : "list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-up-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start><span>${t.helpful ?? "Helpful"}</span></calcite-tooltip><calcite-action .text=${t.thumbsdown} scale=s icon=thumbs-down @click=${a.onThumbsDown} .id=${`thumbs-down-${a.conversationId}-${s ? "standalone" : "list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-down-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start><span>${t.unhelpful ?? "Unhelpful"}</span></calcite-tooltip></div></calcite-card>`)}</calcite-card-group></calcite-block>`;
186
197
  }
187
- const d = {
198
+ const u = {
188
199
  welcome: "Welcome to the new assistant experience",
189
200
  beforeyougetstarted: "Before you get started be aware:",
190
201
  maybeincorrect: "AI generated code may occasionally be incorrect or biased. Review carefully.",
@@ -204,7 +215,7 @@ const d = {
204
215
  esriprivacystatement: "Esri Privacy Statement",
205
216
  supplement: "Supplement",
206
217
  disclaimerpt2: "AI-generated content may be inaccurate. Review before using.",
207
- replaceineditor: "Replace in editor",
218
+ replaceineditor: "Replace all code in editor",
208
219
  keepinmind: "Keep in mind the following:",
209
220
  beconsise: "Be concise, but also clear in your request",
210
221
  avoidambiguity: "Avoid ambiguity and vagueness",
@@ -217,8 +228,15 @@ const d = {
217
228
  layercontextlabel: "Layer context: {layerName}",
218
229
  numlayers: "{numLayers} {layerOrLayers}",
219
230
  numlayersplural: "layers",
220
- numlayerssingular: "layer"
221
- }, fe = "arcade_generation", be = "ArcadeCodeRequest", I = "visualization", ge = "ArcadeAssistant", ve = [
231
+ numlayerssingular: "layer",
232
+ responsecontext: "Response context",
233
+ error: "Error",
234
+ copytoclipboard: "Copy code to clipboard",
235
+ copyprompttoclipboard: "Copy prompt to clipboard",
236
+ copiedsuccessfully: "Copied successfully",
237
+ helpful: "Helpful",
238
+ unhelpful: "Unhelpful"
239
+ }, be = "arcade_generation", ge = "ArcadeCodeRequest", A = "visualization", ve = "ArcadeAssistant", ye = [
222
240
  "your_comments",
223
241
  "user_evaluation",
224
242
  "question",
@@ -229,8 +247,8 @@ const d = {
229
247
  "context",
230
248
  "extras"
231
249
  ];
232
- let F = [], _ = !0;
233
- class ye extends H {
250
+ let U = [], N = !0;
251
+ class $e extends L {
234
252
  constructor() {
235
253
  super(...arguments), this.textAreaRef = j(), this.messages = Q(), this._feedbackService = void 0, this.handleFeedbackButton = (e, t) => {
236
254
  this.feedback = { ...this.feedback, active: !0, value: e, item: t };
@@ -250,13 +268,13 @@ class ye extends H {
250
268
  this.handleFeedbackSheetClose();
251
269
  return;
252
270
  }
253
- const t = this.getModel(), o = t ? await this.getProfileAndMetadata(t.uri) : void 0, a = {
271
+ const t = this.getModel(), o = t ? await this.getProfileAndMetadata(t.uri) : void 0, r = {
254
272
  user_evaluation: this.feedback.value,
255
273
  your_comments: this.feedback.text || void 0,
256
274
  question: this.question,
257
- answer: this.feedback.item?.script ?? "",
275
+ answer: this.feedback.item?.formattedScript ?? this.feedback.item?.script ?? "",
258
276
  useragent: navigator.userAgent,
259
- _source: ge,
277
+ _source: ve,
260
278
  version: this.appVersion ?? "",
261
279
  context: o ? JSON.stringify(o) : "",
262
280
  extras: o?.profileName ?? "",
@@ -264,9 +282,9 @@ class ye extends H {
264
282
  privacy_statement: this.feedback.termsAccepted ? "I_agree" : ""
265
283
  };
266
284
  try {
267
- await e.applyEdits({ addFeatures: [new X({ attributes: a })] });
268
- } catch (s) {
269
- console.error("Error submitting feedback:", s);
285
+ await e.applyEdits({ addFeatures: [new Z({ attributes: r })] });
286
+ } catch (c) {
287
+ console.error("Error submitting feedback:", c);
270
288
  }
271
289
  this.handleFeedbackSheetClose();
272
290
  }, this.handleClose = (e) => {
@@ -282,23 +300,26 @@ class ye extends H {
282
300
  item: void 0,
283
301
  termsAccepted: !1,
284
302
  submitting: !1
285
- }, this.copySuccessConversationId = void 0, this.splashActive = !0, this.editorInsertMode = "add", this.context = void 0, this.historyCards = [], this.helpBase = "", this.assistantsEnabled = !1, this.closed = !1;
303
+ }, this.splashActive = !0, this.context = void 0, this.historyCards = [], this.helpBase = "", this.assistantsEnabled = !1, this.closed = !1;
286
304
  }
287
305
  static {
288
- this.properties = { isViewingResult: 16, confirmationActive: 16, isSubmitting: 16, errorMessage: 16, question: 16, history: 16, feedback: 16, copySuccessConversationId: 16, splashActive: 16, editorInsertMode: 16, context: 16, historyCards: 16, closePanel: 0, insertText: 0, helpBase: 1, assistantsEnabled: 5, layer: [1, { type: Object }], orgBaseUrl: 1, serviceUrl: 1, closed: 7, editorRef: 0, feedbackServiceUrl: 1, appVersion: 1 };
306
+ this.properties = { isViewingResult: 16, confirmationActive: 16, isSubmitting: 16, errorMessage: 16, question: 16, history: 16, feedback: 16, splashActive: 16, context: 16, historyCards: 16, closePanel: 0, insertText: 0, helpBase: 1, assistantsEnabled: 5, layer: [1, { type: Object }], portalUrl: 1, serviceUrl: 1, closed: 7, editorRef: 0, feedbackServiceUrl: 1, appVersion: 1 };
289
307
  }
290
308
  static {
291
- this.styles = ee;
309
+ this.styles = te;
292
310
  }
293
311
  get disclaimerComment() {
294
312
  return `// ${this.messages.disclaimercomment}
295
- // ${d.disclaimerpt2}`;
313
+ // ${u.disclaimerpt2}`;
296
314
  }
297
315
  get assistantHelpUrl() {
298
316
  return `${this.helpBase ?? "https://doc.arcgis.com/en/arcgis-online/"}administer/configure-assistants.htm`;
299
317
  }
300
- get helpTopicUrl() {
301
- return `${this.helpBase ?? "https://doc.arcgis.com/en/arcgis-online/"}create-maps/arcade-assistant.htm`;
318
+ get assistantOverviewDocUrl() {
319
+ return `${this.helpBase ?? "https://doc.arcgis.com/en/arcgis-online/"}create-maps/understand-arcade-assistant.htm`;
320
+ }
321
+ get usingTheAssitantDocUrl() {
322
+ return `${this.helpBase ?? "https://doc.arcgis.com/en/arcgis-online/"}create-maps/use-arcade-assistant.htm`;
302
323
  }
303
324
  async destroy() {
304
325
  }
@@ -314,7 +335,7 @@ class ye extends H {
314
335
  };
315
336
  e().catch((t) => {
316
337
  console.error("Error setting initial context in Arcade Assistant:", t);
317
- }), this.manager.onLifecycle(() => ({ remove: M.onModelContextDidChange(async () => {
338
+ }), this.manager.onLifecycle(() => ({ remove: E.onModelContextDidChange(async () => {
318
339
  e().catch((o) => {
319
340
  console.error("Error setting context in Arcade Assistant:", o);
320
341
  });
@@ -324,10 +345,10 @@ class ye extends H {
324
345
  e.has("history") && (this.historyCards = this.getHistoryCards());
325
346
  }
326
347
  connectedCallback() {
327
- super.connectedCallback(), this.history = F, this.splashActive = _;
348
+ super.connectedCallback(), this.history = U, this.splashActive = N;
328
349
  }
329
350
  disconnectedCallback() {
330
- super.disconnectedCallback(), F = this.history, _ = this.splashActive, this.copySuccessTimer && (clearTimeout(this.copySuccessTimer), this.copySuccessTimer = void 0);
351
+ super.disconnectedCallback(), U = this.history, N = this.splashActive, this.copySuccessTimer && (clearTimeout(this.copySuccessTimer), this.copySuccessTimer = void 0);
331
352
  }
332
353
  getHistoryCards() {
333
354
  return this.history.reduce((e, t) => (!t.script || (e.push({
@@ -335,35 +356,26 @@ class ye extends H {
335
356
  code: t.formattedScript || t.error || "",
336
357
  chips: [
337
358
  {
338
- label: t.profile ?? I,
359
+ label: t.profile ?? A,
339
360
  icon: "map-information",
340
361
  appearance: "outline",
341
362
  scale: "s",
342
363
  conversationId: t.conversationId ?? "",
343
- tooltip: d.profilecontextlabel.replace("{profileName}", t.profile ?? I)
364
+ tooltip: u.profilecontextlabel.replace("{profileName}", t.profile ?? A)
344
365
  },
345
366
  ...t.layerName ? [
346
367
  {
347
- label: d.numlayers.replace("{numLayers}", "1").replace("{layerOrLayers}", d.numlayerssingular),
368
+ label: u.numlayers.replace("{numLayers}", "1").replace("{layerOrLayers}", u.numlayerssingular),
348
369
  icon: "layer",
349
370
  appearance: "outline",
350
371
  scale: "s",
351
372
  conversationId: t.conversationId ?? "",
352
- tooltip: d.layercontextlabel.replace("{layerName}", t.layerName ?? "No layer")
373
+ tooltip: u.layercontextlabel.replace("{layerName}", t.layerName ?? "No layer")
353
374
  }
354
375
  ] : []
355
376
  ],
356
- onAddToEditor: () => {
357
- J(this.editorRef.editorInstance, t.formattedScript ?? "", this.editorInsertMode, this.disclaimerComment);
358
- },
359
- onCopy: (o) => {
360
- const a = t.formattedScript ? `${this.disclaimerComment}
361
- ${t.formattedScript}` : "";
362
- a && navigator.clipboard.writeText(a).then(() => {
363
- this.copySuccessConversationId = o, this.copySuccessTimer && clearTimeout(this.copySuccessTimer), this.copySuccessTimer = window.setTimeout(() => {
364
- this.copySuccessConversationId = void 0, this.copySuccessTimer = void 0;
365
- }, 1500);
366
- });
377
+ onAddToEditor: (o) => {
378
+ J(this.editorRef.editorInstance, t.formattedScript ?? "", o, this.disclaimerComment);
367
379
  },
368
380
  onThumbsUp: () => this.handleFeedbackButton("good", t),
369
381
  onThumbsDown: () => this.handleFeedbackButton("bad", t),
@@ -379,9 +391,9 @@ ${t.formattedScript}` : "";
379
391
  return this._feedbackService;
380
392
  if (!this.feedbackServiceUrl)
381
393
  return;
382
- const e = new K({ url: this.feedbackServiceUrl });
394
+ const e = new X({ url: this.feedbackServiceUrl });
383
395
  await e.load();
384
- const t = ve.filter((o) => !e.fields.some((a) => a.name === o));
396
+ const t = ye.filter((o) => !e.fields.some((r) => r.name === o));
385
397
  if (t.length > 0) {
386
398
  console.error(`Missing the following fields in feedback service: ${t.join(", ")}. Feedback will not be logged.`);
387
399
  return;
@@ -398,78 +410,96 @@ ${t.formattedScript}` : "";
398
410
  const e = await this.getToken(), t = this.getModel();
399
411
  if (!t)
400
412
  return;
401
- const { profileName: o, metadata: a, layerName: s } = await this.getProfileAndMetadata(t.uri), c = (await te({
413
+ const { profileName: o, metadata: r, layerName: c } = await this.getProfileAndMetadata(t.uri), d = (await ie({
402
414
  baseUrl: this.serviceUrl,
403
- skillId: fe,
415
+ skillId: be,
404
416
  message: this.question,
405
417
  authToken: e,
406
418
  context: {
407
- kind: be,
419
+ kind: ge,
408
420
  context: {
409
421
  profile_name: o,
410
- metadata: a
422
+ metadata: r
411
423
  }
412
424
  }
413
- })).find((n) => n.context?.kind === "ArcadeCodeResponse");
414
- if (!c)
425
+ })).find((s) => s.context?.kind === "ArcadeCodeResponse");
426
+ if (!d)
415
427
  return;
416
- c.context?.kind === "ArcadeCodeResponse" && (this.history = [
428
+ d.context?.kind === "ArcadeCodeResponse" && (this.history = [
417
429
  {
418
- script: c?.context?.arcadeCode?.code,
419
- formattedScript: Y(c?.context?.arcadeCode?.code ?? ""),
430
+ script: d?.context?.arcadeCode?.code,
431
+ formattedScript: Y(d?.context?.arcadeCode?.code ?? ""),
420
432
  error: void 0,
421
433
  question: this.question,
422
434
  profile: o,
423
- conversationId: c.conversationId,
424
- layerName: s ?? void 0,
425
- ...c.message ? { message: c.message } : {}
435
+ conversationId: d.conversationId,
436
+ layerName: c ?? void 0,
437
+ ...d.message ? { message: d.message } : {}
426
438
  },
427
439
  ...this.history
428
440
  ], this.isViewingResult = !0, this.errorMessage = void 0);
429
441
  } catch (e) {
430
- e instanceof Error && e.name === "ArcadeAssistantError" ? this.errorMessage = oe(e) || this.messages.erroroccurred || "An error occurred." : this.errorMessage = this.messages.erroroccurred || "An error occurred.", console.error("Error in Arcade Assistant:", e);
442
+ e instanceof Error && e.name === "ArcadeAssistantError" ? this.errorMessage = ae(e) || this.messages.erroroccurred || "An error occurred." : this.errorMessage = this.messages.erroroccurred || "An error occurred.", console.error("Error in Arcade Assistant:", e);
431
443
  } finally {
432
444
  this.isSubmitting = !1;
433
445
  }
434
446
  }
435
447
  }
436
448
  async getToken() {
437
- const { token: e } = await W.getCredential(this.orgBaseUrl);
449
+ const { token: e } = await W.getCredential(this.portalUrl);
438
450
  return e;
439
451
  }
440
452
  async getProfileAndMetadata(e) {
441
- let t = I;
442
- const o = M.getEditorProfileForModel(e);
453
+ let t = A;
454
+ const o = E.getEditorProfileForModel(e);
443
455
  o?.loaded || await o?.loadSource();
444
- const a = this.editorRef.profile;
445
- a && "id" in a && (t = a.id);
446
- const s = o?.definition?.variables?.find((n) => n.type === "feature");
447
- let p = [], c;
448
- return s?.definition && "fields" in s.definition && (p = s.definition.fields.map((n) => ({
449
- name: n.name,
450
- type: n.type,
451
- alias: n.alias
452
- })), Z(s?.definition) && (c = s.definition.title)), { profileName: t, metadata: p, layerName: c };
456
+ const r = this.editorRef.profile;
457
+ r && "id" in r && (t = r.id);
458
+ const c = o?.definition?.variables?.find((s) => s.type === "feature");
459
+ let h = [], d;
460
+ return c?.definition && "fields" in c.definition && (h = c.definition.fields.map((s) => ({
461
+ name: s.name,
462
+ type: s.type,
463
+ alias: s.alias
464
+ })), ee(c?.definition) && (d = c.definition.title)), { profileName: t, metadata: h, layerName: d };
465
+ }
466
+ onCopyCode(e) {
467
+ const t = e ? `${this.disclaimerComment}
468
+ ${e}` : "";
469
+ return navigator.clipboard.writeText(t);
453
470
  }
454
471
  render() {
455
- return this.closed ? null : this.assistantsEnabled ? C`<calcite-flow><calcite-flow-item closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${this.splashActive && C`<calcite-scrim></calcite-scrim>` || ""}${se({ messages: this.messages })}${re({ popoverContent: N({ assistantsEnabled: this.assistantsEnabled, messages: { ...this.messages, ...d }, assistantHelpUrl: this.assistantHelpUrl, helpTopicUrl: this.helpTopicUrl }) })}<calcite-shell class="unstyled-shell">${this.splashActive && he({ messages: { ...d, ...this.messages }, onProceed: () => {
472
+ return this.closed ? null : this.assistantsEnabled ? w`<calcite-flow><calcite-flow-item closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${this.splashActive && w`<calcite-scrim></calcite-scrim>` || ""}${re({ messages: this.messages })}${ce({ popoverContent: q({ assistantsEnabled: this.assistantsEnabled, messages: { ...this.messages, ...u }, assistantHelpUrl: this.assistantHelpUrl, helpTopicUrl: this.usingTheAssitantDocUrl }) })}<calcite-shell class="unstyled-shell">${this.splashActive && me({ messages: { ...u, ...this.messages }, onProceed: () => {
456
473
  this.splashActive = !1;
457
- }, helpTopicUrl: this.helpTopicUrl, onExit: (e) => this.closePanel && this.closePanel(e) }) || ""}${ce({ active: this.confirmationActive, setActive: (e) => this.confirmationActive = e, messages: this.messages })}${le({ isDisabled: this.isSubmitting, isReadOnly: !1, setQuestion: this.setQuestion, setIsViewingResult: (e) => this.isViewingResult = e, mode: this.isViewingResult ? "refine" : "prompt", textAreaRef: this.textAreaRef, question: this.question, errorMessage: this.errorMessage, setErrorMessage: (e) => this.errorMessage = e, submitQuestion: this.submitQuestion.bind(this), messages: { ...d, ...this.messages }, context: this.context })}<calcite-block-group label="interactive blocks">${!this.isViewingResult && !this.isSubmitting && me({ messages: { ...this.messages, ...d }, suggestions: ["Round value to one decimal place", 'Return "Yes" if value > 10'], onSuggestionClick: this.onSuggestionClick }) || ""}<calcite-block .hidden=${!this.isSubmitting} .heading=${this.messages.generatingresponse ?? "Generating response..."}></calcite-block>${U({
474
+ }, helpTopicUrl: this.assistantOverviewDocUrl, onExit: (e) => this.closePanel && this.closePanel(e) }) || ""}${ne({ active: this.confirmationActive, setActive: (e) => this.confirmationActive = e, messages: this.messages })}${de({ isDisabled: this.isSubmitting, isReadOnly: !1, setQuestion: this.setQuestion, setIsViewingResult: (e) => this.isViewingResult = e, mode: this.isViewingResult ? "refine" : "prompt", textAreaRef: this.textAreaRef, question: this.question, errorMessage: this.errorMessage, setErrorMessage: (e) => this.errorMessage = e, submitQuestion: this.submitQuestion.bind(this), messages: { ...u, ...this.messages }, context: this.context })}<calcite-block-group label="interactive blocks">${!this.isViewingResult && !this.isSubmitting && fe({ messages: { ...this.messages, ...u }, suggestions: ["Round value to one decimal place", 'Return "Yes" if value > 10'], onSuggestionClick: this.onSuggestionClick }) || ""}<calcite-block .hidden=${!this.isSubmitting} .heading=${this.messages.generatingresponse ?? "Generating response..."}></calcite-block>${M({
458
475
  expanded: this.isViewingResult,
459
- messages: { ...this.messages, ...d },
476
+ messages: { ...this.messages, ...u },
460
477
  collapsible: !0,
461
478
  showEffectsIcon: !0,
462
- editorInsertMode: this.editorInsertMode,
463
- setEditorInsertMode: (e) => this.editorInsertMode = e,
464
479
  /** Only show the latest history card */
465
480
  cards: this.historyCards.length ? [this.historyCards[0]] : [],
466
481
  heading: this.messages.besteffort ?? "Here's the assistant's best effort",
467
482
  hidden: this.isSubmitting || !this.isViewingResult,
468
- copySuccessConversationId: this.copySuccessConversationId
469
- })}${U({ expanded: !this.isViewingResult, messages: { ...this.messages, ...d }, collapsible: !0, editorInsertMode: this.editorInsertMode, setEditorInsertMode: (e) => this.editorInsertMode = e, cards: this.isViewingResult ? this.historyCards.slice(1) : this.historyCards, heading: this.messages.recentprompts ?? "Recent prompts", hidden: this.isSubmitting || this.history.length === 0, copySuccessConversationId: this.copySuccessConversationId })}</calcite-block-group>${this.feedback.active ? ue({ setOpen: this.handleFeedbackSheetClose, messages: { ...this.messages, ...d }, onSubmit: this.handleFeedbackSubmit, feedback: this.feedback, setFeedback: this.setFeedbackState.bind(this) }) : null}</calcite-shell></calcite-flow-item></calcite-flow>` : C`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${N({ slot: "content-top", messages: { ...this.messages, ...d }, assistantsEnabled: this.assistantsEnabled, assistantHelpUrl: this.assistantHelpUrl, helpTopicUrl: this.helpTopicUrl })}</calcite-flow-item></calcite-flow>`;
483
+ onCopyCode: this.onCopyCode.bind(this),
484
+ standalone: !0
485
+ })}${M({
486
+ expanded: !this.isViewingResult,
487
+ messages: { ...this.messages, ...u },
488
+ collapsible: !0,
489
+ /**
490
+ * When the user is viewing the latest result, we display the first history card
491
+ * (historyCards[0]) separately at the top in "standalone" mode.
492
+ * To avoid showing the same card twice, we remove (slice out) the first card
493
+ * from the list of recent prompts below.
494
+ */
495
+ cards: this.isViewingResult ? this.historyCards.slice(1) : this.historyCards,
496
+ heading: this.messages.recentprompts ?? "Recent prompts",
497
+ hidden: this.isSubmitting || this.history.length === 0,
498
+ onCopyCode: this.onCopyCode.bind(this)
499
+ })}</calcite-block-group>${this.feedback.active ? he({ setOpen: this.handleFeedbackSheetClose, messages: { ...this.messages, ...u }, onSubmit: this.handleFeedbackSubmit, feedback: this.feedback, setFeedback: this.setFeedbackState.bind(this) }) : null}</calcite-shell></calcite-flow-item></calcite-flow>` : w`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${q({ slot: "content-top", messages: { ...this.messages, ...u }, assistantsEnabled: this.assistantsEnabled, assistantHelpUrl: this.assistantHelpUrl, helpTopicUrl: this.usingTheAssitantDocUrl })}</calcite-flow-item></calcite-flow>`;
470
500
  }
471
501
  }
472
- B("arcgis-arcade-coding-assistant", ye);
502
+ V("arcgis-arcade-coding-assistant", $e);
473
503
  export {
474
- ye as ArcgisArcadeCodingAssistant
504
+ $e as ArcgisArcadeCodingAssistant
475
505
  };