@arcgis/common-components 6.0.0-next.4 → 6.0.0-next.40

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.
Files changed (144) hide show
  1. package/dist/cdn/{B33S3YBM.js → 24FE5GMT.js} +1 -1
  2. package/dist/cdn/2XTXXTEZ.js +2 -0
  3. package/dist/cdn/3QTMLOOM.js +2 -0
  4. package/dist/cdn/4X2SOHYB.js +2 -0
  5. package/dist/cdn/{OTWADB4M.js → 4ZVHN3V7.js} +1 -1
  6. package/dist/cdn/55VDXBLV.js +2 -0
  7. package/dist/cdn/5YQK5TCH.js +2 -0
  8. package/dist/cdn/{EB5MDEWF.js → 7S4ZZPSA.js} +1 -1
  9. package/dist/cdn/7VGSZDT7.js +2 -0
  10. package/dist/cdn/ABDFJWQO.js +2 -0
  11. package/dist/cdn/BAMK6STW.js +2 -0
  12. package/dist/cdn/CC74AHNF.js +2 -0
  13. package/dist/cdn/CCJ7MF3B.js +2 -0
  14. package/dist/cdn/{TO3YFXVJ.js → EYOJNGUG.js} +1 -1
  15. package/dist/cdn/{MFGUTQRR.js → F5IBLVYU.js} +1 -1
  16. package/dist/cdn/HMGFS4YI.js +2 -0
  17. package/dist/cdn/HYR5WUUX.js +2 -0
  18. package/dist/cdn/JAMYEW7N.js +2 -0
  19. package/dist/cdn/JCWKK6FB.js +2 -0
  20. package/dist/cdn/LIFJOO55.js +2 -0
  21. package/dist/cdn/{LNXO5YIS.js → LPKRIISW.js} +1 -1
  22. package/dist/cdn/LRP7XW5X.js +2 -0
  23. package/dist/cdn/{KDCSDIUQ.js → LZPZYGFW.js} +1 -1
  24. package/dist/cdn/{JTQN5KMG.js → MWQVR7SB.js} +1 -1
  25. package/dist/cdn/N5YNSPMD.js +2 -0
  26. package/dist/cdn/NEJQBOXB.js +8207 -0
  27. package/dist/cdn/NSTQTWS5.js +2 -0
  28. package/dist/cdn/ONYZMGVN.js +2 -0
  29. package/dist/cdn/OQRMI3K5.js +2 -0
  30. package/dist/cdn/{34AP2EEB.js → OVW45JGX.js} +1 -1
  31. package/dist/cdn/Q73UFMJY.js +4 -0
  32. package/dist/cdn/{BZFAYVKR.js → RBTFN5SR.js} +1 -1
  33. package/dist/cdn/RU4PILTH.js +2 -0
  34. package/dist/cdn/RU722XDV.js +2 -0
  35. package/dist/cdn/S2EORL4N.js +2 -0
  36. package/dist/cdn/S3GK6UB7.js +2 -0
  37. package/dist/cdn/T7LZIFNY.js +2 -0
  38. package/dist/cdn/TZBDDGN3.js +2 -0
  39. package/dist/cdn/UOXUUCE7.js +3 -0
  40. package/dist/cdn/VLVINHT3.js +2 -0
  41. package/dist/cdn/WDQV5Y4K.js +2 -0
  42. package/dist/cdn/{OMROUY3L.js → X44CHGA6.js} +1 -1
  43. package/dist/cdn/XMMFL5H3.js +2 -0
  44. package/dist/cdn/{IECXEZNI.js → Y72KV72H.js} +1 -1
  45. package/dist/cdn/{D4UHHQ35.js → YOPZGJMF.js} +1 -1
  46. package/dist/cdn/ZJMMAZFG.js +2 -0
  47. package/dist/cdn/assets/layer-replace/t9n/messages.en.json +1 -0
  48. package/dist/cdn/index.js +1 -1
  49. package/dist/cdn/main.css +1 -1
  50. package/dist/chunks/sharedCacheDirective.js +74 -0
  51. package/dist/chunks/utils.js +75 -37
  52. package/dist/chunks/utils2.js +9 -14
  53. package/dist/chunks/well-known-sizes-controller.js +42 -0
  54. package/dist/components/arcgis-ckeditor5/customElement.d.ts +0 -9
  55. package/dist/components/arcgis-ckeditor5/customElement.js +1336 -1339
  56. package/dist/components/arcgis-ckeditor5-popover/customElement.d.ts +0 -6
  57. package/dist/components/arcgis-ckeditor5-popover/customElement.js +14 -17
  58. package/dist/components/arcgis-color-input/customElement.d.ts +0 -20
  59. package/dist/components/arcgis-color-input/customElement.js +33 -33
  60. package/dist/components/arcgis-color-input/index.js +2 -1
  61. package/dist/components/arcgis-field-info/customElement.d.ts +0 -3
  62. package/dist/components/arcgis-field-info/customElement.js +41 -41
  63. package/dist/components/arcgis-field-pick-list/customElement.d.ts +0 -28
  64. package/dist/components/arcgis-field-pick-list/customElement.js +114 -127
  65. package/dist/components/arcgis-field-pick-list/index.js +1 -1
  66. package/dist/components/arcgis-html-content/customElement.d.ts +42 -0
  67. package/dist/components/arcgis-html-content/customElement.js +71 -0
  68. package/dist/components/arcgis-html-content/index.d.ts +1 -0
  69. package/dist/components/arcgis-html-content/index.js +1 -0
  70. package/dist/components/arcgis-label-input/customElement.js +1 -1
  71. package/dist/components/arcgis-layer-replace/customElement.d.ts +437 -0
  72. package/dist/components/arcgis-layer-replace/customElement.js +376 -0
  73. package/dist/components/arcgis-layer-replace/index.d.ts +1 -0
  74. package/dist/components/arcgis-layer-replace/index.js +7 -0
  75. package/dist/components/arcgis-slider/customElement.js +546 -451
  76. package/dist/components/arcgis-slider-field/customElement.d.ts +43 -41
  77. package/dist/components/arcgis-slider-field/customElement.js +45 -39
  78. package/dist/components/arcgis-slider-histogram-range/customElement.d.ts +21 -19
  79. package/dist/components/arcgis-slider-histogram-range/customElement.js +28 -22
  80. package/dist/components/arcgis-slider-input/customElement.d.ts +0 -3
  81. package/dist/components/arcgis-slider-input/customElement.js +13 -13
  82. package/dist/components/arcgis-ticks/customElement.js +8 -8
  83. package/dist/components/arcgis-toolbar/customElement.d.ts +25 -2
  84. package/dist/components/arcgis-toolbar/customElement.js +55 -46
  85. package/dist/components/arcgis-toolbar/types.d.ts +21 -1
  86. package/dist/components/arcgis-toolbar-action/customElement.js +17 -18
  87. package/dist/components/arcgis-toolbar-group/customElement.js +20 -17
  88. package/dist/components/arcgis-toolbar-item/customElement.d.ts +2 -2
  89. package/dist/components/arcgis-toolbar-item/customElement.js +14 -14
  90. package/dist/components/arcgis-toolbar-more-button/customElement.js +28 -26
  91. package/dist/components/arcgis-toolbar-split-button/customElement.js +34 -34
  92. package/dist/components/arcgis-toolbar-stack/customElement.d.ts +9 -2
  93. package/dist/components/arcgis-toolbar-stack/customElement.js +63 -125
  94. package/dist/components/arcgis-unique-values-list/customElement.js +11 -11
  95. package/dist/components/arcgis-unique-values-list/index.js +1 -1
  96. package/dist/components/arcgis-value-picker/customElement.js +22 -26
  97. package/dist/components/arcgis-value-picker-combobox/customElement.js +4 -4
  98. package/dist/components/arcgis-value-picker-label/customElement.js +5 -5
  99. package/dist/components/arcgis-value-picker-slider/customElement.d.ts +12 -19
  100. package/dist/components/arcgis-value-picker-slider/customElement.js +17 -17
  101. package/dist/docs/api.json +1 -1
  102. package/dist/docs/docs.json +1 -1
  103. package/dist/docs/vscode.css-custom-data.json +1 -1
  104. package/dist/docs/vscode.html-custom-data.json +1 -1
  105. package/dist/docs/web-types.json +1 -1
  106. package/dist/index.d.ts +15 -20
  107. package/dist/index.js +8 -5
  108. package/dist/loader.js +10 -8
  109. package/dist/types/lumina.d.ts +17 -19
  110. package/dist/types/preact.d.ts +19 -19
  111. package/dist/types/react.d.ts +21 -19
  112. package/dist/types/stencil.d.ts +17 -19
  113. package/dist/utils/sharedCacheDirective.d.ts +68 -0
  114. package/dist/utils/types.d.ts +0 -12
  115. package/package.json +7 -7
  116. package/dist/cdn/32MHBJSZ.js +0 -2
  117. package/dist/cdn/3AFEXHZ5.js +0 -2
  118. package/dist/cdn/5EA7SGHX.js +0 -2
  119. package/dist/cdn/5XRYXPOX.js +0 -2
  120. package/dist/cdn/735FTIBP.js +0 -2
  121. package/dist/cdn/ATLXGXTH.js +0 -2
  122. package/dist/cdn/BCN6LPOG.js +0 -4
  123. package/dist/cdn/CKGWDI7B.js +0 -2
  124. package/dist/cdn/DPJGC3YQ.js +0 -2
  125. package/dist/cdn/DR2THZQU.js +0 -8208
  126. package/dist/cdn/EM4OQXFS.js +0 -2
  127. package/dist/cdn/GDRW3MIZ.js +0 -2
  128. package/dist/cdn/HJ3EJZFF.js +0 -2
  129. package/dist/cdn/HYFFUYAU.js +0 -2
  130. package/dist/cdn/LLATF73T.js +0 -2
  131. package/dist/cdn/M2J3GPM4.js +0 -2
  132. package/dist/cdn/M3SFEFPX.js +0 -2
  133. package/dist/cdn/OIGA7XBZ.js +0 -2
  134. package/dist/cdn/QCUF7B3I.js +0 -2
  135. package/dist/cdn/S4XOD4YS.js +0 -2
  136. package/dist/cdn/TXQKK4DJ.js +0 -2
  137. package/dist/cdn/UIBTY5FF.js +0 -2
  138. package/dist/cdn/X6DNIKWY.js +0 -2
  139. package/dist/cdn/XUPA27AW.js +0 -2
  140. package/dist/cdn/XX2ZCFWI.js +0 -2
  141. package/dist/cdn/YEFEVEP6.js +0 -2
  142. package/dist/cdn/ZCVP2N2O.js +0 -2
  143. package/dist/cdn/ZGYD3GAS.js +0 -2
  144. package/dist/chunks/toolbar.js +0 -9
