@arcgis/coding-components 5.0.2 → 5.0.4
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/{C6LWDIHC.js → 3A4STQXM.js} +1 -1
- package/dist/cdn/{73P6TBNJ.js → 3LPRAQTY.js} +1 -1
- package/dist/cdn/{NPXZJ3IU.js → 5ALY3XQI.js} +1 -1
- package/dist/cdn/{THZN27JD.js → 5K6LAVPW.js} +1 -1
- package/dist/cdn/{HPYEVVS6.js → 7XJ7G5H5.js} +1 -1
- package/dist/cdn/{HAOGNBQN.js → A3T45VXN.js} +1 -1
- package/dist/cdn/{VRXPZ4GN.js → A4OWORZA.js} +1 -1
- package/dist/cdn/CC25THK2.js +2 -0
- package/dist/cdn/{GULQJP4A.js → FNSSKYBZ.js} +1 -1
- package/dist/cdn/{TNMMELHW.js → GAEVCFPO.js} +1 -1
- package/dist/cdn/{GNARRO7H.js → GQLL5GUB.js} +1 -1
- package/dist/cdn/{5B3Y4BQM.js → IC26XJYA.js} +1 -1
- package/dist/cdn/{W7YMS6OO.js → K4TX7B4D.js} +1 -1
- package/dist/cdn/{BCKXXJFB.js → MJSQTSOK.js} +1 -1
- package/dist/cdn/{RYGCWJ7C.js → NIYJTGTP.js} +1 -1
- package/dist/cdn/{ZIY4VTAF.js → OSDOBBYC.js} +1 -1
- package/dist/cdn/{BV75TRFH.js → PLR4WX3O.js} +1 -1
- package/dist/cdn/QFDJFS6E.js +2 -0
- package/dist/cdn/{XSP7FWYY.js → UB65KLBZ.js} +1 -1
- package/dist/cdn/{2K5JL2WP.js → YODLOKH4.js} +1 -1
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/components/arcgis-arcade-editor/customElement.js +25 -22
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/cdn/EEKCZ342.js +0 -2
- package/dist/cdn/J5GTCIQY.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import a from"./
|
|
2
|
+
import a from"./GQLL5GUB.js";import{a as I}from"./72K7GT6K.js";import{a as h}from"./EMCHMKAC.js";import{b as l}from"./RXOG5OZ7.js";import{Qk as T,al as u}from"./YCOWKBW5.js";export default $arcgis.t(([{a:g,b:f}])=>{var m=Promise.withResolvers(),p=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this.stopWorker())}dispose(){this._configChangeListener.dispose(),this.stopWorker()}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null,m=Promise.withResolvers()),this._client=null}static async waitForWorker(){return await m.promise}async _getClientProxy(){let e=await h();if(!this._client){let{languageId:t}=this._defaults,o=window.MonacoEnvironment?.getWorker;if(!o)throw new Error("MonacoEnvironment.getWorker is not configured. Call setupMonacoEnvironment(...) before creating SQL Expression workers.");this._worker=e.createWebWorker({worker:o("SqlExprWorker",t),host:this._defaults.workerHost}),m.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){let t=await this._getClientProxy();return await this._worker?.withSyncedResources(e),t}},L=["AND","AS","BOTH","CASE","CAST","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","DATE","DAY","DOY","DOW","ELSE","END","ESCAPE","FALSE","FLOAT","FOR","FROM","HOUR","IN","INT","INTEGER","INTERVAL","LEADING","LIKE","MINUTE","MONTH","POSITION","REAL","SECOND","SMALLINT","THEN","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TRAILING","TRIM","TRUE","VARCHAR","WEEK","WHEN","WITH","YEAR","ZONE"],M=["AND","BETWEEN","LIKE","NOT","OR","IS","NULL"],b=["CAST","EXTRACT","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","ABS","ACOS","ASIN","ATAN","CEILING","COS","FLOOR","LOG","LOG10","MOD","NULLIF","POWER","ROUND","SIGN","SIN","TAN","TRUNCATE","CHAR_LENGTH","COALESCE","CONCAT","LOWER","POSITION","SUBSTRING","TRIM","UPPER"],O={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},D={defaultToken:"",tokenPostfix:".arcgis",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:L,operators:M,builtinFunctions:b,builtinVariables:[],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@keywords":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/"/,{token:"identifier.quote",next:"@quotedIdentifier"}]],quotedIdentifier:[[/[^"]+/,"identifier"],[/""/,"identifier"],[/"/,{token:"identifier.quote",next:"@pop"}]],scopes:[[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}},_=class{constructor(e,t){this._worker=e,this._defaults=t}async provideCompletionItems(e,t){try{let o=await this._worker(e.uri),r=e.getWordUntilPosition(t),n={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:r.startColumn,endColumn:r.endColumn},c=this._defaults.getApiContextForModel(e.uri);return await o.doComplete(e.uri.toString(),n,t,c)}catch(o){return l("SqlExprCompletionProvider")(o),{suggestions:[]}}}},k=class{constructor(e,t,{defaults:o,diagnosticService:r}){this._languageId=e,this._worker=t,this._disposables=[],this._modelListeners=new Map,this._diagnosticsService=r,this._defaults=o,h().then(n=>{let c=i=>{let s=i.getLanguageId();if(s!==this._languageId)return;let d=I(()=>{this._doValidate(i,s).catch(R=>{throw R})}),S=i.onDidChangeContent(d),A=i.onDidChangeAttached(d);this._modelListeners.set(i.uri.toString(),[S,A]),this._doValidate(i,s).catch(l("SqlExprDiagnosticsAdapter"))},E=i=>{let s=i.uri.toString();n.setModelMarkers(i,this._languageId,[]);let d=this._modelListeners.get(s);if(d){for(;d.length;)d.pop()?.dispose();this._modelListeners.delete(s)}};this._disposables.push(n.onDidCreateModel(c)),this._disposables.push(n.onWillDisposeModel(i=>E(i))),this._disposables.push(n.onDidChangeModelLanguage(i=>{E(i.model),c(i.model)})),this._disposables.push(o.onDidChange(()=>{n.getModels().forEach(i=>{i.getLanguageId()===this._languageId&&(E(i),c(i))})})),this._disposables.push(o.onModelContextDidChange(i=>{n.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&s.uri.toString()===i&&this._doValidate(s,this._languageId).catch(l("SqlExprDiagnosticsAdapter"))})})),this._disposables.push({dispose:()=>{this._modelListeners.forEach(i=>i.forEach(s=>s.dispose())),this._modelListeners.clear()}}),n.getModels().forEach(c)})}async _doValidate(e,t){let o=await h();if(e.isAttachedToEditor())try{let r=await this._worker(e.uri),n=this._defaults.getApiContextForModel(e.uri),c=await r.doValidation(e.uri.toString(),n);this._diagnosticsService.fireDiagnosticsChange(e.uri,c),o.setModelMarkers(e,t,c)}catch(r){l("SqlExprDiagnosticsAdapter")(r)}}},w;async function Z(...a){return await p.waitForWorker(),await new Promise((e,t)=>{if(!w){t(new Error("sql expression worker not registered!"));return}e(w(...a))})}var C=class{constructor(){this._onDiagnosticsChange=new T}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,t){this._onDiagnosticsChange.fire({uri:e,diagnostics:t})}},N=new C;async function K(){return await f(),N}function X(a){let e=new p(a),t=async(...r)=>await e.getLanguageServiceWorker(...r);w=t,u.setMonarchTokensProvider(g.languageId,D),u.setLanguageConfiguration(g.languageId,O);let o=new _(t,g);u.registerCompletionItemProvider(g.languageId,o),new k(a.languageId,t,{defaults:a,diagnosticService:N})}return{a:Z,b:K,c:X}},a)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import f from"./
|
|
2
|
+
import f from"./UB65KLBZ.js";import b from"./GQLL5GUB.js";import{a as _}from"./OSDOBBYC.js";import"./72K7GT6K.js";import"./3A4STQXM.js";import a from"./5K6LAVPW.js";import"./72CKSOAE.js";import"./5ALY3XQI.js";import"./EMCHMKAC.js";import"./3YF4QLXU.js";import"./NMIFSDFV.js";import"./VVVV256M.js";import{D as l,E as h,F as p,G as r,J as g,h as c,j as e,n as o,s as d}from"./PLR4WX3O.js";import{b as s}from"./RXOG5OZ7.js";import"./E26VIEON.js";import"./CVNYRL2K.js";import"./NXRT3FAY.js";import"./YCOWKBW5.js";import"./ALDX5YZO.js";export default $arcgis.t(([,{a:a},{b:f}])=>{var m=c`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}`,n=class extends p{constructor(){super(...arguments),this._codeEditorElt=l(),this._disposables=[],this.messages=_(),this._modelId=d(),this._preparing=!1,this.sideActionBarExpanded=!1,this.script="",this.hideSideBar=!1,this.arcgisDiagnosticsChange=o({bubbles:!1}),this.arcgisScriptChange=o({bubbles:!1})}static{this.properties={_activeAction:16,_apiLibrary:16,_editorProfile:16,_preparing:16,sideActionBarExpanded:16,profile:0,script:1,hideSideBar:5}}static{this.styles=[m]}async setFocus(){await this._codeEditorElt.value?.setFocus()}async load(){await this._updateEditorProfile().catch(s(this))}willUpdate(i){(i.has("messages")||i.has("profile"))&&this._updateDataModelDeps()}async loaded(){let i=await f();this._disposables.push(i.onDiagnosticsChange(t=>!this._preparing&&this.arcgisDiagnosticsChange.emit(t.diagnostics)))}disconnectedCallback(){for(super.disconnectedCallback();this._disposables.length;)this._disposables.pop()?.dispose()}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}async _updateEditorProfile(){this._preparing=!0;try{await a.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale}),this._editorProfile=a.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._preparing=!1}}_setActiveAction(i){if(this._activeAction===i){this._activeAction=void 0;return}this._activeAction=i}_handleActionClick(i){let t=i.target;this._setActiveAction(t.dataset.panelName)}_insertAsSnippet(i){this._codeEditorElt.value?.insertSnippet(i.detail).catch(s(this))}_insertAsText(i){this._codeEditorElt.value?.insertText(i.detail.replaceAll('"',"'")).catch(s(this))}async _updateApiLibrary(){this._apiLibrary=await a.getApiLibraryForModel(this._modelId)}_onCodeEditorValueChange(i){i.stopPropagation(),this.script=i.detail,this.arcgisScriptChange.emit(i.detail)}_getFeatureSetVariable(){let i,t=a.getEditorProfileForModel(this._modelId);return t?.variables?.length&&t?.variables?.[0]?.type!=="featureSet"?s(this)("Encountered unexpected editor profile"):i=t?.variables?.[0],i}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}render(){let i=this._getFeatureSetVariable();return e`<arcgis-code-editor-shell><arcgis-code-editor slot=editor language=arcgis-sql-expression .modelId=${this._modelId} .value=${this.script??""} @arcgisValueChange=${this._onCodeEditorValueChange} ${h(this._codeEditorElt)}></arcgis-code-editor>${!this.hideSideBar&&i&&e`<arcgis-editor-variables slot=side-panel .variable=${i} .closed=${this._activeAction!=="fields"} class=${r(this._activeAction==="fields"?"":"hidden")} .loading=${this._preparing} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${()=>this._setActiveAction(void 0)} data-panel-name=none></arcgis-editor-variables>`||""}${!this.hideSideBar&&e`<arcgis-language-api-panel slot=side-panel class=${r(this._activeAction==="functions"?"":"hidden")} .closed=${this._activeAction!=="functions"} @arcgisInternalItemSelected=${this._insertAsSnippet} @arcgisInternalClosePanel=${()=>this._setActiveAction(void 0)} .loading=${this._preparing} .apiLibrary=${this._apiLibrary} data-panel-name=none hide-documentation-actions .languageId=${a.languageId}></arcgis-language-api-panel>`||""}${!this.hideSideBar&&e`<calcite-action-bar slot=side-action-bar .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}>${i&&e`<calcite-action id=fields-action .text=${this.messages.fields??"Fields"} icon=profile-variables .active=${this._activeAction==="fields"} data-panel-name=fields @click=${this._handleActionClick}></calcite-action>`||""}${i&&!this.sideActionBarExpanded&&e`<calcite-tooltip reference-element=fields-action><span>${this.messages.fields??"Fields"}</span></calcite-tooltip>`||""}<calcite-action id=functions-action .text=${this.messages.functions??"Functions"} icon=function .active=${this._activeAction==="functions"} data-panel-name=functions @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded&&e`<calcite-tooltip reference-element=functions-action><span>${this.messages.functions??"Functions"}</span></calcite-tooltip>`||""}</calcite-action-bar>`||""}</arcgis-code-editor-shell>`}};g("arcgis-sql-expression-editor",n);return n},a,b,f)
|
|
@@ -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.
|
|
18248
|
+
const t = "5.0.4";
|
|
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"./
|
|
2
|
+
import{I as s,u as e}from"./PLR4WX3O.js";import"./RXOG5OZ7.js";import"./ALDX5YZO.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./FNSSKYBZ.js"),"appVersion,assistantsEnabled,closed,closePanel:,disableQuestionAnswerLogging,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,serviceUrl;destroy"],"arcgis-arcade-editor":[()=>import("./CC25THK2.js"),"arcadeAssistant:,customPanels:,editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,setFocus"],"arcgis-arcade-results":[()=>import("./3LPRAQTY.js"),"calciteModeDark,consoleLogs:,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./NIYJTGTP.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./A3T45VXN.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./K4TX7B4D.js")],"arcgis-code-viewer":[()=>import("./7XJ7G5H5.js"),"language,round"],"arcgis-editor-variables":[()=>import("./GAEVCFPO.js"),"closed,loading,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./A4OWORZA.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./YODLOKH4.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)
|
package/dist/chunks/runtime.js
CHANGED
|
@@ -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.
|
|
5
|
+
const t = e({ defaultAssetPath: "https://js.arcgis.com/5.0.4/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
|
|
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 = (
|
|
22
|
-
const { aiAssistantsEnabled: e } =
|
|
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 = (
|
|
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(
|
|
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:
|
|
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 =
|
|
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(
|
|
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
|
-
|
|
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),
|
|
52
|
-
const P =
|
|
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 ?
|
|
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
|
|
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:
|
|
207
|
-
return
|
|
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 :
|
|
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
|
|
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
|
-
}) :
|
|
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 ?
|
|
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
|
|
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);
|