@arcgis/coding-components 5.0.3 → 5.0.5

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.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{a as g}from"./ASHNQ3IP.js";import"./X6QPPSDX.js";import{e as u}from"./NMIFSDFV.js";import{E as h,F as m,J as f,h as c,j as i,n as r,q as d}from"./7GDBSWXQ.js";import{a as n}from"./RXOG5OZ7.js";import"./ALDX5YZO.js";var b=c`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-list-item-group{background-color:var(--calcite-color-foreground-2);word-break:break-word}}`;function p(a){a.key==="Enter"&&a.stopPropagation()}var o=class extends m{constructor(){super(...arguments),this._beforeBack=async()=>{this.removeLastPanelRenderer(),this._filterValue=""},this.messages=g(),this._filterValue="",this._flowItemRenderers=[],this._mode="profile",this._mutationCounter=1,this.loading=!1,this.closed=!1,this.arcgisInternalClosePanel=r({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=r({bubbles:!1})}static{this.properties={_filterValue:16,_flowItemRenderers:16,_mode:16,_mutationCounter:16,loading:5,modelId:1,closed:5,variable:0}}static{this.styles=b}load(){this._variableChanged()}willUpdate(e){e.has("modelId")&&(this._flowItemRenderers=[]),e.has("variable")&&this._variableChanged()}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect()}_variableChanged(){this._mode=this.variable?.type==="featureSet"?"featureSet":"profile"}addPanelRenderer(e){this._flowItemRenderers=[...this._flowItemRenderers,e]}removeLastPanelRenderer(){this._flowItemRenderers=this._flowItemRenderers.slice(0,-1)}_isMode(e){return this._mode===e}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{u(e.querySelector("calcite-flow-item:last-child"),"calcite-input")}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_updateFilterValue(e){this._filterValue=e.currentTarget.value}_emitClose(){this.arcgisInternalClosePanel.emit()}_backToTop(){this._flowItemRenderers=[]}_emitItemSelected(e,t){if(t.nonInteractive)return;let l=e;(!l.key||l.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(t.snippet))}_showCollectionPanel(e,t){e.stopPropagation(),this.addPanelRenderer(l=>this.renderCollectionBasedVariable(t,!1,l))}_getHeadingForCollection(e){if(!e)return"";switch(this._mode){case"profile":return this.messages.profilevariables??"";case"featureSet":return this.messages.fields??""}}_getDescriptionForCollection(e){if(!e)return"";switch(this._mode){case"profile":return e.breadcrumb;case"featureSet":return e.variables[0]?.getLabel()??""}}renderCollectionBasedVariable(e,t=!1,l=!1){if(!e)return null;let s=this.loading;return!s&&!e.loaded&&(e.loadSource().then(()=>setTimeout(()=>{this._mutationCounter+=1})).catch(()=>{n("error",this,"Error loading collection"),s=!1}),s=!0),i`<calcite-flow-item heading-level=2 .heading=${this._getHeadingForCollection(e)} .description=${this._getDescriptionForCollection(e)} .beforeBack=${this._beforeBack} closable @calciteFlowItemClose=${this._emitClose} .selected=${l}><calcite-action slot=header-actions-end .text=${this.messages.backtotop??""} scale=m .hidden=${t||this._isMode("featureSet")} icon=chevrons-left icon-flip-rtl @click=${this._backToTop}></calcite-action><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m .label=${this.messages.filterthevariablesbyname??""} name=variable-filter></calcite-input>${s?i`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??""}></calcite-loader>`:i`<calcite-list .label=${this.messages.profilevariables??"Profile variables"}>${this.renderEditorVariables(e)}</calcite-list>`}</calcite-flow-item>`}renderEditorVariables(e){let t=d(this._filterValue),l=e.variables.filter(s=>s.passFilter(t));return l.length?l.map(s=>this.renderEditorVariable(s)):i`<div class="notice-container">${this.messages.noitems}</div>`}renderEditorVariable(e){switch(e.type){case"group":return this._isMode("featureSet")&&e.isHeader?i`<calcite-list-item-group .heading=${e.getLabel()}></calcite-list-item-group>`:this._isMode("featureSet")&&e._label?.code==="fields"?this.renderEditorVariables(e):i`<calcite-list-item-group .heading=${e.getLabel()}>${this.renderEditorVariables(e)}</calcite-list-item-group>`;default:return i`<calcite-list-item .label=${e.getLabel()} .description=${e.getDescription()} @calciteListItemSelect=${t=>this._emitItemSelected(t,e)} @keydown=${t=>this._emitItemSelected(t,e)}>${e.isCollection?i`<calcite-action slot=actions-end .text=${this.messages.expand??""} scale=s icon=chevron-right icon-flip-rtl @click=${t=>this._showCollectionPanel(t,e)} @keydown=${p}></calcite-action>`:null}${e.icon?i`<calcite-icon .icon=${e.icon} scale=s slot=content-start></calcite-icon>`:null}</calcite-list-item>`}}render(){return this.closed?null:!this.loading&&this.variable?.loaded&&!this.variable?.variables.length?i`<calcite-flow><calcite-flow-item heading-level=2 .heading=${this.messages.profilevariables} closable @calciteFlowItemClose=${this._emitClose}><div class="notice-container">${this.messages.noprofilevariablesmessage}</div></calcite-flow-item></calcite-flow>`:i`<calcite-flow ${h(this.flowFocusHandler)}>${this.renderCollectionBasedVariable(this.variable,!0,this._flowItemRenderers.length===0)}${this._flowItemRenderers.map((e,t,l)=>e(t===l.length-1))}</calcite-flow>`}};f("arcgis-editor-variables",o);export{o as ArcgisEditorVariables};
2
+ import{a as g}from"./S6WDBUCH.js";import"./EVIJBHVJ.js";import{e as u}from"./NMIFSDFV.js";import{E as h,F as m,J as f,h as c,j as i,n as r,q as d}from"./K5Q4VIAS.js";import{a as n}from"./RXOG5OZ7.js";import"./ALDX5YZO.js";var b=c`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-list-item-group{background-color:var(--calcite-color-foreground-2);word-break:break-word}}`;function p(a){a.key==="Enter"&&a.stopPropagation()}var o=class extends m{constructor(){super(...arguments),this._beforeBack=async()=>{this.removeLastPanelRenderer(),this._filterValue=""},this.messages=g(),this._filterValue="",this._flowItemRenderers=[],this._mode="profile",this._mutationCounter=1,this.loading=!1,this.closed=!1,this.arcgisInternalClosePanel=r({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=r({bubbles:!1})}static{this.properties={_filterValue:16,_flowItemRenderers:16,_mode:16,_mutationCounter:16,loading:5,modelId:1,closed:5,variable:0}}static{this.styles=b}load(){this._variableChanged()}willUpdate(e){e.has("modelId")&&(this._flowItemRenderers=[]),e.has("variable")&&this._variableChanged()}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect()}_variableChanged(){this._mode=this.variable?.type==="featureSet"?"featureSet":"profile"}addPanelRenderer(e){this._flowItemRenderers=[...this._flowItemRenderers,e]}removeLastPanelRenderer(){this._flowItemRenderers=this._flowItemRenderers.slice(0,-1)}_isMode(e){return this._mode===e}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{u(e.querySelector("calcite-flow-item:last-child"),"calcite-input")}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_updateFilterValue(e){this._filterValue=e.currentTarget.value}_emitClose(){this.arcgisInternalClosePanel.emit()}_backToTop(){this._flowItemRenderers=[]}_emitItemSelected(e,t){if(t.nonInteractive)return;let l=e;(!l.key||l.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(t.snippet))}_showCollectionPanel(e,t){e.stopPropagation(),this.addPanelRenderer(l=>this.renderCollectionBasedVariable(t,!1,l))}_getHeadingForCollection(e){if(!e)return"";switch(this._mode){case"profile":return this.messages.profilevariables??"";case"featureSet":return this.messages.fields??""}}_getDescriptionForCollection(e){if(!e)return"";switch(this._mode){case"profile":return e.breadcrumb;case"featureSet":return e.variables[0]?.getLabel()??""}}renderCollectionBasedVariable(e,t=!1,l=!1){if(!e)return null;let s=this.loading;return!s&&!e.loaded&&(e.loadSource().then(()=>setTimeout(()=>{this._mutationCounter+=1})).catch(()=>{n("error",this,"Error loading collection"),s=!1}),s=!0),i`<calcite-flow-item heading-level=2 .heading=${this._getHeadingForCollection(e)} .description=${this._getDescriptionForCollection(e)} .beforeBack=${this._beforeBack} closable @calciteFlowItemClose=${this._emitClose} .selected=${l}><calcite-action slot=header-actions-end .text=${this.messages.backtotop??""} scale=m .hidden=${t||this._isMode("featureSet")} icon=chevrons-left icon-flip-rtl @click=${this._backToTop}></calcite-action><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m .label=${this.messages.filterthevariablesbyname??""} name=variable-filter></calcite-input>${s?i`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??""}></calcite-loader>`:i`<calcite-list .label=${this.messages.profilevariables??"Profile variables"}>${this.renderEditorVariables(e)}</calcite-list>`}</calcite-flow-item>`}renderEditorVariables(e){let t=d(this._filterValue),l=e.variables.filter(s=>s.passFilter(t));return l.length?l.map(s=>this.renderEditorVariable(s)):i`<div class="notice-container">${this.messages.noitems}</div>`}renderEditorVariable(e){switch(e.type){case"group":return this._isMode("featureSet")&&e.isHeader?i`<calcite-list-item-group .heading=${e.getLabel()}></calcite-list-item-group>`:this._isMode("featureSet")&&e._label?.code==="fields"?this.renderEditorVariables(e):i`<calcite-list-item-group .heading=${e.getLabel()}>${this.renderEditorVariables(e)}</calcite-list-item-group>`;default:return i`<calcite-list-item .label=${e.getLabel()} .description=${e.getDescription()} @calciteListItemSelect=${t=>this._emitItemSelected(t,e)} @keydown=${t=>this._emitItemSelected(t,e)}>${e.isCollection?i`<calcite-action slot=actions-end .text=${this.messages.expand??""} scale=s icon=chevron-right icon-flip-rtl @click=${t=>this._showCollectionPanel(t,e)} @keydown=${p}></calcite-action>`:null}${e.icon?i`<calcite-icon .icon=${e.icon} scale=s slot=content-start></calcite-icon>`:null}</calcite-list-item>`}}render(){return this.closed?null:!this.loading&&this.variable?.loaded&&!this.variable?.variables.length?i`<calcite-flow><calcite-flow-item heading-level=2 .heading=${this.messages.profilevariables} closable @calciteFlowItemClose=${this._emitClose}><div class="notice-container">${this.messages.noprofilevariablesmessage}</div></calcite-flow-item></calcite-flow>`:i`<calcite-flow ${h(this.flowFocusHandler)}>${this.renderCollectionBasedVariable(this.variable,!0,this._flowItemRenderers.length===0)}${this._flowItemRenderers.map((e,t,l)=>e(t===l.length-1))}</calcite-flow>`}};f("arcgis-editor-variables",o);export{o as ArcgisEditorVariables};
@@ -18245,7 +18245,7 @@ function se(t, e, r, n) {
18245
18245
  const cr = { apiKey: void 0, apiKeys: { scopes: [] }, applicationName: "", applicationUrl: globalThis.location?.href, assetsPath: "", fontsUrl: "https://static.arcgis.com/fonts", geometryServiceUrl: "https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer", geoRSSServiceUrl: "https://utility.arcgis.com/sharing/rss", kmlServiceUrl: "https://utility.arcgis.com/sharing/kml", userPrivilegesApplied: !0, portalUrl: "https://www.arcgis.com", respectPrefersReducedMotion: !0, routeServiceUrl: "https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World", workers: { loaderConfig: { has: {}, paths: {}, map: {}, packages: [] } }, request: { crossOriginNoCorsDomains: null, httpsDomains: ["arcgis.com", "arcgisonline.com", "esrikr.com", "premiumservices.blackbridge.com", "esripremium.accuweather.com", "gbm.digitalglobe.com", "firstlook.digitalglobe.com", "msi.digitalglobe.com"], interceptors: [], internalInterceptors: [], maxUrlLength: 2e3, priority: "high", proxyRules: [], proxyUrl: null, timeout: 62e3, trustedServers: [], useIdentity: !0 }, log: { interceptors: [], level: null } };
18246
18246
  if (globalThis.esriConfig && (Y4(cr, globalThis.esriConfig, !0), delete cr.has), !cr.assetsPath) {
18247
18247
  {
18248
- const t = "5.0.3";
18248
+ const t = "5.0.5";
18249
18249
  cr.assetsPath = `https://js.arcgis.com/${t}/@arcgis/core/assets`;
18250
18250
  }
18251
18251
  cr.defaultAssetsPath = cr.assetsPath;
package/dist/cdn/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{I as s,u as e}from"./7GDBSWXQ.js";import"./RXOG5OZ7.js";import"./ALDX5YZO.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./KJQGH7SU.js"),"appVersion,assistantsEnabled,closed,closePanel:,disableQuestionAnswerLogging,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,serviceUrl;destroy"],"arcgis-arcade-editor":[()=>import("./NQW6FYM2.js"),"arcadeAssistant:,customPanels:,editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,setFocus"],"arcgis-arcade-results":[()=>import("./J2GWTHFG.js"),"calciteModeDark,consoleLogs:,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./MZZXWSGW.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./HUHLRK6Q.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./MZDCQDLA.js")],"arcgis-code-viewer":[()=>import("./BW43HUEN.js"),"language,round"],"arcgis-editor-variables":[()=>import("./5QDI2OLQ.js"),"closed,loading,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./HWIV6BSW.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./UPXS4WP7.js"),"hideSideBar,messages:,profile:,script;setFocus"]});i({resourcesUrl:import.meta.url});var t=new CSSStyleSheet;t.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-code-editor-shell,arcgis-code-viewer,arcgis-sql-expression-editor){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,t];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{I as s,u as e}from"./K5Q4VIAS.js";import"./RXOG5OZ7.js";import"./ALDX5YZO.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./MP4M4VSD.js"),"appVersion,assistantsEnabled,closed,closePanel:,disableQuestionAnswerLogging,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,serviceUrl;destroy"],"arcgis-arcade-editor":[()=>import("./I6GIZWSZ.js"),"arcadeAssistant:,customPanels:,editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,setFocus"],"arcgis-arcade-results":[()=>import("./DEEKIIXS.js"),"calciteModeDark,consoleLogs:,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./CFX5YYPW.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./GJLMXPW7.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./MLSNLBXU.js")],"arcgis-code-viewer":[()=>import("./TV7DSRQ6.js"),"language,round"],"arcgis-editor-variables":[()=>import("./WIKQE2F2.js"),"closed,loading,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./QOURNU2Z.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./23XAK7QK.js"),"hideSideBar,messages:,profile:,script;setFocus"]});i({resourcesUrl:import.meta.url});var t=new CSSStyleSheet;t.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-code-editor-shell,arcgis-code-viewer,arcgis-sql-expression-editor){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,t];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,7 +2,7 @@
2
2
  import "../cdn/main.css";
