@phila/layerboard 3.0.0 → 3.1.0
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/components/Layerboard.vue.d.ts +3 -0
- package/dist/composables/useLayerConfig.d.ts +1 -0
- package/dist/composables/useLayerboard.d.ts +4 -0
- package/dist/index.js +2 -2
- package/dist/index.mjs +1245 -1239
- package/dist/layerboard.css +1 -1
- package/dist/types/layer.d.ts +4 -0
- package/package.json +5 -4
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as be, ref as
|
|
2
|
-
import { Map as Vi, DrawTool as Pi, RasterLayer as ti, CircleLayer as ii, FillLayer as si, LineLayer as
|
|
1
|
+
import { defineComponent as be, ref as E, watch as le, computed as $, nextTick as et, onMounted as ut, onUnmounted as Zt, createElementBlock as L, openBlock as _, createVNode as ee, unref as y, withCtx as rt, createBlock as K, createCommentVNode as Z, Fragment as ke, renderList as Ae, toRef as ot, h as Li, useAttrs as Ai, normalizeClass as me, createElementVNode as D, toDisplayString as Q, withModifiers as hi, renderSlot as Se, withDirectives as pi, mergeProps as _t, vModelDynamic as Ii, createTextVNode as Ve, isRef as Mi, readonly as W, normalizeProps as Jt, guardReactiveProps as Qt, normalizeStyle as we, provide as H, onBeforeUnmount as Di, useId as ei, resolveComponent as Ti, vShow as Bi } from "vue";
|
|
2
|
+
import { Map as Vi, DrawTool as Pi, RasterLayer as ti, CircleLayer as ii, FillLayer as si, LineLayer as Rt, MapMarker as Oi, MapPopup as Ri } from "@phila/phila-ui-map-core";
|
|
3
3
|
import { cn as Nt, Icon as Te, BaseLink as $i, ActionContent as ai } from "@phila/phila-ui-core";
|
|
4
4
|
const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
5
5
|
__name: "MapPanel",
|
|
@@ -23,84 +23,84 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
23
23
|
initialCenter: { default: void 0 }
|
|
24
24
|
},
|
|
25
25
|
emits: ["zoom", "layerLoading", "layerError"],
|
|
26
|
-
setup(
|
|
27
|
-
const t =
|
|
26
|
+
setup(a, { emit: e }) {
|
|
27
|
+
const t = a, i = e, s = E(null), n = E(null), o = E(0);
|
|
28
28
|
function u(l) {
|
|
29
29
|
i("zoom", l), n.value && (o.value = c(n.value));
|
|
30
30
|
}
|
|
31
31
|
function c(l) {
|
|
32
|
-
const
|
|
33
|
-
return
|
|
34
|
-
}
|
|
35
|
-
const h =
|
|
36
|
-
async function r(l,
|
|
37
|
-
const B = encodeURIComponent(
|
|
38
|
-
xmin:
|
|
39
|
-
ymin:
|
|
40
|
-
xmax:
|
|
41
|
-
ymax:
|
|
32
|
+
const g = l.getZoom(), C = l.getCenter().lat, S = 559082264028e-3, B = C * Math.PI / 180;
|
|
33
|
+
return S * Math.cos(B) / Math.pow(2, g);
|
|
34
|
+
}
|
|
35
|
+
const h = E({}), d = E(null), m = E(/* @__PURE__ */ new Set());
|
|
36
|
+
async function r(l, g, p, C, S) {
|
|
37
|
+
const B = encodeURIComponent(C || "1=1"), j = JSON.stringify({
|
|
38
|
+
xmin: g.west,
|
|
39
|
+
ymin: g.south,
|
|
40
|
+
xmax: g.east,
|
|
41
|
+
ymax: g.north,
|
|
42
42
|
spatialReference: { wkid: 4326 }
|
|
43
|
-
}), ae =
|
|
44
|
-
let Ce = 0,
|
|
43
|
+
}), ae = S !== void 0 && S < 14 ? `&maxAllowableOffset=${360 / (Math.pow(2, S) * 512)}` : "", ie = 2e3;
|
|
44
|
+
let Ce = 0, Le = [], ve = !0;
|
|
45
45
|
for (; ve; ) {
|
|
46
46
|
const re = `${l}/query?where=${B}&geometry=${encodeURIComponent(j)}&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&outFields=*&returnGeometry=true&resultRecordCount=${ie}&resultOffset=${Ce}${ae}&f=geojson`, U = await fetch(re);
|
|
47
47
|
if (!U.ok)
|
|
48
48
|
throw new Error(`HTTP ${U.status}: ${U.statusText}`);
|
|
49
|
-
const
|
|
50
|
-
|
|
49
|
+
const J = await U.json();
|
|
50
|
+
J.features && J.features.length > 0 ? (Le = Le.concat(J.features), Ce += J.features.length, ve = J.features.length === ie) : ve = !1;
|
|
51
51
|
}
|
|
52
|
-
return
|
|
52
|
+
return Le = Le.map((re) => {
|
|
53
53
|
if (re.properties) {
|
|
54
54
|
const U = {};
|
|
55
|
-
for (const
|
|
56
|
-
U[
|
|
55
|
+
for (const J of Object.keys(re.properties))
|
|
56
|
+
U[J.toLowerCase()] = re.properties[J];
|
|
57
57
|
return { ...re, properties: U };
|
|
58
58
|
}
|
|
59
59
|
return re;
|
|
60
60
|
}), {
|
|
61
61
|
type: "FeatureCollection",
|
|
62
|
-
features:
|
|
62
|
+
features: Le
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
async function
|
|
66
|
-
const
|
|
67
|
-
const B = t.layerList.find((j) => j.config.id ===
|
|
65
|
+
async function f(l, g, p) {
|
|
66
|
+
const C = g.map(async (S) => {
|
|
67
|
+
const B = t.layerList.find((j) => j.config.id === S)?.config;
|
|
68
68
|
if (B) {
|
|
69
|
-
i("layerLoading",
|
|
69
|
+
i("layerLoading", S, !0);
|
|
70
70
|
try {
|
|
71
|
-
const j = await r(B.url, l,
|
|
72
|
-
h.value = { ...h.value, [
|
|
71
|
+
const j = await r(B.url, l, S, B.where, p);
|
|
72
|
+
h.value = { ...h.value, [S]: j }, i("layerError", S, null);
|
|
73
73
|
} catch (j) {
|
|
74
74
|
const ae = j instanceof Error ? j.message : "Failed to load";
|
|
75
|
-
i("layerError",
|
|
75
|
+
i("layerError", S, ae);
|
|
76
76
|
} finally {
|
|
77
|
-
i("layerLoading",
|
|
77
|
+
i("layerLoading", S, !1);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
|
-
await Promise.all(
|
|
81
|
+
await Promise.all(C);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
const
|
|
83
|
+
function v(l) {
|
|
84
|
+
const g = new Set(l);
|
|
85
85
|
for (const p of t.layerList)
|
|
86
|
-
p.config.parentId &&
|
|
87
|
-
return [...
|
|
86
|
+
p.config.parentId && g.has(p.config.parentId) && g.add(p.config.id);
|
|
87
|
+
return [...g];
|
|
88
88
|
}
|
|
89
|
-
async function k(l,
|
|
90
|
-
const p =
|
|
91
|
-
await
|
|
89
|
+
async function k(l, g) {
|
|
90
|
+
const p = v([...t.visibleLayers]);
|
|
91
|
+
await f(l, p, g);
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function b(l) {
|
|
94
94
|
d.value = l.bounds, k(l.bounds, l.zoom);
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function A(l) {
|
|
97
97
|
n.value = l;
|
|
98
|
-
const
|
|
98
|
+
const g = l.getBounds();
|
|
99
99
|
d.value = {
|
|
100
|
-
west:
|
|
101
|
-
south:
|
|
102
|
-
east:
|
|
103
|
-
north:
|
|
100
|
+
west: g.getWest(),
|
|
101
|
+
south: g.getSouth(),
|
|
102
|
+
east: g.getEast(),
|
|
103
|
+
north: g.getNorth()
|
|
104
104
|
};
|
|
105
105
|
const p = l.getZoom();
|
|
106
106
|
i("zoom", p), o.value = c(l), k(d.value, p);
|
|
@@ -109,47 +109,48 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
109
109
|
() => t.visibleLayers,
|
|
110
110
|
async () => {
|
|
111
111
|
if (ge.value.length > 0 && Ze(), d.value) {
|
|
112
|
-
const l = new Set(t.visibleLayers),
|
|
113
|
-
|
|
114
|
-
const p =
|
|
112
|
+
const l = new Set(t.visibleLayers), g = [...l].filter((C) => !m.value.has(C));
|
|
113
|
+
m.value = new Set(l);
|
|
114
|
+
const p = v(g);
|
|
115
115
|
if (p.length > 0) {
|
|
116
|
-
const
|
|
117
|
-
await
|
|
116
|
+
const C = n.value?.getZoom();
|
|
117
|
+
await f(d.value, p, C);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
);
|
|
122
|
-
function
|
|
122
|
+
function I(l) {
|
|
123
123
|
if (t.visibleLayers.has(l)) return !0;
|
|
124
|
-
const
|
|
125
|
-
return !!
|
|
124
|
+
const g = t.layerList.find((p) => p.config.id === l)?.config;
|
|
125
|
+
return !!g?.parentId && t.visibleLayers.has(g.parentId);
|
|
126
126
|
}
|
|
127
127
|
function z(l) {
|
|
128
128
|
return !!h.value[l.id];
|
|
129
129
|
}
|
|
130
|
-
const
|
|
131
|
-
() => t.layerList.filter((l) => l.config.type === "circle" &&
|
|
130
|
+
const M = $(
|
|
131
|
+
() => t.layerList.filter((l) => l.config.type === "circle" && I(l.config.id) && z(l.config)).map((l) => l.config)
|
|
132
132
|
), T = $(
|
|
133
|
-
() => t.layerList.filter((l) => l.config.type === "fill" &&
|
|
134
|
-
),
|
|
133
|
+
() => t.layerList.filter((l) => l.config.type === "fill" && I(l.config.id) && z(l.config)).map((l) => l.config)
|
|
134
|
+
), R = $(
|
|
135
135
|
() => t.layerList.filter(
|
|
136
|
-
(l) => l.config.type === "fill" && l.config.outlinePaint &&
|
|
136
|
+
(l) => l.config.type === "fill" && l.config.outlinePaint && I(l.config.id) && z(l.config)
|
|
137
137
|
).map((l) => l.config)
|
|
138
138
|
), se = $(
|
|
139
|
-
() => t.layerList.filter((l) => l.config.type === "line" &&
|
|
139
|
+
() => t.layerList.filter((l) => l.config.type === "line" && I(l.config.id) && z(l.config)).map((l) => l.config)
|
|
140
140
|
);
|
|
141
141
|
le(se, async (l) => {
|
|
142
142
|
if (l.length < 2) return;
|
|
143
143
|
await et();
|
|
144
|
-
const
|
|
145
|
-
if (
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
144
|
+
const g = n.value;
|
|
145
|
+
if (!g) return;
|
|
146
|
+
const p = [...l].sort((C, S) => (C.zOrder ?? 0) - (S.zOrder ?? 0));
|
|
147
|
+
for (let C = p.length - 1; C >= 0; C--) {
|
|
148
|
+
const S = C < p.length - 1 ? p[C + 1].id : "highlight-lines";
|
|
149
|
+
try {
|
|
150
|
+
g.getLayer(p[C].id) && g.moveLayer(p[C].id, S);
|
|
151
|
+
} catch {
|
|
152
152
|
}
|
|
153
|
+
}
|
|
153
154
|
});
|
|
154
155
|
function q(l) {
|
|
155
156
|
return t.visibleTiledLayers?.has(l) ?? !1;
|
|
@@ -168,22 +169,22 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
168
169
|
attribution: l.attribution || ""
|
|
169
170
|
};
|
|
170
171
|
}
|
|
171
|
-
const tt =
|
|
172
|
+
const tt = E({}), ht = E(/* @__PURE__ */ new Set());
|
|
172
173
|
async function it(l) {
|
|
173
174
|
if (!ht.value.has(l.id)) {
|
|
174
175
|
ht.value.add(l.id);
|
|
175
176
|
try {
|
|
176
|
-
const
|
|
177
|
+
const g = l.url.replace(/\/$/, ""), p = await fetch(`${g}?f=json`);
|
|
177
178
|
if (!p.ok)
|
|
178
179
|
return;
|
|
179
|
-
const
|
|
180
|
-
let B =
|
|
181
|
-
if (
|
|
182
|
-
for (const j of
|
|
180
|
+
const C = await p.json(), S = C.minScale || 0;
|
|
181
|
+
let B = C.maxScale || 0;
|
|
182
|
+
if (C.layers && C.layers.length > 0)
|
|
183
|
+
for (const j of C.layers)
|
|
183
184
|
j.maxScale && j.maxScale > 0 && (B === 0 || j.maxScale < B) && (B = j.maxScale);
|
|
184
185
|
B === 0 && (B = 72e3), tt.value = {
|
|
185
186
|
...tt.value,
|
|
186
|
-
[l.id]: { minScale:
|
|
187
|
+
[l.id]: { minScale: S, maxScale: B }
|
|
187
188
|
};
|
|
188
189
|
} catch {
|
|
189
190
|
}
|
|
@@ -197,13 +198,13 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
197
198
|
function pt(l) {
|
|
198
199
|
if (!l.scaleBasedRendering)
|
|
199
200
|
return "tiled";
|
|
200
|
-
const
|
|
201
|
-
if (!
|
|
201
|
+
const g = tt.value[l.id];
|
|
202
|
+
if (!g)
|
|
202
203
|
return "tiled";
|
|
203
204
|
const p = o.value;
|
|
204
|
-
return p === 0 || p >
|
|
205
|
+
return p === 0 || p > g.maxScale ? "tiled" : "dynamic";
|
|
205
206
|
}
|
|
206
|
-
const Mt = $(() => t.tiledLayers ? t.tiledLayers.filter((l) => q(l.id) ? l.scaleBasedRendering ? pt(l) === "tiled" : !0 : !1) : []),
|
|
207
|
+
const Mt = $(() => t.tiledLayers ? t.tiledLayers.filter((l) => q(l.id) ? l.scaleBasedRendering ? pt(l) === "tiled" : !0 : !1) : []), He = $(() => t.tiledLayers ? t.tiledLayers.filter((l) => q(l.id) && l.scaleBasedRendering ? pt(l) === "dynamic" : !1) : []);
|
|
207
208
|
function st(l) {
|
|
208
209
|
return {
|
|
209
210
|
type: "raster",
|
|
@@ -212,142 +213,142 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
212
213
|
attribution: l.attribution || ""
|
|
213
214
|
};
|
|
214
215
|
}
|
|
215
|
-
function
|
|
216
|
+
function Re(l) {
|
|
216
217
|
return { type: "geojson", data: h.value[l.id], tolerance: 0 };
|
|
217
218
|
}
|
|
218
219
|
function ze(l) {
|
|
219
220
|
return t.layerOpacities[l] ?? 1;
|
|
220
221
|
}
|
|
221
222
|
function at(l) {
|
|
222
|
-
const
|
|
223
|
+
const g = ze(l.id), p = l.type === "circle" ? "circle-opacity" : l.type === "fill" ? "fill-opacity" : "line-opacity";
|
|
223
224
|
if (l.type === "fill" && l.paint["fill-opacity"] === 0)
|
|
224
225
|
return { ...l.paint, "fill-opacity": 0 };
|
|
225
|
-
const
|
|
226
|
+
const C = l.type === "circle" ? "circle-color" : l.type === "fill" ? "fill-color" : "line-color", S = { ...l.paint }, B = S[C], j = S[p] === 1, ae = typeof B == "string" && B.startsWith("rgba(");
|
|
226
227
|
if (j && ae) {
|
|
227
|
-
if (
|
|
228
|
-
return
|
|
228
|
+
if (g === 1)
|
|
229
|
+
return S;
|
|
229
230
|
{
|
|
230
231
|
const ie = B.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);
|
|
231
232
|
if (ie && ie[4]) {
|
|
232
|
-
const [, Ce,
|
|
233
|
-
|
|
233
|
+
const [, Ce, Le, ve, re] = ie, U = parseFloat(re) * g;
|
|
234
|
+
S[C] = `rgba(${Ce}, ${Le}, ${ve}, ${U})`, S[p] = 1;
|
|
234
235
|
}
|
|
235
|
-
return
|
|
236
|
+
return S;
|
|
236
237
|
}
|
|
237
238
|
}
|
|
238
239
|
if (ae) {
|
|
239
240
|
const ie = B.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);
|
|
240
241
|
if (ie) {
|
|
241
|
-
const [, Ce,
|
|
242
|
-
|
|
242
|
+
const [, Ce, Le, ve] = ie;
|
|
243
|
+
S[C] = `rgb(${Ce}, ${Le}, ${ve})`;
|
|
243
244
|
}
|
|
244
245
|
}
|
|
245
|
-
return
|
|
246
|
+
return S[p] = g, S;
|
|
246
247
|
}
|
|
247
248
|
function Dt(l) {
|
|
248
|
-
const
|
|
249
|
-
return { ...l.outlinePaint, "line-opacity":
|
|
249
|
+
const g = ze(l.id);
|
|
250
|
+
return { ...l.outlinePaint, "line-opacity": g };
|
|
250
251
|
}
|
|
251
|
-
const ge =
|
|
252
|
+
const ge = E([]), Ue = E(null), ce = E(0);
|
|
252
253
|
function We(l) {
|
|
253
|
-
const
|
|
254
|
-
return t.layerList.find((
|
|
254
|
+
const g = l.replace(/-outline$/, "");
|
|
255
|
+
return t.layerList.find((C) => C.config.id === g)?.config;
|
|
255
256
|
}
|
|
256
|
-
function ft(l,
|
|
257
|
-
return l.replace(/\{([^}]+)\}/g, (p,
|
|
258
|
-
const
|
|
259
|
-
return
|
|
257
|
+
function ft(l, g) {
|
|
258
|
+
return l.replace(/\{([^}]+)\}/g, (p, C) => {
|
|
259
|
+
const S = g[C];
|
|
260
|
+
return S == null ? "" : String(S);
|
|
260
261
|
});
|
|
261
262
|
}
|
|
262
263
|
function Fe(l) {
|
|
263
264
|
return l.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
264
265
|
}
|
|
265
|
-
function nt(l,
|
|
266
|
+
function nt(l, g, p) {
|
|
266
267
|
if (l == null) return "-";
|
|
267
|
-
if (
|
|
268
|
-
const
|
|
269
|
-
if (p &&
|
|
270
|
-
return
|
|
271
|
-
switch (
|
|
268
|
+
if (g?.dateFormat && typeof l == "number") {
|
|
269
|
+
const C = new Date(l);
|
|
270
|
+
if (p && g.dateFormat === "shortDateShortTime")
|
|
271
|
+
return C.toLocaleString(void 0, { dateStyle: "short", timeStyle: "short" });
|
|
272
|
+
switch (g.dateFormat) {
|
|
272
273
|
case "shortDateShortTime":
|
|
273
|
-
return
|
|
274
|
+
return C.toLocaleDateString();
|
|
274
275
|
case "longMonthDayYear":
|
|
275
|
-
return
|
|
276
|
+
return C.toLocaleDateString(void 0, { month: "long", day: "numeric", year: "numeric" });
|
|
276
277
|
case "shortDate":
|
|
277
|
-
return
|
|
278
|
+
return C.toLocaleDateString();
|
|
278
279
|
case "longDate":
|
|
279
|
-
return
|
|
280
|
+
return C.toLocaleDateString(void 0, { weekday: "long", month: "long", day: "numeric", year: "numeric" });
|
|
280
281
|
default:
|
|
281
|
-
return
|
|
282
|
+
return C.toLocaleDateString();
|
|
282
283
|
}
|
|
283
284
|
}
|
|
284
285
|
if (typeof l == "number") {
|
|
285
|
-
if (l > 1e12 && !
|
|
286
|
+
if (l > 1e12 && !g)
|
|
286
287
|
return new Date(l).toLocaleDateString();
|
|
287
|
-
const
|
|
288
|
-
if (
|
|
289
|
-
if (Number.isInteger(l) &&
|
|
288
|
+
const C = g?.places, S = g?.digitSeparator ?? !0;
|
|
289
|
+
if (C !== void 0) {
|
|
290
|
+
if (Number.isInteger(l) && C >= 0)
|
|
290
291
|
return String(l);
|
|
291
|
-
const B = l.toFixed(
|
|
292
|
-
if (
|
|
292
|
+
const B = l.toFixed(C);
|
|
293
|
+
if (S) {
|
|
293
294
|
const j = B.split("."), ae = j[0] || "0", ie = j[1], Ce = ae.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
294
295
|
return ie ? `${Ce}.${ie}` : Ce;
|
|
295
296
|
}
|
|
296
297
|
return B;
|
|
297
298
|
}
|
|
298
|
-
return Number.isInteger(l) ? String(l) :
|
|
299
|
+
return Number.isInteger(l) ? String(l) : S ? l.toLocaleString() : String(l);
|
|
299
300
|
}
|
|
300
301
|
return String(l);
|
|
301
302
|
}
|
|
302
303
|
function mt(l) {
|
|
303
|
-
const
|
|
304
|
+
const g = /* @__PURE__ */ new Set();
|
|
304
305
|
return l.filter((p) => {
|
|
305
|
-
const
|
|
306
|
-
return
|
|
306
|
+
const S = `${p.layer.id.replace(/-outline$/, "")}:${JSON.stringify(p.properties)}`;
|
|
307
|
+
return g.has(S) ? !1 : (g.add(S), !0);
|
|
307
308
|
});
|
|
308
309
|
}
|
|
309
|
-
function
|
|
310
|
+
function Me(l, g) {
|
|
310
311
|
const p = h.value[l];
|
|
311
312
|
if (!p?.features) return null;
|
|
312
|
-
const
|
|
313
|
-
if (
|
|
314
|
-
const
|
|
315
|
-
(B) => (B.properties?.objectid ?? B.properties?.OBJECTID ?? B.properties?.FID) ===
|
|
313
|
+
const C = g.objectid ?? g.OBJECTID ?? g.FID;
|
|
314
|
+
if (C != null) {
|
|
315
|
+
const S = p.features.find(
|
|
316
|
+
(B) => (B.properties?.objectid ?? B.properties?.OBJECTID ?? B.properties?.FID) === C
|
|
316
317
|
);
|
|
317
|
-
if (
|
|
318
|
+
if (S) return S.geometry;
|
|
318
319
|
}
|
|
319
320
|
return null;
|
|
320
321
|
}
|
|
321
|
-
function Tt(l,
|
|
322
|
+
function Tt(l, g) {
|
|
322
323
|
const p = /* @__PURE__ */ new Map();
|
|
323
|
-
return
|
|
324
|
-
p.set(
|
|
325
|
-
}), l.sort((
|
|
326
|
-
const B =
|
|
324
|
+
return g.forEach((C, S) => {
|
|
325
|
+
p.set(C.id, S);
|
|
326
|
+
}), l.sort((C, S) => {
|
|
327
|
+
const B = C.layer.id.replace(/-outline$/, ""), j = S.layer.id.replace(/-outline$/, ""), ae = p.get(B) ?? -1;
|
|
327
328
|
return (p.get(j) ?? -1) - ae;
|
|
328
329
|
});
|
|
329
330
|
}
|
|
330
331
|
function de(l) {
|
|
331
|
-
const
|
|
332
|
-
if (!
|
|
332
|
+
const g = n.value;
|
|
333
|
+
if (!g) return;
|
|
333
334
|
const p = [];
|
|
334
335
|
t.layerList.forEach((U) => {
|
|
335
|
-
const
|
|
336
|
-
|
|
336
|
+
const J = U.config;
|
|
337
|
+
I(J.id) && (p.push(J.id), J.outlinePaint && p.push(`${J.id}-outline`));
|
|
337
338
|
});
|
|
338
|
-
const
|
|
339
|
-
if (
|
|
340
|
-
const
|
|
341
|
-
[
|
|
342
|
-
[
|
|
343
|
-
], ae =
|
|
344
|
-
layers:
|
|
339
|
+
const C = p.filter((U) => g.getLayer(U));
|
|
340
|
+
if (C.length === 0) return;
|
|
341
|
+
const S = g.project([l.lngLat.lng, l.lngLat.lat]), B = 10, j = [
|
|
342
|
+
[S.x - B, S.y - B],
|
|
343
|
+
[S.x + B, S.y + B]
|
|
344
|
+
], ae = g.queryRenderedFeatures(j, {
|
|
345
|
+
layers: C
|
|
345
346
|
});
|
|
346
347
|
if (ae.length === 0) return;
|
|
347
348
|
const ie = mt(ae), Ce = t.layerList.map((U) => U.config), ve = Tt(ie, Ce).map((U) => {
|
|
348
|
-
const
|
|
349
|
+
const J = U.layer.id.replace(/-outline$/, ""), ye = We(J);
|
|
349
350
|
if (!ye) return null;
|
|
350
|
-
const Vt =
|
|
351
|
+
const Vt = Me(ye.id, U.properties || {});
|
|
351
352
|
return {
|
|
352
353
|
layerId: ye.id,
|
|
353
354
|
layerTitle: ye.title,
|
|
@@ -357,22 +358,22 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
357
358
|
};
|
|
358
359
|
}).filter((U) => U !== null);
|
|
359
360
|
if (ve.length === 0) return;
|
|
360
|
-
ve.sort((U,
|
|
361
|
-
const ye = U.popupConfig?.popupSortField, Vt =
|
|
361
|
+
ve.sort((U, J) => {
|
|
362
|
+
const ye = U.popupConfig?.popupSortField, Vt = J.popupConfig?.popupSortField;
|
|
362
363
|
if (!ye || ye !== Vt) return 0;
|
|
363
|
-
const Pt = U.properties[ye],
|
|
364
|
-
if (Pt == null ||
|
|
364
|
+
const Pt = U.properties[ye], Ot = J.properties[ye];
|
|
365
|
+
if (Pt == null || Ot == null) return 0;
|
|
365
366
|
const Xt = U.popupConfig?.popupSortOrder !== "asc";
|
|
366
|
-
return Pt <
|
|
367
|
+
return Pt < Ot ? Xt ? 1 : -1 : Pt > Ot ? Xt ? -1 : 1 : 0;
|
|
367
368
|
}), ge.value = ve, ce.value = 0, Ue.value = [l.lngLat.lng, l.lngLat.lat];
|
|
368
369
|
const re = ve[0];
|
|
369
370
|
if (re) {
|
|
370
371
|
const U = We(re.layerId);
|
|
371
372
|
if (U) {
|
|
372
|
-
const
|
|
373
|
+
const J = te(re.geometry), ye = G(U.id, U.type);
|
|
373
374
|
F.value = {
|
|
374
375
|
geometry: re.geometry,
|
|
375
|
-
geometryType:
|
|
376
|
+
geometryType: J,
|
|
376
377
|
layerId: U.id,
|
|
377
378
|
properties: re.properties,
|
|
378
379
|
originalStyle: ye
|
|
@@ -385,8 +386,8 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
385
386
|
}
|
|
386
387
|
function je(l) {
|
|
387
388
|
if (ge.value.length === 0) return;
|
|
388
|
-
const
|
|
389
|
-
if (!(
|
|
389
|
+
const g = l.target;
|
|
390
|
+
if (!(g.tagName === "INPUT" || g.tagName === "TEXTAREA" || g.isContentEditable))
|
|
390
391
|
switch (l.key) {
|
|
391
392
|
case "ArrowLeft":
|
|
392
393
|
case "ArrowUp":
|
|
@@ -419,23 +420,23 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
419
420
|
}), Ye = $(() => {
|
|
420
421
|
const l = he.value;
|
|
421
422
|
if (!l) return "";
|
|
422
|
-
let
|
|
423
|
-
if (
|
|
424
|
-
|
|
423
|
+
let g = '<div class="popup-content">';
|
|
424
|
+
if (g += `<h3 class="popup-title">${Fe(Ke.value)}</h3>`, l.popupConfig?.fields?.length) {
|
|
425
|
+
g += `<table class="popup-table" aria-label="${Fe(Ke.value)}">`;
|
|
425
426
|
for (const p of l.popupConfig.fields) {
|
|
426
|
-
const
|
|
427
|
-
|
|
427
|
+
const C = nt(l.properties[p.field], p.format, l.popupConfig.showTime), S = p.label.toLowerCase(), B = S.includes("url") || S.includes("website"), j = C.startsWith("http://") || C.startsWith("https://") || C.startsWith("www.") || B && C.includes("."), ae = C.startsWith("http://") || C.startsWith("https://") ? C : `https://${C}`, ie = j ? `<a href="${Fe(ae)}" target="_blank" rel="noopener noreferrer">${Fe(C)}</a>` : Fe(C);
|
|
428
|
+
g += `<tr><th scope="row">${Fe(p.label)}</th><td>${ie}</td></tr>`;
|
|
428
429
|
}
|
|
429
|
-
|
|
430
|
+
g += "</table>";
|
|
430
431
|
}
|
|
431
|
-
return
|
|
432
|
-
}), pe =
|
|
432
|
+
return g += "</div>", g;
|
|
433
|
+
}), pe = E({
|
|
433
434
|
type: "FeatureCollection",
|
|
434
435
|
features: []
|
|
435
|
-
}), Xe =
|
|
436
|
+
}), Xe = E({
|
|
436
437
|
type: "FeatureCollection",
|
|
437
438
|
features: []
|
|
438
|
-
}), Je =
|
|
439
|
+
}), Je = E({
|
|
439
440
|
type: "FeatureCollection",
|
|
440
441
|
features: []
|
|
441
442
|
}), Bt = {
|
|
@@ -448,25 +449,25 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
448
449
|
"line-width": ["get", "highlightWidth"],
|
|
449
450
|
"line-color": "#00FFFF",
|
|
450
451
|
"line-opacity": 0.9
|
|
451
|
-
},
|
|
452
|
+
}, w = {
|
|
452
453
|
"fill-color": "#808080",
|
|
453
454
|
"fill-opacity": 0.5
|
|
454
|
-
}, F =
|
|
455
|
-
function
|
|
455
|
+
}, F = E(null);
|
|
456
|
+
function te(l) {
|
|
456
457
|
return l.type;
|
|
457
458
|
}
|
|
458
|
-
function
|
|
459
|
+
function G(l, g) {
|
|
459
460
|
const p = We(l);
|
|
460
461
|
if (!p) return { radius: 5, width: 2 };
|
|
461
|
-
const
|
|
462
|
-
if (
|
|
463
|
-
const
|
|
464
|
-
return typeof
|
|
462
|
+
const C = p.paint || {};
|
|
463
|
+
if (g === "circle") {
|
|
464
|
+
const S = C["circle-radius"];
|
|
465
|
+
return typeof S == "number" ? { radius: S } : { radius: 5 };
|
|
465
466
|
}
|
|
466
|
-
if (
|
|
467
|
-
const
|
|
468
|
-
if (typeof
|
|
469
|
-
return { width:
|
|
467
|
+
if (g === "line" || g === "fill") {
|
|
468
|
+
const S = C["line-width"];
|
|
469
|
+
if (typeof S == "number")
|
|
470
|
+
return { width: S };
|
|
470
471
|
if (p.outlinePaint && p.outlinePaint["line-width"]) {
|
|
471
472
|
const B = p.outlinePaint["line-width"];
|
|
472
473
|
if (typeof B == "number")
|
|
@@ -476,19 +477,19 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
476
477
|
}
|
|
477
478
|
return { radius: 5, width: 2 };
|
|
478
479
|
}
|
|
479
|
-
function
|
|
480
|
+
function X(l) {
|
|
480
481
|
return !l || l.length === 0 ? [] : l[0] ?? [];
|
|
481
482
|
}
|
|
482
|
-
function
|
|
483
|
-
const { geometry:
|
|
483
|
+
function xe(l) {
|
|
484
|
+
const { geometry: g, geometryType: p, originalStyle: C } = l;
|
|
484
485
|
if (p === "Point" || p === "MultiPoint") {
|
|
485
|
-
const B = (
|
|
486
|
+
const B = (C.radius || 5) + 3;
|
|
486
487
|
return {
|
|
487
488
|
type: "FeatureCollection",
|
|
488
489
|
features: [
|
|
489
490
|
{
|
|
490
491
|
type: "Feature",
|
|
491
|
-
geometry:
|
|
492
|
+
geometry: g,
|
|
492
493
|
properties: {
|
|
493
494
|
highlightRadius: B
|
|
494
495
|
}
|
|
@@ -497,13 +498,13 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
497
498
|
};
|
|
498
499
|
}
|
|
499
500
|
if (p === "LineString" || p === "MultiLineString") {
|
|
500
|
-
const B = (
|
|
501
|
+
const B = (C.width || 2) + 3;
|
|
501
502
|
return {
|
|
502
503
|
type: "FeatureCollection",
|
|
503
504
|
features: [
|
|
504
505
|
{
|
|
505
506
|
type: "Feature",
|
|
506
|
-
geometry:
|
|
507
|
+
geometry: g,
|
|
507
508
|
properties: {
|
|
508
509
|
highlightWidth: B
|
|
509
510
|
}
|
|
@@ -512,7 +513,7 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
512
513
|
};
|
|
513
514
|
}
|
|
514
515
|
if (p === "Polygon") {
|
|
515
|
-
const
|
|
516
|
+
const S = g.coordinates, B = X(S), ae = (C.width || 2) + 3;
|
|
516
517
|
return {
|
|
517
518
|
type: "FeatureCollection",
|
|
518
519
|
features: [
|
|
@@ -530,14 +531,14 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
530
531
|
};
|
|
531
532
|
}
|
|
532
533
|
if (p === "MultiPolygon") {
|
|
533
|
-
const
|
|
534
|
+
const S = g.coordinates, j = (C.width || 2) + 3;
|
|
534
535
|
return {
|
|
535
536
|
type: "FeatureCollection",
|
|
536
|
-
features:
|
|
537
|
+
features: S.map((ie) => ({
|
|
537
538
|
type: "Feature",
|
|
538
539
|
geometry: {
|
|
539
540
|
type: "LineString",
|
|
540
|
-
coordinates:
|
|
541
|
+
coordinates: X(ie)
|
|
541
542
|
},
|
|
542
543
|
properties: {
|
|
543
544
|
highlightWidth: j
|
|
@@ -551,10 +552,10 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
551
552
|
};
|
|
552
553
|
}
|
|
553
554
|
function Qe(l) {
|
|
554
|
-
const { geometry:
|
|
555
|
+
const { geometry: g, geometryType: p } = l;
|
|
555
556
|
return p === "Polygon" || p === "MultiPolygon" ? {
|
|
556
557
|
type: "FeatureCollection",
|
|
557
|
-
features: [{ type: "Feature", geometry:
|
|
558
|
+
features: [{ type: "Feature", geometry: g, properties: {} }]
|
|
558
559
|
} : { type: "FeatureCollection", features: [] };
|
|
559
560
|
}
|
|
560
561
|
function Ei(l) {
|
|
@@ -562,8 +563,8 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
562
563
|
Fi();
|
|
563
564
|
return;
|
|
564
565
|
}
|
|
565
|
-
const
|
|
566
|
-
l.geometryType === "Point" || l.geometryType === "MultiPoint" ? (pe.value =
|
|
566
|
+
const g = xe(l);
|
|
567
|
+
l.geometryType === "Point" || l.geometryType === "MultiPoint" ? (pe.value = g, Xe.value = { type: "FeatureCollection", features: [] }, Je.value = { type: "FeatureCollection", features: [] }) : (Xe.value = g, pe.value = { type: "FeatureCollection", features: [] }, Je.value = Qe(l));
|
|
567
568
|
}
|
|
568
569
|
function Fi() {
|
|
569
570
|
pe.value = { type: "FeatureCollection", features: [] }, Xe.value = { type: "FeatureCollection", features: [] }, Je.value = { type: "FeatureCollection", features: [] };
|
|
@@ -582,33 +583,33 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
582
583
|
F.value = null;
|
|
583
584
|
return;
|
|
584
585
|
}
|
|
585
|
-
const
|
|
586
|
-
if (
|
|
587
|
-
const p =
|
|
586
|
+
const g = We(l.layerId);
|
|
587
|
+
if (g) {
|
|
588
|
+
const p = te(l.geometry), C = G(g.id, g.type);
|
|
588
589
|
F.value = {
|
|
589
590
|
geometry: l.geometry,
|
|
590
591
|
geometryType: p,
|
|
591
|
-
layerId:
|
|
592
|
+
layerId: g.id,
|
|
592
593
|
properties: l.properties,
|
|
593
|
-
originalStyle:
|
|
594
|
+
originalStyle: C
|
|
594
595
|
};
|
|
595
596
|
}
|
|
596
597
|
});
|
|
597
|
-
const Yt =
|
|
598
|
+
const Yt = E(null);
|
|
598
599
|
function xi(l) {
|
|
599
|
-
const [
|
|
600
|
-
Yt.value = [
|
|
600
|
+
const [g, p] = l.geometry.coordinates;
|
|
601
|
+
Yt.value = [g, p];
|
|
601
602
|
}
|
|
602
|
-
return (l,
|
|
603
|
-
|
|
603
|
+
return (l, g) => (_(), L("div", Ni, [
|
|
604
|
+
ee(y(Vi), {
|
|
604
605
|
ref_key: "mapRef",
|
|
605
|
-
ref:
|
|
606
|
+
ref: s,
|
|
606
607
|
zoom: t.initialZoom,
|
|
607
608
|
center: t.initialCenter,
|
|
608
609
|
"navigation-controls": { position: t.navigationControlPosition },
|
|
609
610
|
"geolocation-control": { position: t.geolocationControlPosition },
|
|
610
611
|
"basemap-change-controls": { toggle: !0, dropdown: !0, position: t.basemapControlPosition },
|
|
611
|
-
"map-search-control": { position: t.searchControlPosition },
|
|
612
|
+
"map-search-control": { position: t.searchControlPosition, autocomplete: !0 },
|
|
612
613
|
"enable-cyclomedia": !0,
|
|
613
614
|
"cyclomedia-config": t.cyclomediaConfig,
|
|
614
615
|
"cyclomedia-button-position": t.cyclomediaButtonPosition,
|
|
@@ -619,16 +620,16 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
619
620
|
"tool-panel-split-ratio": 50,
|
|
620
621
|
onZoom: u,
|
|
621
622
|
onClick: Ze,
|
|
622
|
-
onMoveend:
|
|
623
|
-
onLoad:
|
|
623
|
+
onMoveend: b,
|
|
624
|
+
onLoad: A,
|
|
624
625
|
onSearchResult: xi
|
|
625
626
|
}, {
|
|
626
627
|
default: rt(() => [
|
|
627
|
-
t.drawControlPosition !== null ? (
|
|
628
|
+
t.drawControlPosition !== null ? (_(), K(y(Pi), {
|
|
628
629
|
key: 0,
|
|
629
630
|
position: t.drawControlPosition
|
|
630
631
|
}, null, 8, ["position"])) : Z("", !0),
|
|
631
|
-
(
|
|
632
|
+
(_(!0), L(ke, null, Ae(Mt.value, (p) => (_(), K(y(ti), {
|
|
632
633
|
id: "tiled-" + p.id,
|
|
633
634
|
key: "tiled-" + p.id,
|
|
634
635
|
source: Ne(p),
|
|
@@ -637,7 +638,7 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
637
638
|
maxzoom: p.maxZoom,
|
|
638
639
|
"before-id": "highlight-circles"
|
|
639
640
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
640
|
-
(
|
|
641
|
+
(_(!0), L(ke, null, Ae(He.value, (p) => (_(), K(y(ti), {
|
|
641
642
|
id: "dynamic-" + p.id,
|
|
642
643
|
key: "dynamic-" + p.id,
|
|
643
644
|
source: st(p),
|
|
@@ -646,69 +647,69 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
646
647
|
maxzoom: p.maxZoom,
|
|
647
648
|
"before-id": "highlight-circles"
|
|
648
649
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
649
|
-
(
|
|
650
|
+
(_(!0), L(ke, null, Ae(M.value, (p) => (_(), K(y(ii), {
|
|
650
651
|
id: p.id,
|
|
651
652
|
key: p.id,
|
|
652
|
-
source:
|
|
653
|
+
source: Re(p),
|
|
653
654
|
paint: at(p),
|
|
654
655
|
minzoom: p.minZoom,
|
|
655
656
|
maxzoom: p.maxZoom,
|
|
656
657
|
"before-id": "highlight-circles",
|
|
657
658
|
onClick: de
|
|
658
659
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
659
|
-
(
|
|
660
|
+
(_(!0), L(ke, null, Ae(T.value, (p) => (_(), K(y(si), {
|
|
660
661
|
id: p.id,
|
|
661
662
|
key: p.id,
|
|
662
|
-
source:
|
|
663
|
+
source: Re(p),
|
|
663
664
|
paint: at(p),
|
|
664
665
|
minzoom: p.minZoom,
|
|
665
666
|
maxzoom: p.maxZoom,
|
|
666
667
|
"before-id": "highlight-circles",
|
|
667
668
|
onClick: de
|
|
668
669
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
669
|
-
(
|
|
670
|
+
(_(!0), L(ke, null, Ae(R.value, (p) => (_(), K(y(Rt), {
|
|
670
671
|
id: p.id + "-outline",
|
|
671
672
|
key: p.id + "-outline",
|
|
672
|
-
source:
|
|
673
|
+
source: Re(p),
|
|
673
674
|
paint: Dt(p),
|
|
674
675
|
minzoom: p.minZoom,
|
|
675
676
|
maxzoom: p.maxZoom,
|
|
676
677
|
"before-id": "highlight-lines",
|
|
677
678
|
onClick: de
|
|
678
679
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
679
|
-
(
|
|
680
|
+
(_(!0), L(ke, null, Ae(se.value, (p) => (_(), K(y(Rt), {
|
|
680
681
|
id: p.id,
|
|
681
682
|
key: p.id,
|
|
682
|
-
source:
|
|
683
|
+
source: Re(p),
|
|
683
684
|
paint: at(p),
|
|
684
685
|
minzoom: p.minZoom,
|
|
685
686
|
maxzoom: p.maxZoom,
|
|
686
687
|
"before-id": "highlight-lines",
|
|
687
688
|
onClick: de
|
|
688
689
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
689
|
-
|
|
690
|
+
ee(y(ii), {
|
|
690
691
|
id: "highlight-circles",
|
|
691
692
|
key: "highlight-circles-layer",
|
|
692
693
|
source: { type: "geojson", data: pe.value },
|
|
693
694
|
paint: Bt
|
|
694
695
|
}, null, 8, ["source"]),
|
|
695
|
-
|
|
696
|
+
ee(y(si), {
|
|
696
697
|
id: "highlight-fill",
|
|
697
698
|
key: "highlight-fill-layer",
|
|
698
699
|
source: { type: "geojson", data: Je.value },
|
|
699
|
-
paint:
|
|
700
|
+
paint: w
|
|
700
701
|
}, null, 8, ["source"]),
|
|
701
|
-
|
|
702
|
+
ee(y(Rt), {
|
|
702
703
|
id: "highlight-lines",
|
|
703
704
|
key: "highlight-lines-layer",
|
|
704
705
|
source: { type: "geojson", data: Xe.value },
|
|
705
706
|
paint: vt
|
|
706
707
|
}, null, 8, ["source"]),
|
|
707
|
-
|
|
708
|
+
ee(y(Oi), {
|
|
708
709
|
"lng-lat": Yt.value,
|
|
709
710
|
color: "#2176d2"
|
|
710
711
|
}, null, 8, ["lng-lat"]),
|
|
711
|
-
he.value && Ue.value ? (
|
|
712
|
+
he.value && Ue.value ? (_(), K(y(Ri), {
|
|
712
713
|
key: 1,
|
|
713
714
|
"lng-lat": Ue.value,
|
|
714
715
|
html: Ye.value,
|
|
@@ -727,14 +728,14 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
727
728
|
}, 8, ["zoom", "center", "navigation-controls", "geolocation-control", "basemap-change-controls", "map-search-control", "cyclomedia-config", "cyclomedia-button-position", "pictometry-credentials", "pictometry-button-position"])
|
|
728
729
|
]));
|
|
729
730
|
}
|
|
730
|
-
}),
|
|
731
|
-
const t =
|
|
732
|
-
for (const [i,
|
|
733
|
-
t[i] =
|
|
731
|
+
}), Oe = (a, e) => {
|
|
732
|
+
const t = a.__vccOpts || a;
|
|
733
|
+
for (const [i, s] of e)
|
|
734
|
+
t[i] = s;
|
|
734
735
|
return t;
|
|
735
|
-
}, Ui = /* @__PURE__ */
|
|
736
|
-
function fi(
|
|
737
|
-
let e =
|
|
736
|
+
}, Ui = /* @__PURE__ */ Oe(zi, [["__scopeId", "data-v-d42acf96"]]);
|
|
737
|
+
function fi(a) {
|
|
738
|
+
let e = a.split("?")[0] || a;
|
|
738
739
|
return e = e.replace(/\/query$/, ""), e = e.replace(/\/$/, ""), e = e.replace(/^https?:\/\//, ""), e.toLowerCase();
|
|
739
740
|
}
|
|
740
741
|
const Zi = ["disabled"], ji = /* @__PURE__ */ be({
|
|
@@ -758,15 +759,15 @@ const Zi = ["disabled"], ji = /* @__PURE__ */ be({
|
|
|
758
759
|
src: {},
|
|
759
760
|
svgRaw: {}
|
|
760
761
|
},
|
|
761
|
-
setup(
|
|
762
|
-
const e =
|
|
762
|
+
setup(a) {
|
|
763
|
+
const e = a, t = (o) => "href" in o && o.href !== void 0 || "to" in o && o.to !== void 0, i = $(() => Nt(
|
|
763
764
|
"phila-button",
|
|
764
765
|
`phila-button--${e.variant}`,
|
|
765
766
|
e.size && `is-${e.size}`,
|
|
766
767
|
e.iconOnly && "icon-button",
|
|
767
768
|
e.iconOnly && e.variant === "standard" && "icon-button--standard",
|
|
768
769
|
e.className
|
|
769
|
-
)),
|
|
770
|
+
)), s = $(() => t(e) ? "to" in e && e.to !== void 0 ? {
|
|
770
771
|
to: e.to,
|
|
771
772
|
disabled: e.disabled,
|
|
772
773
|
className: i.value
|
|
@@ -787,28 +788,28 @@ const Zi = ["disabled"], ji = /* @__PURE__ */ be({
|
|
|
787
788
|
size: e.size
|
|
788
789
|
})
|
|
789
790
|
);
|
|
790
|
-
return (o, u) => t(e) ? (
|
|
791
|
+
return (o, u) => t(e) ? (_(), K(y($i), _t({ key: 0 }, { ...s.value, ...o.$attrs }, { role: "button" }), {
|
|
791
792
|
default: rt(() => [
|
|
792
|
-
|
|
793
|
+
ee(y(ai), Jt(Qt(n.value)), {
|
|
793
794
|
default: rt(() => [
|
|
794
795
|
Se(o.$slots, "default", {}, () => [
|
|
795
|
-
Ve(
|
|
796
|
+
Ve(Q(e.text), 1)
|
|
796
797
|
])
|
|
797
798
|
]),
|
|
798
799
|
_: 3
|
|
799
800
|
}, 16)
|
|
800
801
|
]),
|
|
801
802
|
_: 3
|
|
802
|
-
}, 16)) : (
|
|
803
|
+
}, 16)) : (_(), L("button", _t({
|
|
803
804
|
key: 1,
|
|
804
805
|
type: "button",
|
|
805
806
|
disabled: e.disabled,
|
|
806
807
|
class: i.value
|
|
807
808
|
}, o.$attrs), [
|
|
808
|
-
|
|
809
|
+
ee(y(ai), Jt(Qt(n.value)), {
|
|
809
810
|
default: rt(() => [
|
|
810
811
|
Se(o.$slots, "default", {}, () => [
|
|
811
|
-
Ve(
|
|
812
|
+
Ve(Q(e.text), 1)
|
|
812
813
|
])
|
|
813
814
|
]),
|
|
814
815
|
_: 3
|
|
@@ -820,22 +821,22 @@ var qi = {
|
|
|
820
821
|
prefix: "fas",
|
|
821
822
|
iconName: "circle-exclamation",
|
|
822
823
|
icon: [512, 512, ["exclamation-circle"], "f06a", "M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]
|
|
823
|
-
},
|
|
824
|
+
}, Gi = qi, Hi = {
|
|
824
825
|
prefix: "fas",
|
|
825
826
|
iconName: "xmark",
|
|
826
827
|
icon: [384, 512, [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], "f00d", "M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]
|
|
827
|
-
}, Wi =
|
|
828
|
-
function $e(
|
|
829
|
-
return typeof
|
|
828
|
+
}, Wi = Hi;
|
|
829
|
+
function $e(a) {
|
|
830
|
+
return typeof a == "string" || a instanceof String;
|
|
830
831
|
}
|
|
831
|
-
function ni(
|
|
832
|
+
function ni(a) {
|
|
832
833
|
var e;
|
|
833
|
-
return typeof
|
|
834
|
+
return typeof a == "object" && a != null && (a == null || (e = a.constructor) == null ? void 0 : e.name) === "Object";
|
|
834
835
|
}
|
|
835
|
-
function mi(
|
|
836
|
-
return Array.isArray(e) ? mi(
|
|
837
|
-
let [
|
|
838
|
-
return e(n,
|
|
836
|
+
function mi(a, e) {
|
|
837
|
+
return Array.isArray(e) ? mi(a, (t, i) => e.includes(i)) : Object.entries(a).reduce((t, i) => {
|
|
838
|
+
let [s, n] = i;
|
|
839
|
+
return e(n, s) && (t[s] = n), t;
|
|
839
840
|
}, {});
|
|
840
841
|
}
|
|
841
842
|
const x = {
|
|
@@ -845,42 +846,42 @@ const x = {
|
|
|
845
846
|
RIGHT: "RIGHT",
|
|
846
847
|
FORCE_RIGHT: "FORCE_RIGHT"
|
|
847
848
|
};
|
|
848
|
-
function Ki(
|
|
849
|
-
switch (
|
|
849
|
+
function Ki(a) {
|
|
850
|
+
switch (a) {
|
|
850
851
|
case x.LEFT:
|
|
851
852
|
return x.FORCE_LEFT;
|
|
852
853
|
case x.RIGHT:
|
|
853
854
|
return x.FORCE_RIGHT;
|
|
854
855
|
default:
|
|
855
|
-
return
|
|
856
|
+
return a;
|
|
856
857
|
}
|
|
857
858
|
}
|
|
858
|
-
function $t(
|
|
859
|
-
return
|
|
859
|
+
function $t(a) {
|
|
860
|
+
return a.replace(/([.*+?^=!:${}()|[\]/\\])/g, "\\$1");
|
|
860
861
|
}
|
|
861
|
-
function Ct(
|
|
862
|
-
if (e ===
|
|
863
|
-
const t = Array.isArray(e), i = Array.isArray(
|
|
864
|
-
let
|
|
862
|
+
function Ct(a, e) {
|
|
863
|
+
if (e === a) return !0;
|
|
864
|
+
const t = Array.isArray(e), i = Array.isArray(a);
|
|
865
|
+
let s;
|
|
865
866
|
if (t && i) {
|
|
866
|
-
if (e.length !=
|
|
867
|
-
for (
|
|
867
|
+
if (e.length != a.length) return !1;
|
|
868
|
+
for (s = 0; s < e.length; s++) if (!Ct(e[s], a[s])) return !1;
|
|
868
869
|
return !0;
|
|
869
870
|
}
|
|
870
871
|
if (t != i) return !1;
|
|
871
|
-
if (e &&
|
|
872
|
-
const n = e instanceof Date, o =
|
|
873
|
-
if (n && o) return e.getTime() ==
|
|
872
|
+
if (e && a && typeof e == "object" && typeof a == "object") {
|
|
873
|
+
const n = e instanceof Date, o = a instanceof Date;
|
|
874
|
+
if (n && o) return e.getTime() == a.getTime();
|
|
874
875
|
if (n != o) return !1;
|
|
875
|
-
const u = e instanceof RegExp, c =
|
|
876
|
-
if (u && c) return e.toString() ==
|
|
876
|
+
const u = e instanceof RegExp, c = a instanceof RegExp;
|
|
877
|
+
if (u && c) return e.toString() == a.toString();
|
|
877
878
|
if (u != c) return !1;
|
|
878
879
|
const h = Object.keys(e);
|
|
879
|
-
for (
|
|
880
|
-
for (
|
|
880
|
+
for (s = 0; s < h.length; s++) if (!Object.prototype.hasOwnProperty.call(a, h[s])) return !1;
|
|
881
|
+
for (s = 0; s < h.length; s++) if (!Ct(a[h[s]], e[h[s]])) return !1;
|
|
881
882
|
return !0;
|
|
882
|
-
} else if (e &&
|
|
883
|
-
return e.toString() ===
|
|
883
|
+
} else if (e && a && typeof e == "function" && typeof a == "function")
|
|
884
|
+
return e.toString() === a.toString();
|
|
884
885
|
return !1;
|
|
885
886
|
}
|
|
886
887
|
class Yi {
|
|
@@ -930,44 +931,44 @@ class Yi {
|
|
|
930
931
|
this.oldSelection.end === this.oldSelection.start ? x.RIGHT : x.LEFT;
|
|
931
932
|
}
|
|
932
933
|
}
|
|
933
|
-
function V(
|
|
934
|
-
return new V.InputMask(
|
|
934
|
+
function V(a, e) {
|
|
935
|
+
return new V.InputMask(a, e);
|
|
935
936
|
}
|
|
936
|
-
function gi(
|
|
937
|
-
if (
|
|
938
|
-
return
|
|
937
|
+
function gi(a) {
|
|
938
|
+
if (a == null) throw new Error("mask property should be defined");
|
|
939
|
+
return a instanceof RegExp ? V.MaskedRegExp : $e(a) ? V.MaskedPattern : a === Date ? V.MaskedDate : a === Number ? V.MaskedNumber : Array.isArray(a) || a === Array ? V.MaskedDynamic : V.Masked && a.prototype instanceof V.Masked ? a : V.Masked && a instanceof V.Masked ? a.constructor : a instanceof Function ? V.MaskedFunction : V.Masked;
|
|
939
940
|
}
|
|
940
|
-
function ct(
|
|
941
|
-
if (!
|
|
941
|
+
function ct(a) {
|
|
942
|
+
if (!a) throw new Error("Options in not defined");
|
|
942
943
|
if (V.Masked) {
|
|
943
|
-
if (
|
|
944
|
-
mask:
|
|
944
|
+
if (a.prototype instanceof V.Masked) return {
|
|
945
|
+
mask: a
|
|
945
946
|
};
|
|
946
947
|
const {
|
|
947
948
|
mask: e = void 0,
|
|
948
949
|
...t
|
|
949
|
-
} =
|
|
950
|
-
mask:
|
|
951
|
-
} : ni(
|
|
950
|
+
} = a instanceof V.Masked ? {
|
|
951
|
+
mask: a
|
|
952
|
+
} : ni(a) && a.mask instanceof V.Masked ? a : {};
|
|
952
953
|
if (e) {
|
|
953
954
|
const i = e.mask;
|
|
954
955
|
return {
|
|
955
|
-
...mi(e, (
|
|
956
|
+
...mi(e, (s, n) => !n.startsWith("_")),
|
|
956
957
|
mask: e.constructor,
|
|
957
958
|
_mask: i,
|
|
958
959
|
...t
|
|
959
960
|
};
|
|
960
961
|
}
|
|
961
962
|
}
|
|
962
|
-
return ni(
|
|
963
|
-
...
|
|
963
|
+
return ni(a) ? {
|
|
964
|
+
...a
|
|
964
965
|
} : {
|
|
965
|
-
mask:
|
|
966
|
+
mask: a
|
|
966
967
|
};
|
|
967
968
|
}
|
|
968
|
-
function Pe(
|
|
969
|
-
if (V.Masked &&
|
|
970
|
-
const e = ct(
|
|
969
|
+
function Pe(a) {
|
|
970
|
+
if (V.Masked && a instanceof V.Masked) return a;
|
|
971
|
+
const e = ct(a), t = gi(e.mask);
|
|
971
972
|
if (!t) throw new Error("Masked class is not found for provided mask " + e.mask + ", appropriate module needs to be imported manually before creating mask.");
|
|
972
973
|
return e.mask === t && delete e.mask, e._mask && (e.mask = e._mask, delete e._mask), new t(e);
|
|
973
974
|
}
|
|
@@ -1082,20 +1083,20 @@ V.HTMLMaskElement = Ft;
|
|
|
1082
1083
|
class vi extends Ft {
|
|
1083
1084
|
/** Returns HTMLElement selection start */
|
|
1084
1085
|
get _unsafeSelectionStart() {
|
|
1085
|
-
const e = this.rootElement, t = e.getSelection && e.getSelection(), i = t && t.anchorOffset,
|
|
1086
|
-
return
|
|
1086
|
+
const e = this.rootElement, t = e.getSelection && e.getSelection(), i = t && t.anchorOffset, s = t && t.focusOffset;
|
|
1087
|
+
return s == null || i == null || i < s ? i : s;
|
|
1087
1088
|
}
|
|
1088
1089
|
/** Returns HTMLElement selection end */
|
|
1089
1090
|
get _unsafeSelectionEnd() {
|
|
1090
|
-
const e = this.rootElement, t = e.getSelection && e.getSelection(), i = t && t.anchorOffset,
|
|
1091
|
-
return
|
|
1091
|
+
const e = this.rootElement, t = e.getSelection && e.getSelection(), i = t && t.anchorOffset, s = t && t.focusOffset;
|
|
1092
|
+
return s == null || i == null || i > s ? i : s;
|
|
1092
1093
|
}
|
|
1093
1094
|
/** Sets HTMLElement selection */
|
|
1094
1095
|
_unsafeSelect(e, t) {
|
|
1095
1096
|
if (!this.rootElement.createRange) return;
|
|
1096
1097
|
const i = this.rootElement.createRange();
|
|
1097
1098
|
i.setStart(this.input.firstChild || this.input, e), i.setEnd(this.input.lastChild || this.input, t);
|
|
1098
|
-
const
|
|
1099
|
+
const s = this.rootElement, n = s.getSelection && s.getSelection();
|
|
1099
1100
|
n && (n.removeAllRanges(), n.addRange(i));
|
|
1100
1101
|
}
|
|
1101
1102
|
/** HTMLElement value */
|
|
@@ -1215,7 +1216,7 @@ class Qi {
|
|
|
1215
1216
|
/** Fires custom event */
|
|
1216
1217
|
_fireEvent(e, t) {
|
|
1217
1218
|
const i = this._listeners[e];
|
|
1218
|
-
i && i.forEach((
|
|
1219
|
+
i && i.forEach((s) => s(t));
|
|
1219
1220
|
}
|
|
1220
1221
|
/** Current selection start */
|
|
1221
1222
|
get selectionStart() {
|
|
@@ -1241,8 +1242,8 @@ class Qi {
|
|
|
1241
1242
|
}
|
|
1242
1243
|
/** Syncronizes view from model value, fires change events */
|
|
1243
1244
|
updateControl(e) {
|
|
1244
|
-
const t = this.masked.unmaskedValue, i = this.masked.value,
|
|
1245
|
-
this._unmaskedValue = t, this._value = i, this._rawInputValue =
|
|
1245
|
+
const t = this.masked.unmaskedValue, i = this.masked.value, s = this.masked.rawInputValue, n = this.displayValue, o = this.unmaskedValue !== t || this.value !== i || this._rawInputValue !== s;
|
|
1246
|
+
this._unmaskedValue = t, this._value = i, this._rawInputValue = s, this.el.value !== n && (this.el.value = n), e === "auto" ? this.alignCursor() : e != null && (this.cursorPos = e), o && this._fireChangeEvents(), !this._historyChanging && (o || this.history.isEmpty) && this.history.push({
|
|
1246
1247
|
unmaskedValue: t,
|
|
1247
1248
|
selection: {
|
|
1248
1249
|
start: this.selectionStart,
|
|
@@ -1255,8 +1256,8 @@ class Qi {
|
|
|
1255
1256
|
const {
|
|
1256
1257
|
mask: t,
|
|
1257
1258
|
...i
|
|
1258
|
-
} = e,
|
|
1259
|
-
|
|
1259
|
+
} = e, s = !this.maskEquals(t), n = this.masked.optionsIsChanged(i);
|
|
1260
|
+
s && (this.mask = t), n && this.masked.updateOptions(i), (s || n) && this.updateControl();
|
|
1260
1261
|
}
|
|
1261
1262
|
/** Updates cursor */
|
|
1262
1263
|
updateCursor(e) {
|
|
@@ -1306,11 +1307,11 @@ class Qi {
|
|
|
1306
1307
|
// old state
|
|
1307
1308
|
oldValue: this.displayValue,
|
|
1308
1309
|
oldSelection: this._selection
|
|
1309
|
-
}), i = this.masked.rawInputValue,
|
|
1310
|
+
}), i = this.masked.rawInputValue, s = this.masked.splice(t.startChangePos, t.removed.length, t.inserted, t.removeDirection, {
|
|
1310
1311
|
input: !0,
|
|
1311
1312
|
raw: !0
|
|
1312
1313
|
}).offset, n = i === this.masked.rawInputValue ? t.removeDirection : x.NONE;
|
|
1313
|
-
let o = this.masked.nearestInputPos(t.startChangePos +
|
|
1314
|
+
let o = this.masked.nearestInputPos(t.startChangePos + s, n);
|
|
1314
1315
|
n !== x.NONE && (o = this.masked.nearestInputPos(o, x.NONE)), this.updateControl(o), delete this._inputEvent;
|
|
1315
1316
|
}
|
|
1316
1317
|
/** Handles view change event and commits model value */
|
|
@@ -1344,13 +1345,13 @@ class Qi {
|
|
|
1344
1345
|
}
|
|
1345
1346
|
}
|
|
1346
1347
|
V.InputMask = Qi;
|
|
1347
|
-
class
|
|
1348
|
+
class O {
|
|
1348
1349
|
/** Inserted symbols */
|
|
1349
1350
|
/** Additional offset if any changes occurred before tail */
|
|
1350
1351
|
/** Raw inserted is used by dynamic mask */
|
|
1351
1352
|
/** Can skip chars */
|
|
1352
1353
|
static normalize(e) {
|
|
1353
|
-
return Array.isArray(e) ? e : [e, new
|
|
1354
|
+
return Array.isArray(e) ? e : [e, new O()];
|
|
1354
1355
|
}
|
|
1355
1356
|
constructor(e) {
|
|
1356
1357
|
Object.assign(this, {
|
|
@@ -1375,8 +1376,8 @@ class R {
|
|
|
1375
1376
|
return this.inserted === e.inserted && this.tailShift === e.tailShift && this.rawInserted === e.rawInserted && this.skip === e.skip;
|
|
1376
1377
|
}
|
|
1377
1378
|
}
|
|
1378
|
-
V.ChangeDetails =
|
|
1379
|
-
class
|
|
1379
|
+
V.ChangeDetails = O;
|
|
1380
|
+
class Ie {
|
|
1380
1381
|
/** Tail value as string */
|
|
1381
1382
|
/** Tail start position */
|
|
1382
1383
|
/** Start position */
|
|
@@ -1516,27 +1517,27 @@ class ne {
|
|
|
1516
1517
|
}
|
|
1517
1518
|
/** Extracts tail in range */
|
|
1518
1519
|
extractTail(e, t) {
|
|
1519
|
-
return e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), new
|
|
1520
|
+
return e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), new Ie(this.extractInput(e, t), e);
|
|
1520
1521
|
}
|
|
1521
1522
|
/** Appends tail */
|
|
1522
1523
|
appendTail(e) {
|
|
1523
|
-
return $e(e) && (e = new
|
|
1524
|
+
return $e(e) && (e = new Ie(String(e))), e.appendTo(this);
|
|
1524
1525
|
}
|
|
1525
1526
|
/** Appends char */
|
|
1526
1527
|
_appendCharRaw(e, t) {
|
|
1527
|
-
return e ? (this._value += e, new
|
|
1528
|
+
return e ? (this._value += e, new O({
|
|
1528
1529
|
inserted: e,
|
|
1529
1530
|
rawInserted: e
|
|
1530
|
-
})) : new
|
|
1531
|
+
})) : new O();
|
|
1531
1532
|
}
|
|
1532
1533
|
/** Appends char */
|
|
1533
1534
|
_appendChar(e, t, i) {
|
|
1534
1535
|
t === void 0 && (t = {});
|
|
1535
|
-
const
|
|
1536
|
+
const s = this.state;
|
|
1536
1537
|
let n;
|
|
1537
1538
|
if ([e, n] = this.doPrepareChar(e, t), e && (n = n.aggregate(this._appendCharRaw(e, t)), !n.rawInserted && this.autofix === "pad")) {
|
|
1538
1539
|
const o = this.state;
|
|
1539
|
-
this.state =
|
|
1540
|
+
this.state = s;
|
|
1540
1541
|
let u = this.pad(t);
|
|
1541
1542
|
const c = this._appendCharRaw(e, t);
|
|
1542
1543
|
u = u.aggregate(c), c.rawInserted || u.equals(n) ? n = u : this.state = o;
|
|
@@ -1559,41 +1560,41 @@ class ne {
|
|
|
1559
1560
|
}
|
|
1560
1561
|
u && h.inserted && (this.state = c);
|
|
1561
1562
|
}
|
|
1562
|
-
u || (n = new
|
|
1563
|
+
u || (n = new O(), this.state = s, i && o && (i.state = o));
|
|
1563
1564
|
}
|
|
1564
1565
|
return n;
|
|
1565
1566
|
}
|
|
1566
1567
|
/** Appends optional placeholder at the end */
|
|
1567
1568
|
_appendPlaceholder() {
|
|
1568
|
-
return new
|
|
1569
|
+
return new O();
|
|
1569
1570
|
}
|
|
1570
1571
|
/** Appends optional eager placeholder at the end */
|
|
1571
1572
|
_appendEager() {
|
|
1572
|
-
return new
|
|
1573
|
+
return new O();
|
|
1573
1574
|
}
|
|
1574
1575
|
/** Appends symbols considering flags */
|
|
1575
1576
|
append(e, t, i) {
|
|
1576
1577
|
if (!$e(e)) throw new Error("value should be string");
|
|
1577
|
-
const
|
|
1578
|
+
const s = $e(i) ? new Ie(String(i)) : i;
|
|
1578
1579
|
t != null && t.tail && (t._beforeTailState = this.state);
|
|
1579
1580
|
let n;
|
|
1580
1581
|
[e, n] = this.doPrepare(e, t);
|
|
1581
1582
|
for (let o = 0; o < e.length; ++o) {
|
|
1582
|
-
const u = this._appendChar(e[o], t,
|
|
1583
|
-
if (!u.rawInserted && !this.doSkipInvalid(e[o], t,
|
|
1583
|
+
const u = this._appendChar(e[o], t, s);
|
|
1584
|
+
if (!u.rawInserted && !this.doSkipInvalid(e[o], t, s)) break;
|
|
1584
1585
|
n.aggregate(u);
|
|
1585
1586
|
}
|
|
1586
|
-
return (this.eager === !0 || this.eager === "append") && t != null && t.input && e && n.aggregate(this._appendEager()),
|
|
1587
|
+
return (this.eager === !0 || this.eager === "append") && t != null && t.input && e && n.aggregate(this._appendEager()), s != null && (n.tailShift += this.appendTail(s).tailShift), n;
|
|
1587
1588
|
}
|
|
1588
1589
|
remove(e, t) {
|
|
1589
|
-
return e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), this._value = this.displayValue.slice(0, e) + this.displayValue.slice(t), new
|
|
1590
|
+
return e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), this._value = this.displayValue.slice(0, e) + this.displayValue.slice(t), new O();
|
|
1590
1591
|
}
|
|
1591
1592
|
/** Calls function and reapplies current value */
|
|
1592
1593
|
withValueRefresh(e) {
|
|
1593
1594
|
if (this._refreshing || !this._initialized) return e();
|
|
1594
1595
|
this._refreshing = !0;
|
|
1595
|
-
const t = this.rawInputValue, i = this.value,
|
|
1596
|
-
return this.rawInputValue = t, this.value && this.value !== i && i.indexOf(this.value) === 0 && (this.append(i.slice(this.displayValue.length), {}, ""), this.doCommit()), delete this._refreshing,
|
|
1596
|
+
const t = this.rawInputValue, i = this.value, s = e();
|
|
1597
|
+
return this.rawInputValue = t, this.value && this.value !== i && i.indexOf(this.value) === 0 && (this.append(i.slice(this.displayValue.length), {}, ""), this.doCommit()), delete this._refreshing, s;
|
|
1597
1598
|
}
|
|
1598
1599
|
runIsolated(e) {
|
|
1599
1600
|
if (this._isolated || !this._initialized) return e(this);
|
|
@@ -1606,11 +1607,11 @@ class ne {
|
|
|
1606
1607
|
}
|
|
1607
1608
|
/** Prepares string before mask processing */
|
|
1608
1609
|
doPrepare(e, t) {
|
|
1609
|
-
return t === void 0 && (t = {}),
|
|
1610
|
+
return t === void 0 && (t = {}), O.normalize(this.prepare ? this.prepare(e, this, t) : e);
|
|
1610
1611
|
}
|
|
1611
1612
|
/** Prepares each char before mask processing */
|
|
1612
1613
|
doPrepareChar(e, t) {
|
|
1613
|
-
return t === void 0 && (t = {}),
|
|
1614
|
+
return t === void 0 && (t = {}), O.normalize(this.prepareChar ? this.prepareChar(e, this, t) : e);
|
|
1614
1615
|
}
|
|
1615
1616
|
/** Validates if value is acceptable */
|
|
1616
1617
|
doValidate(e) {
|
|
@@ -1620,26 +1621,26 @@ class ne {
|
|
|
1620
1621
|
doCommit() {
|
|
1621
1622
|
this.commit && this.commit(this.value, this);
|
|
1622
1623
|
}
|
|
1623
|
-
splice(e, t, i,
|
|
1624
|
-
i === void 0 && (i = ""),
|
|
1624
|
+
splice(e, t, i, s, n) {
|
|
1625
|
+
i === void 0 && (i = ""), s === void 0 && (s = x.NONE), n === void 0 && (n = {
|
|
1625
1626
|
input: !0
|
|
1626
1627
|
});
|
|
1627
1628
|
const o = e + t, u = this.extractTail(o), c = this.eager === !0 || this.eager === "remove";
|
|
1628
1629
|
let h;
|
|
1629
|
-
c && (
|
|
1630
|
+
c && (s = Ki(s), h = this.extractInput(0, o, {
|
|
1630
1631
|
raw: !0
|
|
1631
1632
|
}));
|
|
1632
1633
|
let d = e;
|
|
1633
|
-
const
|
|
1634
|
-
if (
|
|
1635
|
-
if (
|
|
1634
|
+
const m = new O();
|
|
1635
|
+
if (s !== x.NONE && (d = this.nearestInputPos(e, t > 1 && e !== 0 && !c ? x.NONE : s), m.tailShift = d - e), m.aggregate(this.remove(d)), c && s !== x.NONE && h === this.rawInputValue)
|
|
1636
|
+
if (s === x.FORCE_LEFT) {
|
|
1636
1637
|
let r;
|
|
1637
1638
|
for (; h === this.rawInputValue && (r = this.displayValue.length); )
|
|
1638
|
-
|
|
1639
|
+
m.aggregate(new O({
|
|
1639
1640
|
tailShift: -1
|
|
1640
1641
|
})).aggregate(this.remove(r - 1));
|
|
1641
|
-
} else
|
|
1642
|
-
return
|
|
1642
|
+
} else s === x.FORCE_RIGHT && u.unshift();
|
|
1643
|
+
return m.aggregate(this.append(i, n, u));
|
|
1643
1644
|
}
|
|
1644
1645
|
maskEquals(e) {
|
|
1645
1646
|
return this.mask === e;
|
|
@@ -1652,7 +1653,7 @@ class ne {
|
|
|
1652
1653
|
return e === t || ne.EMPTY_VALUES.includes(e) && ne.EMPTY_VALUES.includes(t) || (this.format ? this.format(e, this) === this.format(this.typedValue, this) : !1);
|
|
1653
1654
|
}
|
|
1654
1655
|
pad(e) {
|
|
1655
|
-
return new
|
|
1656
|
+
return new O();
|
|
1656
1657
|
}
|
|
1657
1658
|
}
|
|
1658
1659
|
ne.DEFAULTS = {
|
|
@@ -1670,39 +1671,39 @@ class qe {
|
|
|
1670
1671
|
}
|
|
1671
1672
|
extend(e) {
|
|
1672
1673
|
if (!String(e)) return;
|
|
1673
|
-
e = $e(e) ? new
|
|
1674
|
+
e = $e(e) ? new Ie(String(e)) : e;
|
|
1674
1675
|
const t = this.chunks[this.chunks.length - 1], i = t && // if stops are same or tail has no stop
|
|
1675
1676
|
(t.stop === e.stop || e.stop == null) && // if tail chunk goes just after last chunk
|
|
1676
1677
|
e.from === t.from + t.toString().length;
|
|
1677
|
-
if (e instanceof
|
|
1678
|
+
if (e instanceof Ie)
|
|
1678
1679
|
i ? t.extend(e.toString()) : this.chunks.push(e);
|
|
1679
1680
|
else if (e instanceof qe) {
|
|
1680
1681
|
if (e.stop == null) {
|
|
1681
|
-
let
|
|
1682
|
+
let s;
|
|
1682
1683
|
for (; e.chunks.length && e.chunks[0].stop == null; )
|
|
1683
|
-
|
|
1684
|
+
s = e.chunks.shift(), s.from += e.from, this.extend(s);
|
|
1684
1685
|
}
|
|
1685
1686
|
e.toString() && (e.stop = e.blockIndex, this.chunks.push(e));
|
|
1686
1687
|
}
|
|
1687
1688
|
}
|
|
1688
1689
|
appendTo(e) {
|
|
1689
1690
|
if (!(e instanceof V.MaskedPattern))
|
|
1690
|
-
return new
|
|
1691
|
-
const t = new
|
|
1691
|
+
return new Ie(this.toString()).appendTo(e);
|
|
1692
|
+
const t = new O();
|
|
1692
1693
|
for (let i = 0; i < this.chunks.length; ++i) {
|
|
1693
|
-
const
|
|
1694
|
+
const s = this.chunks[i], n = e._mapPosToBlock(e.displayValue.length), o = s.stop;
|
|
1694
1695
|
let u;
|
|
1695
1696
|
if (o != null && // if block not found or stop is behind lastBlock
|
|
1696
|
-
(!n || n.index <= o) && ((
|
|
1697
|
-
e._stops.indexOf(o) >= 0) && t.aggregate(e._appendPlaceholder(o)), u =
|
|
1698
|
-
const c = u.appendTail(
|
|
1697
|
+
(!n || n.index <= o) && ((s instanceof qe || // for continuous block also check if stop is exist
|
|
1698
|
+
e._stops.indexOf(o) >= 0) && t.aggregate(e._appendPlaceholder(o)), u = s instanceof qe && e._blocks[o]), u) {
|
|
1699
|
+
const c = u.appendTail(s);
|
|
1699
1700
|
t.aggregate(c);
|
|
1700
|
-
const h =
|
|
1701
|
+
const h = s.toString().slice(c.rawInserted.length);
|
|
1701
1702
|
h && t.aggregate(e.append(h, {
|
|
1702
1703
|
tail: !0
|
|
1703
1704
|
}));
|
|
1704
1705
|
} else
|
|
1705
|
-
t.aggregate(e.append(
|
|
1706
|
+
t.aggregate(e.append(s.toString(), {
|
|
1706
1707
|
tail: !0
|
|
1707
1708
|
}));
|
|
1708
1709
|
}
|
|
@@ -1721,9 +1722,9 @@ class qe {
|
|
|
1721
1722
|
chunks: t,
|
|
1722
1723
|
...i
|
|
1723
1724
|
} = e;
|
|
1724
|
-
Object.assign(this, i), this.chunks = t.map((
|
|
1725
|
-
const n = "chunks" in
|
|
1726
|
-
return n.state =
|
|
1725
|
+
Object.assign(this, i), this.chunks = t.map((s) => {
|
|
1726
|
+
const n = "chunks" in s ? new qe() : new Ie();
|
|
1727
|
+
return n.state = s, n;
|
|
1727
1728
|
});
|
|
1728
1729
|
}
|
|
1729
1730
|
unshift(e) {
|
|
@@ -1731,8 +1732,8 @@ class qe {
|
|
|
1731
1732
|
const t = e != null ? e - this.from : e;
|
|
1732
1733
|
let i = 0;
|
|
1733
1734
|
for (; i < this.chunks.length; ) {
|
|
1734
|
-
const
|
|
1735
|
-
if (
|
|
1735
|
+
const s = this.chunks[i], n = s.unshift(t);
|
|
1736
|
+
if (s.toString()) {
|
|
1736
1737
|
if (!n) break;
|
|
1737
1738
|
++i;
|
|
1738
1739
|
} else
|
|
@@ -1761,7 +1762,7 @@ class es {
|
|
|
1761
1762
|
this.masked = e, this._log = [];
|
|
1762
1763
|
const {
|
|
1763
1764
|
offset: i,
|
|
1764
|
-
index:
|
|
1765
|
+
index: s
|
|
1765
1766
|
} = e._mapPosToBlock(t) || (t < 0 ? (
|
|
1766
1767
|
// first
|
|
1767
1768
|
{
|
|
@@ -1775,7 +1776,7 @@ class es {
|
|
|
1775
1776
|
offset: 0
|
|
1776
1777
|
}
|
|
1777
1778
|
));
|
|
1778
|
-
this.offset = i, this.index =
|
|
1779
|
+
this.offset = i, this.index = s, this.ok = !1;
|
|
1779
1780
|
}
|
|
1780
1781
|
get block() {
|
|
1781
1782
|
return this.masked._blocks[this.index];
|
|
@@ -1878,11 +1879,11 @@ class yi {
|
|
|
1878
1879
|
this._isRawInput = !1, this._value = "";
|
|
1879
1880
|
}
|
|
1880
1881
|
remove(e, t) {
|
|
1881
|
-
return e === void 0 && (e = 0), t === void 0 && (t = this._value.length), this._value = this._value.slice(0, e) + this._value.slice(t), this._value || (this._isRawInput = !1), new
|
|
1882
|
+
return e === void 0 && (e = 0), t === void 0 && (t = this._value.length), this._value = this._value.slice(0, e) + this._value.slice(t), this._value || (this._isRawInput = !1), new O();
|
|
1882
1883
|
}
|
|
1883
1884
|
nearestInputPos(e, t) {
|
|
1884
1885
|
t === void 0 && (t = x.NONE);
|
|
1885
|
-
const i = 0,
|
|
1886
|
+
const i = 0, s = this._value.length;
|
|
1886
1887
|
switch (t) {
|
|
1887
1888
|
case x.LEFT:
|
|
1888
1889
|
case x.FORCE_LEFT:
|
|
@@ -1891,7 +1892,7 @@ class yi {
|
|
|
1891
1892
|
case x.RIGHT:
|
|
1892
1893
|
case x.FORCE_RIGHT:
|
|
1893
1894
|
default:
|
|
1894
|
-
return
|
|
1895
|
+
return s;
|
|
1895
1896
|
}
|
|
1896
1897
|
}
|
|
1897
1898
|
totalInputPositions(e, t) {
|
|
@@ -1907,12 +1908,12 @@ class yi {
|
|
|
1907
1908
|
return !!this._value;
|
|
1908
1909
|
}
|
|
1909
1910
|
_appendChar(e, t) {
|
|
1910
|
-
if (t === void 0 && (t = {}), this.isFilled) return new
|
|
1911
|
-
const i = this.eager === !0 || this.eager === "append",
|
|
1911
|
+
if (t === void 0 && (t = {}), this.isFilled) return new O();
|
|
1912
|
+
const i = this.eager === !0 || this.eager === "append", s = this.char === e && (this.isUnmasking || t.input || t.raw) && (!t.raw || !i) && !t.tail, n = new O({
|
|
1912
1913
|
inserted: this.char,
|
|
1913
|
-
rawInserted:
|
|
1914
|
+
rawInserted: s ? this.char : ""
|
|
1914
1915
|
});
|
|
1915
|
-
return this._value = this.char, this._isRawInput =
|
|
1916
|
+
return this._value = this.char, this._isRawInput = s && (t.raw || t.input), n;
|
|
1916
1917
|
}
|
|
1917
1918
|
_appendEager() {
|
|
1918
1919
|
return this._appendChar(this.char, {
|
|
@@ -1920,18 +1921,18 @@ class yi {
|
|
|
1920
1921
|
});
|
|
1921
1922
|
}
|
|
1922
1923
|
_appendPlaceholder() {
|
|
1923
|
-
const e = new
|
|
1924
|
+
const e = new O();
|
|
1924
1925
|
return this.isFilled || (this._value = e.inserted = this.char), e;
|
|
1925
1926
|
}
|
|
1926
1927
|
extractTail() {
|
|
1927
|
-
return new
|
|
1928
|
+
return new Ie("");
|
|
1928
1929
|
}
|
|
1929
1930
|
appendTail(e) {
|
|
1930
|
-
return $e(e) && (e = new
|
|
1931
|
+
return $e(e) && (e = new Ie(String(e))), e.appendTo(this);
|
|
1931
1932
|
}
|
|
1932
1933
|
append(e, t, i) {
|
|
1933
|
-
const
|
|
1934
|
-
return i != null && (
|
|
1934
|
+
const s = this._appendChar(e[0], t);
|
|
1935
|
+
return i != null && (s.tailShift += this.appendTail(i).tailShift), s;
|
|
1935
1936
|
}
|
|
1936
1937
|
doCommit() {
|
|
1937
1938
|
}
|
|
@@ -1961,7 +1962,7 @@ class wt {
|
|
|
1961
1962
|
const {
|
|
1962
1963
|
parent: t,
|
|
1963
1964
|
isOptional: i,
|
|
1964
|
-
placeholderChar:
|
|
1965
|
+
placeholderChar: s,
|
|
1965
1966
|
displayChar: n,
|
|
1966
1967
|
lazy: o,
|
|
1967
1968
|
eager: u,
|
|
@@ -1970,7 +1971,7 @@ class wt {
|
|
|
1970
1971
|
this.masked = Pe(c), Object.assign(this, {
|
|
1971
1972
|
parent: t,
|
|
1972
1973
|
isOptional: i,
|
|
1973
|
-
placeholderChar:
|
|
1974
|
+
placeholderChar: s,
|
|
1974
1975
|
displayChar: n,
|
|
1975
1976
|
lazy: o,
|
|
1976
1977
|
eager: u
|
|
@@ -1980,7 +1981,7 @@ class wt {
|
|
|
1980
1981
|
this.isFilled = !1, this.masked.reset();
|
|
1981
1982
|
}
|
|
1982
1983
|
remove(e, t) {
|
|
1983
|
-
return e === void 0 && (e = 0), t === void 0 && (t = this.value.length), e === 0 && t >= 1 ? (this.isFilled = !1, this.masked.remove(e, t)) : new
|
|
1984
|
+
return e === void 0 && (e = 0), t === void 0 && (t = this.value.length), e === 0 && t >= 1 ? (this.isFilled = !1, this.masked.remove(e, t)) : new O();
|
|
1984
1985
|
}
|
|
1985
1986
|
get value() {
|
|
1986
1987
|
return this.masked.value || (this.isFilled && !this.isOptional ? this.placeholderChar : "");
|
|
@@ -1998,21 +1999,21 @@ class wt {
|
|
|
1998
1999
|
return !!this.masked.value || this.isOptional;
|
|
1999
2000
|
}
|
|
2000
2001
|
_appendChar(e, t) {
|
|
2001
|
-
if (t === void 0 && (t = {}), this.isFilled) return new
|
|
2002
|
+
if (t === void 0 && (t = {}), this.isFilled) return new O();
|
|
2002
2003
|
const i = this.masked.state;
|
|
2003
|
-
let
|
|
2004
|
-
return
|
|
2004
|
+
let s = this.masked._appendChar(e, this.currentMaskFlags(t));
|
|
2005
|
+
return s.inserted && this.doValidate(t) === !1 && (s = new O(), this.masked.state = i), !s.inserted && !this.isOptional && !this.lazy && !t.input && (s.inserted = this.placeholderChar), s.skip = !s.inserted && !this.isOptional, this.isFilled = !!s.inserted, s;
|
|
2005
2006
|
}
|
|
2006
2007
|
append(e, t, i) {
|
|
2007
2008
|
return this.masked.append(e, this.currentMaskFlags(t), i);
|
|
2008
2009
|
}
|
|
2009
2010
|
_appendPlaceholder() {
|
|
2010
|
-
return this.isFilled || this.isOptional ? new
|
|
2011
|
+
return this.isFilled || this.isOptional ? new O() : (this.isFilled = !0, new O({
|
|
2011
2012
|
inserted: this.placeholderChar
|
|
2012
2013
|
}));
|
|
2013
2014
|
}
|
|
2014
2015
|
_appendEager() {
|
|
2015
|
-
return new
|
|
2016
|
+
return new O();
|
|
2016
2017
|
}
|
|
2017
2018
|
extractTail(e, t) {
|
|
2018
2019
|
return this.masked.extractTail(e, t);
|
|
@@ -2025,14 +2026,14 @@ class wt {
|
|
|
2025
2026
|
}
|
|
2026
2027
|
nearestInputPos(e, t) {
|
|
2027
2028
|
t === void 0 && (t = x.NONE);
|
|
2028
|
-
const i = 0,
|
|
2029
|
+
const i = 0, s = this.value.length, n = Math.min(Math.max(e, i), s);
|
|
2029
2030
|
switch (t) {
|
|
2030
2031
|
case x.LEFT:
|
|
2031
2032
|
case x.FORCE_LEFT:
|
|
2032
2033
|
return this.isComplete ? n : i;
|
|
2033
2034
|
case x.RIGHT:
|
|
2034
2035
|
case x.FORCE_RIGHT:
|
|
2035
|
-
return this.isComplete ? n :
|
|
2036
|
+
return this.isComplete ? n : s;
|
|
2036
2037
|
case x.NONE:
|
|
2037
2038
|
default:
|
|
2038
2039
|
return n;
|
|
@@ -2066,7 +2067,7 @@ class wt {
|
|
|
2066
2067
|
};
|
|
2067
2068
|
}
|
|
2068
2069
|
pad(e) {
|
|
2069
|
-
return new
|
|
2070
|
+
return new O();
|
|
2070
2071
|
}
|
|
2071
2072
|
}
|
|
2072
2073
|
wt.DEFAULT_DEFINITIONS = {
|
|
@@ -2118,32 +2119,32 @@ class oe extends ne {
|
|
|
2118
2119
|
this._blocks = [], this.exposeBlock = void 0, this._stops = [], this._maskedBlocks = {};
|
|
2119
2120
|
const t = this.mask;
|
|
2120
2121
|
if (!t || !e) return;
|
|
2121
|
-
let i = !1,
|
|
2122
|
+
let i = !1, s = !1;
|
|
2122
2123
|
for (let n = 0; n < t.length; ++n) {
|
|
2123
2124
|
if (this.blocks) {
|
|
2124
2125
|
const h = t.slice(n), d = Object.keys(this.blocks).filter((r) => h.indexOf(r) === 0);
|
|
2125
|
-
d.sort((r,
|
|
2126
|
-
const
|
|
2127
|
-
if (
|
|
2126
|
+
d.sort((r, f) => f.length - r.length);
|
|
2127
|
+
const m = d[0];
|
|
2128
|
+
if (m) {
|
|
2128
2129
|
const {
|
|
2129
2130
|
expose: r,
|
|
2130
|
-
repeat:
|
|
2131
|
-
...
|
|
2132
|
-
} = ct(this.blocks[
|
|
2131
|
+
repeat: f,
|
|
2132
|
+
...v
|
|
2133
|
+
} = ct(this.blocks[m]), k = {
|
|
2133
2134
|
lazy: this.lazy,
|
|
2134
2135
|
eager: this.eager,
|
|
2135
2136
|
placeholderChar: this.placeholderChar,
|
|
2136
2137
|
displayChar: this.displayChar,
|
|
2137
2138
|
overwrite: this.overwrite,
|
|
2138
2139
|
autofix: this.autofix,
|
|
2139
|
-
...
|
|
2140
|
-
repeat:
|
|
2140
|
+
...v,
|
|
2141
|
+
repeat: f,
|
|
2141
2142
|
parent: this
|
|
2142
|
-
},
|
|
2143
|
+
}, b = f != null ? new V.RepeatBlock(
|
|
2143
2144
|
k
|
|
2144
2145
|
/* TODO */
|
|
2145
2146
|
) : Pe(k);
|
|
2146
|
-
|
|
2147
|
+
b && (this._blocks.push(b), r && (this.exposeBlock = b), this._maskedBlocks[m] || (this._maskedBlocks[m] = []), this._maskedBlocks[m].push(this._blocks.length - 1)), n += m.length - 1;
|
|
2147
2148
|
continue;
|
|
2148
2149
|
}
|
|
2149
2150
|
}
|
|
@@ -2157,7 +2158,7 @@ class oe extends ne {
|
|
|
2157
2158
|
continue;
|
|
2158
2159
|
}
|
|
2159
2160
|
if (o === "[" || o === "]") {
|
|
2160
|
-
|
|
2161
|
+
s = !s;
|
|
2161
2162
|
continue;
|
|
2162
2163
|
}
|
|
2163
2164
|
if (o === oe.ESCAPE_CHAR) {
|
|
@@ -2165,7 +2166,7 @@ class oe extends ne {
|
|
|
2165
2166
|
u = !1;
|
|
2166
2167
|
}
|
|
2167
2168
|
const c = u ? new wt({
|
|
2168
|
-
isOptional:
|
|
2169
|
+
isOptional: s,
|
|
2169
2170
|
lazy: this.lazy,
|
|
2170
2171
|
eager: this.eager,
|
|
2171
2172
|
placeholderChar: this.placeholderChar,
|
|
@@ -2195,7 +2196,7 @@ class oe extends ne {
|
|
|
2195
2196
|
_blocks: t,
|
|
2196
2197
|
...i
|
|
2197
2198
|
} = e;
|
|
2198
|
-
this._blocks.forEach((
|
|
2199
|
+
this._blocks.forEach((s, n) => s.state = t[n]), super.state = i;
|
|
2199
2200
|
}
|
|
2200
2201
|
reset() {
|
|
2201
2202
|
super.reset(), this._blocks.forEach((e) => e.reset());
|
|
@@ -2253,12 +2254,12 @@ class oe extends ne {
|
|
|
2253
2254
|
}
|
|
2254
2255
|
_appendEager() {
|
|
2255
2256
|
var e;
|
|
2256
|
-
const t = new
|
|
2257
|
+
const t = new O();
|
|
2257
2258
|
let i = (e = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : e.index;
|
|
2258
2259
|
if (i == null) return t;
|
|
2259
2260
|
this._blocks[i].isFilled && ++i;
|
|
2260
|
-
for (let
|
|
2261
|
-
const n = this._blocks[
|
|
2261
|
+
for (let s = i; s < this._blocks.length; ++s) {
|
|
2262
|
+
const n = this._blocks[s]._appendEager();
|
|
2262
2263
|
if (!n.inserted) break;
|
|
2263
2264
|
t.aggregate(n);
|
|
2264
2265
|
}
|
|
@@ -2266,50 +2267,50 @@ class oe extends ne {
|
|
|
2266
2267
|
}
|
|
2267
2268
|
_appendCharRaw(e, t) {
|
|
2268
2269
|
t === void 0 && (t = {});
|
|
2269
|
-
const i = this._mapPosToBlock(this.displayValue.length),
|
|
2270
|
-
if (!i) return
|
|
2270
|
+
const i = this._mapPosToBlock(this.displayValue.length), s = new O();
|
|
2271
|
+
if (!i) return s;
|
|
2271
2272
|
for (let o = i.index, u; u = this._blocks[o]; ++o) {
|
|
2272
2273
|
var n;
|
|
2273
2274
|
const c = u._appendChar(e, {
|
|
2274
2275
|
...t,
|
|
2275
2276
|
_beforeTailState: (n = t._beforeTailState) == null || (n = n._blocks) == null ? void 0 : n[o]
|
|
2276
2277
|
});
|
|
2277
|
-
if (
|
|
2278
|
+
if (s.aggregate(c), c.consumed) break;
|
|
2278
2279
|
}
|
|
2279
|
-
return
|
|
2280
|
+
return s;
|
|
2280
2281
|
}
|
|
2281
2282
|
extractTail(e, t) {
|
|
2282
2283
|
e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length);
|
|
2283
2284
|
const i = new qe();
|
|
2284
|
-
return e === t || this._forEachBlocksInRange(e, t, (
|
|
2285
|
-
const c =
|
|
2285
|
+
return e === t || this._forEachBlocksInRange(e, t, (s, n, o, u) => {
|
|
2286
|
+
const c = s.extractTail(o, u);
|
|
2286
2287
|
c.stop = this._findStopBefore(n), c.from = this._blockStartPos(n), c instanceof qe && (c.blockIndex = n), i.extend(c);
|
|
2287
2288
|
}), i;
|
|
2288
2289
|
}
|
|
2289
2290
|
extractInput(e, t, i) {
|
|
2290
2291
|
if (e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), i === void 0 && (i = {}), e === t) return "";
|
|
2291
|
-
let
|
|
2292
|
+
let s = "";
|
|
2292
2293
|
return this._forEachBlocksInRange(e, t, (n, o, u, c) => {
|
|
2293
|
-
|
|
2294
|
-
}),
|
|
2294
|
+
s += n.extractInput(u, c, i);
|
|
2295
|
+
}), s;
|
|
2295
2296
|
}
|
|
2296
2297
|
_findStopBefore(e) {
|
|
2297
2298
|
let t;
|
|
2298
2299
|
for (let i = 0; i < this._stops.length; ++i) {
|
|
2299
|
-
const
|
|
2300
|
-
if (
|
|
2300
|
+
const s = this._stops[i];
|
|
2301
|
+
if (s <= e) t = s;
|
|
2301
2302
|
else break;
|
|
2302
2303
|
}
|
|
2303
2304
|
return t;
|
|
2304
2305
|
}
|
|
2305
2306
|
/** Appends placeholder depending on laziness */
|
|
2306
2307
|
_appendPlaceholder(e) {
|
|
2307
|
-
const t = new
|
|
2308
|
+
const t = new O();
|
|
2308
2309
|
if (this.lazy && e == null) return t;
|
|
2309
2310
|
const i = this._mapPosToBlock(this.displayValue.length);
|
|
2310
2311
|
if (!i) return t;
|
|
2311
|
-
const
|
|
2312
|
-
return this._blocks.slice(
|
|
2312
|
+
const s = i.index, n = e ?? this._blocks.length;
|
|
2313
|
+
return this._blocks.slice(s, n).forEach((o) => {
|
|
2313
2314
|
if (!o.lazy || e != null) {
|
|
2314
2315
|
var u;
|
|
2315
2316
|
t.aggregate(o._appendPlaceholder((u = o._blocks) == null ? void 0 : u.length));
|
|
@@ -2320,8 +2321,8 @@ class oe extends ne {
|
|
|
2320
2321
|
_mapPosToBlock(e) {
|
|
2321
2322
|
let t = "";
|
|
2322
2323
|
for (let i = 0; i < this._blocks.length; ++i) {
|
|
2323
|
-
const
|
|
2324
|
-
if (t +=
|
|
2324
|
+
const s = this._blocks[i], n = t.length;
|
|
2325
|
+
if (t += s.displayValue, e <= t.length)
|
|
2325
2326
|
return {
|
|
2326
2327
|
index: i,
|
|
2327
2328
|
offset: e - n
|
|
@@ -2333,11 +2334,11 @@ class oe extends ne {
|
|
|
2333
2334
|
}
|
|
2334
2335
|
_forEachBlocksInRange(e, t, i) {
|
|
2335
2336
|
t === void 0 && (t = this.displayValue.length);
|
|
2336
|
-
const
|
|
2337
|
-
if (
|
|
2338
|
-
const n = this._mapPosToBlock(t), o = n &&
|
|
2339
|
-
if (i(this._blocks[
|
|
2340
|
-
for (let h =
|
|
2337
|
+
const s = this._mapPosToBlock(e);
|
|
2338
|
+
if (s) {
|
|
2339
|
+
const n = this._mapPosToBlock(t), o = n && s.index === n.index, u = s.offset, c = n && o ? n.offset : this._blocks[s.index].displayValue.length;
|
|
2340
|
+
if (i(this._blocks[s.index], s.index, u, c), n && !o) {
|
|
2341
|
+
for (let h = s.index + 1; h < n.index; ++h)
|
|
2341
2342
|
i(this._blocks[h], h, 0, this._blocks[h].displayValue.length);
|
|
2342
2343
|
i(this._blocks[n.index], n.index, 0, n.offset);
|
|
2343
2344
|
}
|
|
@@ -2346,8 +2347,8 @@ class oe extends ne {
|
|
|
2346
2347
|
remove(e, t) {
|
|
2347
2348
|
e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length);
|
|
2348
2349
|
const i = super.remove(e, t);
|
|
2349
|
-
return this._forEachBlocksInRange(e, t, (
|
|
2350
|
-
i.aggregate(
|
|
2350
|
+
return this._forEachBlocksInRange(e, t, (s, n, o, u) => {
|
|
2351
|
+
i.aggregate(s.remove(o, u));
|
|
2351
2352
|
}), i;
|
|
2352
2353
|
}
|
|
2353
2354
|
nearestInputPos(e, t) {
|
|
@@ -2371,8 +2372,8 @@ class oe extends ne {
|
|
|
2371
2372
|
totalInputPositions(e, t) {
|
|
2372
2373
|
e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length);
|
|
2373
2374
|
let i = 0;
|
|
2374
|
-
return this._forEachBlocksInRange(e, t, (
|
|
2375
|
-
i +=
|
|
2375
|
+
return this._forEachBlocksInRange(e, t, (s, n, o, u) => {
|
|
2376
|
+
i += s.totalInputPositions(o, u);
|
|
2376
2377
|
}), i;
|
|
2377
2378
|
}
|
|
2378
2379
|
/** Get block by name */
|
|
@@ -2385,7 +2386,7 @@ class oe extends ne {
|
|
|
2385
2386
|
return t ? t.map((i) => this._blocks[i]) : [];
|
|
2386
2387
|
}
|
|
2387
2388
|
pad(e) {
|
|
2388
|
-
const t = new
|
|
2389
|
+
const t = new O();
|
|
2389
2390
|
return this._forEachBlocksInRange(0, this.displayValue.length, (i) => t.aggregate(i.pad(e))), t;
|
|
2390
2391
|
}
|
|
2391
2392
|
}
|
|
@@ -2419,11 +2420,11 @@ class kt extends oe {
|
|
|
2419
2420
|
const {
|
|
2420
2421
|
to: t = this.to || 0,
|
|
2421
2422
|
from: i = this.from || 0,
|
|
2422
|
-
maxLength:
|
|
2423
|
+
maxLength: s = this.maxLength || 0,
|
|
2423
2424
|
autofix: n = this.autofix,
|
|
2424
2425
|
...o
|
|
2425
2426
|
} = e;
|
|
2426
|
-
this.to = t, this.from = i, this.maxLength = Math.max(String(t).length,
|
|
2427
|
+
this.to = t, this.from = i, this.maxLength = Math.max(String(t).length, s), this.autofix = n;
|
|
2427
2428
|
const u = String(this.from).padStart(this.maxLength, "0"), c = String(this.to).padStart(this.maxLength, "0");
|
|
2428
2429
|
let h = 0;
|
|
2429
2430
|
for (; h < c.length && c[h] === u[h]; ) ++h;
|
|
@@ -2434,8 +2435,8 @@ class kt extends oe {
|
|
|
2434
2435
|
}
|
|
2435
2436
|
boundaries(e) {
|
|
2436
2437
|
let t = "", i = "";
|
|
2437
|
-
const [,
|
|
2438
|
-
return n && (t = "0".repeat(
|
|
2438
|
+
const [, s, n] = e.match(/^(\D*)(\d*)(\D*)/) || [];
|
|
2439
|
+
return n && (t = "0".repeat(s.length) + n, i = "9".repeat(s.length) + n), t = t.padEnd(this.maxLength, "0"), i = i.padEnd(this.maxLength, "9"), [t, i];
|
|
2439
2440
|
}
|
|
2440
2441
|
doPrepareChar(e, t) {
|
|
2441
2442
|
t === void 0 && (t = {});
|
|
@@ -2444,22 +2445,22 @@ class kt extends oe {
|
|
|
2444
2445
|
}
|
|
2445
2446
|
_appendCharRaw(e, t) {
|
|
2446
2447
|
if (t === void 0 && (t = {}), !this.autofix || this.value.length + 1 > this.maxLength) return super._appendCharRaw(e, t);
|
|
2447
|
-
const i = String(this.from).padStart(this.maxLength, "0"),
|
|
2448
|
-
return Number(o) < this.from ? super._appendCharRaw(i[this.value.length], t) : Number(n) > this.to ? !t.tail && this.autofix === "pad" && this.value.length + 1 < this.maxLength ? super._appendCharRaw(i[this.value.length], t).aggregate(this._appendCharRaw(e, t)) : super._appendCharRaw(
|
|
2448
|
+
const i = String(this.from).padStart(this.maxLength, "0"), s = String(this.to).padStart(this.maxLength, "0"), [n, o] = this.boundaries(this.value + e);
|
|
2449
|
+
return Number(o) < this.from ? super._appendCharRaw(i[this.value.length], t) : Number(n) > this.to ? !t.tail && this.autofix === "pad" && this.value.length + 1 < this.maxLength ? super._appendCharRaw(i[this.value.length], t).aggregate(this._appendCharRaw(e, t)) : super._appendCharRaw(s[this.value.length], t) : super._appendCharRaw(e, t);
|
|
2449
2450
|
}
|
|
2450
2451
|
doValidate(e) {
|
|
2451
2452
|
const t = this.value;
|
|
2452
2453
|
if (t.search(/[^0]/) === -1 && t.length <= this._matchFrom) return !0;
|
|
2453
|
-
const [i,
|
|
2454
|
-
return this.from <= Number(
|
|
2454
|
+
const [i, s] = this.boundaries(t);
|
|
2455
|
+
return this.from <= Number(s) && Number(i) <= this.to && super.doValidate(e);
|
|
2455
2456
|
}
|
|
2456
2457
|
pad(e) {
|
|
2457
|
-
const t = new
|
|
2458
|
+
const t = new O();
|
|
2458
2459
|
if (this.value.length === this.maxLength) return t;
|
|
2459
|
-
const i = this.value,
|
|
2460
|
-
if (
|
|
2460
|
+
const i = this.value, s = this.maxLength - this.value.length;
|
|
2461
|
+
if (s) {
|
|
2461
2462
|
this.reset();
|
|
2462
|
-
for (let n = 0; n <
|
|
2463
|
+
for (let n = 0; n < s; ++n)
|
|
2463
2464
|
t.aggregate(super._appendCharRaw("0", e));
|
|
2464
2465
|
i.split("").forEach((n) => this._appendCharRaw(n));
|
|
2465
2466
|
}
|
|
@@ -2473,10 +2474,10 @@ class De extends oe {
|
|
|
2473
2474
|
const {
|
|
2474
2475
|
mask: t,
|
|
2475
2476
|
pattern: i,
|
|
2476
|
-
...
|
|
2477
|
+
...s
|
|
2477
2478
|
} = e;
|
|
2478
2479
|
return {
|
|
2479
|
-
...
|
|
2480
|
+
...s,
|
|
2480
2481
|
mask: $e(t) ? t : i
|
|
2481
2482
|
};
|
|
2482
2483
|
}
|
|
@@ -2498,13 +2499,13 @@ class De extends oe {
|
|
|
2498
2499
|
const {
|
|
2499
2500
|
mask: t,
|
|
2500
2501
|
pattern: i,
|
|
2501
|
-
blocks:
|
|
2502
|
+
blocks: s,
|
|
2502
2503
|
...n
|
|
2503
2504
|
} = {
|
|
2504
2505
|
...De.DEFAULTS,
|
|
2505
2506
|
...e
|
|
2506
2507
|
}, o = Object.assign({}, De.GET_DEFAULT_BLOCKS());
|
|
2507
|
-
e.min && (o.Y.from = e.min.getFullYear()), e.max && (o.Y.to = e.max.getFullYear()), e.min && e.max && o.Y.from === o.Y.to && (o.m.from = e.min.getMonth() + 1, o.m.to = e.max.getMonth() + 1, o.m.from === o.m.to && (o.d.from = e.min.getDate(), o.d.to = e.max.getDate())), Object.assign(o, this.blocks,
|
|
2508
|
+
e.min && (o.Y.from = e.min.getFullYear()), e.max && (o.Y.to = e.max.getFullYear()), e.min && e.max && o.Y.from === o.Y.to && (o.m.from = e.min.getMonth() + 1, o.m.to = e.max.getMonth() + 1, o.m.from === o.m.to && (o.d.from = e.min.getDate(), o.d.to = e.max.getDate())), Object.assign(o, this.blocks, s), super._update({
|
|
2508
2509
|
...n,
|
|
2509
2510
|
mask: $e(t) ? t : i,
|
|
2510
2511
|
blocks: o
|
|
@@ -2561,14 +2562,14 @@ De.DEFAULTS = {
|
|
|
2561
2562
|
...oe.DEFAULTS,
|
|
2562
2563
|
mask: Date,
|
|
2563
2564
|
pattern: is,
|
|
2564
|
-
format: (
|
|
2565
|
-
if (!
|
|
2566
|
-
const t = String(
|
|
2567
|
-
return [t, i,
|
|
2565
|
+
format: (a, e) => {
|
|
2566
|
+
if (!a) return "";
|
|
2567
|
+
const t = String(a.getDate()).padStart(2, "0"), i = String(a.getMonth() + 1).padStart(2, "0"), s = a.getFullYear();
|
|
2568
|
+
return [t, i, s].join(".");
|
|
2568
2569
|
},
|
|
2569
|
-
parse: (
|
|
2570
|
-
const [t, i,
|
|
2571
|
-
return new Date(
|
|
2570
|
+
parse: (a, e) => {
|
|
2571
|
+
const [t, i, s] = a.split(".").map(Number);
|
|
2572
|
+
return new Date(s, i - 1, t);
|
|
2572
2573
|
}
|
|
2573
2574
|
};
|
|
2574
2575
|
V.MaskedDate = De;
|
|
@@ -2586,12 +2587,12 @@ class Lt extends ne {
|
|
|
2586
2587
|
super._update(e), "mask" in e && (this.exposeMask = void 0, this.compiledMasks = Array.isArray(e.mask) ? e.mask.map((t) => {
|
|
2587
2588
|
const {
|
|
2588
2589
|
expose: i,
|
|
2589
|
-
...
|
|
2590
|
+
...s
|
|
2590
2591
|
} = ct(t), n = Pe({
|
|
2591
2592
|
overwrite: this._overwrite,
|
|
2592
2593
|
eager: this._eager,
|
|
2593
2594
|
skipInvalid: this._skipInvalid,
|
|
2594
|
-
...
|
|
2595
|
+
...s
|
|
2595
2596
|
});
|
|
2596
2597
|
return i && (this.exposeMask = n), n;
|
|
2597
2598
|
}) : []);
|
|
@@ -2603,12 +2604,12 @@ class Lt extends ne {
|
|
|
2603
2604
|
}
|
|
2604
2605
|
_applyDispatch(e, t, i) {
|
|
2605
2606
|
e === void 0 && (e = ""), t === void 0 && (t = {}), i === void 0 && (i = "");
|
|
2606
|
-
const
|
|
2607
|
+
const s = t.tail && t._beforeTailState != null ? t._beforeTailState._value : this.value, n = this.rawInputValue, o = t.tail && t._beforeTailState != null ? t._beforeTailState._rawInputValue : n, u = n.slice(o.length), c = this.currentMask, h = new O(), d = c?.state;
|
|
2607
2608
|
return this.currentMask = this.doDispatch(e, {
|
|
2608
2609
|
...t
|
|
2609
2610
|
}, i), this.currentMask && (this.currentMask !== c ? (this.currentMask.reset(), o && (this.currentMask.append(o, {
|
|
2610
2611
|
raw: !0
|
|
2611
|
-
}), h.tailShift = this.currentMask.value.length -
|
|
2612
|
+
}), h.tailShift = this.currentMask.value.length - s.length), u && (h.tailShift += this.currentMask.append(u, {
|
|
2612
2613
|
raw: !0,
|
|
2613
2614
|
tail: !0
|
|
2614
2615
|
}).tailShift)) : d && (this.currentMask.state = d)), h;
|
|
@@ -2622,7 +2623,7 @@ class Lt extends ne {
|
|
|
2622
2623
|
return this.currentMask && e.aggregate(this.currentMask._appendEager()), e;
|
|
2623
2624
|
}
|
|
2624
2625
|
appendTail(e) {
|
|
2625
|
-
const t = new
|
|
2626
|
+
const t = new O();
|
|
2626
2627
|
return e && t.aggregate(this._applyDispatch("", {}, e)), t.aggregate(this.currentMask ? this.currentMask.appendTail(e) : super.appendTail(e));
|
|
2627
2628
|
}
|
|
2628
2629
|
currentMaskFlags(e) {
|
|
@@ -2640,21 +2641,21 @@ class Lt extends ne {
|
|
|
2640
2641
|
}
|
|
2641
2642
|
doPrepare(e, t) {
|
|
2642
2643
|
t === void 0 && (t = {});
|
|
2643
|
-
let [i,
|
|
2644
|
+
let [i, s] = super.doPrepare(e, t);
|
|
2644
2645
|
if (this.currentMask) {
|
|
2645
2646
|
let n;
|
|
2646
|
-
[i, n] = super.doPrepare(i, this.currentMaskFlags(t)),
|
|
2647
|
+
[i, n] = super.doPrepare(i, this.currentMaskFlags(t)), s = s.aggregate(n);
|
|
2647
2648
|
}
|
|
2648
|
-
return [i,
|
|
2649
|
+
return [i, s];
|
|
2649
2650
|
}
|
|
2650
2651
|
doPrepareChar(e, t) {
|
|
2651
2652
|
t === void 0 && (t = {});
|
|
2652
|
-
let [i,
|
|
2653
|
+
let [i, s] = super.doPrepareChar(e, t);
|
|
2653
2654
|
if (this.currentMask) {
|
|
2654
2655
|
let n;
|
|
2655
|
-
[i, n] = super.doPrepareChar(i, this.currentMaskFlags(t)),
|
|
2656
|
+
[i, n] = super.doPrepareChar(i, this.currentMaskFlags(t)), s = s.aggregate(n);
|
|
2656
2657
|
}
|
|
2657
|
-
return [i,
|
|
2658
|
+
return [i, s];
|
|
2658
2659
|
}
|
|
2659
2660
|
reset() {
|
|
2660
2661
|
var e;
|
|
@@ -2695,7 +2696,7 @@ class Lt extends ne {
|
|
|
2695
2696
|
return !!((e = this.currentMask) != null && e.isFilled);
|
|
2696
2697
|
}
|
|
2697
2698
|
remove(e, t) {
|
|
2698
|
-
const i = new
|
|
2699
|
+
const i = new O();
|
|
2699
2700
|
return this.currentMask && i.aggregate(this.currentMask.remove(e, t)).aggregate(this._applyDispatch()), i;
|
|
2700
2701
|
}
|
|
2701
2702
|
get state() {
|
|
@@ -2712,10 +2713,10 @@ class Lt extends ne {
|
|
|
2712
2713
|
const {
|
|
2713
2714
|
compiledMasks: t,
|
|
2714
2715
|
currentMaskRef: i,
|
|
2715
|
-
currentMask:
|
|
2716
|
+
currentMask: s,
|
|
2716
2717
|
...n
|
|
2717
2718
|
} = e;
|
|
2718
|
-
t && this.compiledMasks.forEach((o, u) => o.state = t[u]), i != null && (this.currentMask = i, this.currentMask.state =
|
|
2719
|
+
t && this.compiledMasks.forEach((o, u) => o.state = t[u]), i != null && (this.currentMask = i, this.currentMask.state = s), super.state = n;
|
|
2719
2720
|
}
|
|
2720
2721
|
extractInput(e, t, i) {
|
|
2721
2722
|
return this.currentMask ? this.currentMask.extractInput(e, t, i) : "";
|
|
@@ -2757,10 +2758,10 @@ class Lt extends ne {
|
|
|
2757
2758
|
return Array.isArray(e) ? this.compiledMasks.every((t, i) => {
|
|
2758
2759
|
if (!e[i]) return;
|
|
2759
2760
|
const {
|
|
2760
|
-
mask:
|
|
2761
|
+
mask: s,
|
|
2761
2762
|
...n
|
|
2762
2763
|
} = e[i];
|
|
2763
|
-
return Ct(t, n) && t.maskEquals(
|
|
2764
|
+
return Ct(t, n) && t.maskEquals(s);
|
|
2764
2765
|
}) : super.maskEquals(e);
|
|
2765
2766
|
}
|
|
2766
2767
|
typedValueEquals(e) {
|
|
@@ -2770,13 +2771,13 @@ class Lt extends ne {
|
|
|
2770
2771
|
}
|
|
2771
2772
|
Lt.DEFAULTS = {
|
|
2772
2773
|
...ne.DEFAULTS,
|
|
2773
|
-
dispatch: (
|
|
2774
|
+
dispatch: (a, e, t, i) => {
|
|
2774
2775
|
if (!e.compiledMasks.length) return;
|
|
2775
|
-
const
|
|
2776
|
+
const s = e.rawInputValue, n = e.compiledMasks.map((o, u) => {
|
|
2776
2777
|
const c = e.currentMask === o, h = c ? o.displayValue.length : o.nearestInputPos(o.displayValue.length, x.FORCE_LEFT);
|
|
2777
|
-
return o.rawInputValue !==
|
|
2778
|
+
return o.rawInputValue !== s ? (o.reset(), o.append(s, {
|
|
2778
2779
|
raw: !0
|
|
2779
|
-
})) : c || o.remove(h), o.append(
|
|
2780
|
+
})) : c || o.remove(h), o.append(a, e.currentMaskFlags(t)), o.appendTail(i), {
|
|
2780
2781
|
index: u,
|
|
2781
2782
|
weight: o.rawInputValue.length,
|
|
2782
2783
|
totalInputPositions: o.totalInputPositions(0, Math.max(h, o.nearestInputPos(o.displayValue.length, x.FORCE_LEFT)))
|
|
@@ -2802,37 +2803,37 @@ class At extends oe {
|
|
|
2802
2803
|
...i
|
|
2803
2804
|
} = e;
|
|
2804
2805
|
if (t) {
|
|
2805
|
-
const
|
|
2806
|
+
const s = t.map((u) => u.length), n = Math.min(...s), o = Math.max(...s) - n;
|
|
2806
2807
|
i.mask = "*".repeat(n), o && (i.mask += "[" + "*".repeat(o) + "]"), this.enum = t;
|
|
2807
2808
|
}
|
|
2808
2809
|
super._update(i);
|
|
2809
2810
|
}
|
|
2810
2811
|
_appendCharRaw(e, t) {
|
|
2811
2812
|
t === void 0 && (t = {});
|
|
2812
|
-
const i = Math.min(this.nearestInputPos(0, x.FORCE_RIGHT), this.value.length),
|
|
2813
|
-
if (
|
|
2814
|
-
|
|
2815
|
-
const c =
|
|
2813
|
+
const i = Math.min(this.nearestInputPos(0, x.FORCE_RIGHT), this.value.length), s = this.enum.filter((n) => this.matchValue(n, this.unmaskedValue + e, i));
|
|
2814
|
+
if (s.length) {
|
|
2815
|
+
s.length === 1 && this._forEachBlocksInRange(0, this.value.length, (o, u) => {
|
|
2816
|
+
const c = s[0][u];
|
|
2816
2817
|
u >= this.value.length || c === o.value || (o.reset(), o._appendChar(c, t));
|
|
2817
2818
|
});
|
|
2818
|
-
const n = super._appendCharRaw(
|
|
2819
|
-
return
|
|
2819
|
+
const n = super._appendCharRaw(s[0][this.value.length], t);
|
|
2820
|
+
return s.length === 1 && s[0].slice(this.unmaskedValue.length).split("").forEach((o) => n.aggregate(super._appendCharRaw(o))), n;
|
|
2820
2821
|
}
|
|
2821
|
-
return new
|
|
2822
|
+
return new O({
|
|
2822
2823
|
skip: !this.isComplete
|
|
2823
2824
|
});
|
|
2824
2825
|
}
|
|
2825
2826
|
extractTail(e, t) {
|
|
2826
|
-
return e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), new
|
|
2827
|
+
return e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), new Ie("", e);
|
|
2827
2828
|
}
|
|
2828
2829
|
remove(e, t) {
|
|
2829
|
-
if (e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), e === t) return new
|
|
2830
|
+
if (e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), e === t) return new O();
|
|
2830
2831
|
const i = Math.min(super.nearestInputPos(0, x.FORCE_RIGHT), this.value.length);
|
|
2831
|
-
let
|
|
2832
|
-
for (
|
|
2832
|
+
let s;
|
|
2833
|
+
for (s = e; s >= 0 && !(this.enum.filter((o) => this.matchValue(o, this.value.slice(i, s), i)).length > 1); --s)
|
|
2833
2834
|
;
|
|
2834
|
-
const n = super.remove(
|
|
2835
|
-
return n.tailShift +=
|
|
2835
|
+
const n = super.remove(s, t);
|
|
2836
|
+
return n.tailShift += s - e, n;
|
|
2836
2837
|
}
|
|
2837
2838
|
get isComplete() {
|
|
2838
2839
|
return this.enum.indexOf(this.value) >= 0;
|
|
@@ -2840,7 +2841,7 @@ class At extends oe {
|
|
|
2840
2841
|
}
|
|
2841
2842
|
At.DEFAULTS = {
|
|
2842
2843
|
...oe.DEFAULTS,
|
|
2843
|
-
matchValue: (
|
|
2844
|
+
matchValue: (a, e, t) => a.indexOf(e, t) === t
|
|
2844
2845
|
};
|
|
2845
2846
|
V.MaskedEnum = At;
|
|
2846
2847
|
class ss extends ne {
|
|
@@ -2901,7 +2902,7 @@ class fe extends ne {
|
|
|
2901
2902
|
}
|
|
2902
2903
|
doPrepareChar(e, t) {
|
|
2903
2904
|
t === void 0 && (t = {});
|
|
2904
|
-
const [i,
|
|
2905
|
+
const [i, s] = super.doPrepareChar(this._removeThousandsSeparators(this.scale && this.mapToRadix.length && /*
|
|
2905
2906
|
radix should be mapped when
|
|
2906
2907
|
1) input is done from keyboard = flags.input && flags.raw
|
|
2907
2908
|
2) unmasked value is set = !flags.input && !flags.raw
|
|
@@ -2910,13 +2911,13 @@ class fe extends ne {
|
|
|
2910
2911
|
2) raw value is set = !flags.input && flags.raw
|
|
2911
2912
|
*/
|
|
2912
2913
|
(t.input && t.raw || !t.input && !t.raw) ? e.replace(this._mapToRadixRegExp, this.radix) : e), t);
|
|
2913
|
-
return e && !i && (
|
|
2914
|
+
return e && !i && (s.skip = !0), i && !this.allowPositive && !this.value && i !== "-" && s.aggregate(this._appendChar("-")), [i, s];
|
|
2914
2915
|
}
|
|
2915
2916
|
_separatorsCount(e, t) {
|
|
2916
2917
|
t === void 0 && (t = !1);
|
|
2917
2918
|
let i = 0;
|
|
2918
|
-
for (let
|
|
2919
|
-
this._value.indexOf(this.thousandsSeparator,
|
|
2919
|
+
for (let s = 0; s < e; ++s)
|
|
2920
|
+
this._value.indexOf(this.thousandsSeparator, s) === s && (++i, t && (e += this.thousandsSeparator.length));
|
|
2920
2921
|
return i;
|
|
2921
2922
|
}
|
|
2922
2923
|
_separatorsCountFromSlice(e) {
|
|
@@ -2927,7 +2928,7 @@ class fe extends ne {
|
|
|
2927
2928
|
}
|
|
2928
2929
|
_appendCharRaw(e, t) {
|
|
2929
2930
|
t === void 0 && (t = {});
|
|
2930
|
-
const i = t.tail && t._beforeTailState ? t._beforeTailState._value : this._value,
|
|
2931
|
+
const i = t.tail && t._beforeTailState ? t._beforeTailState._value : this._value, s = this._separatorsCountFromSlice(i);
|
|
2931
2932
|
this._value = this._removeThousandsSeparators(this.value);
|
|
2932
2933
|
const n = this._value;
|
|
2933
2934
|
this._value += e;
|
|
@@ -2938,13 +2939,13 @@ class fe extends ne {
|
|
|
2938
2939
|
this.min != null && this.min < 0 && this.number < this.min && (r = this.min), this.max != null && this.max > 0 && this.number > this.max && (r = this.max), r != null && (this.autofix ? (this._value = this.format(r, this).replace(fe.UNMASKED_RADIX, this.radix), c || (c = n === this._value && !t.tail)) : u = !1), u && (u = !!this._value.match(this._numberRegExp));
|
|
2939
2940
|
}
|
|
2940
2941
|
let h;
|
|
2941
|
-
u ? h = new
|
|
2942
|
+
u ? h = new O({
|
|
2942
2943
|
inserted: this._value.slice(n.length),
|
|
2943
2944
|
rawInserted: c ? "" : e,
|
|
2944
2945
|
skip: c
|
|
2945
|
-
}) : (this._value = n, h = new
|
|
2946
|
-
const d = t.tail && t._beforeTailState ? t._beforeTailState._value : this._value,
|
|
2947
|
-
return h.tailShift += (
|
|
2946
|
+
}) : (this._value = n, h = new O()), this._value = this._insertThousandsSeparators(this._value);
|
|
2947
|
+
const d = t.tail && t._beforeTailState ? t._beforeTailState._value : this._value, m = this._separatorsCountFromSlice(d);
|
|
2948
|
+
return h.tailShift += (m - s) * this.thousandsSeparator.length, h;
|
|
2948
2949
|
}
|
|
2949
2950
|
_findSeparatorAround(e) {
|
|
2950
2951
|
if (this.thousandsSeparator) {
|
|
@@ -2956,15 +2957,15 @@ class fe extends ne {
|
|
|
2956
2957
|
_adjustRangeWithSeparators(e, t) {
|
|
2957
2958
|
const i = this._findSeparatorAround(e);
|
|
2958
2959
|
i >= 0 && (e = i);
|
|
2959
|
-
const
|
|
2960
|
-
return
|
|
2960
|
+
const s = this._findSeparatorAround(t);
|
|
2961
|
+
return s >= 0 && (t = s + this.thousandsSeparator.length), [e, t];
|
|
2961
2962
|
}
|
|
2962
2963
|
remove(e, t) {
|
|
2963
2964
|
e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), [e, t] = this._adjustRangeWithSeparators(e, t);
|
|
2964
|
-
const i = this.value.slice(0, e),
|
|
2965
|
-
this._value = this._insertThousandsSeparators(this._removeThousandsSeparators(i +
|
|
2965
|
+
const i = this.value.slice(0, e), s = this.value.slice(t), n = this._separatorsCount(i.length);
|
|
2966
|
+
this._value = this._insertThousandsSeparators(this._removeThousandsSeparators(i + s));
|
|
2966
2967
|
const o = this._separatorsCountFromSlice(i);
|
|
2967
|
-
return new
|
|
2968
|
+
return new O({
|
|
2968
2969
|
tailShift: (o - n) * this.thousandsSeparator.length
|
|
2969
2970
|
});
|
|
2970
2971
|
}
|
|
@@ -2976,8 +2977,8 @@ class fe extends ne {
|
|
|
2976
2977
|
case x.FORCE_LEFT: {
|
|
2977
2978
|
const i = this._findSeparatorAround(e - 1);
|
|
2978
2979
|
if (i >= 0) {
|
|
2979
|
-
const
|
|
2980
|
-
if (e <
|
|
2980
|
+
const s = i + this.thousandsSeparator.length;
|
|
2981
|
+
if (e < s || this.value.length <= s || t === x.FORCE_LEFT)
|
|
2981
2982
|
return i;
|
|
2982
2983
|
}
|
|
2983
2984
|
break;
|
|
@@ -3003,7 +3004,7 @@ class fe extends ne {
|
|
|
3003
3004
|
}
|
|
3004
3005
|
_normalizeZeros(e) {
|
|
3005
3006
|
const t = this._removeThousandsSeparators(e).split(this.radix);
|
|
3006
|
-
return t[0] = t[0].replace(/^(\D*)(0*)(\d*)/, (i,
|
|
3007
|
+
return t[0] = t[0].replace(/^(\D*)(0*)(\d*)/, (i, s, n, o) => s + o), e.length && !/\d$/.test(t[0]) && (t[0] = t[0] + "0"), t.length > 1 && (t[1] = t[1].replace(/0*$/, ""), t[1].length || (t.length = 1)), this._insertThousandsSeparators(t.join(this.radix));
|
|
3007
3008
|
}
|
|
3008
3009
|
_padFractionalZeros(e) {
|
|
3009
3010
|
if (!e) return e;
|
|
@@ -3012,8 +3013,8 @@ class fe extends ne {
|
|
|
3012
3013
|
}
|
|
3013
3014
|
doSkipInvalid(e, t, i) {
|
|
3014
3015
|
t === void 0 && (t = {});
|
|
3015
|
-
const
|
|
3016
|
-
return super.doSkipInvalid(e, t, i) && !
|
|
3016
|
+
const s = this.scale === 0 && e !== this.thousandsSeparator && (e === this.radix || e === fe.UNMASKED_RADIX || this.mapToRadix.includes(e));
|
|
3017
|
+
return super.doSkipInvalid(e, t, i) && !s;
|
|
3017
3018
|
}
|
|
3018
3019
|
get unmaskedValue() {
|
|
3019
3020
|
return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix, fe.UNMASKED_RADIX);
|
|
@@ -3059,7 +3060,7 @@ fe.DEFAULTS = {
|
|
|
3059
3060
|
normalizeZeros: !0,
|
|
3060
3061
|
padFractionalZeros: !1,
|
|
3061
3062
|
parse: Number,
|
|
3062
|
-
format: (
|
|
3063
|
+
format: (a) => a.toLocaleString("en-US", {
|
|
3063
3064
|
useGrouping: !1,
|
|
3064
3065
|
maximumFractionDigits: 20
|
|
3065
3066
|
})
|
|
@@ -3070,13 +3071,13 @@ const zt = {
|
|
|
3070
3071
|
UNMASKED: "unmaskedValue",
|
|
3071
3072
|
TYPED: "typedValue"
|
|
3072
3073
|
};
|
|
3073
|
-
function bi(
|
|
3074
|
+
function bi(a, e, t) {
|
|
3074
3075
|
e === void 0 && (e = zt.MASKED), t === void 0 && (t = zt.MASKED);
|
|
3075
|
-
const i = Pe(
|
|
3076
|
-
return (
|
|
3076
|
+
const i = Pe(a);
|
|
3077
|
+
return (s) => i.runIsolated((n) => (n[e] = s, n[t]));
|
|
3077
3078
|
}
|
|
3078
|
-
function as(
|
|
3079
|
-
return bi(e, t, i)(
|
|
3079
|
+
function as(a, e, t, i) {
|
|
3080
|
+
return bi(e, t, i)(a);
|
|
3080
3081
|
}
|
|
3081
3082
|
V.PIPE_TYPE = zt;
|
|
3082
3083
|
V.createPipe = bi;
|
|
@@ -3097,7 +3098,7 @@ class ns extends oe {
|
|
|
3097
3098
|
super.updateOptions(e);
|
|
3098
3099
|
}
|
|
3099
3100
|
_update(e) {
|
|
3100
|
-
var t, i,
|
|
3101
|
+
var t, i, s;
|
|
3101
3102
|
const {
|
|
3102
3103
|
repeat: n,
|
|
3103
3104
|
...o
|
|
@@ -3105,7 +3106,7 @@ class ns extends oe {
|
|
|
3105
3106
|
this._blockOpts = Object.assign({}, this._blockOpts, o);
|
|
3106
3107
|
const u = Pe(this._blockOpts);
|
|
3107
3108
|
this.repeat = (t = (i = n ?? u.repeat) != null ? i : this.repeat) != null ? t : 1 / 0, super._update({
|
|
3108
|
-
mask: "m".repeat(Math.max(this.repeatTo === 1 / 0 && ((
|
|
3109
|
+
mask: "m".repeat(Math.max(this.repeatTo === 1 / 0 && ((s = this._blocks) == null ? void 0 : s.length) || 0, this.repeatFrom)),
|
|
3109
3110
|
blocks: {
|
|
3110
3111
|
m: u
|
|
3111
3112
|
},
|
|
@@ -3124,33 +3125,33 @@ class ns extends oe {
|
|
|
3124
3125
|
}
|
|
3125
3126
|
_appendCharRaw(e, t) {
|
|
3126
3127
|
t === void 0 && (t = {});
|
|
3127
|
-
const i = new
|
|
3128
|
+
const i = new O();
|
|
3128
3129
|
for (
|
|
3129
|
-
let c = (
|
|
3130
|
+
let c = (s = (n = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : n.index) != null ? s : Math.max(this._blocks.length - 1, 0), h, d;
|
|
3130
3131
|
// try to get a block or
|
|
3131
3132
|
// try to allocate a new block if not allocated already
|
|
3132
3133
|
h = (o = this._blocks[c]) != null ? o : d = !d && this._allocateBlock(c);
|
|
3133
3134
|
++c
|
|
3134
3135
|
) {
|
|
3135
|
-
var
|
|
3136
|
-
const
|
|
3136
|
+
var s, n, o, u;
|
|
3137
|
+
const m = h._appendChar(e, {
|
|
3137
3138
|
...t,
|
|
3138
3139
|
_beforeTailState: (u = t._beforeTailState) == null || (u = u._blocks) == null ? void 0 : u[c]
|
|
3139
3140
|
});
|
|
3140
|
-
if (
|
|
3141
|
+
if (m.skip && d) {
|
|
3141
3142
|
this._blocks.pop(), this.mask = this.mask.slice(1);
|
|
3142
3143
|
break;
|
|
3143
3144
|
}
|
|
3144
|
-
if (i.aggregate(
|
|
3145
|
+
if (i.aggregate(m), m.consumed) break;
|
|
3145
3146
|
}
|
|
3146
3147
|
return i;
|
|
3147
3148
|
}
|
|
3148
3149
|
_trimEmptyTail(e, t) {
|
|
3149
|
-
var i,
|
|
3150
|
+
var i, s;
|
|
3150
3151
|
e === void 0 && (e = 0);
|
|
3151
3152
|
const n = Math.max(((i = this._mapPosToBlock(e)) == null ? void 0 : i.index) || 0, this.repeatFrom, 0);
|
|
3152
3153
|
let o;
|
|
3153
|
-
t != null && (o = (
|
|
3154
|
+
t != null && (o = (s = this._mapPosToBlock(t)) == null ? void 0 : s.index), o == null && (o = this._blocks.length - 1);
|
|
3154
3155
|
let u = 0;
|
|
3155
3156
|
for (let c = o; n <= c && !this._blocks[c].unmaskedValue; --c, ++u)
|
|
3156
3157
|
;
|
|
@@ -3194,7 +3195,7 @@ var os = {
|
|
|
3194
3195
|
eager: {
|
|
3195
3196
|
required: !1,
|
|
3196
3197
|
default: void 0,
|
|
3197
|
-
validator: (
|
|
3198
|
+
validator: (a) => ["append", "remove"].includes(a) || typeof a == "boolean"
|
|
3198
3199
|
},
|
|
3199
3200
|
skipInvalid: {
|
|
3200
3201
|
type: Boolean,
|
|
@@ -3224,7 +3225,7 @@ var os = {
|
|
|
3224
3225
|
autofix: {
|
|
3225
3226
|
required: !1,
|
|
3226
3227
|
default: void 0,
|
|
3227
|
-
validator: (
|
|
3228
|
+
validator: (a) => a === "pad" || typeof a == "boolean"
|
|
3228
3229
|
},
|
|
3229
3230
|
// number
|
|
3230
3231
|
radix: String,
|
|
@@ -3246,42 +3247,42 @@ var os = {
|
|
|
3246
3247
|
// dynamic
|
|
3247
3248
|
dispatch: Function
|
|
3248
3249
|
};
|
|
3249
|
-
function rs(
|
|
3250
|
+
function rs(a, e) {
|
|
3250
3251
|
let {
|
|
3251
3252
|
emit: t,
|
|
3252
3253
|
onAccept: i,
|
|
3253
|
-
onComplete:
|
|
3254
|
+
onComplete: s,
|
|
3254
3255
|
defaultValue: n,
|
|
3255
3256
|
defaultUnmaskedValue: o,
|
|
3256
3257
|
defaultTypedValue: u
|
|
3257
3258
|
} = e === void 0 ? {} : e;
|
|
3258
|
-
const c = Mi(
|
|
3259
|
-
let
|
|
3260
|
-
function
|
|
3261
|
-
|
|
3259
|
+
const c = Mi(a) ? a : E(a), h = E(), d = E(), m = E(""), r = E(""), f = E();
|
|
3260
|
+
let v, k = m.value, b = r.value, A = f.value;
|
|
3261
|
+
function I() {
|
|
3262
|
+
A = f.value = d.value.typedValue, b = r.value = d.value.unmaskedValue, k = m.value = d.value.value;
|
|
3262
3263
|
}
|
|
3263
3264
|
function z(N) {
|
|
3264
|
-
|
|
3265
|
+
I(), t && (t("accept", m.value, N), t("accept:masked", m.value, N), t("accept:typed", f.value, N), t("accept:unmasked", r.value, N)), i?.(N);
|
|
3265
3266
|
}
|
|
3266
|
-
function
|
|
3267
|
-
t && (t("complete", d.value.value, N), t("complete:masked", d.value.value, N), t("complete:typed", d.value.typedValue, N), t("complete:unmasked", d.value.unmaskedValue, N)),
|
|
3267
|
+
function M(N) {
|
|
3268
|
+
t && (t("complete", d.value.value, N), t("complete:masked", d.value.value, N), t("complete:typed", d.value.typedValue, N), t("complete:unmasked", d.value.unmaskedValue, N)), s?.(N);
|
|
3268
3269
|
}
|
|
3269
3270
|
const T = () => {
|
|
3270
|
-
!d.value || r.value === void 0 || (
|
|
3271
|
+
!d.value || r.value === void 0 || (b !== r.value && (d.value.unmaskedValue = r.value, d.value.unmaskedValue !== r.value && z()), b = void 0);
|
|
3271
3272
|
};
|
|
3272
3273
|
le(r, T);
|
|
3273
|
-
const
|
|
3274
|
-
!d.value ||
|
|
3274
|
+
const R = () => {
|
|
3275
|
+
!d.value || m.value === void 0 || (k !== m.value && (d.value.value = m.value, d.value.value !== m.value && z()), k = void 0);
|
|
3275
3276
|
};
|
|
3276
|
-
le(
|
|
3277
|
+
le(m, R);
|
|
3277
3278
|
const se = () => {
|
|
3278
|
-
!d.value ||
|
|
3279
|
+
!d.value || f.value === void 0 || (A !== f.value && (d.value.typedValue = f.value, d.value.masked.typedValueEquals(f.value) || z()), A = void 0);
|
|
3279
3280
|
};
|
|
3280
|
-
le(
|
|
3281
|
+
le(f, se);
|
|
3281
3282
|
function q() {
|
|
3282
|
-
|
|
3283
|
+
v = h.value;
|
|
3283
3284
|
const N = c.value;
|
|
3284
|
-
!
|
|
3285
|
+
!v || !(N != null && N.mask) || (d.value = V(v, N), n !== void 0 && (m.value = n), o !== void 0 && (r.value = o), u !== void 0 && (f.value = u), T(), R(), se(), I(), d.value.on("accept", z).on("complete", M));
|
|
3285
3286
|
}
|
|
3286
3287
|
function ue() {
|
|
3287
3288
|
var N;
|
|
@@ -3289,21 +3290,21 @@ function rs(s, e) {
|
|
|
3289
3290
|
}
|
|
3290
3291
|
return ut(q), Zt(ue), le([h, c], () => {
|
|
3291
3292
|
const N = h.value, Ne = c.value;
|
|
3292
|
-
(!(Ne != null && Ne.mask) || N !==
|
|
3293
|
+
(!(Ne != null && Ne.mask) || N !== v) && ue(), N && (d.value ? d.value.updateOptions(Ne) : q());
|
|
3293
3294
|
}), {
|
|
3294
3295
|
el: h,
|
|
3295
3296
|
mask: W(d),
|
|
3296
|
-
masked:
|
|
3297
|
+
masked: m,
|
|
3297
3298
|
unmasked: r,
|
|
3298
|
-
typed:
|
|
3299
|
+
typed: f
|
|
3299
3300
|
};
|
|
3300
3301
|
}
|
|
3301
|
-
function ls(
|
|
3302
|
-
return
|
|
3303
|
-
...
|
|
3304
|
-
}, Object.keys(
|
|
3305
|
-
(
|
|
3306
|
-
}),
|
|
3302
|
+
function ls(a, e) {
|
|
3303
|
+
return a = {
|
|
3304
|
+
...a
|
|
3305
|
+
}, Object.keys(a).forEach((t) => {
|
|
3306
|
+
(a[t] === void 0 || e.includes(t)) && delete a[t];
|
|
3307
|
+
}), a;
|
|
3307
3308
|
}
|
|
3308
3309
|
const us = ["typed", "unmasked", "value", "modelValue"];
|
|
3309
3310
|
var cs = be({
|
|
@@ -3320,36 +3321,36 @@ var cs = be({
|
|
|
3320
3321
|
...os
|
|
3321
3322
|
},
|
|
3322
3323
|
emits: ["update:modelValue", "update:masked", "update:value", "update:unmasked", "update:typed", "accept", "accept:value", "accept:masked", "accept:unmasked", "accept:typed", "complete", "complete:value", "complete:masked", "complete:unmasked", "complete:typed"],
|
|
3323
|
-
setup(
|
|
3324
|
+
setup(a, e) {
|
|
3324
3325
|
let {
|
|
3325
3326
|
attrs: t,
|
|
3326
3327
|
emit: i
|
|
3327
3328
|
} = e;
|
|
3328
3329
|
const {
|
|
3329
|
-
el:
|
|
3330
|
+
el: s,
|
|
3330
3331
|
mask: n,
|
|
3331
3332
|
masked: o,
|
|
3332
3333
|
unmasked: u,
|
|
3333
3334
|
typed: c
|
|
3334
|
-
} = rs(ls(
|
|
3335
|
+
} = rs(ls(a, us), {
|
|
3335
3336
|
emit: i,
|
|
3336
|
-
onAccept: (
|
|
3337
|
-
const
|
|
3338
|
-
i("accept:value",
|
|
3337
|
+
onAccept: (f) => {
|
|
3338
|
+
const v = o.value;
|
|
3339
|
+
i("accept:value", v, f), i("update:value", v, f), i("update:masked", v, f), i("update:modelValue", v, f), i("update:unmasked", u.value, f), i("update:typed", c.value, f);
|
|
3339
3340
|
},
|
|
3340
|
-
onComplete: (
|
|
3341
|
-
i("complete:value", o.value,
|
|
3341
|
+
onComplete: (f) => {
|
|
3342
|
+
i("complete:value", o.value, f);
|
|
3342
3343
|
}
|
|
3343
|
-
}), h = ot(
|
|
3344
|
-
return o.value = d.value || h.value || "", u.value =
|
|
3345
|
-
const
|
|
3344
|
+
}), h = ot(a, "value"), d = ot(a, "modelValue"), m = ot(a, "unmasked"), r = ot(a, "typed");
|
|
3345
|
+
return o.value = d.value || h.value || "", u.value = m.value || "", c.value = r.value, le(h, (f) => o.value = f), le(d, (f) => o.value = f), le(m, (f) => u.value = f), le(r, (f) => c.value = f), () => {
|
|
3346
|
+
const f = {
|
|
3346
3347
|
...t,
|
|
3347
|
-
value:
|
|
3348
|
-
ref:
|
|
3348
|
+
value: a.value != null ? a.value : a.modelValue != null ? a.modelValue : n.value ? n.value.displayValue : "",
|
|
3349
|
+
ref: s
|
|
3349
3350
|
};
|
|
3350
|
-
return
|
|
3351
|
-
i("update:modelValue",
|
|
3352
|
-
}), Li("input",
|
|
3351
|
+
return a.mask || (f.onInput = (v) => {
|
|
3352
|
+
i("update:modelValue", v.target.value), i("update:value", v.target.value);
|
|
3353
|
+
}), Li("input", f);
|
|
3353
3354
|
};
|
|
3354
3355
|
}
|
|
3355
3356
|
}), ds = cs;
|
|
@@ -3377,90 +3378,94 @@ const hs = ["for"], ps = { class: "state-layer" }, fs = { class: "content" }, ms
|
|
|
3377
3378
|
} }
|
|
3378
3379
|
},
|
|
3379
3380
|
emits: ["update:modelValue", "complete"],
|
|
3380
|
-
setup(
|
|
3381
|
-
const
|
|
3382
|
-
get: () =>
|
|
3383
|
-
set: (
|
|
3384
|
-
|
|
3381
|
+
setup(a, { expose: e, emit: t }) {
|
|
3382
|
+
const i = Ai(), s = a, n = $(() => typeof s.error == "string" ? s.error : s.error[0]), o = ot(s, "id"), u = t, c = E(""), h = $({
|
|
3383
|
+
get: () => s.modelValue !== void 0 ? s.modelValue : c.value,
|
|
3384
|
+
set: (k) => {
|
|
3385
|
+
u("update:modelValue", k), c.value = k;
|
|
3385
3386
|
}
|
|
3386
|
-
}), h = $(() => {
|
|
3387
|
-
const f = ["default-class"];
|
|
3388
|
-
return t.disabled != null && f.push("phila-input--disabled"), a.value && f.push("phila-input--error"), t.required != null && f.push("phila-input--required"), Nt(...f);
|
|
3389
3387
|
}), d = $(() => {
|
|
3390
|
-
const
|
|
3391
|
-
return
|
|
3392
|
-
}),
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
}), r =
|
|
3396
|
-
|
|
3388
|
+
const k = ["default-class"];
|
|
3389
|
+
return i.disabled != null && k.push("phila-input--disabled"), n.value && k.push("phila-input--error"), i.required != null && k.push("phila-input--required"), Nt(...k);
|
|
3390
|
+
}), m = $(() => {
|
|
3391
|
+
const k = [];
|
|
3392
|
+
return h.value !== "" && k.push("phila-text-field--filled"), s.className && k.push(s.className), Nt(...k);
|
|
3393
|
+
}), r = $(() => {
|
|
3394
|
+
if (!(s.label || i["aria-label"]))
|
|
3395
|
+
return s.placeholder || void 0;
|
|
3396
|
+
}), f = E(null), v = (k) => {
|
|
3397
|
+
k.target.closest("button") || f.value?.focus();
|
|
3397
3398
|
};
|
|
3398
|
-
return (f, k) => (
|
|
3399
|
-
class: me(["phila-input",
|
|
3399
|
+
return e({ inputRef: f }), (k, b) => (_(), L("div", {
|
|
3400
|
+
class: me(["phila-input", d.value])
|
|
3400
3401
|
}, [
|
|
3401
|
-
|
|
3402
|
+
s.label ? (_(), L("label", {
|
|
3402
3403
|
key: 0,
|
|
3403
|
-
for:
|
|
3404
|
+
for: o.value,
|
|
3404
3405
|
class: "has-text-label-small phila-label"
|
|
3405
|
-
},
|
|
3406
|
+
}, Q(s.label), 9, hs)) : Z("", !0),
|
|
3406
3407
|
D("div", {
|
|
3407
|
-
class: me(["phila-text-field",
|
|
3408
|
-
onClick: hi(
|
|
3408
|
+
class: me(["phila-text-field", m.value]),
|
|
3409
|
+
onClick: hi(v, ["prevent"])
|
|
3409
3410
|
}, [
|
|
3410
3411
|
D("div", ps, [
|
|
3411
|
-
|
|
3412
|
+
s.leadingIcon ? (_(), K(y(Te), {
|
|
3412
3413
|
key: 0,
|
|
3413
|
-
"icon-class":
|
|
3414
|
+
"icon-class": s.leadingIcon,
|
|
3414
3415
|
inline: "",
|
|
3415
3416
|
decorative: ""
|
|
3416
3417
|
}, null, 8, ["icon-class"])) : Z("", !0),
|
|
3417
3418
|
D("div", fs, [
|
|
3418
3419
|
D("div", ms, [
|
|
3419
|
-
|
|
3420
|
-
id:
|
|
3421
|
-
modelValue:
|
|
3422
|
-
"onUpdate:modelValue":
|
|
3420
|
+
s.imaskProps?.mask ? (_(), K(y(ds), _t({ key: 0 }, { ...y(i), ...s.imaskProps }, {
|
|
3421
|
+
id: o.value,
|
|
3422
|
+
modelValue: h.value,
|
|
3423
|
+
"onUpdate:modelValue": b[0] || (b[0] = (A) => h.value = A),
|
|
3423
3424
|
class: "phila-text-field-input has-text-body-default",
|
|
3424
|
-
placeholder:
|
|
3425
|
-
onComplete:
|
|
3426
|
-
}), null, 16, ["id", "modelValue", "placeholder"])) : pi((
|
|
3427
|
-
|
|
3428
|
-
|
|
3425
|
+
placeholder: s.placeholder,
|
|
3426
|
+
onComplete: b[1] || (b[1] = () => u("complete", c.value))
|
|
3427
|
+
}), null, 16, ["id", "modelValue", "placeholder"])) : pi((_(), L("input", _t({
|
|
3428
|
+
key: 1,
|
|
3429
|
+
id: o.value,
|
|
3430
|
+
ref_key: "inputRef",
|
|
3431
|
+
ref: f
|
|
3432
|
+
}, y(i), {
|
|
3433
|
+
"onUpdate:modelValue": b[2] || (b[2] = (A) => h.value = A),
|
|
3429
3434
|
class: "phila-text-field-input has-text-body-default",
|
|
3430
|
-
placeholder:
|
|
3431
|
-
"aria-label":
|
|
3435
|
+
placeholder: s.placeholder,
|
|
3436
|
+
"aria-label": r.value
|
|
3432
3437
|
}), null, 16, gs)), [
|
|
3433
|
-
[Ii,
|
|
3438
|
+
[Ii, h.value]
|
|
3434
3439
|
])
|
|
3435
3440
|
])
|
|
3436
3441
|
]),
|
|
3437
|
-
|
|
3442
|
+
h.value != "" ? (_(), K(y(ji), {
|
|
3438
3443
|
key: 1,
|
|
3439
3444
|
variant: "standard",
|
|
3440
3445
|
size: "small",
|
|
3441
3446
|
"icon-only": "",
|
|
3442
3447
|
"icon-definition": y(Wi),
|
|
3443
|
-
onClick:
|
|
3448
|
+
onClick: b[3] || (b[3] = (A) => h.value = "")
|
|
3444
3449
|
}, null, 8, ["icon-definition"])) : Z("", !0),
|
|
3445
|
-
|
|
3450
|
+
s.trailingIcon ? (_(), K(y(Te), {
|
|
3446
3451
|
key: 2,
|
|
3447
3452
|
size: "small",
|
|
3448
|
-
"icon-class":
|
|
3453
|
+
"icon-class": s.trailingIcon,
|
|
3449
3454
|
inline: "",
|
|
3450
3455
|
decorative: ""
|
|
3451
3456
|
}, null, 8, ["icon-class"])) : Z("", !0),
|
|
3452
|
-
Se(
|
|
3457
|
+
Se(k.$slots, "trailing-action")
|
|
3453
3458
|
])
|
|
3454
3459
|
], 2),
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
"icon-definition": y(
|
|
3460
|
+
s.supportingText ? (_(), L("div", vs, Q(s.supportingText), 1)) : Z("", !0),
|
|
3461
|
+
n.value ? (_(), L("div", ys, [
|
|
3462
|
+
ee(y(Te), {
|
|
3463
|
+
"icon-definition": y(Gi),
|
|
3459
3464
|
size: "small",
|
|
3460
3465
|
inline: "",
|
|
3461
3466
|
decorative: ""
|
|
3462
3467
|
}, null, 8, ["icon-definition"]),
|
|
3463
|
-
Ve(" " +
|
|
3468
|
+
Ve(" " + Q(n.value), 1)
|
|
3464
3469
|
])) : Z("", !0)
|
|
3465
3470
|
], 2));
|
|
3466
3471
|
}
|
|
@@ -3504,19 +3509,19 @@ const Es = {
|
|
|
3504
3509
|
error: {},
|
|
3505
3510
|
unavailable: { type: Boolean }
|
|
3506
3511
|
},
|
|
3507
|
-
setup(
|
|
3508
|
-
return (e, t) => (
|
|
3509
|
-
|
|
3510
|
-
|
|
3512
|
+
setup(a) {
|
|
3513
|
+
return (e, t) => (_(), L(ke, null, [
|
|
3514
|
+
a.loading && !a.unavailable ? (_(), L("span", Es, " Loading... ")) : Z("", !0),
|
|
3515
|
+
a.error ? (_(), L("span", {
|
|
3511
3516
|
key: 1,
|
|
3512
3517
|
class: "error-indicator",
|
|
3513
|
-
"aria-label":
|
|
3518
|
+
"aria-label": a.error,
|
|
3514
3519
|
role: "status"
|
|
3515
3520
|
}, " Error ", 8, Fs)) : Z("", !0),
|
|
3516
|
-
|
|
3521
|
+
a.unavailable ? (_(), L("span", xs, " (zoom in) ")) : Z("", !0)
|
|
3517
3522
|
], 64));
|
|
3518
3523
|
}
|
|
3519
|
-
}), St = /* @__PURE__ */
|
|
3524
|
+
}), St = /* @__PURE__ */ Oe(Ls, [["__scopeId", "data-v-19b1b402"]]), As = { class: "opacity-control" }, Is = ["for"], Ms = ["id", "value", "aria-label"], Ds = /* @__PURE__ */ be({
|
|
3520
3525
|
__name: "LayerOpacitySlider",
|
|
3521
3526
|
props: {
|
|
3522
3527
|
layerId: {},
|
|
@@ -3524,31 +3529,31 @@ const Es = {
|
|
|
3524
3529
|
opacity: {}
|
|
3525
3530
|
},
|
|
3526
3531
|
emits: ["update:opacity"],
|
|
3527
|
-
setup(
|
|
3532
|
+
setup(a, { emit: e }) {
|
|
3528
3533
|
const t = e;
|
|
3529
|
-
function i(
|
|
3530
|
-
const n =
|
|
3534
|
+
function i(s) {
|
|
3535
|
+
const n = s.target;
|
|
3531
3536
|
t("update:opacity", parseFloat(n.value));
|
|
3532
3537
|
}
|
|
3533
|
-
return (
|
|
3538
|
+
return (s, n) => (_(), L("div", As, [
|
|
3534
3539
|
D("label", {
|
|
3535
3540
|
class: "opacity-label",
|
|
3536
|
-
for: "opacity-" +
|
|
3537
|
-
}, " Opacity: " +
|
|
3541
|
+
for: "opacity-" + a.layerId
|
|
3542
|
+
}, " Opacity: " + Q(Math.round(a.opacity * 100)) + "% ", 9, Is),
|
|
3538
3543
|
D("input", {
|
|
3539
|
-
id: "opacity-" +
|
|
3544
|
+
id: "opacity-" + a.layerId,
|
|
3540
3545
|
type: "range",
|
|
3541
3546
|
min: "0",
|
|
3542
3547
|
max: "1",
|
|
3543
3548
|
step: "0.05",
|
|
3544
|
-
value:
|
|
3545
|
-
"aria-label": "Opacity for " +
|
|
3549
|
+
value: a.opacity,
|
|
3550
|
+
"aria-label": "Opacity for " + a.layerName,
|
|
3546
3551
|
class: "opacity-slider",
|
|
3547
3552
|
onInput: i
|
|
3548
3553
|
}, null, 40, Ms)
|
|
3549
3554
|
]));
|
|
3550
3555
|
}
|
|
3551
|
-
}), qt = /* @__PURE__ */
|
|
3556
|
+
}), qt = /* @__PURE__ */ Oe(Ds, [["__scopeId", "data-v-1a025f6a"]]), Ts = ["aria-label"], Bs = {
|
|
3552
3557
|
key: 3,
|
|
3553
3558
|
class: "legend-label"
|
|
3554
3559
|
}, Vs = /* @__PURE__ */ be({
|
|
@@ -3557,21 +3562,21 @@ const Es = {
|
|
|
3557
3562
|
items: {},
|
|
3558
3563
|
label: {}
|
|
3559
3564
|
},
|
|
3560
|
-
setup(
|
|
3561
|
-
return (e, t) => (
|
|
3565
|
+
setup(a) {
|
|
3566
|
+
return (e, t) => (_(), L("ul", {
|
|
3562
3567
|
class: "layer-legend",
|
|
3563
|
-
"aria-label":
|
|
3568
|
+
"aria-label": a.label
|
|
3564
3569
|
}, [
|
|
3565
|
-
(
|
|
3566
|
-
key:
|
|
3570
|
+
(_(!0), L(ke, null, Ae(a.items, (i, s) => (_(), L("li", {
|
|
3571
|
+
key: s,
|
|
3567
3572
|
class: "legend-item"
|
|
3568
3573
|
}, [
|
|
3569
|
-
i.type === "circle" ? (
|
|
3574
|
+
i.type === "circle" ? (_(), L("span", {
|
|
3570
3575
|
key: 0,
|
|
3571
3576
|
class: "legend-symbol legend-circle",
|
|
3572
3577
|
style: we({ backgroundColor: i.color }),
|
|
3573
3578
|
"aria-hidden": "true"
|
|
3574
|
-
}, null, 4)) : i.type === "line" ? (
|
|
3579
|
+
}, null, 4)) : i.type === "line" ? (_(), L("span", {
|
|
3575
3580
|
key: 1,
|
|
3576
3581
|
class: "legend-symbol legend-line",
|
|
3577
3582
|
style: we({
|
|
@@ -3579,7 +3584,7 @@ const Es = {
|
|
|
3579
3584
|
height: `${i.width || 2}px`
|
|
3580
3585
|
}),
|
|
3581
3586
|
"aria-hidden": "true"
|
|
3582
|
-
}, null, 4)) : i.type === "fill" ? (
|
|
3587
|
+
}, null, 4)) : i.type === "fill" ? (_(), L("span", {
|
|
3583
3588
|
key: 2,
|
|
3584
3589
|
class: "legend-symbol legend-fill",
|
|
3585
3590
|
style: we({
|
|
@@ -3589,34 +3594,34 @@ const Es = {
|
|
|
3589
3594
|
}),
|
|
3590
3595
|
"aria-hidden": "true"
|
|
3591
3596
|
}, null, 4)) : Z("", !0),
|
|
3592
|
-
|
|
3597
|
+
a.items.length > 1 ? (_(), L("span", Bs, Q(i.label), 1)) : Z("", !0)
|
|
3593
3598
|
]))), 128))
|
|
3594
3599
|
], 8, Ts));
|
|
3595
3600
|
}
|
|
3596
|
-
}),
|
|
3597
|
-
function
|
|
3601
|
+
}), Gt = /* @__PURE__ */ Oe(Vs, [["__scopeId", "data-v-3a9206ab"]]);
|
|
3602
|
+
function Ht(a) {
|
|
3598
3603
|
function e(o) {
|
|
3599
|
-
return
|
|
3604
|
+
return a().visibleLayerIds.has(o);
|
|
3600
3605
|
}
|
|
3601
3606
|
function t(o) {
|
|
3602
|
-
return
|
|
3607
|
+
return a().layerOpacities[o] ?? 1;
|
|
3603
3608
|
}
|
|
3604
3609
|
function i(o) {
|
|
3605
|
-
return
|
|
3610
|
+
return a().loadingLayerIds.has(o);
|
|
3606
3611
|
}
|
|
3607
|
-
function
|
|
3608
|
-
return
|
|
3612
|
+
function s(o) {
|
|
3613
|
+
return a().layerErrors[o] || null;
|
|
3609
3614
|
}
|
|
3610
3615
|
function n(o) {
|
|
3611
|
-
const u =
|
|
3616
|
+
const u = a().currentZoom, c = o.minZoom, h = o.maxZoom;
|
|
3612
3617
|
return !(c !== void 0 && u < c || h !== void 0 && u > h);
|
|
3613
3618
|
}
|
|
3614
|
-
return { isVisible: e, getLayerOpacity: t, isLayerLoading: i, getLayerError:
|
|
3619
|
+
return { isVisible: e, getLayerOpacity: t, isLayerLoading: i, getLayerError: s, isLayerAvailableAtZoom: n };
|
|
3615
3620
|
}
|
|
3616
|
-
const Ps = { class: "layer-panel" },
|
|
3621
|
+
const Ps = { class: "layer-panel" }, Os = {
|
|
3617
3622
|
key: 0,
|
|
3618
3623
|
class: "search-box"
|
|
3619
|
-
},
|
|
3624
|
+
}, Rs = {
|
|
3620
3625
|
key: 1,
|
|
3621
3626
|
class: "topics-container"
|
|
3622
3627
|
}, $s = { class: "layer-row" }, Ns = ["href", "aria-label"], zs = {
|
|
@@ -3643,18 +3648,18 @@ const Ps = { class: "layer-panel" }, Rs = {
|
|
|
3643
3648
|
searchPlaceholder: { default: "Filter layers..." }
|
|
3644
3649
|
},
|
|
3645
3650
|
emits: ["toggleLayer", "setOpacity", "updateSearch"],
|
|
3646
|
-
setup(
|
|
3647
|
-
const t =
|
|
3651
|
+
setup(a, { emit: e }) {
|
|
3652
|
+
const t = a, i = e, s = $(() => {
|
|
3648
3653
|
if (!t.searchQuery.trim())
|
|
3649
3654
|
return t.layerList;
|
|
3650
|
-
const
|
|
3651
|
-
return t.layerList.filter((k) => k.config.title.toLowerCase().includes(
|
|
3655
|
+
const v = t.searchQuery.toLowerCase();
|
|
3656
|
+
return t.layerList.filter((k) => k.config.title.toLowerCase().includes(v));
|
|
3652
3657
|
});
|
|
3653
|
-
function n(
|
|
3654
|
-
const k = fi(
|
|
3658
|
+
function n(v) {
|
|
3659
|
+
const k = fi(v);
|
|
3655
3660
|
return t.layerMetadata[k] || null;
|
|
3656
3661
|
}
|
|
3657
|
-
const o = $(() => t.layerList.some((
|
|
3662
|
+
const o = $(() => t.layerList.some((v) => n(v.config.url))), { isVisible: u, getLayerOpacity: c, isLayerLoading: h, getLayerError: d, isLayerAvailableAtZoom: m } = Ht(() => ({
|
|
3658
3663
|
visibleLayerIds: t.visibleLayers,
|
|
3659
3664
|
layerOpacities: t.layerOpacities,
|
|
3660
3665
|
loadingLayerIds: t.loadingLayers,
|
|
@@ -3662,21 +3667,21 @@ const Ps = { class: "layer-panel" }, Rs = {
|
|
|
3662
3667
|
currentZoom: t.currentZoom
|
|
3663
3668
|
})), r = $({
|
|
3664
3669
|
get: () => t.searchQuery,
|
|
3665
|
-
set: (
|
|
3670
|
+
set: (v) => i("updateSearch", v)
|
|
3666
3671
|
});
|
|
3667
|
-
function
|
|
3668
|
-
i("toggleLayer",
|
|
3672
|
+
function f(v) {
|
|
3673
|
+
i("toggleLayer", v);
|
|
3669
3674
|
}
|
|
3670
|
-
return (
|
|
3671
|
-
|
|
3672
|
-
|
|
3675
|
+
return (v, k) => (_(), L("div", Ps, [
|
|
3676
|
+
a.showSearch ? (_(), L("div", Os, [
|
|
3677
|
+
ee(y(ks), {
|
|
3673
3678
|
modelValue: r.value,
|
|
3674
|
-
"onUpdate:modelValue": k[0] || (k[0] = (
|
|
3675
|
-
placeholder:
|
|
3679
|
+
"onUpdate:modelValue": k[0] || (k[0] = (b) => r.value = b),
|
|
3680
|
+
placeholder: a.searchPlaceholder,
|
|
3676
3681
|
"class-name": "layer-search-field"
|
|
3677
3682
|
}, {
|
|
3678
3683
|
"trailing-action": rt(() => [
|
|
3679
|
-
|
|
3684
|
+
ee(y(Te), {
|
|
3680
3685
|
"icon-definition": y(bs),
|
|
3681
3686
|
size: "small",
|
|
3682
3687
|
inline: "",
|
|
@@ -3686,76 +3691,76 @@ const Ps = { class: "layer-panel" }, Rs = {
|
|
|
3686
3691
|
_: 1
|
|
3687
3692
|
}, 8, ["modelValue", "placeholder"])
|
|
3688
3693
|
])) : Z("", !0),
|
|
3689
|
-
|
|
3690
|
-
Se(
|
|
3694
|
+
a.mode === "topics" ? (_(), L("div", Rs, [
|
|
3695
|
+
Se(v.$slots, "topics", {}, () => [
|
|
3691
3696
|
k[2] || (k[2] = D("div", { class: "no-topics" }, ' No topic components provided. Use the "topics" slot to add TopicAccordion components. ', -1))
|
|
3692
3697
|
], !0)
|
|
3693
|
-
])) : (
|
|
3698
|
+
])) : (_(), L("div", {
|
|
3694
3699
|
key: 2,
|
|
3695
3700
|
class: me(["layer-list", { "has-metadata": o.value }])
|
|
3696
3701
|
}, [
|
|
3697
|
-
(
|
|
3698
|
-
key:
|
|
3702
|
+
(_(!0), L(ke, null, Ae(s.value, (b) => (_(), L("div", {
|
|
3703
|
+
key: b.config.id,
|
|
3699
3704
|
class: "layer-item"
|
|
3700
3705
|
}, [
|
|
3701
3706
|
D("div", $s, [
|
|
3702
|
-
n(
|
|
3707
|
+
n(b.config.url) ? (_(), L("a", {
|
|
3703
3708
|
key: 0,
|
|
3704
|
-
href: n(
|
|
3709
|
+
href: n(b.config.url) || "",
|
|
3705
3710
|
target: "_blank",
|
|
3706
3711
|
rel: "noopener noreferrer",
|
|
3707
3712
|
class: "metadata-link",
|
|
3708
|
-
"aria-label": "View metadata for " +
|
|
3713
|
+
"aria-label": "View metadata for " + b.config.title,
|
|
3709
3714
|
onClick: k[1] || (k[1] = hi(() => {
|
|
3710
3715
|
}, ["stop"]))
|
|
3711
3716
|
}, [
|
|
3712
|
-
|
|
3717
|
+
ee(y(Te), {
|
|
3713
3718
|
"icon-definition": y(Ss),
|
|
3714
3719
|
size: "small",
|
|
3715
3720
|
inline: "",
|
|
3716
3721
|
decorative: ""
|
|
3717
3722
|
}, null, 8, ["icon-definition"])
|
|
3718
|
-
], 8, Ns)) : o.value ? (
|
|
3723
|
+
], 8, Ns)) : o.value ? (_(), L("span", zs)) : Z("", !0),
|
|
3719
3724
|
D("label", {
|
|
3720
3725
|
class: me(["layer-checkbox", {
|
|
3721
|
-
"layer-unavailable": !y(
|
|
3722
|
-
"layer-error": y(d)(
|
|
3726
|
+
"layer-unavailable": !y(m)(b.config),
|
|
3727
|
+
"layer-error": y(d)(b.config.id)
|
|
3723
3728
|
}])
|
|
3724
3729
|
}, [
|
|
3725
3730
|
D("input", {
|
|
3726
3731
|
type: "checkbox",
|
|
3727
|
-
checked: y(u)(
|
|
3728
|
-
disabled: !y(
|
|
3729
|
-
onChange: (
|
|
3732
|
+
checked: y(u)(b.config.id),
|
|
3733
|
+
disabled: !y(m)(b.config),
|
|
3734
|
+
onChange: (A) => f(b.config.id)
|
|
3730
3735
|
}, null, 40, Us),
|
|
3731
3736
|
D("span", Zs, [
|
|
3732
|
-
Ve(
|
|
3733
|
-
|
|
3734
|
-
loading: y(h)(
|
|
3735
|
-
error: y(d)(
|
|
3736
|
-
unavailable: !y(
|
|
3737
|
+
Ve(Q(b.config.title) + " ", 1),
|
|
3738
|
+
ee(St, {
|
|
3739
|
+
loading: y(h)(b.config.id),
|
|
3740
|
+
error: y(d)(b.config.id),
|
|
3741
|
+
unavailable: !y(m)(b.config)
|
|
3737
3742
|
}, null, 8, ["loading", "error", "unavailable"])
|
|
3738
3743
|
])
|
|
3739
3744
|
], 2)
|
|
3740
3745
|
]),
|
|
3741
|
-
|
|
3746
|
+
a.showOpacity && y(u)(b.config.id) && y(m)(b.config) ? (_(), K(qt, {
|
|
3742
3747
|
key: 0,
|
|
3743
|
-
"layer-id":
|
|
3744
|
-
"layer-name":
|
|
3745
|
-
opacity: y(c)(
|
|
3746
|
-
"onUpdate:opacity": (
|
|
3748
|
+
"layer-id": b.config.id,
|
|
3749
|
+
"layer-name": b.config.title,
|
|
3750
|
+
opacity: y(c)(b.config.id),
|
|
3751
|
+
"onUpdate:opacity": (A) => i("setOpacity", b.config.id, A)
|
|
3747
3752
|
}, null, 8, ["layer-id", "layer-name", "opacity", "onUpdate:opacity"])) : Z("", !0),
|
|
3748
|
-
|
|
3753
|
+
a.showLegend && y(u)(b.config.id) && y(m)(b.config) && b.config.legend?.length ? (_(), K(Gt, {
|
|
3749
3754
|
key: 1,
|
|
3750
|
-
items:
|
|
3751
|
-
label: "Legend for " +
|
|
3755
|
+
items: b.config.legend,
|
|
3756
|
+
label: "Legend for " + b.config.title
|
|
3752
3757
|
}, null, 8, ["items", "label"])) : Z("", !0)
|
|
3753
3758
|
]))), 128)),
|
|
3754
|
-
|
|
3759
|
+
s.value.length === 0 ? (_(), L("div", js, 'No layers match "' + Q(a.searchQuery) + '"', 1)) : Z("", !0)
|
|
3755
3760
|
], 2))
|
|
3756
3761
|
]));
|
|
3757
3762
|
}
|
|
3758
|
-
}),
|
|
3763
|
+
}), Gs = /* @__PURE__ */ Oe(qs, [["__scopeId", "data-v-e48bb978"]]), Hs = {
|
|
3759
3764
|
esriSLSSolid: null,
|
|
3760
3765
|
esriSLSDash: [6, 1.5],
|
|
3761
3766
|
esriSLSDot: [1, 1.5],
|
|
@@ -3763,104 +3768,104 @@ const Ps = { class: "layer-panel" }, Rs = {
|
|
|
3763
3768
|
esriSLSDashDotDot: [6, 1.5, 1, 1.5, 1, 1.5],
|
|
3764
3769
|
esriSLSNull: null
|
|
3765
3770
|
};
|
|
3766
|
-
function dt(
|
|
3767
|
-
if (
|
|
3768
|
-
return
|
|
3771
|
+
function dt(a) {
|
|
3772
|
+
if (a)
|
|
3773
|
+
return Hs[a] ?? void 0;
|
|
3769
3774
|
}
|
|
3770
|
-
function Ws(
|
|
3775
|
+
function Ws(a, e, t, i, s) {
|
|
3771
3776
|
const n = [];
|
|
3772
|
-
let o = e[0], u = [
|
|
3773
|
-
for (let r = 1; r <
|
|
3774
|
-
e[r] === o ? u.push(
|
|
3777
|
+
let o = e[0], u = [a[0]], c = 0;
|
|
3778
|
+
for (let r = 1; r < a.length; r++)
|
|
3779
|
+
e[r] === o ? u.push(a[r]) : (n.push({ style: o, breaks: u, startIndex: c }), o = e[r], u = [a[r]], c = r);
|
|
3775
3780
|
n.push({ style: o, breaks: u, startIndex: c });
|
|
3776
3781
|
const h = [], d = /* @__PURE__ */ new Set();
|
|
3777
|
-
let
|
|
3782
|
+
let m = i.minValue ?? 0;
|
|
3778
3783
|
for (let r = 0; r < n.length; r++) {
|
|
3779
|
-
const
|
|
3780
|
-
let
|
|
3784
|
+
const f = n[r], v = f.breaks, k = dt(f.style), b = r === 0 ? null : n[r - 1].breaks[n[r - 1].breaks.length - 1].classMaxValue, A = v[v.length - 1].classMaxValue;
|
|
3785
|
+
let I;
|
|
3781
3786
|
const z = !!i.defaultSymbol;
|
|
3782
|
-
|
|
3783
|
-
const
|
|
3784
|
-
"line-opacity": Ee(
|
|
3787
|
+
b === null ? I = `${!z && i.minValue != null ? `${t} >= ${i.minValue} AND ` : ""}${t} <= ${A}` : r === n.length - 1 && z ? I = `${t} > ${b}` : I = `${t} > ${b} AND ${t} <= ${A}`;
|
|
3788
|
+
const M = {
|
|
3789
|
+
"line-opacity": Ee(s)
|
|
3785
3790
|
};
|
|
3786
|
-
if (k && (
|
|
3787
|
-
|
|
3791
|
+
if (k && (M["line-dasharray"] = k), v.length === 1)
|
|
3792
|
+
M["line-color"] = P(v[0].symbol?.color), M["line-width"] = Y(v[0].symbol?.width || 2);
|
|
3788
3793
|
else {
|
|
3789
3794
|
const q = ["step", ["get", t]], ue = ["step", ["get", t]];
|
|
3790
|
-
q.push(P(
|
|
3791
|
-
for (let N = 1; N <
|
|
3792
|
-
q.push(
|
|
3793
|
-
|
|
3795
|
+
q.push(P(v[0].symbol?.color)), ue.push(Y(v[0].symbol?.width || 2));
|
|
3796
|
+
for (let N = 1; N < v.length; N++)
|
|
3797
|
+
q.push(v[N - 1].classMaxValue), q.push(P(v[N].symbol?.color)), ue.push(v[N - 1].classMaxValue), ue.push(Y(v[N].symbol?.width || 2));
|
|
3798
|
+
M["line-color"] = q, M["line-width"] = ue;
|
|
3794
3799
|
}
|
|
3795
3800
|
const T = [];
|
|
3796
|
-
for (const q of
|
|
3801
|
+
for (const q of v)
|
|
3797
3802
|
T.push({
|
|
3798
3803
|
type: "line",
|
|
3799
3804
|
color: P(q.symbol?.color),
|
|
3800
3805
|
width: Y(q.symbol?.width || 2),
|
|
3801
|
-
label: q.label || `${
|
|
3802
|
-
}),
|
|
3803
|
-
const
|
|
3806
|
+
label: q.label || `${m} - ${q.classMaxValue}`
|
|
3807
|
+
}), m = q.classMaxValue + 1;
|
|
3808
|
+
const R = f.style.replace("esriSLS", "").toLowerCase();
|
|
3804
3809
|
let se;
|
|
3805
|
-
r === 0 ? se = "" : d.has(
|
|
3810
|
+
r === 0 ? se = "" : d.has(R) ? se = `-${R}-${r}` : se = `-${R}`, d.add(R), h.push({ suffix: se, where: I, paint: M, legend: T });
|
|
3806
3811
|
}
|
|
3807
3812
|
return h;
|
|
3808
3813
|
}
|
|
3809
|
-
function Ks(
|
|
3814
|
+
function Ks(a, e, t, i, s) {
|
|
3810
3815
|
const n = /* @__PURE__ */ new Map();
|
|
3811
|
-
for (const h of
|
|
3816
|
+
for (const h of a) {
|
|
3812
3817
|
const d = h.symbol?.style || "esriSLSSolid";
|
|
3813
3818
|
n.has(d) || n.set(d, []), n.get(d).push(h);
|
|
3814
3819
|
}
|
|
3815
3820
|
const o = [], u = /* @__PURE__ */ new Set();
|
|
3816
3821
|
let c = !0;
|
|
3817
3822
|
for (const [h, d] of n) {
|
|
3818
|
-
const
|
|
3823
|
+
const m = dt(h), f = d.map((I) => `${e} = '${String(I.value).replace(/'/g, "''")}'`).join(" OR "), v = {
|
|
3819
3824
|
"line-opacity": Ee(i)
|
|
3820
3825
|
};
|
|
3821
|
-
if (
|
|
3822
|
-
|
|
3826
|
+
if (m && (v["line-dasharray"] = m), d.length === 1)
|
|
3827
|
+
v["line-color"] = P(d[0].symbol?.color), v["line-width"] = Y(d[0].symbol?.width || 2);
|
|
3823
3828
|
else {
|
|
3824
|
-
const
|
|
3829
|
+
const I = ["match", ["to-string", ["get", e]]];
|
|
3825
3830
|
for (const z of d)
|
|
3826
|
-
|
|
3827
|
-
|
|
3831
|
+
I.push(bt(z.value)), I.push(P(z.symbol?.color));
|
|
3832
|
+
I.push(t ? P(t.color) : "rgba(0, 0, 0, 0)"), v["line-color"] = I, v["line-width"] = Y(d[0].symbol?.width || 2);
|
|
3828
3833
|
}
|
|
3829
3834
|
const k = [];
|
|
3830
|
-
for (const
|
|
3831
|
-
const z = String(
|
|
3835
|
+
for (const I of d) {
|
|
3836
|
+
const z = String(I.value), T = s?.get(z) || I.label || z;
|
|
3832
3837
|
k.push({
|
|
3833
3838
|
type: "line",
|
|
3834
|
-
color: P(
|
|
3835
|
-
width: Y(
|
|
3839
|
+
color: P(I.symbol?.color),
|
|
3840
|
+
width: Y(I.symbol?.width || 1),
|
|
3836
3841
|
label: T
|
|
3837
3842
|
});
|
|
3838
3843
|
}
|
|
3839
|
-
const
|
|
3840
|
-
let
|
|
3841
|
-
c ?
|
|
3844
|
+
const b = h.replace("esriSLS", "").toLowerCase();
|
|
3845
|
+
let A;
|
|
3846
|
+
c ? A = "" : u.has(b) ? A = `-${b}-${o.length}` : A = `-${b}`, u.add(b), c = !1, o.push({ suffix: A, where: f, paint: v, legend: k });
|
|
3842
3847
|
}
|
|
3843
3848
|
return o;
|
|
3844
3849
|
}
|
|
3845
|
-
function P(
|
|
3846
|
-
if (!
|
|
3847
|
-
const e =
|
|
3850
|
+
function P(a) {
|
|
3851
|
+
if (!a || !Array.isArray(a) || a.length < 3) return "#888888";
|
|
3852
|
+
const e = a[0], t = a[1], i = a[2], n = (a[3] ?? 255) / 255;
|
|
3848
3853
|
return n === 1 ? `#${e.toString(16).padStart(2, "0")}${t.toString(16).padStart(2, "0")}${i.toString(16).padStart(2, "0")}` : `rgba(${e}, ${t}, ${i}, ${n.toFixed(2)})`;
|
|
3849
3854
|
}
|
|
3850
|
-
function Ee(
|
|
3851
|
-
return
|
|
3855
|
+
function Ee(a) {
|
|
3856
|
+
return a !== void 0 ? a : 1;
|
|
3852
3857
|
}
|
|
3853
|
-
function Y(
|
|
3854
|
-
return Math.round(
|
|
3858
|
+
function Y(a) {
|
|
3859
|
+
return Math.round(a * (96 / 72) * 10) / 10;
|
|
3855
3860
|
}
|
|
3856
3861
|
const Ys = 559082264;
|
|
3857
|
-
function li(
|
|
3858
|
-
return !
|
|
3862
|
+
function li(a) {
|
|
3863
|
+
return !a || a <= 0 ? null : Math.round(Math.log2(Ys / a) * 100) / 100;
|
|
3859
3864
|
}
|
|
3860
|
-
function Xs(
|
|
3865
|
+
function Xs(a, e) {
|
|
3861
3866
|
const t = {};
|
|
3862
|
-
if (
|
|
3863
|
-
const i = li(
|
|
3867
|
+
if (a && a > 0) {
|
|
3868
|
+
const i = li(a);
|
|
3864
3869
|
i !== null && (t.minZoom = i);
|
|
3865
3870
|
}
|
|
3866
3871
|
if (e && e > 0) {
|
|
@@ -3869,9 +3874,9 @@ function Xs(s, e) {
|
|
|
3869
3874
|
}
|
|
3870
3875
|
return t;
|
|
3871
3876
|
}
|
|
3872
|
-
function It(
|
|
3873
|
-
if (!
|
|
3874
|
-
switch (
|
|
3877
|
+
function It(a) {
|
|
3878
|
+
if (!a) return "fill";
|
|
3879
|
+
switch (a.type) {
|
|
3875
3880
|
case "esriSFS":
|
|
3876
3881
|
return "fill";
|
|
3877
3882
|
case "esriSLS":
|
|
@@ -3886,25 +3891,25 @@ function It(s) {
|
|
|
3886
3891
|
return "fill";
|
|
3887
3892
|
}
|
|
3888
3893
|
}
|
|
3889
|
-
function Be(
|
|
3890
|
-
return !(!
|
|
3894
|
+
function Be(a) {
|
|
3895
|
+
return !(!a || a.style === "esriSLSNull" || a.color === null || a.width === 0 || a.color && a.color[3] === 0);
|
|
3891
3896
|
}
|
|
3892
|
-
function bt(
|
|
3893
|
-
return String(
|
|
3897
|
+
function bt(a) {
|
|
3898
|
+
return String(a);
|
|
3894
3899
|
}
|
|
3895
|
-
function _i(
|
|
3896
|
-
const i =
|
|
3900
|
+
function _i(a, e, t) {
|
|
3901
|
+
const i = a.symbol, s = It(i);
|
|
3897
3902
|
let n = {}, o = [], u = null;
|
|
3898
|
-
if (
|
|
3903
|
+
if (s === "fill" && i) {
|
|
3899
3904
|
const c = i.color === null ? 0 : i.color?.[3] ?? 255, h = c === 0 ? "rgba(0, 0, 0, 0)" : P(i.color), d = c === 0 ? 0 : c < 255 ? 1 : Ee(e);
|
|
3900
3905
|
if (n = {
|
|
3901
3906
|
"fill-color": h,
|
|
3902
3907
|
"fill-opacity": d
|
|
3903
3908
|
}, Be(i.outline)) {
|
|
3904
|
-
const
|
|
3909
|
+
const m = Y(i.outline.width || 1);
|
|
3905
3910
|
u = {
|
|
3906
3911
|
"line-color": P(i.outline.color),
|
|
3907
|
-
"line-width":
|
|
3912
|
+
"line-width": m
|
|
3908
3913
|
};
|
|
3909
3914
|
}
|
|
3910
3915
|
c === 0 && Be(i.outline) ? o = [
|
|
@@ -3913,16 +3918,16 @@ function _i(s, e, t) {
|
|
|
3913
3918
|
color: "transparent",
|
|
3914
3919
|
outlineColor: P(i.outline.color),
|
|
3915
3920
|
outlineWidth: Y(i.outline.width || 1),
|
|
3916
|
-
label:
|
|
3921
|
+
label: a.label || "Feature"
|
|
3917
3922
|
}
|
|
3918
3923
|
] : o = [
|
|
3919
3924
|
{
|
|
3920
3925
|
type: "fill",
|
|
3921
3926
|
color: P(i.color),
|
|
3922
|
-
label:
|
|
3927
|
+
label: a.label || "Feature"
|
|
3923
3928
|
}
|
|
3924
3929
|
];
|
|
3925
|
-
} else if (
|
|
3930
|
+
} else if (s === "line" && i) {
|
|
3926
3931
|
n = {
|
|
3927
3932
|
"line-color": P(i.color),
|
|
3928
3933
|
"line-width": Y(i.width || 1),
|
|
@@ -3934,10 +3939,10 @@ function _i(s, e, t) {
|
|
|
3934
3939
|
type: "line",
|
|
3935
3940
|
color: P(i.color),
|
|
3936
3941
|
width: Y(i.width || 1),
|
|
3937
|
-
label:
|
|
3942
|
+
label: a.label || "Feature"
|
|
3938
3943
|
}
|
|
3939
3944
|
];
|
|
3940
|
-
} else if (
|
|
3945
|
+
} else if (s === "circle" && i) {
|
|
3941
3946
|
const c = Math.round((i.size || 6) * 0.71 * 100) / 100;
|
|
3942
3947
|
n = {
|
|
3943
3948
|
"circle-color": P(i.color),
|
|
@@ -3947,37 +3952,37 @@ function _i(s, e, t) {
|
|
|
3947
3952
|
{
|
|
3948
3953
|
type: "circle",
|
|
3949
3954
|
color: P(i.color),
|
|
3950
|
-
label:
|
|
3955
|
+
label: a.label || "Feature"
|
|
3951
3956
|
}
|
|
3952
3957
|
];
|
|
3953
3958
|
}
|
|
3954
|
-
return { paint: n, legend: o, geomType:
|
|
3959
|
+
return { paint: n, legend: o, geomType: s, outlinePaint: u };
|
|
3955
3960
|
}
|
|
3956
|
-
function Js(
|
|
3957
|
-
const i =
|
|
3958
|
-
if (
|
|
3959
|
-
return _i({ ...
|
|
3960
|
-
const o =
|
|
3961
|
+
function Js(a, e, t) {
|
|
3962
|
+
const i = a.field1.toLowerCase(), s = a.uniqueValueInfos || [], n = a.defaultSymbol;
|
|
3963
|
+
if (s.length === 0)
|
|
3964
|
+
return _i({ ...a, symbol: n }, e);
|
|
3965
|
+
const o = s[0]?.symbol || n, u = It(o);
|
|
3961
3966
|
let c = {};
|
|
3962
3967
|
const h = [];
|
|
3963
3968
|
let d = null;
|
|
3964
3969
|
if (u === "fill") {
|
|
3965
|
-
const
|
|
3966
|
-
for (const r of
|
|
3967
|
-
|
|
3968
|
-
const
|
|
3970
|
+
const m = ["match", ["to-string", ["get", i]]];
|
|
3971
|
+
for (const r of s) {
|
|
3972
|
+
m.push(bt(r.value)), m.push(P(r.symbol?.color));
|
|
3973
|
+
const f = String(r.value), k = t?.get(f) || r.label || f;
|
|
3969
3974
|
h.push({
|
|
3970
3975
|
type: "fill",
|
|
3971
3976
|
color: P(r.symbol?.color),
|
|
3972
3977
|
label: k
|
|
3973
3978
|
});
|
|
3974
3979
|
}
|
|
3975
|
-
if (
|
|
3980
|
+
if (m.push(n ? P(n.color) : "rgba(0, 0, 0, 0)"), n && h.push({
|
|
3976
3981
|
type: "fill",
|
|
3977
3982
|
color: P(n.color),
|
|
3978
|
-
label:
|
|
3983
|
+
label: a.defaultLabel || "Other"
|
|
3979
3984
|
}), c = {
|
|
3980
|
-
"fill-color":
|
|
3985
|
+
"fill-color": m,
|
|
3981
3986
|
"fill-opacity": Ee(e)
|
|
3982
3987
|
}, Be(o?.outline)) {
|
|
3983
3988
|
const r = Y(Math.max(o.outline.width || 1, 1));
|
|
@@ -3987,65 +3992,65 @@ function Js(s, e, t) {
|
|
|
3987
3992
|
};
|
|
3988
3993
|
}
|
|
3989
3994
|
} else if (u === "line") {
|
|
3990
|
-
const
|
|
3991
|
-
for (const
|
|
3992
|
-
|
|
3993
|
-
const k = String(
|
|
3995
|
+
const m = ["match", ["to-string", ["get", i]]];
|
|
3996
|
+
for (const v of s) {
|
|
3997
|
+
m.push(bt(v.value)), m.push(P(v.symbol?.color));
|
|
3998
|
+
const k = String(v.value), A = t?.get(k) || v.label || k;
|
|
3994
3999
|
h.push({
|
|
3995
4000
|
type: "line",
|
|
3996
|
-
color: P(
|
|
3997
|
-
width: Y(
|
|
3998
|
-
label:
|
|
4001
|
+
color: P(v.symbol?.color),
|
|
4002
|
+
width: Y(v.symbol?.width || 1),
|
|
4003
|
+
label: A
|
|
3999
4004
|
});
|
|
4000
4005
|
}
|
|
4001
|
-
|
|
4006
|
+
m.push(n ? P(n.color) : "rgba(0, 0, 0, 0)"), n && h.push({
|
|
4002
4007
|
type: "line",
|
|
4003
4008
|
color: P(n.color),
|
|
4004
4009
|
width: Y(n.width || 1),
|
|
4005
|
-
label:
|
|
4010
|
+
label: a.defaultLabel || "Other"
|
|
4006
4011
|
}), c = {
|
|
4007
|
-
"line-color":
|
|
4012
|
+
"line-color": m,
|
|
4008
4013
|
"line-width": Y(o?.width || 2),
|
|
4009
4014
|
"line-opacity": Ee(e)
|
|
4010
4015
|
};
|
|
4011
|
-
const r =
|
|
4012
|
-
if (
|
|
4013
|
-
const
|
|
4014
|
-
return { paint: {}, legend: [], geomType: u, outlinePaint: d, splitLayers:
|
|
4016
|
+
const r = s.map((v) => v.symbol?.style || "esriSLSSolid"), f = [...new Set(r)];
|
|
4017
|
+
if (f.length > 1) {
|
|
4018
|
+
const v = Ks(s, i, n, e, t);
|
|
4019
|
+
return { paint: {}, legend: [], geomType: u, outlinePaint: d, splitLayers: v };
|
|
4015
4020
|
}
|
|
4016
|
-
if (
|
|
4017
|
-
const
|
|
4018
|
-
|
|
4021
|
+
if (f.length === 1) {
|
|
4022
|
+
const v = dt(f[0]);
|
|
4023
|
+
v && (c["line-dasharray"] = v);
|
|
4019
4024
|
}
|
|
4020
4025
|
} else if (u === "circle") {
|
|
4021
|
-
const
|
|
4022
|
-
for (const
|
|
4023
|
-
|
|
4024
|
-
const
|
|
4026
|
+
const m = ["match", ["to-string", ["get", i]]];
|
|
4027
|
+
for (const f of s) {
|
|
4028
|
+
m.push(bt(f.value)), m.push(P(f.symbol?.color));
|
|
4029
|
+
const v = String(f.value), b = t?.get(v) || f.label || v;
|
|
4025
4030
|
h.push({
|
|
4026
4031
|
type: "circle",
|
|
4027
|
-
color: P(
|
|
4028
|
-
label:
|
|
4032
|
+
color: P(f.symbol?.color),
|
|
4033
|
+
label: b
|
|
4029
4034
|
});
|
|
4030
4035
|
}
|
|
4031
|
-
|
|
4036
|
+
m.push(n ? P(n.color) : "rgba(0, 0, 0, 0)"), n && h.push({
|
|
4032
4037
|
type: "circle",
|
|
4033
4038
|
color: P(n.color),
|
|
4034
|
-
label:
|
|
4039
|
+
label: a.defaultLabel || "Other"
|
|
4035
4040
|
});
|
|
4036
4041
|
const r = Math.round((o?.size || 6) * 0.71 * 100) / 100;
|
|
4037
4042
|
c = {
|
|
4038
|
-
"circle-color":
|
|
4043
|
+
"circle-color": m,
|
|
4039
4044
|
"circle-radius": r,
|
|
4040
4045
|
"circle-opacity": Ee(e)
|
|
4041
4046
|
}, Be(o?.outline) && (c["circle-stroke-color"] = P(o.outline.color), c["circle-stroke-width"] = Y(o.outline.width || 1));
|
|
4042
4047
|
}
|
|
4043
4048
|
return { paint: c, legend: h, geomType: u, outlinePaint: d };
|
|
4044
4049
|
}
|
|
4045
|
-
function Qs(
|
|
4046
|
-
const t =
|
|
4047
|
-
if (
|
|
4048
|
-
return ea(
|
|
4050
|
+
function Qs(a, e) {
|
|
4051
|
+
const t = a.field.toLowerCase(), i = a.classBreakInfos || [], s = a.visualVariables?.find((d) => d.type === "colorInfo");
|
|
4052
|
+
if (s?.stops && s.stops.length > 0)
|
|
4053
|
+
return ea(s, t, a, e);
|
|
4049
4054
|
if (i.length === 0)
|
|
4050
4055
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
4051
4056
|
const n = i[0]?.symbol, o = It(n);
|
|
@@ -4055,9 +4060,9 @@ function Qs(s, e) {
|
|
|
4055
4060
|
if (o === "fill") {
|
|
4056
4061
|
const d = ["step", ["get", t]];
|
|
4057
4062
|
d.push(P(i[0]?.symbol?.color));
|
|
4058
|
-
for (let
|
|
4059
|
-
const r = i[
|
|
4060
|
-
|
|
4063
|
+
for (let m = 0; m < i.length; m++) {
|
|
4064
|
+
const r = i[m];
|
|
4065
|
+
m > 0 && (d.push(i[m - 1].classMaxValue), d.push(P(r.symbol?.color))), c.push({
|
|
4061
4066
|
type: "fill",
|
|
4062
4067
|
color: P(r.symbol?.color),
|
|
4063
4068
|
label: r.label || `${r.classMaxValue}`
|
|
@@ -4067,44 +4072,44 @@ function Qs(s, e) {
|
|
|
4067
4072
|
"fill-color": d,
|
|
4068
4073
|
"fill-opacity": Ee(e)
|
|
4069
4074
|
}, Be(n?.outline)) {
|
|
4070
|
-
const
|
|
4075
|
+
const m = Y(n.outline.width || 1);
|
|
4071
4076
|
h = {
|
|
4072
4077
|
"line-color": P(n.outline.color),
|
|
4073
|
-
"line-width":
|
|
4078
|
+
"line-width": m
|
|
4074
4079
|
};
|
|
4075
4080
|
}
|
|
4076
4081
|
} else if (o === "line") {
|
|
4077
|
-
const d = i.map((
|
|
4078
|
-
if (
|
|
4079
|
-
const
|
|
4080
|
-
return { paint: {}, legend: [], geomType: o, outlinePaint: h, splitLayers:
|
|
4081
|
-
}
|
|
4082
|
-
const
|
|
4083
|
-
|
|
4084
|
-
let
|
|
4085
|
-
for (let
|
|
4086
|
-
const
|
|
4087
|
-
|
|
4082
|
+
const d = i.map((A) => A.symbol?.style || "esriSLSSolid"), m = [...new Set(d)];
|
|
4083
|
+
if (m.length > 1) {
|
|
4084
|
+
const A = Ws(i, d, t, a, e);
|
|
4085
|
+
return { paint: {}, legend: [], geomType: o, outlinePaint: h, splitLayers: A };
|
|
4086
|
+
}
|
|
4087
|
+
const f = ["step", ["get", t]];
|
|
4088
|
+
f.push(P(i[0]?.symbol?.color));
|
|
4089
|
+
let v = a.minValue ?? 0;
|
|
4090
|
+
for (let A = 0; A < i.length; A++) {
|
|
4091
|
+
const I = i[A];
|
|
4092
|
+
A > 0 && (f.push(i[A - 1].classMaxValue), f.push(P(I.symbol?.color))), c.push({
|
|
4088
4093
|
type: "line",
|
|
4089
|
-
color: P(
|
|
4090
|
-
width: Y(
|
|
4091
|
-
label:
|
|
4092
|
-
}),
|
|
4094
|
+
color: P(I.symbol?.color),
|
|
4095
|
+
width: Y(I.symbol?.width || n?.width || 2),
|
|
4096
|
+
label: I.label || `${v} - ${I.classMaxValue}`
|
|
4097
|
+
}), v = I.classMaxValue + 1;
|
|
4093
4098
|
}
|
|
4094
4099
|
const k = Y(n?.width || 2);
|
|
4095
4100
|
u = {
|
|
4096
|
-
"line-color":
|
|
4101
|
+
"line-color": f,
|
|
4097
4102
|
"line-width": k,
|
|
4098
4103
|
"line-opacity": Ee(e)
|
|
4099
4104
|
};
|
|
4100
|
-
const
|
|
4101
|
-
|
|
4105
|
+
const b = dt(m[0]);
|
|
4106
|
+
b && (u["line-dasharray"] = b);
|
|
4102
4107
|
}
|
|
4103
4108
|
return { paint: u, legend: c, geomType: o, outlinePaint: h };
|
|
4104
4109
|
}
|
|
4105
|
-
function ea(
|
|
4106
|
-
const
|
|
4107
|
-
if (
|
|
4110
|
+
function ea(a, e, t, i) {
|
|
4111
|
+
const s = a.stops || [];
|
|
4112
|
+
if (s.length === 0)
|
|
4108
4113
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
4109
4114
|
const n = t.classBreakInfos?.[0]?.symbol || t.defaultSymbol, o = It(n);
|
|
4110
4115
|
let u = {};
|
|
@@ -4112,7 +4117,7 @@ function ea(s, e, t, i) {
|
|
|
4112
4117
|
let h = null;
|
|
4113
4118
|
if (o === "fill") {
|
|
4114
4119
|
const d = ["interpolate", ["linear"], ["get", e]];
|
|
4115
|
-
for (const r of
|
|
4120
|
+
for (const r of s)
|
|
4116
4121
|
d.push(r.value), d.push(P(r.color)), c.push({
|
|
4117
4122
|
type: "fill",
|
|
4118
4123
|
color: P(r.color),
|
|
@@ -4138,52 +4143,52 @@ function ea(s, e, t, i) {
|
|
|
4138
4143
|
}
|
|
4139
4144
|
return { paint: u, legend: c, geomType: o, outlinePaint: h };
|
|
4140
4145
|
}
|
|
4141
|
-
function ta(
|
|
4142
|
-
if (!
|
|
4146
|
+
function ta(a, e, t, i) {
|
|
4147
|
+
if (!a?.renderer)
|
|
4143
4148
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
4144
|
-
const
|
|
4145
|
-
switch (
|
|
4149
|
+
const s = a.renderer;
|
|
4150
|
+
switch (s.type) {
|
|
4146
4151
|
case "simple":
|
|
4147
|
-
return _i(
|
|
4152
|
+
return _i(s, e);
|
|
4148
4153
|
case "uniqueValue":
|
|
4149
|
-
return Js(
|
|
4154
|
+
return Js(s, e, t);
|
|
4150
4155
|
case "classBreaks":
|
|
4151
|
-
return Qs(
|
|
4156
|
+
return Qs(s, e);
|
|
4152
4157
|
default:
|
|
4153
4158
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
4154
4159
|
}
|
|
4155
4160
|
}
|
|
4156
|
-
function ia(
|
|
4157
|
-
if (!
|
|
4158
|
-
const e = (
|
|
4161
|
+
function ia(a) {
|
|
4162
|
+
if (!a) return null;
|
|
4163
|
+
const e = (a.title || "").replace(/\{([^}]+)\}/g, (n, o) => `{${o.toLowerCase()}}`), i = (a.fieldInfos || []).filter((n) => n.visible === !0).map((n) => {
|
|
4159
4164
|
const o = {
|
|
4160
4165
|
field: n.fieldName.toLowerCase(),
|
|
4161
4166
|
label: n.label || n.fieldName
|
|
4162
4167
|
};
|
|
4163
4168
|
return n.format && (o.format = {}, n.format.dateFormat && (o.format.dateFormat = n.format.dateFormat), n.format.digitSeparator !== void 0 && (o.format.digitSeparator = n.format.digitSeparator), n.format.places !== void 0 && (o.format.places = n.format.places), Object.keys(o.format).length === 0 && delete o.format), o;
|
|
4164
|
-
}),
|
|
4169
|
+
}), s = {
|
|
4165
4170
|
title: e,
|
|
4166
4171
|
fields: i
|
|
4167
4172
|
};
|
|
4168
|
-
return
|
|
4173
|
+
return a.showTime && (s.showTime = !0), s;
|
|
4169
4174
|
}
|
|
4170
|
-
function sa(
|
|
4171
|
-
return
|
|
4175
|
+
function sa(a) {
|
|
4176
|
+
return a?.definitionExpression;
|
|
4172
4177
|
}
|
|
4173
|
-
function aa(
|
|
4174
|
-
return (
|
|
4178
|
+
function aa(a) {
|
|
4179
|
+
return (a.includes("_") ? a.split("_").slice(1).join(" ") : a).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
4175
4180
|
}
|
|
4176
|
-
function na(
|
|
4177
|
-
return
|
|
4181
|
+
function na(a) {
|
|
4182
|
+
return a.includes("_") ? a.split("_").slice(1).join(" ") : a;
|
|
4178
4183
|
}
|
|
4179
|
-
function oa(
|
|
4184
|
+
function oa(a) {
|
|
4180
4185
|
const e = /* @__PURE__ */ new Map();
|
|
4181
|
-
if (!
|
|
4186
|
+
if (!a)
|
|
4182
4187
|
return e;
|
|
4183
|
-
const t =
|
|
4188
|
+
const t = a.split(`
|
|
4184
4189
|
`), i = /^(\d{1,3})\s+(.+)$/;
|
|
4185
|
-
for (const
|
|
4186
|
-
const n =
|
|
4190
|
+
for (const s of t) {
|
|
4191
|
+
const n = s.trim().match(i);
|
|
4187
4192
|
if (n) {
|
|
4188
4193
|
const [, o, u] = n;
|
|
4189
4194
|
o && u && e.set(o, u.trim());
|
|
@@ -4191,9 +4196,9 @@ function oa(s) {
|
|
|
4191
4196
|
}
|
|
4192
4197
|
return e;
|
|
4193
4198
|
}
|
|
4194
|
-
async function ra(
|
|
4199
|
+
async function ra(a) {
|
|
4195
4200
|
try {
|
|
4196
|
-
const e = await fetch(`${
|
|
4201
|
+
const e = await fetch(`${a}?f=json`);
|
|
4197
4202
|
if (!e.ok)
|
|
4198
4203
|
return null;
|
|
4199
4204
|
const t = await e.json();
|
|
@@ -4205,99 +4210,99 @@ async function ra(s) {
|
|
|
4205
4210
|
return null;
|
|
4206
4211
|
}
|
|
4207
4212
|
}
|
|
4208
|
-
function ui(
|
|
4213
|
+
function ui(a) {
|
|
4209
4214
|
const e = {
|
|
4210
|
-
id:
|
|
4211
|
-
title:
|
|
4212
|
-
type:
|
|
4213
|
-
url:
|
|
4214
|
-
opacity:
|
|
4215
|
-
paint:
|
|
4216
|
-
legend:
|
|
4217
|
-
popup:
|
|
4215
|
+
id: a.id,
|
|
4216
|
+
title: a.title,
|
|
4217
|
+
type: a.type,
|
|
4218
|
+
url: a.url,
|
|
4219
|
+
opacity: a.opacity,
|
|
4220
|
+
paint: a.paint,
|
|
4221
|
+
legend: a.legend,
|
|
4222
|
+
popup: a.popup
|
|
4218
4223
|
};
|
|
4219
|
-
return
|
|
4224
|
+
return a.where && (e.where = a.where), a.minZoom !== void 0 && (e.minZoom = a.minZoom), a.maxZoom !== void 0 && (e.maxZoom = a.maxZoom), a.outlinePaint && (e.outlinePaint = a.outlinePaint), a.parentId && (e.parentId = a.parentId), e;
|
|
4220
4225
|
}
|
|
4221
|
-
async function Ci(
|
|
4222
|
-
const e =
|
|
4223
|
-
for (const
|
|
4224
|
-
if (
|
|
4226
|
+
async function Ci(a) {
|
|
4227
|
+
const e = a.operationalLayers || [], t = [], i = ["Zoning and Planning_Land Use"];
|
|
4228
|
+
for (const s of e)
|
|
4229
|
+
if (s.url && !s.title?.toLowerCase().includes("(under construction)") && !(s.url && /\/MapServer(\/\d+)?$/i.test(s.url)))
|
|
4225
4230
|
try {
|
|
4226
|
-
let n =
|
|
4227
|
-
const u = !n || !n.renderer, c = i.includes(
|
|
4228
|
-
if ((u || c) &&
|
|
4229
|
-
const T = await ra(
|
|
4231
|
+
let n = s.layerDefinition?.drawingInfo, o;
|
|
4232
|
+
const u = !n || !n.renderer, c = i.includes(s.title), h = n?.renderer?.uniqueValueInfos?.[0]?.symbol?.outline || n?.renderer?.defaultSymbol?.outline;
|
|
4233
|
+
if ((u || c) && s.url) {
|
|
4234
|
+
const T = await ra(s.url);
|
|
4230
4235
|
if (T) {
|
|
4231
4236
|
if (n = T.drawingInfo, h && Be(h) && n?.renderer) {
|
|
4232
|
-
const
|
|
4237
|
+
const R = n.renderer, se = R.uniqueValueInfos?.[0]?.symbol?.outline || R.defaultSymbol?.outline;
|
|
4233
4238
|
if (!Be(se)) {
|
|
4234
|
-
for (const q of
|
|
4239
|
+
for (const q of R.uniqueValueInfos || [])
|
|
4235
4240
|
q.symbol && (q.symbol.outline = h);
|
|
4236
|
-
|
|
4241
|
+
R.defaultSymbol && (R.defaultSymbol.outline = h);
|
|
4237
4242
|
}
|
|
4238
4243
|
}
|
|
4239
4244
|
T.description && (o = oa(T.description), o.size > 0);
|
|
4240
4245
|
}
|
|
4241
4246
|
}
|
|
4242
|
-
const { paint: d, legend:
|
|
4247
|
+
const { paint: d, legend: m, geomType: r, outlinePaint: f, splitLayers: v } = ta(
|
|
4243
4248
|
n,
|
|
4244
|
-
|
|
4249
|
+
s.opacity,
|
|
4245
4250
|
o,
|
|
4246
|
-
|
|
4247
|
-
), k = ia(
|
|
4248
|
-
if (
|
|
4249
|
-
for (const T of
|
|
4250
|
-
const
|
|
4251
|
+
s.title
|
|
4252
|
+
), k = ia(s.popupInfo), b = sa(s.layerDefinition), A = Xs(s.layerDefinition?.minScale, s.layerDefinition?.maxScale), I = aa(s.title), z = na(s.title), M = s.opacity ?? 1;
|
|
4253
|
+
if (v && v.length > 0)
|
|
4254
|
+
for (const T of v) {
|
|
4255
|
+
const R = `${I}${T.suffix}`;
|
|
4251
4256
|
t.push(ui({
|
|
4252
|
-
id:
|
|
4257
|
+
id: R,
|
|
4253
4258
|
title: z,
|
|
4254
4259
|
type: r,
|
|
4255
|
-
url:
|
|
4256
|
-
opacity:
|
|
4260
|
+
url: s.url,
|
|
4261
|
+
opacity: M,
|
|
4257
4262
|
paint: T.paint,
|
|
4258
4263
|
legend: T.legend,
|
|
4259
4264
|
popup: k,
|
|
4260
|
-
where:
|
|
4261
|
-
minZoom:
|
|
4262
|
-
maxZoom:
|
|
4263
|
-
parentId: T.suffix ?
|
|
4265
|
+
where: b ? `(${b}) AND (${T.where})` : T.where,
|
|
4266
|
+
minZoom: A.minZoom,
|
|
4267
|
+
maxZoom: A.maxZoom,
|
|
4268
|
+
parentId: T.suffix ? I : void 0
|
|
4264
4269
|
}));
|
|
4265
4270
|
}
|
|
4266
4271
|
else
|
|
4267
4272
|
t.push(ui({
|
|
4268
|
-
id:
|
|
4273
|
+
id: I,
|
|
4269
4274
|
title: z,
|
|
4270
4275
|
type: r,
|
|
4271
|
-
url:
|
|
4272
|
-
opacity:
|
|
4276
|
+
url: s.url,
|
|
4277
|
+
opacity: M,
|
|
4273
4278
|
paint: d,
|
|
4274
|
-
legend:
|
|
4279
|
+
legend: m,
|
|
4275
4280
|
popup: k,
|
|
4276
|
-
where:
|
|
4277
|
-
minZoom:
|
|
4278
|
-
maxZoom:
|
|
4279
|
-
outlinePaint:
|
|
4281
|
+
where: b,
|
|
4282
|
+
minZoom: A.minZoom,
|
|
4283
|
+
maxZoom: A.maxZoom,
|
|
4284
|
+
outlinePaint: f
|
|
4280
4285
|
}));
|
|
4281
4286
|
} catch {
|
|
4282
4287
|
}
|
|
4283
|
-
return t.sort((
|
|
4288
|
+
return t.sort((s, n) => s.title.localeCompare(n.title)), t;
|
|
4284
4289
|
}
|
|
4285
4290
|
const ci = {}, Wt = "376af635c84643cd816a8c5d017a53aa", qa = Wt;
|
|
4286
|
-
function Kt(
|
|
4287
|
-
let t = `https://www.arcgis.com/sharing/rest/content/items/${
|
|
4291
|
+
function Kt(a, e) {
|
|
4292
|
+
let t = `https://www.arcgis.com/sharing/rest/content/items/${a}/data?f=json`;
|
|
4288
4293
|
return e && (t += `&token=${e}`), t;
|
|
4289
4294
|
}
|
|
4290
|
-
function
|
|
4295
|
+
function Ga() {
|
|
4291
4296
|
return Kt(Wt);
|
|
4292
4297
|
}
|
|
4293
4298
|
const Et = /* @__PURE__ */ new Map(), lt = /* @__PURE__ */ new Map();
|
|
4294
|
-
function la(
|
|
4295
|
-
|
|
4299
|
+
function la(a) {
|
|
4300
|
+
a ? (Et.delete(a), lt.delete(a)) : (Et.clear(), lt.clear());
|
|
4296
4301
|
}
|
|
4297
4302
|
let yt, di = 0;
|
|
4298
4303
|
async function ua() {
|
|
4299
|
-
const
|
|
4300
|
-
if (!(!
|
|
4304
|
+
const a = typeof import.meta < "u" && ci?.VITE_AGO_USERNAME, e = typeof import.meta < "u" && ci?.VITE_AGO_PASSWORD;
|
|
4305
|
+
if (!(!a || !e)) {
|
|
4301
4306
|
if (yt && Date.now() < di - 3e5)
|
|
4302
4307
|
return yt;
|
|
4303
4308
|
try {
|
|
@@ -4308,7 +4313,7 @@ async function ua() {
|
|
|
4308
4313
|
},
|
|
4309
4314
|
body: new URLSearchParams({
|
|
4310
4315
|
f: "json",
|
|
4311
|
-
username:
|
|
4316
|
+
username: a,
|
|
4312
4317
|
password: e,
|
|
4313
4318
|
referer: window.location.origin || "https://localhost",
|
|
4314
4319
|
expiration: "120"
|
|
@@ -4321,18 +4326,18 @@ async function ua() {
|
|
|
4321
4326
|
}
|
|
4322
4327
|
}
|
|
4323
4328
|
}
|
|
4324
|
-
async function ca(
|
|
4325
|
-
const t = Kt(
|
|
4329
|
+
async function ca(a, e) {
|
|
4330
|
+
const t = Kt(a, e), i = await fetch(t, { cache: "no-store" });
|
|
4326
4331
|
if (!i.ok)
|
|
4327
4332
|
throw new Error(`Failed to fetch WebMap: ${i.status} ${i.statusText}`);
|
|
4328
|
-
const
|
|
4329
|
-
if (
|
|
4330
|
-
throw new Error(`ArcGIS error: ${
|
|
4331
|
-
return
|
|
4333
|
+
const s = await i.json();
|
|
4334
|
+
if (s.error)
|
|
4335
|
+
throw new Error(`ArcGIS error: ${s.error.message || s.error.code || "Unknown error"}`);
|
|
4336
|
+
return s;
|
|
4332
4337
|
}
|
|
4333
|
-
async function da(
|
|
4338
|
+
async function da(a) {
|
|
4334
4339
|
try {
|
|
4335
|
-
const e = await ua(), t = await ca(
|
|
4340
|
+
const e = await ua(), t = await ca(a, e);
|
|
4336
4341
|
return await Ci(t);
|
|
4337
4342
|
} catch (e) {
|
|
4338
4343
|
throw new Error(
|
|
@@ -4340,26 +4345,26 @@ async function da(s) {
|
|
|
4340
4345
|
);
|
|
4341
4346
|
}
|
|
4342
4347
|
}
|
|
4343
|
-
async function Ut(
|
|
4344
|
-
const e = Et.get(
|
|
4348
|
+
async function Ut(a = Wt) {
|
|
4349
|
+
const e = Et.get(a);
|
|
4345
4350
|
if (e)
|
|
4346
4351
|
return e;
|
|
4347
|
-
const t = lt.get(
|
|
4352
|
+
const t = lt.get(a);
|
|
4348
4353
|
if (t)
|
|
4349
4354
|
return t;
|
|
4350
4355
|
const i = (async () => {
|
|
4351
4356
|
try {
|
|
4352
|
-
const
|
|
4353
|
-
return Et.set(
|
|
4357
|
+
const s = await da(a);
|
|
4358
|
+
return Et.set(a, s), s;
|
|
4354
4359
|
} finally {
|
|
4355
|
-
lt.delete(
|
|
4360
|
+
lt.delete(a);
|
|
4356
4361
|
}
|
|
4357
4362
|
})();
|
|
4358
|
-
return lt.set(
|
|
4363
|
+
return lt.set(a, i), i;
|
|
4359
4364
|
}
|
|
4360
|
-
function ha(
|
|
4361
|
-
const e =
|
|
4362
|
-
for (const r of
|
|
4365
|
+
function ha(a) {
|
|
4366
|
+
const e = E({}), t = /* @__PURE__ */ new Map();
|
|
4367
|
+
for (const r of a)
|
|
4363
4368
|
e.value[r.id] = {
|
|
4364
4369
|
data: null,
|
|
4365
4370
|
loading: !1,
|
|
@@ -4367,18 +4372,18 @@ function ha(s) {
|
|
|
4367
4372
|
lastFetched: null
|
|
4368
4373
|
};
|
|
4369
4374
|
async function i(r) {
|
|
4370
|
-
const
|
|
4375
|
+
const f = r.id;
|
|
4371
4376
|
e.value = {
|
|
4372
4377
|
...e.value,
|
|
4373
|
-
[
|
|
4374
|
-
data: e.value[
|
|
4375
|
-
lastFetched: e.value[
|
|
4378
|
+
[f]: {
|
|
4379
|
+
data: e.value[f]?.data ?? null,
|
|
4380
|
+
lastFetched: e.value[f]?.lastFetched ?? null,
|
|
4376
4381
|
loading: !0,
|
|
4377
4382
|
error: null
|
|
4378
4383
|
}
|
|
4379
4384
|
};
|
|
4380
4385
|
try {
|
|
4381
|
-
let
|
|
4386
|
+
let v;
|
|
4382
4387
|
if (r.type === "http-get") {
|
|
4383
4388
|
const k = await fetch(r.url, {
|
|
4384
4389
|
method: "GET",
|
|
@@ -4386,7 +4391,7 @@ function ha(s) {
|
|
|
4386
4391
|
});
|
|
4387
4392
|
if (!k.ok)
|
|
4388
4393
|
throw new Error(`HTTP ${k.status}: ${k.statusText}`);
|
|
4389
|
-
|
|
4394
|
+
v = await k.json();
|
|
4390
4395
|
} else if (r.type === "http-post") {
|
|
4391
4396
|
const k = await fetch(r.url, {
|
|
4392
4397
|
method: "POST",
|
|
@@ -4394,42 +4399,42 @@ function ha(s) {
|
|
|
4394
4399
|
});
|
|
4395
4400
|
if (!k.ok)
|
|
4396
4401
|
throw new Error(`HTTP ${k.status}: ${k.statusText}`);
|
|
4397
|
-
|
|
4402
|
+
v = await k.json();
|
|
4398
4403
|
} else if (r.type === "esri") {
|
|
4399
|
-
const
|
|
4400
|
-
if (!
|
|
4401
|
-
throw new Error(`HTTP ${
|
|
4402
|
-
|
|
4404
|
+
const b = `${r.url.replace(/\/$/, "")}/query?where=1%3D1&outFields=*&returnGeometry=false&f=json`, A = await fetch(b, r.options);
|
|
4405
|
+
if (!A.ok)
|
|
4406
|
+
throw new Error(`HTTP ${A.status}: ${A.statusText}`);
|
|
4407
|
+
v = (await A.json()).features?.map((z) => z.attributes) || [];
|
|
4403
4408
|
} else
|
|
4404
4409
|
throw new Error(`Unknown data source type: ${r.type}`);
|
|
4405
|
-
r.transform && (
|
|
4410
|
+
r.transform && (v = r.transform(v)), e.value = {
|
|
4406
4411
|
...e.value,
|
|
4407
|
-
[
|
|
4408
|
-
data:
|
|
4412
|
+
[f]: {
|
|
4413
|
+
data: v,
|
|
4409
4414
|
loading: !1,
|
|
4410
4415
|
error: null,
|
|
4411
4416
|
lastFetched: Date.now()
|
|
4412
4417
|
}
|
|
4413
4418
|
};
|
|
4414
|
-
} catch (
|
|
4415
|
-
const k =
|
|
4419
|
+
} catch (v) {
|
|
4420
|
+
const k = v instanceof Error ? v.message : "Unknown error";
|
|
4416
4421
|
e.value = {
|
|
4417
4422
|
...e.value,
|
|
4418
|
-
[
|
|
4419
|
-
data: e.value[
|
|
4420
|
-
lastFetched: e.value[
|
|
4423
|
+
[f]: {
|
|
4424
|
+
data: e.value[f]?.data ?? null,
|
|
4425
|
+
lastFetched: e.value[f]?.lastFetched ?? null,
|
|
4421
4426
|
loading: !1,
|
|
4422
4427
|
error: k
|
|
4423
4428
|
}
|
|
4424
4429
|
};
|
|
4425
4430
|
}
|
|
4426
4431
|
}
|
|
4427
|
-
async function
|
|
4428
|
-
await Promise.all(
|
|
4432
|
+
async function s() {
|
|
4433
|
+
await Promise.all(a.map((r) => i(r)));
|
|
4429
4434
|
}
|
|
4430
4435
|
async function n(r) {
|
|
4431
|
-
const
|
|
4432
|
-
|
|
4436
|
+
const f = a.find((v) => v.id === r);
|
|
4437
|
+
f && await i(f);
|
|
4433
4438
|
}
|
|
4434
4439
|
function o(r) {
|
|
4435
4440
|
return e.value[r]?.data ?? null;
|
|
@@ -4442,30 +4447,30 @@ function ha(s) {
|
|
|
4442
4447
|
return e.value[r]?.error ?? null;
|
|
4443
4448
|
}
|
|
4444
4449
|
function d() {
|
|
4445
|
-
for (const r of
|
|
4450
|
+
for (const r of a)
|
|
4446
4451
|
if (r.pollInterval && r.pollInterval > 0) {
|
|
4447
|
-
const
|
|
4452
|
+
const f = window.setInterval(() => {
|
|
4448
4453
|
i(r);
|
|
4449
4454
|
}, r.pollInterval);
|
|
4450
|
-
t.set(r.id,
|
|
4455
|
+
t.set(r.id, f);
|
|
4451
4456
|
}
|
|
4452
4457
|
}
|
|
4453
|
-
function
|
|
4458
|
+
function m() {
|
|
4454
4459
|
for (const [, r] of t)
|
|
4455
4460
|
window.clearInterval(r);
|
|
4456
4461
|
t.clear();
|
|
4457
4462
|
}
|
|
4458
4463
|
return ut(() => {
|
|
4459
|
-
|
|
4464
|
+
s(), d();
|
|
4460
4465
|
}), Zt(() => {
|
|
4461
|
-
|
|
4466
|
+
m();
|
|
4462
4467
|
}), {
|
|
4463
4468
|
/** Reactive state for all data sources */
|
|
4464
4469
|
state: W(e),
|
|
4465
4470
|
/** Whether any data source is currently loading */
|
|
4466
4471
|
isLoading: u,
|
|
4467
4472
|
/** Fetch all data sources */
|
|
4468
|
-
fetchAll:
|
|
4473
|
+
fetchAll: s,
|
|
4469
4474
|
/** Refetch a specific data source by id */
|
|
4470
4475
|
refetch: n,
|
|
4471
4476
|
/** Get data for a specific source */
|
|
@@ -4475,7 +4480,7 @@ function ha(s) {
|
|
|
4475
4480
|
/** Get error for a specific source */
|
|
4476
4481
|
getError: h,
|
|
4477
4482
|
/** Stop all polling (useful for cleanup) */
|
|
4478
|
-
stopPolling:
|
|
4483
|
+
stopPolling: m
|
|
4479
4484
|
};
|
|
4480
4485
|
}
|
|
4481
4486
|
const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
@@ -4522,31 +4527,31 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4522
4527
|
initialCenter: { default: void 0 }
|
|
4523
4528
|
},
|
|
4524
4529
|
emits: ["configs-loaded", "load-error", "zoom"],
|
|
4525
|
-
setup(
|
|
4526
|
-
const i =
|
|
4527
|
-
function
|
|
4528
|
-
const
|
|
4530
|
+
setup(a, { expose: e, emit: t }) {
|
|
4531
|
+
const i = a, s = t, n = E([]), o = E(!0), u = E(null), c = E(12), h = E(""), d = E(/* @__PURE__ */ new Set()), m = E({}), r = E(/* @__PURE__ */ new Set()), f = E({}), v = E({}), k = E(/* @__PURE__ */ new Set()), b = E({});
|
|
4532
|
+
function A() {
|
|
4533
|
+
const w = {};
|
|
4529
4534
|
for (const F of i.tiledLayers)
|
|
4530
|
-
|
|
4531
|
-
|
|
4535
|
+
w[F.id] = F.opacity ?? 1;
|
|
4536
|
+
b.value = w;
|
|
4532
4537
|
}
|
|
4533
|
-
function
|
|
4534
|
-
k.value.has(
|
|
4538
|
+
function I(w) {
|
|
4539
|
+
k.value.has(w) ? k.value.delete(w) : k.value.add(w), k.value = new Set(k.value);
|
|
4535
4540
|
}
|
|
4536
|
-
function z(
|
|
4537
|
-
F ? k.value.add(
|
|
4541
|
+
function z(w, F) {
|
|
4542
|
+
F ? k.value.add(w) : k.value.delete(w), k.value = new Set(k.value);
|
|
4538
4543
|
}
|
|
4539
|
-
function
|
|
4540
|
-
|
|
4544
|
+
function M(w, F) {
|
|
4545
|
+
b.value = { ...b.value, [w]: F };
|
|
4541
4546
|
}
|
|
4542
|
-
const T = i.dataSources.length > 0 ? ha(i.dataSources) : null,
|
|
4543
|
-
function q(
|
|
4544
|
-
return T?.getData(
|
|
4547
|
+
const T = i.dataSources.length > 0 ? ha(i.dataSources) : null, R = $(() => T?.state.value ?? {}), se = $(() => T?.isLoading.value ?? !1);
|
|
4548
|
+
function q(w) {
|
|
4549
|
+
return T?.getData(w) ?? null;
|
|
4545
4550
|
}
|
|
4546
|
-
function ue(
|
|
4547
|
-
return T?.refetch(
|
|
4551
|
+
function ue(w) {
|
|
4552
|
+
return T?.refetch(w) ?? Promise.resolve();
|
|
4548
4553
|
}
|
|
4549
|
-
|
|
4554
|
+
H("layerboard-layers", W(n)), H("layerboard-visible", d), H("layerboard-opacities", m), H("layerboard-loading", W(r)), H("layerboard-errors", W(f)), H("layerboard-zoom", W(c)), H("layerboard-toggle-layer", He), H("layerboard-set-layer-visible", st), H("layerboard-set-layers-visible", Re), H("layerboard-set-opacity", ze), H("layerboard-tiled-layers", W($(() => i.tiledLayers))), H("layerboard-visible-tiled", k), H("layerboard-tiled-opacities", b), H("layerboard-toggle-tiled", I), H("layerboard-set-tiled-opacity", M), H("layerboard-set-tiled-visible", z), H("layerboard-data-sources-state", R), H("layerboard-data-sources-loading", se), H("layerboard-get-data-source", q), H("layerboard-refetch-data-source", ue);
|
|
4550
4555
|
const N = $(() => ({
|
|
4551
4556
|
backgroundColor: i.themeColor
|
|
4552
4557
|
})), Ne = $(() => ({
|
|
@@ -4559,33 +4564,34 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4559
4564
|
async function it() {
|
|
4560
4565
|
try {
|
|
4561
4566
|
o.value = !0, u.value = null;
|
|
4562
|
-
const F = (await Ut(i.webMapId)).map((
|
|
4563
|
-
let
|
|
4564
|
-
const
|
|
4565
|
-
|
|
4566
|
-
...
|
|
4567
|
-
paint:
|
|
4568
|
-
outlinePaint:
|
|
4569
|
-
legend:
|
|
4570
|
-
type:
|
|
4567
|
+
const F = (await Ut(i.webMapId)).map((G) => {
|
|
4568
|
+
let X = G;
|
|
4569
|
+
const xe = i.layerStyleOverrides[G.id];
|
|
4570
|
+
xe && (X = {
|
|
4571
|
+
...X,
|
|
4572
|
+
paint: xe.paint ?? X.paint,
|
|
4573
|
+
outlinePaint: xe.outlinePaint ?? X.outlinePaint,
|
|
4574
|
+
legend: xe.legend ?? X.legend,
|
|
4575
|
+
type: xe.type ?? X.type,
|
|
4576
|
+
zOrder: xe.zOrder ?? X.zOrder
|
|
4571
4577
|
});
|
|
4572
|
-
const Qe = i.popupOverrides[
|
|
4573
|
-
return Qe &&
|
|
4574
|
-
...
|
|
4575
|
-
popup: { ...
|
|
4576
|
-
}),
|
|
4578
|
+
const Qe = i.popupOverrides[G.id] || (G.parentId ? i.popupOverrides[G.parentId] : void 0);
|
|
4579
|
+
return Qe && X.popup && (X = {
|
|
4580
|
+
...X,
|
|
4581
|
+
popup: { ...X.popup, ...Qe }
|
|
4582
|
+
}), X;
|
|
4577
4583
|
});
|
|
4578
|
-
n.value = F.map((
|
|
4579
|
-
config:
|
|
4580
|
-
component:
|
|
4584
|
+
n.value = F.map((G) => ({
|
|
4585
|
+
config: G,
|
|
4586
|
+
component: G.type
|
|
4581
4587
|
}));
|
|
4582
|
-
const
|
|
4583
|
-
F.forEach((
|
|
4584
|
-
|
|
4585
|
-
}),
|
|
4586
|
-
} catch (
|
|
4587
|
-
const F =
|
|
4588
|
-
u.value = F,
|
|
4588
|
+
const te = {};
|
|
4589
|
+
F.forEach((G) => {
|
|
4590
|
+
te[G.id] = G.opacity ?? 1;
|
|
4591
|
+
}), m.value = te, s("configs-loaded", F);
|
|
4592
|
+
} catch (w) {
|
|
4593
|
+
const F = w instanceof Error ? w.message : "Failed to load layer configurations";
|
|
4594
|
+
u.value = F, s("load-error", F);
|
|
4589
4595
|
} finally {
|
|
4590
4596
|
o.value = !1;
|
|
4591
4597
|
}
|
|
@@ -4593,58 +4599,58 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4593
4599
|
async function pt() {
|
|
4594
4600
|
if (i.fetchMetadata)
|
|
4595
4601
|
try {
|
|
4596
|
-
const
|
|
4602
|
+
const w = "https://phl.carto.com/api/v2/sql?q=" + encodeURIComponent(
|
|
4597
4603
|
"select url_text, COALESCE(representation, '') as representation from phl.knack_metadata_reps_endpoints_join WHERE ( format = 'API' OR format = 'GeoService' ) AND url_text IS NOT null"
|
|
4598
|
-
), F = await fetch(
|
|
4604
|
+
), F = await fetch(w);
|
|
4599
4605
|
if (!F.ok) return;
|
|
4600
|
-
const
|
|
4601
|
-
for (const
|
|
4602
|
-
if (
|
|
4603
|
-
const
|
|
4604
|
-
|
|
4606
|
+
const te = await F.json(), G = {};
|
|
4607
|
+
for (const X of te.rows || [])
|
|
4608
|
+
if (X.url_text && X.representation) {
|
|
4609
|
+
const xe = fi(X.url_text), Qe = `https://metadata.phila.gov/#home/representationdetails/${X.representation}/`;
|
|
4610
|
+
G[xe] = Qe;
|
|
4605
4611
|
}
|
|
4606
|
-
|
|
4612
|
+
v.value = G;
|
|
4607
4613
|
} catch {
|
|
4608
4614
|
}
|
|
4609
4615
|
}
|
|
4610
|
-
function Mt(
|
|
4611
|
-
c.value =
|
|
4616
|
+
function Mt(w) {
|
|
4617
|
+
c.value = w, s("zoom", w);
|
|
4612
4618
|
}
|
|
4613
|
-
function
|
|
4614
|
-
d.value.has(
|
|
4619
|
+
function He(w) {
|
|
4620
|
+
d.value.has(w) ? d.value.delete(w) : d.value.add(w), d.value = new Set(d.value);
|
|
4615
4621
|
}
|
|
4616
|
-
function st(
|
|
4617
|
-
F ? d.value.add(
|
|
4622
|
+
function st(w, F) {
|
|
4623
|
+
F ? d.value.add(w) : d.value.delete(w), d.value = new Set(d.value);
|
|
4618
4624
|
}
|
|
4619
|
-
function
|
|
4620
|
-
for (const
|
|
4621
|
-
F ? d.value.add(
|
|
4625
|
+
function Re(w, F) {
|
|
4626
|
+
for (const te of w)
|
|
4627
|
+
F ? d.value.add(te) : d.value.delete(te);
|
|
4622
4628
|
d.value = new Set(d.value);
|
|
4623
4629
|
}
|
|
4624
|
-
function ze(
|
|
4625
|
-
|
|
4630
|
+
function ze(w, F) {
|
|
4631
|
+
m.value = { ...m.value, [w]: F };
|
|
4626
4632
|
}
|
|
4627
|
-
function at(
|
|
4628
|
-
F ? r.value.add(
|
|
4633
|
+
function at(w, F) {
|
|
4634
|
+
F ? r.value.add(w) : r.value.delete(w), r.value = new Set(r.value);
|
|
4629
4635
|
}
|
|
4630
|
-
function Dt(
|
|
4636
|
+
function Dt(w, F) {
|
|
4631
4637
|
if (F)
|
|
4632
|
-
|
|
4638
|
+
f.value = { ...f.value, [w]: F };
|
|
4633
4639
|
else {
|
|
4634
|
-
const
|
|
4635
|
-
delete
|
|
4640
|
+
const te = { ...f.value };
|
|
4641
|
+
delete te[w], f.value = te;
|
|
4636
4642
|
}
|
|
4637
4643
|
}
|
|
4638
|
-
function ge(
|
|
4639
|
-
h.value =
|
|
4644
|
+
function ge(w) {
|
|
4645
|
+
h.value = w;
|
|
4640
4646
|
}
|
|
4641
|
-
const Ue =
|
|
4647
|
+
const Ue = E(null), ce = E(null), We = E(null), ft = E(null), Fe = E(null), nt = E(null), mt = E(null), Me = E("sidebar");
|
|
4642
4648
|
function Tt() {
|
|
4643
|
-
|
|
4644
|
-
|
|
4649
|
+
Me.value = Me.value === "sidebar" ? "map" : "sidebar", et(() => {
|
|
4650
|
+
Me.value === "sidebar" && Ue.value?.focus();
|
|
4645
4651
|
});
|
|
4646
4652
|
}
|
|
4647
|
-
const de =
|
|
4653
|
+
const de = E(!1);
|
|
4648
4654
|
function Ze() {
|
|
4649
4655
|
de.value = !de.value, de.value && et(() => {
|
|
4650
4656
|
ft.value?.focus();
|
|
@@ -4655,11 +4661,11 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4655
4661
|
ce.value?.focus();
|
|
4656
4662
|
});
|
|
4657
4663
|
}
|
|
4658
|
-
const _e =
|
|
4664
|
+
const _e = E(!1);
|
|
4659
4665
|
function gt() {
|
|
4660
4666
|
_e.value = !_e.value;
|
|
4661
4667
|
}
|
|
4662
|
-
const he =
|
|
4668
|
+
const he = E(!1), Ke = E(null);
|
|
4663
4669
|
function Ye() {
|
|
4664
4670
|
Ke.value = document.activeElement, he.value = !0, et(() => {
|
|
4665
4671
|
mt.value?.focus();
|
|
@@ -4670,60 +4676,60 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4670
4676
|
Ke.value?.focus(), Ke.value = null;
|
|
4671
4677
|
});
|
|
4672
4678
|
}
|
|
4673
|
-
function Xe(
|
|
4674
|
-
|
|
4679
|
+
function Xe(w) {
|
|
4680
|
+
w.target.classList.contains("layerboard-modal-backdrop") && pe();
|
|
4675
4681
|
}
|
|
4676
|
-
function Je(
|
|
4677
|
-
if (
|
|
4682
|
+
function Je(w) {
|
|
4683
|
+
if (w.key === "Escape") {
|
|
4678
4684
|
je();
|
|
4679
4685
|
return;
|
|
4680
4686
|
}
|
|
4681
|
-
if (
|
|
4687
|
+
if (w.key === "Tab" && Fe.value) {
|
|
4682
4688
|
const F = Array.from(
|
|
4683
4689
|
Fe.value.querySelectorAll(
|
|
4684
4690
|
'a[href], button:not([disabled]), textarea, input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
|
4685
4691
|
)
|
|
4686
4692
|
);
|
|
4687
4693
|
if (F.length === 0) return;
|
|
4688
|
-
const
|
|
4689
|
-
|
|
4694
|
+
const te = F[0], G = F[F.length - 1];
|
|
4695
|
+
w.shiftKey ? document.activeElement === te && (w.preventDefault(), G.focus()) : document.activeElement === G && (w.preventDefault(), te.focus());
|
|
4690
4696
|
}
|
|
4691
4697
|
}
|
|
4692
|
-
function Bt(
|
|
4693
|
-
if (
|
|
4698
|
+
function Bt(w) {
|
|
4699
|
+
if (w.key === "Escape") {
|
|
4694
4700
|
pe();
|
|
4695
4701
|
return;
|
|
4696
4702
|
}
|
|
4697
|
-
if (
|
|
4703
|
+
if (w.key === "Tab" && nt.value) {
|
|
4698
4704
|
const F = Array.from(
|
|
4699
4705
|
nt.value.querySelectorAll(
|
|
4700
4706
|
'a[href], button:not([disabled]), textarea, input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
|
4701
4707
|
)
|
|
4702
4708
|
);
|
|
4703
4709
|
if (F.length === 0) return;
|
|
4704
|
-
const
|
|
4705
|
-
|
|
4710
|
+
const te = F[0], G = F[F.length - 1];
|
|
4711
|
+
w.shiftKey ? document.activeElement === te && (w.preventDefault(), G.focus()) : document.activeElement === G && (w.preventDefault(), te.focus());
|
|
4706
4712
|
}
|
|
4707
4713
|
}
|
|
4708
|
-
|
|
4714
|
+
H("layerboard-open-modal", Ye), H("layerboard-close-modal", pe), H("layerboard-is-modal-open", W(he)), e({
|
|
4709
4715
|
/** Layer configurations */
|
|
4710
4716
|
layerList: n,
|
|
4711
4717
|
/** Set of visible layer IDs */
|
|
4712
4718
|
visibleLayers: d,
|
|
4713
4719
|
/** Layer opacity values */
|
|
4714
|
-
layerOpacities:
|
|
4720
|
+
layerOpacities: m,
|
|
4715
4721
|
/** Set of currently loading layer IDs */
|
|
4716
4722
|
loadingLayers: r,
|
|
4717
4723
|
/** Map of layer errors by ID */
|
|
4718
|
-
layerErrors:
|
|
4724
|
+
layerErrors: f,
|
|
4719
4725
|
/** Current map zoom level */
|
|
4720
4726
|
currentZoom: c,
|
|
4721
4727
|
/** Toggle a layer's visibility */
|
|
4722
|
-
toggleLayer:
|
|
4728
|
+
toggleLayer: He,
|
|
4723
4729
|
/** Set a layer's visibility explicitly */
|
|
4724
4730
|
setLayerVisible: st,
|
|
4725
4731
|
/** Set multiple layers' visibility at once */
|
|
4726
|
-
setLayersVisible:
|
|
4732
|
+
setLayersVisible: Re,
|
|
4727
4733
|
/** Set a layer's opacity */
|
|
4728
4734
|
setLayerOpacity: ze,
|
|
4729
4735
|
/** Reload layer configurations */
|
|
@@ -4734,16 +4740,16 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4734
4740
|
/** Set of visible tiled layer IDs */
|
|
4735
4741
|
visibleTiledLayers: k,
|
|
4736
4742
|
/** Tiled layer opacity values */
|
|
4737
|
-
tiledLayerOpacities:
|
|
4743
|
+
tiledLayerOpacities: b,
|
|
4738
4744
|
/** Toggle a tiled layer's visibility */
|
|
4739
|
-
toggleTiledLayer:
|
|
4745
|
+
toggleTiledLayer: I,
|
|
4740
4746
|
/** Set a tiled layer's visibility explicitly */
|
|
4741
4747
|
setTiledLayerVisible: z,
|
|
4742
4748
|
/** Set a tiled layer's opacity */
|
|
4743
|
-
setTiledLayerOpacity:
|
|
4749
|
+
setTiledLayerOpacity: M,
|
|
4744
4750
|
// Data source APIs
|
|
4745
4751
|
/** State of all data sources */
|
|
4746
|
-
dataSourcesState:
|
|
4752
|
+
dataSourcesState: R,
|
|
4747
4753
|
/** Whether any data source is loading */
|
|
4748
4754
|
dataSourcesLoading: se,
|
|
4749
4755
|
/** Get data from a specific data source */
|
|
@@ -4758,14 +4764,14 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4758
4764
|
/** Close the modal */
|
|
4759
4765
|
closeModal: pe
|
|
4760
4766
|
});
|
|
4761
|
-
function vt(
|
|
4762
|
-
|
|
4767
|
+
function vt(w) {
|
|
4768
|
+
w.key === "Escape" && de.value && je();
|
|
4763
4769
|
}
|
|
4764
4770
|
return ut(() => {
|
|
4765
|
-
it(), pt(),
|
|
4771
|
+
it(), pt(), A(), document.addEventListener("keydown", vt);
|
|
4766
4772
|
}), Di(() => {
|
|
4767
4773
|
document.removeEventListener("keydown", vt);
|
|
4768
|
-
}), (
|
|
4774
|
+
}), (w, F) => (_(), L("div", pa, [
|
|
4769
4775
|
F[5] || (F[5] = D("a", {
|
|
4770
4776
|
href: "#main-content",
|
|
4771
4777
|
class: "skip-to-main-content-link"
|
|
@@ -4795,18 +4801,18 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4795
4801
|
"aria-label": "Toggle menu",
|
|
4796
4802
|
onClick: Ze
|
|
4797
4803
|
}, [
|
|
4798
|
-
|
|
4804
|
+
ee(y(Te), {
|
|
4799
4805
|
"icon-definition": y(ws),
|
|
4800
4806
|
size: "medium",
|
|
4801
4807
|
inline: "",
|
|
4802
4808
|
decorative: ""
|
|
4803
4809
|
}, null, 8, ["icon-definition"])
|
|
4804
4810
|
], 8, fa),
|
|
4805
|
-
Se(
|
|
4806
|
-
D("h1", null,
|
|
4807
|
-
|
|
4811
|
+
Se(w.$slots, "header", {}, () => [
|
|
4812
|
+
D("h1", null, Q(a.title), 1),
|
|
4813
|
+
a.subtitle ? (_(), L("span", ma, Q(a.subtitle), 1)) : Z("", !0)
|
|
4808
4814
|
], !0),
|
|
4809
|
-
de.value ? (
|
|
4815
|
+
de.value ? (_(), L("div", {
|
|
4810
4816
|
key: 0,
|
|
4811
4817
|
ref_key: "mobileMenuRef",
|
|
4812
4818
|
ref: Fe,
|
|
@@ -4814,11 +4820,11 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4814
4820
|
role: "dialog",
|
|
4815
4821
|
"aria-modal": "true",
|
|
4816
4822
|
"aria-label": "Site menu",
|
|
4817
|
-
style: we({ backgroundColor:
|
|
4823
|
+
style: we({ backgroundColor: a.themeColor }),
|
|
4818
4824
|
onKeydown: Je
|
|
4819
4825
|
}, [
|
|
4820
4826
|
D("div", ga, [
|
|
4821
|
-
Se(
|
|
4827
|
+
Se(w.$slots, "footer", {
|
|
4822
4828
|
openModal: Ye,
|
|
4823
4829
|
closeModal: pe,
|
|
4824
4830
|
isModalOpen: he.value
|
|
@@ -4833,77 +4839,77 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4833
4839
|
"aria-label": "Close menu",
|
|
4834
4840
|
onClick: je
|
|
4835
4841
|
}, [
|
|
4836
|
-
|
|
4842
|
+
ee(y(Te), {
|
|
4837
4843
|
"icon-definition": y(ri),
|
|
4838
4844
|
size: "medium",
|
|
4839
4845
|
decorative: ""
|
|
4840
4846
|
}, null, 8, ["icon-definition"])
|
|
4841
4847
|
], 512)
|
|
4842
4848
|
], 36)) : Z("", !0),
|
|
4843
|
-
de.value ? (
|
|
4849
|
+
de.value ? (_(), L("div", {
|
|
4844
4850
|
key: 1,
|
|
4845
4851
|
class: "layerboard-mobile-menu-backdrop",
|
|
4846
4852
|
onClick: je
|
|
4847
4853
|
})) : Z("", !0)
|
|
4848
4854
|
], 4),
|
|
4849
4855
|
D("div", va, [
|
|
4850
|
-
o.value ? (
|
|
4856
|
+
o.value ? (_(), L("div", ya, [
|
|
4851
4857
|
D("div", {
|
|
4852
4858
|
class: "layerboard-spinner",
|
|
4853
|
-
style: we({ borderTopColor:
|
|
4859
|
+
style: we({ borderTopColor: a.themeColor })
|
|
4854
4860
|
}, null, 4),
|
|
4855
|
-
D("p", null, "Loading " +
|
|
4856
|
-
])) : u.value ? (
|
|
4861
|
+
D("p", null, "Loading " + Q(a.title) + "...", 1)
|
|
4862
|
+
])) : u.value ? (_(), L("div", ka, [
|
|
4857
4863
|
F[3] || (F[3] = D("h2", null, "Error Loading Layers", -1)),
|
|
4858
|
-
D("p", null,
|
|
4864
|
+
D("p", null, Q(u.value), 1),
|
|
4859
4865
|
D("button", {
|
|
4860
4866
|
class: "layerboard-retry-button",
|
|
4861
|
-
style: we({ backgroundColor:
|
|
4867
|
+
style: we({ backgroundColor: a.themeColor }),
|
|
4862
4868
|
onClick: it
|
|
4863
4869
|
}, " Retry ", 4)
|
|
4864
|
-
])) : (
|
|
4870
|
+
])) : (_(), L(ke, { key: 2 }, [
|
|
4865
4871
|
D("aside", {
|
|
4866
4872
|
id: "main-content",
|
|
4867
4873
|
ref_key: "sidebarRef",
|
|
4868
4874
|
ref: Ue,
|
|
4869
|
-
class: me(["layerboard-sidebar", { "is-active":
|
|
4875
|
+
class: me(["layerboard-sidebar", { "is-active": Me.value === "sidebar" }]),
|
|
4870
4876
|
style: we(ht.value),
|
|
4871
4877
|
"aria-label": "Map layers",
|
|
4872
4878
|
tabindex: "-1"
|
|
4873
4879
|
}, [
|
|
4874
|
-
Se(
|
|
4880
|
+
Se(w.$slots, "sidebar", {
|
|
4875
4881
|
layers: n.value,
|
|
4876
4882
|
visibleLayers: d.value,
|
|
4877
|
-
layerOpacities:
|
|
4883
|
+
layerOpacities: m.value,
|
|
4878
4884
|
loadingLayers: r.value,
|
|
4879
|
-
layerErrors:
|
|
4885
|
+
layerErrors: f.value,
|
|
4880
4886
|
currentZoom: c.value,
|
|
4881
|
-
toggleLayer:
|
|
4887
|
+
toggleLayer: He,
|
|
4882
4888
|
setLayerVisible: st,
|
|
4883
|
-
setLayersVisible:
|
|
4889
|
+
setLayersVisible: Re,
|
|
4884
4890
|
setOpacity: ze,
|
|
4885
|
-
tiledLayers:
|
|
4891
|
+
tiledLayers: a.tiledLayers,
|
|
4886
4892
|
visibleTiledLayers: k.value,
|
|
4887
|
-
tiledLayerOpacities:
|
|
4888
|
-
toggleTiledLayer:
|
|
4893
|
+
tiledLayerOpacities: b.value,
|
|
4894
|
+
toggleTiledLayer: I,
|
|
4889
4895
|
setTiledLayerVisible: z,
|
|
4890
|
-
setTiledLayerOpacity:
|
|
4891
|
-
dataSourcesState:
|
|
4896
|
+
setTiledLayerOpacity: M,
|
|
4897
|
+
dataSourcesState: R.value,
|
|
4892
4898
|
dataSourcesLoading: se.value,
|
|
4893
4899
|
getDataSource: q,
|
|
4894
4900
|
refetchDataSource: ue
|
|
4895
4901
|
}, () => [
|
|
4896
|
-
|
|
4902
|
+
a.showDefaultSidebar ? (_(), K(Gs, {
|
|
4897
4903
|
key: 0,
|
|
4898
4904
|
"layer-list": n.value,
|
|
4899
4905
|
"visible-layers": d.value,
|
|
4900
|
-
"layer-opacities":
|
|
4906
|
+
"layer-opacities": m.value,
|
|
4901
4907
|
"loading-layers": r.value,
|
|
4902
|
-
"layer-errors":
|
|
4908
|
+
"layer-errors": f.value,
|
|
4903
4909
|
"current-zoom": c.value,
|
|
4904
4910
|
"search-query": h.value,
|
|
4905
|
-
"layer-metadata":
|
|
4906
|
-
onToggleLayer:
|
|
4911
|
+
"layer-metadata": v.value,
|
|
4912
|
+
onToggleLayer: He,
|
|
4907
4913
|
onSetOpacity: ze,
|
|
4908
4914
|
onUpdateSearch: ge
|
|
4909
4915
|
}, null, 8, ["layer-list", "visible-layers", "layer-opacities", "loading-layers", "layer-errors", "current-zoom", "search-query", "layer-metadata"])) : Z("", !0)
|
|
@@ -4912,26 +4918,26 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4912
4918
|
D("div", {
|
|
4913
4919
|
role: "main",
|
|
4914
4920
|
"aria-label": "Map",
|
|
4915
|
-
class: me(["layerboard-map", { "is-active":
|
|
4921
|
+
class: me(["layerboard-map", { "is-active": Me.value === "map" }])
|
|
4916
4922
|
}, [
|
|
4917
|
-
|
|
4923
|
+
ee(Ui, {
|
|
4918
4924
|
"visible-layers": d.value,
|
|
4919
|
-
"layer-opacities":
|
|
4925
|
+
"layer-opacities": m.value,
|
|
4920
4926
|
"layer-list": n.value,
|
|
4921
|
-
"tiled-layers":
|
|
4927
|
+
"tiled-layers": a.tiledLayers,
|
|
4922
4928
|
"visible-tiled-layers": k.value,
|
|
4923
|
-
"tiled-layer-opacities":
|
|
4924
|
-
"cyclomedia-config":
|
|
4925
|
-
"pictometry-credentials":
|
|
4926
|
-
"basemap-control-position":
|
|
4927
|
-
"navigation-control-position":
|
|
4928
|
-
"geolocation-control-position":
|
|
4929
|
-
"search-control-position":
|
|
4930
|
-
"draw-control-position":
|
|
4931
|
-
"cyclomedia-button-position":
|
|
4932
|
-
"pictometry-button-position":
|
|
4933
|
-
"initial-zoom":
|
|
4934
|
-
"initial-center":
|
|
4929
|
+
"tiled-layer-opacities": b.value,
|
|
4930
|
+
"cyclomedia-config": a.cyclomediaConfig,
|
|
4931
|
+
"pictometry-credentials": a.pictometryCredentials,
|
|
4932
|
+
"basemap-control-position": a.basemapControlPosition,
|
|
4933
|
+
"navigation-control-position": a.navigationControlPosition,
|
|
4934
|
+
"geolocation-control-position": a.geolocationControlPosition,
|
|
4935
|
+
"search-control-position": a.searchControlPosition,
|
|
4936
|
+
"draw-control-position": a.drawControlPosition,
|
|
4937
|
+
"cyclomedia-button-position": a.cyclomediaButtonPosition,
|
|
4938
|
+
"pictometry-button-position": a.pictometryButtonPosition,
|
|
4939
|
+
"initial-zoom": a.initialZoom,
|
|
4940
|
+
"initial-center": a.initialCenter,
|
|
4935
4941
|
onZoom: Mt,
|
|
4936
4942
|
onLayerLoading: at,
|
|
4937
4943
|
onLayerError: Dt
|
|
@@ -4944,7 +4950,7 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4944
4950
|
"aria-label": _e.value ? "Expand sidebar" : "Collapse sidebar",
|
|
4945
4951
|
onClick: gt
|
|
4946
4952
|
}, [
|
|
4947
|
-
|
|
4953
|
+
ee(y(Te), {
|
|
4948
4954
|
"icon-definition": _e.value ? y(_s) : y(Cs),
|
|
4949
4955
|
size: "medium",
|
|
4950
4956
|
decorative: ""
|
|
@@ -4959,13 +4965,13 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4959
4965
|
style: we(tt.value),
|
|
4960
4966
|
onClick: Tt
|
|
4961
4967
|
}, [
|
|
4962
|
-
|
|
4968
|
+
Me.value === "map" ? (_(), L("span", _a, Q(a.sidebarLabel), 1)) : (_(), L("span", Ca, Q(a.mapLabel), 1))
|
|
4963
4969
|
], 4),
|
|
4964
4970
|
D("footer", {
|
|
4965
4971
|
class: "layerboard-footer",
|
|
4966
4972
|
style: we(Ne.value)
|
|
4967
4973
|
}, [
|
|
4968
|
-
Se(
|
|
4974
|
+
Se(w.$slots, "footer", {
|
|
4969
4975
|
openModal: Ye,
|
|
4970
4976
|
closeModal: pe,
|
|
4971
4977
|
isModalOpen: he.value
|
|
@@ -4973,7 +4979,7 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4973
4979
|
F[4] || (F[4] = Ve(" City of Philadelphia ", -1))
|
|
4974
4980
|
], !0)
|
|
4975
4981
|
], 4),
|
|
4976
|
-
he.value ? (
|
|
4982
|
+
he.value ? (_(), L("div", {
|
|
4977
4983
|
key: 0,
|
|
4978
4984
|
class: "layerboard-modal-backdrop",
|
|
4979
4985
|
onClick: Xe,
|
|
@@ -4994,19 +5000,19 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4994
5000
|
"aria-label": "Close modal",
|
|
4995
5001
|
onClick: pe
|
|
4996
5002
|
}, [
|
|
4997
|
-
|
|
5003
|
+
ee(y(Te), {
|
|
4998
5004
|
"icon-definition": y(ri),
|
|
4999
5005
|
size: "medium",
|
|
5000
5006
|
decorative: ""
|
|
5001
5007
|
}, null, 8, ["icon-definition"])
|
|
5002
5008
|
], 512),
|
|
5003
|
-
Se(
|
|
5009
|
+
Se(w.$slots, "modal", { closeModal: pe }, void 0, !0)
|
|
5004
5010
|
], 512)
|
|
5005
5011
|
], 32)) : Z("", !0),
|
|
5006
|
-
D("span", wa,
|
|
5012
|
+
D("span", wa, Q(Me.value === "sidebar" ? "Showing layers panel" : "Showing map"), 1)
|
|
5007
5013
|
]));
|
|
5008
5014
|
}
|
|
5009
|
-
}),
|
|
5015
|
+
}), Ha = /* @__PURE__ */ Oe(Sa, [["__scopeId", "data-v-3a0fb2f3"]]), Ea = ["aria-expanded"], Fa = {
|
|
5010
5016
|
key: 0,
|
|
5011
5017
|
class: "topic-icon"
|
|
5012
5018
|
}, xa = { class: "topic-title" }, La = /* @__PURE__ */ be({
|
|
@@ -5019,42 +5025,42 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
5019
5025
|
headerClass: { default: void 0 }
|
|
5020
5026
|
},
|
|
5021
5027
|
emits: ["toggle", "layerChange"],
|
|
5022
|
-
setup(
|
|
5023
|
-
const t =
|
|
5028
|
+
setup(a, { emit: e }) {
|
|
5029
|
+
const t = a, i = e, s = E(t.expanded), n = `topic-panel-${ei()}`, o = `topic-header-${ei()}`;
|
|
5024
5030
|
le(
|
|
5025
5031
|
() => t.expanded,
|
|
5026
5032
|
(c) => {
|
|
5027
|
-
|
|
5033
|
+
s.value = c;
|
|
5028
5034
|
}
|
|
5029
5035
|
);
|
|
5030
5036
|
function u() {
|
|
5031
|
-
|
|
5037
|
+
s.value = !s.value, i("toggle", s.value);
|
|
5032
5038
|
}
|
|
5033
5039
|
return (c, h) => {
|
|
5034
5040
|
const d = Ti("font-awesome-icon");
|
|
5035
|
-
return
|
|
5036
|
-
class: me(["topic-accordion", { "is-expanded":
|
|
5041
|
+
return _(), L("div", {
|
|
5042
|
+
class: me(["topic-accordion", { "is-expanded": s.value }])
|
|
5037
5043
|
}, [
|
|
5038
5044
|
D("button", {
|
|
5039
5045
|
id: o,
|
|
5040
|
-
class: me(["topic-header",
|
|
5046
|
+
class: me(["topic-header", a.headerClass]),
|
|
5041
5047
|
type: "button",
|
|
5042
|
-
"aria-expanded":
|
|
5048
|
+
"aria-expanded": s.value,
|
|
5043
5049
|
"aria-controls": n,
|
|
5044
5050
|
onClick: u
|
|
5045
5051
|
}, [
|
|
5046
|
-
|
|
5052
|
+
a.icon || c.$slots.icon ? (_(), L("span", Fa, [
|
|
5047
5053
|
Se(c.$slots, "icon", {}, () => [
|
|
5048
|
-
|
|
5054
|
+
a.icon ? (_(), K(d, {
|
|
5049
5055
|
key: 0,
|
|
5050
|
-
icon: ["fas",
|
|
5056
|
+
icon: ["fas", a.icon],
|
|
5051
5057
|
"aria-hidden": "true"
|
|
5052
5058
|
}, null, 8, ["icon"])) : Z("", !0)
|
|
5053
5059
|
], !0)
|
|
5054
5060
|
])) : Z("", !0),
|
|
5055
|
-
D("span", xa,
|
|
5061
|
+
D("span", xa, Q(a.title), 1),
|
|
5056
5062
|
D("span", {
|
|
5057
|
-
class: me(["topic-chevron", { "is-rotated":
|
|
5063
|
+
class: me(["topic-chevron", { "is-rotated": s.value }])
|
|
5058
5064
|
}, [...h[0] || (h[0] = [
|
|
5059
5065
|
D("svg", {
|
|
5060
5066
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5082,23 +5088,23 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
5082
5088
|
h[1] || (h[1] = D("p", { class: "topic-empty" }, "No content provided for this topic.", -1))
|
|
5083
5089
|
], !0)
|
|
5084
5090
|
], 512), [
|
|
5085
|
-
[Bi,
|
|
5091
|
+
[Bi, s.value]
|
|
5086
5092
|
])
|
|
5087
5093
|
], 2);
|
|
5088
5094
|
};
|
|
5089
5095
|
}
|
|
5090
|
-
}), Wa = /* @__PURE__ */
|
|
5091
|
-
function Aa(
|
|
5092
|
-
return
|
|
5096
|
+
}), Wa = /* @__PURE__ */ Oe(La, [["__scopeId", "data-v-a2023afa"]]);
|
|
5097
|
+
function Aa(a) {
|
|
5098
|
+
return a.displayOptions?.shouldShowCheckbox !== !1;
|
|
5093
5099
|
}
|
|
5094
|
-
function wi(
|
|
5095
|
-
return e ?
|
|
5100
|
+
function wi(a, e) {
|
|
5101
|
+
return e ? a.displayOptions?.shouldShowSlider !== !1 : !1;
|
|
5096
5102
|
}
|
|
5097
|
-
function Si(
|
|
5098
|
-
return e ?
|
|
5103
|
+
function Si(a, e) {
|
|
5104
|
+
return e ? a.displayOptions?.shouldShowLegendBox !== !1 : !1;
|
|
5099
5105
|
}
|
|
5100
|
-
function
|
|
5101
|
-
return
|
|
5106
|
+
function Ge(a) {
|
|
5107
|
+
return a.displayOptions?.layerNameChange || a.title;
|
|
5102
5108
|
}
|
|
5103
5109
|
const Ia = ["aria-label"], Ma = ["checked", "disabled", "onChange"], Da = { class: "layer-title" }, Ta = { class: "layer-title" }, Ba = {
|
|
5104
5110
|
key: 0,
|
|
@@ -5117,23 +5123,23 @@ const Ia = ["aria-label"], Ma = ["checked", "disabled", "onChange"], Da = { clas
|
|
|
5117
5123
|
groupLabel: { default: void 0 }
|
|
5118
5124
|
},
|
|
5119
5125
|
emits: ["toggleLayer", "setOpacity"],
|
|
5120
|
-
setup(
|
|
5121
|
-
const t =
|
|
5126
|
+
setup(a, { emit: e }) {
|
|
5127
|
+
const t = a, i = e, { isVisible: s, getLayerOpacity: n, isLayerLoading: o, getLayerError: u, isLayerAvailableAtZoom: c } = Ht(
|
|
5122
5128
|
() => t
|
|
5123
5129
|
);
|
|
5124
5130
|
function h(d) {
|
|
5125
5131
|
i("toggleLayer", d);
|
|
5126
5132
|
}
|
|
5127
|
-
return (d,
|
|
5133
|
+
return (d, m) => (_(), L("fieldset", {
|
|
5128
5134
|
class: "layer-checkbox-set",
|
|
5129
5135
|
role: "group",
|
|
5130
|
-
"aria-label":
|
|
5136
|
+
"aria-label": a.groupLabel
|
|
5131
5137
|
}, [
|
|
5132
|
-
(
|
|
5138
|
+
(_(!0), L(ke, null, Ae(a.layers, (r) => (_(), L("div", {
|
|
5133
5139
|
key: r.id,
|
|
5134
5140
|
class: "layer-item"
|
|
5135
5141
|
}, [
|
|
5136
|
-
y(Aa)(r) ? (
|
|
5142
|
+
y(Aa)(r) ? (_(), L("label", {
|
|
5137
5143
|
key: 0,
|
|
5138
5144
|
class: me(["layer-checkbox", {
|
|
5139
5145
|
"layer-unavailable": !y(c)(r),
|
|
@@ -5142,19 +5148,19 @@ const Ia = ["aria-label"], Ma = ["checked", "disabled", "onChange"], Da = { clas
|
|
|
5142
5148
|
}, [
|
|
5143
5149
|
D("input", {
|
|
5144
5150
|
type: "checkbox",
|
|
5145
|
-
checked: y(
|
|
5151
|
+
checked: y(s)(r.id),
|
|
5146
5152
|
disabled: !y(c)(r),
|
|
5147
|
-
onChange: (
|
|
5153
|
+
onChange: (f) => h(r.id)
|
|
5148
5154
|
}, null, 40, Ma),
|
|
5149
5155
|
D("span", Da, [
|
|
5150
|
-
Ve(
|
|
5151
|
-
|
|
5156
|
+
Ve(Q(y(Ge)(r)) + " ", 1),
|
|
5157
|
+
ee(St, {
|
|
5152
5158
|
loading: y(o)(r.id),
|
|
5153
5159
|
error: y(u)(r.id),
|
|
5154
5160
|
unavailable: !y(c)(r)
|
|
5155
5161
|
}, null, 8, ["loading", "error", "unavailable"])
|
|
5156
5162
|
])
|
|
5157
|
-
], 2)) : (
|
|
5163
|
+
], 2)) : (_(), L("div", {
|
|
5158
5164
|
key: 1,
|
|
5159
5165
|
class: me(["layer-label-only", {
|
|
5160
5166
|
"layer-unavailable": !y(c)(r),
|
|
@@ -5162,31 +5168,31 @@ const Ia = ["aria-label"], Ma = ["checked", "disabled", "onChange"], Da = { clas
|
|
|
5162
5168
|
}])
|
|
5163
5169
|
}, [
|
|
5164
5170
|
D("span", Ta, [
|
|
5165
|
-
Ve(
|
|
5166
|
-
|
|
5171
|
+
Ve(Q(y(Ge)(r)) + " ", 1),
|
|
5172
|
+
ee(St, {
|
|
5167
5173
|
loading: y(o)(r.id),
|
|
5168
5174
|
error: y(u)(r.id),
|
|
5169
5175
|
unavailable: !y(c)(r)
|
|
5170
5176
|
}, null, 8, ["loading", "error", "unavailable"])
|
|
5171
5177
|
])
|
|
5172
5178
|
], 2)),
|
|
5173
|
-
y(wi)(r,
|
|
5179
|
+
y(wi)(r, a.showOpacity) && y(s)(r.id) && y(c)(r) ? (_(), K(qt, {
|
|
5174
5180
|
key: 2,
|
|
5175
5181
|
"layer-id": r.id,
|
|
5176
|
-
"layer-name": y(
|
|
5182
|
+
"layer-name": y(Ge)(r),
|
|
5177
5183
|
opacity: y(n)(r.id),
|
|
5178
|
-
"onUpdate:opacity": (
|
|
5184
|
+
"onUpdate:opacity": (f) => i("setOpacity", r.id, f)
|
|
5179
5185
|
}, null, 8, ["layer-id", "layer-name", "opacity", "onUpdate:opacity"])) : Z("", !0),
|
|
5180
|
-
y(Si)(r,
|
|
5186
|
+
y(Si)(r, a.showLegend) && y(s)(r.id) && y(c)(r) && r.legend?.length ? (_(), K(Gt, {
|
|
5181
5187
|
key: 3,
|
|
5182
5188
|
items: r.legend,
|
|
5183
|
-
label: "Legend for " + y(
|
|
5189
|
+
label: "Legend for " + y(Ge)(r)
|
|
5184
5190
|
}, null, 8, ["items", "label"])) : Z("", !0)
|
|
5185
5191
|
]))), 128)),
|
|
5186
|
-
|
|
5192
|
+
a.layers.length === 0 ? (_(), L("div", Ba, "No layers available")) : Z("", !0)
|
|
5187
5193
|
], 8, Ia));
|
|
5188
5194
|
}
|
|
5189
|
-
}), Ka = /* @__PURE__ */
|
|
5195
|
+
}), Ka = /* @__PURE__ */ Oe(Va, [["__scopeId", "data-v-bfcd7855"]]), Pa = ["aria-label"], Oa = ["name", "checked", "disabled", "onChange"], Ra = { class: "layer-title" }, $a = {
|
|
5190
5196
|
key: 0,
|
|
5191
5197
|
class: "empty-state"
|
|
5192
5198
|
}, Na = /* @__PURE__ */ be({
|
|
@@ -5204,20 +5210,20 @@ const Ia = ["aria-label"], Ma = ["checked", "disabled", "onChange"], Da = { clas
|
|
|
5204
5210
|
groupLabel: { default: void 0 }
|
|
5205
5211
|
},
|
|
5206
5212
|
emits: ["selectLayer", "setOpacity"],
|
|
5207
|
-
setup(
|
|
5208
|
-
const t =
|
|
5213
|
+
setup(a, { emit: e }) {
|
|
5214
|
+
const t = a, i = e, { isVisible: s, getLayerOpacity: n, isLayerLoading: o, getLayerError: u, isLayerAvailableAtZoom: c } = Ht(
|
|
5209
5215
|
() => t
|
|
5210
5216
|
);
|
|
5211
5217
|
function h(d) {
|
|
5212
|
-
const
|
|
5213
|
-
i("selectLayer", d,
|
|
5218
|
+
const m = t.layers.filter((r) => t.visibleLayerIds.has(r.id) && r.id !== d).map((r) => r.id);
|
|
5219
|
+
i("selectLayer", d, m);
|
|
5214
5220
|
}
|
|
5215
|
-
return (d,
|
|
5221
|
+
return (d, m) => (_(), L("div", {
|
|
5216
5222
|
class: "layer-radio-set",
|
|
5217
5223
|
role: "radiogroup",
|
|
5218
|
-
"aria-label":
|
|
5224
|
+
"aria-label": a.groupLabel
|
|
5219
5225
|
}, [
|
|
5220
|
-
(
|
|
5226
|
+
(_(!0), L(ke, null, Ae(a.layers, (r) => (_(), L("div", {
|
|
5221
5227
|
key: r.id,
|
|
5222
5228
|
class: "layer-item"
|
|
5223
5229
|
}, [
|
|
@@ -5229,106 +5235,106 @@ const Ia = ["aria-label"], Ma = ["checked", "disabled", "onChange"], Da = { clas
|
|
|
5229
5235
|
}, [
|
|
5230
5236
|
D("input", {
|
|
5231
5237
|
type: "radio",
|
|
5232
|
-
name:
|
|
5233
|
-
checked: y(
|
|
5238
|
+
name: a.groupName,
|
|
5239
|
+
checked: y(s)(r.id),
|
|
5234
5240
|
disabled: !y(c)(r),
|
|
5235
|
-
onChange: (
|
|
5236
|
-
}, null, 40,
|
|
5237
|
-
D("span",
|
|
5238
|
-
Ve(
|
|
5239
|
-
|
|
5241
|
+
onChange: (f) => h(r.id)
|
|
5242
|
+
}, null, 40, Oa),
|
|
5243
|
+
D("span", Ra, [
|
|
5244
|
+
Ve(Q(y(Ge)(r)) + " ", 1),
|
|
5245
|
+
ee(St, {
|
|
5240
5246
|
loading: y(o)(r.id),
|
|
5241
5247
|
error: y(u)(r.id),
|
|
5242
5248
|
unavailable: !y(c)(r)
|
|
5243
5249
|
}, null, 8, ["loading", "error", "unavailable"])
|
|
5244
5250
|
])
|
|
5245
5251
|
], 2),
|
|
5246
|
-
y(wi)(r,
|
|
5252
|
+
y(wi)(r, a.showOpacity) && y(s)(r.id) && y(c)(r) ? (_(), K(qt, {
|
|
5247
5253
|
key: 0,
|
|
5248
5254
|
"layer-id": r.id,
|
|
5249
|
-
"layer-name": y(
|
|
5255
|
+
"layer-name": y(Ge)(r),
|
|
5250
5256
|
opacity: y(n)(r.id),
|
|
5251
|
-
"onUpdate:opacity": (
|
|
5257
|
+
"onUpdate:opacity": (f) => i("setOpacity", r.id, f)
|
|
5252
5258
|
}, null, 8, ["layer-id", "layer-name", "opacity", "onUpdate:opacity"])) : Z("", !0),
|
|
5253
|
-
y(Si)(r,
|
|
5259
|
+
y(Si)(r, a.showLegend) && y(s)(r.id) && y(c)(r) && r.legend?.length ? (_(), K(Gt, {
|
|
5254
5260
|
key: 1,
|
|
5255
5261
|
items: r.legend,
|
|
5256
|
-
label: "Legend for " + y(
|
|
5262
|
+
label: "Legend for " + y(Ge)(r)
|
|
5257
5263
|
}, null, 8, ["items", "label"])) : Z("", !0)
|
|
5258
5264
|
]))), 128)),
|
|
5259
|
-
|
|
5265
|
+
a.layers.length === 0 ? (_(), L("div", $a, "No layers available")) : Z("", !0)
|
|
5260
5266
|
], 8, Pa));
|
|
5261
5267
|
}
|
|
5262
|
-
}), Ya = /* @__PURE__ */
|
|
5263
|
-
function Xa(
|
|
5264
|
-
const e =
|
|
5268
|
+
}), Ya = /* @__PURE__ */ Oe(Na, [["__scopeId", "data-v-c368d815"]]);
|
|
5269
|
+
function Xa(a) {
|
|
5270
|
+
const e = E([]), t = E(/* @__PURE__ */ new Set()), i = E({}), s = E(/* @__PURE__ */ new Set()), n = E({}), o = E(""), u = E(!1), c = E(!1), h = E(null), d = $(() => {
|
|
5265
5271
|
if (!o.value.trim())
|
|
5266
5272
|
return e.value;
|
|
5267
|
-
const
|
|
5268
|
-
return e.value.filter((T) => T.title.toLowerCase().includes(
|
|
5269
|
-
}),
|
|
5270
|
-
config:
|
|
5271
|
-
component:
|
|
5273
|
+
const M = o.value.toLowerCase();
|
|
5274
|
+
return e.value.filter((T) => T.title.toLowerCase().includes(M));
|
|
5275
|
+
}), m = $(() => e.value.map((M) => ({
|
|
5276
|
+
config: M,
|
|
5277
|
+
component: M.type
|
|
5272
5278
|
// "circle", "fill", or "line"
|
|
5273
5279
|
})));
|
|
5274
5280
|
async function r() {
|
|
5275
5281
|
if (!c.value) {
|
|
5276
5282
|
u.value = !0, h.value = null;
|
|
5277
5283
|
try {
|
|
5278
|
-
let
|
|
5279
|
-
|
|
5284
|
+
let M;
|
|
5285
|
+
a.mode === "dynamic" || !a.mode ? a.webMapId ? M = await f(a.webMapId) : M = await Ut() : M = await Ut(), e.value = M;
|
|
5280
5286
|
const T = {};
|
|
5281
|
-
|
|
5282
|
-
T[
|
|
5287
|
+
M.forEach((R) => {
|
|
5288
|
+
T[R.id] = R.opacity ?? 1;
|
|
5283
5289
|
}), i.value = T, c.value = !0;
|
|
5284
|
-
} catch (
|
|
5285
|
-
h.value =
|
|
5290
|
+
} catch (M) {
|
|
5291
|
+
h.value = M instanceof Error ? M : new Error("Failed to initialize layerboard");
|
|
5286
5292
|
} finally {
|
|
5287
5293
|
u.value = !1;
|
|
5288
5294
|
}
|
|
5289
5295
|
}
|
|
5290
5296
|
}
|
|
5291
|
-
async function
|
|
5292
|
-
const T = Kt(
|
|
5293
|
-
if (!
|
|
5294
|
-
throw new Error(`Failed to fetch WebMap: ${
|
|
5295
|
-
const se = await
|
|
5297
|
+
async function f(M) {
|
|
5298
|
+
const T = Kt(M), R = await fetch(T, { cache: "no-store" });
|
|
5299
|
+
if (!R.ok)
|
|
5300
|
+
throw new Error(`Failed to fetch WebMap: ${R.status} ${R.statusText}`);
|
|
5301
|
+
const se = await R.json();
|
|
5296
5302
|
return Ci(se);
|
|
5297
5303
|
}
|
|
5298
|
-
function
|
|
5304
|
+
function v(M) {
|
|
5299
5305
|
const T = new Set(t.value);
|
|
5300
|
-
T.has(
|
|
5306
|
+
T.has(M) ? T.delete(M) : T.add(M), t.value = T;
|
|
5301
5307
|
}
|
|
5302
|
-
function k(
|
|
5308
|
+
function k(M, T) {
|
|
5303
5309
|
i.value = {
|
|
5304
5310
|
...i.value,
|
|
5305
|
-
[
|
|
5311
|
+
[M]: Math.max(0, Math.min(1, T))
|
|
5306
5312
|
};
|
|
5307
5313
|
}
|
|
5308
|
-
function
|
|
5309
|
-
o.value =
|
|
5314
|
+
function b(M) {
|
|
5315
|
+
o.value = M;
|
|
5310
5316
|
}
|
|
5311
|
-
function M
|
|
5312
|
-
const
|
|
5313
|
-
T ?
|
|
5317
|
+
function A(M, T) {
|
|
5318
|
+
const R = new Set(s.value);
|
|
5319
|
+
T ? R.add(M) : R.delete(M), s.value = R;
|
|
5314
5320
|
}
|
|
5315
|
-
function
|
|
5321
|
+
function I(M, T) {
|
|
5316
5322
|
if (T)
|
|
5317
|
-
n.value = { ...n.value, [
|
|
5323
|
+
n.value = { ...n.value, [M]: T };
|
|
5318
5324
|
else {
|
|
5319
|
-
const
|
|
5320
|
-
delete
|
|
5325
|
+
const R = { ...n.value };
|
|
5326
|
+
delete R[M], n.value = R;
|
|
5321
5327
|
}
|
|
5322
5328
|
}
|
|
5323
5329
|
function z() {
|
|
5324
|
-
e.value = [], t.value = /* @__PURE__ */ new Set(), i.value = {},
|
|
5330
|
+
e.value = [], t.value = /* @__PURE__ */ new Set(), i.value = {}, s.value = /* @__PURE__ */ new Set(), n.value = {}, o.value = "", u.value = !1, c.value = !1, h.value = null;
|
|
5325
5331
|
}
|
|
5326
5332
|
return {
|
|
5327
5333
|
// State (readonly)
|
|
5328
5334
|
layerConfigs: W(e),
|
|
5329
5335
|
visibleLayers: W(t),
|
|
5330
5336
|
layerOpacities: W(i),
|
|
5331
|
-
loadingLayers: W(
|
|
5337
|
+
loadingLayers: W(s),
|
|
5332
5338
|
layerErrors: W(n),
|
|
5333
5339
|
searchQuery: W(o),
|
|
5334
5340
|
isLoading: W(u),
|
|
@@ -5336,45 +5342,45 @@ function Xa(s) {
|
|
|
5336
5342
|
error: W(h),
|
|
5337
5343
|
// Computed
|
|
5338
5344
|
filteredLayerConfigs: d,
|
|
5339
|
-
layerList:
|
|
5345
|
+
layerList: m,
|
|
5340
5346
|
// Config
|
|
5341
|
-
config:
|
|
5347
|
+
config: a,
|
|
5342
5348
|
// Methods
|
|
5343
5349
|
initialize: r,
|
|
5344
|
-
toggleLayer:
|
|
5350
|
+
toggleLayer: v,
|
|
5345
5351
|
setLayerOpacity: k,
|
|
5346
|
-
filterLayers:
|
|
5347
|
-
setLayerLoading:
|
|
5348
|
-
setLayerError:
|
|
5352
|
+
filterLayers: b,
|
|
5353
|
+
setLayerLoading: A,
|
|
5354
|
+
setLayerError: I,
|
|
5349
5355
|
reset: z
|
|
5350
5356
|
};
|
|
5351
5357
|
}
|
|
5352
5358
|
function Ja() {
|
|
5353
|
-
const
|
|
5359
|
+
const a = E([]), e = E(/* @__PURE__ */ new Set()), t = E(/* @__PURE__ */ new Set());
|
|
5354
5360
|
function i(n) {
|
|
5355
5361
|
e.value.has(n) ? e.value.delete(n) : e.value.add(n);
|
|
5356
5362
|
}
|
|
5357
|
-
function
|
|
5358
|
-
|
|
5363
|
+
function s(n) {
|
|
5364
|
+
a.value = n;
|
|
5359
5365
|
}
|
|
5360
5366
|
return {
|
|
5361
|
-
layers: $(() =>
|
|
5367
|
+
layers: $(() => a.value),
|
|
5362
5368
|
visibleLayerIds: $(() => e.value),
|
|
5363
5369
|
loadingLayerIds: $(() => t.value),
|
|
5364
5370
|
toggleLayer: i,
|
|
5365
|
-
setLayers:
|
|
5371
|
+
setLayers: s
|
|
5366
5372
|
};
|
|
5367
5373
|
}
|
|
5368
|
-
function za(
|
|
5369
|
-
const e =
|
|
5374
|
+
function za(a) {
|
|
5375
|
+
const e = E(null), t = E(!1), i = E(null), s = E(0);
|
|
5370
5376
|
async function n(c = {}) {
|
|
5371
5377
|
t.value = !0, i.value = null;
|
|
5372
|
-
const h =
|
|
5373
|
-
let d = 0,
|
|
5378
|
+
const h = a.pageSize || 2e3;
|
|
5379
|
+
let d = 0, m = [], r = !0;
|
|
5374
5380
|
try {
|
|
5375
5381
|
for (; r; ) {
|
|
5376
|
-
const
|
|
5377
|
-
let
|
|
5382
|
+
const v = a.url.replace(/\/$/, ""), k = encodeURIComponent(c.where || a.where || "1=1");
|
|
5383
|
+
let b = `${v}/query?where=${k}&outFields=*&returnGeometry=true&resultRecordCount=${h}&resultOffset=${d}&f=geojson`;
|
|
5378
5384
|
if (c.bounds) {
|
|
5379
5385
|
const z = JSON.stringify({
|
|
5380
5386
|
xmin: c.bounds.west,
|
|
@@ -5383,28 +5389,28 @@ function za(s) {
|
|
|
5383
5389
|
ymax: c.bounds.north,
|
|
5384
5390
|
spatialReference: { wkid: 4326 }
|
|
5385
5391
|
});
|
|
5386
|
-
|
|
5392
|
+
b += `&geometry=${encodeURIComponent(z)}&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects`;
|
|
5387
5393
|
}
|
|
5388
|
-
const
|
|
5389
|
-
if (!
|
|
5390
|
-
throw new Error(`HTTP ${
|
|
5391
|
-
const
|
|
5392
|
-
|
|
5394
|
+
const A = await fetch(b);
|
|
5395
|
+
if (!A.ok)
|
|
5396
|
+
throw new Error(`HTTP ${A.status}: ${A.statusText}`);
|
|
5397
|
+
const I = await A.json();
|
|
5398
|
+
I.features && I.features.length > 0 ? (m = m.concat(I.features), d += I.features.length, r = I.features.length === h) : r = !1;
|
|
5393
5399
|
}
|
|
5394
|
-
const
|
|
5400
|
+
const f = {
|
|
5395
5401
|
type: "FeatureCollection",
|
|
5396
|
-
features:
|
|
5402
|
+
features: m
|
|
5397
5403
|
};
|
|
5398
|
-
return e.value =
|
|
5399
|
-
} catch (
|
|
5400
|
-
const
|
|
5401
|
-
throw i.value =
|
|
5404
|
+
return e.value = f, s.value = m.length, f;
|
|
5405
|
+
} catch (f) {
|
|
5406
|
+
const v = f instanceof Error ? f : new Error("Failed to fetch features");
|
|
5407
|
+
throw i.value = v, v;
|
|
5402
5408
|
} finally {
|
|
5403
5409
|
t.value = !1;
|
|
5404
5410
|
}
|
|
5405
5411
|
}
|
|
5406
5412
|
function o() {
|
|
5407
|
-
e.value = null,
|
|
5413
|
+
e.value = null, s.value = 0, i.value = null;
|
|
5408
5414
|
}
|
|
5409
5415
|
async function u(c = {}) {
|
|
5410
5416
|
return n(c);
|
|
@@ -5414,22 +5420,22 @@ function za(s) {
|
|
|
5414
5420
|
data: W(e),
|
|
5415
5421
|
isLoading: W(t),
|
|
5416
5422
|
error: W(i),
|
|
5417
|
-
totalFeatures: W(
|
|
5423
|
+
totalFeatures: W(s),
|
|
5418
5424
|
// Config
|
|
5419
|
-
config:
|
|
5425
|
+
config: a,
|
|
5420
5426
|
// Methods
|
|
5421
5427
|
fetch: n,
|
|
5422
5428
|
refetch: u,
|
|
5423
5429
|
clear: o
|
|
5424
5430
|
};
|
|
5425
5431
|
}
|
|
5426
|
-
function Qa(
|
|
5427
|
-
const i = za(
|
|
5432
|
+
function Qa(a, e, t) {
|
|
5433
|
+
const i = za(a);
|
|
5428
5434
|
return le(
|
|
5429
5435
|
e,
|
|
5430
|
-
async (
|
|
5431
|
-
if (
|
|
5432
|
-
const n = t(
|
|
5436
|
+
async (s) => {
|
|
5437
|
+
if (s) {
|
|
5438
|
+
const n = t(s);
|
|
5433
5439
|
await i.fetch(n);
|
|
5434
5440
|
}
|
|
5435
5441
|
},
|
|
@@ -5438,17 +5444,17 @@ function Qa(s, e, t) {
|
|
|
5438
5444
|
}
|
|
5439
5445
|
export {
|
|
5440
5446
|
Ka as LayerCheckboxSet,
|
|
5441
|
-
|
|
5447
|
+
Gs as LayerPanel,
|
|
5442
5448
|
Ya as LayerRadioButtonSet,
|
|
5443
|
-
|
|
5449
|
+
Ha as Layerboard,
|
|
5444
5450
|
Ui as MapPanel,
|
|
5445
5451
|
Wa as TopicAccordion,
|
|
5446
5452
|
qa as WEBMAP_ID,
|
|
5447
5453
|
Kt as buildWebMapUrl,
|
|
5448
5454
|
la as clearCache,
|
|
5449
5455
|
Ut as getLayerConfigs,
|
|
5450
|
-
|
|
5451
|
-
|
|
5456
|
+
Ge as getLayerDisplayName,
|
|
5457
|
+
Ga as getWebMapUrl,
|
|
5452
5458
|
fi as normalizeUrl,
|
|
5453
5459
|
Aa as shouldShowCheckbox,
|
|
5454
5460
|
Si as shouldShowLegendBox,
|