@arcgis/coding-components 5.1.0-next.129 → 5.1.0-next.130

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/cdn/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{J as s,v as e}from"./REL6OK2I.js";import"./Y3KOWWO5.js";import"./3TTFCHAA.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./OYNUENPR.js"),"appVersion,closed,closePanel:,diagnostics:,disableQuestionAnswerLogging,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,promptingEnabled,serviceUrl;destroy,openPrompt"],"arcgis-arcade-debugger-console":[()=>import("./U6KAPM53.js"),"debuggerStore:,modelId"],"arcgis-arcade-debugger-output":[()=>import("./7NI24N24.js"),"debuggerStore:,result:"],"arcgis-arcade-editor":[()=>import("./6NF6A3IL.js"),"arcadeAssistant:,customPanels:,disableAssistant,editorInstance:,editorOptions:,enableDebugger,externalExecutor:,hideDocumentationActions,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,openArcadeAssistant,setFocus"],"arcgis-arcade-results":[()=>import("./B7UJ6L6F.js"),"consoleLogs:,hideHeader,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./XRARLSUB.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./66OHRRRE.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./CNNHY73S.js")],"arcgis-code-viewer":[()=>import("./Q4VU6BZR.js"),"language,lineNumbers,round"],"arcgis-editor-variables":[()=>import("./2CUPMUTK.js"),"closed,heading,hideDescriptions,loading,messageOverrides:,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./3YHAACIY.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./FHSCW2PZ.js"),"hideDescriptionsInFieldsPanel,hideSideBar,messageOverrides:,messages:,profile:,script;setFocus"],"arcgis-sql-layer-editor":[()=>import("./A4IJ4IXL.js"),"editorInstance:,editorOptions:,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script;setFocus"]});i({resourcesUrl:import.meta.url});var r=new CSSStyleSheet;r.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-code-editor-shell,arcgis-code-viewer,arcgis-sql-expression-editor,arcgis-sql-layer-editor){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,r];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,s)
2
+ import{J as s,v as e}from"./REL6OK2I.js";import"./Y3KOWWO5.js";import"./3TTFCHAA.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./OYNUENPR.js"),"appVersion,closed,closePanel:,diagnostics:,disableQuestionAnswerLogging,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,promptingEnabled,serviceUrl;destroy,openPrompt"],"arcgis-arcade-debugger-console":[()=>import("./TKFJEUYO.js"),"debuggerStore:,modelId"],"arcgis-arcade-debugger-output":[()=>import("./62CWTCDL.js"),"debuggerStore:,result:"],"arcgis-arcade-editor":[()=>import("./NKLH4FV4.js"),"arcadeAssistant:,customPanels:,disableAssistant,editorInstance:,editorOptions:,enableDebugger,externalExecutor:,hideDocumentationActions,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,openArcadeAssistant,setFocus"],"arcgis-arcade-results":[()=>import("./MORS3SBZ.js"),"consoleLogs:,hideHeader,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./XRARLSUB.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./66OHRRRE.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./MSZINSFE.js")],"arcgis-code-viewer":[()=>import("./Q4VU6BZR.js"),"language,lineNumbers,round"],"arcgis-editor-variables":[()=>import("./2CUPMUTK.js"),"closed,heading,hideDescriptions,loading,messageOverrides:,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./3YHAACIY.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./FHSCW2PZ.js"),"hideDescriptionsInFieldsPanel,hideSideBar,messageOverrides:,messages:,profile:,script;setFocus"],"arcgis-sql-layer-editor":[()=>import("./A4IJ4IXL.js"),"editorInstance:,editorOptions:,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script;setFocus"]});i({resourcesUrl:import.meta.url});var r=new CSSStyleSheet;r.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-code-editor-shell,arcgis-code-viewer,arcgis-sql-expression-editor,arcgis-sql-layer-editor){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,r];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,s)
@@ -12,7 +12,7 @@ function l(t) {
12
12
  }
13
13
  function u(t) {
14
14
  const e = t.split(".").filter(Boolean).at(-1) ?? t;
15
- return e.length > 9 ? `${e.slice(0, 12)}...` : e;
15
+ return e.length > 12 ? `${e.slice(0, 12)}...` : e;
16
16
  }
