@opengis/gis 0.2.166 → 0.2.167

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.
@@ -1,3471 +0,0 @@
1
- var di = Object.defineProperty;
2
- var pi = (e, n, t) => n in e ? di(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
3
- var L = (e, n, t) => pi(e, typeof n != "symbol" ? n + "" : n, t);
4
- import { openBlock as _, createElementBlock as M, createElementVNode as g, defineComponent as ae, ref as E, watch as $, createTextVNode as mi, createVNode as D, createBlock as P, createCommentVNode as W, defineAsyncComponent as hi, unref as ze, withCtx as bn, withDirectives as fn, vModelText as dn, normalizeClass as _e, Fragment as kt, renderList as At, toDisplayString as fe, getCurrentInstance as Ct, onBeforeUnmount as wt, toRef as gi, computed as ve, onMounted as yi, resolveDynamicComponent as vi } from "vue";
5
- import { useRoute as bi, useRouter as xi } from "vue-router";
6
- import { notify as X } from "@opengis/core";
7
- import { _ as Xe, u as Ge, f as Si, M as ki, g as Ai, h as Ci, i as wi, j as tt, k as Ti, l as _i, m as Ei, s as it, n as Ii } from "./index-ClqqnPEd.js";
8
- import { _ as Ni, a as $i, b as Li, c as Fi } from "./HeaderActions.vue_vue_type_script_setup_true_lang-D3oMTMO0.js";
9
- import { S as Oi, C as Ri } from "./CardIcon-B-HKyoDs.js";
10
- import { _ as Tt } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-D3ZPeXMw.js";
11
- import { V as Ze } from "./vs-datatable-C27Dlfo3.js";
12
- import { _ as Nn, m as $n, r as $e } from "./import-utils-HEL359RU.js";
13
- /*! js-yaml 5.2.1 https://github.com/nodeca/js-yaml @license MIT */
14
- var T = Symbol("NOT_RESOLVED"), Ln = Symbol("MERGE_KEY");
15
- function U(e, n) {
16
- return {
17
- tagName: e,
18
- nodeKind: "scalar",
19
- implicit: n.implicit ?? !1,
20
- matchByTagPrefix: n.matchByTagPrefix ?? !1,
21
- implicitFirstChars: n.implicitFirstChars ?? null,
22
- resolve: n.resolve,
23
- identify: n.identify ?? null,
24
- represent: n.represent ?? ((t) => String(t)),
25
- representTagName: n.representTagName ?? null
26
- };
27
- }
28
- function Fn(e, n) {
29
- const t = n.finalize === void 0;
30
- return {
31
- tagName: e,
32
- nodeKind: "sequence",
33
- implicit: !1,
34
- matchByTagPrefix: n.matchByTagPrefix ?? !1,
35
- create: n.create,
36
- addItem: n.addItem,
37
- finalize: n.finalize ?? ((i) => i),
38
- carrierIsResult: t,
39
- identify: n.identify ?? null,
40
- represent: n.represent ?? ((i) => i),
41
- representTagName: n.representTagName ?? null
42
- };
43
- }
44
- function en(e, n) {
45
- const t = n.finalize === void 0;
46
- return {
47
- tagName: e,
48
- nodeKind: "mapping",
49
- implicit: !1,
50
- matchByTagPrefix: n.matchByTagPrefix ?? !1,
51
- create: n.create,
52
- addPair: n.addPair,
53
- has: n.has,
54
- keys: n.keys,
55
- get: n.get,
56
- finalize: n.finalize ?? ((i) => i),
57
- carrierIsResult: t,
58
- identify: n.identify ?? null,
59
- represent: n.represent ?? ((i) => i),
60
- representTagName: n.representTagName ?? null
61
- };
62
- }
63
- var Pi = U("tag:yaml.org,2002:str", {
64
- resolve: (e) => e,
65
- identify: (e) => typeof e == "string"
66
- }), Mi = [
67
- "",
68
- "~",
69
- "null",
70
- "Null",
71
- "NULL"
72
- ], Ui = U("tag:yaml.org,2002:null", {
73
- implicit: !0,
74
- implicitFirstChars: [
75
- "",
76
- "~",
77
- "n",
78
- "N"
79
- ],
80
- resolve: (e) => Mi.indexOf(e) !== -1 ? null : T,
81
- identify: (e) => e === null,
82
- represent: () => "null"
83
- }), qi = U("tag:yaml.org,2002:null", {
84
- implicit: !0,
85
- implicitFirstChars: ["n"],
86
- resolve: (e, n) => e === "null" || n && e === "" ? null : T,
87
- identify: (e) => e === null,
88
- represent: () => "null"
89
- }), Vi = [
90
- "",
91
- "~",
92
- "null",
93
- "Null",
94
- "NULL"
95
- ], Bi = U("tag:yaml.org,2002:null", {
96
- implicit: !0,
97
- implicitFirstChars: [
98
- "",
99
- "~",
100
- "n",
101
- "N"
102
- ],
103
- resolve: (e) => Vi.indexOf(e) !== -1 ? null : T,
104
- identify: (e) => e === null,
105
- represent: () => "null"
106
- }), Di = [
107
- "true",
108
- "True",
109
- "TRUE"
110
- ], Yi = [
111
- "false",
112
- "False",
113
- "FALSE"
114
- ], ji = U("tag:yaml.org,2002:bool", {
115
- implicit: !0,
116
- implicitFirstChars: [
117
- "t",
118
- "T",
119
- "f",
120
- "F"
121
- ],
122
- resolve: (e) => Di.indexOf(e) !== -1 ? !0 : Yi.indexOf(e) !== -1 ? !1 : T,
123
- identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
124
- represent: (e) => e ? "true" : "false"
125
- }), Ki = ["true"], Hi = ["false"], zi = U("tag:yaml.org,2002:bool", {
126
- implicit: !0,
127
- implicitFirstChars: ["t", "f"],
128
- resolve: (e) => Ki.indexOf(e) !== -1 ? !0 : Hi.indexOf(e) !== -1 ? !1 : T,
129
- identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
130
- represent: (e) => e ? "true" : "false"
131
- }), Gi = [
132
- "true",
133
- "True",
134
- "TRUE",
135
- "y",
136
- "Y",
137
- "yes",
138
- "Yes",
139
- "YES",
140
- "on",
141
- "On",
142
- "ON"
143
- ], Wi = [
144
- "false",
145
- "False",
146
- "FALSE",
147
- "n",
148
- "N",
149
- "no",
150
- "No",
151
- "NO",
152
- "off",
153
- "Off",
154
- "OFF"
155
- ], Qi = U("tag:yaml.org,2002:bool", {
156
- implicit: !0,
157
- implicitFirstChars: [
158
- "y",
159
- "Y",
160
- "n",
161
- "N",
162
- "t",
163
- "T",
164
- "f",
165
- "F",
166
- "o",
167
- "O"
168
- ],
169
- resolve: (e) => Gi.indexOf(e) !== -1 ? !0 : Wi.indexOf(e) !== -1 ? !1 : T,
170
- identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
171
- represent: (e) => e ? "true" : "false"
172
- }), Ji = /* @__PURE__ */ new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"), Xi = /* @__PURE__ */ new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
173
- function Zi(e) {
174
- let n = e, t = 1;
175
- return (n[0] === "-" || n[0] === "+") && (n[0] === "-" && (t = -1), n = n.slice(1)), n.startsWith("0b") ? t * parseInt(n.slice(2), 2) : n.startsWith("0o") ? t * parseInt(n.slice(2), 8) : n.startsWith("0x") ? t * parseInt(n.slice(2), 16) : t * parseInt(n, 10);
176
- }
177
- function er(e, n) {
178
- if (n) {
179
- if (!Xi.test(e)) return T;
180
- } else if (!Ji.test(e)) return T;
181
- const t = Zi(e);
182
- return Number.isFinite(t) ? t : T;
183
- }
184
- var _t = U("tag:yaml.org,2002:int", {
185
- implicit: !0,
186
- implicitFirstChars: [
187
- "-",
188
- "+",
189
- ..."0123456789"
190
- ],
191
- resolve: er,
192
- identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
193
- represent: (e) => e.toString(10)
194
- }), nr = /* @__PURE__ */ new RegExp("^-?(?:0|[1-9][0-9]*)$"), tr = /* @__PURE__ */ new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
195
- function ir(e) {
196
- let n = e, t = 1;
197
- return (n[0] === "-" || n[0] === "+") && (n[0] === "-" && (t = -1), n = n.slice(1)), n.startsWith("0b") ? t * parseInt(n.slice(2), 2) : n.startsWith("0o") ? t * parseInt(n.slice(2), 8) : n.startsWith("0x") ? t * parseInt(n.slice(2), 16) : t * parseInt(n, 10);
198
- }
199
- function rr(e, n) {
200
- if (n) {
201
- if (!tr.test(e)) return T;
202
- } else if (!nr.test(e)) return T;
203
- const t = ir(e);
204
- return Number.isFinite(t) ? t : T;
205
- }
206
- var or = U("tag:yaml.org,2002:int", {
207
- implicit: !0,
208
- implicitFirstChars: ["-", ..."0123456789"],
209
- resolve: rr,
210
- identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
211
- represent: (e) => e.toString(10)
212
- }), lr = /* @__PURE__ */ new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");
213
- function ar(e) {
214
- let n = e.replace(/_/g, ""), t = 1;
215
- if ((n[0] === "-" || n[0] === "+") && (n[0] === "-" && (t = -1), n = n.slice(1)), n.startsWith("0b")) return t * parseInt(n.slice(2), 2);
216
- if (n.startsWith("0x")) return t * parseInt(n.slice(2), 16);
217
- if (n.includes(":")) {
218
- let i = 0;
219
- for (const r of n.split(":")) i = i * 60 + Number(r);
220
- return t * i;
221
- }
222
- return n !== "0" && n[0] === "0" ? t * parseInt(n, 8) : t * parseInt(n, 10);
223
- }
224
- function sr(e) {
225
- if (!lr.test(e)) return T;
226
- const n = ar(e);
227
- return Number.isFinite(n) ? n : T;
228
- }
229
- var xn = U("tag:yaml.org,2002:int", {
230
- implicit: !0,
231
- implicitFirstChars: [
232
- "-",
233
- "+",
234
- ..."0123456789"
235
- ],
236
- resolve: sr,
237
- identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
238
- represent: (e) => e.toString(10)
239
- }), ur = /* @__PURE__ */ new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"), cr = /* @__PURE__ */ new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
240
- function fr(e) {
241
- if (!ur.test(e)) return T;
242
- let n = e.toLowerCase();
243
- const t = n[0] === "-" ? -1 : 1;
244
- if ("+-".includes(n[0]) && (n = n.slice(1)), n === ".inf") return t === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
245
- if (n === ".nan") return NaN;
246
- const i = t * parseFloat(n);
247
- return Number.isFinite(i) || cr.test(e) ? i : T;
248
- }
249
- function dr(e) {
250
- if (isNaN(e)) return ".nan";
251
- if (e === Number.POSITIVE_INFINITY) return ".inf";
252
- if (e === Number.NEGATIVE_INFINITY) return "-.inf";
253
- if (Object.is(e, -0)) return "-0.0";
254
- const n = e.toString(10);
255
- return /^[-+]?[0-9]+e/.test(n) ? n.replace("e", ".e") : n;
256
- }
257
- var Et = U("tag:yaml.org,2002:float", {
258
- implicit: !0,
259
- implicitFirstChars: [
260
- "-",
261
- "+",
262
- ".",
263
- ..."0123456789"
264
- ],
265
- resolve: fr,
266
- identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
267
- represent: dr
268
- }), pr = /* @__PURE__ */ new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"), mr = /* @__PURE__ */ new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
269
- function hr(e, n) {
270
- if (n) {
271
- if (!mr.test(e)) return T;
272
- let i = e.toLowerCase();
273
- const r = i[0] === "-" ? -1 : 1;
274
- if ("+-".includes(i[0]) && (i = i.slice(1)), i === ".inf") return r === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
275
- if (i === ".nan") return NaN;
276
- const o = r * parseFloat(i);
277
- return Number.isFinite(o) ? o : T;
278
- }
279
- if (!pr.test(e)) return T;
280
- const t = Number(e);
281
- return Number.isFinite(t) ? t : T;
282
- }
283
- function gr(e) {
284
- if (isNaN(e)) return ".nan";
285
- if (e === Number.POSITIVE_INFINITY) return ".inf";
286
- if (e === Number.NEGATIVE_INFINITY) return "-.inf";
287
- if (Object.is(e, -0)) return "-0.0";
288
- const n = e.toString(10);
289
- return /^[-+]?[0-9]+e/.test(n) ? n.replace("e", ".e") : n;
290
- }
291
- var yr = U("tag:yaml.org,2002:float", {
292
- implicit: !0,
293
- implicitFirstChars: ["-", ..."0123456789"],
294
- resolve: hr,
295
- identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
296
- represent: gr
297
- }), vr = /* @__PURE__ */ new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"), br = /* @__PURE__ */ new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
298
- function xr(e) {
299
- if (!vr.test(e)) return T;
300
- let n = e.toLowerCase().replace(/_/g, "");
301
- const t = n[0] === "-" ? -1 : 1;
302
- if ("+-".includes(n[0]) && (n = n.slice(1)), n === ".inf") return t === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
303
- if (n === ".nan") return NaN;
304
- let i = 0;
305
- if (n.includes(":")) {
306
- for (const r of n.split(":")) i = i * 60 + Number(r);
307
- i *= t;
308
- } else i = t * parseFloat(n);
309
- return Number.isFinite(i) || br.test(e) ? i : T;
310
- }
311
- function Sr(e) {
312
- if (isNaN(e)) return ".nan";
313
- if (e === Number.POSITIVE_INFINITY) return ".inf";
314
- if (e === Number.NEGATIVE_INFINITY) return "-.inf";
315
- if (Object.is(e, -0)) return "-0.0";
316
- const n = e.toString(10);
317
- return /^[-+]?[0-9]+e/.test(n) ? n.replace("e", ".e") : n;
318
- }
319
- var Sn = U("tag:yaml.org,2002:float", {
320
- implicit: !0,
321
- implicitFirstChars: [
322
- "-",
323
- "+",
324
- ".",
325
- ..."0123456789"
326
- ],
327
- resolve: xr,
328
- identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
329
- represent: Sr
330
- }), kr = U("tag:yaml.org,2002:merge", {
331
- implicit: !0,
332
- implicitFirstChars: ["<"],
333
- resolve: (e, n) => e === "<<" || n && e === "" ? Ln : T
334
- }), Ar = /^[A-Za-z0-9+/]*={0,2}$/;
335
- function Cr(e) {
336
- const n = e.replace(/\s/g, "");
337
- if (n.length % 4 !== 0 || !Ar.test(n)) return T;
338
- const t = atob(n), i = new Uint8Array(t.length);
339
- for (let r = 0; r < t.length; r++) i[r] = t.charCodeAt(r);
340
- return i;
341
- }
342
- function wr(e) {
343
- let n = "";
344
- for (let t = 0; t < e.length; t++) n += String.fromCharCode(e[t]);
345
- return btoa(n);
346
- }
347
- var Tr = U("tag:yaml.org,2002:binary", {
348
- resolve: Cr,
349
- identify: (e) => Object.prototype.toString.call(e) === "[object Uint8Array]",
350
- represent: wr
351
- }), _r = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"), Er = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
352
- function Ir(e) {
353
- let n = _r.exec(e);
354
- if (n === null && (n = Er.exec(e)), n === null) return T;
355
- const t = +n[1], i = +n[2] - 1, r = +n[3];
356
- if (!n[4]) {
357
- const c = new Date(Date.UTC(t, i, r));
358
- return c.getUTCFullYear() !== t || c.getUTCMonth() !== i || c.getUTCDate() !== r ? T : c;
359
- }
360
- const o = +n[4], l = +n[5], a = +n[6];
361
- let u = 0;
362
- if (o > 23 || l > 59 || a > 59) return T;
363
- if (n[7]) {
364
- let c = n[7].slice(0, 3);
365
- for (; c.length < 3; ) c += "0";
366
- u = +c;
367
- }
368
- const s = new Date(Date.UTC(t, i, r, o, l, a, u));
369
- if (s.getUTCFullYear() !== t || s.getUTCMonth() !== i || s.getUTCDate() !== r) return T;
370
- if (n[9]) {
371
- const c = +n[10], y = +(n[11] || 0);
372
- if (c > 23 || y > 59) return T;
373
- const m = (c * 60 + y) * 6e4;
374
- s.setTime(s.getTime() - (n[9] === "-" ? -m : m));
375
- }
376
- return s;
377
- }
378
- var Nr = U("tag:yaml.org,2002:timestamp", {
379
- implicit: !0,
380
- implicitFirstChars: [..."0123456789"],
381
- resolve: Ir,
382
- identify: (e) => e instanceof Date,
383
- represent: (e) => e.toISOString()
384
- }), $r = Fn("tag:yaml.org,2002:seq", {
385
- create: () => [],
386
- addItem: (e, n) => {
387
- e.push(n);
388
- },
389
- identify: Array.isArray
390
- });
391
- function nn(e) {
392
- if (e === null || typeof e != "object" || Array.isArray(e)) return !1;
393
- const n = Object.getPrototypeOf(e);
394
- return n === null || n === Object.prototype;
395
- }
396
- function kn(e, n) {
397
- const t = {};
398
- for (const i of n) e[i] !== void 0 && (t[i] = e[i]);
399
- return t;
400
- }
401
- var Lr = Fn("tag:yaml.org,2002:omap", {
402
- create: () => ({
403
- list: [],
404
- seen: /* @__PURE__ */ new Set()
405
- }),
406
- addItem: (e, n) => {
407
- let t;
408
- if (n instanceof Map) {
409
- if (n.size !== 1) return "cannot resolve an ordered map item";
410
- t = n.keys().next().value;
411
- } else if (nn(n)) {
412
- const i = Object.keys(n);
413
- if (i.length !== 1) return "cannot resolve an ordered map item";
414
- t = i[0];
415
- } else return "cannot resolve an ordered map item";
416
- return e.seen.has(t) ? "duplicate key in ordered map" : (e.seen.add(t), e.list.push(n), "");
417
- },
418
- finalize: (e) => e.list
419
- }), Fr = Fn("tag:yaml.org,2002:pairs", {
420
- create: () => [],
421
- addItem: (e, n) => {
422
- if (n instanceof Map)
423
- return n.size !== 1 ? "cannot resolve a pairs item" : (e.push(n.entries().next().value), "");
424
- if (Object.prototype.toString.call(n) !== "[object Object]") return "cannot resolve a pairs item";
425
- const t = n, i = Object.keys(t);
426
- return i.length !== 1 ? "cannot resolve a pairs item" : (e.push([i[0], t[i[0]]]), "");
427
- }
428
- }), Or = en("tag:yaml.org,2002:map", {
429
- create: () => ({}),
430
- identify: nn,
431
- represent: (e) => {
432
- const n = /* @__PURE__ */ new Map();
433
- for (const t of Object.keys(e)) n.set(t, e[t]);
434
- return n;
435
- },
436
- addPair: (e, n, t) => {
437
- if (n !== null && typeof n == "object") return "object-based map does not support complex keys";
438
- const i = String(n);
439
- return i === "__proto__" ? Object.defineProperty(e, i, {
440
- value: t,
441
- enumerable: !0,
442
- configurable: !0,
443
- writable: !0
444
- }) : e[i] = t, "";
445
- },
446
- has: (e, n) => n !== null && typeof n == "object" ? !1 : Object.prototype.hasOwnProperty.call(e, String(n)),
447
- keys: (e) => Object.keys(e),
448
- get: (e, n) => e[String(n)]
449
- }), Rr = en("tag:yaml.org,2002:set", {
450
- create: () => /* @__PURE__ */ new Set(),
451
- identify: (e) => e instanceof Set,
452
- represent: (e) => {
453
- const n = /* @__PURE__ */ new Map();
454
- for (const t of e) n.set(t, null);
455
- return n;
456
- },
457
- addPair: (e, n, t) => t !== null ? "cannot resolve a set item" : (e.add(n), ""),
458
- has: (e, n) => e.has(n),
459
- keys: (e) => e.keys(),
460
- get: () => null
461
- });
462
- function Pr() {
463
- return {
464
- scalar: {},
465
- sequence: {},
466
- mapping: {}
467
- };
468
- }
469
- function Mr() {
470
- return {
471
- scalar: [],
472
- sequence: [],
473
- mapping: []
474
- };
475
- }
476
- function Ur(e) {
477
- const n = [];
478
- for (const t of e) {
479
- let i = n.length;
480
- for (let r = 0; r < n.length; r++) {
481
- const o = n[r];
482
- if (o.nodeKind === t.nodeKind && o.tagName === t.tagName && o.matchByTagPrefix === t.matchByTagPrefix) {
483
- i = r;
484
- break;
485
- }
486
- }
487
- n[i] = t;
488
- }
489
- return n;
490
- }
491
- var tn = class It {
492
- constructor(n) {
493
- L(this, "tags");
494
- L(this, "implicitScalarTags");
495
- L(this, "implicitScalarByFirstChar");
496
- L(this, "implicitScalarAnyFirstChar");
497
- L(this, "defaultScalarTag");
498
- L(this, "defaultSequenceTag");
499
- L(this, "defaultMappingTag");
500
- L(this, "exact");
501
- L(this, "prefix");
502
- const t = Ur(n), i = [], r = Pr(), o = Mr();
503
- for (const c of t) {
504
- if (c.nodeKind === "scalar" && c.implicit) {
505
- if (c.matchByTagPrefix) throw new Error("Implicit scalar tags cannot match by tag prefix");
506
- i.push(c);
507
- }
508
- switch (c.nodeKind) {
509
- case "scalar":
510
- c.matchByTagPrefix ? o.scalar.push(c) : r.scalar[c.tagName] = c;
511
- break;
512
- case "sequence":
513
- c.matchByTagPrefix ? o.sequence.push(c) : r.sequence[c.tagName] = c;
514
- break;
515
- case "mapping":
516
- c.matchByTagPrefix ? o.mapping.push(c) : r.mapping[c.tagName] = c;
517
- break;
518
- }
519
- }
520
- const l = i.filter((c) => c.implicitFirstChars === null), a = /* @__PURE__ */ new Set();
521
- for (const c of i) if (c.implicitFirstChars !== null) for (const y of c.implicitFirstChars) a.add(y);
522
- const u = /* @__PURE__ */ new Map();
523
- for (const c of a) u.set(c, i.filter((y) => y.implicitFirstChars === null || y.implicitFirstChars.indexOf(c) !== -1));
524
- const s = r.scalar["tag:yaml.org,2002:str"];
525
- if (!s) throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");
526
- this.tags = t, this.implicitScalarTags = i, this.implicitScalarByFirstChar = u, this.implicitScalarAnyFirstChar = l, this.defaultScalarTag = s, this.defaultSequenceTag = r.sequence["tag:yaml.org,2002:seq"], this.defaultMappingTag = r.mapping["tag:yaml.org,2002:map"], this.exact = r, this.prefix = o;
527
- }
528
- withTags(...n) {
529
- let t = [];
530
- for (const i of n) t = t.concat(i);
531
- return new It([...this.tags, ...t]);
532
- }
533
- }, On = new tn([
534
- Pi,
535
- $r,
536
- Or
537
- ]);
538
- new tn([
539
- ...On.tags,
540
- qi,
541
- zi,
542
- or,
543
- yr
544
- ]);
545
- var qr = new tn([
546
- ...On.tags,
547
- Ui,
548
- ji,
549
- _t,
550
- Et
551
- ]), Vr = new tn([
552
- ...On.tags,
553
- Bi,
554
- Qi,
555
- xn,
556
- Sn,
557
- Nr,
558
- kr,
559
- Tr,
560
- Lr,
561
- Fr,
562
- Rr
563
- ]);
564
- en("tag:yaml.org,2002:map", {
565
- create: () => /* @__PURE__ */ new Map(),
566
- addPair: (e, n, t) => (e.set(n, t), ""),
567
- has: (e, n) => e.has(n),
568
- keys: (e) => e.keys(),
569
- get: (e, n) => e.get(n),
570
- identify: (e) => e instanceof Map || nn(e),
571
- represent: (e) => {
572
- if (e instanceof Map) return e;
573
- const n = /* @__PURE__ */ new Map(), t = e;
574
- for (const i of Object.keys(t)) n.set(i, t[i]);
575
- return n;
576
- }
577
- });
578
- function rt(e) {
579
- if (Array.isArray(e)) {
580
- const n = Array.prototype.slice.call(e);
581
- for (let t = 0; t < n.length; t++) {
582
- if (Array.isArray(n[t])) return null;
583
- typeof n[t] == "object" && Object.prototype.toString.call(n[t]) === "[object Object]" && (n[t] = "[object Object]");
584
- }
585
- return String(n);
586
- }
587
- return typeof e == "object" && Object.prototype.toString.call(e) === "[object Object]" ? "[object Object]" : String(e);
588
- }
589
- en("tag:yaml.org,2002:map", {
590
- create: () => ({}),
591
- identify: nn,
592
- represent: (e) => {
593
- const n = /* @__PURE__ */ new Map();
594
- for (const t of Object.keys(e)) n.set(t, e[t]);
595
- return n;
596
- },
597
- addPair: (e, n, t) => {
598
- const i = rt(n);
599
- return i === null ? "nested arrays are not supported inside keys" : (i === "__proto__" ? Object.defineProperty(e, i, {
600
- value: t,
601
- enumerable: !0,
602
- configurable: !0,
603
- writable: !0
604
- }) : e[i] = t, "");
605
- },
606
- has: (e, n) => {
607
- const t = rt(n);
608
- return t !== null && Object.prototype.hasOwnProperty.call(e, t);
609
- },
610
- keys: (e) => Object.keys(e),
611
- get: (e, n) => e[String(n)]
612
- });
613
- var Br = {
614
- maxLength: 79,
615
- indent: 1,
616
- linesBefore: 3,
617
- linesAfter: 2
618
- };
619
- function pn(e, n, t, i, r) {
620
- let o = "", l = "";
621
- const a = Math.floor(r / 2) - 1;
622
- return i - n > a && (o = " ... ", n = i - a + o.length), t - i > a && (l = " ...", t = i + a - l.length), {
623
- str: o + e.slice(n, t).replace(/\t/g, "→") + l,
624
- pos: i - n + o.length
625
- };
626
- }
627
- function mn(e, n) {
628
- return " ".repeat(Math.max(n - e.length, 0)) + e;
629
- }
630
- function Dr(e, n) {
631
- if (!e.buffer) return null;
632
- const t = {
633
- ...Br,
634
- ...n
635
- }, i = /\r?\n|\r|\0/g, r = [0], o = [];
636
- let l, a = -1;
637
- for (; l = i.exec(e.buffer); )
638
- o.push(l.index), r.push(l.index + l[0].length), e.position <= l.index && a < 0 && (a = r.length - 2);
639
- a < 0 && (a = r.length - 1);
640
- let u = "";
641
- const s = Math.min(e.line + t.linesAfter, o.length).toString().length, c = t.maxLength - (t.indent + s + 3);
642
- for (let m = 1; m <= t.linesBefore && !(a - m < 0); m++) {
643
- const b = pn(e.buffer, r[a - m], o[a - m], e.position - (r[a] - r[a - m]), c);
644
- u = `${" ".repeat(t.indent)}${mn((e.line - m + 1).toString(), s)} | ${b.str}
645
- ${u}`;
646
- }
647
- const y = pn(e.buffer, r[a], o[a], e.position, c);
648
- u += `${" ".repeat(t.indent)}${mn((e.line + 1).toString(), s)} | ${y.str}
649
- `, u += `${"-".repeat(t.indent + s + 3 + y.pos)}^
650
- `;
651
- for (let m = 1; m <= t.linesAfter && !(a + m >= o.length); m++) {
652
- const b = pn(e.buffer, r[a + m], o[a + m], e.position - (r[a] - r[a + m]), c);
653
- u += `${" ".repeat(t.indent)}${mn((e.line + m + 1).toString(), s)} | ${b.str}
654
- `;
655
- }
656
- return u.replace(/\n$/, "");
657
- }
658
- function ot(e, n) {
659
- let t = "";
660
- return e.mark ? (e.mark.name && (t += `in "${e.mark.name}" `), t += `(${e.mark.line + 1}:${e.mark.column + 1})`, !n && e.mark.snippet && (t += `
661
-
662
- ${e.mark.snippet}`), `${e.reason} ${t}`) : e.reason;
663
- }
664
- var Le = class extends Error {
665
- constructor(n, t) {
666
- super();
667
- L(this, "reason");
668
- L(this, "mark");
669
- this.name = "YAMLException", this.reason = n, this.mark = t, this.message = ot(this, !1), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
670
- }
671
- toString(n) {
672
- return `${this.name}: ${ot(this, n)}`;
673
- }
674
- };
675
- function rn(e, n, t, i = "") {
676
- let r = 0, o = 0;
677
- for (let a = 0; a < n; a++) {
678
- const u = e.charCodeAt(a);
679
- u === 10 ? (r++, o = a + 1) : u === 13 && (r++, e.charCodeAt(a + 1) === 10 && a++, o = a + 1);
680
- }
681
- const l = {
682
- name: i,
683
- buffer: e,
684
- position: n,
685
- line: r,
686
- column: n - o
687
- };
688
- throw l.snippet = Dr(l), new Le(t, l);
689
- }
690
- var Yr = -1;
691
- function lt(e) {
692
- switch (e) {
693
- case 48:
694
- return "\0";
695
- case 97:
696
- return "\x07";
697
- case 98:
698
- return "\b";
699
- case 116:
700
- return " ";
701
- case 9:
702
- return " ";
703
- case 110:
704
- return `
705
- `;
706
- case 118:
707
- return "\v";
708
- case 102:
709
- return "\f";
710
- case 114:
711
- return "\r";
712
- case 101:
713
- return "\x1B";
714
- case 32:
715
- return " ";
716
- case 34:
717
- return '"';
718
- case 47:
719
- return "/";
720
- case 92:
721
- return "\\";
722
- case 78:
723
- return "…";
724
- case 95:
725
- return " ";
726
- case 76:
727
- return "\u2028";
728
- case 80:
729
- return "\u2029";
730
- default:
731
- return "";
732
- }
733
- }
734
- var Nt = new Array(256), $t = new Array(256);
735
- for (let e = 0; e < 256; e++)
736
- Nt[e] = lt(e) ? 1 : 0, $t[e] = lt(e);
737
- function jr(e) {
738
- return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode((e - 65536 >> 10) + 55296, (e - 65536 & 1023) + 56320);
739
- }
740
- function Kr(e) {
741
- return e >= 48 && e <= 57 ? e - 48 : (e | 32) - 97 + 10;
742
- }
743
- function Hr(e) {
744
- return e === 120 ? 2 : e === 117 ? 4 : 8;
745
- }
746
- function We(e, n, t) {
747
- let i = 0;
748
- for (; n < t; ) {
749
- const r = e.charCodeAt(n);
750
- if (r === 10)
751
- i++, n++;
752
- else if (r === 13)
753
- i++, n++, e.charCodeAt(n) === 10 && n++;
754
- else if (r === 32 || r === 9) n++;
755
- else break;
756
- }
757
- return {
758
- position: n,
759
- breaks: i
760
- };
761
- }
762
- function Rn(e) {
763
- return e === 1 ? " " : `
764
- `.repeat(e - 1);
765
- }
766
- function zr(e, n, t) {
767
- let i = "", r = n, o = n, l = n;
768
- for (; r < t; ) {
769
- const a = e.charCodeAt(r);
770
- if (a === 10 || a === 13) {
771
- i += e.slice(o, l);
772
- const u = We(e, r, t);
773
- i += Rn(u.breaks), r = o = l = u.position;
774
- } else
775
- r++, a !== 32 && a !== 9 && (l = r);
776
- }
777
- return i + e.slice(o, l);
778
- }
779
- function Gr(e, n, t) {
780
- let i = "", r = n, o = n, l = n;
781
- for (; r < t; ) {
782
- const a = e.charCodeAt(r);
783
- if (a === 39)
784
- i += e.slice(o, r) + "'", r += 2, o = l = r;
785
- else if (a === 10 || a === 13) {
786
- i += e.slice(o, l);
787
- const u = We(e, r, t);
788
- i += Rn(u.breaks), r = o = l = u.position;
789
- } else
790
- r++, a !== 32 && a !== 9 && (l = r);
791
- }
792
- return i + e.slice(o, t);
793
- }
794
- function Wr(e, n, t) {
795
- let i = "", r = n, o = n, l = n;
796
- for (; r < t; ) {
797
- const a = e.charCodeAt(r);
798
- if (a === 92) {
799
- i += e.slice(o, r), r++;
800
- const u = e.charCodeAt(r);
801
- if (u === 10 || u === 13) r = We(e, r, t).position;
802
- else if (u < 256 && Nt[u])
803
- i += $t[u], r++;
804
- else {
805
- let s = Hr(u), c = 0;
806
- for (; s > 0; s--) {
807
- r++;
808
- const y = Kr(e.charCodeAt(r));
809
- c = (c << 4) + y;
810
- }
811
- i += jr(c), r++;
812
- }
813
- o = l = r;
814
- } else if (a === 10 || a === 13) {
815
- i += e.slice(o, l);
816
- const u = We(e, r, t);
817
- i += Rn(u.breaks), r = o = l = u.position;
818
- } else
819
- r++, a !== 32 && a !== 9 && (l = r);
820
- }
821
- return i + e.slice(o, t);
822
- }
823
- function at(e, n, t, i, r, o) {
824
- const l = i < 0 ? 0 : i, a = e.slice(n, t).replace(/\r\n?/g, `
825
- `), u = a === "" ? [] : (a.endsWith(`
826
- `) ? a.slice(0, -1) : a).split(`
827
- `);
828
- let s = "", c = !1, y = 0, m = !1;
829
- for (const b of u) {
830
- let p = 0;
831
- for (; p < l && b.charCodeAt(p) === 32; ) p++;
832
- if (i < 0 || p >= b.length) {
833
- y++;
834
- continue;
835
- }
836
- const h = b.slice(l), v = h.charCodeAt(0);
837
- o ? v === 32 || v === 9 ? (m = !0, s += `
838
- `.repeat(c ? 1 + y : y)) : m ? (m = !1, s += `
839
- `.repeat(y + 1)) : y === 0 ? c && (s += " ") : s += `
840
- `.repeat(y) : s += `
841
- `.repeat(c ? 1 + y : y), s += h, c = !0, y = 0;
842
- }
843
- return r === 3 ? s += `
844
- `.repeat(c ? 1 + y : y) : r !== 2 && c && (s += `
845
- `), s;
846
- }
847
- function Qr(e, n) {
848
- if (n.valueStart === Yr) return "";
849
- const { valueStart: t, valueEnd: i } = n;
850
- if (n.fast) return e.slice(t, i);
851
- switch (n.style) {
852
- case 2:
853
- return Gr(e, t, i);
854
- case 3:
855
- return Wr(e, t, i);
856
- case 4:
857
- return at(e, t, i, n.indent, n.chomping, !1);
858
- case 5:
859
- return at(e, t, i, n.indent, n.chomping, !0);
860
- default:
861
- return zr(e, t, i);
862
- }
863
- }
864
- var Jr = {
865
- "!": "!",
866
- "!!": "tag:yaml.org,2002:"
867
- };
868
- function hn(e) {
869
- return encodeURI(e).replace(/!/g, "%21");
870
- }
871
- function Lt(e, n) {
872
- if (e.startsWith("!<") && e.endsWith(">")) return decodeURIComponent(e.slice(2, -1));
873
- const t = e.indexOf("!", 1), i = t === -1 ? "!" : e.slice(0, t + 1), r = (n == null ? void 0 : n[i]) ?? Jr[i] ?? i;
874
- return decodeURIComponent(r) + decodeURIComponent(e.slice(i.length));
875
- }
876
- function Ft(e) {
877
- let n = e;
878
- return n.charCodeAt(0) === 33 ? (n = n.slice(1), `!${hn(n)}`) : n.slice(0, 18) === "tag:yaml.org,2002:" ? `!!${hn(n.slice(18))}` : `!<${hn(n)}>`;
879
- }
880
- var be = -1, Pn = {
881
- filename: "",
882
- schema: qr,
883
- json: !1,
884
- maxTotalMergeKeys: 1e4,
885
- maxAliases: -1
886
- };
887
- function Xr(e) {
888
- return "tagStart" in e && e.tagStart !== be ? e.tagStart : "anchorStart" in e && e.anchorStart !== be ? e.anchorStart : "valueStart" in e && e.valueStart !== be ? e.valueStart : "start" in e ? e.start : 0;
889
- }
890
- function j(e, n) {
891
- rn(e.source, e.position, n, e.filename);
892
- }
893
- function Ot(e, n, t, i) {
894
- try {
895
- return t.finalize(i);
896
- } catch (r) {
897
- if (r instanceof Le) throw r;
898
- rn(e.source, n, r instanceof Error ? r.message : String(r), e.filename);
899
- }
900
- }
901
- function Ke(e, n, t) {
902
- const i = e[t];
903
- if (i) return i;
904
- for (const r of n) if (t.startsWith(r.tagName)) return r;
905
- }
906
- function Zr(e, n, t, i, r) {
907
- const o = Ke(n, t, i);
908
- if (o) return o;
909
- j(e, `unknown ${r} tag !<${i}>`);
910
- }
911
- function eo(e, n) {
912
- const t = Qr(e.source, n), i = n.tagStart === be ? "" : e.source.slice(n.tagStart, n.tagEnd), r = e.schema.defaultScalarTag;
913
- if (i !== "") {
914
- if (i === "!") return {
915
- value: t,
916
- tag: r
917
- };
918
- const o = Lt(i, e.tagHandlers), l = Ke(e.schema.exact.scalar, e.schema.prefix.scalar, o);
919
- if (l) {
920
- const u = l.resolve(t, !0, o);
921
- return u === T && j(e, `cannot resolve a node with !<${o}> explicit tag`), {
922
- value: u,
923
- tag: l
924
- };
925
- }
926
- const a = Ke(e.schema.exact.mapping, e.schema.prefix.mapping, o) ?? Ke(e.schema.exact.sequence, e.schema.prefix.sequence, o);
927
- if (a) {
928
- t !== "" && j(e, `cannot resolve a node with !<${o}> explicit tag`);
929
- const u = a.create(o);
930
- return {
931
- value: a.carrierIsResult ? u : Ot(e, e.position, a, u),
932
- tag: a
933
- };
934
- }
935
- j(e, `unknown scalar tag !<${o}>`);
936
- }
937
- if (n.style === 1) {
938
- const o = e.schema.implicitScalarByFirstChar.get(t.charAt(0)) ?? e.schema.implicitScalarAnyFirstChar;
939
- for (const l of o) {
940
- const a = l.resolve(t, !1, l.tagName);
941
- if (a !== T) return {
942
- value: a,
943
- tag: l
944
- };
945
- }
946
- }
947
- return {
948
- value: r.resolve(t, !1, r.tagName),
949
- tag: r
950
- };
951
- }
952
- function st(e, n, t, i, r, o) {
953
- const l = n.tagStart === be ? "" : e.source.slice(n.tagStart, n.tagEnd), a = l === "" || l === "!" ? r : Lt(l, e.tagHandlers);
954
- return {
955
- tagName: a,
956
- tag: Zr(e, t, i, a, o)
957
- };
958
- }
959
- function Rt(e) {
960
- return e.nodeKind === "mapping";
961
- }
962
- function ut(e, n, t, i) {
963
- for (const r of i.keys(t)) {
964
- if (e.maxTotalMergeKeys !== -1 && ++e.totalMergeKeys > e.maxTotalMergeKeys && j(e, `merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`), n.tag.has(n.value, r)) continue;
965
- const o = n.tag.addPair(n.value, r, i.get(t, r));
966
- o && j(e, o), (n.overridable ?? (n.overridable = /* @__PURE__ */ new Set())).add(r);
967
- }
968
- }
969
- function no(e, n, t, i) {
970
- if (e.position = n.keyPosition, Rt(i)) ut(e, n, t, i);
971
- else if (i.nodeKind === "sequence" && Array.isArray(t)) for (const r of t) ut(e, n, r, n.tag);
972
- else j(e, "cannot merge mappings; the provided source object is unacceptable");
973
- }
974
- function to(e, n, t, i, r) {
975
- var l, a;
976
- if (e.position = n.keyPosition, t === Ln) {
977
- no(e, n, i, r);
978
- return;
979
- }
980
- !e.json && n.tag.has(n.value, t) && !((l = n.overridable) != null && l.has(t)) && j(e, "duplicated mapping key");
981
- const o = n.tag.addPair(n.value, t, i);
982
- o && j(e, o), (a = n.overridable) == null || a.delete(t);
983
- }
984
- function gn(e, n, t) {
985
- const i = e.frames[e.frames.length - 1];
986
- if (i.kind === "document")
987
- i.value = n, i.hasValue = !0;
988
- else if (i.kind === "sequence") {
989
- i.merge && (Rt(t) || j(e, "cannot merge mappings; the provided source object is unacceptable"));
990
- const r = i.tag.addItem(i.value, n, i.index++);
991
- r && j(e, r);
992
- } else if (i.hasKey) {
993
- const r = i.key;
994
- i.key = void 0, i.hasKey = !1, to(e, i, r, n, t);
995
- } else
996
- i.key = n, i.keyPosition = e.position, i.hasKey = !0;
997
- }
998
- function yn(e, n, t, i, r) {
999
- if (n.anchorStart !== be) {
1000
- const o = {
1001
- value: t,
1002
- tag: i,
1003
- isValueFinal: r
1004
- };
1005
- return e.anchors.set(e.source.slice(n.anchorStart, n.anchorEnd), o), o;
1006
- }
1007
- return null;
1008
- }
1009
- function io(e, n) {
1010
- const t = {
1011
- ...Pn,
1012
- ...n,
1013
- events: e,
1014
- documents: [],
1015
- eventIndex: 0,
1016
- position: 0,
1017
- frames: [],
1018
- anchors: /* @__PURE__ */ new Map(),
1019
- tagHandlers: /* @__PURE__ */ Object.create(null),
1020
- totalMergeKeys: 0,
1021
- aliasCount: 0
1022
- };
1023
- for (; t.eventIndex < t.events.length; ) {
1024
- const i = t.events[t.eventIndex++];
1025
- switch (t.position = Xr(i), i.type) {
1026
- case 1:
1027
- t.anchors = /* @__PURE__ */ new Map(), t.aliasCount = 0, t.tagHandlers = /* @__PURE__ */ Object.create(null);
1028
- for (const r of i.directives) r.kind === "tag" && (t.tagHandlers[r.handle] = r.prefix);
1029
- t.frames.push({
1030
- kind: "document",
1031
- position: t.position,
1032
- value: void 0,
1033
- hasValue: !1
1034
- });
1035
- break;
1036
- case 4: {
1037
- const { value: r, tag: o } = eo(t, i);
1038
- yn(t, i, r, o, !0), gn(t, r, o);
1039
- break;
1040
- }
1041
- case 2: {
1042
- const r = st(t, i, t.schema.exact.sequence, t.schema.prefix.sequence, "tag:yaml.org,2002:seq", "sequence"), o = r.tag.create(r.tagName), l = yn(t, i, o, r.tag, r.tag.carrierIsResult), a = t.frames[t.frames.length - 1], u = a !== void 0 && a.kind === "mapping" && a.hasKey && a.key === Ln;
1043
- t.frames.push({
1044
- kind: "sequence",
1045
- position: t.position,
1046
- value: o,
1047
- tag: r.tag,
1048
- anchor: l,
1049
- index: 0,
1050
- merge: u
1051
- });
1052
- break;
1053
- }
1054
- case 3: {
1055
- const r = st(t, i, t.schema.exact.mapping, t.schema.prefix.mapping, "tag:yaml.org,2002:map", "mapping"), o = r.tag.create(r.tagName), l = yn(t, i, o, r.tag, r.tag.carrierIsResult);
1056
- t.frames.push({
1057
- kind: "mapping",
1058
- position: t.position,
1059
- value: o,
1060
- tag: r.tag,
1061
- anchor: l,
1062
- key: void 0,
1063
- keyPosition: t.position,
1064
- hasKey: !1,
1065
- overridable: null
1066
- });
1067
- break;
1068
- }
1069
- case 5: {
1070
- t.maxAliases !== -1 && ++t.aliasCount > t.maxAliases && j(t, `aliases exceeded maxAliases (${t.maxAliases})`);
1071
- const r = t.source.slice(i.anchorStart, i.anchorEnd), o = t.anchors.get(r);
1072
- o || j(t, `unidentified alias "${r}"`), o.isValueFinal || j(t, `recursive alias "${r}" is not supported for tag ${o.tag.tagName} because it uses finalize()`), gn(t, o.value, o.tag);
1073
- break;
1074
- }
1075
- case 6: {
1076
- const r = t.frames.pop();
1077
- if (r.kind === "document") t.documents.push(r.value);
1078
- else {
1079
- const o = r.tag.carrierIsResult ? r.value : Ot(t, r.position, r.tag, r.value);
1080
- r.anchor && (r.anchor.value = o, r.anchor.isValueFinal = !0), gn(t, o, r.tag);
1081
- }
1082
- break;
1083
- }
1084
- }
1085
- }
1086
- return t.documents;
1087
- }
1088
- var w = -1, Pt = Object.prototype.hasOwnProperty, ie = 1, An = 2, Mt = 3, Qe = 4, ro = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, oo = /[,\[\]{}]/, Ut = /^(?:!|!!|![0-9A-Za-z-]+!)$/, Cn = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`, qt = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`, lo = new RegExp(`^(?:${Cn})*$`), ao = new RegExp(`^(?:${qt})+$`), so = new RegExp(`^(?:!(?:${Cn})*|${qt}(?:${Cn})*)$`), Mn = {
1089
- filename: "",
1090
- maxDepth: 100
1091
- };
1092
- function uo(e, n, t) {
1093
- e.events.push({
1094
- type: 1,
1095
- explicitStart: n,
1096
- explicitEnd: t,
1097
- directives: e.directives
1098
- });
1099
- }
1100
- function Vt(e, n, t, i, r, o, l) {
1101
- e.events.push({
1102
- type: 2,
1103
- start: n,
1104
- anchorStart: t,
1105
- anchorEnd: i,
1106
- tagStart: r,
1107
- tagEnd: o,
1108
- style: l
1109
- });
1110
- }
1111
- function Ee(e, n, t, i, r, o, l) {
1112
- e.events.push({
1113
- type: 3,
1114
- start: n,
1115
- anchorStart: t,
1116
- anchorEnd: i,
1117
- tagStart: r,
1118
- tagEnd: o,
1119
- style: l
1120
- });
1121
- }
1122
- function Ae(e, n, t, i, r, o, l, a, u = 1, s = -1, c = !1) {
1123
- e.events.push({
1124
- type: 4,
1125
- valueStart: n,
1126
- valueEnd: t,
1127
- anchorStart: i,
1128
- anchorEnd: r,
1129
- tagStart: o,
1130
- tagEnd: l,
1131
- style: a,
1132
- chomping: u,
1133
- indent: s,
1134
- fast: c
1135
- });
1136
- }
1137
- function co(e, n, t) {
1138
- e.events.push({
1139
- type: 5,
1140
- anchorStart: n,
1141
- anchorEnd: t
1142
- });
1143
- }
1144
- function xe(e) {
1145
- e.events.push({ type: 6 });
1146
- }
1147
- function Y(e) {
1148
- Ae(e, w, w, w, w, w, w, 1);
1149
- }
1150
- function ct() {
1151
- return {
1152
- anchorStart: w,
1153
- anchorEnd: w,
1154
- tagStart: w,
1155
- tagEnd: w
1156
- };
1157
- }
1158
- function Ie(e) {
1159
- return {
1160
- position: e.position,
1161
- line: e.line,
1162
- lineStart: e.lineStart,
1163
- lineIndent: e.lineIndent,
1164
- firstTabInLine: e.firstTabInLine,
1165
- eventsLength: e.events.length
1166
- };
1167
- }
1168
- function oe(e, n) {
1169
- e.position = n.position, e.line = n.line, e.lineStart = n.lineStart, e.lineIndent = n.lineIndent, e.firstTabInLine = n.firstTabInLine, e.events.length = n.eventsLength;
1170
- }
1171
- function x(e, n) {
1172
- rn(e.input.slice(0, e.length), e.position, n, e.filename);
1173
- }
1174
- function F(e) {
1175
- return e === 10 || e === 13;
1176
- }
1177
- function pe(e) {
1178
- return e === 9 || e === 32;
1179
- }
1180
- function Q(e) {
1181
- return pe(e) || F(e);
1182
- }
1183
- function Z(e) {
1184
- return e === 0 || Q(e);
1185
- }
1186
- function me(e) {
1187
- return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
1188
- }
1189
- function fo(e) {
1190
- return e >= 48 && e <= 57 ? e - 48 : -1;
1191
- }
1192
- function po(e) {
1193
- if (e >= 48 && e <= 57) return e - 48;
1194
- const n = e | 32;
1195
- return n >= 97 && n <= 102 ? n - 97 + 10 : -1;
1196
- }
1197
- function mo(e) {
1198
- return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
1199
- }
1200
- function ho(e) {
1201
- return e === 48 || e === 97 || e === 98 || e === 116 || e === 9 || e === 110 || e === 118 || e === 102 || e === 114 || e === 101 || e === 32 || e === 34 || e === 47 || e === 92 || e === 78 || e === 95 || e === 76 || e === 80;
1202
- }
1203
- function Je(e) {
1204
- e.input.charCodeAt(e.position) === 10 ? e.position++ : (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++), e.line++, e.lineStart = e.position, e.lineIndent = 0, e.firstTabInLine = -1;
1205
- }
1206
- function V(e, n) {
1207
- let t = 0, i = e.input.charCodeAt(e.position), r = e.position === e.lineStart || Q(e.input.charCodeAt(e.position - 1));
1208
- for (; i !== 0; ) {
1209
- for (; pe(i); )
1210
- r = !0, i === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), i = e.input.charCodeAt(++e.position);
1211
- if (n && r && i === 35) do
1212
- i = e.input.charCodeAt(++e.position);
1213
- while (!F(i) && i !== 0);
1214
- if (!F(i)) break;
1215
- for (Je(e), t++, r = !0, i = e.input.charCodeAt(e.position); i === 32; )
1216
- e.lineIndent++, i = e.input.charCodeAt(++e.position);
1217
- }
1218
- return t;
1219
- }
1220
- function le(e, n = e.position) {
1221
- const t = e.input.charCodeAt(n);
1222
- if ((t === 45 || t === 46) && t === e.input.charCodeAt(n + 1) && t === e.input.charCodeAt(n + 2)) {
1223
- const i = e.input.charCodeAt(n + 3);
1224
- return i === 0 || Q(i);
1225
- }
1226
- return !1;
1227
- }
1228
- function ft(e) {
1229
- let n = e.input.charCodeAt(e.position);
1230
- for (; n !== 0 && !F(n); ) n = e.input.charCodeAt(++e.position);
1231
- }
1232
- function Bt(e, n, t) {
1233
- ro.test(e.input.slice(n, t)) && x(e, "the stream contains non-printable characters");
1234
- }
1235
- function go(e, n, t) {
1236
- if (e.input.charCodeAt(e.position) !== 33) return !1;
1237
- n.tagStart !== w && x(e, "duplication of a tag property");
1238
- const i = e.position;
1239
- let r = !1, o = !1, l = "!", a = e.input.charCodeAt(++e.position);
1240
- a === 60 ? (r = !0, a = e.input.charCodeAt(++e.position)) : a === 33 && (o = !0, l = "!!", a = e.input.charCodeAt(++e.position));
1241
- let u = e.position, s;
1242
- if (r) {
1243
- for (; a !== 0 && a !== 62; ) a = e.input.charCodeAt(++e.position);
1244
- a !== 62 && x(e, "unexpected end of the stream within a verbatim tag"), s = e.input.slice(u, e.position), e.position++;
1245
- } else {
1246
- for (; a !== 0 && !Q(a) && !(t && me(a)); )
1247
- a === 33 && (o ? x(e, "tag suffix cannot contain exclamation marks") : (l = e.input.slice(u - 1, e.position + 1), Ut.test(l) || x(e, "named tag handle cannot contain such characters"), o = !0, u = e.position + 1)), a = e.input.charCodeAt(++e.position);
1248
- s = e.input.slice(u, e.position), oo.test(s) && x(e, "tag suffix cannot contain flow indicator characters");
1249
- }
1250
- return s && !(r ? lo.test(s) : ao.test(s)) && x(e, `tag name cannot contain such characters: ${s}`), !r && l !== "!" && l !== "!!" && !Pt.call(e.tagHandlers, l) && x(e, `undeclared tag handle "${l}"`), n.tagStart = i, n.tagEnd = e.position, !0;
1251
- }
1252
- function yo(e, n) {
1253
- if (e.input.charCodeAt(e.position) !== 38) return !1;
1254
- n.anchorStart !== w && x(e, "duplication of an anchor property"), e.position++;
1255
- const t = e.position;
1256
- for (; e.input.charCodeAt(e.position) !== 0 && !Q(e.input.charCodeAt(e.position)) && !me(e.input.charCodeAt(e.position)); ) e.position++;
1257
- return e.position === t && x(e, "name of an anchor node must contain at least one character"), n.anchorStart = t, n.anchorEnd = e.position, !0;
1258
- }
1259
- function vo(e, n) {
1260
- if (e.input.charCodeAt(e.position) !== 42) return !1;
1261
- (n.anchorStart !== w || n.tagStart !== w) && x(e, "alias node should not have any properties"), e.position++;
1262
- const t = e.position;
1263
- for (; e.input.charCodeAt(e.position) !== 0 && !Q(e.input.charCodeAt(e.position)) && !me(e.input.charCodeAt(e.position)); ) e.position++;
1264
- return e.position === t && x(e, "name of an alias node must contain at least one character"), co(e, t, e.position), !0;
1265
- }
1266
- function wn(e, n) {
1267
- V(e, !1), e.lineIndent < n && x(e, "deficient indentation");
1268
- }
1269
- function bo(e, n, t) {
1270
- if (e.input.charCodeAt(e.position) !== 39) return !1;
1271
- e.position++;
1272
- const i = e.position;
1273
- let r = !0;
1274
- for (; e.input.charCodeAt(e.position) !== 0; ) {
1275
- const o = e.input.charCodeAt(e.position);
1276
- if (o === 39) {
1277
- if (e.input.charCodeAt(e.position + 1) === 39) {
1278
- r = !1, e.position += 2;
1279
- continue;
1280
- }
1281
- const l = e.position;
1282
- return e.position++, Ae(e, i, l, t.anchorStart, t.anchorEnd, t.tagStart, t.tagEnd, 2, 1, -1, r), !0;
1283
- }
1284
- F(o) ? (r = !1, wn(e, n)) : e.position === e.lineStart && le(e) ? x(e, "unexpected end of the document within a single quoted scalar") : o !== 9 && o < 32 ? x(e, "expected valid JSON character") : e.position++;
1285
- }
1286
- x(e, "unexpected end of the stream within a single quoted scalar");
1287
- }
1288
- function xo(e, n, t) {
1289
- if (e.input.charCodeAt(e.position) !== 34) return !1;
1290
- e.position++;
1291
- const i = e.position;
1292
- let r = !0;
1293
- for (; e.input.charCodeAt(e.position) !== 0; ) {
1294
- const o = e.input.charCodeAt(e.position);
1295
- if (o === 34) {
1296
- const l = e.position;
1297
- return e.position++, Ae(e, i, l, t.anchorStart, t.anchorEnd, t.tagStart, t.tagEnd, 3, 1, -1, r), !0;
1298
- }
1299
- if (o === 92) {
1300
- r = !1;
1301
- const l = e.input.charCodeAt(++e.position);
1302
- if (F(l)) wn(e, n);
1303
- else if (ho(l)) e.position++;
1304
- else {
1305
- let a = mo(l);
1306
- for (a === 0 && x(e, "unknown escape sequence"); a-- > 0; )
1307
- e.position++, po(e.input.charCodeAt(e.position)) < 0 && x(e, "expected hexadecimal character");
1308
- e.position++;
1309
- }
1310
- } else F(o) ? (r = !1, wn(e, n)) : e.position === e.lineStart && le(e) ? x(e, "unexpected end of the document within a double quoted scalar") : o !== 9 && o < 32 ? x(e, "expected valid JSON character") : e.position++;
1311
- }
1312
- x(e, "unexpected end of the stream within a double quoted scalar");
1313
- }
1314
- function So(e, n, t) {
1315
- const i = e.input.charCodeAt(e.position);
1316
- let r = 1, o = -1, l = !1;
1317
- if (i !== 124 && i !== 62) return !1;
1318
- const a = i === 124 ? 4 : 5;
1319
- for (e.position++; e.input.charCodeAt(e.position) !== 0; ) {
1320
- const b = e.input.charCodeAt(e.position), p = fo(b);
1321
- if (b === 43 || b === 45)
1322
- r !== 1 && x(e, "repeat of a chomping mode identifier"), r = b === 43 ? 3 : 2, e.position++;
1323
- else if (p >= 0)
1324
- p === 0 && x(e, "bad explicit indentation width of a block scalar; it cannot be less than one"), l && x(e, "repeat of an indentation width identifier"), o = n + p - 1, l = !0, e.position++;
1325
- else break;
1326
- }
1327
- let u = !1;
1328
- for (; pe(e.input.charCodeAt(e.position)); )
1329
- u = !0, e.position++;
1330
- u && e.input.charCodeAt(e.position) === 35 && ft(e), F(e.input.charCodeAt(e.position)) ? Je(e) : e.input.charCodeAt(e.position) !== 0 && x(e, "a line break is expected");
1331
- let s = l ? o : -1, c = 0;
1332
- const y = e.position;
1333
- let m = e.position;
1334
- for (; e.input.charCodeAt(e.position) !== 0; ) {
1335
- const b = e.position;
1336
- let p = 0;
1337
- for (; e.input.charCodeAt(b + p) === 32; ) p++;
1338
- const h = e.input.charCodeAt(b + p);
1339
- if (h === 0) {
1340
- s >= 0 ? p > s && (m = b + p) : p > 0 && (m = b + p);
1341
- break;
1342
- }
1343
- if (b === e.lineStart && le(e, b)) break;
1344
- if (!l && s === -1 && F(h) && (c = Math.max(c, p)), !l && s === -1 && !F(h) && (h === 9 && p < n && (e.position = b + p, x(e, "tab characters must not be used in indentation")), p < c && (e.position = b + p, x(e, "bad indentation of a mapping entry"))), s === -1 && h !== 0 && !F(h) && p < n) {
1345
- e.lineIndent = p, e.position = b + p;
1346
- break;
1347
- }
1348
- !l && h !== 0 && !F(h) && s === -1 && (s = p);
1349
- const v = s === -1 ? n + 1 : s;
1350
- if (h !== 0 && !F(h) && p < v) {
1351
- e.lineIndent = p, e.position = b + p;
1352
- break;
1353
- }
1354
- ft(e), m = e.position, F(e.input.charCodeAt(e.position)) && (Je(e), m = e.position);
1355
- }
1356
- return Bt(e, y, m), Ae(e, y, m, t.anchorStart, t.anchorEnd, t.tagStart, t.tagEnd, a, r, s), !0;
1357
- }
1358
- function ko(e, n) {
1359
- const t = e.input.charCodeAt(e.position), i = n === ie;
1360
- if (t === 0 || Q(t) || t === 35 || t === 38 || t === 42 || t === 33 || t === 124 || t === 62 || t === 39 || t === 34 || t === 37 || t === 64 || t === 96 || i && me(t)) return !1;
1361
- if (t === 63 || t === 45) {
1362
- const r = e.input.charCodeAt(e.position + 1);
1363
- if (Z(r) || i && me(r)) return !1;
1364
- }
1365
- return !0;
1366
- }
1367
- function Ao(e, n, t, i) {
1368
- if (!ko(e, t)) return !1;
1369
- const r = e.position;
1370
- let o = e.position, l = e.input.charCodeAt(e.position);
1371
- const a = t === ie;
1372
- let u = !1;
1373
- for (; l !== 0 && !(e.position === e.lineStart && le(e)); ) {
1374
- if (l === 58) {
1375
- const s = e.input.charCodeAt(e.position + 1);
1376
- if (Z(s) || a && me(s)) break;
1377
- } else if (l === 35) {
1378
- if (Q(e.input.charCodeAt(e.position - 1))) break;
1379
- } else {
1380
- if (a && me(l)) break;
1381
- if (F(l)) {
1382
- const s = e.position, c = e.line, y = e.lineStart, m = e.lineIndent;
1383
- if (V(e, !1), e.lineIndent >= n) {
1384
- u = !0, l = e.input.charCodeAt(e.position);
1385
- continue;
1386
- }
1387
- e.position = s, e.line = c, e.lineStart = y, e.lineIndent = m;
1388
- break;
1389
- }
1390
- }
1391
- pe(l) || (o = e.position + 1), l = e.input.charCodeAt(++e.position);
1392
- }
1393
- return o === r ? !1 : (Bt(e, r, o), Ae(e, r, o, i.anchorStart, i.anchorEnd, i.tagStart, i.tagEnd, 1, 1, -1, !u), !0);
1394
- }
1395
- function ce(e, n) {
1396
- const t = e.line;
1397
- V(e, !0), (e.line > t && e.lineIndent < n || e.firstTabInLine !== -1 && e.lineIndent < n) && x(e, "deficient indentation");
1398
- }
1399
- function Co(e, n, t) {
1400
- const i = e.input.charCodeAt(e.position), r = i === 123, o = e.position;
1401
- let l = !0;
1402
- if (i !== 91 && i !== 123) return !1;
1403
- const a = r ? 125 : 93;
1404
- for (r ? Ee(e, o, t.anchorStart, t.anchorEnd, t.tagStart, t.tagEnd, 2) : Vt(e, o, t.anchorStart, t.anchorEnd, t.tagStart, t.tagEnd, 2), e.position++; e.input.charCodeAt(e.position) !== 0; ) {
1405
- ce(e, n);
1406
- let u = e.input.charCodeAt(e.position);
1407
- if (u === a)
1408
- return e.position++, xe(e), !0;
1409
- l ? u === 44 && x(e, "expected the node content, but found ','") : x(e, "missed comma between flow collection entries");
1410
- let s = !1, c = !1;
1411
- u === 63 && Q(e.input.charCodeAt(e.position + 1)) && (s = c = !0, e.position += 1, ce(e, n));
1412
- const y = e.line, m = Ie(e), b = ee(e, n, ie, !1, !0);
1413
- ce(e, n), u = e.input.charCodeAt(e.position), (r || c || e.line === y) && u === 58 ? (s = !0, e.position++, ce(e, n), r ? b || Y(e) : (oe(e, m), Ee(e, m.position, w, w, w, w, 2), ee(e, n, ie, !1, !0) || Y(e), ce(e, n), e.position++, ce(e, n)), ee(e, n, ie, !1, !0) || Y(e), ce(e, n), r || xe(e)) : r && s ? (b || Y(e), Y(e)) : r ? Y(e) : s && (oe(e, m), Ee(e, m.position, w, w, w, w, 2), ee(e, n, ie, !1, !0), Y(e), xe(e)), u = e.input.charCodeAt(e.position), u === 44 ? (l = !0, e.position++) : l = !1;
1414
- }
1415
- x(e, "unexpected end of the stream within a flow collection");
1416
- }
1417
- function dt(e, n, t) {
1418
- if (e.firstTabInLine !== -1 || e.input.charCodeAt(e.position) !== 45 || !Z(e.input.charCodeAt(e.position + 1))) return !1;
1419
- for (Vt(e, e.position, t.anchorStart, t.anchorEnd, t.tagStart, t.tagEnd, 1); e.input.charCodeAt(e.position) === 45 && Z(e.input.charCodeAt(e.position + 1)); ) {
1420
- e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, x(e, "tab characters must not be used in indentation"));
1421
- const i = e.line;
1422
- e.position++;
1423
- const r = V(e, !0) > 0;
1424
- if (e.firstTabInLine !== -1 && e.input.charCodeAt(e.position) === 45 && Z(e.input.charCodeAt(e.position + 1)) && x(e, "bad indentation of a sequence entry"), r && e.lineIndent <= n ? Y(e) : ee(e, n, Mt, !1, !0), V(e, !0), e.lineIndent < n || e.position >= e.length) break;
1425
- e.lineIndent > n && x(e, "bad indentation of a sequence entry"), e.line === i && e.input.charCodeAt(e.position) === 45 && Z(e.input.charCodeAt(e.position + 1)) && x(e, "bad indentation of a sequence entry");
1426
- }
1427
- return xe(e), !0;
1428
- }
1429
- function vn(e, n, t, i) {
1430
- let r = !1, o = !1, l = !1, a = !1;
1431
- if (e.firstTabInLine !== -1) return !1;
1432
- let u = e.input.charCodeAt(e.position);
1433
- for (; u !== 0; ) {
1434
- !r && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, x(e, "tab characters must not be used in indentation"));
1435
- const s = e.input.charCodeAt(e.position + 1), c = e.line;
1436
- if ((u === 63 || u === 58) && Z(s))
1437
- l || (Ee(e, e.position, i.anchorStart, i.anchorEnd, i.tagStart, i.tagEnd, 1), l = !0), u === 63 ? (r && Y(e), o = !0, r = !0) : (r || (Y(e), o = !0), r = !1), e.position += 1, a = !0;
1438
- else {
1439
- r && (Y(e), r = !1);
1440
- const y = Ie(e);
1441
- if (!ee(e, t, An, !1, !0)) break;
1442
- if (e.line === c) {
1443
- for (u = e.input.charCodeAt(e.position); pe(u); ) u = e.input.charCodeAt(++e.position);
1444
- if (u === 58) {
1445
- if (u = e.input.charCodeAt(++e.position), Z(u) || x(e, "a whitespace character is expected after the key-value separator within a block mapping"), !l) {
1446
- for (oe(e, y), Ee(e, y.position, i.anchorStart, i.anchorEnd, i.tagStart, i.tagEnd, 1), l = !0, ee(e, t, An, !1, !0), u = e.input.charCodeAt(e.position); pe(u); ) u = e.input.charCodeAt(++e.position);
1447
- e.position++;
1448
- }
1449
- o = !0, r = !1, a = !1;
1450
- } else if (o) x(e, "expected ':' after a mapping key");
1451
- else
1452
- return i.anchorStart !== w || i.tagStart !== w ? (oe(e, y), !1) : !0;
1453
- } else if (o) x(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
1454
- else
1455
- return i.anchorStart !== w || i.tagStart !== w ? (oe(e, y), !1) : !0;
1456
- }
1457
- if (ee(e, n, Qe, !0, a) && (a = !1), r || a && (Y(e), a = !1), V(e, !0), u = e.input.charCodeAt(e.position), (e.line === c || e.lineIndent > n) && u !== 0) x(e, "bad indentation of a mapping entry");
1458
- else if (e.lineIndent < n) break;
1459
- }
1460
- return o ? (r && Y(e), l && xe(e), !0) : !1;
1461
- }
1462
- function ee(e, n, t, i, r, o = !0) {
1463
- var p, h;
1464
- e.depth >= e.maxDepth && x(e, `nesting exceeded maxDepth (${e.maxDepth})`), e.depth++;
1465
- let l = 1, a = !1, u = !1, s = null;
1466
- const c = ct();
1467
- let y = t === Qe || t === Mt, m = y;
1468
- const b = y;
1469
- if (i && V(e, !0) && (a = !0, e.lineIndent > n ? l = 1 : e.lineIndent === n ? l = 0 : l = -1), e.position === e.lineStart && le(e))
1470
- return e.depth--, !1;
1471
- if (l === 1) for (; ; ) {
1472
- const v = e.input.charCodeAt(e.position), k = Ie(e);
1473
- if (a && l !== 1 && (v === 33 || v === 38)) break;
1474
- if (a && b && (c.tagStart !== w || c.anchorStart !== w) && (v === 33 || v === 38)) {
1475
- const C = Ie(e), R = n + 1;
1476
- if (vn(e, e.position - e.lineStart, R, c) && ((p = e.events[C.eventsLength]) == null ? void 0 : p.type) === 3)
1477
- return e.depth--, !0;
1478
- oe(e, C);
1479
- }
1480
- if (a && (v === 33 && c.tagStart !== w || v === 38 && c.anchorStart !== w) || !go(e, c, t === ie) && !yo(e, c)) break;
1481
- s === null && (s = k), V(e, !0) ? (a = !0, m = b, e.lineIndent > n ? l = 1 : e.lineIndent === n ? l = 0 : l = -1) : m = !1;
1482
- }
1483
- if (m && (m = a || r), l === 1 || t === Qe) {
1484
- const v = t === ie || t === An ? n : n + 1, k = e.position - e.lineStart;
1485
- if (l === 1) if (m && (dt(e, k, c) || vn(e, k, v, c)) || Co(e, v, c)) u = !0;
1486
- else {
1487
- const C = e.input.charCodeAt(e.position);
1488
- if (s !== null && o && b && !m && C !== 124 && C !== 62) {
1489
- const R = Ie(e), B = s.position - s.lineStart;
1490
- oe(e, s), vn(e, B, v, ct()) && ((h = e.events[R.eventsLength]) == null ? void 0 : h.type) === 3 ? u = !0 : oe(e, R);
1491
- }
1492
- !u && (y && So(e, v, c) || bo(e, v, c) || xo(e, v, c) || vo(e, c) || Ao(e, v, t, c)) && (u = !0);
1493
- }
1494
- else l === 0 && (u = m && dt(e, k, c));
1495
- }
1496
- return y = y && !u, !u && (c.anchorStart !== w || c.tagStart !== w || y) && (Ae(e, w, w, c.anchorStart, c.anchorEnd, c.tagStart, c.tagEnd, 1), u = !0), e.depth--, u || c.anchorStart !== w || c.tagStart !== w;
1497
- }
1498
- function wo(e) {
1499
- if (e.lineIndent > 0 || e.input.charCodeAt(e.position) !== 37) return !1;
1500
- e.position++;
1501
- const n = e.position;
1502
- for (; e.input.charCodeAt(e.position) !== 0 && !Q(e.input.charCodeAt(e.position)); ) e.position++;
1503
- const t = e.input.slice(n, e.position), i = [];
1504
- for (t.length === 0 && x(e, "directive name must not be less than one character in length"); e.input.charCodeAt(e.position) !== 0 && !F(e.input.charCodeAt(e.position)); ) {
1505
- for (; pe(e.input.charCodeAt(e.position)); ) e.position++;
1506
- if (e.input.charCodeAt(e.position) === 35 || F(e.input.charCodeAt(e.position)) || e.input.charCodeAt(e.position) === 0) break;
1507
- const r = e.position;
1508
- for (; e.input.charCodeAt(e.position) !== 0 && !Q(e.input.charCodeAt(e.position)); ) e.position++;
1509
- i.push(e.input.slice(r, e.position));
1510
- }
1511
- if (F(e.input.charCodeAt(e.position)) && Je(e), t === "YAML") {
1512
- e.directives.some((o) => o.kind === "yaml") && x(e, "duplication of %YAML directive"), i.length !== 1 && x(e, "YAML directive accepts exactly one argument");
1513
- const r = /^([0-9]+)\.([0-9]+)$/.exec(i[0]);
1514
- r === null && x(e, "ill-formed argument of the YAML directive"), parseInt(r[1], 10) !== 1 && x(e, "unacceptable YAML version of the document"), e.directives.push({
1515
- kind: "yaml",
1516
- version: i[0]
1517
- });
1518
- } else if (t === "TAG") {
1519
- i.length !== 2 && x(e, "TAG directive accepts exactly two arguments");
1520
- const [r, o] = i;
1521
- Ut.test(r) || x(e, "ill-formed tag handle (first argument) of the TAG directive"), Pt.call(e.tagHandlers, r) && x(e, `there is a previously declared suffix for "${r}" tag handle`), so.test(o) || x(e, "ill-formed tag prefix (second argument) of the TAG directive"), e.tagHandlers[r] = o, e.directives.push({
1522
- kind: "tag",
1523
- handle: r,
1524
- prefix: o
1525
- });
1526
- }
1527
- return !0;
1528
- }
1529
- function To(e) {
1530
- e.directives = [], e.tagHandlers = /* @__PURE__ */ Object.create(null);
1531
- let n = !1;
1532
- for (V(e, !0); wo(e); )
1533
- n = !0, V(e, !0);
1534
- let t = !1, i = !1, r = !0;
1535
- if (e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 && Z(e.input.charCodeAt(e.position + 3))) {
1536
- t = !0;
1537
- const a = e.line;
1538
- e.position += 3, V(e, !0), r = e.line > a;
1539
- } else n && x(e, "directives end mark is expected");
1540
- const o = e.events.length;
1541
- if (!t && e.position === e.lineStart && e.input.charCodeAt(e.position) === 46 && le(e)) {
1542
- e.position += 3, V(e, !0);
1543
- return;
1544
- }
1545
- if (uo(e, t, !1), ee(e, e.lineIndent - 1, Qe, !1, r, r) || Y(e), V(e, !0), e.position === e.lineStart && le(e) && (i = e.input.charCodeAt(e.position) === 46, i)) {
1546
- const a = e.line;
1547
- e.position += 3, V(e, !0), e.line === a && e.position < e.length && x(e, "end of the stream or a document separator is expected");
1548
- }
1549
- const l = e.events[o];
1550
- (l == null ? void 0 : l.type) === 1 && (l.explicitEnd = i), xe(e), !i && e.position < e.length && !(e.position === e.lineStart && le(e)) && x(e, "end of the stream or a document separator is expected");
1551
- }
1552
- function _o(e, n) {
1553
- const t = e.length, i = {
1554
- ...Mn,
1555
- ...n,
1556
- input: `${e}\0`,
1557
- length: t,
1558
- position: 0,
1559
- line: 0,
1560
- lineStart: 0,
1561
- lineIndent: 0,
1562
- firstTabInLine: -1,
1563
- depth: 0,
1564
- directives: [],
1565
- tagHandlers: /* @__PURE__ */ Object.create(null),
1566
- events: []
1567
- }, r = e.indexOf("\0");
1568
- for (r !== -1 && rn(e, r, "null byte is not allowed in input", i.filename), i.input.charCodeAt(i.position) === 65279 && i.position++; i.position < i.length && (V(i, !0), !(i.position >= i.length)); ) {
1569
- const o = i.position;
1570
- To(i), i.position === o && x(i, "can not read a document");
1571
- }
1572
- return i.events;
1573
- }
1574
- var Eo = {
1575
- ...Mn,
1576
- ...Pn
1577
- };
1578
- function Io(e, n = {}) {
1579
- const t = {
1580
- ...Eo,
1581
- ...n
1582
- }, i = String(e), r = Object.keys(Mn), o = Object.keys(Pn);
1583
- return io(_o(i, kn(t, r)), {
1584
- ...kn(t, o),
1585
- source: i
1586
- });
1587
- }
1588
- function Dt(e, n) {
1589
- const t = Io(e, n);
1590
- if (t.length === 0) throw new Le("expected a document, but the input is empty");
1591
- if (t.length === 1) return t[0];
1592
- throw new Le("expected a single document in the stream, but found more");
1593
- }
1594
- var De = class {
1595
- constructor() {
1596
- L(this, "tagged", !1);
1597
- L(this, "flow", !1);
1598
- L(this, "singleQuoted", !1);
1599
- L(this, "doubleQuoted", !1);
1600
- L(this, "literal", !1);
1601
- L(this, "folded", !1);
1602
- }
1603
- }, de = Symbol("INVALID");
1604
- function No(e) {
1605
- const n = new Set([
1606
- e.defaultScalarTag,
1607
- e.defaultSequenceTag,
1608
- e.defaultMappingTag
1609
- ].filter((o) => o !== void 0)), t = e.implicitScalarTags, i = e.tags.filter((o) => !(o.nodeKind === "scalar" && o.implicit) && !n.has(o)), r = e.tags.filter((o) => n.has(o));
1610
- return [
1611
- ...t.map((o) => ({
1612
- tag: o,
1613
- implicitTag: !0
1614
- })),
1615
- ...i.map((o) => ({
1616
- tag: o,
1617
- implicitTag: !1
1618
- })),
1619
- ...r.map((o) => ({
1620
- tag: o,
1621
- implicitTag: !0
1622
- }))
1623
- ];
1624
- }
1625
- function $o(e, n) {
1626
- for (let t = 0, i = e.representTypes.length; t < i; t += 1) {
1627
- const { tag: r, implicitTag: o } = e.representTypes[t];
1628
- if (r.identify && r.identify(n)) {
1629
- let l;
1630
- return r.matchByTagPrefix && r.representTagName ? l = r.representTagName(n) : l = r.tagName, {
1631
- tag: r,
1632
- tagName: l,
1633
- implicitTag: o
1634
- };
1635
- }
1636
- }
1637
- return null;
1638
- }
1639
- function Te(e, n) {
1640
- if (!e.noRefs && n !== null && typeof n == "object") {
1641
- const c = e.refs.get(n);
1642
- if (c)
1643
- return c.anchor === void 0 && (c.anchor = `ref_${e.refCounter++}`), {
1644
- kind: "alias",
1645
- tag: "",
1646
- style: new De(),
1647
- anchor: c.anchor
1648
- };
1649
- }
1650
- const t = $o(e, n);
1651
- if (!t) {
1652
- if (n === void 0 || e.skipInvalid) return de;
1653
- throw new Le(`unacceptable kind of an object to dump ${Object.prototype.toString.call(n)}`);
1654
- }
1655
- const { tag: i, tagName: r, implicitTag: o } = t, l = o ? r : Ft(r);
1656
- if (i.nodeKind === "scalar") {
1657
- const c = new De();
1658
- return c.tagged = !o, {
1659
- kind: "scalar",
1660
- tag: l,
1661
- style: c,
1662
- value: i.represent(n)
1663
- };
1664
- }
1665
- if (i.nodeKind === "sequence") {
1666
- const c = i.represent(n), y = new De();
1667
- y.tagged = !o;
1668
- const m = {
1669
- kind: "sequence",
1670
- tag: l,
1671
- style: y,
1672
- items: []
1673
- };
1674
- e.noRefs || e.refs.set(n, m);
1675
- for (let b = 0, p = c.length; b < p; b += 1) {
1676
- let h = Te(e, c[b]);
1677
- h === de && c[b] === void 0 && (h = Te(e, null)), h !== de && m.items.push(h);
1678
- }
1679
- return m;
1680
- }
1681
- const a = i.represent(n), u = new De();
1682
- u.tagged = !o;
1683
- const s = {
1684
- kind: "mapping",
1685
- tag: l,
1686
- style: u,
1687
- items: []
1688
- };
1689
- e.noRefs || e.refs.set(n, s);
1690
- for (const [c, y] of a) {
1691
- const m = Te(e, c);
1692
- if (m === de) continue;
1693
- const b = Te(e, y);
1694
- b !== de && s.items.push({
1695
- key: m,
1696
- value: b
1697
- });
1698
- }
1699
- return s;
1700
- }
1701
- function Lo(e, n, t = {}) {
1702
- const i = Te({
1703
- representTypes: No(n),
1704
- noRefs: t.noRefs ?? !1,
1705
- skipInvalid: t.skipInvalid ?? !1,
1706
- refs: /* @__PURE__ */ new Map(),
1707
- refCounter: 0
1708
- }, e);
1709
- return [{
1710
- contents: i === de ? null : i,
1711
- directives: []
1712
- }];
1713
- }
1714
- var Fo = Symbol("visit:break"), Yt = Symbol("visit:skip");
1715
- function He(e, n, t) {
1716
- const i = n(e, t);
1717
- if (i === Fo) return !0;
1718
- if (i === Yt) return !1;
1719
- const r = t.depth + 1;
1720
- switch (e.kind) {
1721
- case "sequence":
1722
- for (const o of e.items) if (He(o, n, {
1723
- depth: r,
1724
- parent: e,
1725
- isKey: !1
1726
- })) return !0;
1727
- break;
1728
- case "mapping":
1729
- for (const { key: o, value: l } of e.items)
1730
- if (He(o, n, {
1731
- depth: r,
1732
- parent: e,
1733
- isKey: !0
1734
- }) || He(l, n, {
1735
- depth: r,
1736
- parent: e,
1737
- isKey: !1
1738
- })) return !0;
1739
- break;
1740
- }
1741
- return !1;
1742
- }
1743
- function Oo(e, n) {
1744
- for (const t of e) if (t.contents && He(t.contents, n, {
1745
- depth: 0,
1746
- parent: null,
1747
- isKey: !1
1748
- })) return;
1749
- }
1750
- var Un = 65279, Ro = 9, he = 10, jt = 13, Po = 32, Mo = 33, Kt = 34, Tn = 35, Uo = 37, qo = 38, Ht = 39, Vo = 42, zt = 44, qn = 45, Fe = 58, Bo = 61, Do = 62, Gt = 63, Yo = 64, Wt = 91, Qt = 93, jo = 96, Jt = 123, Ko = 124, Xt = 125, q = {};
1751
- q[0] = "\\0";
1752
- q[7] = "\\a";
1753
- q[8] = "\\b";
1754
- q[9] = "\\t";
1755
- q[10] = "\\n";
1756
- q[11] = "\\v";
1757
- q[12] = "\\f";
1758
- q[13] = "\\r";
1759
- q[27] = "\\e";
1760
- q[34] = '\\"';
1761
- q[92] = "\\\\";
1762
- q[133] = "\\N";
1763
- q[160] = "\\_";
1764
- q[8232] = "\\L";
1765
- q[8233] = "\\P";
1766
- var Vn = {
1767
- indent: 2,
1768
- seqNoIndent: !1,
1769
- seqInlineFirst: !0,
1770
- sortKeys: !1,
1771
- lineWidth: 80,
1772
- flowBracketPadding: !1,
1773
- flowSkipCommaSpace: !1,
1774
- flowSkipColonSpace: !1,
1775
- quoteFlowKeys: !1,
1776
- quoteStyle: "single",
1777
- forceQuotes: !1,
1778
- tagBeforeAnchor: !1
1779
- };
1780
- function Ho(e) {
1781
- return e.style.tagged ? e.tag : Ft(e.tag);
1782
- }
1783
- function zo(e) {
1784
- const n = {
1785
- ...Vn,
1786
- ...e
1787
- };
1788
- return {
1789
- ...n,
1790
- defaultScalarTagName: n.schema.defaultScalarTag.tagName,
1791
- implicitResolvers: n.schema.implicitScalarTags
1792
- };
1793
- }
1794
- function Go(e) {
1795
- const n = e.toString(16).toUpperCase(), t = e <= 255 ? "x" : "u", i = e <= 255 ? 2 : 4;
1796
- return `\\${t}${"0".repeat(i - n.length)}${n}`;
1797
- }
1798
- function pt(e, n) {
1799
- const t = " ".repeat(n);
1800
- let i = 0, r = "";
1801
- const o = e.length;
1802
- for (; i < o; ) {
1803
- let l;
1804
- const a = e.indexOf(`
1805
- `, i);
1806
- a === -1 ? (l = e.slice(i), i = o) : (l = e.slice(i, a + 1), i = a + 1), l.length && l !== `
1807
- ` && (r += t), r += l;
1808
- }
1809
- return r;
1810
- }
1811
- function _n(e, n) {
1812
- return `
1813
- ${" ".repeat(e.indent * n)}`;
1814
- }
1815
- function Wo(e, n) {
1816
- const t = e.indent * Math.max(1, n);
1817
- return {
1818
- indent: t,
1819
- blockIndent: n === 0 ? e.indent + 1 : e.indent,
1820
- lineWidth: e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - t)
1821
- };
1822
- }
1823
- function mt(e, n) {
1824
- for (let t = 0, i = e.implicitResolvers.length; t < i; t += 1) {
1825
- const r = e.implicitResolvers[t];
1826
- if (r.resolve(n, !1, r.tagName) !== T) return r.tagName;
1827
- }
1828
- return e.defaultScalarTagName;
1829
- }
1830
- function ke(e) {
1831
- return e === Po || e === Ro;
1832
- }
1833
- function Qo(e) {
1834
- const n = e.charCodeAt(0);
1835
- if (n !== qn && n !== 46 || e.charCodeAt(1) !== n || e.charCodeAt(2) !== n) return !1;
1836
- if (e.length === 3) return !0;
1837
- const t = e.charCodeAt(3);
1838
- return ke(t) || t === jt || t === he;
1839
- }
1840
- function Oe(e) {
1841
- return e >= 32 && e <= 126 || e >= 161 && e <= 55295 && e !== 8232 && e !== 8233 || e >= 57344 && e <= 65533 && e !== Un || e >= 65536 && e <= 1114111;
1842
- }
1843
- function ht(e) {
1844
- return Oe(e) && e !== Un && e !== jt && e !== he;
1845
- }
1846
- function En(e, n, t) {
1847
- const i = ht(e), r = i && !ke(e);
1848
- return (t ? i : i && e !== zt && e !== Wt && e !== Qt && e !== Jt && e !== Xt) && e !== Tn && !(n === Fe && !r) || ht(n) && !ke(n) && e === Tn || n === Fe && r;
1849
- }
1850
- function Jo(e) {
1851
- return Oe(e) && e !== Un && !ke(e) && e !== qn && e !== Gt && e !== Fe && e !== zt && e !== Wt && e !== Qt && e !== Jt && e !== Xt && e !== Tn && e !== qo && e !== Vo && e !== Mo && e !== Ko && e !== Bo && e !== Do && e !== Ht && e !== Kt && e !== Uo && e !== Yo && e !== jo;
1852
- }
1853
- function Xo(e, n) {
1854
- const t = Se(e, 0);
1855
- if (Jo(t)) return !0;
1856
- if (e.length > 1 && (t === qn || t === Gt || t === Fe)) {
1857
- const i = Se(e, 1);
1858
- return !ke(i) && En(i, t, n);
1859
- }
1860
- return !1;
1861
- }
1862
- function Zo(e) {
1863
- return !ke(e) && e !== Fe;
1864
- }
1865
- function Se(e, n) {
1866
- const t = e.charCodeAt(n);
1867
- let i;
1868
- return t >= 55296 && t <= 56319 && n + 1 < e.length && (i = e.charCodeAt(n + 1), i >= 56320 && i <= 57343) ? (t - 55296) * 1024 + i - 56320 + 65536 : t;
1869
- }
1870
- function Zt(e) {
1871
- return /^\n* /.test(e);
1872
- }
1873
- var Re = 1, Ne = 2, Bn = 3, Dn = 4, re = 5;
1874
- function el(e, n, t, i, r, o) {
1875
- const { blockIndent: l, lineWidth: a } = t;
1876
- let u, s = 0, c = -1, y = !1, m = !1;
1877
- const b = a !== -1;
1878
- let p = -1, h = !Qo(n) && Xo(n, o) && Zo(Se(n, n.length - 1));
1879
- if (i || r) for (u = 0; u < n.length; s >= 65536 ? u += 2 : u++) {
1880
- if (s = Se(n, u), !Oe(s)) return re;
1881
- h = h && En(s, c, o), c = s;
1882
- }
1883
- else {
1884
- for (u = 0; u < n.length; s >= 65536 ? u += 2 : u++) {
1885
- if (s = Se(n, u), s === he)
1886
- y = !0, b && (m = m || u - p - 1 > a && n[p + 1] !== " ", p = u);
1887
- else if (!Oe(s)) return re;
1888
- h = h && En(s, c, o), c = s;
1889
- }
1890
- m = m || b && u - p - 1 > a && n[p + 1] !== " ";
1891
- }
1892
- return !y && !m ? h && !r ? Re : e.quoteStyle === "double" ? re : Ne : l > 9 && Zt(n) ? re : m ? Dn : Bn;
1893
- }
1894
- function nl(e, n, t) {
1895
- const { indent: i, blockIndent: r, lineWidth: o } = t;
1896
- switch (n) {
1897
- case Re:
1898
- return yt(e, i);
1899
- case Ne:
1900
- return `'${yt(e, i).replace(/'/g, "''")}'`;
1901
- case Bn:
1902
- return "|" + gt(e, r) + vt(pt(e, i));
1903
- case Dn:
1904
- return ">" + gt(e, r) + vt(pt(il(e, o), i));
1905
- case re:
1906
- return `"${rl(e)}"`;
1907
- }
1908
- }
1909
- function tl(e, n, t, i, r) {
1910
- const o = i || !r;
1911
- if (n.style.singleQuoted) return Ne;
1912
- if (n.style.doubleQuoted) return re;
1913
- if (!o) {
1914
- if (n.style.literal) return Bn;
1915
- if (n.style.folded) return Dn;
1916
- }
1917
- const l = n.value;
1918
- if (l.length === 0)
1919
- return n.style.tagged || mt(e, l) === n.tag ? Re : e.quoteStyle === "double" ? re : Ne;
1920
- const a = el(e, l, t, o, e.forceQuotes && !i, r);
1921
- return a === Re && !n.style.tagged && mt(e, l) !== n.tag ? e.quoteStyle === "double" ? re : Ne : a;
1922
- }
1923
- function gt(e, n) {
1924
- const t = Zt(e) ? String(n) : "", i = e[e.length - 1] === `
1925
- `;
1926
- return `${t}${i && (e[e.length - 2] === `
1927
- ` || e === `
1928
- `) ? "+" : i ? "" : "-"}
1929
- `;
1930
- }
1931
- function yt(e, n) {
1932
- let t = e.indexOf(`
1933
- `);
1934
- if (t === -1) return e;
1935
- const i = " ".repeat(n);
1936
- let r = e.slice(0, t);
1937
- const o = /(\n+)([^\n]*)/g;
1938
- o.lastIndex = t;
1939
- let l;
1940
- for (; l = o.exec(e); ) {
1941
- const a = l[1].length, u = l[2];
1942
- r += `
1943
- `.repeat(a + 1) + i + u;
1944
- }
1945
- return r;
1946
- }
1947
- function vt(e) {
1948
- return e[e.length - 1] === `
1949
- ` ? e.slice(0, -1) : e;
1950
- }
1951
- function il(e, n) {
1952
- const t = /(\n+)([^\n]*)/g;
1953
- let i = e.indexOf(`
1954
- `);
1955
- i === -1 && (i = e.length), t.lastIndex = i;
1956
- let r = bt(e.slice(0, i), n), o = e[0] === `
1957
- ` || e[0] === " ", l, a;
1958
- for (; a = t.exec(e); ) {
1959
- const u = a[1], s = a[2];
1960
- l = s[0] === " ", r += u + (!o && !l && s !== "" ? `
1961
- ` : "") + bt(s, n), o = l;
1962
- }
1963
- return r;
1964
- }
1965
- function bt(e, n) {
1966
- if (e === "" || e[0] === " ") return e;
1967
- const t = / [^ ]/g;
1968
- let i, r = 0, o, l = 0, a = 0, u = "";
1969
- for (; i = t.exec(e); )
1970
- a = i.index, a - r > n && (o = l > r ? l : a, u += `
1971
- ${e.slice(r, o)}`, r = o + 1), l = a;
1972
- return u += `
1973
- `, e.length - r > n && l > r ? u += `${e.slice(r, l)}
1974
- ${e.slice(l + 1)}` : u += e.slice(r), u.slice(1);
1975
- }
1976
- function rl(e) {
1977
- let n = "", t = 0;
1978
- for (let i = 0; i < e.length; t >= 65536 ? i += 2 : i++) {
1979
- t = Se(e, i);
1980
- const r = q[t];
1981
- if (r) {
1982
- n += r;
1983
- continue;
1984
- }
1985
- if (Oe(t)) {
1986
- n += e[i], t >= 65536 && (n += e[i + 1]);
1987
- continue;
1988
- }
1989
- n += Go(t);
1990
- }
1991
- return n;
1992
- }
1993
- function ol(e, n, t) {
1994
- let i = "";
1995
- for (let o = 0, l = t.items.length; o < l; o += 1) {
1996
- const a = ne(e, n, t.items[o], {});
1997
- i !== "" && (i += `,${e.flowSkipCommaSpace ? "" : " "}`), i += a;
1998
- }
1999
- const r = e.flowBracketPadding && i !== "" ? " " : "";
2000
- return `[${r}${i}${r}]`;
2001
- }
2002
- function xt(e, n, t, i) {
2003
- let r = "";
2004
- for (let o = 0, l = t.items.length; o < l; o += 1) {
2005
- const a = ne(e, n + 1, t.items[o], {
2006
- block: !0,
2007
- compact: e.seqInlineFirst,
2008
- isblockseq: !0
2009
- });
2010
- (!i || r !== "") && (r += _n(e, n)), a === "" || he === a.charCodeAt(0) ? r += "-" : r += "- ", r += a;
2011
- }
2012
- return r;
2013
- }
2014
- function ll(e, n, t) {
2015
- let i = "";
2016
- const r = ei(e, t.items);
2017
- for (const { key: l, value: a } of r) {
2018
- let u = "";
2019
- i !== "" && (u += `,${e.flowSkipCommaSpace ? "" : " "}`);
2020
- const s = ne(e, n, l, { iskey: !0 }), c = s.length > 1024;
2021
- c ? u += "? " : e.quoteFlowKeys && (u += '"');
2022
- const y = ne(e, n, a, {}), m = e.flowSkipColonSpace || y === "" ? "" : " ";
2023
- u += `${s}${e.quoteFlowKeys && !c ? '"' : ""}:${m}${y}`, i += u;
2024
- }
2025
- const o = e.flowBracketPadding && i !== "" ? " " : "";
2026
- return `{${o}${i}${o}}`;
2027
- }
2028
- function Ye(e) {
2029
- return e.kind === "scalar" ? e.value : e;
2030
- }
2031
- function ei(e, n) {
2032
- if (!e.sortKeys) return n;
2033
- const t = n.slice();
2034
- if (e.sortKeys === !0) t.sort((i, r) => {
2035
- const o = Ye(i.key), l = Ye(r.key);
2036
- return o < l ? -1 : o > l ? 1 : 0;
2037
- });
2038
- else {
2039
- const i = e.sortKeys;
2040
- t.sort((r, o) => i(Ye(r.key), Ye(o.key)));
2041
- }
2042
- return t;
2043
- }
2044
- function al(e, n, t, i) {
2045
- let r = "";
2046
- const o = ei(e, t.items);
2047
- for (let l = 0, a = o.length; l < a; l += 1) {
2048
- let u = "";
2049
- (!i || r !== "") && (u += _n(e, n));
2050
- const { key: s, value: c } = o[l], y = (s.kind === "mapping" || s.kind === "sequence") && !s.style.flow && s.items.length !== 0 || s.kind === "scalar" && (s.style.literal || s.style.folded), m = y ? ne(e, n + 1, s, {
2051
- block: !0,
2052
- compact: !0,
2053
- isblockseq: !In(e, s, n + 1)
2054
- }) : ne(e, n + 1, s, {
2055
- block: !0,
2056
- compact: !0,
2057
- iskey: !0
2058
- }), b = s.kind === "scalar" && s.value.indexOf(`
2059
- `) !== -1, p = y || b || m.length > 1024;
2060
- p && (m && he === m.charCodeAt(0) ? u += "?" : u += "? "), u += m, p && (u += _n(e, n));
2061
- const h = ne(e, n + 1, c, {
2062
- block: !0,
2063
- compact: p,
2064
- isblockseq: p && !In(e, c, n + 1)
2065
- }), v = s.kind === "scalar" && s.value === "" && m !== "" && m.charCodeAt(m.length - 1) !== Ht && m.charCodeAt(m.length - 1) !== Kt, k = !p && (s.kind === "alias" || v) ? " " : "";
2066
- h === "" || he === h.charCodeAt(0) ? u += `${k}:` : u += `${k}: `, u += h, r += u;
2067
- }
2068
- return r;
2069
- }
2070
- function In(e, n, t) {
2071
- return n.style.tagged || n.anchor !== void 0 || e.indent < 2 && t > 0;
2072
- }
2073
- function ne(e, n, t, i) {
2074
- if (t.kind === "alias") return `*${t.anchor}`;
2075
- const { block: r = !1, iskey: o = !1, isblockseq: l = !1 } = i;
2076
- let a = i.compact ?? !1;
2077
- const u = t.anchor !== void 0;
2078
- In(e, t, n) && (a = !1);
2079
- let s, c = t.style.tagged;
2080
- const y = r && (t.kind === "mapping" || t.kind === "sequence") && !t.style.flow && t.items.length !== 0;
2081
- if (t.kind === "mapping") y ? s = al(e, n, t, a) : s = ll(e, n, t);
2082
- else if (t.kind === "sequence") y ? e.seqNoIndent && !l && n > 0 ? s = xt(e, n - 1, t, a) : s = xt(e, n, t, a) : s = ol(e, n, t);
2083
- else {
2084
- const m = Wo(e, n), b = tl(e, t, m, o, r);
2085
- s = nl(t.value, b, m), c = t.style.tagged || b !== Re && t.tag !== e.defaultScalarTagName;
2086
- }
2087
- if (y && a && n > 0 && e.indent > 2 && (s = `${" ".repeat(e.indent - 2)}${s}`), c || u) {
2088
- const m = [], b = c ? Ho(t) : null, p = u ? `&${t.anchor}` : null;
2089
- e.tagBeforeAnchor ? (b !== null && m.push(b), p !== null && m.push(p)) : (p !== null && m.push(p), b !== null && m.push(b));
2090
- const h = s === "" || s.charCodeAt(0) === he ? "" : " ";
2091
- s = `${m.join(" ")}${h}${s}`;
2092
- }
2093
- return s;
2094
- }
2095
- function sl(e) {
2096
- return (e.kind === "sequence" || e.kind === "mapping") && !e.style.flow && e.items.length !== 0 && !e.style.tagged && e.anchor === void 0;
2097
- }
2098
- function ul(e) {
2099
- let n = e;
2100
- for (; (n.kind === "sequence" || n.kind === "mapping") && !n.style.flow && n.items.length !== 0; ) n = n.kind === "sequence" ? n.items[n.items.length - 1] : n.items[n.items.length - 1].value;
2101
- if (n.kind !== "scalar" || !(n.style.literal || n.style.folded)) return !1;
2102
- const { value: t } = n;
2103
- return t.endsWith(`
2104
-
2105
- `) || t === `
2106
- `;
2107
- }
2108
- function cl(e) {
2109
- let n = "";
2110
- for (const t of e.directives) {
2111
- if (t.kind === "yaml") {
2112
- n += `%YAML ${t.version}
2113
- `;
2114
- continue;
2115
- }
2116
- const { handle: i, prefix: r } = t;
2117
- n += `%TAG ${i} ${r}
2118
- `;
2119
- }
2120
- return n;
2121
- }
2122
- function fl(e, n) {
2123
- const t = zo(n);
2124
- let i = "", r = !1;
2125
- for (let o = 0; o < e.length; o += 1) {
2126
- const l = e[o], a = cl(l), u = a !== "", s = l.explicitStart || u || o > 0 && !r;
2127
- if (i += a, l.contents === null)
2128
- s && (i += `---
2129
- `);
2130
- else if (s) {
2131
- const c = ne(t, 0, l.contents, {
2132
- block: !0,
2133
- compact: !0
2134
- }), y = c === "" ? "" : u || sl(l.contents) ? `
2135
- ` : " ";
2136
- i += `---${y}${c}
2137
- `;
2138
- } else i += ne(t, 0, l.contents, {
2139
- block: !0,
2140
- compact: !0
2141
- }) + `
2142
- `;
2143
- r = l.explicitEnd || l.contents !== null && ul(l.contents), r && (i += `...
2144
- `);
2145
- }
2146
- return i;
2147
- }
2148
- var dl = Vr.withTags({
2149
- ...xn,
2150
- resolve: (e, n, t) => {
2151
- const i = xn.resolve(e, n, t);
2152
- return i === T ? _t.resolve(e, n, t) : i;
2153
- }
2154
- }, {
2155
- ...Sn,
2156
- resolve: (e, n, t) => {
2157
- const i = Sn.resolve(e, n, t);
2158
- return i === T ? Et.resolve(e, n, t) : i;
2159
- }
2160
- }), pl = {
2161
- ...Vn,
2162
- schema: dl,
2163
- skipInvalid: !1,
2164
- noRefs: !1,
2165
- flowLevel: -1,
2166
- transform: () => {
2167
- }
2168
- };
2169
- function ni(e, n = {}) {
2170
- const t = {
2171
- ...pl,
2172
- ...n
2173
- }, i = Lo(e, t.schema, {
2174
- noRefs: t.noRefs,
2175
- skipInvalid: t.skipInvalid
2176
- });
2177
- return t.flowLevel >= 0 && Oo(i, (r, o) => {
2178
- if (!(o.depth < t.flowLevel))
2179
- return r.style.flow = !0, Yt;
2180
- }), t.transform(i), fl(i, {
2181
- ...kn(t, Object.keys(Vn)),
2182
- schema: t.schema
2183
- });
2184
- }
2185
- const ml = {}, hl = {
2186
- xmlns: "http://www.w3.org/2000/svg",
2187
- width: "24",
2188
- height: "24",
2189
- viewBox: "0 0 24 24",
2190
- fill: "none",
2191
- stroke: "currentColor",
2192
- "stroke-width": "2",
2193
- "stroke-linecap": "round",
2194
- "stroke-linejoin": "round",
2195
- class: "lucide lucide-layers"
2196
- };
2197
- function gl(e, n) {
2198
- return _(), M("svg", hl, [...n[0] || (n[0] = [
2199
- g("path", { d: "m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z" }, null, -1),
2200
- g("path", { d: "m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65" }, null, -1),
2201
- g("path", { d: "m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65" }, null, -1)
2202
- ])]);
2203
- }
2204
- const yl = /* @__PURE__ */ Xe(ml, [["render", gl]]), vl = {}, bl = {
2205
- xmlns: "http://www.w3.org/2000/svg",
2206
- width: "24",
2207
- height: "24",
2208
- viewBox: "0 0 24 24",
2209
- fill: "none",
2210
- stroke: "currentColor",
2211
- "stroke-width": "2",
2212
- "stroke-linecap": "round",
2213
- "stroke-linejoin": "round",
2214
- class: "lucide lucide-map"
2215
- };
2216
- function xl(e, n) {
2217
- return _(), M("svg", bl, [...n[0] || (n[0] = [
2218
- g("path", { d: "M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z" }, null, -1),
2219
- g("path", { d: "M15 5.764v15" }, null, -1),
2220
- g("path", { d: "M9 3.236v15" }, null, -1)
2221
- ])]);
2222
- }
2223
- const Sl = /* @__PURE__ */ Xe(vl, [["render", xl]]), kl = {}, Al = {
2224
- xmlns: "http://www.w3.org/2000/svg",
2225
- width: "24",
2226
- height: "24",
2227
- viewBox: "0 0 24 24",
2228
- fill: "none",
2229
- stroke: "currentColor",
2230
- "stroke-width": "2",
2231
- "stroke-linecap": "round",
2232
- "stroke-linejoin": "round",
2233
- class: "lucide lucide-filter"
2234
- };
2235
- function Cl(e, n) {
2236
- return _(), M("svg", Al, [...n[0] || (n[0] = [
2237
- g("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" }, null, -1)
2238
- ])]);
2239
- }
2240
- const wl = /* @__PURE__ */ Xe(kl, [["render", Cl]]), Tl = { class: "flex flex-col flex-1 overflow-hidden" }, _l = { class: "flex justify-end gap-2" }, El = ["href"], Il = { class: "flex flex-col flex-1 overflow-hidden" }, Nl = { class: "bg-white rounded-xl border border-gray-200 shadow-sm overflow-hidden mt-3 flex flex-col flex-1" }, $l = { class: "relative bg-gradient-to-br from-slate-50 to-white flex-1" }, Ll = /* @__PURE__ */ ae({
2241
- __name: "vs-tab-style",
2242
- props: {
2243
- token: {},
2244
- styleYaml: {},
2245
- styleText: {}
2246
- },
2247
- emits: ["update:style-yaml", "update:style-text", "update"],
2248
- setup(e, { emit: n }) {
2249
- const t = e, i = n, r = E("");
2250
- $(
2251
- () => t.styleText,
2252
- (u) => {
2253
- const s = u ?? "";
2254
- r.value !== s && (r.value = s);
2255
- },
2256
- { immediate: !0 }
2257
- ), $(r, async (u) => {
2258
- var c, y;
2259
- const s = u ?? "";
2260
- t.styleText !== s && i("update:style-text", s);
2261
- try {
2262
- const m = u ? Dt(u) : null;
2263
- if ((c = m == null ? void 0 : m.colorAttr) != null && c.length && ((y = t.styleYaml) == null ? void 0 : y.colorAttr) !== m.colorAttr) {
2264
- const b = await o(m.colorAttr);
2265
- m.colors = b.reduce(
2266
- (h, v, k) => ({
2267
- ...h,
2268
- [v.id.toString()]: l[k]
2269
- }),
2270
- {}
2271
- );
2272
- const p = ni(m);
2273
- p !== r.value && (r.value = p);
2274
- }
2275
- JSON.stringify(m) !== JSON.stringify(t.styleYaml) && i(
2276
- "update:style-yaml",
2277
- m && typeof m == "object" ? m : null
2278
- );
2279
- } catch {
2280
- t.styleYaml !== null && i("update:style-yaml", null);
2281
- }
2282
- });
2283
- async function o(u) {
2284
- return (await fetch(`/api/gis-service/${t.token}/${u}`).then(
2285
- (c) => c.json()
2286
- )).rows;
2287
- }
2288
- const l = [
2289
- "#8dd3c7",
2290
- "#ffffb3",
2291
- "#bebada",
2292
- "#fb8072",
2293
- "#80b1d3",
2294
- "#fdb462",
2295
- "#b3de69",
2296
- "#fccde5",
2297
- "#d9d9d9",
2298
- "#bc80bd"
2299
- ], a = async () => {
2300
- const u = t.styleYaml ? JSON.stringify(t.styleYaml) : t.styleText ? t.styleText : "null";
2301
- try {
2302
- await fetch(`/api/gis-service/${t.token}`, {
2303
- method: "PUT",
2304
- headers: { "Content-Type": "application/json" },
2305
- body: JSON.stringify({ style: u })
2306
- }), i("update"), X({ type: "success", title: "Успіх", message: "Стилі збережено" });
2307
- } catch (s) {
2308
- X({
2309
- type: "error",
2310
- title: "Помилка",
2311
- message: "Не вдалося зберегти стилі"
2312
- }), console.log(s);
2313
- }
2314
- };
2315
- return (u, s) => (_(), M("div", Tl, [
2316
- g("div", _l, [
2317
- g("a", {
2318
- target: "_blank",
2319
- href: "/api/gis-service/" + t.token + "/col",
2320
- class: "inline-flex items-center justify-center gap-1 px-3 py-1.5 rounded-md bg-sky-100 hover:bg-sky-200 text-sky-700 font-medium text-sm transition disabled:opacity-70 disabled:cursor-not-allowed"
2321
- }, " Атрибути ", 8, El),
2322
- g("button", {
2323
- onClick: a,
2324
- class: "inline-flex items-center justify-center gap-1 px-3 py-1.5 rounded-md bg-sky-100 hover:bg-sky-200 text-sky-700 font-medium text-sm transition disabled:opacity-70 disabled:cursor-not-allowed"
2325
- }, [...s[1] || (s[1] = [
2326
- g("svg", {
2327
- xmlns: "http://www.w3.org/2000/svg",
2328
- width: "24",
2329
- height: "24",
2330
- viewBox: "0 0 24 24",
2331
- fill: "none",
2332
- stroke: "currentColor",
2333
- "stroke-width": "2",
2334
- "stroke-linecap": "round",
2335
- "stroke-linejoin": "round",
2336
- class: "lucide lucide-save h-3 w-3 mr-1"
2337
- }, [
2338
- g("path", { d: "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z" }),
2339
- g("path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7" }),
2340
- g("path", { d: "M7 3v4a1 1 0 0 0 1 1h7" })
2341
- ], -1),
2342
- mi(" Зберегти стилі ", -1)
2343
- ])])
2344
- ]),
2345
- g("div", Il, [
2346
- g("div", Nl, [
2347
- s[2] || (s[2] = g("div", { class: "bg-gradient-to-r from-gray-50 to-gray-100 px-4 py-2 border-b border-gray-200 flex items-center justify-between" }, [
2348
- g("div", { class: "text-xs text-gray-400" }, "YAML")
2349
- ], -1)),
2350
- g("div", $l, [
2351
- D(Tt, {
2352
- modelValue: r.value,
2353
- "onUpdate:modelValue": s[0] || (s[0] = (c) => r.value = c),
2354
- language: "yaml",
2355
- theme: "vs-light"
2356
- }, null, 8, ["modelValue"])
2357
- ])
2358
- ])
2359
- ])
2360
- ]));
2361
- }
2362
- }), Fl = { class: "flex flex-col flex-1 min-h-0" }, Ol = { class: "flex flex-col flex-1 min-h-0" }, Rl = /* @__PURE__ */ ae({
2363
- __name: "vs-tab-popup",
2364
- props: {
2365
- token: {},
2366
- fields: {},
2367
- columns: {}
2368
- },
2369
- emits: ["update:columns", "save"],
2370
- setup(e, { emit: n }) {
2371
- const t = e, i = n, r = E(t.columns || []);
2372
- $(
2373
- () => t.columns,
2374
- (p) => r.value = p || [],
2375
- { immediate: !0 }
2376
- ), $(r, (p) => {
2377
- const h = Ge(t.token);
2378
- h && (h.popup = p), i("update:columns", p);
2379
- });
2380
- const o = E("list"), l = E(!1), a = E([]), u = [
2381
- { key: "name", label: "Назва", type: "main" }
2382
- // { key: "ua", label: "UA" },
2383
- // { key: "format", label: "Format" },
2384
- // { key: "meta", label: "Meta" },
2385
- ], s = {
2386
- name: { type: "text", label: "Назва", disabled: !0, validators: ["required"] },
2387
- label: { type: "text", label: "Найменування", validators: ["required"] },
2388
- // format: { type: "text", label: "Format", disabled: true, hidden: true },
2389
- meta: {
2390
- type: "radio",
2391
- label: "Meta",
2392
- mode: "combo",
2393
- options: [
2394
- { text: "Заголовок", id: "title" },
2395
- { text: "Властивість", id: "feature" },
2396
- { text: "Бейдж", id: "badge" }
2397
- ]
2398
- },
2399
- data: {
2400
- type: "autocomplete",
2401
- label: "Класифікатор",
2402
- data: "admin.cls.name"
2403
- // conditions: ["meta", "in", ["badge", "select", "tags"]],
2404
- }
2405
- };
2406
- function c() {
2407
- a.value = r.value.map((p) => p.name || p.id), l.value = !0;
2408
- }
2409
- function y() {
2410
- var k;
2411
- const p = [...r.value], h = ((k = t.fields) == null ? void 0 : k.filter((C) => a.value.includes(C.name))) || [], v = $n(p, h, {
2412
- selectedKeys: a.value,
2413
- resolveKey: (C) => $e(C)
2414
- });
2415
- r.value = v, l.value = !1, a.value = [];
2416
- }
2417
- function m() {
2418
- l.value = !1, a.value = [];
2419
- }
2420
- function b() {
2421
- let p = [];
2422
- o.value === "all" ? p = t.fields || [] : o.value === "none" ? p = [] : p = r.value, p.filter((h) => !h.label).forEach((h) => h.label = h.ua), i("save", p);
2423
- }
2424
- return (p, h) => (_(), M("div", Fl, [
2425
- g("div", { class: "flex justify-between mb-3 gap-2" }, [
2426
- g("button", {
2427
- onClick: c,
2428
- class: "inline-flex items-center justify-center gap-1 px-3 py-1.5 rounded-md bg-sky-100 hover:bg-sky-200 text-sky-700 font-medium text-sm transition disabled:opacity-70 disabled:cursor-not-allowed"
2429
- }, " Імпорт "),
2430
- g("button", {
2431
- onClick: b,
2432
- class: "inline-flex items-center justify-center gap-1 px-3 py-1.5 rounded-md bg-sky-100 hover:bg-sky-200 text-sky-700 font-medium text-sm transition disabled:opacity-70 disabled:cursor-not-allowed"
2433
- }, " Зберегти попап ")
2434
- ]),
2435
- g("div", Ol, [
2436
- o.value === "list" ? (_(), P(Ze, {
2437
- key: 0,
2438
- modelValue: r.value,
2439
- "onUpdate:modelValue": h[0] || (h[0] = (v) => r.value = v),
2440
- "columns-scheme": u,
2441
- "form-scheme": s,
2442
- "main-col-width": "250px",
2443
- "add-button": !1
2444
- }, null, 8, ["modelValue"])) : W("", !0)
2445
- ]),
2446
- D(Nn, {
2447
- visible: l.value,
2448
- "onUpdate:visible": h[1] || (h[1] = (v) => l.value = v),
2449
- selection: a.value,
2450
- "onUpdate:selection": h[2] || (h[2] = (v) => a.value = v),
2451
- fields: e.fields,
2452
- title: "Імпорт полів",
2453
- "id-prefix": "import-popup",
2454
- onConfirm: y,
2455
- onCancel: m
2456
- }, null, 8, ["visible", "selection", "fields"])
2457
- ]));
2458
- }
2459
- }), Pl = { class: "flex flex-col flex-1 min-h-0" }, Ml = { class: "flex justify-between mb-3 gap-2" }, Ul = { class: "p-4 space-y-4 text-sm" }, ql = { class: "space-y-1" }, Vl = { class: "space-y-1" }, Bl = { class: "flex items-center gap-3" }, Dl = { class: "flex justify-end gap-2 p-4 border-t" }, Yl = /* @__PURE__ */ ae({
2460
- __name: "vs-tab-legend",
2461
- props: {
2462
- mapInfo: {},
2463
- token: {},
2464
- columns: {}
2465
- },
2466
- emits: ["update:columns", "save"],
2467
- setup(e, { emit: n }) {
2468
- const t = e, i = n, r = E(t.columns || []);
2469
- $(
2470
- () => t.columns,
2471
- (p) => {
2472
- r.value = p || [];
2473
- }
2474
- ), $(r, (p) => {
2475
- i("update:columns", p);
2476
- });
2477
- const o = E(!1), l = E({
2478
- name: "",
2479
- color: "#2E86DE"
2480
- }), a = hi(
2481
- () => import("@opengis/core").then((p) => p.VsModal)
2482
- ), u = [
2483
- { key: "name", label: "Назва" },
2484
- { key: "color", label: "Колір", type: "color" }
2485
- ], s = {
2486
- name: { type: "text", label: "Назва", validators: ["required"] },
2487
- color: { type: "color", label: "Колір", validators: ["required"] }
2488
- };
2489
- function c(p) {
2490
- p && y(), o.value = p;
2491
- }
2492
- function y() {
2493
- l.value = { name: "", color: "#2E86DE" };
2494
- }
2495
- function m() {
2496
- var k, C;
2497
- const p = (k = l.value.name) == null ? void 0 : k.trim();
2498
- if (!p) {
2499
- X({
2500
- type: "warning",
2501
- title: "Перевірка",
2502
- message: "Вкажіть назву елементу легенди"
2503
- });
2504
- return;
2505
- }
2506
- const h = ((C = l.value.color) == null ? void 0 : C.trim()) || "#2E86DE";
2507
- if (r.value.some(
2508
- (R) => $e(R) === $e({ name: p })
2509
- )) {
2510
- X({
2511
- type: "warning",
2512
- title: "Дубль",
2513
- message: "Такий елемент легенди вже існує"
2514
- });
2515
- return;
2516
- }
2517
- r.value = [...r.value, { name: p, color: h }], y(), o.value = !1;
2518
- }
2519
- function b() {
2520
- i("save", r.value);
2521
- }
2522
- return (p, h) => (_(), M("div", Pl, [
2523
- g("div", Ml, [
2524
- g("button", {
2525
- onClick: h[0] || (h[0] = (v) => o.value = !0),
2526
- class: "inline-flex items-center justify-center gap-1 px-3 py-1.5 rounded-md bg-sky-100 hover:bg-sky-200 text-sky-700 font-medium text-sm transition disabled:opacity-70 disabled:cursor-not-allowed"
2527
- }, " Додати "),
2528
- g("button", {
2529
- onClick: b,
2530
- class: "inline-flex items-center justify-center gap-1 px-3 py-1.5 rounded-md bg-sky-100 hover:bg-sky-200 text-sky-700 font-medium text-sm transition disabled:opacity-70 disabled:cursor-not-allowed"
2531
- }, " Зберегти легенду ")
2532
- ]),
2533
- D(Ze, {
2534
- modelValue: r.value,
2535
- "onUpdate:modelValue": h[1] || (h[1] = (v) => r.value = v),
2536
- "columns-scheme": u,
2537
- "form-scheme": s,
2538
- "main-col-width": "250px",
2539
- "add-button": !1
2540
- }, null, 8, ["modelValue"]),
2541
- D(ze(a), {
2542
- teleport: "#modal",
2543
- visible: o.value,
2544
- title: "Новий елемент легенди",
2545
- "onUpdate:visible": c
2546
- }, {
2547
- footer: bn(() => [
2548
- g("div", Dl, [
2549
- g("button", {
2550
- type: "button",
2551
- class: "inline-flex items-center justify-center gap-1 px-3 py-1.5 rounded-md bg-sky-100 hover:bg-sky-200 text-sky-700 font-medium text-sm transition disabled:opacity-70 disabled:cursor-not-allowed",
2552
- onClick: h[5] || (h[5] = (v) => c(!1))
2553
- }, " Скасувати "),
2554
- g("button", {
2555
- type: "button",
2556
- class: "inline-flex items-center justify-center gap-1 px-3 py-1.5 rounded-md bg-sky-100 hover:bg-sky-200 text-sky-700 font-medium text-sm transition disabled:opacity-70 disabled:cursor-not-allowed",
2557
- onClick: m
2558
- }, " Додати ")
2559
- ])
2560
- ]),
2561
- default: bn(() => [
2562
- g("div", Ul, [
2563
- g("div", ql, [
2564
- h[6] || (h[6] = g("label", { class: "block text-xs font-medium text-gray-500 uppercase tracking-wide" }, " Назва ", -1)),
2565
- fn(g("input", {
2566
- "onUpdate:modelValue": h[2] || (h[2] = (v) => l.value.name = v),
2567
- type: "text",
2568
- class: "w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200",
2569
- placeholder: "Наприклад, Житлова зона"
2570
- }, null, 512), [
2571
- [dn, l.value.name]
2572
- ])
2573
- ]),
2574
- g("div", Vl, [
2575
- h[7] || (h[7] = g("label", { class: "block text-xs font-medium text-gray-500 uppercase tracking-wide" }, " Колір ", -1)),
2576
- g("div", Bl, [
2577
- fn(g("input", {
2578
- "onUpdate:modelValue": h[3] || (h[3] = (v) => l.value.color = v),
2579
- type: "color",
2580
- class: "h-10 w-16 rounded border border-gray-300"
2581
- }, null, 512), [
2582
- [dn, l.value.color]
2583
- ]),
2584
- fn(g("input", {
2585
- "onUpdate:modelValue": h[4] || (h[4] = (v) => l.value.color = v),
2586
- type: "text",
2587
- class: "flex-1 rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200",
2588
- placeholder: "#FFFFFF"
2589
- }, null, 512), [
2590
- [dn, l.value.color]
2591
- ])
2592
- ])
2593
- ])
2594
- ])
2595
- ]),
2596
- _: 1
2597
- }, 8, ["visible"])
2598
- ]));
2599
- }
2600
- }), jl = { class: "space-y-3 bg-gradient-to-br from-sky-50 to-blue-50 p-4 rounded-xl border border-sky-100 shadow-sm" }, Kl = ["onClick"], Hl = ["aria-checked", "value"], zl = { key: 0 }, Gl = /* @__PURE__ */ ae({
2601
- __name: "view-mode-toggle",
2602
- props: {
2603
- modelValue: {},
2604
- options: {},
2605
- showHtml: { type: Boolean }
2606
- },
2607
- emits: ["update:modelValue"],
2608
- setup(e, { emit: n }) {
2609
- const t = e, i = n, r = (l) => i("update:modelValue", l), o = t.options || [
2610
- { value: "all", label: "All" },
2611
- { value: "list", label: "List" },
2612
- { value: "none", label: "None" }
2613
- ];
2614
- return (l, a) => (_(), M("div", jl, [
2615
- a[1] || (a[1] = g("label", { class: "text-sm font-medium text-gray-600" }, "Режим відображення", -1)),
2616
- g("div", {
2617
- role: "radiogroup",
2618
- class: _e(["grid gap-2", `grid-cols-${ze(o).length}`])
2619
- }, [
2620
- (_(!0), M(kt, null, At(ze(o), (u) => (_(), M("div", {
2621
- key: u.value,
2622
- onClick: (s) => r(u.value),
2623
- class: _e(["flex items-center justify-center space-x-2 rounded-lg p-2 border transition-all duration-300 cursor-pointer", [
2624
- e.modelValue === u.value ? "bg-gradient-to-r from-sky-200 to-blue-200 border-transparent shadow-sm" : "bg-white border-gray-100 hover:border-sky-200 hover:shadow-sm"
2625
- ]])
2626
- }, [
2627
- g("button", {
2628
- type: "button",
2629
- role: "radio",
2630
- "aria-checked": e.modelValue === u.value,
2631
- value: u.value,
2632
- class: "aspect-square rounded-full border border-primary h-4 w-4 flex items-center justify-center text-sky-500"
2633
- }, [
2634
- e.modelValue === u.value ? (_(), M("span", zl, [...a[0] || (a[0] = [
2635
- g("svg", {
2636
- xmlns: "http://www.w3.org/2000/svg",
2637
- viewBox: "0 0 24 24",
2638
- fill: "none",
2639
- stroke: "currentColor",
2640
- "stroke-width": "2",
2641
- "stroke-linecap": "round",
2642
- "stroke-linejoin": "round",
2643
- class: "lucide lucide-circle h-2.5 w-2.5 fill-current text-current"
2644
- }, [
2645
- g("circle", {
2646
- cx: "12",
2647
- cy: "12",
2648
- r: "10"
2649
- })
2650
- ], -1)
2651
- ])])) : W("", !0)
2652
- ], 8, Hl),
2653
- g("label", {
2654
- class: _e(["text-xs font-medium cursor-pointer", e.modelValue === u.value ? "text-gray-700" : "text-gray-600"])
2655
- }, fe(u.label), 3)
2656
- ], 10, Kl))), 128))
2657
- ], 2)
2658
- ]));
2659
- }
2660
- }), Wl = { class: "flex flex-col flex-1 min-h-0" }, Ql = { class: "flex flex-col flex-1 min-h-0" }, Jl = /* @__PURE__ */ ae({
2661
- __name: "vs-tab-card",
2662
- props: {
2663
- fields: {},
2664
- columns: {},
2665
- viewMode: {},
2666
- html: {}
2667
- },
2668
- emits: ["update:columns", "save"],
2669
- setup(e, { emit: n }) {
2670
- const t = e, i = n, r = E(t.columns || []);
2671
- $(
2672
- () => t.columns,
2673
- (v) => r.value = v || [],
2674
- { immediate: !0 }
2675
- ), $(r, (v) => i("update:columns", v));
2676
- const o = E(t.viewMode ?? "list");
2677
- $(
2678
- () => t.viewMode,
2679
- (v) => {
2680
- v && v !== o.value && (o.value = v);
2681
- }
2682
- );
2683
- const l = E(t.html ?? "");
2684
- $(
2685
- () => t.html,
2686
- (v) => {
2687
- typeof v == "string" && v !== l.value && (l.value = v);
2688
- },
2689
- { immediate: !0 }
2690
- );
2691
- const a = E(!1), u = E([]), s = [
2692
- { key: "name", label: "Name", type: "main" }
2693
- // { key: "ua", label: "UA" },
2694
- // { key: 'format', label: 'Format' },
2695
- //{ key: 'is_admin', label: 'Admin', options: [{ text: "Так", id: true }, { text: "Ні", id: false }]},
2696
- /* { key: "meta", label: "Мета" }, */
2697
- ], c = {
2698
- name: {
2699
- type: "text",
2700
- label: "Name",
2701
- validators: ["required"],
2702
- disabled: !0
2703
- },
2704
- label: { type: "text", label: "Label", validators: ["required"] },
2705
- format: {
2706
- type: "radio",
2707
- label: "Format",
2708
- mode: "inline",
2709
- validators: ["required"],
2710
- options: [
2711
- { text: "Text", id: "text" },
2712
- { text: "Number", id: "number" },
2713
- { text: "Date", id: "date" },
2714
- { text: "File", id: "file" },
2715
- { text: "Select", id: "select" },
2716
- { text: "Tags", id: "tags" }
2717
- ]
2718
- },
2719
- is_admin: { type: "Switcher", label: "Тільки для адміністративної частини" },
2720
- data: {
2721
- type: "select",
2722
- label: "Класифікатор",
2723
- data: "admin.cls.name"
2724
- // conditions: ['format', 'in', ['select', 'badge', 'tags']],
2725
- }
2726
- /* meta: {
2727
- type: "combobox",
2728
- label: "Мета",
2729
- validators: ["required"],
2730
- mode: "combo",
2731
- options: [
2732
- { text: "Title", id: "title" },
2733
- { text: "Features", id: "features" },
2734
- { text: "Status", id: "status" },
2735
- { text: "Tags", id: "tags" },
2736
- { text: "Category", id: "category" },
2737
- ],
2738
- }, */
2739
- };
2740
- function y() {
2741
- u.value = o.value === "html" ? [] : r.value.map((v) => v.name || v.id), a.value = !0;
2742
- }
2743
- function m() {
2744
- var R;
2745
- const v = [...r.value], k = ((R = t.fields) == null ? void 0 : R.filter((B) => u.value.includes(B.name)).map((B) => {
2746
- const { type: Ce, format: ge, ...K } = B;
2747
- return {
2748
- ...K,
2749
- format: ge ?? Ce ?? "text"
2750
- };
2751
- })) || [], C = $n(v, k, {
2752
- selectedKeys: u.value,
2753
- resolveKey: (B) => $e(B)
2754
- });
2755
- if (r.value = C, o.value === "html" && k.length) {
2756
- const B = k.map((K) => {
2757
- const we = K.label ?? "", ye = K.name ?? K.id ?? "";
2758
- return `<dd>${we}</dd>
2759
- <dt>{{ ${ye} }}</dt>`;
2760
- }).join(`
2761
- `), ge = (l.value ?? "").trimEnd();
2762
- l.value = ge ? `${ge}
2763
- ${B}` : B;
2764
- }
2765
- a.value = !1, u.value = [];
2766
- }
2767
- function b() {
2768
- a.value = !1, u.value = [];
2769
- }
2770
- function p() {
2771
- const v = o.value === "html" ? "html" : "list", k = {
2772
- card_mode: v
2773
- };
2774
- v === "html" ? k.html = l.value : v === "list" && (k.list = r.value), i("save", "card", k);
2775
- }
2776
- const h = [
2777
- { value: "all", label: "Всі" },
2778
- { value: "list", label: "Список" },
2779
- { value: "none", label: "Жодне" },
2780
- { value: "html", label: "HTML" }
2781
- ];
2782
- return (v, k) => (_(), M("div", Wl, [
2783
- g("div", { class: "flex justify-between mb-3 gap-2" }, [
2784
- g("button", {
2785
- onClick: y,
2786
- class: "inline-flex items-center justify-center gap-1 px-3 py-1.5 rounded-md bg-sky-100 hover:bg-sky-200 text-sky-700 font-medium text-sm transition disabled:opacity-70 disabled:cursor-not-allowed"
2787
- }, " Імпорт "),
2788
- g("button", {
2789
- onClick: p,
2790
- class: "inline-flex items-center justify-center gap-1 px-3 py-1.5 rounded-md bg-sky-100 hover:bg-sky-200 text-sky-700 font-medium text-sm transition disabled:opacity-70 disabled:cursor-not-allowed"
2791
- }, " Зберегти ")
2792
- ]),
2793
- D(Gl, {
2794
- modelValue: o.value,
2795
- "onUpdate:modelValue": k[0] || (k[0] = (C) => o.value = C),
2796
- options: h
2797
- }, null, 8, ["modelValue"]),
2798
- g("div", Ql, [
2799
- o.value === "list" ? (_(), P(Ze, {
2800
- key: 0,
2801
- modelValue: r.value,
2802
- "onUpdate:modelValue": k[1] || (k[1] = (C) => r.value = C),
2803
- "columns-scheme": s,
2804
- "form-scheme": c,
2805
- "main-col-width": "250px",
2806
- "add-button": !1
2807
- }, null, 8, ["modelValue"])) : o.value === "html" ? (_(), P(Tt, {
2808
- key: 1,
2809
- modelValue: l.value,
2810
- "onUpdate:modelValue": k[2] || (k[2] = (C) => l.value = C),
2811
- language: "html",
2812
- theme: "vs-light",
2813
- class: "flex-1 min-h-0"
2814
- }, null, 8, ["modelValue"])) : W("", !0)
2815
- ]),
2816
- D(Nn, {
2817
- visible: a.value,
2818
- "onUpdate:visible": k[3] || (k[3] = (C) => a.value = C),
2819
- selection: u.value,
2820
- "onUpdate:selection": k[4] || (k[4] = (C) => u.value = C),
2821
- fields: e.fields,
2822
- title: "Імпорт полів для картки",
2823
- "id-prefix": "import-card",
2824
- onConfirm: m,
2825
- onCancel: b
2826
- }, null, 8, ["visible", "selection", "fields"])
2827
- ]));
2828
- }
2829
- }), Xl = { class: "flex flex-col flex-1 min-h-0" }, Zl = /* @__PURE__ */ ae({
2830
- __name: "vs-tab-filter",
2831
- props: {
2832
- fields: {},
2833
- columns: {}
2834
- },
2835
- emits: ["update:columns", "save"],
2836
- setup(e, { emit: n }) {
2837
- const t = e, i = n;
2838
- console.log(t.columns);
2839
- const r = E(t.columns || []);
2840
- $(
2841
- () => t.columns,
2842
- (p) => r.value = p || [],
2843
- { immediate: !0 }
2844
- ), $(r, (p) => i("update:columns", p), { deep: !0, immediate: !0 });
2845
- const o = E("list"), l = E(!1), a = E([]), u = [
2846
- { key: "id", label: "Name" },
2847
- { key: "label", label: "UA" }
2848
- // { key: "type", label: "Тип" },
2849
- ], s = {
2850
- name: { type: "text", label: "Name", disabled: !0, validators: ["required"] },
2851
- label: { type: "text", label: "UA", validators: ["required"] },
2852
- type: {
2853
- type: "radio",
2854
- label: "Тип",
2855
- position: "horizontal",
2856
- validators: ["required"],
2857
- options: [
2858
- { text: "Check", id: "check" },
2859
- { text: "Range", id: "range" },
2860
- { text: "Date", id: "date" },
2861
- { text: "Text", id: "text" },
2862
- { text: "Select", id: "autocomplete" }
2863
- ]
2864
- },
2865
- hidden: {
2866
- label: "Приховати",
2867
- type: "Switcher"
2868
- },
2869
- data: {
2870
- type: "select",
2871
- label: "Класифікатор",
2872
- data: "admin.cls.name",
2873
- conditions: ["type", "in", ["autocomplete", "select", "check"]],
2874
- validators: ["required"]
2875
- }
2876
- };
2877
- function c() {
2878
- a.value = r.value.map((p) => p.name || p.id), l.value = !0;
2879
- }
2880
- function y() {
2881
- var k;
2882
- const p = [...r.value], h = ((k = t.fields) == null ? void 0 : k.filter((C) => a.value.includes(C.name))) || [], v = $n(p, h, {
2883
- selectedKeys: a.value,
2884
- resolveKey: (C) => $e(C)
2885
- });
2886
- r.value = v, l.value = !1, a.value = [];
2887
- }
2888
- function m() {
2889
- l.value = !1, a.value = [];
2890
- }
2891
- function b() {
2892
- let p = [];
2893
- o.value === "all" ? p = t.fields || [] : o.value === "none" ? p = [] : p = r.value, i("save", p);
2894
- }
2895
- return (p, h) => (_(), M("div", Xl, [
2896
- g("div", { class: "flex justify-between mb-3 gap-2" }, [
2897
- g("button", {
2898
- onClick: c,
2899
- class: "inline-flex items-center justify-center gap-1 px-3 py-1.5 rounded-md bg-sky-100 hover:bg-sky-200 text-sky-700 font-medium text-sm transition disabled:opacity-70 disabled:cursor-not-allowed"
2900
- }, " Імпорт "),
2901
- g("button", {
2902
- onClick: b,
2903
- class: "inline-flex items-center justify-center gap-1 px-3 py-1.5 rounded-md bg-sky-100 hover:bg-sky-200 text-sky-700 font-medium text-sm transition disabled:opacity-70 disabled:cursor-not-allowed"
2904
- }, " Зберегти фільтр ")
2905
- ]),
2906
- o.value === "list" ? (_(), P(Ze, {
2907
- key: 0,
2908
- modelValue: r.value,
2909
- "onUpdate:modelValue": h[0] || (h[0] = (v) => r.value = v),
2910
- "columns-scheme": u,
2911
- "form-scheme": s,
2912
- "main-col-width": "250px",
2913
- "add-button": !1
2914
- }, null, 8, ["modelValue"])) : W("", !0),
2915
- D(Nn, {
2916
- visible: l.value,
2917
- "onUpdate:visible": h[1] || (h[1] = (v) => l.value = v),
2918
- selection: a.value,
2919
- "onUpdate:selection": h[2] || (h[2] = (v) => a.value = v),
2920
- fields: e.fields,
2921
- title: "Імпорт полів",
2922
- "id-prefix": "import-filter",
2923
- onConfirm: y,
2924
- onCancel: m
2925
- }, null, 8, ["visible", "selection", "fields"])
2926
- ]));
2927
- }
2928
- }), ea = /* @__PURE__ */ ae({
2929
- __name: "MapDataLayer",
2930
- props: {
2931
- id: {},
2932
- layer: {},
2933
- styleSpec: {},
2934
- autoCenter: { type: [Boolean, null] }
2935
- },
2936
- setup(e, { expose: n }) {
2937
- var p, h, v, k;
2938
- const { map: t, flyTo: i, setZoom: r } = Si(), o = ((h = (p = Ct()) == null ? void 0 : p.appContext.config.globalProperties) == null ? void 0 : h.$settings) || null, l = e, a = l.id;
2939
- String(l.id);
2940
- const u = `${location.origin}/api/vtile/${l.id}/ua/{z}/{x}/{y}.vmt?all=1`, s = Ge(a, {
2941
- source: {
2942
- type: "vector",
2943
- tiles: [u],
2944
- minzoom: 0,
2945
- maxzoom: 14
2946
- },
2947
- popup: l.layer.popup,
2948
- layer: {
2949
- // id: layerId,
2950
- // source: sourceId,
2951
- // 'source-layer': props.id,
2952
- style: (v = l.layer) == null ? void 0 : v.style
2953
- /* paint: {
2954
- 'circle-radius': 6,
2955
- 'circle-color': 'red',
2956
- } */
2957
- }
2958
- });
2959
- n({ layerHandle: s }), (l.autoCenter ?? !0) && i({ center: l.layer.center || ((k = o == null ? void 0 : o.map) == null ? void 0 : k.center) || [30, 50], animate: !1 });
2960
- let c = null;
2961
- function y() {
2962
- if (!(s != null && s.setTiles)) return;
2963
- const C = u.includes("?") ? "&" : "?", R = `${u}${C}_=${Date.now()}`;
2964
- s.setTiles([R]);
2965
- }
2966
- function m() {
2967
- c && clearTimeout(c), c = setTimeout(() => {
2968
- c = null, b().catch((C) => console.error("Failed to update map layer", C));
2969
- }, 300);
2970
- }
2971
- async function b() {
2972
- t.value && (y(), s.setStyle(l.styleSpec ?? null));
2973
- }
2974
- return $(() => l.styleSpec, m, { deep: !0 }), wt(() => {
2975
- s.remove();
2976
- }), (C, R) => null;
2977
- }
2978
- }), na = { class: "flex h-full bg-gradient-to-br from-slate-50 to-white" }, ta = { class: "flex-1 relative overflow-hidden" }, ia = { class: "absolute top-0 left-0 w-full z-20" }, ra = { class: "px-4 sm:px-6 py-4 border-b border-gray-200 bg-white shadow-sm" }, oa = { class: "flex items-start justify-between gap-4" }, la = { class: "flex-1 min-w-0" }, aa = { class: "flex items-center text-sm text-gray-500 mb-3" }, sa = { class: "text-gray-900 font-medium truncate max-w-xs" }, ua = { class: "flex items-center justify-between gap-4" }, ca = { class: "flex-1 min-w-0" }, fa = { class: "flex items-center gap-3 mb-1" }, da = { class: "text-base font-semibold text-gray-900 truncate" }, pa = {
2979
- key: 0,
2980
- class: "px-2 py-0.5 bg-green-50 border border-green-200 rounded flex-shrink-0"
2981
- }, ma = { class: "text-xs font-medium text-green-700" }, ha = ["title"], ga = { class: "w-full h-full bg-gradient-to-br from-sky-50 via-white to-blue-50 flex items-center justify-center relative pt-[115px]" }, ya = { class: "relative w-full h-full" }, va = { style: { top: "17px", left: "230px", position: "absolute", "z-index": "1" } }, ba = { class: "absolute top-4 left-4 z-20" }, xa = { class: "absolute top-[6.5rem] right-2 space-y-1 z-20" }, Sa = { class: "absolute bottom-4 left-4 z-20" }, ka = { class: "flex-1 flex flex-col h-full" }, Aa = { class: "px-3 pt-3 pb-2 border-b border-gray-100" }, Ca = { class: "items-center justify-center text-muted-foreground grid w-full grid-cols-6 h-12 p-1 bg-gray-50 rounded-xl shadow-sm" }, wa = ["aria-selected", "onClick"], Ta = { class: "leading-none" }, _a = { class: "flex flex-col flex-1 overflow-y-hidden p-3" }, Ea = "OpenGIS", St = 2, je = 5, Ia = 1e3, Na = /* @__PURE__ */ ae({
2982
- __name: "service",
2983
- props: {
2984
- hideServiceKey: { type: Boolean, default: !1 }
2985
- },
2986
- setup(e) {
2987
- var Gn, Wn;
2988
- const t = gi(e, "hideServiceKey"), i = bi(), r = xi(), { id: o } = i.params, l = E(null), a = E(null), u = E({}), s = E(null), c = ((Wn = (Gn = Ct()) == null ? void 0 : Gn.appContext.config.globalProperties) == null ? void 0 : Wn.$settings) || null;
2989
- function y(f) {
2990
- typeof document > "u" || (document.title = f ? `${f} — Сервіс` : Ea);
2991
- }
2992
- let m = null;
2993
- const b = E(!1);
2994
- function p() {
2995
- var f;
2996
- return (f = l.value) == null ? void 0 : f.ctx;
2997
- }
2998
- function h(f) {
2999
- typeof window > "u" || window.dispatchEvent(
3000
- new CustomEvent(Ii, {
3001
- detail: f
3002
- })
3003
- );
3004
- }
3005
- function v(f) {
3006
- var O, A, J;
3007
- const d = (A = (O = p()) == null ? void 0 : O.map) == null ? void 0 : A.value;
3008
- if (!d || !f) return [];
3009
- const S = (J = s.value) != null && J.service_id ? String(s.value.service_id) : null;
3010
- return (d.queryRenderedFeatures(f) || []).filter((N) => {
3011
- var Qn, Jn, Xn, Zn, et, nt;
3012
- const te = ((Qn = N == null ? void 0 : N.properties) == null ? void 0 : Qn.id) ?? (N == null ? void 0 : N.id);
3013
- if (te == null || !(N != null && N.source) || S && String(N.source) !== S) return !1;
3014
- const G = Ge(N.source) || Ge((Jn = N.layer) == null ? void 0 : Jn.id);
3015
- if (!G) return !1;
3016
- const ue = (Zn = (Xn = G == null ? void 0 : G.opts) == null ? void 0 : Xn.source) == null ? void 0 : Zn.type, Be = (nt = (et = G == null ? void 0 : G.opts) == null ? void 0 : et.layer) == null ? void 0 : nt.type;
3017
- return ue !== "raster" && Be !== "raster";
3018
- });
3019
- }
3020
- function k(f) {
3021
- const d = v(f == null ? void 0 : f.point);
3022
- h({
3023
- features: d,
3024
- externalItems: []
3025
- });
3026
- }
3027
- function C(f) {
3028
- if (Array.isArray(f)) return C(f[0]);
3029
- if (typeof f != "string" && typeof f != "number") return null;
3030
- const d = typeof f == "number" ? f : Number(f.trim());
3031
- return Number.isFinite(d) ? d : null;
3032
- }
3033
- function R(f, d) {
3034
- return f.toFixed(d);
3035
- }
3036
- function B(f, d, S) {
3037
- const I = 0.5 * 10 ** -S;
3038
- return Math.abs(f - d) > I;
3039
- }
3040
- function Ce() {
3041
- var N, te, G, ue;
3042
- const f = (te = (N = p()) == null ? void 0 : N.map) == null ? void 0 : te.value;
3043
- if (!f) return;
3044
- const d = C(i.query.z), S = C(i.query.x), I = C(i.query.y);
3045
- if (d == null || S == null || I == null) return;
3046
- const O = (G = f.getCenter) == null ? void 0 : G.call(f), A = (ue = f.getZoom) == null ? void 0 : ue.call(f);
3047
- (!O || B(O.lng, S, je) || B(O.lat, I, je) || B(A ?? 0, d, St)) && (b.value = !0, f.jumpTo({ center: [S, I], zoom: d }), b.value = !1);
3048
- }
3049
- function ge() {
3050
- var O, A, J, N;
3051
- if (b.value) return;
3052
- const f = (A = (O = p()) == null ? void 0 : O.map) == null ? void 0 : A.value;
3053
- if (!f) return;
3054
- const d = (J = f.getCenter) == null ? void 0 : J.call(f), S = (N = f.getZoom) == null ? void 0 : N.call(f);
3055
- if (!d || S == null) return;
3056
- const I = {
3057
- ...i.query,
3058
- z: R(S, St),
3059
- x: R(d.lng, je),
3060
- y: R(d.lat, je)
3061
- };
3062
- i.query.z === I.z && i.query.x === I.x && i.query.y === I.y || r.replace({ query: I });
3063
- }
3064
- const K = E(null), we = E(""), ye = E([]), on = E([]), Pe = E([]), ln = E("list"), an = E(""), Me = E([]), Ue = E(!0);
3065
- let se = null;
3066
- const H = ve(
3067
- () => {
3068
- var f, d;
3069
- return ((f = s.value) == null ? void 0 : f.id) ?? ((d = s.value) == null ? void 0 : d.service_id) ?? null;
3070
- }
3071
- ), Yn = ve(() => {
3072
- const f = (c == null ? void 0 : c.map) || null, d = (f == null ? void 0 : f.boundary) ?? null, S = (f == null ? void 0 : f.katottg) ?? null;
3073
- return !d && !S ? null : { boundary: d, katottg: S };
3074
- }), sn = ve(() => {
3075
- const f = s.value;
3076
- if (!f) return "";
3077
- const d = [];
3078
- !t.value && f.service_key && d.push(`Сервіс: ${f.service_key}`), f.description && d.push(f.description);
3079
- const S = f.group_name || f.group_id;
3080
- return S && d.push(`Група: ${S}`), typeof f.is_public < "u" && d.push(f.is_public ? "Публічний" : "Не публічний"), typeof f.is_active < "u" && d.push(f.is_active ? "Активний" : "Неактивний"), d.join(", ");
3081
- }), jn = ve(() => {
3082
- const f = s.value, d = (f == null ? void 0 : f.group_name) || (f == null ? void 0 : f.group_id);
3083
- return d ? String(d).toUpperCase() : "";
3084
- }), ti = ve(() => {
3085
- var S;
3086
- const f = (S = i.matched[i.matched.length - 1]) == null ? void 0 : S.path;
3087
- return (typeof f == "string" && f ? f : i.path).replace(/\/:id\??$/, "") || "/";
3088
- }), ii = ve(() => {
3089
- var d;
3090
- const f = (d = i.meta) == null ? void 0 : d.title;
3091
- return typeof f == "string" && f.trim() ? f : "Datasets";
3092
- });
3093
- function ri() {
3094
- r.push(ti.value);
3095
- }
3096
- const Kn = [
3097
- { key: "style", label: "Стиль", icon: Oi },
3098
- { key: "popup", label: "Попап", icon: Sl },
3099
- { key: "filter", label: "Фільтр", icon: wl },
3100
- { key: "legend", label: "Легенда", icon: yl },
3101
- { key: "card", label: "Картка", icon: Ri },
3102
- { key: "metadata", label: "Метадані", icon: Fi }
3103
- ], Hn = Kn.map((f) => f.key), z = E("style");
3104
- yi(async () => {
3105
- const f = i.query.tab;
3106
- f && Hn.includes(f) && (z.value = f), await qe(), oi();
3107
- });
3108
- async function oi() {
3109
- var I;
3110
- const f = p();
3111
- if (!(f != null && f.ready)) return;
3112
- await f.ready(), Ce();
3113
- const d = (I = f.map) == null ? void 0 : I.value;
3114
- if (!d) return;
3115
- const S = () => ge();
3116
- d.on("moveend", S), d.on("zoomend", S), d.on("click", k), m = () => {
3117
- d.off("moveend", S), d.off("zoomend", S), d.off("click", k);
3118
- };
3119
- }
3120
- $(
3121
- () => [i.query.z, i.query.x, i.query.y],
3122
- () => {
3123
- Ce();
3124
- }
3125
- ), $(z, (f) => {
3126
- i.query.tab !== f && r.replace({ query: { ...i.query, tab: f } });
3127
- }), $(
3128
- () => i.query.tab,
3129
- (f) => {
3130
- f && Hn.includes(f) && z.value !== f && (z.value = f);
3131
- }
3132
- ), $(
3133
- () => {
3134
- var f;
3135
- return (f = s.value) == null ? void 0 : f.name;
3136
- },
3137
- (f) => y(f),
3138
- { immediate: !0 }
3139
- );
3140
- function un(f) {
3141
- if (!f) return null;
3142
- try {
3143
- return JSON.parse(JSON.stringify(f));
3144
- } catch (d) {
3145
- return console.warn("Failed to clone style", d), null;
3146
- }
3147
- }
3148
- function cn(f) {
3149
- if (!f) return null;
3150
- if (typeof f == "string")
3151
- try {
3152
- return it(Dt(f) || null);
3153
- } catch (d) {
3154
- return console.warn("Failed to parse style yaml", d), null;
3155
- }
3156
- return it(un(f));
3157
- }
3158
- function li(f, d) {
3159
- try {
3160
- return JSON.stringify(f) === JSON.stringify(d);
3161
- } catch {
3162
- return !1;
3163
- }
3164
- }
3165
- function ai() {
3166
- var d;
3167
- if (!s.value) return;
3168
- const f = cn(K.value);
3169
- li(f, ((d = s.value) == null ? void 0 : d.style) ?? null) || (s.value = {
3170
- ...s.value,
3171
- style: f
3172
- });
3173
- }
3174
- function si() {
3175
- se && clearTimeout(se), se = setTimeout(() => {
3176
- se = null, ai();
3177
- }, Ia);
3178
- }
3179
- const qe = async () => {
3180
- try {
3181
- const f = await fetch(`/api/gis-service/${o}`);
3182
- if (!f.ok) throw new Error(`${f.status}`);
3183
- const d = await f.json();
3184
- u.value = d || {}, a.value = o;
3185
- const S = cn(d.style);
3186
- s.value = d ? { ...d, style: un(S) } : null, K.value = S, we.value = typeof (d == null ? void 0 : d.style) == "string" ? d.style : S ? ni(S) : "", on.value = (d == null ? void 0 : d.popup) || [], ln.value = d.card_mode === "html" ? "html" : "list", Pe.value = d.card, an.value = d.html, ye.value = (d == null ? void 0 : d.legend) || [], Me.value = (d == null ? void 0 : d.filters) || [];
3187
- } catch (f) {
3188
- console.error("Failed to fetch map info", f);
3189
- }
3190
- };
3191
- $(
3192
- () => {
3193
- var f;
3194
- return (f = s.value) == null ? void 0 : f.style;
3195
- },
3196
- (f) => {
3197
- K.value = cn(f);
3198
- },
3199
- { deep: !0 }
3200
- ), $(
3201
- () => K.value,
3202
- () => {
3203
- si();
3204
- },
3205
- { deep: !0 }
3206
- ), wt(() => {
3207
- se && (clearTimeout(se), se = null), m == null || m(), m = null;
3208
- });
3209
- async function ui(f) {
3210
- try {
3211
- const d = await fetch(`/api/gis-clear-vtile/${f}`), { message: S, error: I, code: O } = await d.json();
3212
- if (O === 200)
3213
- return X({ type: "success", title: "Успіх", message: S });
3214
- X({ type: "error", title: "Помилка", message: I });
3215
- } catch (d) {
3216
- X({
3217
- type: "error",
3218
- title: "Помилка",
3219
- message: "Не вдалося очистити тайли"
3220
- }), console.error(d);
3221
- }
3222
- }
3223
- async function Ve(f, d) {
3224
- await zn({ [f]: d }, f);
3225
- }
3226
- function ci() {
3227
- const f = un(K.value);
3228
- s.value = s.value ? { ...s.value, style: f } : s.value;
3229
- }
3230
- async function zn(f, d) {
3231
- if (s.value = {
3232
- ...s.value || {},
3233
- ...f
3234
- }, typeof f.html < "u" && (u.value = {
3235
- ...u.value || {},
3236
- html: f.html
3237
- }), !!H.value)
3238
- try {
3239
- if (!(await fetch(`/api/gis-service/${H.value}`, {
3240
- method: "PUT",
3241
- headers: { "Content-Type": "application/json" },
3242
- body: JSON.stringify(f)
3243
- })).ok) throw new Error("Save failed");
3244
- X({
3245
- type: "success",
3246
- title: "Успіх",
3247
- message: `${d} saved`
3248
- }), await qe();
3249
- } catch (S) {
3250
- X({
3251
- type: "error",
3252
- title: "Помилка",
3253
- message: `Failed to save ${d}`
3254
- }), console.error(S);
3255
- }
3256
- }
3257
- async function fi(f, d) {
3258
- if (f !== "card") {
3259
- await Ve(f, d);
3260
- return;
3261
- }
3262
- const S = (d == null ? void 0 : d.card_mode) === "html" ? "html" : "list", I = S === "html" && typeof (d == null ? void 0 : d.html) == "string" ? d.html : "", O = (S === "html" ? [] : null) || (Array.isArray(d == null ? void 0 : d.list) ? d.list : []);
3263
- Pe.value = O, ln.value = S, an.value = I;
3264
- const A = {
3265
- card_mode: S
3266
- };
3267
- S === "html" && (A.html = I), S === "list" && (A.card = O), await zn(A, "card");
3268
- }
3269
- return (f, d) => {
3270
- var S, I, O;
3271
- return _(), M("div", na, [
3272
- g("div", ta, [
3273
- g("div", ia, [
3274
- g("div", ra, [
3275
- g("div", oa, [
3276
- g("div", la, [
3277
- g("div", aa, [
3278
- g("button", {
3279
- type: "button",
3280
- class: "hover:text-gray-700 cursor-pointer transition-colors",
3281
- onClick: ri
3282
- }, fe(ii.value), 1),
3283
- d[10] || (d[10] = g("svg", {
3284
- xmlns: "http://www.w3.org/2000/svg",
3285
- width: "24",
3286
- height: "24",
3287
- viewBox: "0 0 24 24",
3288
- fill: "none",
3289
- stroke: "currentColor",
3290
- "stroke-width": "2",
3291
- "stroke-linecap": "round",
3292
- "stroke-linejoin": "round",
3293
- class: "lucide lucide-chevron-right w-4 h-4 mx-1"
3294
- }, [
3295
- g("path", { d: "m9 18 6-6-6-6" })
3296
- ], -1)),
3297
- g("span", sa, fe(((S = s.value) == null ? void 0 : S.name) || "Dataset"), 1)
3298
- ]),
3299
- g("div", ua, [
3300
- g("div", ca, [
3301
- g("div", fa, [
3302
- g("h1", da, fe(((I = s.value) == null ? void 0 : I.name) || "Dataset"), 1),
3303
- jn.value ? (_(), M("div", pa, [
3304
- g("span", ma, fe(jn.value), 1)
3305
- ])) : W("", !0)
3306
- ]),
3307
- sn.value ? (_(), M("p", {
3308
- key: 0,
3309
- class: "text-xs text-gray-500 truncate",
3310
- title: sn.value
3311
- }, fe(sn.value), 9, ha)) : W("", !0)
3312
- ])
3313
- ])
3314
- ]),
3315
- H.value ? (_(), P(Ni, {
3316
- key: 0,
3317
- class: "flex-shrink-0",
3318
- "entity-id": H.value,
3319
- "entity-info": { name: (O = s.value) == null ? void 0 : O.name },
3320
- table: "gis.services.table",
3321
- "entity-label": "Сервіс",
3322
- "save-method": "put",
3323
- "show-xml-item": !1,
3324
- "clear-tiles-handler": ui,
3325
- onSaved: qe
3326
- }, null, 8, ["entity-id", "entity-info"])) : W("", !0)
3327
- ])
3328
- ])
3329
- ]),
3330
- g("div", ga, [
3331
- g("div", ya, [
3332
- D(ki, {
3333
- ref_key: "mapViewRef",
3334
- ref: l
3335
- }, {
3336
- default: bn(() => {
3337
- var A, J, N, te, G, ue, Be;
3338
- return [
3339
- (A = s.value) != null && A.service_id ? (_(), P(ea, {
3340
- key: 0,
3341
- id: (J = s.value) == null ? void 0 : J.service_id,
3342
- layer: s.value,
3343
- "style-spec": ((N = s.value) == null ? void 0 : N.style) || null,
3344
- autoCenter: !1
3345
- }, null, 8, ["id", "layer", "style-spec"])) : W("", !0),
3346
- H.value ? (_(), P(Ai, {
3347
- key: 1,
3348
- "layer-id": H.value,
3349
- boundary: ((te = s.value) == null ? void 0 : te.boundary) || ((G = Yn.value) == null ? void 0 : G.boundary) || null,
3350
- katottg: ((ue = s.value) == null ? void 0 : ue.katottg) || ((Be = Yn.value) == null ? void 0 : Be.katottg) || null
3351
- }, null, 8, ["layer-id", "boundary", "katottg"])) : W("", !0),
3352
- g("div", va, [
3353
- H.value ? (_(), P(Ci, {
3354
- key: 0,
3355
- "layer-id": H.value,
3356
- filters: Me.value
3357
- }, null, 8, ["layer-id", "filters"])) : W("", !0)
3358
- ]),
3359
- d[11] || (d[11] = g("div", {
3360
- id: "map-filter-popover-host",
3361
- class: "map-widget__filter-host"
3362
- }, null, -1)),
3363
- g("div", ba, [
3364
- D(wi)
3365
- ]),
3366
- g("div", xa, [
3367
- D(tt),
3368
- u.value.center ? (_(), P(tt, {
3369
- key: 0,
3370
- targetCenter: u.value.center,
3371
- targetLabel: "Ценр даних"
3372
- }, null, 8, ["targetCenter"])) : W("", !0)
3373
- ]),
3374
- g("div", Sa, [
3375
- D(Ti, {
3376
- items: ye.value || null
3377
- }, null, 8, ["items"])
3378
- ]),
3379
- D(_i),
3380
- D(Ei, {
3381
- html: u.value.html
3382
- }, null, 8, ["html"])
3383
- ];
3384
- }),
3385
- _: 1
3386
- }, 512)
3387
- ])
3388
- ]),
3389
- D($i, {
3390
- open: Ue.value,
3391
- onToggle: d[0] || (d[0] = (A) => Ue.value = !Ue.value),
3392
- "top-class": "top-4"
3393
- }, null, 8, ["open"])
3394
- ]),
3395
- g("div", {
3396
- class: _e(["bg-white border-l border-gray-100 flex flex-col overflow-hidden shadow-lg flex-shrink-0 transition-[width] duration-100 ease-in-out", Ue.value ? "w-[650px]" : "w-0"])
3397
- }, [
3398
- g("div", ka, [
3399
- g("div", Aa, [
3400
- g("div", Ca, [
3401
- (_(), M(kt, null, At(Kn, (A) => g("button", {
3402
- key: A.key,
3403
- type: "button",
3404
- role: "tab",
3405
- "aria-selected": z.value === A.key,
3406
- class: _e([
3407
- "whitespace-nowrap flex flex-col items-center justify-center gap-0.5 py-1 px-1 text-[9px] font-medium transition-all duration-300 hover:bg-white/70 rounded-lg group",
3408
- z.value === A.key ? "bg-white shadow-sm text-gray-700" : ""
3409
- ]),
3410
- onClick: (J) => z.value = A.key
3411
- }, [
3412
- (_(), P(vi(A.icon), { class: "h-3.5 w-3.5 mb-0.5" })),
3413
- g("span", Ta, fe(A.label), 1)
3414
- ], 10, wa)), 64))
3415
- ])
3416
- ]),
3417
- g("div", _a, [
3418
- z.value === "style" ? (_(), P(Ll, {
3419
- key: 0,
3420
- token: H.value,
3421
- "style-text": we.value,
3422
- "style-yaml": K.value,
3423
- "onUpdate:styleYaml": d[1] || (d[1] = (A) => K.value = A),
3424
- "onUpdate:styleText": d[2] || (d[2] = (A) => we.value = A),
3425
- onUpdate: ci
3426
- }, null, 8, ["token", "style-text", "style-yaml"])) : z.value === "legend" ? (_(), P(Yl, {
3427
- key: 1,
3428
- token: H.value,
3429
- columns: ye.value,
3430
- "onUpdate:columns": d[3] || (d[3] = (A) => ye.value = A),
3431
- onSave: d[4] || (d[4] = (A) => Ve("legend", A))
3432
- }, null, 8, ["token", "columns"])) : z.value === "popup" ? (_(), P(Rl, {
3433
- key: 2,
3434
- token: H.value,
3435
- columns: on.value,
3436
- fields: u.value.fields,
3437
- "onUpdate:columns": d[5] || (d[5] = (A) => on.value = A),
3438
- onSave: d[6] || (d[6] = (A) => Ve("popup", A))
3439
- }, null, 8, ["token", "columns", "fields"])) : z.value === "card" ? (_(), P(Jl, {
3440
- key: 3,
3441
- token: H.value,
3442
- columns: Pe.value,
3443
- fields: u.value.fields,
3444
- "view-mode": ln.value,
3445
- html: an.value,
3446
- "onUpdate:columns": d[7] || (d[7] = (A) => Pe.value = A),
3447
- onSave: fi
3448
- }, null, 8, ["token", "columns", "fields", "view-mode", "html"])) : z.value === "filter" ? (_(), P(Zl, {
3449
- key: 4,
3450
- token: H.value,
3451
- fields: u.value.fields,
3452
- columns: Me.value,
3453
- "onUpdate:columns": d[8] || (d[8] = (A) => Me.value = A),
3454
- onSave: d[9] || (d[9] = (A) => Ve("filters", A))
3455
- }, null, 8, ["token", "fields", "columns"])) : z.value === "metadata" ? (_(), P(Li, {
3456
- key: 5,
3457
- data: s.value,
3458
- "entity-id": String(ze(o)),
3459
- "entity-type": "service",
3460
- onSaved: qe
3461
- }, null, 8, ["data", "entity-id"])) : W("", !0)
3462
- ])
3463
- ])
3464
- ], 2)
3465
- ]);
3466
- };
3467
- }
3468
- }), Ba = /* @__PURE__ */ Xe(Na, [["__scopeId", "data-v-ae471f34"]]);
3469
- export {
3470
- Ba as default
3471
- };