@@ -0,0 +1,376 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import { c as $ } from "../../chunks/runtime.js";
3
+ import { keyed as v } from "lit/directives/keyed.js";
4
+ import { repeat as b } from "lit/directives/repeat.js";
5
+ import { isAbortError as x } from "@arcgis/core/core/promiseUtils.js";
6
+ import { substitute as u } from "@arcgis/core/intl.js";
7
+ import { LitElement as R, createEvent as C } from "@arcgis/lumina";
8
+ import { log as I } from "@arcgis/toolkit/log";
9
+ import { css as D, html as d } from "lit";
10
+ import { u as L } from "../../chunks/useT9n.js";
11
+ const S = D`:host{display:block;container-type:inline-size;container-name:layer-replace;color:var(--arcgis-layer-replace-color, var(--calcite-color-text-2));--arcgis-layer-replace-content-gap: var(--calcite-space-sm-plus);--arcgis-layer-replace-row-gap: var(--calcite-space-sm-plus);--arcgis-layer-replace-name-gap: var(--calcite-space-sm);--arcgis-layer-replace-min-column-width: 16rem}.layer-replace{display:flex;flex-direction:column;gap:var(--arcgis-layer-replace-content-gap)}.layer-row,.field-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(var(--arcgis-layer-replace-min-column-width),1fr);align-items:center;gap:var(--arcgis-layer-replace-row-gap)}.layer-name,.field-name{display:flex;align-items:center;min-width:0;gap:var(--arcgis-layer-replace-name-gap)}.field-label{display:flex;flex-direction:column;min-width:0}.field-alias{color:var(--calcite-color-text-3);font-size:var(--calcite-font-size--1)}.layer-name span,.field-name span{overflow-wrap:anywhere}.field-list{display:flex;flex-direction:column;gap:var(--arcgis-layer-replace-content-gap)}.layer-cell,.field-source,.field-target{display:flex;flex-direction:column;min-width:0;gap:var(--arcgis-layer-replace-name-gap)}calcite-combobox,calcite-notice{min-width:0}@container layer-replace (max-width: 36rem){.layer-row{grid-template-columns:1fr;gap:var(--arcgis-layer-replace-content-gap);padding:var(--calcite-space-sm);border:1px solid var(--calcite-color-border-1);border-radius:var(--calcite-border-radius-1)}.field-row{grid-template-columns:1fr;gap:var(--arcgis-layer-replace-name-gap);padding-block:var(--arcgis-layer-replace-name-gap);border-bottom:1px solid var(--calcite-color-border-1)}.field-row:last-child{border-bottom:0}.field-target{padding-inline-start:var(--calcite-space-lg)}}`;
12
+ function g(c) {
13
+ return c?.name?.toLowerCase();
14
+ }
15
+ function k(c, e = {}) {
16
+ const t = c.fieldMappings.flatMap(
17
+ (s, l) => (c.replacementFieldsBySource.get(s.source) ?? []).flatMap((r, o) => {
18
+ const p = N(s.source, r);
19
+ return p === void 0 ? [] : [
20
+ {
21
+ source: s.source,
22
+ replacement: r,
23
+ strength: p,
24
+ sourceIndex: l,
25
+ replacementIndex: o
26
+ }
27
+ ];
28
+ })
29
+ );
30
+ t.sort(
31
+ (s, l) => l.strength - s.strength || s.sourceIndex - l.sourceIndex || s.replacementIndex - l.replacementIndex
32
+ );
33
+ const i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
34
+ for (const s of t) {
35
+ const l = g(s.replacement);
36
+ !i.has(s.source) && (e.allowDuplicateReplacementFields || !l || !a.has(l)) && (i.set(s.source, s.replacement), l && !e.allowDuplicateReplacementFields && a.add(l));
37
+ }
38
+ return c.fieldMappings.map((s) => ({
39
+ source: s.source,
40
+ replacement: i.get(s.source)
41
+ }));
42
+ }
43
+ function F(c, e, t) {
44
+ const i = c.map(({ source: l }) => {
45
+ const r = t.find((o) => o.source === l)?.replacement;
46
+ return {
47
+ source: l,
48
+ replacement: r && e.replacementFieldsBySource.get(l)?.includes(r) ? r : void 0
49
+ };
50
+ });
51
+ if (e.allowDuplicateReplacementFields)
52
+ return i;
53
+ const a = /* @__PURE__ */ new Map(), s = [...i];
54
+ return s.forEach((l, r) => {
55
+ const o = l.replacement ? g(l.replacement) : void 0;
56
+ if (!o)
57
+ return;
58
+ const p = a.get(o);
59
+ if (p === void 0) {
60
+ a.set(o, r);
61
+ return;
62
+ }
63
+ if (l.source === e.preferredSource) {
64
+ s[p] = { ...s[p], replacement: void 0 }, a.set(o, r);
65
+ return;
66
+ }
67
+ s[r] = { ...l, replacement: void 0 };
68
+ }), s;
69
+ }
70
+ function z(c, e, t, i) {
71
+ const a = i.matches.flatMap(({ replacementFieldName: s, sourceFieldName: l }) => {
72
+ const r = w(e, l), o = r ? w(t.replacementFieldsBySource.get(r) ?? [], s) : void 0;
73
+ return r && o ? [{ source: r, replacement: o }] : [];
74
+ });
75
+ return F(c, t, a);
76
+ }
77
+ function w(c, e) {
78
+ const t = c.find((a) => a.name === e);
79
+ if (t)
80
+ return t;
81
+ const i = c.filter((a) => a.name?.toLowerCase() === e.toLowerCase());
82
+ return i.length === 1 ? i[0] : void 0;
83
+ }
84
+ function N(c, e) {
85
+ const t = c.type === "oid" || c.type === "global-id";
86
+ if (t && e.type !== c.type || !t && (!c.name || !e.name))
87
+ return;
88
+ const i = g(c), a = g(e);
89
+ if (i && i === a)
90
+ return 4;
91
+ const s = [c.name, c.alias].filter((n) => !!n), l = [e.name, e.alias].filter((n) => !!n), r = s.map((n) => n.toLowerCase()), o = l.map((n) => n.toLowerCase());
92
+ if (r.some((n) => o.includes(n)))
93
+ return 3;
94
+ if (t)
95
+ return 2;
96
+ let p;
97
+ for (const n of r) {
98
+ const m = n.length * 0.3;
99
+ for (const h of o) {
100
+ const f = A(n, h);
101
+ if (f <= m) {
102
+ const y = 1 + (1 - f / Math.max(n.length, h.length));
103
+ p = Math.max(p ?? 0, y);
104
+ }
105
+ }
106
+ }
107
+ return p;
108
+ }
109
+ function A(c, e) {
110
+ if (c === e)
111
+ return 0;
112
+ if (!c)
113
+ return e.length;
114
+ if (!e)
115
+ return c.length;
116
+ const t = new Array(e.length + 1).fill(0);
117
+ let i = Array.from({ length: e.length + 1 }, (a, s) => s);
118
+ for (let a = 1; a <= c.length; a++) {
119
+ t[0] = a;
120
+ for (let s = 1; s <= e.length; s++)
121
+ t[s] = c[a - 1] === e[s - 1] ? i[s - 1] : 1 + Math.min(t[s - 1], i[s], i[s - 1]);
122
+ i = [...t];
123
+ }
124
+ return t[e.length];
125
+ }
126
+ const T = {
127
+ feature: "feature-layer",
128
+ group: "layers",
129
+ "subtype-group": "subtype",
130
+ "knowledge-graph": "knowledge-layer",
131
+ "link-chart": "knowledge-graph",
132
+ graphics: "layer-graphics"
133
+ }, B = {
134
+ point: "point",
135
+ multipoint: "layer-multipoint",
136
+ line: "line",
137
+ polyline: "line",
138
+ polygon: "polygon"
139
+ }, M = {
140
+ oid: "key",
141
+ guid: "key",
142
+ "global-id": "key",
143
+ blob: "binary",
144
+ integer: "integer",
145
+ "small-integer": "integer",
146
+ "big-integer": "integer",
147
+ single: "number",
148
+ double: "number",
149
+ long: "number",
150
+ number: "number",
151
+ date: "date-time",
152
+ "date-only": "calendar",
153
+ "time-only": "clock",
154
+ "timestamp-offset": "time-zone",
155
+ string: "string"
156
+ };
157
+ class E extends R {
158
+ constructor() {
159
+ super(...arguments), this.messages = L({ blocking: !0 }), this.#t = /* @__PURE__ */ new Map(), this.fieldMappings = [], this.isMatchingFields = !1, this.replacementCandidates = [], this.mode = "layer-and-fields", this.showFieldAliases = !1, this.allowDuplicateReplacementFields = !1, this.arcgisChange = C();
160
+ }
161
+ static {
162
+ this.properties = { fieldMappings: 16, isMatchingFields: 16, mapping: 32, source: 0, replacement: 0, replacementCandidates: 0, mode: 1, sourceFieldFilter: 0, additionalSourceFields: 0, replacementFieldFilter: 0, fieldMatcher: 0, showFieldAliases: 5, getFieldDisplayInfo: 0, getLayerDisplayInfo: 0, allowDuplicateReplacementFields: 5, messageOverrides: 0 };
163
+ }
164
+ static {
165
+ this.styles = S;
166
+ }
167
+ #e;
168
+ #n;
169
+ #t;
170
+ get mapping() {
171
+ return this.source ? { source: this.source, replacement: this.replacement, fieldMappings: this.fieldMappings } : void 0;
172
+ }
173
+ async matchFields() {
174
+ this.replacement && await this.#o(!0);
175
+ }
176
+ willUpdate(e) {
177
+ let t = this.replacement;
178
+ const i = e.has("source");
179
+ let a = e.has("replacement") || !this.hasUpdated && !!t;
180
+ const s = e.has("sourceFieldFilter"), l = e.has("additionalSourceFields"), r = e.has("replacementFieldFilter"), o = e.has("fieldMatcher"), p = e.has("allowDuplicateReplacementFields"), n = e.has("fieldMappings"), m = this.mode === "layer-and-fields" && t && !this.replacementCandidates.includes(t) ? void 0 : t;
181
+ m !== t && (t = m, a = !0, this.replacement = m);
182
+ const h = i || a || s || l || r;
183
+ if (h && this.#i(), h || o || p) {
184
+ const f = h || o;
185
+ this.#o(f).catch((y) => {
186
+ x(y) || I("error", this, "Field matching failed.", { detail: { error: y } });
187
+ });
188
+ } else n && this.#a(this.fieldMappings, t);
189
+ }
190
+ disconnectedCallback() {
191
+ this.#i(), super.disconnectedCallback();
192
+ }
193
+ #s(e) {
194
+ return !!e && "fields" in e;
195
+ }
196
+ #c(e) {
197
+ if (!this.#s(e))
198
+ return [];
199
+ const t = e.fields;
200
+ return t ? Array.from(t) : [];
201
+ }
202
+ #v(e, t) {
203
+ const i = this.#c(e);
204
+ return this.additionalSourceFields?.forEach((a) => {
205
+ i.some((l) => g(l) === g(a)) || i.push(a);
206
+ }), e && this.#s(e) ? i.filter((a) => !t || t(a, e)) : [];
207
+ }
208
+ async #o(e) {
209
+ const t = this.replacement;
210
+ this.#i();
211
+ const i = this.#v(this.source, this.sourceFieldFilter);
212
+ this.#t = new Map(i.map((r) => [
213
+ r,
214
+ this.#d(t, r, this.replacementFieldFilter)
215
+ ]));
216
+ let a = F(i.map((r) => ({ source: r })), {
217
+ allowDuplicateReplacementFields: this.allowDuplicateReplacementFields,
218
+ replacementFieldsBySource: this.#t
219
+ }, this.fieldMappings);
220
+ if (!e || !this.source || !t) {
221
+ this.#l(a), this.#a(a, t);
222
+ return;
223
+ }
224
+ a = a.map(({ source: r }) => ({ source: r })), this.#l(a), this.#a(a, t);
225
+ const s = this.source, l = new AbortController();
226
+ this.#e = l, this.isMatchingFields = !0;
227
+ try {
228
+ const r = await this.#F(a, i, t, l.signal);
229
+ if (l.signal.aborted || this.#e !== l || this.source !== s || this.replacement !== t)
230
+ return;
231
+ this.#l(r), this.#a(r, t);
232
+ } finally {
233
+ this.#e === l && (this.#e = void 0, this.isMatchingFields = !1);
234
+ }
235
+ }
236
+ #d(e, t, i) {
237
+ return !e || !this.#s(e) ? [] : this.#c(e).filter((s) => !i || i(s, e, t));
238
+ }
239
+ #p(e, t = this.replacement) {
240
+ if (t === this.replacement) {
241
+ const i = this.#t.get(e);
242
+ if (i)
243
+ return i;
244
+ }
245
+ return this.#d(t, e, this.replacementFieldFilter);
246
+ }
247
+ #m(e, t) {
248
+ return new Map(e.map((i) => [i, this.#p(i, t)]));
249
+ }
250
+ async #F(e, t, i, a) {
251
+ const s = this.source;
252
+ if (!s)
253
+ return [];
254
+ const l = this.#m(t, i);
255
+ if (!this.fieldMatcher)
256
+ return F(e, {
257
+ allowDuplicateReplacementFields: this.allowDuplicateReplacementFields,
258
+ replacementFieldsBySource: l
259
+ }, k({ fieldMappings: e, replacementFieldsBySource: l }, { allowDuplicateReplacementFields: this.allowDuplicateReplacementFields }));
260
+ const r = t.map((n) => ({
261
+ replacementFields: l.get(n) ?? [],
262
+ sourceField: n
263
+ })), o = {
264
+ allowDuplicateReplacementFields: this.allowDuplicateReplacementFields ?? !1,
265
+ fieldCandidates: r,
266
+ source: s,
267
+ replacement: i
268
+ }, p = await this.fieldMatcher(o, a);
269
+ return a.throwIfAborted(), z(e, t, {
270
+ allowDuplicateReplacementFields: this.allowDuplicateReplacementFields,
271
+ replacementFieldsBySource: l
272
+ }, p);
273
+ }
274
+ #i() {
275
+ this.#e?.abort(), this.#e = void 0, this.isMatchingFields = !1;
276
+ }
277
+ #h(e, t) {
278
+ return e.length === t.length && e.every((i, a) => i.source === t[a].source && i.replacement === t[a].replacement);
279
+ }
280
+ #b(e, t) {
281
+ return e === t ? !0 : !e || !t ? !1 : e.source === t.source && e.replacement === t.replacement && this.#h(e.fieldMappings, t.fieldMappings);
282
+ }
283
+ #l(e) {
284
+ this.#h(this.fieldMappings, e) || (this.fieldMappings = e);
285
+ }
286
+ #a(e, t = this.replacement) {
287
+ const i = this.source ? { source: this.source, replacement: t, fieldMappings: e } : void 0;
288
+ this.#b(this.#n, i) || (this.#n = i, this.arcgisChange.emit(i ?? null));
289
+ }
290
+ #w(e, t) {
291
+ this.#i();
292
+ const i = this.fieldMappings.map((a) => a.source === e ? { ...a, replacement: t } : a);
293
+ this.fieldMappings = F(this.fieldMappings, {
294
+ allowDuplicateReplacementFields: this.allowDuplicateReplacementFields,
295
+ preferredSource: e,
296
+ replacementFieldsBySource: this.#m(this.fieldMappings.map(({ source: a }) => a), this.replacement)
297
+ }, i);
298
+ }
299
+ #u(e) {
300
+ return e.title || e.id;
301
+ }
302
+ #g(e) {
303
+ const t = this.getLayerDisplayInfo?.(e)?.icon;
304
+ if (t === null)
305
+ return;
306
+ if (t)
307
+ return t;
308
+ if ("isTable" in e && e.isTable)
309
+ return "table";
310
+ const i = T[e.type];
311
+ if (i)
312
+ return i;
313
+ const a = "geometryType" in e ? e.geometryType : void 0;
314
+ return typeof a == "string" && B[a] || "layer";
315
+ }
316
+ #f(e) {
317
+ return this.showFieldAliases ? e.alias : void 0;
318
+ }
319
+ #r(e, t) {
320
+ const i = this.getFieldDisplayInfo?.(e, t), a = i?.icon === null ? void 0 : i?.icon ?? M[e.type], s = this.#f(e);
321
+ return d`<div class="field-name">${a && d`<calcite-icon .icon=${a} scale=s></calcite-icon>` || ""}<div class="field-label"><span>${e.name}</span>${s && d`<span class="field-alias">${s}</span>` || ""}</div></div>`;
322
+ }
323
+ #y(e, t, i, a) {
324
+ const s = a?.icon === null ? void 0 : a?.icon ?? M[e.type], l = this.#f(e), r = e.name;
325
+ return v(e.name, d`<calcite-combobox-item .value=${e.name} .icon=${s} .heading=${r} .description=${l ?? void 0} .label=${r} .selected=${i} @calciteComboboxItemChange=${() => this.#w(t, e)}></calcite-combobox-item>`);
326
+ }
327
+ #M(e, t, i, a) {
328
+ const s = e.map((n) => ({
329
+ field: n,
330
+ displayInfo: this.getFieldDisplayInfo?.(n, t)
331
+ }));
332
+ if (!s.some(({ displayInfo: n }) => !!n?.groupName))
333
+ return s.map(({ field: n, displayInfo: m }) => this.#y(n, i, n === a, m));
334
+ const r = this.messages.fields, o = /* @__PURE__ */ new Map();
335
+ for (const n of s) {
336
+ const m = n.displayInfo?.groupName || r, h = o.get(m);
337
+ h ? h.push(n) : o.set(m, [n]);
338
+ }
339
+ const p = [
340
+ ...o.has(r) ? [r] : [],
341
+ ...Array.from(o.keys()).filter((n) => n !== r)
342
+ ];
343
+ return b(p, (n) => n, (n) => d`<calcite-combobox-item-group .label=${n}>${o.get(n).map(({ field: m, displayInfo: h }) => this.#y(m, i, m === a, h))}</calcite-combobox-item-group>`);
344
+ }
345
+ #$() {
346
+ const e = this.replacement ? void 0 : "invalid";
347
+ return this.replacementCandidates.length === 0 ? d`<calcite-notice open kind=info scale=s><div slot=message>${this.messages.noReplacementLayers}</div></calcite-notice>` : d`<calcite-combobox .label=${this.messages.replacementLayer} selection-mode=single-persist .placeholder=${this.messages.selectLayer} .status=${e} overlay-positioning=fixed max-items=8>${b(this.replacementCandidates, (t) => t.id, (t) => {
348
+ const i = this.#u(t);
349
+ return d`<calcite-combobox-item .value=${t.id} .icon=${this.#g(t)} .heading=${i} .label=${i} .selected=${this.replacement === t} @calciteComboboxItemChange=${() => this.replacement = t}></calcite-combobox-item>`;
350
+ })}</calcite-combobox>`;
351
+ }
352
+ #x(e) {
353
+ const t = this.source;
354
+ if (!t)
355
+ return;
356
+ const i = e.source.name;
357
+ if (!this.replacement)
358
+ return v(e.source.name, d`<div class="field-row" role=group .ariaLabel=${u(this.messages.fieldMappingFor, { field: i })}><div class="field-source">${this.#r(e.source, t)}</div><div class="field-target"><calcite-combobox .label=${u(this.messages.replacementFieldFor, { field: i })} disabled .placeholder=${this.messages.selectLayerFirst}></calcite-combobox></div></div>`);
359
+ const a = this.replacement, s = this.#p(e.source), l = e.replacement ? void 0 : "invalid";
360
+ return s.length === 0 ? v(e.source.name, d`<div class="field-row" role=group .ariaLabel=${u(this.messages.fieldMappingFor, { field: i })}><div class="field-source">${this.#r(e.source, t)}</div><div class="field-target"><calcite-notice open kind=info scale=s><div slot=message>${this.messages.noReplacementFields}</div></calcite-notice></div></div>`) : v(e.source.name, d`<div class="field-row" role=group .ariaLabel=${u(this.messages.fieldMappingFor, { field: i })}><div class="field-source">${this.#r(e.source, t)}</div><div class="field-target"><calcite-combobox .label=${u(this.messages.replacementFieldFor, { field: i })} selection-mode=single-persist .placeholder=${this.messages.selectField} .status=${l} overlay-positioning=fixed max-items=8>${this.#M(s, a, e.source, e.replacement)}</calcite-combobox></div></div>`);
361
+ }
362
+ render() {
363
+ const e = this.source;
364
+ if (!e)
365
+ return d`<calcite-notice open kind=info><div slot=message>${this.messages.selectSourceLayer}</div></calcite-notice>`;
366
+ const t = this.#t.size > 0;
367
+ if (this.mode === "fields-only" && !this.replacement)
368
+ return d`<calcite-notice open kind=info><div slot=message>${this.messages.selectReplacementLayer}</div></calcite-notice>`;
369
+ const i = this.#u(e), a = this.mode === "layer-and-fields" ? this.#g(e) : void 0;
370
+ return d`<div class="layer-replace">${this.mode === "layer-and-fields" && d`<div class="layer-row" role=group .ariaLabel=${this.messages.layerReplacement}><div class="layer-cell" role=group .ariaLabel=${u(this.messages.sourceLayer, { layer: i })}><div class="layer-name">${a && d`<calcite-icon .icon=${a} scale=s></calcite-icon>` || ""}<span>${i}</span></div></div><div class="layer-cell">${this.#$()}</div></div>` || ""}<slot></slot>${t && d`<calcite-block expandable expanded .heading=${u(this.messages.fieldsCount, { count: this.fieldMappings.length })} .loading=${this.isMatchingFields}><div class="field-list">${this.fieldMappings.map((s) => this.#x(s))}</div></calcite-block>` || ""}</div>`;
371
+ }
372
+ }
373
+ $("arcgis-layer-replace", E);
374
+ export {
375
+ E as ArcgisLayerReplace
376
+ };
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";
@@ -0,0 +1,7 @@
1
+ import "@esri/calcite-components/components/calcite-icon";
2
+ import "@esri/calcite-components/components/calcite-combobox-item";
3
+ import "@esri/calcite-components/components/calcite-combobox-item-group";
4
+ import "@esri/calcite-components/components/calcite-notice";
5
+ import "@esri/calcite-components/components/calcite-combobox";
6
+ import "@esri/calcite-components/components/calcite-block";
7
+ export * from "./customElement.js";