17
17
  let o = class extends p {
18
18
  constructor(t) {
@@ -164,7 +164,7 @@ function L({ lazyTreeState: e, nodePath: t, mergedCollectionItem: n, expanded: r
164
164
  }
165
165
  return l.length ? C(l) : C();
166
166
  }, j = () => u.kind !== "collection" ? null : !i.expanded || i.status === "loading" ? C() : C(c`${i.status === "error" ? w() : null}${i.status === "loaded" ? i.collectionItems.map((l) => L({ name: l.name || l.id, mergedCollectionItem: l, messages: a, nodePath: M(t, l.id), lazyTreeState: e, value: l.featureSet, loadPreview: s, previewLabel: k(o, l.name || l.id), previewSourcePath: q(m, X(l)), previewLoading: g })) : null}`), O = () => u.kind === "collection" ? j() : _();
167
- return c`<calcite-tree-item .expanded=${i.expanded} @calciteTreeItemExpand=${d} @calciteTreeItemCollapse=${y}><div class="tree-item-label">${T({ name: f, isMetadata: p })}<bdi>${u.displayValue}</bdi></div>${i.status === "loading" ? c`<calcite-loader slot=actions-end scale=s inline type=indeterminate .label=${a.loading ?? "Loading"} .text=${a.loading ?? "Loading"}></calcite-loader>` : null}${D ? c`<calcite-action slot=actions-end scale=s class="load-action" .text=${a.loadpreview ?? "Load preview"} text-enabled icon=play icon-flip-rtl .disabled=${g} @click=${V}></calcite-action>` : null}${O()}</calcite-tree-item>`;
167
+ return c`<calcite-tree-item .expanded=${i.expanded} @calciteTreeItemExpand=${d} @calciteTreeItemCollapse=${y}><div class="tree-item-label">${T({ name: f, isMetadata: p })}<bdi>${u.displayValue}</bdi></div>${i.status === "loading" ? c`<calcite-loader slot=actions-end scale=s inline type=indeterminate .label=${a.loading ?? "Loading"} .text=${a.loading ?? "Loading"}></calcite-loader>` : null}${D ? c`<calcite-action slot=actions-end scale=s class="load-action" .text=${a.loadpreview ?? "Load preview"} text-enabled icon=play .disabled=${g} @click=${V}></calcite-action>` : null}${O()}</calcite-tree-item>`;
168
168
  }
169
169
  function P(e) {
170
170
  if (e == null)
@@ -1,16 +1,16 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import { html as a, unsafeCSS as d, css as m } from "lit";
2
+ import { html as a, unsafeCSS as v, css as m } from "lit";
3
3
  import { nothing as y, safeClassMap as l } from "@arcgis/lumina";
4
4
  import { classes as i } from "@arcgis/toolkit/dom";
5
5
  import { uncapitalize as f, quoteString as c } from "@arcgis/toolkit/string";
6
- import { f as g, a as $, b } from "./arcade-executor.js";
6
+ import { f as g, a as b, b as $ } from "./arcade-executor.js";
7
7
  import { t as o } from "./monaco-theme.js";
8
8
  const s = {
9
9
  lines: !0,
10
10
  selectionMode: "none",
11
11
  scale: "s",
12
12
  oncalciteTreeSelect: (e) => e.currentTarget.selectedItems.forEach((t) => t.selected = !1)
13
- }, u = "tree-item-metadata", p = ({ name: e, isMetadata: t = !1 }) => a`<span class=${l(i("dictionary-property", t && u))}>${e}</span><span class=${l(i(t && u))}>:&nbsp;</span>`, z = ({ obj: e, subtree: t }) => a`<calcite-tree slot=${"children"} .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item class="string-value">${JSON.stringify(e, void 0, 2)}</calcite-tree-item></calcite-tree>`, N = ({ value: e, subtree: t = !1 }) => a`<calcite-tree slot=${(t ? "children" : void 0) ?? y} .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item><div class="tree-item-label">${p({ name: "type" })}${f(e.type)}</div></calcite-tree-item><calcite-tree-item><div class="tree-item-label">${p({ name: "value" })}<span class="string-value">${JSON.stringify(e, void 0, 2)}</span></div></calcite-tree-item></calcite-tree>`, C = ({ type: e, value: t }) => {
13
+ }, u = "tree-item-metadata", p = ({ name: e, isMetadata: t = !1 }) => a`<bdi class=${l(i("dictionary-property", t && u))}>${e}</bdi><bdi class=${l(i(t && u))}>:&nbsp;</bdi>`, z = ({ obj: e, subtree: t }) => a`<calcite-tree slot=${"children"} .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item class="string-value">${JSON.stringify(e, void 0, 2)}</calcite-tree-item></calcite-tree>`, N = ({ value: e, subtree: t = !1 }) => a`<calcite-tree slot=${(t ? "children" : void 0) ?? y} .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item><div class="tree-item-label">${p({ name: "type" })}<bdi>${f(e.type)}</bdi></div></calcite-tree-item><calcite-tree-item><div class="tree-item-label">${p({ name: "value" })}<span class="string-value">${JSON.stringify(e, void 0, 2)}</span></div></calcite-tree-item></calcite-tree>`, C = ({ type: e, value: t }) => {
14
14
  switch (e) {
15
15
  case "unknown":
16
16
  case "Unknown":
@@ -75,9 +75,9 @@ function V(e) {
75
75
  case "text":
76
76
  return { type: e.type, value: e.value };
77
77
  case "date":
78
- return { type: e.type, value: b(e) };
79
- case "dateOnly":
80
78
  return { type: e.type, value: $(e) };
79
+ case "dateOnly":
80
+ return { type: e.type, value: b(e) };
81
81
  case "time":
82
82
  return { type: e.type, value: g(e) };
83
83
  }
@@ -94,14 +94,14 @@ function A() {
94
94
  `, e += `:host(:state(${S})),
95
95
  `, e += `:host([calcite-mode-dark]) {
96
96
  `;
97
- const v = o["dark-theme"];
98
- return Object.entries(v).forEach(([n, r]) => {
97
+ const d = o["dark-theme"];
98
+ return Object.entries(d).forEach(([n, r]) => {
99
99
  e += `
100
100
  --arcgis-editor-${n}: ${r};`;
101
101
  }), e += `
102
102
  }
103
103
  `, m`
104
- ${d(e)}
104
+ ${v(e)}
105
105
  `;
106
106
  }
107
107
  const E = m`
@@ -1,38 +1,38 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import { html as r } from "lit";
2
+ import { html as a } from "lit";
3
3
  import "@arcgis/lumina";
4
- import { B as b, v as $, M as d } from "./arcade-executor.js";
4
+ import { B as y, v as p, M as $ } from "./arcade-executor.js";
5
5
  import { uncapitalize as m, setValuesInString as v } from "@arcgis/toolkit/string";
6
6
  import { s as g } from "./fields.js";
7
7
  import "@arcgis/toolkit/function";
8
8
  import { i as S, a as f, S as h, D as o, b as k, G as x } from "./debugger-value-styles.js";
9
- const n = {
9
+ const i = {
10
10
  lines: !0,
11
11
  selectionMode: "none",
12
12
  scale: "s",
13
13
  oncalciteTreeSelect: (e) => e.currentTarget.selectedItems.forEach((t) => t.selected = !1)
14
- }, u = {
14
+ }, d = {
15
15
  onClick: (e) => {
16
16
  const t = e.currentTarget;
17
17
  t.expanded = !t.expanded;
18
18
  }
19
19
  }, A = ({ arcadeResult: e, t9nStrings: t }) => {
20
- const a = e.value ?? [], s = Math.max(a.length - d, 0);
21
- return r`<span>${`${m(e.type)}(${a.length ?? 0})`}</span>${s > 0 ? r`<span>&nbsp;${v(t.showingfirstitemsformat, {
22
- count: d.toString()
20
+ const r = e.value ?? [], c = Math.max(r.length - $, 0);
21
+ return a`<bdi>${`${m(e.type)}(${r.length ?? 0})`}</bdi>${c > 0 ? a`<span>&nbsp;${v(t.showingfirstitemsformat, {
22
+ count: $.toString()
23
23
  })}</span>` : null}`;
24
- }, C = ({ value: e, subtree: t, t9nStrings: a }) => {
25
- const s = e.geometry?.();
26
- return r`<calcite-tree slot=${"children"} .lines=${n.lines} .selectionMode=${n.selectionMode} .scale=${n.scale} @calciteTreeSelect=${n.oncalciteTreeSelect}>${e.keys().map((c) => {
27
- const l = $(e.field(c));
28
- return e.arcadeDeclaredClass === "esri.arcade.Feature" && l.type === "geometry" ? null : p({ arcadeResult: l, name: c, t9nStrings: a });
29
- })}${s ? p({ arcadeResult: { type: "geometry", value: s }, name: "geometry", t9nStrings: a }) : null}</calcite-tree>`;
30
- }, B = ({ arcadeResult: e, t9nStrings: t }) => r`<div class="value-type"><span>${m(e.type)}:</span>${e.features.length >= b ? r`<span>&nbsp;${v(t.showingfirstitemsformat, {
31
- count: b.toString()
32
- })}</span>` : null}</div>`, D = ({ items: e, subtree: t, arrayLength: a = e.length, t9nStrings: s }) => r`<calcite-tree slot=${"children"} .lines=${n.lines} .selectionMode=${n.selectionMode} .scale=${n.scale} @calciteTreeSelect=${n.oncalciteTreeSelect}>${e.map((c, l) => {
33
- const i = $(c);
34
- return p({ arcadeResult: i, name: l, expanded: !t, t9nStrings: s });
35
- })}${p({ arcadeResult: { type: "number", value: a }, name: "length", isMetadata: !0, t9nStrings: s })}</calcite-tree>`, p = ({ arcadeResult: e, name: t, isMetadata: a = !1, expanded: s, t9nStrings: c }) => {
24
+ }, C = ({ value: e, subtree: t, t9nStrings: r }) => {
25
+ const c = e.geometry?.();
26
+ return a`<calcite-tree slot=${"children"} .lines=${i.lines} .selectionMode=${i.selectionMode} .scale=${i.scale} @calciteTreeSelect=${i.oncalciteTreeSelect}>${e.keys().map((l) => {
27
+ const s = p(e.field(l));
28
+ return e.arcadeDeclaredClass === "esri.arcade.Feature" && s.type === "geometry" ? null : u({ arcadeResult: s, name: l, t9nStrings: r });
29
+ })}${c ? u({ arcadeResult: { type: "geometry", value: c }, name: "geometry", t9nStrings: r }) : null}</calcite-tree>`;
30
+ }, B = ({ arcadeResult: e, t9nStrings: t }) => a`<div class="value-type"><bdi>${m(e.type)}:</bdi>${e.features.length >= y ? a`<span>&nbsp;${v(t.showingfirstitemsformat, {
31
+ count: y.toString()
32
+ })}</span>` : null}</div>`, D = ({ items: e, subtree: t, arrayLength: r = e.length, t9nStrings: c }) => a`<calcite-tree slot=${"children"} .lines=${i.lines} .selectionMode=${i.selectionMode} .scale=${i.scale} @calciteTreeSelect=${i.oncalciteTreeSelect}>${e.map((l, s) => {
33
+ const n = p(l);
34
+ return u({ arcadeResult: n, name: s, expanded: !t, t9nStrings: c });
35
+ })}${u({ arcadeResult: { type: "number", value: r }, name: "length", isMetadata: !0, t9nStrings: c })}</calcite-tree>`, u = ({ arcadeResult: e, name: t, isMetadata: r = !1, expanded: c, t9nStrings: l }) => {
36
36
  switch (e.type) {
37
37
  case "null":
38
38
  case "unknown":
@@ -42,34 +42,34 @@ const n = {
42
42
  case "dateOnly":
43
43
  case "time":
44
44
  case "boolean":
45
- const { type: l, value: i } = f(e);
46
- return r`<calcite-tree-item><div class="tree-item-label">${o({ name: t, isMetadata: a })}${h({ type: l, value: i })}</div></calcite-tree-item>`;
45
+ const { type: s, value: n } = f(e);
46
+ return a`<calcite-tree-item><div class="tree-item-label">${o({ name: t, isMetadata: r })}${h({ type: s, value: n })}</div></calcite-tree-item>`;
47
47
  case "array": {
48
- const y = e.value ?? [], T = y.slice(0, d);
49
- return r`<calcite-tree-item .expanded=${s} @click=${u.onClick}><div class="tree-item-label">${o({ name: t, isMetadata: a })}${A({ arcadeResult: e, t9nStrings: c })}</div>${D({ items: T, arrayLength: y.length, subtree: !0, t9nStrings: c })}</calcite-tree-item>`;
48
+ const b = e.value ?? [], T = b.slice(0, $);
49
+ return a`<calcite-tree-item .expanded=${c} @click=${d.onClick}><div class="tree-item-label">${o({ name: t, isMetadata: r })}${A({ arcadeResult: e, t9nStrings: l })}</div>${D({ items: T, arrayLength: b.length, subtree: !0, t9nStrings: l })}</calcite-tree-item>`;
50
50
  }
51
51
  case "geometry":
52
- return r`<calcite-tree-item .expanded=${s} @click=${u.onClick}><div class="tree-item-label">${o({ name: t, isMetadata: a })}<span>${m(e.type)}</span></div>${x({ value: e.value, subtree: !0 })}</calcite-tree-item>`;
52
+ return a`<calcite-tree-item .expanded=${c} @click=${d.onClick}><div class="tree-item-label">${o({ name: t, isMetadata: r })}<bdi>${m(e.type)}</bdi></div>${x({ value: e.value, subtree: !0 })}</calcite-tree-item>`;
53
53
  case "attachment":
54
- return r`<calcite-tree-item .expanded=${s} @click=${u.onClick}><div class="tree-item-label">${o({ name: t, isMetadata: a })}<span>${m(e.type)}</span></div>${k({ obj: e.value.castAsJson(), subtree: !0 })}</calcite-tree-item>`;
54
+ return a`<calcite-tree-item .expanded=${c} @click=${d.onClick}><div class="tree-item-label">${o({ name: t, isMetadata: r })}<bdi>${m(e.type)}</bdi></div>${k({ obj: e.value.castAsJson(), subtree: !0 })}</calcite-tree-item>`;
55
55
  case "feature":
56
56
  case "dictionary":
57
57
  case "portal":
58
- return r`<calcite-tree-item .expanded=${s} @click=${u.onClick}><div class="tree-item-label">${o({ name: t, isMetadata: a })}<span>${m(e.type)}</span></div>${C({ value: e.value, subtree: !0, t9nStrings: c })}</calcite-tree-item>`;
58
+ return a`<calcite-tree-item .expanded=${c} @click=${d.onClick}><div class="tree-item-label">${o({ name: t, isMetadata: r })}<bdi>${m(e.type)}</bdi></div>${C({ value: e.value, subtree: !0, t9nStrings: l })}</calcite-tree-item>`;
59
59
  default:
60
60
  return null;
61
61
  }
62
62
  }, G = ({ arcadeResult: e }) => {
63
63
  const t = g(e.value.fields);
64
- return r`<div class="table-scroll"><table><thead><tr>${t.map((a) => r`<th>${a.name}</th>`)}</tr></thead><tbody>${e.features.map((a) => r`<tr>${t.map((s) => {
65
- const c = $(a.field(s.name));
66
- if (!S(c))
67
- return r`<td></td>`;
64
+ return a`<div class="table-scroll"><table><thead><tr>${t.map((r) => a`<th>${r.name}</th>`)}</tr></thead><tbody>${e.features.map((r) => a`<tr>${t.map((c) => {
65
+ const l = p(r.field(c.name));
66
+ if (!S(l))
67
+ return a`<td></td>`;
68
68
  try {
69
- const { type: l, value: i } = f(c);
70
- return r`<td>${h({ type: l, value: i })}</td>`;
69
+ const { type: s, value: n } = f(l);
70
+ return a`<td>${h({ type: s, value: n })}</td>`;
71
71
  } catch {
72
- return r`<td></td>`;
72
+ return a`<td></td>`;
73
73
  }
74
74
  })}</tr>`)}</tbody></table></div>`;
75
75
  };
@@ -79,5 +79,5 @@ export {
79
79
  B as F,
80
80
  G as a,
81
81
  D as b,
82
- n as t
82
+ i as t
83
83
  };
@@ -207,7 +207,7 @@ class N extends f {
207
207
  return r`<calcite-tabs><calcite-tab-nav slot=title-group><calcite-tab-title .tab=${p} .selected=${e === p} @calciteTabsActivate=${(t) => this.activateTab(t.target.tab)}>${this.messages.scope ?? "Scope"}</calcite-tab-title>${g(this.previewTabsState.tabs, (t) => `title-${t.id}`, (t) => r`<calcite-tab-title .tab=${t.id} title=${t.label ?? b} closable .selected=${e === t.id} @calciteTabsActivate=${(a) => this.activateTab(a.target.tab)} @calciteTabsClose=${(a) => this.closePreviewTab(a.target)}><bdi>${t.title}</bdi></calcite-tab-title>`)}</calcite-tab-nav><calcite-tab .tab=${p} .selected=${e === p}><div class="tab-panel">${this.renderScopePanel()}</div></calcite-tab>${g(this.previewTabsState.tabs, (t) => `panel-${t.id}`, (t) => r`<calcite-tab .tab=${t.id} .selected=${e === t.id}><div class="tab-panel preview-panel">${this.renderPreviewPanel(t)}</div></calcite-tab>`)}</calcite-tabs>`;
208
208
  }
209
209
  render() {
210
- const { line: e } = this.debuggerStore?.executionState ?? {}, t = this.breakpoints.find((i) => i.line === e), a = this.breakpoints.findIndex((i) => i.line === e);
210
+ const { line: e } = this.debuggerStore?.executionState ?? {}, t = e ? this.breakpoints.find((i) => i.line === e) : this.breakpoints[0], a = e ? this.breakpoints.findIndex((i) => i.line === e) : 0;
211
211
  return r`<div class="console-shell">${this.breakpoints.length && r`<div class="breakpoint-header"><arcgis-code-viewer language=arcade class="breakpoint-code-viewer" .lineNumbers=${(i) => String(i + (t?.line ?? e ?? 1) - 1)}>${this.getBreakpointCode(t?.line ?? this.breakpoints[0]?.line ?? e ?? 1)}</arcgis-code-viewer>${this.breakpoints.length ? r`<calcite-action id=${this._breakpointPopoverId ?? b} scale=s .text=${this.getBreakpointPositionText(a >= 0 ? a + 1 : 1)} text-enabled icon=chevron-down></calcite-action>` : null}${this.renderBreakpointPopover(t?.line ?? e)}</div>` || ""}<div class="tabs-container">${this.renderTabs()}</div></div>`;
212
212
  }
213
213
  }
@@ -6,7 +6,7 @@ import { u as o } from "../../chunks/useT9n.js";
6
6
  import { d as c, g as n, c as a, t } from "../../chunks/debugger-value-styles.js";
7
7
  import { observeAncestorsMutation as u, unsafeGetCalciteModeName as d } from "@arcgis/toolkit/dom";
8
8
  import { D as m } from "../../chunks/debugger-value-components.js";
9
- const p = l`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);--calcite-block-padding: var(--calcite-spacing-sm);overflow:auto;calcite-flow{height:100%}.disabled-state-text{font-size:var(--calcite-font-size-sm);color:var(--calcite-color-text-3);font-style:italic;display:block;margin:var(--calcite-spacing-md)}.ltr-container{direction:ltr}[class*=result-value-]{line-height:1.25rem}}`;
9
+ const p = l`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);--calcite-block-padding: var(--calcite-spacing-sm);overflow:auto;calcite-flow{height:100%}.disabled-state-text{font-size:var(--calcite-font-size-sm);color:var(--calcite-color-text-3);font-style:italic;display:block;margin:var(--calcite-spacing-md)}[class*=result-value-]{line-height:1.25rem}}`;
10
10
  class h extends i {
11
11
  constructor() {
12
12
  super(...arguments), this.messages = o();
@@ -599,7 +599,7 @@ class we extends ie {
599
599
  }
600
600
  }
601
601
  _onEditorMouseDown(e) {
602
- if (!this.enableDebugger || ![this._monacoEditor.MouseTargetType.GUTTER_GLYPH_MARGIN].includes(e.target.type))
602
+ if (!this.enableDebugger || ![this._monacoEditor.MouseTargetType.GUTTER_GLYPH_MARGIN].includes(e.target.type) || e.target.element?.classList.contains("codicon-gutter-lightbulb"))
603
603
  return;
604
604
  const s = e.target.position?.lineNumber;
605
605
  s && this._debuggerState.toggleBreakpoint(s);
@@ -1,23 +1,23 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import { c as h } from "../../chunks/runtime.js";
2
+ import { c as p } from "../../chunks/runtime.js";
3
3
  import { css as g, html as e } from "lit";
4
- import { LitElement as f, createEvent as d, safeClassMap as r } from "@arcgis/lumina";
4
+ import { LitElement as f, createEvent as u, safeClassMap as r } from "@arcgis/lumina";
5
5
  import { setValuesInString as i, uncapitalize as a } from "@arcgis/toolkit/string";
6
6
  import { M as v } from "../../chunks/arcade-executor.js";
7
7
  import { u as b } from "../../chunks/useT9n.js";
8
8
  import { F as $, a as x, t as s, D as y, A as R, b as P } from "../../chunks/functional.js";
9
- import { d as w, g as k, c as m, b as S, G as T, a as C, S as p } from "../../chunks/debugger-value-styles.js";
9
+ import { d as w, g as k, c as m, b as S, G as T, a as C, S as h } from "../../chunks/debugger-value-styles.js";
10
10
  import { createRef as o, ref as n } from "lit/directives/ref.js";
11
11
  import { observeAncestorsMutation as M, unsafeGetCalciteModeName as I } from "@arcgis/toolkit/dom";
12
- const L = g`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden;min-height:0}.y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-color-foreground-1)}header{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}.ltr-container{direction:ltr}calcite-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm);calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.color-info{color:var(--calcite-color-status-info)}.color-error{color:var(--calcite-color-status-danger)}.color-success{color:var(--calcite-color-status-success)}[class*=result-value-]{font-size:var(--calcite-font-size--2);line-height:1.25rem;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-md)}.console-logs-container{background-color:var(--calcite-color-foreground-1);padding:0 var(--calcite-spacing-md);font-family:var(--calcite-code-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal)}.result-value-table{display:flex;flex-direction:column;min-height:0;.table-scroll{overflow:auto;flex:1 1 auto;min-height:0;max-width:100%;background-color:var(--calcite-color-foreground-1)}table{min-width:max-content;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap;thead{background-color:var(--calcite-color-foreground-2)}tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}th,td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-xxs);.string-value{white-space:pre}}th{font-weight:var(--calcite-font-weight-medium)}}}}`, c = {
13
- onClick: (u) => {
14
- const t = u.currentTarget;
12
+ const L = g`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden;min-height:0}.y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-color-foreground-1)}header{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}calcite-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm);calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.color-info{color:var(--calcite-color-status-info)}.color-error{color:var(--calcite-color-status-danger)}.color-success{color:var(--calcite-color-status-success)}[class*=result-value-]{font-size:var(--calcite-font-size--2);line-height:1.25rem;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-md)}.console-logs-container{background-color:var(--calcite-color-foreground-1);padding:0 var(--calcite-spacing-md);font-family:var(--calcite-code-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal)}.result-value-table{display:flex;flex-direction:column;min-height:0;.table-scroll{overflow:auto;flex:1 1 auto;min-height:0;max-width:100%;background-color:var(--calcite-color-foreground-1)}table{min-width:max-content;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap;thead{background-color:var(--calcite-color-foreground-2)}tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}th,td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-xxs);.string-value{white-space:pre}}th{font-weight:var(--calcite-font-weight-medium)}}}}`, c = {
13
+ onClick: (d) => {
14
+ const t = d.currentTarget;
15
15
  t.expanded = !t.expanded;
16
16
  }
17
17
  };
18
18
  class F extends f {
19
19
  constructor() {
20
- super(...arguments), this.messages = b(), this.outputRef = o(), this.consoleRef = o(), this.logRef = o(), this.openedResultPanel = "output", this.hideHeader = !1, this.arcgisInternalClosePanel = d({ bubbles: !1, composed: !1 }), this.arcgisInternalOpenedResultPanelChange = d({ bubbles: !1, composed: !1 });
20
+ super(...arguments), this.messages = b(), this.outputRef = o(), this.consoleRef = o(), this.logRef = o(), this.openedResultPanel = "output", this.hideHeader = !1, this.arcgisInternalClosePanel = u({ bubbles: !1, composed: !1 }), this.arcgisInternalOpenedResultPanelChange = u({ bubbles: !1, composed: !1 });
21
21
  }
22
22
  static {
23
23
  this.properties = { consoleLogs: 0, loading: 5, openedResultPanel: 3, result: 0, hideHeader: 5 };
@@ -48,7 +48,7 @@ class F extends f {
48
48
  I(this.el) === "dark" ? this.elementInternals.states.add(m) : this.elementInternals.states.delete(m);
49
49
  }
50
50
  renderConsolePanel() {
51
- return this.openedResultPanel !== "console" ? null : this.loading && !this.consoleLogs?.length ? e`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading ?? "loading"}></calcite-loader>` : e`<div class="console-logs-container ltr-container">${this.consoleLogs?.length ? this.consoleLogs.map((t) => e`<p>${t}</p>`) : e`<p>${this.messages.consolemessage}</p>`}</div>`;
51
+ return this.openedResultPanel !== "console" ? null : this.loading && !this.consoleLogs?.length ? e`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading ?? "loading"}></calcite-loader>` : e`<div class="console-logs-container">${this.consoleLogs?.length ? this.consoleLogs.map((t) => e`<p>${t}</p>`) : e`<p>${this.messages.consolemessage}</p>`}</div>`;
52
52
  }
53
53
  renderLogPanel() {
54
54
  if (this.openedResultPanel !== "log")
@@ -85,7 +85,7 @@ class F extends f {
85
85
  return e`<div class="result-value-simple flex-adjustable">${i(this.messages.executionerrorformat ?? "", { message: this.result.value })}</div>`;
86
86
  case "null":
87
87
  case "unknown":
88
- return e`<div class="result-value-simple ltr-container">${p({ type: this.result.type, value: a(this.result.type) })}</div>`;
88
+ return e`<div class="result-value-simple">${h({ type: this.result.type, value: a(this.result.type) })}</div>`;
89
89
  case "text":
90
90
  case "number":
91
91
  case "date":
@@ -93,33 +93,33 @@ class F extends f {
93
93
  case "time":
94
94
  case "boolean": {
95
95
  const { type: t, value: l } = C(this.result);
96
- return e`<div class="result-value-simple ltr-container"><span class="value-type">${a(this.result.type)}:&nbsp;</span>${p({ type: t, value: l })}</div>`;
96
+ return e`<div class="result-value-simple"><bdi class="value-type">${a(this.result.type)}:&nbsp;</bdi>${h({ type: t, value: l })}</div>`;
97
97
  }
98
98
  case "array": {
99
99
  const l = (this.result.value ?? []).slice(0, v);
100
- return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item expanded @click=${c.onClick}><div class="tree-item-label">${R({ arcadeResult: this.result, t9nStrings: this.messages })}</div>${P({ items: l, subtree: !0, t9nStrings: this.messages })}</calcite-tree-item></calcite-tree></div>`;
100
+ return e`<div class="result-value-simple"><calcite-tree .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item expanded @click=${c.onClick}><div class="tree-item-label">${R({ arcadeResult: this.result, t9nStrings: this.messages })}</div>${P({ items: l, subtree: !0, t9nStrings: this.messages })}</calcite-tree-item></calcite-tree></div>`;
101
101
  }
102
102
  case "geometry":
103
- return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item expanded @click=${c.onClick}><div class="tree-item-label">${a(this.result.type)}</div>${T({ value: this.result.value, subtree: !0 })}</calcite-tree-item></calcite-tree></div>`;
103
+ return e`<div class="result-value-simple"><calcite-tree .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item expanded @click=${c.onClick}><div class="tree-item-label"><bdi>${a(this.result.type)}</bdi></div>${T({ value: this.result.value, subtree: !0 })}</calcite-tree-item></calcite-tree></div>`;
104
104
  case "attachment":
105
- return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item expanded @click=${c.onClick}><div class="tree-item-label">${a(this.result.type)}</div>${S({ obj: this.result.value.castAsJson(), subtree: !0 })}</calcite-tree-item></calcite-tree></div>`;
105
+ return e`<div class="result-value-simple"><calcite-tree .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item expanded @click=${c.onClick}><div class="tree-item-label"><bdi>${a(this.result.type)}</bdi></div>${S({ obj: this.result.value.castAsJson(), subtree: !0 })}</calcite-tree-item></calcite-tree></div>`;
106
106
  case "feature":
107
107
  case "dictionary":
108
108
  case "portal":
109
- return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item expanded @click=${c.onClick}><div class="tree-item-label">${a(this.result.type)}</div>${y({ value: this.result.value, subtree: !0, t9nStrings: this.messages })}</calcite-tree-item></calcite-tree></div>`;
109
+ return e`<div class="result-value-simple"><calcite-tree .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item expanded @click=${c.onClick}><div class="tree-item-label"><bdi>${a(this.result.type)}</bdi></div>${y({ value: this.result.value, subtree: !0, t9nStrings: this.messages })}</calcite-tree-item></calcite-tree></div>`;
110
110
  case "featureSet":
111
- return e`<div class="result-value-table ltr-container">${$({ arcadeResult: this.result, t9nStrings: this.messages })}${x({ arcadeResult: this.result })}</div>`;
111
+ return e`<div class="result-value-table">${$({ arcadeResult: this.result, t9nStrings: this.messages })}${x({ arcadeResult: this.result })}</div>`;
112
112
  case "knowledgeGraph":
113
- return e`<div class="result-value-simple ltr-container"><span class="value-type">${a(this.result.type)}:&nbsp;</span><span class="string-value">${this.result.value.url}</span></div>`;
113
+ return e`<div class="result-value-simple"><bdi class="value-type">${a(this.result.type)}:&nbsp;</bdi><bdi class="string-value">${this.result.value.url}</bdi></div>`;
114
114
  default:
115
- return e`<div class="result-value-simple flex-adjustable ltr-container">${this.messages.runscriptmessage}</div>`;
115
+ return e`<div class="result-value-simple flex-adjustable">${this.messages.runscriptmessage}</div>`;
116
116
  }
117
117
  }
118
118
  render() {
119
119
  return e`${this.hideHeader ? null : e`<header class="flex-row"><calcite-action-bar class="flex-adjustable" layout=horizontal scale=s expanded expand-disabled><calcite-action-group scale=s><calcite-action .active=${this.openedResultPanel === "output"} .text=${this.messages.output ?? ""} text-enabled scale=s icon=list-show-all icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=output ${n(this.outputRef)}></calcite-action><calcite-action .active=${this.openedResultPanel === "console"} .text=${this.messages.console ?? ""} text-enabled scale=s icon=console icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=console ${n(this.consoleRef)}></calcite-action><calcite-action .active=${this.openedResultPanel === "log"} .text=${this.messages.log ?? ""} text-enabled scale=s icon=list icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=log ${n(this.logRef)}></calcite-action></calcite-action-group></calcite-action-bar><calcite-action scale=s icon=x .text=${this.messages.close ?? ""} @click=${this._emitClose}></calcite-action></header>`}<article class="flex-adjustable">${this.loading ? e`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading ?? "Loading"}></calcite-loader>` : e`<div class="flex-column y-scrollable-container">${this.renderOutputPanel()}${this.renderConsolePanel()}${this.renderLogPanel()}</div>`}</article>`;
120
120
  }
121
121
  }
122
- h("arcgis-arcade-results", F);
122
+ p("arcgis-arcade-results", F);
123
123
  export {
124
124
  F as ArcgisArcadeResults
125
125
  };
@@ -3,86 +3,91 @@ import { c as g } from "../../chunks/runtime.js";
3
3
  import { css as f, html as x } from "lit";
4
4
  import { LitElement as v } from "@arcgis/lumina";
5
5
  import { slotChangeHasContent as y } from "@arcgis/toolkit/dom";
6
- import { createRef as c, ref as d } from "lit/directives/ref.js";
7
- const w = f`:host{--internal-border: var(--arcgis-coding-components-border, 1px solid var(--calcite-color-border-3));--internal-background-color: var(--arcgis-coding-components-background-color, var(--calcite-color-foreground-1));--internal-side-action-bar-max-w: var(--arcgis-coding-components-side-action-bar-max-w, 25%);--internal-code-editor-side-panel-w: var(--arcgis-coding-components-code-editor-side-panel-w, 600px);--internal-code-editor-side-panel-max-w: var(--arcgis-coding-components-code-editor-side-panel-max-w, 45%);--internal-code-editor-results-panel-max-h: var(--arcgis-coding-components-code-editor-results-panel-max-h, 50%);--internal-code-editor-results-panel-h: var(--arcgis-coding-components-code-editor-results-panel-h, 50%);--internal-code-editor-results-panel-bottom-drawer-controls-h: 0px;display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--internal-border);box-sizing:border-box;background-color:var(--internal-background-color);height:100%;.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.bottom-drawer{display:flex;flex:0 0 auto;flex-direction:column;overflow:hidden;position:relative;box-sizing:border-box;min-height:0}.bottom-drawer-resize-handle{display:none;position:absolute;inset-inline:0;inset-block-start:0;align-items:center;justify-content:center;block-size:var(--calcite-size-fixed-sm-plus);cursor:ns-resize;touch-action:none;user-select:none;z-index:var(--calcite-z-index-header);border-block-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);outline:none}.bottom-drawer-resize-handle-bar{display:flex;align-items:center;justify-content:center;inline-size:100%;block-size:var(--calcite-size-fixed-sm-plus);color:var(--calcite-color-border-input);background-color:var(--calcite-color-background);border-block-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);border-block-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);transition:box-shadow .12s ease,color .12s ease,background-color .12s ease}.bottom-drawer-resize-handle-bar calcite-icon{color:inherit}}:host(:state(results-has-content)) .bottom-drawer{padding-block-start:var(--calcite-size-fixed-sm-plus);height:calc(var(--internal-code-editor-results-panel-h) + var(--internal-code-editor-results-panel-bottom-drawer-controls-h));max-height:calc(var(--internal-code-editor-results-panel-max-h) + var(--internal-code-editor-results-panel-bottom-drawer-controls-h))}:host(:state(results-has-content)) .bottom-drawer-resize-handle{display:flex}:host(:state(results-has-content)) .bottom-drawer-resize-handle:focus .bottom-drawer-resize-handle-bar{box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host(:state(results-has-content)) .bottom-drawer-resize-handle:hover .bottom-drawer-resize-handle-bar,:host(:state(results-has-content)) .bottom-drawer-resize-handle .bottom-drawer-resize-handle-bar,:host(:state(is-resizing)) .bottom-drawer-resize-handle-bar{color:var(--calcite-shell-panel-resize-icon-color, var(--calcite-color-text-1));background-color:var(--calcite-shell-panel-resize-background-color, var(--calcite-color-foreground-3))}:host(:state(results-has-content)) slot[name=bottom-action-bar]::slotted(*){border-top:0}slot[name=top-action-bar]{flex:0 0 auto}slot[name=top-action-bar]::slotted(*){border-bottom:var(--internal-border)}slot[name=bottom-action-bar]{flex:0 0 auto}slot[name=bottom-action-bar]::slotted(*){border-top:var(--internal-border)}slot[name=side-panel]::slotted(*){max-width:var(--internal-code-editor-side-panel-max-w);width:var(--internal-code-editor-side-panel-w);border-inline-start:var(--internal-border);box-sizing:border-box;flex:1 0 auto}slot[name=side-panel]::slotted(.hidden){display:none}slot[name=editor]::slotted(*){flex:auto;min-height:0}slot[name=results-panel]{display:flex;flex:1 1 auto;overflow:hidden;min-height:0}slot[name=results-panel]::slotted(*){border-top:var(--internal-border);box-sizing:border-box;flex:1 1 auto;min-height:0}slot[name=side-action-bar]::slotted(*){max-width:var(--internal-side-action-bar-max-w);border-inline-start:var(--internal-border)}`, z = 10, P = 25, u = 100, i = "results-has-content", m = "is-resizing", H = "--arcgis-coding-components-code-editor-results-panel-max-h", s = "--internal-code-editor-results-panel-h", a = "--internal-code-editor-results-panel-max-h", n = "--internal-code-editor-results-panel-bottom-drawer-controls-h";
6
+ import { createRef as l, ref as c } from "lit/directives/ref.js";
7
+ const w = f`:host{--internal-border: var(--arcgis-coding-components-border, 1px solid var(--calcite-color-border-3));--internal-background-color: var(--arcgis-coding-components-background-color, var(--calcite-color-foreground-1));--internal-side-action-bar-max-w: var(--arcgis-coding-components-side-action-bar-max-w, 25%);--internal-code-editor-side-panel-w: var(--arcgis-coding-components-code-editor-side-panel-w, 600px);--internal-code-editor-side-panel-max-w: var(--arcgis-coding-components-code-editor-side-panel-max-w, 45%);--internal-code-editor-results-panel-max-h: var(--arcgis-coding-components-code-editor-results-panel-max-h, 50%);--internal-code-editor-results-panel-h: var(--arcgis-coding-components-code-editor-results-panel-h, 50%);--internal-code-editor-results-panel-bottom-drawer-controls-h: 0px;display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--internal-border);box-sizing:border-box;background-color:var(--internal-background-color);height:100%;.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.bottom-drawer{display:flex;flex:0 0 auto;flex-direction:column;overflow:hidden;position:relative;box-sizing:border-box;min-height:0}.bottom-drawer-resize-handle{display:none;position:absolute;inset-inline:0;inset-block-start:0;align-items:center;justify-content:center;block-size:var(--calcite-size-fixed-sm-plus);cursor:ns-resize;touch-action:none;user-select:none;z-index:var(--calcite-z-index-header);border-block-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);outline:none}.bottom-drawer-resize-handle-bar{display:flex;align-items:center;justify-content:center;inline-size:100%;block-size:var(--calcite-size-fixed-sm-plus);color:var(--calcite-color-border-input);background-color:var(--calcite-color-background);border-block-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);border-block-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);transition:box-shadow .12s ease,color .12s ease,background-color .12s ease}.bottom-drawer-resize-handle-bar calcite-icon{color:inherit}}:host(:state(results-has-content)) .bottom-drawer{padding-block-start:var(--calcite-size-fixed-sm-plus);height:calc(var(--internal-code-editor-results-panel-h) + var(--internal-code-editor-results-panel-bottom-drawer-controls-h));max-height:calc(var(--internal-code-editor-results-panel-max-h) + var(--internal-code-editor-results-panel-bottom-drawer-controls-h))}:host(:state(results-has-content)) .bottom-drawer-resize-handle{display:flex}:host(:state(results-has-content)) .bottom-drawer-resize-handle:focus .bottom-drawer-resize-handle-bar{box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host(:state(results-has-content)) .bottom-drawer-resize-handle:hover .bottom-drawer-resize-handle-bar,:host(:state(results-has-content)) .bottom-drawer-resize-handle .bottom-drawer-resize-handle-bar,:host(:state(is-resizing)) .bottom-drawer-resize-handle-bar{color:var(--calcite-shell-panel-resize-icon-color, var(--calcite-color-text-1));background-color:var(--calcite-shell-panel-resize-background-color, var(--calcite-color-foreground-3))}:host(:state(results-has-content)) slot[name=bottom-action-bar]::slotted(*){border-top:0}slot[name=top-action-bar]{flex:0 0 auto}slot[name=top-action-bar]::slotted(*){border-bottom:var(--internal-border)}slot[name=bottom-action-bar]{flex:0 0 auto}slot[name=bottom-action-bar]::slotted(*){border-top:var(--internal-border)}slot[name=side-panel]::slotted(*){max-width:var(--internal-code-editor-side-panel-max-w);width:var(--internal-code-editor-side-panel-w);border-inline-start:var(--internal-border);box-sizing:border-box;flex:1 0 auto}slot[name=side-panel]::slotted(.hidden){display:none}slot[name=editor]::slotted(*){flex:auto;min-height:0}slot[name=results-panel]{display:flex;flex:1 1 auto;overflow:hidden;min-height:0}slot[name=results-panel]::slotted(*){border-top:var(--internal-border);box-sizing:border-box;flex:1 1 auto;min-height:0}slot[name=side-action-bar]::slotted(*){max-width:var(--internal-side-action-bar-max-w);border-inline-start:var(--internal-border)}`, z = 10, P = 25, h = 100, u = "results-has-content", m = "is-resizing", H = "--arcgis-coding-components-code-editor-results-panel-max-h", s = "--internal-code-editor-results-panel-h", n = "--internal-code-editor-results-panel-max-h", i = "--internal-code-editor-results-panel-bottom-drawer-controls-h";
8
8
  class R extends v {
9
9
  static {
10
10
  this.styles = [w];
11
11
  }
12
12
  #e = void 0;
13
- #i = !1;
14
- #n = c();
15
- #d = c();
16
- #a = c();
17
- #t;
18
- #h(e) {
19
- this.#e === e.pointerId && this.#r();
20
- }
21
- #g = (e) => {
22
- this.#e === e.pointerId && this.#r();
13
+ #t = !1;
14
+ #n = !1;
15
+ #a = l();
16
+ #h = l();
17
+ #l = l();
18
+ #r;
19
+ #u(e) {
20
+ this.#e === e.pointerId && this.#o();
21
+ }
22
+ #f = (e) => {
23
+ this.#e === e.pointerId && this.#o();
23
24
  };
24
25
  load() {
25
- this.manager.onLifecycle(() => (this.#t = new ResizeObserver(() => {
26
- this.elementInternals.states.has(i) && this.#s();
27
- }), this.updateComplete.then(() => this.#b()), () => {
28
- this.#r(), this.#t?.disconnect(), this.#t = void 0;
26
+ this.manager.onLifecycle(() => (this.#r = new ResizeObserver(() => {
27
+ this.#t && this.#i();
28
+ }), this.updateComplete.then(() => this.#g()), () => {
29
+ this.#o(), this.#r?.disconnect(), this.#r = void 0;
29
30
  }));
30
31
  }
31
- #f() {
32
- this.elementInternals.states.has(i) && this.#s(), this.#b();
33
- }
34
- #x(e) {
35
- e.button !== 0 || !this.elementInternals.states.has(i) || (e.preventDefault(), e.currentTarget instanceof HTMLElement && (e.currentTarget.focus(), e.currentTarget.setPointerCapture(e.pointerId)), this.#e = e.pointerId, this.#i = !0, this.elementInternals.states.add(m), this.#u(e));
32
+ #x() {
33
+ this.#t && this.#i(), this.#g();
36
34
  }
37
35
  #v(e) {
38
- if (!this.elementInternals.states.has(i))
39
- return;
40
- this.#s();
41
- const t = this.#P(e);
42
- t != null && (e.preventDefault(), e.stopPropagation(), this.#i = !0, this.#c(t));
36
+ e.button !== 0 || !this.#t || (e.preventDefault(), e.currentTarget instanceof HTMLElement && (e.currentTarget.focus(), e.currentTarget.setPointerCapture(e.pointerId)), this.#e = e.pointerId, this.#n = !0, this.elementInternals.states.add(m), this.#m(e));
43
37
  }
44
38
  #y(e) {
39
+ if (!this.#t)
40
+ return;
41
+ this.#i();
42
+ const t = this.#H(e);
43
+ t != null && (e.preventDefault(), e.stopPropagation(), this.#n = !0, this.#d(t));
44
+ }
45
+ #w(e) {
45
46
  if (!e.target)
46
47
  return;
47
48
  const r = y(e);
48
- r || (this.#r(), this.#i || this.#R()), r ? (this.elementInternals.states.add(i), this.#s()) : this.elementInternals.states.delete(i);
49
+ if (this.#t = r, r) {
50
+ this.elementInternals.states.add(u), this.#i();
51
+ return;
52
+ }
53
+ this.#o(), this.#n || this.#C(), this.elementInternals.states.delete(u);
49
54
  }
50
- #r() {
55
+ #o() {
51
56
  const e = this.#e;
52
57
  if (!e)
53
58
  return;
54
59
  this.#e = void 0;
55
- const t = this.#d.value;
60
+ const t = this.#h.value;
56
61
  t?.hasPointerCapture(e) && t.releasePointerCapture(e), this.elementInternals.states.delete(m);
57
62
  }
58
- #u(e) {
63
+ #m(e) {
59
64
  if (this.#e !== e.pointerId)
60
65
  return;
61
- const t = this.#o(), r = this.el.getBoundingClientRect().bottom - e.clientY - t;
62
- this.#c(r, t);
66
+ const t = this.#s(), r = this.el.getBoundingClientRect().bottom - e.clientY - t;
67
+ this.#d(r, t);
63
68
  }
64
- #w() {
69
+ #z() {
65
70
  const e = Number.parseFloat(this.el.style.getPropertyValue(s));
66
71
  if (Number.isFinite(e))
67
72
  return e;
68
- const t = Number.parseFloat(getComputedStyle(this.#n.value ?? this.el).height);
69
- return Number.isFinite(t) ? Math.max(0, t - this.#o()) : u;
73
+ const t = Number.parseFloat(getComputedStyle(this.#a.value ?? this.el).height);
74
+ return Number.isFinite(t) ? Math.max(0, t - this.#s()) : h;
70
75
  }
71
- #m() {
76
+ #p() {
72
77
  return this.el.querySelector(':scope > [slot="bottom-action-bar"]');
73
78
  }
74
- #o() {
75
- const e = this.#m()?.getBoundingClientRect().height ?? 0, t = this.#a.value?.getBoundingClientRect().height ?? 0;
79
+ #s() {
80
+ const e = this.#p()?.getBoundingClientRect().height ?? 0, t = this.#l.value?.getBoundingClientRect().height ?? 0;
76
81
  return e + t;
77
82
  }
78
- #p() {
83
+ #b() {
79
84
  return getComputedStyle(this.el).getPropertyValue(H).trim() || null;
80
85
  }
81
- #l(e, t) {
86
+ #c(e, t) {
82
87
  t ? this.el.style.setProperty(e, t) : this.el.style.removeProperty(e);
83
88
  }
84
- #z(e) {
85
- const t = this.#p();
89
+ #P(e) {
90
+ const t = this.#b();
86
91
  if (!t)
87
92
  return null;
88
93
  const r = Number.parseFloat(t);
@@ -90,26 +95,26 @@ class R extends v {
90
95
  return r;
91
96
  if (t.endsWith("%") && Number.isFinite(r))
92
97
  return this.el.getBoundingClientRect().height * r / 100;
93
- const o = this.#n.value;
98
+ const o = this.#a.value;
94
99
  if (!o)
95
100
  return null;
96
- const l = this.el.style.getPropertyValue(n), p = this.el.style.getPropertyValue(s), b = this.el.style.getPropertyValue(a);
97
- this.el.style.setProperty(n, `${e}px`), this.el.style.setProperty(s, `${this.el.getBoundingClientRect().height}px`), this.el.style.setProperty(a, t);
98
- const h = Number.parseFloat(getComputedStyle(o).height);
99
- return this.#l(n, l), this.#l(s, p), this.#l(a, b), Number.isFinite(h) ? Math.max(0, h - e) : null;
101
+ const a = this.el.style.getPropertyValue(i), p = this.el.style.getPropertyValue(s), b = this.el.style.getPropertyValue(n);
102
+ this.el.style.setProperty(i, `${e}px`), this.el.style.setProperty(s, `${this.el.getBoundingClientRect().height}px`), this.el.style.setProperty(n, t);
103
+ const d = Number.parseFloat(getComputedStyle(o).height);
104
+ return this.#c(i, a), this.#c(s, p), this.#c(n, b), Number.isFinite(d) ? Math.max(0, d - e) : null;
100
105
  }
101
- #b() {
102
- const e = this.#t;
106
+ #g() {
107
+ const e = this.#r;
103
108
  if (!e)
104
109
  return;
105
110
  e.disconnect(), e.observe(this.el);
106
- const t = this.#a.value;
111
+ const t = this.#l.value;
107
112
  t && e.observe(t);
108
- const r = this.#m();
113
+ const r = this.#p();
109
114
  r && e.observe(r);
110
115
  }
111
- #P(e) {
112
- const t = e.shiftKey ? P : z, r = this.#w();
116
+ #H(e) {
117
+ const t = e.shiftKey ? P : z, r = this.#z();
113
118
  switch (e.key) {
114
119
  case "ArrowUp":
115
120
  return r + t;
@@ -119,23 +124,23 @@ class R extends v {
119
124
  return;
120
125
  }
121
126
  }
122
- #H(e, t) {
123
- const r = Math.max(0, this.el.getBoundingClientRect().height - t), o = this.#z(t), l = o == null ? r : Math.min(r, o);
124
- return Math.min(Math.max(e, u), l);
127
+ #R(e, t) {
128
+ const r = Math.max(0, this.el.getBoundingClientRect().height - t), o = this.#P(t), a = o == null ? r : Math.min(r, o);
129
+ return Math.min(Math.max(e, h), a);
125
130
  }
126
- #c(e, t = this.#o()) {
127
- const r = this.#H(e, t), o = this.#p();
128
- this.el.style.setProperty(n, `${t}px`), this.el.style.setProperty(s, `${r}px`), this.el.style.setProperty(a, o ?? `calc(100% - ${t}px)`);
131
+ #d(e, t = this.#s()) {
132
+ const r = this.#R(e, t), o = this.#b();
133
+ this.el.style.setProperty(i, `${t}px`), this.el.style.setProperty(s, `${r}px`), this.el.style.setProperty(n, o ?? `calc(100% - ${t}px)`);
129
134
  }
130
- #R() {
131
- this.el.style.removeProperty(n), this.el.style.removeProperty(s), this.el.style.removeProperty(a);
135
+ #C() {
136
+ this.el.style.removeProperty(i), this.el.style.removeProperty(s), this.el.style.removeProperty(n);
132
137
  }
133
- #s() {
134
- const e = this.#o(), t = Number.parseFloat(this.el.style.getPropertyValue(s));
135
- return Number.isFinite(t) ? this.#c(t, e) : this.el.style.setProperty(n, `${e}px`), e;
138
+ #i() {
139
+ const e = this.#s(), t = Number.parseFloat(this.el.style.getPropertyValue(s));
140
+ return Number.isFinite(t) ? this.#d(t, e) : this.el.style.setProperty(i, `${e}px`), e;
136
141
  }
137
142
  render() {
138
- return x`<slot name=top-action-bar></slot><div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable"><slot name=editor></slot><div class="bottom-drawer" ${d(this.#n)}><div aria-label="Resize results panel" aria-orientation=horizontal class="bottom-drawer-resize-handle" role=separator tabindex=0 @pointercancel=${this.#h} @pointerdown=${this.#x} @pointermove=${this.#u} @pointerup=${this.#h} @lostpointercapture=${this.#g} @keydown=${this.#v} ${d(this.#d)}><div class="bottom-drawer-resize-handle-bar" ${d(this.#a)}><calcite-icon icon=drag-resize-vertical scale=s></calcite-icon></div></div><slot name=bottom-action-bar @slotchange=${this.#f}></slot><slot name=results-panel @slotchange=${this.#y}></slot></div></div><slot name=side-panel></slot><slot name=side-action-bar></slot></div>`;
143
+ return x`<slot name=top-action-bar></slot><div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable"><slot name=editor></slot><div class="bottom-drawer" ${c(this.#a)}><div aria-label="Resize results panel" aria-orientation=horizontal class="bottom-drawer-resize-handle" role=separator tabindex=0 @pointercancel=${this.#u} @pointerdown=${this.#v} @pointermove=${this.#m} @pointerup=${this.#u} @lostpointercapture=${this.#f} @keydown=${this.#y} ${c(this.#h)}><div class="bottom-drawer-resize-handle-bar" ${c(this.#l)}><calcite-icon icon=drag-resize-vertical scale=s></calcite-icon></div></div><slot name=bottom-action-bar @slotchange=${this.#x}></slot><slot name=results-panel @slotchange=${this.#w}></slot></div></div><slot name=side-panel></slot><slot name=side-action-bar></slot></div>`;
139
144
  }
140
145
  }
141
146
  g("arcgis-code-editor-shell", R);