3
3
  import { makeRuntime as e } from "@arcgis/lumina";
4
4
  import { trackAccess as s, createObservable as r, createTrackingTarget as a, runTracked as c } from "@arcgis/core/applications/Components/reactiveUtils.js";
5
- const t = e({ defaultAssetPath: "https://js.arcgis.com/5.0.3/coding-components/", hydratedAttribute: "hydrated" }), { customElement: n, getAssetPath: i, setAssetPath: d } = t;
5
+ const t = e({ defaultAssetPath: "https://js.arcgis.com/5.0.5/coding-components/", hydratedAttribute: "hydrated" }), { customElement: n, getAssetPath: i, setAssetPath: d } = t;
6
6
  t.t = s;
7
7
  t.o = r;
8
8
  t.c = a;
@@ -1,6 +1,6 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
2
  import { g as I, c as D } from "../../chunks/runtime.js";
3
- import { css as C, html as s, nothing as b } from "lit";
3
+ import { css as C, html as i, nothing as b } from "lit";
4
4
  import { KeyCode as B } from "monaco-editor";
5
5
  import "monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js";
6
6
  import "monaco-editor/esm/vs/editor/standalone/common/standaloneTheme.js";
@@ -18,38 +18,41 @@ import { u as F } from "../../chunks/useT9n.js";
18
18
  import { createRef as N, ref as H } from "lit/directives/ref.js";
