@arcgis/portal-components 5.2.0-next.160 → 5.2.0-next.162
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/{NICTB76A.js → 2DIAUHE5.js} +1 -1
- package/dist/cdn/{5GTO7PTH.js → 2IKXUDFM.js} +1 -1
- package/dist/cdn/{MSO7PIO4.js → 2IRP3ZVE.js} +1 -1
- package/dist/cdn/{XKC6SPS4.js → 3HINDHV7.js} +1 -1
- package/dist/cdn/{USGROSML.js → 3NTQM2R7.js} +1 -1
- package/dist/cdn/{55FL7WQV.js → 3PK47DQP.js} +1 -1
- package/dist/cdn/{K6PWSEML.js → 3TLHOVLW.js} +1 -1
- package/dist/cdn/3ZHDGFSL.js +2 -0
- package/dist/cdn/42VKNALC.js +2 -0
- package/dist/cdn/453JLSJV.js +2 -0
- package/dist/cdn/{FAOIT32R.js → 4YPPX4Y3.js} +1 -1
- package/dist/cdn/{RT6SXACX.js → 4Z7OQ6QY.js} +1 -1
- package/dist/cdn/{D7LRCAK4.js → 53GR4QVG.js} +1 -1
- package/dist/cdn/57DQMVPP.js +2 -0
- package/dist/cdn/{REJN2DGR.js → 5CBXYHFU.js} +1 -1
- package/dist/cdn/{JDUO5LCR.js → 64QA6IBU.js} +1 -1
- package/dist/cdn/66MA5EIA.js +2 -0
- package/dist/cdn/{LTC6K4DZ.js → 6RAOSMME.js} +1 -1
- package/dist/cdn/{S5HIKMGQ.js → 6VTAWA6R.js} +1 -1
- package/dist/cdn/74XEOQEV.js +2 -0
- package/dist/cdn/765N2BRQ.js +2 -0
- package/dist/cdn/{UTA2UBBS.js → 7D7RSVSQ.js} +1 -1
- package/dist/cdn/{TMG43PBB.js → AARKDW3L.js} +1 -1
- package/dist/cdn/{DIKRXF22.js → BFYTNFAM.js} +1 -1
- package/dist/cdn/{QU2JYXVL.js → BKU43GE5.js} +1 -1
- package/dist/cdn/{KIKEE2KY.js → C3W4HTWD.js} +1 -1
- package/dist/cdn/{KYNL256E.js → C7NJCXTN.js} +1 -1
- package/dist/cdn/CKEGCEEU.js +2 -0
- package/dist/cdn/{V5YXPHYD.js → CWGXNX3W.js} +1 -1
- package/dist/cdn/{RUTSKSEA.js → DITALHT7.js} +1 -1
- package/dist/cdn/{MC3LJZSI.js → EL5IQDXK.js} +1 -1
- package/dist/cdn/{SG7Z5VLB.js → EX5JJTWQ.js} +1 -1
- package/dist/cdn/{LNWWUPFK.js → FD7SPNGP.js} +1 -1
- package/dist/cdn/{3D3X4POQ.js → FZUEX6YH.js} +1 -1
- package/dist/cdn/{EEGDBRHR.js → GTD6FUPM.js} +1 -1
- package/dist/cdn/{VDOEP33G.js → HCCPATGO.js} +1 -1
- package/dist/cdn/{MFJVE4UZ.js → HOWXDT3E.js} +1 -1
- package/dist/cdn/HT4JMB5R.js +2 -0
- package/dist/cdn/HTTYI276.js +2 -0
- package/dist/cdn/{MQISQ7P3.js → HWDSHH76.js} +1 -1
- package/dist/cdn/HXDTSREX.js +2 -0
- package/dist/cdn/I7NJ6E6I.js +2 -0
- package/dist/cdn/{BLCHSMT7.js → IJLJOGU3.js} +1 -1
- package/dist/cdn/J4M77DLV.js +2 -0
- package/dist/cdn/JI63K67U.js +2 -0
- package/dist/cdn/{33J7647P.js → JIWLTMFC.js} +1 -1
- package/dist/cdn/{6BMWSGLA.js → K3ROLJNC.js} +1 -1
- package/dist/cdn/{WDMKBY5P.js → K4LOZYJF.js} +1 -1
- package/dist/cdn/{OUFIJDIW.js → KLQ5GKNI.js} +1 -1
- package/dist/cdn/{4NM7IXBT.js → KQEU5AFO.js} +1 -1
- package/dist/cdn/{FUCC4ZHI.js → LU7EPIPR.js} +1 -1
- package/dist/cdn/{7NQY5QJK.js → M6AFYDDU.js} +1 -1
- package/dist/cdn/{OQGUCK3G.js → MEBV5YAO.js} +1 -1
- package/dist/cdn/{TAREB43U.js → MOJGAOYF.js} +1 -1
- package/dist/cdn/{V2OG75CK.js → MTY2ZUR2.js} +1 -1
- package/dist/cdn/{RBGARTND.js → MXL2BB47.js} +1 -1
- package/dist/cdn/{EL6F7I65.js → NKRXJF72.js} +1 -1
- package/dist/cdn/{SKVSGN5R.js → O6KBOBTA.js} +1 -1
- package/dist/cdn/{OV5O7YP4.js → OUZPGGZR.js} +1 -1
- package/dist/cdn/{2QH66WX5.js → P2XPGJIH.js} +1 -1
- package/dist/cdn/{YJS5PGLO.js → P5WD6JVL.js} +1 -1
- package/dist/cdn/{OV4DNSQV.js → PGVE7V53.js} +1 -1
- package/dist/cdn/PLGWH6LA.js +2 -0
- package/dist/cdn/PO54NFLO.js +2 -0
- package/dist/cdn/{3WHDCXCM.js → PPHEHA5I.js} +3 -3
- package/dist/cdn/{QVMZCD3A.js → PS5BTYGD.js} +1 -1
- package/dist/cdn/{UGRFT75G.js → Q53MAFDQ.js} +1 -1
- package/dist/cdn/{D6SIWTME.js → QQ6MQPCH.js} +1 -1
- package/dist/cdn/{A3MNR4AI.js → QS53VF2B.js} +1 -1
- package/dist/cdn/{2XTCMELJ.js → RAAM3NQL.js} +1 -1
- package/dist/cdn/{AQBDDI5G.js → RVZXDXUC.js} +1 -1
- package/dist/cdn/S62RRECO.js +2 -0
- package/dist/cdn/{YEMT55I6.js → S6R4ZQPM.js} +1 -1
- package/dist/cdn/{FQYC25GN.js → SFNAWLR5.js} +1 -1
- package/dist/cdn/{F575CWKZ.js → SOLQD7DU.js} +1 -1
- package/dist/cdn/{PJGJZYBY.js → ST7YCKG6.js} +1 -1
- package/dist/cdn/{JDIMTYM2.js → TA456NXC.js} +1 -1
- package/dist/cdn/{ADZAKBOJ.js → TFGNQADN.js} +1 -1
- package/dist/cdn/TNNIKT2R.js +2 -0
- package/dist/cdn/{456JKNCU.js → UANMZWU3.js} +1 -1
- package/dist/cdn/UC42OQDP.js +2 -0
- package/dist/cdn/{WPZ5FJSC.js → UCE5G5TL.js} +1 -1
- package/dist/cdn/{7EOHRU5A.js → UQSYMUOF.js} +1 -1
- package/dist/cdn/URZI7SU4.js +2 -0
- package/dist/cdn/{WXD774JG.js → V4XGNCNI.js} +1 -1
- package/dist/cdn/{CWSEBETE.js → VAFMKDDD.js} +1 -1
- package/dist/cdn/VSNBZIZ4.js +2 -0
- package/dist/cdn/{CVOWIH4J.js → W3UGJC24.js} +1 -1
- package/dist/cdn/{VMQIDO4Z.js → WNDPRHBO.js} +1 -1
- package/dist/cdn/{BQZ34JPU.js → X4E3B7EQ.js} +1 -1
- package/dist/cdn/{X4LJOMMF.js → XGRVBCMF.js} +1 -1
- package/dist/cdn/XRF3NMPE.js +2 -0
- package/dist/cdn/XYH7L6WW.js +2 -0
- package/dist/cdn/XYZFL54V.js +2 -0
- package/dist/cdn/{23X56P4K.js → Y2EJ24EM.js} +1 -1
- package/dist/cdn/{7G7MPSXD.js → ZYZ3EIB7.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/functionalities.js +14 -8
- package/dist/components/arcgis-portal-account-switcher/customElement.js +1 -1
- package/dist/components/arcgis-portal-add-gps-metadata/customElement.js +145 -124
- package/dist/components/arcgis-portal-delete-items/customElement.js +151 -158
- package/dist/components/arcgis-portal-delete-items/index.js +1 -1
- 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 +7 -7
- package/dist/cdn/24PB4CMZ.js +0 -2
- package/dist/cdn/2GBRZSEC.js +0 -2
- package/dist/cdn/3SRD2O7D.js +0 -2
- package/dist/cdn/7GHMHFBI.js +0 -2
- package/dist/cdn/AOZUSTFQ.js +0 -2
- package/dist/cdn/BYWI4K4N.js +0 -2
- package/dist/cdn/FORXD2BX.js +0 -2
- package/dist/cdn/FQOOFBPI.js +0 -2
- package/dist/cdn/GQ72VSNC.js +0 -2
- package/dist/cdn/HJE457T5.js +0 -2
- package/dist/cdn/IFN5ZRZD.js +0 -2
- package/dist/cdn/LCQW3IG6.js +0 -2
- package/dist/cdn/LX4CTYFB.js +0 -2
- package/dist/cdn/NUEXG7VJ.js +0 -2
- package/dist/cdn/PRIG3TBV.js +0 -2
- package/dist/cdn/Q6BRXAQD.js +0 -2
- package/dist/cdn/QBV7VDQK.js +0 -2
- package/dist/cdn/R54T4WBW.js +0 -2
- package/dist/cdn/S5J33LIC.js +0 -2
- package/dist/cdn/UETPYEHR.js +0 -2
- package/dist/cdn/V77BFG3A.js +0 -2
- package/dist/cdn/V7GVZLEG.js +0 -2
- package/dist/cdn/WDUH4TEH.js +0 -2
- package/dist/cdn/YGF6ENPU.js +0 -2
- /package/dist/cdn/{R74ZHFA6.js → JMA56SOB.js} +0 -0
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const
|
|
3
|
-
throw new Error(`Unexpected value: ${
|
|
4
|
-
}, a = async (
|
|
5
|
-
await new Promise((
|
|
6
|
-
},
|
|
2
|
+
const n = (t) => {
|
|
3
|
+
throw new Error(`Unexpected value: ${t}`);
|
|
4
|
+
}, a = async (t) => {
|
|
5
|
+
await new Promise((e) => setTimeout(e, t));
|
|
6
|
+
}, o = async (t, e = 10) => {
|
|
7
|
+
for (let s = 0; s < e; s++)
|
|
8
|
+
if (s > 0 && await a(500 * 2 ** Math.floor((s - 1) / 2)), await t())
|
|
9
|
+
return !0;
|
|
10
|
+
return !1;
|
|
11
|
+
}, r = (t, e) => t.includes(e), i = (t) => Object.keys(t);
|
|
7
12
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
n as a,
|
|
14
|
+
i as b,
|
|
15
|
+
r as i,
|
|
16
|
+
o as p,
|
|
11
17
|
a as t
|
|
12
18
|
};
|
|
@@ -346,7 +346,7 @@ class ee extends T {
|
|
|
346
346
|
const { portal: s, user: t, clientId: i } = this;
|
|
347
347
|
if (!s || !t || !e)
|
|
348
348
|
return;
|
|
349
|
-
const n = h(t.sourceJSON.orgUrlKey ?? "", s), a = p.findCredential(n, t.
|
|
349
|
+
const n = h(t.sourceJSON.orgUrlKey ?? "", s), a = p.findCredential(n, t.username);
|
|
350
350
|
a && U({ config: { baseUrl: n, restBaseUrl: `${n}/sharing/rest` }, token: a?.token, clientId: i }), F(e, s, i);
|
|
351
351
|
}
|
|
352
352
|
signoutAll(e) {
|
|
@@ -1,58 +1,59 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import { css as
|
|
7
|
-
import { u as
|
|
8
|
-
import
|
|
9
|
-
import { r as
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import { c as S } from "../../chunks/runtime.js";
|
|
3
|
+
import v from "@arcgis/core/layers/Layer.js";
|
|
4
|
+
import I from "@arcgis/core/portal/PortalItem.js";
|
|
5
|
+
import { LitElement as C, createEvent as f } from "@arcgis/lumina";
|
|
6
|
+
import { css as L, html as m } from "lit";
|
|
7
|
+
import { u as A } from "../../chunks/useT9n.js";
|
|
8
|
+
import g from "@arcgis/core/request.js";
|
|
9
|
+
import { r as O } from "../../chunks/request.js";
|
|
10
|
+
import { p as z } from "../../chunks/functionalities.js";
|
|
11
|
+
const w = L`:host{background-color:var(--calcite-color-foreground-1)}.scrim-container{position:relative}.base-fields-control{margin-inline-end:.75rem}.added{display:inline-flex;gap:.5rem;flex-shrink:0;white-space:nowrap}.added calcite-icon{color:var(--calcite-color-status-success)}.add-fields-button{margin:.75rem 0}calcite-block{border-bottom:0}calcite-list-item:last-child:after{display:block;margin-inline-start:var(--calcite-spacing-md);border-block-end:1px solid var(--calcite-list-border-color, var(--calcite-color-border-3));content:""}`;
|
|
12
|
+
async function b({
|
|
12
13
|
item: s,
|
|
13
14
|
layers: e
|
|
14
15
|
}) {
|
|
15
|
-
const { url:
|
|
16
|
-
if (!
|
|
17
|
-
return { result:
|
|
16
|
+
const { url: t } = s, l = /* @__PURE__ */ new Map();
|
|
17
|
+
if (!t)
|
|
18
|
+
return { result: l };
|
|
18
19
|
try {
|
|
19
|
-
const i = (await
|
|
20
|
+
const i = (await g(t, {
|
|
20
21
|
cacheBust: !0,
|
|
21
22
|
query: { f: "json" },
|
|
22
23
|
responseType: "json"
|
|
23
24
|
})).data;
|
|
24
25
|
if (i.fields) {
|
|
25
26
|
const n = e?.[0];
|
|
26
|
-
return e?.length === 1 && n?.layerId != null &&
|
|
27
|
+
return e?.length === 1 && n?.layerId != null && l.set(n.layerId, i.fields), { result: l };
|
|
27
28
|
}
|
|
28
29
|
if (!i.layers?.length)
|
|
29
|
-
return { result:
|
|
30
|
-
const
|
|
30
|
+
return { result: l };
|
|
31
|
+
const a = t.replace(/\/$/u, "");
|
|
31
32
|
return await Promise.all(
|
|
32
33
|
i.layers.map(async ({ id: n }) => {
|
|
33
|
-
const r = (await
|
|
34
|
+
const r = (await g(`${a}/${n}`, {
|
|
34
35
|
cacheBust: !0,
|
|
35
36
|
query: { f: "json" },
|
|
36
37
|
responseType: "json"
|
|
37
38
|
})).data;
|
|
38
|
-
|
|
39
|
+
l.set(n, r.fields ?? []);
|
|
39
40
|
})
|
|
40
|
-
), { result:
|
|
41
|
+
), { result: l };
|
|
41
42
|
} catch (i) {
|
|
42
43
|
return console.error("Error getting layer fields:", i), { error: { code: "unhandledError" } };
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
|
-
const
|
|
46
|
+
const P = (s) => {
|
|
46
47
|
const { url: e } = s;
|
|
47
48
|
return e ? e.replace("/rest/services", "/rest/admin/services").replace(/\/$/u, "") : null;
|
|
48
49
|
};
|
|
49
|
-
async function
|
|
50
|
+
async function x({
|
|
50
51
|
fields: s,
|
|
51
52
|
item: e,
|
|
52
|
-
portal:
|
|
53
|
-
layerId:
|
|
53
|
+
portal: t,
|
|
54
|
+
layerId: l
|
|
54
55
|
}) {
|
|
55
|
-
const i =
|
|
56
|
+
const i = P(e);
|
|
56
57
|
if (!i)
|
|
57
58
|
return {
|
|
58
59
|
error: {
|
|
@@ -61,35 +62,35 @@ async function I({
|
|
|
61
62
|
}
|
|
62
63
|
};
|
|
63
64
|
try {
|
|
64
|
-
const
|
|
65
|
-
url: `${i}/${
|
|
66
|
-
portal:
|
|
65
|
+
const a = await O({
|
|
66
|
+
url: `${i}/${l != null ? `${l}/` : ""}addToDefinition`,
|
|
67
|
+
portal: t,
|
|
67
68
|
method: "post",
|
|
68
69
|
params: {
|
|
69
70
|
addToDefinition: JSON.stringify({ fields: s })
|
|
70
71
|
}
|
|
71
72
|
});
|
|
72
|
-
return
|
|
73
|
+
return a.success === !1 || a.error ? {
|
|
73
74
|
error: {
|
|
74
75
|
code: "unhandledError",
|
|
75
|
-
message:
|
|
76
|
+
message: a.error?.message
|
|
76
77
|
}
|
|
77
|
-
} : { result:
|
|
78
|
-
} catch (
|
|
79
|
-
return console.error("Error adding fields to the feature service definition:",
|
|
78
|
+
} : { result: a };
|
|
79
|
+
} catch (a) {
|
|
80
|
+
return console.error("Error adding fields to the feature service definition:", a), {
|
|
80
81
|
error: {
|
|
81
82
|
code: "unhandledError"
|
|
82
83
|
}
|
|
83
84
|
};
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
|
-
async function
|
|
87
|
+
async function G({
|
|
87
88
|
fields: s,
|
|
88
89
|
item: e,
|
|
89
|
-
portal:
|
|
90
|
-
layerId:
|
|
90
|
+
portal: t,
|
|
91
|
+
layerId: l
|
|
91
92
|
}) {
|
|
92
|
-
const i =
|
|
93
|
+
const i = P(e);
|
|
93
94
|
if (!i)
|
|
94
95
|
return {
|
|
95
96
|
error: {
|
|
@@ -98,61 +99,61 @@ async function C({
|
|
|
98
99
|
}
|
|
99
100
|
};
|
|
100
101
|
try {
|
|
101
|
-
const
|
|
102
|
-
url: `${i}/${
|
|
103
|
-
portal:
|
|
102
|
+
const a = await O({
|
|
103
|
+
url: `${i}/${l != null ? `${l}/` : ""}updateDefinition`,
|
|
104
|
+
portal: t,
|
|
104
105
|
method: "post",
|
|
105
106
|
params: {
|
|
106
107
|
updateDefinition: JSON.stringify({ fields: s })
|
|
107
108
|
}
|
|
108
109
|
});
|
|
109
|
-
return
|
|
110
|
+
return a.success === !1 || a.error ? {
|
|
110
111
|
error: {
|
|
111
112
|
code: "unhandledError",
|
|
112
|
-
message:
|
|
113
|
+
message: a.error?.message ?? "Failed to update the feature service definition."
|
|
113
114
|
}
|
|
114
|
-
} : { result:
|
|
115
|
-
} catch (
|
|
116
|
-
return console.error("Error updating the feature service definition:",
|
|
115
|
+
} : { result: a };
|
|
116
|
+
} catch (a) {
|
|
117
|
+
return console.error("Error updating the feature service definition:", a), {
|
|
117
118
|
error: {
|
|
118
119
|
code: "unhandledError"
|
|
119
120
|
}
|
|
120
121
|
};
|
|
121
122
|
}
|
|
122
123
|
}
|
|
123
|
-
async function
|
|
124
|
+
async function R(s) {
|
|
124
125
|
const { url: e } = s;
|
|
125
126
|
if (!e)
|
|
126
127
|
return { error: { code: "unhandledError" } };
|
|
127
128
|
try {
|
|
128
|
-
return { result: (await
|
|
129
|
-
} catch (
|
|
130
|
-
return console.error("Error getting service info:",
|
|
129
|
+
return { result: (await g(e, { query: { f: "json" } })).data };
|
|
130
|
+
} catch (t) {
|
|
131
|
+
return console.error("Error getting service info:", t), { error: { code: "unhandledError" } };
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
|
-
const
|
|
134
|
-
const
|
|
135
|
-
return
|
|
136
|
-
({ code: i, name:
|
|
137
|
-
) :
|
|
138
|
-
},
|
|
139
|
-
const
|
|
140
|
-
for (const
|
|
141
|
-
const n =
|
|
142
|
-
n ?
|
|
134
|
+
const E = (s, e) => {
|
|
135
|
+
const t = s.domain ?? null, l = e.domain ?? null;
|
|
136
|
+
return t === null || l === null ? t === l : t.type !== l.type ? !1 : t.type === "codedValue" && l.type === "codedValue" ? t.codedValues.length === l.codedValues.length && t.codedValues.every(
|
|
137
|
+
({ code: i, name: a }, n) => i === l.codedValues[n]?.code && a === l.codedValues[n]?.name
|
|
138
|
+
) : t.type === "range" && l.type === "range" ? t.range[0] === l.range[0] && t.range[1] === l.range[1] : !0;
|
|
139
|
+
}, N = (s, e) => {
|
|
140
|
+
const t = new Map(e.map((a) => [a.name, a])), l = [], i = [];
|
|
141
|
+
for (const a of s) {
|
|
142
|
+
const n = t.get(a.name);
|
|
143
|
+
n ? E(a, n) || i.push({ name: a.name, domain: a.domain }) : l.push(a);
|
|
143
144
|
}
|
|
144
|
-
return { missingFields:
|
|
145
|
-
},
|
|
145
|
+
return { missingFields: l, modifiedFields: i };
|
|
146
|
+
}, M = (s) => {
|
|
146
147
|
switch (s) {
|
|
147
148
|
case "esriGeometryPolyline":
|
|
148
149
|
case "esriGeometryPolygon":
|
|
149
|
-
return [...
|
|
150
|
+
return [...k];
|
|
150
151
|
case "esriGeometryPoint":
|
|
151
|
-
return [
|
|
152
|
+
return [...$];
|
|
152
153
|
default:
|
|
153
154
|
return [];
|
|
154
155
|
}
|
|
155
|
-
},
|
|
156
|
+
}, _ = (s) => s === "esriGeometryPoint" ? [...B] : [], F = (s) => s === "esriGeometryPoint" ? [...U] : [], k = [
|
|
156
157
|
{
|
|
157
158
|
name: "esrignss_avg_h_rms",
|
|
158
159
|
type: "esriFieldTypeDouble",
|
|
@@ -224,7 +225,7 @@ const A = (s, e) => {
|
|
|
224
225
|
domain: null,
|
|
225
226
|
defaultValue: null
|
|
226
227
|
}
|
|
227
|
-
],
|
|
228
|
+
], $ = [
|
|
228
229
|
{
|
|
229
230
|
name: "esrignss_speed",
|
|
230
231
|
type: "esriFieldTypeDouble",
|
|
@@ -635,7 +636,7 @@ const A = (s, e) => {
|
|
|
635
636
|
domain: null,
|
|
636
637
|
defaultValue: null
|
|
637
638
|
}
|
|
638
|
-
],
|
|
639
|
+
], B = [
|
|
639
640
|
{
|
|
640
641
|
name: "esrisnsr_tilt_azimuth_accuracy",
|
|
641
642
|
type: "esriFieldTypeDouble",
|
|
@@ -693,7 +694,7 @@ const A = (s, e) => {
|
|
|
693
694
|
},
|
|
694
695
|
defaultValue: null
|
|
695
696
|
}
|
|
696
|
-
],
|
|
697
|
+
], U = [
|
|
697
698
|
{
|
|
698
699
|
name: "esrignss_cp1_latitude",
|
|
699
700
|
type: "esriFieldTypeDouble",
|
|
@@ -1182,64 +1183,67 @@ const A = (s, e) => {
|
|
|
1182
1183
|
defaultValue: null
|
|
1183
1184
|
}
|
|
1184
1185
|
];
|
|
1185
|
-
function
|
|
1186
|
+
function K(s) {
|
|
1186
1187
|
if (s.geometryType === "polyline" || s.geometryType === "polygon") {
|
|
1187
1188
|
const e = s.capabilities;
|
|
1188
1189
|
return e?.data?.supportsAttachment && e?.operations?.supportsQueryAttachments;
|
|
1189
1190
|
}
|
|
1190
1191
|
return !0;
|
|
1191
1192
|
}
|
|
1192
|
-
const
|
|
1193
|
-
class
|
|
1193
|
+
const Y = (s) => s.every(K), H = ["point", "polyline", "polygon"], q = (s) => s?.type === "Feature Service";
|
|
1194
|
+
class j extends C {
|
|
1194
1195
|
constructor() {
|
|
1195
|
-
super(...arguments), this.messages =
|
|
1196
|
+
super(...arguments), this.messages = A({ blocking: !0 }), this.initCount = 0, this.supportsAttachments = !1, this.layersLoaded = !1, this.pointLayers = [], this.lineOrPolygonLayers = [], this.loadedItem = null, this.gpsFieldFixesBySet = null, this.addFieldsDisabled = !0, this.initializing = !0, this.hasLineOrPolygonLayer = !1, this.hasPointFeatureLayer = !1, this.addingGPSFieldMetadata = [], this.item = null, this.itemId = null, this.messageOverrides = {}, this.arcgisGPSMetadataFieldsAdded = f(), this.arcgisReadOnlyMode = f();
|
|
1196
1197
|
}
|
|
1197
1198
|
static {
|
|
1198
1199
|
this.properties = { loadedItem: 16, gpsFieldFixesBySet: 16, addFieldsDisabled: 16, initializing: 16, hasLineOrPolygonLayer: 16, hasPointFeatureLayer: 16, addingGPSFieldMetadata: 16, item: 0, itemId: 1, portal: 0, messageOverrides: 0 };
|
|
1199
1200
|
}
|
|
1200
1201
|
static {
|
|
1201
|
-
this.styles =
|
|
1202
|
+
this.styles = w;
|
|
1203
|
+
}
|
|
1204
|
+
connectedCallback() {
|
|
1205
|
+
super.connectedCallback(), this.hasUpdated && this.initItem();
|
|
1202
1206
|
}
|
|
1203
1207
|
willUpdate(e) {
|
|
1204
1208
|
(e.has("item") || e.has("itemId")) && this.initItem();
|
|
1205
1209
|
}
|
|
1206
1210
|
async initItem({ showLoading: e = !0 } = {}) {
|
|
1207
|
-
const
|
|
1211
|
+
const t = ++this.initCount;
|
|
1208
1212
|
if (!this.item && !this.itemId) {
|
|
1209
1213
|
this.resetItemState(), this.initializing = !1;
|
|
1210
1214
|
return;
|
|
1211
1215
|
}
|
|
1212
1216
|
e && (this.resetItemState(), this.initializing = !0);
|
|
1213
|
-
const { item:
|
|
1217
|
+
const { item: l, itemId: i, portal: a } = this, n = l ? await l.load() : await new I({
|
|
1214
1218
|
id: i,
|
|
1215
|
-
portal:
|
|
1219
|
+
portal: a
|
|
1216
1220
|
}).load();
|
|
1217
|
-
if (!this.isCurrentInitialization(
|
|
1221
|
+
if (!this.isCurrentInitialization(t))
|
|
1218
1222
|
return;
|
|
1219
|
-
if (!
|
|
1223
|
+
if (!q(n)) {
|
|
1220
1224
|
this.resetItemState(), this.initializing = !1;
|
|
1221
1225
|
return;
|
|
1222
1226
|
}
|
|
1223
1227
|
this.loadedItem = n;
|
|
1224
|
-
const r = !e && this.layersLoaded ? [...this.pointLayers, ...this.lineOrPolygonLayers] : await this.getFeatureLayers(n), { result:
|
|
1225
|
-
if (!this.isCurrentInitialization(
|
|
1228
|
+
const r = !e && this.layersLoaded ? [...this.pointLayers, ...this.lineOrPolygonLayers] : await this.getFeatureLayers(n), { result: p } = await R(n);
|
|
1229
|
+
if (!this.isCurrentInitialization(t))
|
|
1226
1230
|
return;
|
|
1227
1231
|
this.layersLoaded = !0, this.pointLayers = r.filter((d) => d.geometryType === "point"), this.lineOrPolygonLayers = r.filter((d) => d.geometryType === "polyline" || d.geometryType === "polygon"), this.hasLineOrPolygonLayer = r.some((d) => d.geometryType === "polyline" || d.geometryType === "polygon"), this.hasPointFeatureLayer = r.some((d) => d.geometryType === "point");
|
|
1228
|
-
const { result: o, error:
|
|
1229
|
-
if (!this.isCurrentInitialization(
|
|
1232
|
+
const { result: o, error: h } = r.length > 0 ? await b({ item: n, layers: r }) : {};
|
|
1233
|
+
if (!this.isCurrentInitialization(t))
|
|
1230
1234
|
return;
|
|
1231
|
-
if (
|
|
1235
|
+
if (h) {
|
|
1232
1236
|
this.resetItemState(), this.initializing = !1;
|
|
1233
1237
|
return;
|
|
1234
1238
|
}
|
|
1235
|
-
const
|
|
1239
|
+
const y = o ?? /* @__PURE__ */ new Map();
|
|
1236
1240
|
this.gpsFieldFixesBySet = {
|
|
1237
|
-
base: this.analyzeFieldSet([...this.pointLayers, ...this.lineOrPolygonLayers],
|
|
1238
|
-
gnss: this.analyzeFieldSet(this.pointLayers,
|
|
1239
|
-
rangefinder: this.analyzeFieldSet(this.pointLayers,
|
|
1240
|
-
}, this.supportsAttachments =
|
|
1241
|
-
const
|
|
1242
|
-
this.addFieldsDisabled = !this.supportsAttachments || !
|
|
1241
|
+
base: this.analyzeFieldSet([...this.pointLayers, ...this.lineOrPolygonLayers], y, "base"),
|
|
1242
|
+
gnss: this.analyzeFieldSet(this.pointLayers, y, "gnss"),
|
|
1243
|
+
rangefinder: this.analyzeFieldSet(this.pointLayers, y, "rangefinder")
|
|
1244
|
+
}, this.supportsAttachments = Y(r);
|
|
1245
|
+
const T = p?.sourceSchemaChangesAllowed !== !1;
|
|
1246
|
+
this.addFieldsDisabled = !this.supportsAttachments || !T, this.initializing = !1;
|
|
1243
1247
|
}
|
|
1244
1248
|
isCurrentInitialization(e) {
|
|
1245
1249
|
return e === this.initCount;
|
|
@@ -1248,11 +1252,11 @@ class k extends P {
|
|
|
1248
1252
|
this.loadedItem = null, this.layersLoaded = !1, this.pointLayers = [], this.lineOrPolygonLayers = [], this.gpsFieldFixesBySet = null, this.addFieldsDisabled = !0, this.hasLineOrPolygonLayer = !1, this.hasPointFeatureLayer = !1;
|
|
1249
1253
|
}
|
|
1250
1254
|
async getFeatureLayers(e) {
|
|
1251
|
-
const
|
|
1252
|
-
return await
|
|
1255
|
+
const t = await v.fromPortalItem({ portalItem: e });
|
|
1256
|
+
return await t.load(), "layers" in t ? (await Promise.all(t.layers.map(async (i) => (await i.load(), this.isSupportedFeatureLayer(i) ? i : null)))).filter((i) => !!i) : this.isSupportedFeatureLayer(t) ? [t] : [];
|
|
1253
1257
|
}
|
|
1254
1258
|
isSupportedFeatureLayer(e) {
|
|
1255
|
-
return e.type === "feature" &&
|
|
1259
|
+
return e.type === "feature" && H.some((t) => t === e.geometryType);
|
|
1256
1260
|
}
|
|
1257
1261
|
getCompatibleEsriGeometryType(e) {
|
|
1258
1262
|
switch (e.geometryType) {
|
|
@@ -1266,14 +1270,14 @@ class k extends P {
|
|
|
1266
1270
|
return null;
|
|
1267
1271
|
}
|
|
1268
1272
|
}
|
|
1269
|
-
analyzeFieldSet(e,
|
|
1273
|
+
analyzeFieldSet(e, t, l) {
|
|
1270
1274
|
const i = [];
|
|
1271
|
-
for (const
|
|
1272
|
-
if (
|
|
1275
|
+
for (const a of e) {
|
|
1276
|
+
if (a.layerId == null)
|
|
1273
1277
|
continue;
|
|
1274
|
-
const n =
|
|
1278
|
+
const n = t.get(a.layerId) ?? [], r = this.getCompatibleEsriGeometryType(a), p = r ? l === "base" ? M(r) : l === "gnss" ? _(r) : F(r) : [], o = N(p, n);
|
|
1275
1279
|
(o.missingFields.length > 0 || o.modifiedFields.length > 0) && i.push({
|
|
1276
|
-
layerId:
|
|
1280
|
+
layerId: a.layerId,
|
|
1277
1281
|
fieldsToAdd: o.missingFields,
|
|
1278
1282
|
domainsToUpdate: o.modifiedFields
|
|
1279
1283
|
});
|
|
@@ -1287,46 +1291,63 @@ class k extends P {
|
|
|
1287
1291
|
return this.addingGPSFieldMetadata.includes(e);
|
|
1288
1292
|
}
|
|
1289
1293
|
async addFields(e) {
|
|
1290
|
-
const
|
|
1291
|
-
if (!
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
+
const t = this.portal ?? this.loadedItem?.portal, l = this.loadedItem, i = this.gpsFieldFixesBySet;
|
|
1295
|
+
if (!t || !l || !i)
|
|
1296
|
+
return;
|
|
1297
|
+
if (t.isReadOnly) {
|
|
1298
|
+
this.arcgisReadOnlyMode.emit();
|
|
1299
|
+
return;
|
|
1300
|
+
}
|
|
1301
|
+
this.addingGPSFieldMetadata = [...this.addingGPSFieldMetadata, e];
|
|
1302
|
+
const a = [...this.pointLayers, ...this.lineOrPolygonLayers];
|
|
1303
|
+
try {
|
|
1304
|
+
const n = i[e], p = (await Promise.all(n.filter(({ fieldsToAdd: u }) => u.length > 0).map(async ({ fieldsToAdd: u, layerId: c }) => await x({ fields: u, item: l, layerId: c, portal: t })))).every(({ error: u }) => !u), o = p ? await Promise.all(n.filter(({ domainsToUpdate: u }) => u.length > 0).map(async ({ domainsToUpdate: u, layerId: c }) => await G({ fields: u, item: l, layerId: c, portal: t }))) : [], h = p && o.every(({ error: u }) => !u);
|
|
1305
|
+
if (!h || this.loadedItem !== l)
|
|
1294
1306
|
return;
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1307
|
+
let y;
|
|
1308
|
+
if (await z(async () => {
|
|
1309
|
+
if (this.loadedItem !== l)
|
|
1310
|
+
return !0;
|
|
1311
|
+
const { result: u, error: c } = await b({ item: l, layers: a });
|
|
1312
|
+
if (c || this.loadedItem !== l)
|
|
1313
|
+
return !0;
|
|
1314
|
+
if (!u)
|
|
1315
|
+
return !1;
|
|
1316
|
+
const V = e === "base" ? a : a.filter((D) => D.geometryType === "point");
|
|
1317
|
+
return this.analyzeFieldSet(V, u, e).length > 0 ? !1 : (y = u, !0);
|
|
1318
|
+
}, 10) || console.warn("Fields were not verified on the service.", {
|
|
1319
|
+
itemId: l.id,
|
|
1320
|
+
fieldSet: e
|
|
1321
|
+
}), !y || this.loadedItem !== l)
|
|
1322
|
+
return;
|
|
1323
|
+
await this.initItem({ showLoading: !1 }), p && h && this.gpsFieldFixesBySet && !this.hasFieldChanges(e) && this.arcgisGPSMetadataFieldsAdded.emit(e);
|
|
1324
|
+
} finally {
|
|
1325
|
+
this.addingGPSFieldMetadata = this.addingGPSFieldMetadata.filter((n) => n !== e);
|
|
1303
1326
|
}
|
|
1304
1327
|
}
|
|
1305
1328
|
canShowAddGPSMetadata() {
|
|
1306
1329
|
const e = this.loadedItem ?? this.item;
|
|
1307
|
-
return !!e &&
|
|
1330
|
+
return !!e && q(e);
|
|
1308
1331
|
}
|
|
1309
1332
|
showAdvancedFields() {
|
|
1310
1333
|
const e = this.gpsFieldFixesBySet;
|
|
1311
|
-
return !this.hasPointFeatureLayer || !e ? !1 : this.pointLayers.some((l) => {
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
return (e.base.find(({ layerId: n }) => n === l.layerId)?.fieldsToAdd ?? []).length < i.length;
|
|
1316
|
-
});
|
|
1334
|
+
return !this.hasPointFeatureLayer || !e ? !1 : this.hasFieldChanges("base") ? this.pointLayers.some((t) => t.layerId == null ? !1 : ["gnss", "rangefinder"].some((l) => {
|
|
1335
|
+
const i = l === "gnss" ? _("esriGeometryPoint") : F("esriGeometryPoint");
|
|
1336
|
+
return (e[l].find(({ layerId: n }) => n === t.layerId)?.fieldsToAdd ?? []).length < i.length;
|
|
1337
|
+
})) : !0;
|
|
1317
1338
|
}
|
|
1318
|
-
renderAddFieldsControl(e,
|
|
1319
|
-
const
|
|
1320
|
-
if (!
|
|
1321
|
-
return
|
|
1339
|
+
renderAddFieldsControl(e, t = !1) {
|
|
1340
|
+
const l = this.gpsFieldFixesBySet;
|
|
1341
|
+
if (!t && l && !this.hasFieldChanges(e))
|
|
1342
|
+
return m`<span slot=actions-end class="added"><calcite-icon icon=check-circle scale=s aria-hidden></calcite-icon>${this.messages.added}</span>`;
|
|
1322
1343
|
const i = this.isLoading(e);
|
|
1323
|
-
return
|
|
1344
|
+
return m`<calcite-button slot=actions-end class="add-fields-button" appearance=outline-fill .disabled=${t || !l || i || this.addFieldsDisabled} .loading=${i} @click=${async () => await this.addFields(e)}>${i ? this.messages.addingFields : this.messages.addFields}</calcite-button>`;
|
|
1324
1345
|
}
|
|
1325
1346
|
render() {
|
|
1326
|
-
return this.canShowAddGPSMetadata() ?
|
|
1347
|
+
return this.canShowAddGPSMetadata() ? m`<div class="scrim-container"><calcite-block scale=m expanded>${this.initializing && m`<calcite-scrim loading></calcite-scrim>` || ""}<calcite-list .label=${this.messages.gpsOptions} selection-mode=none><calcite-list-item .label=${this.messages.accordionHeading}>${this.renderAddFieldsControl("base")}</calcite-list-item>${this.showAdvancedFields() && m`<calcite-list-item .label=${this.messages.gnssReceiverFields}>${this.renderAddFieldsControl("gnss")}</calcite-list-item><calcite-list-item .label=${this.messages.laserRangefinderFields}>${this.renderAddFieldsControl("rangefinder")}</calcite-list-item>` || ""}</calcite-list></calcite-block></div>` : null;
|
|
1327
1348
|
}
|
|
1328
1349
|
}
|
|
1329
|
-
|
|
1350
|
+
S("arcgis-portal-add-gps-metadata", j);
|
|
1330
1351
|
export {
|
|
1331
|
-
|
|
1352
|
+
j as ArcgisPortalAddGpsMetadata
|
|
1332
1353
|
};
|