@arcgis/coding-components 5.0.0-next.32 → 5.0.0-next.34
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.
- package/dist/addons.js +1 -1
- package/dist/cdn/{E5WGM3EO.js → 3G4S2ERL.js} +2 -2
- package/dist/cdn/{DFE6VTKB.js → 3HOSVOQF.js} +2 -2
- package/dist/cdn/{N6WHBWHN.js → 4NKHCL6W.js} +2 -2
- package/dist/cdn/{623JWHZD.js → 5RZARZRD.js} +2 -2
- package/dist/cdn/{RMQJXJ6Q.js → A52BWJRT.js} +2 -2
- package/dist/cdn/{FPAMNZS7.js → ABMXAFJP.js} +2 -2
- package/dist/cdn/{N2K7THJ6.js → AYFUMOY2.js} +2 -2
- package/dist/cdn/{55TNDMUS.js → BSWGIMHR.js} +1 -1
- package/dist/cdn/{VPY7US2U.js → BY2AZFQT.js} +2 -2
- package/dist/cdn/{WJG47HSX.js → C7PKUL27.js} +1 -1
- package/dist/cdn/{QA2X7GQW.js → CKDH5DK4.js} +2 -2
- package/dist/cdn/{CXFKQ4RE.js → CVOY6MN2.js} +4 -4
- package/dist/cdn/{ZS3ZZP7C.js → D3A445QG.js} +2 -2
- package/dist/cdn/D6NKFIB7.js +4 -0
- package/dist/cdn/{DTE6TU6M.js → EQPEFYVM.js} +1 -1
- package/dist/cdn/{IIXUV7FB.js → EVE3STDB.js} +1 -1
- package/dist/cdn/{NC5BRE2K.js → FAVI4NPY.js} +1 -1
- package/dist/cdn/FDWIGYOQ.js +6 -0
- package/dist/cdn/{2H4SANEZ.js → FODBVVQW.js} +2 -2
- package/dist/cdn/{6O6DECN2.js → GLQ5BPYQ.js} +2 -2
- package/dist/cdn/{J7V5INZV.js → H5VLYURC.js} +2 -2
- package/dist/cdn/{RVJYSLUY.js → HV2IU4K5.js} +1 -1
- package/dist/cdn/{AF3K4LWT.js → IIHJFHZ5.js} +2 -2
- package/dist/cdn/{WI3LQNXD.js → J3WXTW72.js} +2 -2
- package/dist/cdn/{KSTEQHRA.js → L4SA4RX4.js} +2 -2
- package/dist/cdn/{JVTZNZIA.js → LFRIZ2XB.js} +2 -2
- package/dist/cdn/{DOGEZWSP.js → LUHLOZ52.js} +2 -2
- package/dist/cdn/{2FRPKA6L.js → MRYFA4BE.js} +2 -2
- package/dist/cdn/{MGMYSTPB.js → O3IYK7RM.js} +2 -2
- package/dist/cdn/{HWMWCW6E.js → R6ISWI62.js} +2 -2
- package/dist/cdn/{2IFGR4VT.js → R74OLTXW.js} +2 -2
- package/dist/cdn/{7QLTA5YF.js → RR653ILW.js} +2 -2
- package/dist/cdn/{BLTIH4C2.js → SOCWRWQ3.js} +2 -2
- package/dist/cdn/{7IUWYVBF.js → TC6EISCY.js} +2 -2
- package/dist/cdn/{XUHZTHGB.js → TECR5JWF.js} +2 -2
- package/dist/cdn/{DGKJ3U7T.js → UX2I6WJR.js} +2 -2
- package/dist/cdn/{2FIPLTCQ.js → VYYPNF3K.js} +2 -2
- package/dist/cdn/{WEWH3FSF.js → W36EOYCQ.js} +2 -2
- package/dist/cdn/{YH2OCB5E.js → X7224RR3.js} +2 -2
- package/dist/cdn/{CRWABB7C.js → Y6R7LATC.js} +1 -1
- package/dist/cdn/{UFPUZUBG.js → YOSXIFLJ.js} +2 -2
- package/dist/cdn/{UV6OL7RM.js → Z747ROBS.js} +2 -2
- package/dist/cdn/{75L6ONUG.js → ZUWGIVMK.js} +2 -2
- package/dist/cdn/{NG6PGW6C.js → ZVZONB3C.js} +2 -2
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +34 -34
- package/dist/cdn/index.js +2 -2
- package/dist/chunks/arcade-defaults.js +1 -1
- package/dist/chunks/arcade-executor.js +1 -1
- package/dist/chunks/arcade-mode.js +1 -1
- package/dist/chunks/arcade-service-accessors.js +1 -1
- package/dist/chunks/editor.js +1 -1
- package/dist/chunks/fields.js +1 -1
- package/dist/chunks/language-defaults-base.js +1 -1
- package/dist/chunks/markdown.js +1 -1
- package/dist/chunks/monaco-importer.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/setup-monaco.js +1 -1
- package/dist/chunks/sql-expr-contribution.js +1 -1
- package/dist/chunks/sql-expr-defaults.js +1 -1
- package/dist/chunks/sql-expr-mode.js +1 -1
- package/dist/chunks/sql-expr-service-accessors.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/components/arcgis-arcade-coding-assistant/customElement.js +90 -89
- package/dist/components/arcgis-arcade-coding-assistant/index.d.ts +1 -1
- package/dist/components/arcgis-arcade-coding-assistant/index.js +1 -1
- package/dist/components/arcgis-arcade-editor/customElement.js +1 -1
- package/dist/components/arcgis-arcade-results/customElement.js +1 -1
- package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
- package/dist/components/arcgis-code-editor/customElement.js +1 -1
- package/dist/components/arcgis-editor-variables/customElement.js +1 -1
- package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
- package/dist/components/arcgis-sql-expression-editor/customElement.js +1 -1
- package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
- package/dist/docs/api.json +2 -2
- package/dist/docs/docs.json +2 -2
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.js +1 -1
- package/dist/monacoStyles.js +1 -1
- package/package.json +5 -5
- package/dist/cdn/HJYSDD6H.js +0 -6
- package/dist/cdn/YFVVVPG5.js +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createArcadeExecutor as C } from "@arcgis/core/arcade.js";
|
|
2
2
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
-
v5.0.0-next.
|
|
4
|
+
v5.0.0-next.34 */
|
|
5
5
|
const G = "https://developers.arcgis.com/arcade/", O = 100, A = 100;
|
|
6
6
|
function u(t) {
|
|
7
7
|
return !!t && typeof t == "object" && "declaredRootClass" in t && typeof t.declaredRootClass == "string" && t.declaredRootClass === "esri.arcade.featureset.support.FeatureSet";
|
|
@@ -9,7 +9,7 @@ import { debounce as F } from "@arcgis/toolkit/function";
|
|
|
9
9
|
import { Deferred as _ } from "@arcgis/toolkit/promise";
|
|
10
10
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
11
11
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
12
|
-
v5.0.0-next.
|
|
12
|
+
v5.0.0-next.34 */
|
|
13
13
|
const S = [
|
|
14
14
|
"<=",
|
|
15
15
|
">=",
|
package/dist/chunks/editor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { css as e } from "lit";
|
|
2
2
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
-
v5.0.0-next.
|
|
4
|
+
v5.0.0-next.34 */
|
|
5
5
|
const i = e`@layer{arcgis-arcade-editor,arcgis-sql-expression-editor{.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-panel{flex:1 0 auto}.position-relative{position:relative}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.border-inline-start{border-inline-start:var(--arcgis-coding-components-border)!important;box-sizing:border-box}.border-inline-end{border-inline-end:var(--arcgis-coding-components-border)!important;box-sizing:border-box}.side-action-bar{max-width:var(--arcgis-coding-components-side-action-bar-max-w)}.code-editor-side-panel{max-width:var(--arcgis-coding-components-code-editor-side-panel-max-w);width:var(--arcgis-coding-components-code-editor-side-panel-w)}.code-editor-side-panel calcite-flow{height:100%}}}`;
|
|
6
6
|
export {
|
|
7
7
|
i as s
|
package/dist/chunks/fields.js
CHANGED
|
@@ -15,7 +15,7 @@ import { filterApiLibraryForContext as de } from "@arcgis/languages-api-utils";
|
|
|
15
15
|
import { Emitter as G, Uri as E } from "monaco-editor";
|
|
16
16
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
17
17
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
18
|
-
v5.0.0-next.
|
|
18
|
+
v5.0.0-next.34 */
|
|
19
19
|
function k(t) {
|
|
20
20
|
return !!t && typeof t == "object" && "declaredClass" in t && typeof t.declaredClass == "string" && t.declaredClass.startsWith("esri.layers.") && w(t) && "queryFeatures" in t && typeof t.queryFeatures == "function";
|
|
21
21
|
}
|
package/dist/chunks/markdown.js
CHANGED
|
@@ -4,7 +4,7 @@ import { IStandaloneThemeService as ae } from "monaco-editor/esm/vs/editor/stand
|
|
|
4
4
|
import { generateTokensCSSForColorMap as ye } from "monaco-editor/esm/vs/editor/common/languages/supports/tokenization.js";
|
|
5
5
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
6
6
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
7
|
-
v5.0.0-next.
|
|
7
|
+
v5.0.0-next.34 */
|
|
8
8
|
async function Se(r, e) {
|
|
9
9
|
return await (await we()).colorize(r, e, { tabSize: 2 });
|
|
10
10
|
}
|
|
@@ -6,7 +6,7 @@ import "monaco-editor/esm/vs/editor/standalone/common/standaloneTheme.js";
|
|
|
6
6
|
import "monaco-editor/esm/vs/editor/common/languages/supports/tokenization.js";
|
|
7
7
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
8
8
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
9
|
-
v5.0.0-next.
|
|
9
|
+
v5.0.0-next.34 */
|
|
10
10
|
function $(e, n, l, i) {
|
|
11
11
|
if (!n)
|
|
12
12
|
return [];
|
package/dist/chunks/runtime.js
CHANGED
|
@@ -3,7 +3,7 @@ import { makeRuntime as e } from "@arcgis/lumina";
|
|
|
3
3
|
import { trackAccess as s, createObservable as r, createTrackingTarget as a, runTracked as c } from "@arcgis/core/applications/Components/reactiveUtils.js";
|
|
4
4
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
5
5
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
6
|
-
v5.0.0-next.
|
|
6
|
+
v5.0.0-next.34 */
|
|
7
7
|
const t = e({ defaultAssetPath: "https://jsdev.arcgis.com/next/coding-components/", hydratedAttribute: "hydrated" }), { customElement: n, getAssetPath: d, setAssetPath: i } = t;
|
|
8
8
|
t.t = s;
|
|
9
9
|
t.o = r;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import w from "@arcgis/core/request.js";
|
|
2
2
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
-
v5.0.0-next.
|
|
4
|
+
v5.0.0-next.34 */
|
|
5
5
|
function d() {
|
|
6
6
|
return !!window.MonacoEnvironment?.getWorker;
|
|
7
7
|
}
|
|
@@ -9,7 +9,7 @@ import { a as n } from "./sql-expr-defaults.js";
|
|
|
9
9
|
import { g as m } from "./sql-expr-service-accessors.js";
|
|
10
10
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
11
11
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
12
|
-
v5.0.0-next.
|
|
12
|
+
v5.0.0-next.34 */
|
|
13
13
|
const s = /* @__PURE__ */ new Set();
|
|
14
14
|
function g(e, o) {
|
|
15
15
|
return () => {
|
|
@@ -4,7 +4,7 @@ import { fetchT9nStringsBundle as M } from "@arcgis/toolkit/intl";
|
|
|
4
4
|
import { g as b } from "./runtime.js";
|
|
5
5
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
6
6
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
7
|
-
v5.0.0-next.
|
|
7
|
+
v5.0.0-next.34 */
|
|
8
8
|
const x = (r) => {
|
|
9
9
|
const e = r.variables[0], i = e && e.type === "featureSet" ? A(e) : void 0, { apiVersion: t, bundles: o, hiddenApiItems: s } = r.toEditorProfileDefinition();
|
|
10
10
|
return {
|
|
@@ -9,7 +9,7 @@ import { debounce as N } from "@arcgis/toolkit/function";
|
|
|
9
9
|
import { g as f } from "./sql-expr-service-accessors.js";
|
|
10
10
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
11
11
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
12
|
-
v5.0.0-next.
|
|
12
|
+
v5.0.0-next.34 */
|
|
13
13
|
let h = new _();
|
|
14
14
|
class k {
|
|
15
15
|
constructor(e) {
|
package/dist/chunks/useT9n.js
CHANGED
|
@@ -2,7 +2,7 @@ import { makeT9nController as o } from "@arcgis/lumina/controllers";
|
|
|
2
2
|
import { g as t } from "./runtime.js";
|
|
3
3
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
5
|
-
v5.0.0-next.
|
|
5
|
+
v5.0.0-next.34 */
|
|
6
6
|
const s = o(t);
|
|
7
7
|
export {
|
|
8
8
|
s as u
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { nothing as
|
|
1
|
+
import { c as L } from "../../chunks/runtime.js";
|
|
2
|
+
import { nothing as M, LitElement as V } from "@arcgis/lumina";
|
|
3
3
|
import { ref as H, createRef as B } from "lit/directives/ref.js";
|
|
4
4
|
import j from "@arcgis/core/identity/IdentityManager.js";
|
|
5
5
|
import { u as W } from "../../chunks/useT9n.js";
|
|
6
|
-
import { b as
|
|
7
|
-
import { css as
|
|
8
|
-
import
|
|
9
|
-
import { e as
|
|
6
|
+
import { b as S } from "../../chunks/arcade-defaults.js";
|
|
7
|
+
import { css as G, html as r } from "lit";
|
|
8
|
+
import I from "@arcgis/core/request.js";
|
|
9
|
+
import { e as Q, a as J } from "../../chunks/monaco-importer.js";
|
|
10
10
|
import { repeat as U } from "lit/directives/repeat.js";
|
|
11
11
|
import "@arcgis/toolkit/function";
|
|
12
12
|
import { generateGuid as K } from "@arcgis/toolkit/string";
|
|
@@ -17,9 +17,9 @@ import Z from "@arcgis/core/Graphic.js";
|
|
|
17
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/5.0/esri/copyright.txt for details.
|
|
20
|
-
v5.0.0-next.
|
|
21
|
-
const te =
|
|
22
|
-
class
|
|
20
|
+
v5.0.0-next.34 */
|
|
21
|
+
const te = G`:host(:not([closed])){container-type:size;--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-code-editor-side-panel-max-w);width:var(--arcgis-coding-components-code-editor-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}@container (max-width: 380px){.hidden-below-380{display:none}}@container (min-width: 380px){.hidden-above-380{display:none}}.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)}.feedback-content{padding:1rem;display:flex;flex-direction:column;gap:.75rem;max-height:30vh;overflow-y:auto}.feedback-sheet{--calcite-sheet-height: auto;--calcite-sheet-max-height: 100%;--calcite-sheet-min-height: auto}calcite-chip[slot=header-actions-end]{align-self:center;margin-inline-end:.5rem}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}.contained-popover-or-tooltip{--calcite-popover-max-size-x: 100%;--calcite-tooltip-max-size-x: 100%}.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-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}.contained{max-width:100%;max-height:100%;max-width:100cqi;max-height:75cqb;overflow-y:auto}}:host([closed]){display:none}`;
|
|
22
|
+
class v extends Error {
|
|
23
23
|
constructor({
|
|
24
24
|
message: e,
|
|
25
25
|
code: t,
|
|
@@ -30,7 +30,7 @@ class y extends Error {
|
|
|
30
30
|
super(e), this.name = "ArcadeAssistantError", this.code = t, this.subCode = o, this.details = c, this.source = n;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function T(i) {
|
|
34
34
|
if (!i)
|
|
35
35
|
return;
|
|
36
36
|
const e = i.indexOf('{"error":');
|
|
@@ -44,39 +44,39 @@ function E(i) {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
async function ie(i) {
|
|
47
|
-
const { baseUrl: e, skillId: t, message: o, authToken: c, previousConversationId: n, context:
|
|
47
|
+
const { baseUrl: e, skillId: t, message: o, authToken: c, previousConversationId: n, context: u } = i, d = t ? `${e}/skills/${t}/chat` : `${e}/chat`, s = [], a = {
|
|
48
48
|
message: o,
|
|
49
|
-
context:
|
|
49
|
+
context: u
|
|
50
50
|
};
|
|
51
|
-
n && (
|
|
52
|
-
let
|
|
51
|
+
n && (a.conversation_id = n);
|
|
52
|
+
let l;
|
|
53
53
|
try {
|
|
54
|
-
|
|
54
|
+
l = await I(d, {
|
|
55
55
|
method: "post",
|
|
56
56
|
headers: {
|
|
57
57
|
"Content-Type": "application/json",
|
|
58
58
|
token: c
|
|
59
59
|
},
|
|
60
|
-
body: JSON.stringify(
|
|
60
|
+
body: JSON.stringify(a),
|
|
61
61
|
responseType: "json"
|
|
62
62
|
});
|
|
63
|
-
} catch (
|
|
64
|
-
const
|
|
65
|
-
throw
|
|
63
|
+
} catch (m) {
|
|
64
|
+
const f = m, k = f.details?.rawResponse || f.message || String(m), b = T(k);
|
|
65
|
+
throw b ? new v(b) : m;
|
|
66
66
|
}
|
|
67
|
-
const
|
|
68
|
-
s.push(
|
|
69
|
-
const
|
|
70
|
-
let
|
|
71
|
-
async function
|
|
72
|
-
let
|
|
73
|
-
const
|
|
74
|
-
for (;
|
|
75
|
-
await new Promise((
|
|
76
|
-
const k = oe(
|
|
77
|
-
let
|
|
67
|
+
const p = l.data;
|
|
68
|
+
s.push(p);
|
|
69
|
+
const y = p.conversationId, _ = p.inquiryId;
|
|
70
|
+
let w = p.sequenceNumber;
|
|
71
|
+
async function z() {
|
|
72
|
+
let m = 0;
|
|
73
|
+
const f = 25;
|
|
74
|
+
for (; m < f; ) {
|
|
75
|
+
await new Promise((g) => setTimeout(g, 1e3));
|
|
76
|
+
const k = oe(y, w, _);
|
|
77
|
+
let b;
|
|
78
78
|
try {
|
|
79
|
-
|
|
79
|
+
b = await I(d, {
|
|
80
80
|
method: "post",
|
|
81
81
|
headers: {
|
|
82
82
|
"Content-Type": "application/json",
|
|
@@ -85,42 +85,42 @@ async function ie(i) {
|
|
|
85
85
|
body: JSON.stringify(k),
|
|
86
86
|
responseType: "json"
|
|
87
87
|
});
|
|
88
|
-
} catch (
|
|
89
|
-
const
|
|
90
|
-
throw
|
|
88
|
+
} catch (g) {
|
|
89
|
+
const A = g, O = A.details?.rawResponse || A.message || String(g), C = T(O);
|
|
90
|
+
throw C ? new v(C) : g;
|
|
91
91
|
}
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
94
|
-
throw new
|
|
95
|
-
message:
|
|
96
|
-
code:
|
|
97
|
-
subCode:
|
|
98
|
-
details:
|
|
92
|
+
const h = b.data;
|
|
93
|
+
if (h.context && h.context.kind === "ArcgisErrorAsContext" && h.context.error)
|
|
94
|
+
throw new v({
|
|
95
|
+
message: h.context.error.message || "ArcGIS Assistant error",
|
|
96
|
+
code: h.context.error.code,
|
|
97
|
+
subCode: h.context.error.subCode,
|
|
98
|
+
details: h.context.error.details,
|
|
99
99
|
source: "polling-response"
|
|
100
100
|
});
|
|
101
|
-
if (s.push(
|
|
101
|
+
if (s.push(h), w = h.sequenceNumber, m++, !h.hasMore)
|
|
102
102
|
break;
|
|
103
103
|
}
|
|
104
|
-
if (
|
|
105
|
-
throw new
|
|
104
|
+
if (m === f)
|
|
105
|
+
throw new v({
|
|
106
106
|
message: "Request timed out",
|
|
107
107
|
code: "TIMEOUT",
|
|
108
108
|
source: "polling"
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
const
|
|
111
|
+
const D = 2 * 60 * 1e3;
|
|
112
112
|
return await Promise.race([
|
|
113
|
-
|
|
113
|
+
z(),
|
|
114
114
|
new Promise(
|
|
115
|
-
(
|
|
116
|
-
() =>
|
|
117
|
-
new
|
|
115
|
+
(m, f) => setTimeout(
|
|
116
|
+
() => f(
|
|
117
|
+
new v({
|
|
118
118
|
message: "Request timed out",
|
|
119
119
|
code: "TIMEOUT",
|
|
120
120
|
source: "hard-timeout"
|
|
121
121
|
})
|
|
122
122
|
),
|
|
123
|
-
|
|
123
|
+
D
|
|
124
124
|
)
|
|
125
125
|
)
|
|
126
126
|
]), s;
|
|
@@ -136,7 +136,7 @@ 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
138
|
const se = (i) => {
|
|
139
|
-
const e = i.value.length, t = 72, o = 180, c = i.offsetWidth,
|
|
139
|
+
const e = i.value.length, t = 72, o = 180, c = i.offsetWidth, u = Math.max(1, Math.floor(c / 8)), d = Math.ceil(e / u), s = t + (d - 2) * 24;
|
|
140
140
|
i.style.setProperty("--calcite-text-area-min-height", `${Math.min(s, o)}px`);
|
|
141
141
|
};
|
|
142
142
|
function ce({ messages: i }) {
|
|
@@ -146,7 +146,7 @@ function re({ popoverContent: i }) {
|
|
|
146
146
|
return r`<calcite-action icon=information slot=header-actions-end id=legal-disclaimer text></calcite-action><calcite-popover reference-element=legal-disclaimer label=legal-disclaimer placement=bottom auto-close focus-trap-disabled><div class="contained">${i}</div></calcite-popover>`;
|
|
147
147
|
}
|
|
148
148
|
function F({ 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 ??
|
|
149
|
+
return r`<div class="error-display"><calcite-input-message id=error-message status=invalid icon=exclamation-mark-triangle scale=m slot=${e ?? M}>${i}</calcite-input-message></div>`;
|
|
150
150
|
}
|
|
151
151
|
function ne({ active: i, setActive: e, messages: t }) {
|
|
152
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>`;
|
|
@@ -154,14 +154,16 @@ function ne({ active: i, setActive: e, messages: t }) {
|
|
|
154
154
|
function le({ context: i, messages: e }) {
|
|
155
155
|
return i ? r`<div class="gaps">${i.profileName && r`<calcite-popover auto-close placement=top .label=${(e.profilecontextlabel ?? "Profile context: {profileName}").replace("{profileName}", i.profileName)} reference-element=profile-context-button class="context-popover contained-popover-or-tooltip"><p>${(e.profilecontextlabel ?? "Profile context: {profileName}").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 ?? "Layer context: {layerName}").replace("{layerName}", i.layerName)} reference-element=layer-context-button class="context-popover contained-popover-or-tooltip"><p>${(e.layercontextlabel ?? "Layer context: {layerName}").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 de({ isDisabled: i, isReadOnly: e, setQuestion: t, setIsViewingResult: o, textAreaRef: c, question: n, errorMessage:
|
|
158
|
-
return r`<div class="text-area-wrapper"><calcite-text-area resize=vertical .readOnly=${i || e} class="styled-text-area" .placeholder=${
|
|
159
|
-
se(
|
|
160
|
-
}} ${H(c)}><div class="submission-actions-wrapper" slot=footer-start>${
|
|
157
|
+
function de({ isDisabled: i, isReadOnly: e, setQuestion: t, setIsViewingResult: o, textAreaRef: c, question: n, errorMessage: u, setErrorMessage: d, submitQuestion: s, messages: a, mode: l, context: p }) {
|
|
158
|
+
return r`<div class="text-area-wrapper"><calcite-text-area resize=vertical .readOnly=${i || e} class="styled-text-area" .placeholder=${a.askaquestion ?? `Specify the calculation or logic you need in an Arcade expression. (e.g., 'Return "Yes" if value > 10')`} .value=${n} @calciteTextAreaInput=${(y) => {
|
|
159
|
+
se(y.target), t(y.target.value);
|
|
160
|
+
}} ${H(c)}><div class="submission-actions-wrapper" slot=footer-start>${u && F({ errorMessage: u, slot: "footer-start" }) || ""}<div class="submission-actions">${le({ context: p, messages: a })}<div class="align-inline-end gaps"><calcite-button round kind=neutral .hidden=${l !== "refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid .disabled=${i} @click=${async () => {
|
|
161
161
|
o(!1), t("");
|
|
162
|
-
}}>${
|
|
163
|
-
|
|
164
|
-
}}>${a
|
|
162
|
+
}} .label=${a.startover ?? "Start Over"} class="hidden-above-380" id=small-start-over-button></calcite-button><calcite-tooltip reference-element=small-start-over-button placement=top-start class="hidden-above-380">${a.startover ?? "Start Over"}</calcite-tooltip><calcite-button round kind=neutral .hidden=${l !== "refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid .disabled=${i} @click=${async () => {
|
|
163
|
+
o(!1), t("");
|
|
164
|
+
}} class="hidden-below-380">${a.startover ?? "Start Over"}</calcite-button><calcite-button round icon-end=effects appearance=solid .loading=${i} .disabled=${i} @click=${async () => {
|
|
165
|
+
d(n ? "" : a.enteraprompt ?? "Please enter a prompt"), await s();
|
|
166
|
+
}}>${l === "prompt" ? a.ask ?? "Generate" : a.refine ?? "Refine"}</calcite-button></div></div></div></calcite-text-area></div>`;
|
|
165
167
|
}
|
|
166
168
|
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
169
|
function he({ setOpen: i, messages: e, feedback: t, setFeedback: o, onSubmit: c }) {
|
|
@@ -169,8 +171,8 @@ function he({ setOpen: i, messages: e, feedback: t, setFeedback: o, onSubmit: c
|
|
|
169
171
|
o({ ...t, termsAccepted: n.target.checked });
|
|
170
172
|
}} .disabled=${t.submitting}></calcite-checkbox><span>${$((e.agreement ?? "I agree to the {EsriPrivacyStatement} (and {Supplement}).").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=${c} .disabled=${!t.termsAccepted || t.submitting} .loading=${t.submitting}>${e.submitfeedback ?? "Submit Feedback"}</calcite-button></calcite-panel></calcite-sheet>` : null;
|
|
171
173
|
}
|
|
172
|
-
function
|
|
173
|
-
return r`<calcite-block .label=${e.assistantinformation ?? "Assistant information"} slot=${t ??
|
|
174
|
+
function E({ assistantsEnabled: i, messages: e, slot: t, assistantHelpUrl: o, helpTopicUrl: c }) {
|
|
175
|
+
return r`<calcite-block .label=${e.assistantinformation ?? "Assistant information"} slot=${t ?? M} expanded class="info-block"><calcite-chip .label=${e.new ?? "New"} kind=brand>${e.new ?? "New"}</calcite-chip><h1 class="info-heading">${e.introducing ?? "Introducing Arcade Assistant (beta)"}</h1><p>${e.capabilities ?? "The assistant uses artificial intelligence to generate Arcade expressions."}</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>${$((e.seedocumentation ?? "Please see the {documentation} for more information, including limitations and additional resources.").replace("{documentation}", `<calcite-link href=${c} target="_blank">${e.documentation ?? "documentation"}</calcite-link>`))}</p>` : r`<p>${$(e.useofassistant?.replace("{aiassistants}", `<strong>${e.aiassistants ?? "Ai Assistants"}</strong>`))}<calcite-link .href=${o} target=_blank icon-end=launch-2>${e.configureassistants ?? "Configure Assistants"}</calcite-link></p>`}</calcite-block>`;
|
|
174
176
|
}
|
|
175
177
|
function me({ messages: i, onProceed: e, onExit: t, helpTopicUrl: o }) {
|
|
176
178
|
return r`<calcite-dialog close-disabled placement=top .heading=${i.welcome ?? "Welcome to the new assistant experience"} slot=dialogs open width-scale=m id=welcome-dialog><h3 class="unstyled-h3">${i.beforeyougetstarted ?? "Before you get started be aware:"}</h3><ul><li>${i.maybeincorrect ?? "AI generated code may occasionally be incorrect or biased. Review carefully."}</li><li>${$((i.pleasereadhelp ?? "Read the Arcade Assistant (beta) {helpTopic} to get started and learn details on security, privacy and limitations.").replace("{helpTopic}", `<calcite-link href=${o} target="_blank">${i.helptopic ?? "help topic"}</calcite-link>`))}</li></ul><calcite-button id=welcome-proceed slot=footer-end @click=${e}>${i.proceed ?? "Proceed"}</calcite-button><calcite-button id=welcome-decline slot=footer-start @click=${t} kind=neutral>${i.exit ?? "Exit"}</calcite-button></calcite-dialog>`;
|
|
@@ -178,21 +180,20 @@ function me({ messages: i, onProceed: e, onExit: t, helpTopicUrl: o }) {
|
|
|
178
180
|
function fe({ messages: i, suggestions: e, onSuggestionClick: t }) {
|
|
179
181
|
return r`<calcite-block .heading=${i.promptsuggestions} expanded collapsible id=suggestion-block><calcite-chip-group class="suggestions" .label=${i.promptsuggestions ?? "Prompt Suggestions"}>${U(e, (o) => o, (o) => r`<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
182
|
}
|
|
181
|
-
const
|
|
182
|
-
function
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
const u = l.currentTarget;
|
|
183
|
+
const R = 200;
|
|
184
|
+
function N({ hidden: i = !1, expanded: e = !1, messages: t, cards: o, heading: c, collapsible: n = !1, showEffectsIcon: u = !1, onCopyCode: d, standalone: s }) {
|
|
185
|
+
return r`<calcite-block .hidden=${i} id=result-block .heading=${c ?? t.besteffort ?? "Here is the assistant's best effort"} .expanded=${e} .collapsible=${n}>${u && r`<calcite-chip .label=${t.assistantresponses ?? "Assistant responses"} slot=content-start icon=effects scale=m class="suggestion-chips"></calcite-chip>` || ""}<calcite-card-group .label=${t.assistantresponses ?? "Assistant responses"}>${U(o, (a) => a.conversationId, (a) => r`<calcite-card><div slot=heading><div class="prior-prompt"><span>${a.priorPrompt.length > R ? `${a.priorPrompt.slice(0, R)}...` : 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) => {
|
|
186
|
+
const p = l.currentTarget;
|
|
186
187
|
navigator.clipboard.writeText(a.priorPrompt).then(() => {
|
|
187
|
-
|
|
188
|
+
p.setAttribute("data-copied", "true"), setTimeout(() => p.removeAttribute("data-copied"), 1500);
|
|
188
189
|
});
|
|
189
190
|
}}></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 ?? "Copy prompt to clipboard"}</calcite-tooltip></div>${a.message && s && r`<div class="response-error-container">${F({ 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 && r`<calcite-tooltip .referenceElement=${`response-chip-${a.conversationId}-error`} placement=top-start>${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) => {
|
|
190
|
-
const
|
|
191
|
-
return r`${l.tooltip && r`<calcite-tooltip .referenceElement=${`response-chip-${l.conversationId}-${
|
|
192
|
-
})}</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
|
|
193
|
-
const
|
|
191
|
+
const p = K();
|
|
192
|
+
return r`${l.tooltip && r`<calcite-tooltip .referenceElement=${`response-chip-${l.conversationId}-${p}`} placement=top-start class="contained-popover-or-tooltip">${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>`;
|
|
193
|
+
})}</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 class="add-to-editor-button hidden-above-380" @click=${() => a.onAddToEditor("add")} scale=s icon-start=plus round .label=${t.addtoeditor ?? "Add to editor"} .id=${`add-to-editor-button-${a.conversationId}-${s ? "standalone" : "list"}`}></calcite-button><calcite-tooltip class="hidden-above-380" .referenceElement=${`add-to-editor-button-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start>${t.addtoeditor ?? "Add to editor"}</calcite-tooltip><calcite-button class="add-to-editor-button hidden-below-380" @click=${() => a.onAddToEditor("add")} 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) => {
|
|
194
|
+
const p = l.currentTarget;
|
|
194
195
|
d(a.code).then(() => {
|
|
195
|
-
|
|
196
|
+
p.setAttribute("data-copied", "true"), setTimeout(() => p.removeAttribute("data-copied"), 1500);
|
|
196
197
|
});
|
|
197
198
|
}} 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 ?? "Copy code to clipboard"}</calcite-tooltip></div><div slot=footer-end class="feedback-actions"><calcite-action .text=${t.thumbsup ?? "Thumbs up"} 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 ?? "Thumbs down"} 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>`;
|
|
198
199
|
}
|
|
@@ -207,8 +208,8 @@ const be = "arcade_generation", ge = "ArcadeCodeRequest", x = "visualization", v
|
|
|
207
208
|
"context",
|
|
208
209
|
"extras"
|
|
209
210
|
];
|
|
210
|
-
let
|
|
211
|
-
class $e extends
|
|
211
|
+
let P = [], q = !0;
|
|
212
|
+
class $e extends V {
|
|
212
213
|
constructor() {
|
|
213
214
|
super(...arguments), this.textAreaRef = B(), this.messages = W(), this._feedbackService = void 0, this.handleFeedbackButton = (e, t) => {
|
|
214
215
|
this.feedback = { active: !0, value: e, item: t, termsAccepted: !1, text: "", submitting: !1 };
|
|
@@ -248,8 +249,8 @@ class $e extends L {
|
|
|
248
249
|
};
|
|
249
250
|
try {
|
|
250
251
|
await e.applyEdits({ addFeatures: [new Z({ attributes: n })] });
|
|
251
|
-
} catch (
|
|
252
|
-
console.error("Error submitting feedback:",
|
|
252
|
+
} catch (u) {
|
|
253
|
+
console.error("Error submitting feedback:", u);
|
|
253
254
|
}
|
|
254
255
|
this.handleFeedbackSheetClose();
|
|
255
256
|
}, this.handleClose = (e) => {
|
|
@@ -295,7 +296,7 @@ class $e extends L {
|
|
|
295
296
|
};
|
|
296
297
|
e().catch((t) => {
|
|
297
298
|
console.error("Error setting initial context in Arcade Assistant:", t);
|
|
298
|
-
}), this.manager.onLifecycle(() => ({ remove:
|
|
299
|
+
}), this.manager.onLifecycle(() => ({ remove: S.onModelContextDidChange(async () => {
|
|
299
300
|
e().catch((o) => {
|
|
300
301
|
console.error("Error setting context in Arcade Assistant:", o);
|
|
301
302
|
});
|
|
@@ -305,10 +306,10 @@ class $e extends L {
|
|
|
305
306
|
(e.has("history") || e.has("messages")) && (this.historyCards = this.getHistoryCards());
|
|
306
307
|
}
|
|
307
308
|
connectedCallback() {
|
|
308
|
-
super.connectedCallback(), this.history =
|
|
309
|
+
super.connectedCallback(), this.history = P, this.splashActive = q;
|
|
309
310
|
}
|
|
310
311
|
disconnectedCallback() {
|
|
311
|
-
super.disconnectedCallback(),
|
|
312
|
+
super.disconnectedCallback(), P = this.history, q = this.splashActive, this.copySuccessTimer && (clearTimeout(this.copySuccessTimer), this.copySuccessTimer = void 0);
|
|
312
313
|
}
|
|
313
314
|
getHistoryCards() {
|
|
314
315
|
return this.history.reduce((e, t) => (!t.script || (e.push({
|
|
@@ -335,7 +336,7 @@ class $e extends L {
|
|
|
335
336
|
] : []
|
|
336
337
|
],
|
|
337
338
|
onAddToEditor: (o) => {
|
|
338
|
-
|
|
339
|
+
Q(this.editorRef.editorInstance, t.formattedScript ?? "", o, this.disclaimerComment);
|
|
339
340
|
},
|
|
340
341
|
onThumbsUp: () => this.handleFeedbackButton("good", t),
|
|
341
342
|
onThumbsDown: () => this.handleFeedbackButton("bad", t),
|
|
@@ -411,17 +412,17 @@ class $e extends L {
|
|
|
411
412
|
}
|
|
412
413
|
async getProfileAndMetadata(e) {
|
|
413
414
|
let t = x;
|
|
414
|
-
const o =
|
|
415
|
+
const o = S.getEditorProfileForModel(e);
|
|
415
416
|
o?.loaded || await o?.loadSource();
|
|
416
417
|
const c = this.editorRef.profile;
|
|
417
418
|
c && "id" in c && (t = c.id);
|
|
418
419
|
const n = o?.definition?.variables?.find((s) => s.type === "feature");
|
|
419
|
-
let
|
|
420
|
-
return n?.definition && "fields" in n.definition && (
|
|
420
|
+
let u = [], d;
|
|
421
|
+
return n?.definition && "fields" in n.definition && (u = n.definition.fields.map((s) => ({
|
|
421
422
|
name: s.name,
|
|
422
423
|
type: s.type,
|
|
423
424
|
alias: s.alias
|
|
424
|
-
})), ee(n?.definition) && (d = n.definition.title)), { profileName: t, metadata:
|
|
425
|
+
})), ee(n?.definition) && (d = n.definition.title)), { profileName: t, metadata: u, layerName: d };
|
|
425
426
|
}
|
|
426
427
|
onCopyCode(e) {
|
|
427
428
|
const t = e ? `${this.disclaimerComment}
|
|
@@ -429,9 +430,9 @@ ${e}` : "";
|
|
|
429
430
|
return navigator.clipboard.writeText(t);
|
|
430
431
|
}
|
|
431
432
|
render() {
|
|
432
|
-
return this.closed ? null : this.assistantsEnabled ? r`<calcite-flow><calcite-flow-item closable heading-level=2 .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${this.splashActive && r`<calcite-scrim></calcite-scrim>` || ""}${ce({ messages: this.messages })}${re({ popoverContent:
|
|
433
|
+
return this.closed ? null : this.assistantsEnabled ? r`<calcite-flow><calcite-flow-item closable heading-level=2 .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${this.splashActive && r`<calcite-scrim></calcite-scrim>` || ""}${ce({ messages: this.messages })}${re({ popoverContent: E({ assistantsEnabled: this.assistantsEnabled, messages: this.messages, assistantHelpUrl: this.assistantHelpUrl, helpTopicUrl: this.usingTheAssitantDocUrl }) })}<calcite-shell class="unstyled-shell">${this.splashActive && me({ messages: this.messages, onProceed: () => {
|
|
433
434
|
this.splashActive = !1;
|
|
434
|
-
}, 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: this.messages, context: this.context })}<calcite-block-group label="interactive blocks">${!this.isViewingResult && !this.isSubmitting && fe({ messages: this.messages, suggestions: [this.messages.prompsuggestion1 ?? "", this.messages.prompsuggestion2 ?? ""], onSuggestionClick: this.onSuggestionClick }) || ""}<calcite-block .hidden=${!this.isSubmitting} .heading=${this.messages.generatingresponse ?? "Generating response..."}></calcite-block>${
|
|
435
|
+
}, 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: this.messages, context: this.context })}<calcite-block-group label="interactive blocks">${!this.isViewingResult && !this.isSubmitting && fe({ messages: this.messages, suggestions: [this.messages.prompsuggestion1 ?? "", this.messages.prompsuggestion2 ?? ""], onSuggestionClick: this.onSuggestionClick }) || ""}<calcite-block .hidden=${!this.isSubmitting} .heading=${this.messages.generatingresponse ?? "Generating response..."}></calcite-block>${N({
|
|
435
436
|
expanded: this.isViewingResult,
|
|
436
437
|
messages: this.messages,
|
|
437
438
|
collapsible: !0,
|
|
@@ -442,7 +443,7 @@ ${e}` : "";
|
|
|
442
443
|
hidden: this.isSubmitting || !this.isViewingResult,
|
|
443
444
|
onCopyCode: this.onCopyCode.bind(this),
|
|
444
445
|
standalone: !0
|
|
445
|
-
})}${
|
|
446
|
+
})}${N({
|
|
446
447
|
expanded: !this.isViewingResult,
|
|
447
448
|
messages: this.messages,
|
|
448
449
|
collapsible: !0,
|
|
@@ -456,10 +457,10 @@ ${e}` : "";
|
|
|
456
457
|
heading: this.messages.recentprompts ?? "Recent prompts",
|
|
457
458
|
hidden: this.isSubmitting || this.history.length === 0,
|
|
458
459
|
onCopyCode: this.onCopyCode.bind(this)
|
|
459
|
-
})}</calcite-block-group>${this.feedback.active ? he({ setOpen: this.handleFeedbackSheetClose, messages: this.messages, onSubmit: this.handleFeedbackSubmit, feedback: this.feedback, setFeedback: this.setFeedbackState.bind(this) }) : null}</calcite-shell></calcite-flow-item></calcite-flow>` : r`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable heading-level=2 .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${
|
|
460
|
+
})}</calcite-block-group>${this.feedback.active ? he({ setOpen: this.handleFeedbackSheetClose, messages: this.messages, onSubmit: this.handleFeedbackSubmit, feedback: this.feedback, setFeedback: this.setFeedbackState.bind(this) }) : null}</calcite-shell></calcite-flow-item></calcite-flow>` : r`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable heading-level=2 .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${E({ slot: "content-top", messages: this.messages, assistantsEnabled: this.assistantsEnabled, assistantHelpUrl: this.assistantHelpUrl, helpTopicUrl: this.usingTheAssitantDocUrl })}</calcite-flow-item></calcite-flow>`;
|
|
460
461
|
}
|
|
461
462
|
}
|
|
462
|
-
|
|
463
|
+
L("arcgis-arcade-coding-assistant", $e);
|
|
463
464
|
export {
|
|
464
465
|
$e as ArcgisArcadeCodingAssistant
|
|
465
466
|
};
|
|
@@ -5,6 +5,7 @@ import "@esri/calcite-components/components/calcite-input-message";
|
|
|
5
5
|
import "@esri/calcite-components/components/calcite-alert";
|
|
6
6
|
import "@esri/calcite-components/components/calcite-button";
|
|
7
7
|
import "@esri/calcite-components/components/calcite-text-area";
|
|
8
|
+
import "@esri/calcite-components/components/calcite-tooltip";
|
|
8
9
|
import "@esri/calcite-components/components/calcite-sheet";
|
|
9
10
|
import "@esri/calcite-components/components/calcite-panel";
|
|
10
11
|
import "@esri/calcite-components/components/calcite-label";
|
|
@@ -17,7 +18,6 @@ import "@esri/calcite-components/components/calcite-dialog";
|
|
|
17
18
|
import "@esri/calcite-components/components/calcite-chip-group";
|
|
18
19
|
import "@esri/calcite-components/components/calcite-card-group";
|
|
19
20
|
import "@esri/calcite-components/components/calcite-card";
|
|
20
|
-
import "@esri/calcite-components/components/calcite-tooltip";
|
|
21
21
|
import "@esri/calcite-components/components/calcite-flow";
|
|
22
22
|
import "@esri/calcite-components/components/calcite-flow-item";
|
|
23
23
|
import "@esri/calcite-components/components/calcite-scrim";
|
|
@@ -5,6 +5,7 @@ import "@esri/calcite-components/components/calcite-input-message";
|
|
|
5
5
|
import "@esri/calcite-components/components/calcite-alert";
|
|
6
6
|
import "@esri/calcite-components/components/calcite-button";
|
|
7
7
|
import "@esri/calcite-components/components/calcite-text-area";
|
|
8
|
+
import "@esri/calcite-components/components/calcite-tooltip";
|
|
8
9
|
import "@esri/calcite-components/components/calcite-sheet";
|
|
9
10
|
import "@esri/calcite-components/components/calcite-panel";
|
|
10
11
|
import "@esri/calcite-components/components/calcite-label";
|
|
@@ -17,7 +18,6 @@ import "@esri/calcite-components/components/calcite-dialog";
|
|
|
17
18
|
import "@esri/calcite-components/components/calcite-chip-group";
|
|
18
19
|
import "@esri/calcite-components/components/calcite-card-group";
|
|
19
20
|
import "@esri/calcite-components/components/calcite-card";
|
|
20
|
-
import "@esri/calcite-components/components/calcite-tooltip";
|
|
21
21
|
import "@esri/calcite-components/components/calcite-flow";
|
|
22
22
|
import "@esri/calcite-components/components/calcite-flow-item";
|
|
23
23
|
import "@esri/calcite-components/components/calcite-scrim";
|