19
19
  import R from "@arcgis/core/identity/IdentityManager.js";
20
20
  import { log as O, rethrowError as o } from "@arcgis/toolkit/log";
21
- const j = C`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}.main-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group 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)}}`, E = "https://services6.arcgis.com/HXHga6CfMLMBOlBX/ArcGIS/rest/services/survey123_6e349a50b4504ca6b6107216d568db5f_form/FeatureServer/0", a = (i, e) => O(i, "Arcade Assistant", e), z = (i) => {
22
- const { aiAssistantsEnabled: e } = i;
21
+ const j = C`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}.main-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group 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)}}`, E = "https://services6.arcgis.com/HXHga6CfMLMBOlBX/ArcGIS/rest/services/survey123_6e349a50b4504ca6b6107216d568db5f_form/FeatureServer/0", a = (s, e) => O(s, "Arcade Assistant", e), z = (s) => {
22
+ const { aiAssistantsEnabled: e } = s;
23
23
  return e === void 0 ? (a("warn", "`areAiAssistantsEnabled` is not defined in the organizations settings."), !1) : e;
24
- }, V = (i) => !(!i || !("id" in i)), G = async (i) => (await R.getCredential(i, { oAuthPopupConfirmation: !1 })).token, q = async (i) => {
24
+ }, V = (s) => !(!s || !("id" in s)), G = async (s) => (await R.getCredential(s, { oAuthPopupConfirmation: !1 })).token, q = async (s) => {
25
25
  try {
26
- return !!await R.checkSignInStatus(i);
26
+ return !!await R.checkSignInStatus(s);
27
27
  } catch {
28
28
  return a("warn", "User is not signed in."), !1;
29
29
  }
30
30
  };
31
31
  async function Q({
32
- portalUrl: i,
32
+ portalUrl: s,
33
33
  profile: e
34
34
  }) {
35
35
  if (!V(e))
36
36
  return a("warn", "Addon initialization failed. Reason: unsupported profile."), { shouldRender: !1 };
37
- const t = i.replace(/\/sharing\/rest(\/.*)?$/iu, "").replace(/\/$/u, "");
37
+ const t = s.replace(/\/sharing\/rest(\/.*)?$/iu, "").replace(/\/$/u, "");
38
38
  if (!await q(t))
39
39
  return { shouldRender: !1 };
40
- const n = await G(i), h = `${t}/sharing/rest/portals/self?f=json&token=${n}`, p = `${t}/sharing/rest/portals/self/settings?f=json&token=${n}`, u = `${t}/sharing/rest/portals/self/signinSettings?f=json&token=${n}`, w = await Promise.allSettled([
41
- fetch(h, { credentials: "include" }).then((r) => r.json()),
40
+ const n = await G(s), p = `${t}/sharing/rest/portals/self?f=json&token=${n}`, u = `${t}/sharing/rest/portals/self/settings?f=json&token=${n}`, g = `${t}/sharing/rest/portals/self/signinSettings?f=json&token=${n}`, w = await Promise.allSettled([
42
41
  fetch(p, { credentials: "include" }).then((r) => r.json()),
43
- fetch(u, { credentials: "include" }).then((r) => r.json())
44
- ]), [g, f, _] = w, m = g.status === "fulfilled" ? g.value : (a("warn", `Failed to fetch selfUrl. Reason: ${g.reason}.`), {}), S = f.status === "fulfilled" ? f.value : (a("warn", `Failed to fetch settingsUrl. Reason: ${f.reason}.`), {}), y = _.status === "fulfilled" ? _.value : (a("warn", `Failed to fetch signinSettingsUrl. Reason: ${_.reason}.`), {}), $ = m.helpBase || "";
42
+ fetch(u, { credentials: "include" }).then((r) => r.json()),
43
+ fetch(g, { credentials: "include" }).then((r) => r.json())
44
+ ]), [f, _, m] = w, h = f.status === "fulfilled" ? f.value : (a("warn", `Failed to fetch selfUrl. Reason: ${f.reason}.`), {}), S = _.status === "fulfilled" ? _.value : (a("warn", `Failed to fetch settingsUrl. Reason: ${_.reason}.`), {}), y = m.status === "fulfilled" ? m.value : (a("warn", `Failed to fetch signinSettingsUrl. Reason: ${m.reason}.`), {});
45
+ if (h.isPortal)
46
+ return { shouldRender: !1 };
47
+ const $ = h.helpBase || "";
45
48
  if (!S)
46
49
  return a("warn", "Settings response is not available."), { shouldRender: !1 };
47
50
  let A = z(S);
48
51
  y.blockBetaApps === !0 && (a(
49
52
  "warn",
50
53
  "Arcade Assistant is blocked by the organization settings. To enable it, do not block beta apps in the organization settings."
51
- ), A = !1), m?.user?.privileges?.includes("portal:user:useAIAssistants") || (a("warn", "User does not have the required privileges to use AI Assistants."), A = !1);
52
- const P = m?.helperServices?.aiAssistantServices?.url;
54
+ ), A = !1), h?.user?.privileges?.includes("portal:user:useAIAssistants") || (a("warn", "User does not have the required privileges to use AI Assistants."), A = !1);
55
+ const P = h?.helperServices?.aiAssistantServices?.url;
53
56
  return P ? {
54
57
  shouldRender: !0,
55
58
  serviceUrl: P,
@@ -198,16 +201,16 @@ class X extends k {
198
201
  }));
