@arcgis/coding-components 5.0.0-next.93 → 5.0.0-next.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addons/arcade-coding-assistant/chat-helper.d.ts +3 -3
- package/dist/addons.js +26 -25
- package/dist/cdn/{ETMVFEBE.js → 26R4B4SR.js} +2 -2
- package/dist/cdn/{XOQ3RM5Y.js → 54FZPXUP.js} +2 -2
- package/dist/cdn/{ZBXNENKW.js → 5DAT5ZFW.js} +2 -2
- package/dist/cdn/{ITSWV2D2.js → BAKKWJI7.js} +2 -2
- package/dist/cdn/{BYEBULNN.js → CJ6SJGTO.js} +2 -2
- package/dist/cdn/{QONUPJDY.js → CLUG3LC4.js} +1 -1
- package/dist/cdn/{5XCYAKJJ.js → D5OWDVIG.js} +2 -2
- package/dist/cdn/{4P5HZOXS.js → DFLUHXMI.js} +2 -2
- package/dist/cdn/{LBTNX3UD.js → DIFXXFOE.js} +2 -2
- package/dist/cdn/{A323TEFP.js → DNW5A5G6.js} +2 -2
- package/dist/cdn/DPEHWNF4.js +14 -0
- package/dist/cdn/{QDDMGH2B.js → EMLWH6JD.js} +2 -2
- package/dist/cdn/{VAELJETA.js → FDTYASER.js} +2 -2
- package/dist/cdn/{UGVEW6ZQ.js → H44HKSEL.js} +1 -1
- package/dist/cdn/{5CEEVUCZ.js → HQO32HVD.js} +2 -2
- package/dist/cdn/{7FSEYOGD.js → HR7CEM5J.js} +2 -2
- package/dist/cdn/J5JG7YJY.js +4 -0
- package/dist/cdn/KFNUX4NF.js +4 -0
- package/dist/cdn/{I4JO32WF.js → KU2RSLW6.js} +2 -2
- package/dist/cdn/{PGSOHB37.js → KUOOSF2Y.js} +2 -2
- package/dist/cdn/MMTP5K7U.js +6 -0
- package/dist/cdn/{5EBSP7DM.js → NA3DW5WP.js} +2 -2
- package/dist/cdn/{V5FQNTXG.js → P3ADDEIL.js} +2 -2
- package/dist/cdn/{Z4L7OJKT.js → PJE2D7RB.js} +2 -2
- package/dist/cdn/{ZCT5XGMI.js → Q6M3EIWR.js} +1 -1
- package/dist/cdn/QGWBJM2F.js +4 -0
- package/dist/cdn/{GYL2QCR7.js → QNHGH7LN.js} +2 -2
- package/dist/cdn/{CT7TBHUK.js → QSZ5Q2P3.js} +2 -2
- package/dist/cdn/{CY2NIZSQ.js → QXAPL2AZ.js} +1 -1
- package/dist/cdn/{LC7PNNVV.js → R3ZFQ3NB.js} +3 -3
- package/dist/cdn/{N7HNKUKK.js → RTU52FLE.js} +2 -2
- package/dist/cdn/SE7546PF.js +4 -0
- package/dist/cdn/T5QY5OT3.js +4 -0
- package/dist/cdn/TBTRAJ2W.js +4 -0
- package/dist/cdn/{URZFEWH3.js → UEGR62F7.js} +2 -2
- package/dist/cdn/{PO35LCAS.js → UHWI5CWO.js} +2 -2
- package/dist/cdn/UQDJQX5N.js +4 -0
- package/dist/cdn/{K3L3TIEP.js → V5OOACSR.js} +2 -2
- package/dist/cdn/VLKLFWDG.js +4 -0
- package/dist/cdn/{2X52Y4DY.js → VYAAHXIM.js} +1 -1
- package/dist/cdn/W3HRDCHH.js +6 -0
- package/dist/cdn/{P6IUHZNJ.js → W5PCHPTR.js} +2 -2
- package/dist/cdn/{53OPBGH3.js → W6PBVDLA.js} +1 -1
- package/dist/cdn/WDT3UXU3.js +4 -0
- package/dist/cdn/WJOUYKK2.js +4 -0
- package/dist/cdn/{TRILF5XK.js → XLMLAWJH.js} +2 -2
- package/dist/cdn/{UTNSHEMF.js → XQXLHCC5.js} +1 -1
- package/dist/cdn/{2GQYFHB5.js → ZV42HAPL.js} +2 -2
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +759 -757
- package/dist/cdn/index.js +2 -2
- package/dist/chunks/arcade-contribution.js +1 -1
- package/dist/chunks/arcade-defaults.js +1 -1
- package/dist/chunks/arcade-executor.js +1 -1
- package/dist/chunks/arcade-mode.js +55 -54
- package/dist/chunks/arcade-service-accessors.js +1 -1
- package/dist/chunks/colorize.js +1 -1
- package/dist/chunks/editor.js +1 -1
- package/dist/chunks/fields.js +1 -1
- package/dist/chunks/language-defaults-base.js +203 -202
- package/dist/chunks/markdown.js +1 -1
- package/dist/chunks/monaco-importer.js +1 -1
- package/dist/chunks/monaco-theme.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/sql-expr-defaults.js +1 -1
- package/dist/chunks/sql-expr-mode.js +67 -66
- package/dist/chunks/sql-expr-service-accessors.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/chunks/utilities.js +1 -1
- package/dist/components/arcgis-arcade-coding-assistant/customElement.js +221 -110
- package/dist/components/arcgis-arcade-coding-assistant/types.d.ts +4 -4
- package/dist/components/arcgis-arcade-editor/customElement.js +67 -65
- package/dist/components/arcgis-arcade-results/customElement.js +1 -1
- package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
- package/dist/components/arcgis-code-editor/customElement.js +1 -1
- package/dist/components/arcgis-code-viewer/customElement.js +15 -14
- package/dist/components/arcgis-editor-variables/customElement.js +10 -9
- package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
- package/dist/components/arcgis-sql-expression-editor/customElement.js +22 -21
- package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
- package/dist/docs/api.json +2 -2
- package/dist/docs/docs.json +2 -2
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.js +1 -1
- package/dist/monacoStyles.js +1 -1
- package/dist/utils/arcade-assistant/aiContext.d.ts +6 -0
- package/dist/utils/arcade-assistant/types.d.ts +39 -0
- package/package.json +5 -5
- package/dist/cdn/3AOVYJDA.js +0 -4
- package/dist/cdn/DGSXN3MJ.js +0 -6
- package/dist/cdn/HNHID2GQ.js +0 -4
- package/dist/cdn/IBBEGZKT.js +0 -4
- package/dist/cdn/MIV62SB5.js +0 -4
- package/dist/cdn/MNSM3SGU.js +0 -4
- package/dist/cdn/PQAIRRA6.js +0 -4
- package/dist/cdn/SYFORY5P.js +0 -4
- package/dist/cdn/UPIRR7NI.js +0 -14
- package/dist/cdn/UVW7RTZM.js +0 -4
- package/dist/cdn/VFIPWTCQ.js +0 -4
- package/dist/cdn/WSQRFXIA.js +0 -4
- package/dist/cdn/YNQH23OP.js +0 -6
|
@@ -1,137 +1,138 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import g from "@arcgis/core/layers/FeatureLayer.js";
|
|
2
|
+
import te from "@arcgis/core/request.js";
|
|
3
3
|
import "@arcgis/toolkit/type";
|
|
4
|
-
import { p as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { isNotNull as
|
|
9
|
-
import { addLtrMark as
|
|
10
|
-
import { s as
|
|
11
|
-
import { CompletionItemKind as
|
|
12
|
-
import { getDeclaredVoxelMembers as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
4
|
+
import { p as ie } from "./utilities.js";
|
|
5
|
+
import re from "@arcgis/core/portal/PortalItem.js";
|
|
6
|
+
import se from "@arcgis/core/WebMap.js";
|
|
7
|
+
import ne from "@arcgis/core/WebScene.js";
|
|
8
|
+
import { isNotNull as v, isNotUndefined as k } from "@arcgis/toolkit/predicate";
|
|
9
|
+
import { addLtrMark as oe, setValuesInString as G } from "@arcgis/toolkit/string";
|
|
10
|
+
import { s as w, f as ae, a as m, m as le, b as ue } from "./fields.js";
|
|
11
|
+
import { CompletionItemKind as F, InsertTextFormat as x, InsertTextMode as V } from "vscode-languageserver-types";
|
|
12
|
+
import { getDeclaredVoxelMembers as pe, getDeclaredPixelMembers as ce } from "@arcgis/core/applications/Components/arcadeEditorUtils.js";
|
|
13
|
+
import { log as h } from "@arcgis/toolkit/log";
|
|
14
|
+
import { i as he } from "./monaco-importer.js";
|
|
15
|
+
import { g as fe } from "./runtime.js";
|
|
16
|
+
import { normalizeLocale as de } from "@arcgis/toolkit/intl";
|
|
17
|
+
import { filterApiLibraryForContext as ye } from "@arcgis/languages-api-utils";
|
|
18
|
+
import { Emitter as E, Uri as j } from "monaco-editor";
|
|
18
19
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
19
20
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
20
|
-
v5.0.0-next.
|
|
21
|
-
function k(t) {
|
|
22
|
-
return !!t && typeof t == "object" && "declaredClass" in t && typeof t.declaredClass == "string" && t.declaredClass.startsWith("esri.layers.") && w(t) && "queryFeatures" in t && typeof t.queryFeatures == "function";
|
|
23
|
-
}
|
|
21
|
+
v5.0.0-next.95 */
|
|
24
22
|
function q(t) {
|
|
23
|
+
return !!t && typeof t == "object" && "declaredClass" in t && typeof t.declaredClass == "string" && t.declaredClass.startsWith("esri.layers.") && D(t) && "queryFeatures" in t && typeof t.queryFeatures == "function";
|
|
24
|
+
}
|
|
25
|
+
function K(t) {
|
|
25
26
|
return !!t && typeof t == "object" && "declaredClass" in t && typeof t.declaredClass == "string" && (t.declaredClass === "esri.Map" || t.declaredClass === "esri.WebMap" || t.declaredClass === "esri.WebScene");
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function _e(t) {
|
|
28
29
|
return !!t && typeof t == "object" && "loadAll" in t && typeof t.loadAll == "function";
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
+
function z(t) {
|
|
31
32
|
return !!t && typeof t == "object" && "portalItem" in t && t.portalItem != null;
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
+
function H(t) {
|
|
34
35
|
return !!t && typeof t == "object" && "portalItem" in t && t.portalItem != null;
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function D(t) {
|
|
37
38
|
return !!t && typeof t == "object" && "fields" in t && Array.isArray(t.fields);
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
+
function S(t) {
|
|
40
41
|
return !!t && typeof t == "object" && "url" in t && typeof t.url == "string";
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
-
return
|
|
44
|
-
}
|
|
45
|
-
function H(t) {
|
|
46
|
-
return D(t) || w(t) || z(t);
|
|
47
|
-
}
|
|
48
|
-
function Ze(t) {
|
|
49
|
-
return H(t) && "type" in t && t.type === "voxel";
|
|
43
|
+
function be(t) {
|
|
44
|
+
return S(t) && /\/(?:featureserver|mapserver)(?:\/|$)/iu.test(t.url ?? "");
|
|
50
45
|
}
|
|
51
|
-
function
|
|
52
|
-
return
|
|
46
|
+
function J(t) {
|
|
47
|
+
return S(t) || D(t) || H(t);
|
|
53
48
|
}
|
|
54
49
|
function tt(t) {
|
|
55
|
-
return
|
|
50
|
+
return J(t) && "type" in t && t.type === "voxel";
|
|
56
51
|
}
|
|
57
52
|
function it(t) {
|
|
58
|
-
return
|
|
53
|
+
return J(t) && "type" in t && (t.type === "imagery" || t.type === "imagery-tile");
|
|
54
|
+
}
|
|
55
|
+
function rt(t) {
|
|
56
|
+
return S(t) || D(t) || H(t);
|
|
57
|
+
}
|
|
58
|
+
function st(t) {
|
|
59
|
+
return z(t) || K(t) || be(t);
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
+
function N(t) {
|
|
61
62
|
return !!t && typeof t == "object" && "declaredClass" in t && t.declaredClass === "esri.layers.support.Subtype";
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
+
function C(t) {
|
|
64
65
|
return !!t && typeof t == "object" && "declaredClass" in t && t.declaredClass === "esri.layers.support.CodedValueDomain";
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
+
function me(t) {
|
|
67
68
|
return !!t && typeof t == "object" && "declaredClass" in t && t.declaredClass === "esri.layers.support.InheritedDomain";
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
+
function nt(t) {
|
|
70
71
|
return !!t && typeof t == "object" && "id" in t && typeof t.id == "string" && "definitions" in t && typeof t.definitions == "object" && !Array.isArray(t.definitions);
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
+
function f(t) {
|
|
73
74
|
return !!t && typeof t == "object" && "title" in t && typeof t.title == "string";
|
|
74
75
|
}
|
|
75
|
-
function
|
|
76
|
+
function ge(t) {
|
|
76
77
|
return !!t && typeof t == "object" && "url" in t && typeof t.url == "string";
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
+
function Q(t) {
|
|
79
80
|
return !!t && typeof t == "object" && "layerId" in t && typeof t.layerId == "number";
|
|
80
81
|
}
|
|
81
82
|
function P(t) {
|
|
82
83
|
return !!t && typeof t == "object" && "typeIdField" in t && "types" in t;
|
|
83
84
|
}
|
|
84
|
-
function
|
|
85
|
+
function U(t) {
|
|
85
86
|
return !!t && typeof t == "object" && "getFieldDomain" in t && typeof t.getFieldDomain == "function";
|
|
86
87
|
}
|
|
87
|
-
function
|
|
88
|
+
function y(t) {
|
|
88
89
|
return !!t && typeof t == "object" && "subtypeField" in t;
|
|
89
90
|
}
|
|
90
|
-
function ge(t) {
|
|
91
|
-
return d(t) && "subtypes" in t;
|
|
92
|
-
}
|
|
93
91
|
function we(t) {
|
|
94
|
-
return
|
|
92
|
+
return y(t) && "subtypes" in t;
|
|
95
93
|
}
|
|
96
94
|
function De(t) {
|
|
97
|
-
return
|
|
95
|
+
return !!t && typeof t == "object" && "portalItem" in t;
|
|
98
96
|
}
|
|
99
97
|
function Se(t) {
|
|
100
|
-
return
|
|
98
|
+
return Q(t) && "relationships" in t && "url" in t && Array.isArray(t.relationships) && typeof t.url == "string";
|
|
101
99
|
}
|
|
102
100
|
function Ce(t) {
|
|
101
|
+
return !!t && typeof t == "object" && "isTable" in t && typeof t.isTable == "boolean";
|
|
102
|
+
}
|
|
103
|
+
function ve(t) {
|
|
103
104
|
if (t && typeof t == "object") {
|
|
104
|
-
if (
|
|
105
|
+
if (Ce(t))
|
|
105
106
|
return t.isTable || "type" in t && t.type === "table";
|
|
106
107
|
if ("geometryType" in t)
|
|
107
108
|
return t.geometryType === "" || t.geometryType === "esriGeometryNull" || t.geometryType === null;
|
|
108
109
|
}
|
|
109
110
|
return !1;
|
|
110
111
|
}
|
|
111
|
-
function ve(t) {
|
|
112
|
-
return !Ce(t);
|
|
113
|
-
}
|
|
114
112
|
function Fe(t) {
|
|
115
|
-
return
|
|
113
|
+
return !ve(t);
|
|
116
114
|
}
|
|
117
115
|
function xe(t) {
|
|
116
|
+
return !!t && typeof t == "object" && "load" in t && typeof t.load == "function";
|
|
117
|
+
}
|
|
118
|
+
function Ve(t) {
|
|
118
119
|
return !!t && typeof t == "object" && "type" in t && t.type === "voxel";
|
|
119
120
|
}
|
|
120
|
-
function
|
|
121
|
+
function B(t) {
|
|
121
122
|
return !!t && typeof t == "object" && "type" in t && typeof t.type == "string" && ["imagery", "imagery-tile"].includes(t.type);
|
|
122
123
|
}
|
|
123
|
-
async function
|
|
124
|
+
async function X(t) {
|
|
124
125
|
if (!t)
|
|
125
126
|
return null;
|
|
126
127
|
let e;
|
|
127
|
-
return
|
|
128
|
+
return D(t) ? e = t : e = new g(t), xe(e) && await e.load(), e;
|
|
128
129
|
}
|
|
129
130
|
async function Pe(t) {
|
|
130
131
|
t += "/layers";
|
|
131
|
-
const e = await
|
|
132
|
+
const e = await te(t, { responseType: "json", query: { f: "json" } }), i = t.endsWith("MapServer/layers") ? "data" : "query", r = W(e.data?.layers, i), s = W(e.data?.tables, i);
|
|
132
133
|
return { layers: r, tables: s };
|
|
133
134
|
}
|
|
134
|
-
function
|
|
135
|
+
function W(t, e) {
|
|
135
136
|
return t ? t.filter((i) => {
|
|
136
137
|
switch (i.type) {
|
|
137
138
|
case "Feature Layer":
|
|
@@ -144,17 +145,17 @@ function B(t, e) {
|
|
|
144
145
|
}
|
|
145
146
|
}) : [];
|
|
146
147
|
}
|
|
147
|
-
async function
|
|
148
|
-
const i = new
|
|
148
|
+
async function Ie(t, e) {
|
|
149
|
+
const i = new g({ url: `${t.url}/${e.relatedTableId}` });
|
|
149
150
|
return await i.load(), i;
|
|
150
151
|
}
|
|
151
|
-
function
|
|
152
|
+
function I(t) {
|
|
152
153
|
return (e, i) => {
|
|
153
154
|
if (e.type === "oid")
|
|
154
155
|
return -1;
|
|
155
156
|
if (i.type === "oid")
|
|
156
157
|
return 1;
|
|
157
|
-
if (
|
|
158
|
+
if (y(t)) {
|
|
158
159
|
if (e.name === t.subtypeField)
|
|
159
160
|
return -1;
|
|
160
161
|
if (i.name === t.subtypeField)
|
|
@@ -169,47 +170,47 @@ function V(t) {
|
|
|
169
170
|
return e.name.localeCompare(i.name, "en", { sensitivity: "base" });
|
|
170
171
|
};
|
|
171
172
|
}
|
|
172
|
-
function
|
|
173
|
+
function R(t, e) {
|
|
173
174
|
return t?.every((i) => i.domains?.[e.name]?.type === "inherited") ?? !1;
|
|
174
175
|
}
|
|
175
|
-
const
|
|
176
|
-
function
|
|
177
|
-
return t.match(
|
|
176
|
+
const Te = /^[a-z_$][a-z0-9_$]*$/giu;
|
|
177
|
+
function T(t, e = !0) {
|
|
178
|
+
return t.match(Te) ? `${e ? "." : ""}${t}` : `["${t}"]`;
|
|
178
179
|
}
|
|
179
|
-
function
|
|
180
|
-
return t ? `${t}${
|
|
180
|
+
function Y(t, e) {
|
|
181
|
+
return t ? `${t}${T(e)}` : e;
|
|
181
182
|
}
|
|
182
|
-
function
|
|
183
|
-
return
|
|
183
|
+
function O(t) {
|
|
184
|
+
return De(t) ? t.portalItem : null;
|
|
184
185
|
}
|
|
185
|
-
function
|
|
186
|
+
function ot(t, e, i = !1) {
|
|
186
187
|
let r = e;
|
|
187
188
|
const s = [], n = [];
|
|
188
|
-
return
|
|
189
|
+
return w(t).forEach((o) => {
|
|
189
190
|
r && (r += `
|
|
190
191
|
|
|
191
192
|
`), r += `**${o.name}** (${o.alias})
|
|
192
193
|
${o.type}`, o.description && (r += `
|
|
193
194
|
'${o.description}`);
|
|
194
|
-
const c =
|
|
195
|
+
const c = ue(o), p = T(o.name, !1), b = m(o);
|
|
195
196
|
if (s.push({
|
|
196
197
|
name: o.name,
|
|
197
|
-
description:
|
|
198
|
+
description: b,
|
|
198
199
|
type: c,
|
|
199
200
|
completion: {
|
|
200
201
|
label: o.name,
|
|
201
|
-
detail:
|
|
202
|
+
detail: b,
|
|
202
203
|
insertText: p,
|
|
203
|
-
insertTextMode:
|
|
204
|
-
insertTextFormat:
|
|
205
|
-
kind:
|
|
204
|
+
insertTextMode: V.asIs,
|
|
205
|
+
insertTextFormat: x.PlainText,
|
|
206
|
+
kind: F.Field
|
|
206
207
|
}
|
|
207
208
|
}), i) {
|
|
208
209
|
if (!o.alias || o.alias.toLowerCase() === o.name.toLowerCase())
|
|
209
210
|
return;
|
|
210
|
-
let
|
|
211
|
+
let d = `**${o.alias}**
|
|
211
212
|
${o.type}`;
|
|
212
|
-
o.description && (
|
|
213
|
+
o.description && (d += `
|
|
213
214
|
'${o.description}`), n.push({
|
|
214
215
|
name: o.alias,
|
|
215
216
|
description: o.name,
|
|
@@ -218,16 +219,16 @@ ${o.type}`;
|
|
|
218
219
|
label: o.alias,
|
|
219
220
|
detail: o.name,
|
|
220
221
|
insertText: p,
|
|
221
|
-
insertTextMode:
|
|
222
|
-
insertTextFormat:
|
|
223
|
-
kind:
|
|
224
|
-
documentation: { kind: "markdown", value:
|
|
222
|
+
insertTextMode: V.asIs,
|
|
223
|
+
insertTextFormat: x.PlainText,
|
|
224
|
+
kind: F.Field,
|
|
225
|
+
documentation: { kind: "markdown", value: d }
|
|
225
226
|
}
|
|
226
227
|
});
|
|
227
228
|
}
|
|
228
229
|
}), [[...s, ...n], r];
|
|
229
230
|
}
|
|
230
|
-
function
|
|
231
|
+
function at(t, e) {
|
|
231
232
|
let i = e;
|
|
232
233
|
const r = [];
|
|
233
234
|
return t.forEach((s) => {
|
|
@@ -243,15 +244,15 @@ ${s.type}`, s.name && (i += `
|
|
|
243
244
|
completion: {
|
|
244
245
|
label: s.name,
|
|
245
246
|
detail: s.name,
|
|
246
|
-
insertText:
|
|
247
|
-
insertTextMode:
|
|
248
|
-
insertTextFormat:
|
|
249
|
-
kind:
|
|
247
|
+
insertText: T(s.name, !1),
|
|
248
|
+
insertTextMode: V.asIs,
|
|
249
|
+
insertTextFormat: x.PlainText,
|
|
250
|
+
kind: F.Field
|
|
250
251
|
}
|
|
251
252
|
});
|
|
252
253
|
}), [r, i];
|
|
253
254
|
}
|
|
254
|
-
class
|
|
255
|
+
class Z {
|
|
255
256
|
constructor(e, i, r) {
|
|
256
257
|
this._profile = e, this._label = i, this.description = r, this.filterDescription = !1;
|
|
257
258
|
}
|
|
@@ -259,13 +260,13 @@ class Y {
|
|
|
259
260
|
* Returns the label string.
|
|
260
261
|
*/
|
|
261
262
|
getLabel() {
|
|
262
|
-
return this._label == null ? "" : typeof this._label == "string" ?
|
|
263
|
+
return this._label == null ? "" : typeof this._label == "string" ? oe(this._label) : G(this._profile?.intlStrings[this._label.code], this._label.formatValues);
|
|
263
264
|
}
|
|
264
265
|
/**
|
|
265
266
|
* Returns the description string.
|
|
266
267
|
*/
|
|
267
268
|
getDescription() {
|
|
268
|
-
return this.description == null ? "" : typeof this.description == "string" ? this.description :
|
|
269
|
+
return this.description == null ? "" : typeof this.description == "string" ? this.description : G(this._profile?.intlStrings[this.description.code], this.description.formatValues);
|
|
269
270
|
}
|
|
270
271
|
/**
|
|
271
272
|
* Returns true if the item pass the filter test
|
|
@@ -274,12 +275,12 @@ class Y {
|
|
|
274
275
|
return !e || e.test(this.getLabel()) ? !0 : this.filterDescription && e.test(this.getDescription());
|
|
275
276
|
}
|
|
276
277
|
}
|
|
277
|
-
class
|
|
278
|
+
class M extends Z {
|
|
278
279
|
constructor(e) {
|
|
279
280
|
super(e.profile, e.label, e.description ?? e.declaration?.description), this.declaration = e.declaration ?? {}, this.name = e.declaration?.name ?? "", this.snippet = e.snippet ?? "", this.nonInteractive = e.nonInteractive ?? !1, this.filterDescription = e.filterDescription ?? !1, this.icon = e.icon;
|
|
280
281
|
}
|
|
281
282
|
}
|
|
282
|
-
class l extends
|
|
283
|
+
class l extends M {
|
|
283
284
|
constructor(e) {
|
|
284
285
|
super(e), this.type = "text", this.isCollection = !1, this.type = e.declaration?.type ?? "text";
|
|
285
286
|
}
|
|
@@ -290,7 +291,7 @@ class l extends T {
|
|
|
290
291
|
return { type: this.type, name: "", ...this.declaration };
|
|
291
292
|
}
|
|
292
293
|
}
|
|
293
|
-
class
|
|
294
|
+
class Me extends M {
|
|
294
295
|
constructor(e) {
|
|
295
296
|
super(e), this.type = "array", this.isCollection = !1, this.elementType = e.declaration?.elementType ?? { type: "number", name: "number" };
|
|
296
297
|
}
|
|
@@ -301,7 +302,7 @@ class Te extends T {
|
|
|
301
302
|
return { type: this.type, elementType: this.elementType, name: "", ...this.declaration };
|
|
302
303
|
}
|
|
303
304
|
}
|
|
304
|
-
class
|
|
305
|
+
class $ extends M {
|
|
305
306
|
constructor(e, i) {
|
|
306
307
|
super(i), this.owner = e, this.isCollection = !0, this._loaded = !0, this.variables = [];
|
|
307
308
|
}
|
|
@@ -328,7 +329,7 @@ class M extends T {
|
|
|
328
329
|
return "";
|
|
329
330
|
}
|
|
330
331
|
}
|
|
331
|
-
class u extends
|
|
332
|
+
class u extends Z {
|
|
332
333
|
constructor(e, i, r = [], s = !1) {
|
|
333
334
|
super(e, i), this.variables = r, this.isHeader = s, this.type = "group", this.isCollection = !0;
|
|
334
335
|
}
|
|
@@ -336,7 +337,7 @@ class u extends Y {
|
|
|
336
337
|
return !0;
|
|
337
338
|
}
|
|
338
339
|
}
|
|
339
|
-
class
|
|
340
|
+
class _ extends $ {
|
|
340
341
|
constructor(e, i) {
|
|
341
342
|
super(e, i), this.type = "dictionary", this.dictionaryVariables = [], this.loadPropertyDeclarations(i.declaration?.properties), this.snippet && this.dictionaryVariables.length && (this.variables = [new u(this._profile, this.snippet, this.dictionaryVariables)]);
|
|
342
343
|
}
|
|
@@ -355,7 +356,7 @@ class y extends M {
|
|
|
355
356
|
}), i;
|
|
356
357
|
}
|
|
357
358
|
createVariableInstance(e) {
|
|
358
|
-
const i =
|
|
359
|
+
const i = Y(this.snippet, e.name);
|
|
359
360
|
switch (e.type) {
|
|
360
361
|
case "number":
|
|
361
362
|
case "text":
|
|
@@ -367,38 +368,38 @@ class y extends M {
|
|
|
367
368
|
case "knowledgeGraph":
|
|
368
369
|
return new l({ profile: this._profile, declaration: e, label: i, snippet: i });
|
|
369
370
|
case "pixel":
|
|
370
|
-
return new
|
|
371
|
+
return new Ae(this, { profile: this._profile, declaration: e, label: i, snippet: i });
|
|
371
372
|
case "voxel":
|
|
372
|
-
return new
|
|
373
|
+
return new Le(this, { profile: this._profile, declaration: e, label: i, snippet: i });
|
|
373
374
|
case "feature":
|
|
374
|
-
return new
|
|
375
|
+
return new $e(this, { profile: this._profile, declaration: e, label: i, snippet: i });
|
|
375
376
|
case "featureSet":
|
|
376
|
-
return new
|
|
377
|
+
return new A(this, { profile: this._profile, declaration: e, label: i, snippet: i }, [
|
|
377
378
|
new l({ profile: this._profile, label: i, description: "", snippet: i })
|
|
378
379
|
]);
|
|
379
380
|
case "featureSetCollection":
|
|
380
|
-
return new
|
|
381
|
+
return new Ge(this, {
|
|
381
382
|
profile: this._profile,
|
|
382
383
|
declaration: e,
|
|
383
384
|
label: i,
|
|
384
385
|
snippet: i
|
|
385
386
|
});
|
|
386
387
|
case "dictionary":
|
|
387
|
-
return new
|
|
388
|
+
return new _(this, {
|
|
388
389
|
profile: this._profile,
|
|
389
390
|
declaration: e,
|
|
390
391
|
label: i,
|
|
391
392
|
snippet: i
|
|
392
393
|
});
|
|
393
394
|
case "array":
|
|
394
|
-
return new
|
|
395
|
+
return new Me({
|
|
395
396
|
profile: this._profile,
|
|
396
397
|
declaration: e,
|
|
397
398
|
label: i,
|
|
398
399
|
snippet: i
|
|
399
400
|
});
|
|
400
401
|
default:
|
|
401
|
-
return
|
|
402
|
+
return h("error", "Editor profile", "Invalid profile variable", { detail: { declaration: e } }), null;
|
|
402
403
|
}
|
|
403
404
|
}
|
|
404
405
|
toProfileVariableDefinition() {
|
|
@@ -410,30 +411,30 @@ class y extends M {
|
|
|
410
411
|
};
|
|
411
412
|
}
|
|
412
413
|
}
|
|
413
|
-
class
|
|
414
|
+
class ee extends $ {
|
|
414
415
|
constructor(e, i, r) {
|
|
415
416
|
super(e, i), this.relationshipsProperties = r, this._source = null, this._loaded = !1, this._definition = i.declaration?.definition;
|
|
416
417
|
}
|
|
417
418
|
get title() {
|
|
418
|
-
return
|
|
419
|
+
return f(this._source) ? this._source.title ?? "" : "";
|
|
419
420
|
}
|
|
420
421
|
get url() {
|
|
421
|
-
return
|
|
422
|
+
return ge(this._source) ? this._source.url ?? "" : "";
|
|
422
423
|
}
|
|
423
424
|
get informationUrl() {
|
|
424
|
-
return !this.loaded || !this.url ? null :
|
|
425
|
+
return !this.loaded || !this.url ? null : Q(this._source) ? `${this.url}/${this._source.layerId}` : this.url;
|
|
425
426
|
}
|
|
426
427
|
get informationType() {
|
|
427
428
|
return this._profile?.intlStrings.layer ?? "layer";
|
|
428
429
|
}
|
|
429
430
|
async loadSource() {
|
|
430
|
-
return
|
|
431
|
+
return v(this._loadPromise) && k(this._loadPromise) ? await this._loadPromise : (this._loadPromise = this._loadSource(), await this._loadPromise);
|
|
431
432
|
}
|
|
432
433
|
_getValueSnippet(e) {
|
|
433
|
-
return ["feature", "voxel", "pixel"].includes(this.type) ?
|
|
434
|
+
return ["feature", "voxel", "pixel"].includes(this.type) ? Y(this.snippet, e.name) : e.name;
|
|
434
435
|
}
|
|
435
436
|
_getSubtypeOrDomainNameSnippet(e) {
|
|
436
|
-
return this.type !== "feature" ? null :
|
|
437
|
+
return this.type !== "feature" ? null : y(this._source) && e.name === this._source.subtypeField ? `SubtypeName(${this.snippet})` : `DomainName(${this.snippet}, "${e.name}")`;
|
|
437
438
|
}
|
|
438
439
|
_getFieldProperty(e, i) {
|
|
439
440
|
const r = this._getDomainDictionary(e);
|
|
@@ -443,9 +444,9 @@ class Z extends M {
|
|
|
443
444
|
return new l({
|
|
444
445
|
profile: this._profile,
|
|
445
446
|
label: s,
|
|
446
|
-
description:
|
|
447
|
+
description: m(e),
|
|
447
448
|
snippet: s,
|
|
448
|
-
icon:
|
|
449
|
+
icon: ae(e, i),
|
|
449
450
|
filterDescription: !0
|
|
450
451
|
});
|
|
451
452
|
}
|
|
@@ -456,23 +457,23 @@ class Z extends M {
|
|
|
456
457
|
label: i,
|
|
457
458
|
description: e.name,
|
|
458
459
|
snippet: i,
|
|
459
|
-
icon:
|
|
460
|
+
icon: le(e),
|
|
460
461
|
filterDescription: !0
|
|
461
462
|
});
|
|
462
463
|
}
|
|
463
464
|
_getDomainDictionary(e) {
|
|
464
|
-
return
|
|
465
|
+
return U(this._source) ? y(this._source) && this._source.subtypeField ? this._getSubtypeDomainDictionary(e) : P(this._source) && this._source.typeIdField ? this._getFeatureTypeDomainDictionary(e) : this._getFieldDomainDictionary(e) : null;
|
|
465
466
|
}
|
|
466
467
|
_getSubtypeDomainDictionary(e) {
|
|
467
|
-
if (!
|
|
468
|
+
if (!y(this._source))
|
|
468
469
|
return null;
|
|
469
|
-
if (!
|
|
470
|
+
if (!we(this._source))
|
|
470
471
|
return e.name === this._source.subtypeField ? null : this._getFieldDomainDictionary(e);
|
|
471
472
|
if (e.name === this._source.subtypeField) {
|
|
472
473
|
const s = this._createDomainDictionary(e);
|
|
473
474
|
return s.icon = "subtype", s.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.subtypes, e)), s;
|
|
474
475
|
}
|
|
475
|
-
if (
|
|
476
|
+
if (R(this._source.subtypes, e))
|
|
476
477
|
return this._getFieldDomainDictionary(e);
|
|
477
478
|
const i = this._getDomainValuesGroup(this._source.subtypes, e);
|
|
478
479
|
if (!i)
|
|
@@ -487,7 +488,7 @@ class Z extends M {
|
|
|
487
488
|
const s = this._createDomainDictionary(e);
|
|
488
489
|
return s.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.types, e)), s;
|
|
489
490
|
}
|
|
490
|
-
if (
|
|
491
|
+
if (R(this._source.types, e))
|
|
491
492
|
return this._getFieldDomainDictionary(e);
|
|
492
493
|
const i = this._getDomainValuesGroup(this._source.types, e);
|
|
493
494
|
if (!i)
|
|
@@ -496,10 +497,10 @@ class Z extends M {
|
|
|
496
497
|
return r.variables.push(i), r;
|
|
497
498
|
}
|
|
498
499
|
_getFieldDomainDictionary(e) {
|
|
499
|
-
if (!
|
|
500
|
+
if (!U(this._source))
|
|
500
501
|
return null;
|
|
501
502
|
const i = this._source.getFieldDomain(e.name);
|
|
502
|
-
if (!
|
|
503
|
+
if (!C(i))
|
|
503
504
|
return null;
|
|
504
505
|
const r = this._getCodedValueDomainGroup(i, {
|
|
505
506
|
code: "domainvalues"
|
|
@@ -507,10 +508,10 @@ class Z extends M {
|
|
|
507
508
|
return s.variables.push(r), s;
|
|
508
509
|
}
|
|
509
510
|
_getTypeOrSubtypeDomainGroup(e, i) {
|
|
510
|
-
if (
|
|
511
|
+
if (C(i.domain))
|
|
511
512
|
return this._getCodedValueDomainGroup(i.domain, { code: "subtypes" });
|
|
512
513
|
const r = e?.map((s) => {
|
|
513
|
-
const n =
|
|
514
|
+
const n = N(s) ? s.code : s.id;
|
|
514
515
|
return new l({
|
|
515
516
|
profile: this._profile,
|
|
516
517
|
label: `${n}`,
|
|
@@ -536,26 +537,26 @@ class Z extends M {
|
|
|
536
537
|
const r = [];
|
|
537
538
|
return !e || e.length === 0 || (e.forEach((s) => {
|
|
538
539
|
const n = s.domains?.[i.name];
|
|
539
|
-
if (!n ||
|
|
540
|
+
if (!n || me(n) || !C(n))
|
|
540
541
|
return;
|
|
541
|
-
const a =
|
|
542
|
+
const a = m(i), o = this._getCodedValueDomainGroup(n, {
|
|
542
543
|
code: "domainvaluesfortypeformat",
|
|
543
544
|
formatValues: {
|
|
544
545
|
fieldName: a,
|
|
545
546
|
typeName: s.name
|
|
546
547
|
}
|
|
547
|
-
}), c =
|
|
548
|
+
}), c = N(s) ? s.code : s.id, p = `${c}`, b = `"${c}""`, d = new _(this, {
|
|
548
549
|
profile: this._profile,
|
|
549
550
|
label: p,
|
|
550
|
-
snippet:
|
|
551
|
+
snippet: b,
|
|
551
552
|
description: s.name,
|
|
552
553
|
declaration: { name: a }
|
|
553
554
|
});
|
|
554
|
-
|
|
555
|
+
d.variables = [o], r.push(d);
|
|
555
556
|
}), !r.length) ? null : new u(this._profile, { code: "domainvaluesbysubtypes" }, r);
|
|
556
557
|
}
|
|
557
558
|
_createDomainDictionary(e) {
|
|
558
|
-
const i = this._getValueSnippet(e), r =
|
|
559
|
+
const i = this._getValueSnippet(e), r = m(e), s = new _(this, {
|
|
559
560
|
profile: this._profile,
|
|
560
561
|
label: i,
|
|
561
562
|
description: r,
|
|
@@ -585,15 +586,15 @@ class Z extends M {
|
|
|
585
586
|
if (!this.relationshipsProperties?.exposeRelationships || !this._profile?.supportFeatureSetFunctions)
|
|
586
587
|
return null;
|
|
587
588
|
const e = this._source;
|
|
588
|
-
if (!
|
|
589
|
+
if (!Se(e))
|
|
589
590
|
return null;
|
|
590
591
|
const i = new u(this._profile, { code: "relationships" }), r = await Promise.all(
|
|
591
592
|
e.relationships?.map(async (s) => {
|
|
592
|
-
const n = await
|
|
593
|
-
if (!
|
|
593
|
+
const n = await Ie(e, s);
|
|
594
|
+
if (!q(n) || s.relatedTableId === this.relationshipsProperties?.sourceTableId)
|
|
594
595
|
return null;
|
|
595
596
|
const a = `FeatureSetByRelationshipName(${this.snippet}, "${s.name}")`;
|
|
596
|
-
return new
|
|
597
|
+
return new A(
|
|
597
598
|
this,
|
|
598
599
|
{
|
|
599
600
|
profile: this._profile,
|
|
@@ -607,21 +608,21 @@ class Z extends M {
|
|
|
607
608
|
);
|
|
608
609
|
}) ?? []
|
|
609
610
|
);
|
|
610
|
-
return i.variables = r.filter(
|
|
611
|
+
return i.variables = r.filter(v), i.variables.length ? i : null;
|
|
611
612
|
}
|
|
612
613
|
}
|
|
613
|
-
class
|
|
614
|
+
class L extends ee {
|
|
614
615
|
constructor(e, i, r, s = { exposeRelationships: !0 }) {
|
|
615
616
|
super(e, i, s), this.type = r;
|
|
616
617
|
}
|
|
617
618
|
get title() {
|
|
618
|
-
return
|
|
619
|
+
return f(this._source) ? this._source.title ?? "" : { code: this.type };
|
|
619
620
|
}
|
|
620
621
|
toProfileVariableDefinition() {
|
|
621
622
|
return { type: this.type, name: "", ...this.declaration };
|
|
622
623
|
}
|
|
623
624
|
}
|
|
624
|
-
class
|
|
625
|
+
class $e extends L {
|
|
625
626
|
constructor(e, i) {
|
|
626
627
|
super(e, i, "feature", { exposeRelationships: !0 }), this.type = "feature";
|
|
627
628
|
}
|
|
@@ -629,9 +630,9 @@ class Me extends $ {
|
|
|
629
630
|
if (this.loaded)
|
|
630
631
|
return this._source;
|
|
631
632
|
try {
|
|
632
|
-
if (this._source = await
|
|
633
|
+
if (this._source = await X(this._definition), !this._source)
|
|
633
634
|
throw new Error("Invalid definition");
|
|
634
|
-
const e =
|
|
635
|
+
const e = f(this._source) ? this._source.title ?? "" : "";
|
|
635
636
|
this.variables.push(
|
|
636
637
|
new u(this._profile, e, [
|
|
637
638
|
new l({
|
|
@@ -643,7 +644,7 @@ class Me extends $ {
|
|
|
643
644
|
])
|
|
644
645
|
);
|
|
645
646
|
const i = new u(this._profile, { code: "values" });
|
|
646
|
-
if (this.variables.push(i),
|
|
647
|
+
if (this.variables.push(i), Fe(this._source)) {
|
|
647
648
|
const n = `Geometry(${this.snippet})`, a = new l({
|
|
648
649
|
profile: this._profile,
|
|
649
650
|
declaration: { name: n },
|
|
@@ -656,20 +657,20 @@ class Me extends $ {
|
|
|
656
657
|
i.variables.push(a);
|
|
657
658
|
}
|
|
658
659
|
const r = this._source;
|
|
659
|
-
|
|
660
|
+
w(this._source.fields).map((n) => r.fields.find((a) => a.name === n.name)).sort(I(r)).forEach((n) => {
|
|
660
661
|
i.variables.push(this._getFieldProperty(n));
|
|
661
662
|
});
|
|
662
663
|
const s = await this._getRelationshipsProperty();
|
|
663
664
|
s && this.variables.push(s);
|
|
664
665
|
} catch (e) {
|
|
665
|
-
|
|
666
|
+
h("error", "FeatureVariable", "Error with definition", { detail: { error: e, definition: this._definition } }), this._source = null;
|
|
666
667
|
} finally {
|
|
667
668
|
this._loaded = !0;
|
|
668
669
|
}
|
|
669
670
|
return this._source;
|
|
670
671
|
}
|
|
671
672
|
}
|
|
672
|
-
class
|
|
673
|
+
class Le extends L {
|
|
673
674
|
constructor(e, i) {
|
|
674
675
|
super(e, i, "voxel", { exposeRelationships: !1 }), this.type = "voxel", this._source = null;
|
|
675
676
|
}
|
|
@@ -677,11 +678,11 @@ class $e extends $ {
|
|
|
677
678
|
if (this.loaded)
|
|
678
679
|
return this._source;
|
|
679
680
|
try {
|
|
680
|
-
if (!
|
|
681
|
+
if (!Ve(this._definition))
|
|
681
682
|
throw new Error("Invalid definition - not a VoxelLayer");
|
|
682
683
|
if (await this._definition.load(), this._source = this._definition, !this._source)
|
|
683
684
|
throw new Error("Invalid definition");
|
|
684
|
-
const e =
|
|
685
|
+
const e = f(this._source) ? this._source.title ?? "" : "";
|
|
685
686
|
this.variables.push(
|
|
686
687
|
new u(this._profile, e, [
|
|
687
688
|
new l({
|
|
@@ -694,19 +695,19 @@ class $e extends $ {
|
|
|
694
695
|
);
|
|
695
696
|
const i = new u(this._profile, { code: "values" });
|
|
696
697
|
this.variables.push(i);
|
|
697
|
-
const r = await
|
|
698
|
-
|
|
698
|
+
const r = await pe(this._source), s = this._source;
|
|
699
|
+
w(this._source.fields).map((n) => s.fields.find((a) => a.name === n.name)).sort(I(s)).forEach((n) => {
|
|
699
700
|
i.variables.push(this._getFieldProperty(n, r));
|
|
700
701
|
});
|
|
701
702
|
} catch (e) {
|
|
702
|
-
|
|
703
|
+
h("error", this.type, "Error with definition", { detail: { error: e, definition: this._definition } }), this._source = null;
|
|
703
704
|
} finally {
|
|
704
705
|
this._loaded = !0;
|
|
705
706
|
}
|
|
706
707
|
return this._source;
|
|
707
708
|
}
|
|
708
709
|
}
|
|
709
|
-
class
|
|
710
|
+
class Ae extends L {
|
|
710
711
|
constructor(e, i) {
|
|
711
712
|
super(e, i, "pixel", { exposeRelationships: !1 }), this.type = "pixel", this._source = null;
|
|
712
713
|
}
|
|
@@ -714,11 +715,11 @@ class Le extends $ {
|
|
|
714
715
|
if (this.loaded)
|
|
715
716
|
return this._source;
|
|
716
717
|
try {
|
|
717
|
-
if (!
|
|
718
|
+
if (!B(this._definition))
|
|
718
719
|
throw new Error("Invalid definition - not an ImageryLayer");
|
|
719
720
|
if (await this._definition.load(), this._source = this._definition, !this._source)
|
|
720
721
|
throw new Error("Invalid definition");
|
|
721
|
-
const e =
|
|
722
|
+
const e = f(this._source) ? this._source.title ?? "" : "";
|
|
722
723
|
this.variables.push(
|
|
723
724
|
new u(this._profile, e, [
|
|
724
725
|
new l({
|
|
@@ -730,39 +731,39 @@ class Le extends $ {
|
|
|
730
731
|
])
|
|
731
732
|
);
|
|
732
733
|
const i = new u(this._profile, { code: "values" });
|
|
733
|
-
if (this.variables.push(i), !
|
|
734
|
+
if (this.variables.push(i), !B(this._source))
|
|
734
735
|
throw new Error("Invalid definition - not an ImageryLayer");
|
|
735
|
-
(await
|
|
736
|
+
(await ce(this._source)).forEach((s) => {
|
|
736
737
|
i.variables.push(this._getMemberProperty(s));
|
|
737
738
|
});
|
|
738
739
|
} catch (e) {
|
|
739
|
-
|
|
740
|
+
h("error", this.type, "Error with definition", { detail: { error: e, definition: this._definition } }), this._source = null;
|
|
740
741
|
} finally {
|
|
741
742
|
this._loaded = !0;
|
|
742
743
|
}
|
|
743
744
|
return this._source;
|
|
744
745
|
}
|
|
745
746
|
}
|
|
746
|
-
class
|
|
747
|
+
class A extends ee {
|
|
747
748
|
constructor(e, i, r = [], s) {
|
|
748
749
|
super(e, i, s), this.featureSetSnippets = r, this.type = "featureSet";
|
|
749
750
|
}
|
|
750
751
|
get title() {
|
|
751
|
-
return
|
|
752
|
+
return f(this._source) ? this._source.title ?? "" : { code: "featureset" };
|
|
752
753
|
}
|
|
753
754
|
async _loadSource() {
|
|
754
755
|
if (this.loaded)
|
|
755
756
|
return this._source;
|
|
756
757
|
try {
|
|
757
|
-
if (this._source = await
|
|
758
|
+
if (this._source = await X(this._definition), !this._source)
|
|
758
759
|
throw new Error("Invalid definition");
|
|
759
760
|
this.variables.push(new u(this._profile, this.title, this.featureSetSnippets, !0));
|
|
760
761
|
const e = new u(this._profile, { code: "fields" });
|
|
761
|
-
this.variables.push(e), e.variables =
|
|
762
|
+
this.variables.push(e), e.variables = w(this._source.fields).sort(I(this._source)).map((r) => this._getFieldProperty(r));
|
|
762
763
|
const i = await this._getRelationshipsProperty();
|
|
763
764
|
i && this.variables.push(i);
|
|
764
765
|
} catch (e) {
|
|
765
|
-
|
|
766
|
+
h("error", this.type, "Error with definition", { detail: { error: e, definition: this._definition } }), this._source = null;
|
|
766
767
|
} finally {
|
|
767
768
|
this._loaded = !0;
|
|
768
769
|
}
|
|
@@ -772,12 +773,12 @@ class L extends Z {
|
|
|
772
773
|
return { type: this.type, name: "", ...this.declaration, definition: this._definition };
|
|
773
774
|
}
|
|
774
775
|
}
|
|
775
|
-
class
|
|
776
|
+
class Ge extends $ {
|
|
776
777
|
constructor(e, i) {
|
|
777
778
|
super(e, i), this.type = "featureSetCollection", this._featureSetCollections = null, this._loaded = !1, this._definition = i.declaration?.definition;
|
|
778
779
|
}
|
|
779
780
|
get informationUrl() {
|
|
780
|
-
return !this.loaded || !this._featureSetCollections ? null : typeof this._featureSetCollections.source != "string" ?
|
|
781
|
+
return !this.loaded || !this._featureSetCollections ? null : typeof this._featureSetCollections.source != "string" ? ie(O(this._featureSetCollections.source)) : null;
|
|
781
782
|
}
|
|
782
783
|
get informationType() {
|
|
783
784
|
if (!this.loaded || !this._featureSetCollections)
|
|
@@ -794,7 +795,7 @@ class Ae extends M {
|
|
|
794
795
|
}
|
|
795
796
|
}
|
|
796
797
|
async loadSource() {
|
|
797
|
-
return
|
|
798
|
+
return v(this._loadPromise) && k(this._loadPromise) ? await this._loadPromise : (this._loadPromise = this._loadSource(), await this._loadPromise);
|
|
798
799
|
}
|
|
799
800
|
async _loadSource() {
|
|
800
801
|
if (this.loaded)
|
|
@@ -805,7 +806,7 @@ class Ae extends M {
|
|
|
805
806
|
const e = typeof this._featureSetCollections.source == "string" ? { code: this._featureSetCollections.source.endsWith("FeatureServer") ? "featureservice" : "mapservice" } : {
|
|
806
807
|
code: "webmapformat",
|
|
807
808
|
formatValues: {
|
|
808
|
-
webMapTitle:
|
|
809
|
+
webMapTitle: O(this._featureSetCollections.source)?.title || "Untitled map"
|
|
809
810
|
}
|
|
810
811
|
}, i = new u(this._profile, e, [
|
|
811
812
|
new l({
|
|
@@ -817,37 +818,37 @@ class Ae extends M {
|
|
|
817
818
|
]), r = new u(this._profile, { code: "layers" }, this._featureSetCollections.layers), s = new u(this._profile, { code: "tables" }, this._featureSetCollections.tables);
|
|
818
819
|
this.variables.push(i, r, s);
|
|
819
820
|
} catch (e) {
|
|
820
|
-
|
|
821
|
+
h("error", this.type, "Error with definition", { detail: { error: e, definition: this._definition } }), this._featureSetCollections = null;
|
|
821
822
|
} finally {
|
|
822
823
|
this._loaded = !0;
|
|
823
824
|
}
|
|
824
825
|
return this._featureSetCollections;
|
|
825
826
|
}
|
|
826
827
|
async _featureSetCollectionsFromDefinition() {
|
|
827
|
-
return this._definition ?
|
|
828
|
+
return this._definition ? K(this._definition) ? await this._featureSetCollectionFromMap(this._definition) : S(this._definition) ? await this._featureSetCollectionFromUrl(this._definition.url) : z(this._definition) ? await this._featureSetCollectionFromPortalItem(this._definition.portalItem) : null : null;
|
|
828
829
|
}
|
|
829
830
|
async _featureSetCollectionFromMap(e) {
|
|
830
|
-
return
|
|
831
|
+
return _e(e) && await e.loadAll(), await Promise.all(e.allTables.map(async (i) => await i.load())), {
|
|
831
832
|
layers: this._convertWebMapLayersToVariables(e.allLayers),
|
|
832
833
|
tables: this._convertWebMapLayersToVariables(e.allTables),
|
|
833
834
|
source: e
|
|
834
835
|
};
|
|
835
836
|
}
|
|
836
837
|
async _featureSetCollectionFromPortalItem(e) {
|
|
837
|
-
const i = new
|
|
838
|
+
const i = new re(e);
|
|
838
839
|
switch (await i.load(), i.type) {
|
|
839
840
|
case "Web Map": {
|
|
840
|
-
const r = new
|
|
841
|
+
const r = new se({ portalItem: i });
|
|
841
842
|
return await this._featureSetCollectionFromMap(r);
|
|
842
843
|
}
|
|
843
844
|
case "Web Scene": {
|
|
844
|
-
const r = new
|
|
845
|
+
const r = new ne({ portalItem: i });
|
|
845
846
|
return await this._featureSetCollectionFromMap(r);
|
|
846
847
|
}
|
|
847
848
|
case "Feature Service":
|
|
848
849
|
return await this._featureSetCollectionFromUrl(i.url);
|
|
849
850
|
default:
|
|
850
|
-
return
|
|
851
|
+
return h("error", this.type, "Unsupported portal item", { detail: { definition: e } }), null;
|
|
851
852
|
}
|
|
852
853
|
}
|
|
853
854
|
async _featureSetCollectionFromUrl(e) {
|
|
@@ -856,12 +857,12 @@ class Ae extends M {
|
|
|
856
857
|
return null;
|
|
857
858
|
const r = await Pe(i), s = Promise.all(
|
|
858
859
|
r.layers.map(async (c) => {
|
|
859
|
-
const p = new
|
|
860
|
+
const p = new g({ url: `${i}/${c.id}` });
|
|
860
861
|
return await p.load(), this._createFeatureSetVariable(p);
|
|
861
862
|
})
|
|
862
863
|
), n = Promise.all(
|
|
863
864
|
r.tables.map(async (c) => {
|
|
864
|
-
const p = new
|
|
865
|
+
const p = new g({ url: `${i}/${c.id}` });
|
|
865
866
|
return await p.load(), this._createFeatureSetVariable(p);
|
|
866
867
|
})
|
|
867
868
|
), [a, o] = await Promise.all([s, n]);
|
|
@@ -870,14 +871,14 @@ class Ae extends M {
|
|
|
870
871
|
_convertWebMapLayersToVariables(e) {
|
|
871
872
|
const i = [];
|
|
872
873
|
return e.toArray().reverse().forEach((r) => {
|
|
873
|
-
if (
|
|
874
|
+
if (q(r)) {
|
|
874
875
|
i.push(this._createFeatureSetVariable(r, !0));
|
|
875
876
|
return;
|
|
876
877
|
}
|
|
877
878
|
}), i;
|
|
878
879
|
}
|
|
879
880
|
_createFeatureSetVariable(e, i = !1) {
|
|
880
|
-
return new
|
|
881
|
+
return new A(
|
|
881
882
|
this,
|
|
882
883
|
{
|
|
883
884
|
profile: this._profile,
|
|
@@ -907,7 +908,7 @@ class Ae extends M {
|
|
|
907
908
|
return { type: this.type, name: "", ...this.declaration, definition: this._definition };
|
|
908
909
|
}
|
|
909
910
|
}
|
|
910
|
-
class
|
|
911
|
+
class lt extends _ {
|
|
911
912
|
constructor(e, i, r = "en") {
|
|
912
913
|
super(void 0, {
|
|
913
914
|
profile: null,
|
|
@@ -931,15 +932,15 @@ class ot extends y {
|
|
|
931
932
|
};
|
|
932
933
|
}
|
|
933
934
|
}
|
|
934
|
-
const
|
|
935
|
+
const Ee = {
|
|
935
936
|
locale: "en"
|
|
936
937
|
};
|
|
937
|
-
class
|
|
938
|
+
class ut {
|
|
938
939
|
// #endregion
|
|
939
940
|
constructor(e, i) {
|
|
940
|
-
this.languageId = e, this._apiConfig = i, this._onDidChange = new
|
|
941
|
+
this.languageId = e, this._apiConfig = i, this._onDidChange = new E(), this._modelToProfileMap = /* @__PURE__ */ new Map(), this._modelToApiContextMap = /* @__PURE__ */ new Map(), this._localeToApiLibraryPromiseMap = /* @__PURE__ */ new Map(), this._onModelContextDidChange = new E(), this._onDidModelContextChangeTimeout = -1, this.workerHost = {
|
|
941
942
|
getApiLibrary: async (r) => await this.getApiLibrary(r)
|
|
942
|
-
},
|
|
943
|
+
}, he().then((r) => {
|
|
943
944
|
r.onWillDisposeModel((s) => {
|
|
944
945
|
this.disposeForModel(s.uri);
|
|
945
946
|
});
|
|
@@ -952,7 +953,7 @@ class at {
|
|
|
952
953
|
}, 0));
|
|
953
954
|
}
|
|
954
955
|
_getApiKey(e) {
|
|
955
|
-
return
|
|
956
|
+
return j.isUri(e) || (e = j.parse(e)), e.toString();
|
|
956
957
|
}
|
|
957
958
|
// #endregion
|
|
958
959
|
// #region Public methods
|
|
@@ -981,7 +982,7 @@ class at {
|
|
|
981
982
|
* @returns The API context for the model.
|
|
982
983
|
*/
|
|
983
984
|
getApiContextForModel(e) {
|
|
984
|
-
return this._modelToApiContextMap.get(this._getApiKey(e)) ??
|
|
985
|
+
return this._modelToApiContextMap.get(this._getApiKey(e)) ?? Ee;
|
|
985
986
|
}
|
|
986
987
|
/**
|
|
987
988
|
* Set or update api context for the given model id.
|
|
@@ -1002,34 +1003,34 @@ class at {
|
|
|
1002
1003
|
*/
|
|
1003
1004
|
async getApiLibraryForModel(e) {
|
|
1004
1005
|
const i = this.getApiContextForModel(e), r = this.getApiLibrary(i.locale ?? "en");
|
|
1005
|
-
return (await
|
|
1006
|
+
return (await ye(r, i)).categories;
|
|
1006
1007
|
}
|
|
1007
1008
|
// #endregion
|
|
1008
1009
|
//#region Private methods
|
|
1009
1010
|
async fetchApiLibrary(e) {
|
|
1010
1011
|
try {
|
|
1011
|
-
const { apiPath: i, apiPrefix: r } = this._apiConfig, s =
|
|
1012
|
+
const { apiPath: i, apiPrefix: r } = this._apiConfig, s = fe(`${i}/${r}${e}.json`), n = await fetch(s);
|
|
1012
1013
|
return n.ok ? await n.json() : [];
|
|
1013
1014
|
} catch {
|
|
1014
1015
|
return [];
|
|
1015
1016
|
}
|
|
1016
1017
|
}
|
|
1017
1018
|
async getApiLibrary(e) {
|
|
1018
|
-
const i =
|
|
1019
|
+
const i = de(e);
|
|
1019
1020
|
return this._localeToApiLibraryPromiseMap.has(i) || this._localeToApiLibraryPromiseMap.set(i, this.fetchApiLibrary(i)), await this._localeToApiLibraryPromiseMap.get(i) ?? [];
|
|
1020
1021
|
}
|
|
1021
1022
|
// #endregion
|
|
1022
1023
|
}
|
|
1023
1024
|
export {
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1025
|
+
lt as E,
|
|
1026
|
+
ut as L,
|
|
1027
|
+
rt as a,
|
|
1028
|
+
q as b,
|
|
1029
|
+
st as c,
|
|
1030
|
+
tt as d,
|
|
1031
|
+
it as e,
|
|
1032
|
+
ot as f,
|
|
1033
|
+
J as g,
|
|
1034
|
+
nt as i,
|
|
1035
|
+
at as m
|
|
1035
1036
|
};
|