199
202
  }
200
203
  renderMainActionBar() {
201
- return this.testData ? s`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-disabled slot=top-action-bar><calcite-action-group scale=s><calcite-action .text=${this.messages.run ?? ""} text-enabled icon=play scale=s .loading=${this._preparingArcade} @click=${() => void this._executeScript().catch(o(this))}></calcite-action>${this._executionResult ? s`<calcite-action .text=${this.messages.lastresults ?? ""} .active=${this._showExecutionPanel} text-enabled icon=access-string-results icon-flip-rtl scale=s @click=${this._toggleShowExecutionPanel}></calcite-action>` : null}</calcite-action-group></calcite-action-bar>` : null;
204
+ return this.testData ? i`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-disabled slot=top-action-bar><calcite-action-group scale=s><calcite-action .text=${this.messages.run ?? ""} text-enabled icon=play scale=s .loading=${this._preparingArcade} @click=${() => void this._executeScript().catch(o(this))}></calcite-action>${this._executionResult ? i`<calcite-action .text=${this.messages.lastresults ?? ""} .active=${this._showExecutionPanel} text-enabled icon=access-string-results icon-flip-rtl scale=s @click=${this._toggleShowExecutionPanel}></calcite-action>` : null}</calcite-action-group></calcite-action-bar>` : null;
202
205
  }
203
206
  renderMainPanel() {
204
- return s`<arcgis-code-editor slot=editor .editorOptions=${this.editorOptions} .language=${c.languageId} .value=${this.script ?? ""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${H(this._codeEditorElt)}></arcgis-code-editor>`;
207
+ return i`<arcgis-code-editor slot=editor .editorOptions=${this.editorOptions} .language=${c.languageId} .value=${this.script ?? ""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${H(this._codeEditorElt)}></arcgis-code-editor>`;
205
208
  }
206
- renderAction({ id: e, label: t, icon: d, active: n, panelName: h, iconFlipRtl: p = !1, onClick: u = this._toggleSidePanel }) {
207
- return s`<calcite-action id=${e ?? b} .text=${t} .textEnabled=${this.sideActionBarExpanded} .icon=${d} .active=${n} @click=${u} data-panel-name=${h ?? b} .iconFlipRtl=${p}></calcite-action>${!this.sideActionBarExpanded && s`<calcite-tooltip .referenceElement=${e}><span>${t}</span></calcite-tooltip>` || ""}`;
209
+ renderAction({ id: e, label: t, icon: d, active: n, panelName: p, iconFlipRtl: u = !1, onClick: g = this._toggleSidePanel }) {
210
+ return i`<calcite-action id=${e ?? b} .text=${t} .textEnabled=${this.sideActionBarExpanded} .icon=${d} .active=${n} @click=${g} data-panel-name=${p ?? b} .iconFlipRtl=${u}></calcite-action>${!this.sideActionBarExpanded && i`<calcite-tooltip .referenceElement=${e}><span>${t}</span></calcite-tooltip>` || ""}`;
208
211
  }
209
212
  renderSideActionBar() {
210
- return this.hideSideBar ? null : s`<calcite-action-bar slot=side-action-bar class="side-action-bar" .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action-group>${this.renderAction({
213
+ return this.hideSideBar ? null : i`<calcite-action-bar slot=side-action-bar class="side-action-bar" .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action-group>${this.renderAction({
211
214
  id: "profile-variables-action",
212
215
  label: this.messages.profilevariables ?? "",
213
216
  icon: "profile-variables",
@@ -251,13 +254,13 @@ class X extends k {
251
254
  if (this.hideSideBar)
252
255
  return null;
253
256
  const { openedSidePanel: e } = this;
254
- return s`<arcgis-language-api-panel slot=side-panel class=${l(e === "api" ? "" : "hidden")} .loading=${this._preparingArcade} .apiLibrary=${this._apiLibrary} .hideDocumentationActions=${this.hideDocumentationActions} @arcgisInternalItemSelected=${this._insertAsSnippet} @arcgisInternalClosePanel=${this._toggleSidePanel} data-panel-name=none .closed=${e !== "api"}></arcgis-language-api-panel><arcgis-editor-variables slot=side-panel class=${l(e === "variables" ? "" : "hidden")} .loading=${this._preparingArcade} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._toggleSidePanel} data-panel-name=none .variable=${this._editorProfile} .closed=${e !== "variables"}></arcgis-editor-variables>${this.suggestions?.length && s`<arcgis-arcade-suggestions slot=side-panel class=${l(e === "suggestions" ? "" : "hidden")} .closed=${e !== "suggestions"} .suggestions=${this.suggestions} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._toggleSidePanel} data-panel-name=none></arcgis-arcade-suggestions>` || ""}${this.arcadeAssistant && this._arcadeAssistantRemoteState.shouldRender && s`<arcgis-arcade-coding-assistant slot=side-panel class=${l(e === "arcade-assistant" ? "" : "hidden")} .closed=${e !== "arcade-assistant"} .insertText=${this._insertText.bind(this)} .closePanel=${this._toggleSidePanel} .portalUrl=${this.arcadeAssistant.portalUrl} .serviceUrl=${"serviceUrl" in this._arcadeAssistantRemoteState ? this._arcadeAssistantRemoteState.serviceUrl : void 0} .helpBase=${this._arcadeAssistantRemoteState.helpBase} .assistantsEnabled=${this._arcadeAssistantRemoteState.assistantsEnabled} .feedbackServiceUrl=${this._arcadeAssistantRemoteState.feedbackServiceUrl} .editorRef=${this.el} .appVersion=${this.arcadeAssistant.appVersion} .disableQuestionAnswerLogging=${this.arcadeAssistant.disableQuestionAnswerLogging}></arcgis-arcade-coding-assistant>` || ""}${this.customPanels?.map((t) => s`<calcite-flow slot=side-panel class=${l(e === t.id ? "" : "hidden")}>${t?.useFlows ? t.renderer?.({
257
+ return i`<arcgis-language-api-panel slot=side-panel class=${l(e === "api" ? "" : "hidden")} .loading=${this._preparingArcade} .apiLibrary=${this._apiLibrary} .hideDocumentationActions=${this.hideDocumentationActions} @arcgisInternalItemSelected=${this._insertAsSnippet} @arcgisInternalClosePanel=${this._toggleSidePanel} data-panel-name=none .closed=${e !== "api"}></arcgis-language-api-panel><arcgis-editor-variables slot=side-panel class=${l(e === "variables" ? "" : "hidden")} .loading=${this._preparingArcade} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._toggleSidePanel} data-panel-name=none .variable=${this._editorProfile} .closed=${e !== "variables"}></arcgis-editor-variables>${this.suggestions?.length && i`<arcgis-arcade-suggestions slot=side-panel class=${l(e === "suggestions" ? "" : "hidden")} .closed=${e !== "suggestions"} .suggestions=${this.suggestions} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._toggleSidePanel} data-panel-name=none></arcgis-arcade-suggestions>` || ""}${this.arcadeAssistant && this._arcadeAssistantRemoteState.shouldRender && i`<arcgis-arcade-coding-assistant slot=side-panel class=${l(e === "arcade-assistant" ? "" : "hidden")} .closed=${e !== "arcade-assistant"} .insertText=${this._insertText.bind(this)} .closePanel=${this._toggleSidePanel} .portalUrl=${this.arcadeAssistant.portalUrl} .serviceUrl=${"serviceUrl" in this._arcadeAssistantRemoteState ? this._arcadeAssistantRemoteState.serviceUrl : void 0} .helpBase=${this._arcadeAssistantRemoteState.helpBase} .assistantsEnabled=${this._arcadeAssistantRemoteState.assistantsEnabled} .feedbackServiceUrl=${this._arcadeAssistantRemoteState.feedbackServiceUrl} .editorRef=${this.el} .appVersion=${this.arcadeAssistant.appVersion} .disableQuestionAnswerLogging=${this.arcadeAssistant.disableQuestionAnswerLogging}></arcgis-arcade-coding-assistant>` || ""}${this.customPanels?.map((t) => i`<calcite-flow slot=side-panel class=${l(e === t.id ? "" : "hidden")}>${t?.useFlows ? t.renderer?.({
255
258
  closePanel: this._toggleSidePanel,
256
259
  insertText: this._insertText.bind(this),
257
260
  closed: e !== t.id,
258
261
  /** pass this.el instead of "this" as it is what actually gets attached to the dom */
259
262
  editorRef: this.el
260
- }) : s`<calcite-flow-item .heading=${t.name} heading-level=2 closable .closed=${e !== t.id} @calciteFlowItemClose=${this._toggleSidePanel} .description=${t.description}>${t.renderer?.({
263
+ }) : i`<calcite-flow-item .heading=${t.name} heading-level=2 closable .closed=${e !== t.id} @calciteFlowItemClose=${this._toggleSidePanel} .description=${t.description}>${t.renderer?.({
261
264
  closePanel: this._toggleSidePanel,
262
265
  insertText: this._insertText.bind(this),
263
266
  closed: e !== t.id,
@@ -266,10 +269,10 @@ class X extends k {
266
269
  })}</calcite-flow-item>`}</calcite-flow>`)}`;
267
270
  }
268
271
  renderResultsPanel() {
269
- return this._showExecutionPanel ? s`<arcgis-arcade-results slot=results-panel .openedResultPanel=${this._resultPanel} .loading=${this._executingScript} .result=${this._executionResult} .consoleLogs=${this._consoleLogs} @arcgisInternalOpenedResultPanelChange=${this._onResultPanelChange} @arcgisInternalClosePanel=${this._onExecutionPanelClose}></arcgis-arcade-results>` : null;
272
+ return this._showExecutionPanel ? i`<arcgis-arcade-results slot=results-panel .openedResultPanel=${this._resultPanel} .loading=${this._executingScript} .result=${this._executionResult} .consoleLogs=${this._consoleLogs} @arcgisInternalOpenedResultPanelChange=${this._onResultPanelChange} @arcgisInternalClosePanel=${this._onExecutionPanelClose}></arcgis-arcade-results>` : null;
270
273
  }
271
274
  render() {
272
- return s`<arcgis-code-editor-shell>${this.renderMainActionBar()}${this.renderMainPanel()}${this.renderResultsPanel()}${this.renderSidePanel()}${this.renderSideActionBar()}</arcgis-code-editor-shell>`;
275
+ return i`<arcgis-code-editor-shell>${this.renderMainActionBar()}${this.renderMainPanel()}${this.renderResultsPanel()}${this.renderSidePanel()}${this.renderSideActionBar()}</arcgis-code-editor-shell>`;
273
276
  }
274
277
  }
275
278
  D("arcgis-arcade-editor", X);