@opengis/cms 0.0.35 → 0.0.36

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.
@@ -0,0 +1,1375 @@
1
+ import { openBlock as w, createElementBlock as F, createStaticVNode as Re, defineComponent as D, ref as k, normalizeClass as B, createTextVNode as Z, toDisplayString as _, createCommentVNode as $, createBlock as O, unref as y, withModifiers as Y, createVNode as b, createElementVNode as v, withDirectives as Me, withKeys as te, vModelText as Ue, watch as De, resolveComponent as Ye, withCtx as j, nextTick as ne, mergeModels as Be, useModel as pe, onBeforeMount as $e, Fragment as Pe, computed as He, onMounted as Ve } from "vue";
2
+ import { c as ve, a as qe, b as je, T as Ke, u as V, d as Ge, Z as Qe, J as We, l as X, y as I, P as ze, Q as he, e as ge, A as Ze, H as Xe, S as Je } from "./index-7TVhDCPx.js";
3
+ import { useRouter as er, useRoute as rr } from "vue-router";
4
+ /**
5
+ * @license lucide-vue-next v0.344.0 - ISC
6
+ *
7
+ * This source code is licensed under the ISC license.
8
+ * See the LICENSE file in the root directory of this source tree.
9
+ */
10
+ const tr = ve("CheckIcon", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
11
+ /**
12
+ * @license lucide-vue-next v0.344.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */
17
+ const nr = ve("XIcon", [
18
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
19
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
20
+ ]), ir = {}, lr = {
21
+ xmlns: "http://www.w3.org/2000/svg",
22
+ width: "24",
23
+ height: "24",
24
+ viewBox: "0 0 24 24",
25
+ fill: "none",
26
+ stroke: "currentColor",
27
+ "stroke-width": "2",
28
+ "stroke-linecap": "round",
29
+ "stroke-linejoin": "round"
30
+ };
31
+ function ar(e, r) {
32
+ return w(), F("svg", lr, [...r[0] || (r[0] = [
33
+ Re('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>', 6)
34
+ ])]);
35
+ }
36
+ const ur = /* @__PURE__ */ qe(ir, [["render", ar]]), or = {
37
+ key: 0,
38
+ class: "p-3 flex items-center gap-x-3 cursor-grab bg-gray-100 border border-gray-300 rounded-lg font-medium text-sm text-gray-800 dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-200"
39
+ }, sr = {
40
+ key: 0,
41
+ class: "text-xs text-gray-500 dark:text-neutral-400 ml-2"
42
+ }, cr = {
43
+ key: 1,
44
+ class: "p-3 flex items-center gap-x-2 bg-gray-100 border border-gray-300 rounded-lg dark:bg-neutral-900 dark:border-neutral-700"
45
+ }, fr = { class: "text-sm font-medium text-gray-800 dark:text-neutral-200 shrink-0" }, dr = /* @__PURE__ */ D({
46
+ __name: "MenuItem",
47
+ props: {
48
+ title: {},
49
+ value: {}
50
+ },
51
+ emits: ["delete", "update:value"],
52
+ setup(e, { emit: r }) {
53
+ const t = e, i = r, n = k(!1), a = k(""), l = () => {
54
+ typeof t.value == "string" && (a.value = t.value, n.value = !0);
55
+ }, u = () => {
56
+ typeof t.value == "string" && (i("update:value", a.value), n.value = !1);
57
+ }, o = () => {
58
+ n.value = !1, a.value = "";
59
+ };
60
+ return (s, d) => (w(), F("div", {
61
+ class: B([{ "space-y-1": typeof s.value != "string" }, "dark:bg-transparent"])
62
+ }, [
63
+ n.value ? (w(), F("div", cr, [
64
+ v("span", fr, _(s.title) + ":", 1),
65
+ Me(v("input", {
66
+ "onUpdate:modelValue": d[1] || (d[1] = (p) => a.value = p),
67
+ onKeyup: [
68
+ te(u, ["enter"]),
69
+ te(o, ["esc"])
70
+ ],
71
+ onBlur: u,
72
+ class: "flex-1 px-2 py-1 text-sm border border-gray-300 rounded dark:bg-neutral-800 dark:border-neutral-600 dark:text-neutral-200 focus:outline-none focus:ring-2 focus:ring-blue-500",
73
+ type: "text",
74
+ placeholder: "/link"
75
+ }, null, 544), [
76
+ [Ue, a.value]
77
+ ]),
78
+ v("button", {
79
+ onClick: Y(u, ["stop"]),
80
+ class: "shrink-0 p-1 text-green-600 dark:text-green-400 hover:bg-green-50 dark:hover:bg-green-900/20 rounded",
81
+ title: "Save"
82
+ }, [
83
+ b(y(tr), { class: "size-4" })
84
+ ]),
85
+ v("button", {
86
+ onClick: Y(o, ["stop"]),
87
+ class: "shrink-0 p-1 text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded",
88
+ title: "Cancel"
89
+ }, [
90
+ b(y(nr), { class: "size-4" })
91
+ ])
92
+ ])) : (w(), F("div", or, [
93
+ Z(_(s.title) + " ", 1),
94
+ typeof s.value == "string" ? (w(), F("span", sr, _(s.value), 1)) : $("", !0),
95
+ typeof s.value == "string" ? (w(), O(y(je), {
96
+ key: 1,
97
+ class: "shrink-0 size-4 ml-auto text-gray-500 dark:text-neutral-500 cursor-pointer hover:text-blue-600 dark:hover:text-blue-400",
98
+ onClick: Y(l, ["stop"])
99
+ })) : $("", !0),
100
+ b(y(Ke), {
101
+ class: "shrink-0 size-4 text-gray-500 dark:text-neutral-500 cursor-pointer hover:text-red-600 dark:hover:text-red-400",
102
+ onClick: d[0] || (d[0] = Y((p) => i("delete"), ["stop"]))
103
+ }),
104
+ b(ur, { class: "shrink-0 size-4 cursor-pointer text-gray-500 dark:text-neutral-500" })
105
+ ]))
106
+ ], 2));
107
+ }
108
+ }), mr = { class: "space-y-1" }, pr = /* @__PURE__ */ D({
109
+ __name: "MenuList",
110
+ props: {
111
+ list: {
112
+ type: Array,
113
+ default: () => []
114
+ },
115
+ inside: {
116
+ type: Boolean,
117
+ default: !1
118
+ }
119
+ },
120
+ emits: ["update:list", "delete:item"],
121
+ setup(e, { emit: r }) {
122
+ const { t } = V(), i = e, n = r, a = k([]);
123
+ De(
124
+ () => i.list,
125
+ (d) => {
126
+ a.value = d ? [...d] : [];
127
+ },
128
+ { immediate: !0, deep: !0 }
129
+ );
130
+ const l = () => {
131
+ n("update:list", a.value);
132
+ }, u = (d) => {
133
+ Qe({
134
+ title: t("cms.builder.deleteTitle"),
135
+ message: t("cms.builder.deleteObject"),
136
+ type: "error",
137
+ onConfirm: () => {
138
+ n("update:list", a.value), n("delete:item", d);
139
+ }
140
+ });
141
+ }, o = (d, p) => {
142
+ d.value = p, ne(() => {
143
+ a.value = [...a.value], n("update:list", a.value);
144
+ });
145
+ }, s = (d, p) => {
146
+ d.children = p, ne(() => {
147
+ a.value = [...a.value], n("update:list", a.value);
148
+ });
149
+ };
150
+ return (d, p) => {
151
+ const c = Ye("MenuList", !0);
152
+ return w(), O(y(Ge), {
153
+ tag: "ul",
154
+ list: a.value,
155
+ group: { name: "nested", pull: !0, put: !0 },
156
+ "item-key": "id",
157
+ class: B(["nested-sortable space-y-1", { "ps-5 dark:bg-transparent": e.inside }]),
158
+ onChange: l,
159
+ onEnd: l
160
+ }, {
161
+ item: j(({ element: m }) => [
162
+ v("div", mr, [
163
+ b(dr, {
164
+ title: m.title,
165
+ value: m.value,
166
+ onDelete: (f) => u(m),
167
+ "onUpdate:value": (f) => o(m, f)
168
+ }, null, 8, ["title", "value", "onDelete", "onUpdate:value"]),
169
+ Array.isArray(m.children) ? (w(), O(c, {
170
+ key: 0,
171
+ list: m.children,
172
+ inside: !0,
173
+ "onUpdate:list": (f) => s(m, f),
174
+ "onDelete:item": u
175
+ }, null, 8, ["list", "onUpdate:list"])) : $("", !0)
176
+ ])
177
+ ]),
178
+ _: 1
179
+ }, 8, ["list", "class"]);
180
+ };
181
+ }
182
+ }), vr = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, hr = /* @__PURE__ */ D({
183
+ __name: "AddNewItemInTree",
184
+ props: {
185
+ isOpen: { type: Boolean, required: !0 },
186
+ isOpenModifiers: {}
187
+ },
188
+ emits: /* @__PURE__ */ Be(["addNewItem"], ["update:isOpen"]),
189
+ setup(e, { emit: r }) {
190
+ const { t } = V(), i = pe(e, "isOpen"), n = k({}), a = r, l = k({}), u = {
191
+ title: {
192
+ type: "text",
193
+ label: t("cms.menu.form.name"),
194
+ required: !0,
195
+ placeholder: t("cms.menu.form.name"),
196
+ validators: ["required"]
197
+ },
198
+ value: {
199
+ type: "text",
200
+ label: t("cms.menu.form.value"),
201
+ required: !0,
202
+ placeholder: t("cms.menu.form.value"),
203
+ validators: ["required"]
204
+ }
205
+ }, o = async () => {
206
+ if (await n.value.validate()) {
207
+ I({
208
+ type: "warning",
209
+ title: t("cms.common.actions.warning"),
210
+ message: t("cms.menu.createMenuFailed")
211
+ });
212
+ return;
213
+ }
214
+ a("addNewItem", l.value), l.value = {};
215
+ };
216
+ return (s, d) => (w(), O(y(We), {
217
+ teleport: "#modal",
218
+ visible: i.value,
219
+ title: s.$t("cms.menu.createMenu"),
220
+ template: "default",
221
+ closeClickBack: !1,
222
+ onClose: d[3] || (d[3] = (p) => i.value = !1)
223
+ }, {
224
+ footer: j(() => [
225
+ v("div", vr, [
226
+ v("button", {
227
+ class: "inline-flex items-center px-3 py-2 text-sm text-black duration-300 border border-gray-200 rounded-lg gap-x-2 whitespace-nowrap hover:bg-gray-100",
228
+ onClick: d[2] || (d[2] = (p) => {
229
+ i.value = !1, l.value = {};
230
+ })
231
+ }, _(s.$t("cms.common.actions.cancel")), 1),
232
+ v("button", {
233
+ onClick: o,
234
+ class: "py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"
235
+ }, _(s.$t("cms.common.actions.save")), 1)
236
+ ])
237
+ ]),
238
+ default: j(() => [
239
+ b(y(X), {
240
+ form: n.value,
241
+ "onUpdate:form": d[0] || (d[0] = (p) => n.value = p),
242
+ modelValue: l.value,
243
+ "onUpdate:modelValue": d[1] || (d[1] = (p) => l.value = p),
244
+ schema: u
245
+ }, null, 8, ["form", "modelValue"])
246
+ ]),
247
+ _: 1
248
+ }, 8, ["visible", "title"]));
249
+ }
250
+ }), gr = /* @__PURE__ */ D({
251
+ __name: "MenuBody",
252
+ props: {
253
+ modelValue: {},
254
+ modelModifiers: {}
255
+ },
256
+ emits: ["update:modelValue"],
257
+ setup(e) {
258
+ he["vs-input-monaco-editor"] = ge;
259
+ const { t: r } = V(), t = k(!1), i = k(null), n = pe(e, "modelValue"), a = k({}), l = async (c) => {
260
+ try {
261
+ if (await a.value.validate()) {
262
+ I({
263
+ type: "warning",
264
+ title: r("cms.common.actions.warning"),
265
+ message: r("cms.menu.createMenuFailed")
266
+ });
267
+ return;
268
+ }
269
+ t.value = !1, c.id = Math.random().toString(36).substr(2, 9), c.children = [], n.value.items.unshift(c);
270
+ } catch (m) {
271
+ console.log(m);
272
+ }
273
+ }, u = k([
274
+ {
275
+ key: "name",
276
+ title: r("cms.common.title"),
277
+ type: "text",
278
+ placeholder: r("cms.common.title"),
279
+ required: !0,
280
+ validators: ["required"]
281
+ },
282
+ {
283
+ key: "description",
284
+ title: r("cms.common.description"),
285
+ type: "text",
286
+ placeholder: r("cms.common.description"),
287
+ required: !0,
288
+ validators: ["required"]
289
+ },
290
+ {
291
+ key: "locale",
292
+ title: r("cms.menu.form.language"),
293
+ type: "select",
294
+ placeholder: r("cms.menu.form.language"),
295
+ required: !0,
296
+ options: [
297
+ { text: "Ukrainian", id: "uk" },
298
+ { text: "English", id: "en" }
299
+ ],
300
+ validators: ["required"]
301
+ }
302
+ ]), o = (c) => {
303
+ let m = [];
304
+ for (const f in c)
305
+ typeof c[f] == "object" ? m.push({
306
+ title: f,
307
+ value: "",
308
+ id: Math.random().toString(36).substr(2, 9),
309
+ children: o(c[f])
310
+ }) : m.push({
311
+ title: f,
312
+ value: c[f],
313
+ id: Math.random().toString(36).substr(2, 9),
314
+ children: []
315
+ });
316
+ return m;
317
+ }, s = (c) => {
318
+ n.value.items = c;
319
+ }, d = (c) => {
320
+ p(n.value.items, c.id);
321
+ };
322
+ function p(c, m) {
323
+ for (let f = c.length - 1; f >= 0; f--) {
324
+ if (c[f].id === m)
325
+ return c.splice(f, 1), !0;
326
+ if (c[f].children && c[f].children.length && p(c[f].children, m))
327
+ return !0;
328
+ }
329
+ return !1;
330
+ }
331
+ return $e(() => {
332
+ Array.isArray(n.value.items) || (n.value.items = o(n.value.items));
333
+ }), (c, m) => (w(), F(Pe, null, [
334
+ b(y(X), {
335
+ schema: u.value,
336
+ modelValue: n.value,
337
+ "onUpdate:modelValue": m[0] || (m[0] = (f) => n.value = f),
338
+ form: a.value,
339
+ "onUpdate:form": m[1] || (m[1] = (f) => a.value = f)
340
+ }, null, 8, ["schema", "modelValue", "form"]),
341
+ v("button", {
342
+ onClick: m[2] || (m[2] = (f) => t.value = !0),
343
+ class: "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium w-min ml-auto my-6 h-9 px-4 py-2 bg-blue-600 text-white shadow-md transition-all duration-200 transform hover:bg-blue-700 hover:shadow-lg hover:scale-105 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"
344
+ }, [
345
+ b(y(ze), { class: "w-4 h-4 mr-2" }),
346
+ Z(" " + _(c.$t("cms.menu.createMenu")), 1)
347
+ ]),
348
+ b(hr, {
349
+ isOpen: t.value,
350
+ "onUpdate:isOpen": m[3] || (m[3] = (f) => t.value = f),
351
+ form: i.value,
352
+ "onUpdate:form": m[4] || (m[4] = (f) => i.value = f),
353
+ onAddNewItem: l
354
+ }, null, 8, ["isOpen", "form"]),
355
+ b(pr, {
356
+ class: "px-2",
357
+ list: n.value.items,
358
+ "onUpdate:list": s,
359
+ "onDelete:item": d
360
+ }, null, 8, ["list"])
361
+ ], 64));
362
+ }
363
+ });
364
+ /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
365
+ function xe(e) {
366
+ return typeof e > "u" || e === null;
367
+ }
368
+ function xr(e) {
369
+ return typeof e == "object" && e !== null;
370
+ }
371
+ function yr(e) {
372
+ return Array.isArray(e) ? e : xe(e) ? [] : [e];
373
+ }
374
+ function wr(e, r) {
375
+ var t, i, n, a;
376
+ if (r)
377
+ for (a = Object.keys(r), t = 0, i = a.length; t < i; t += 1)
378
+ n = a[t], e[n] = r[n];
379
+ return e;
380
+ }
381
+ function kr(e, r) {
382
+ var t = "", i;
383
+ for (i = 0; i < r; i += 1)
384
+ t += e;
385
+ return t;
386
+ }
387
+ function br(e) {
388
+ return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
389
+ }
390
+ var Ar = xe, _r = xr, Er = yr, Fr = kr, Cr = br, Sr = wr, C = {
391
+ isNothing: Ar,
392
+ isObject: _r,
393
+ toArray: Er,
394
+ repeat: Fr,
395
+ isNegativeZero: Cr,
396
+ extend: Sr
397
+ };
398
+ function ye(e, r) {
399
+ var t = "", i = e.reason || "(unknown reason)";
400
+ return e.mark ? (e.mark.name && (t += 'in "' + e.mark.name + '" '), t += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !r && e.mark.snippet && (t += `
401
+
402
+ ` + e.mark.snippet), i + " " + t) : i;
403
+ }
404
+ function L(e, r) {
405
+ Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = r, this.message = ye(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
406
+ }
407
+ L.prototype = Object.create(Error.prototype);
408
+ L.prototype.constructor = L;
409
+ L.prototype.toString = function(r) {
410
+ return this.name + ": " + ye(this, r);
411
+ };
412
+ var A = L, Nr = [
413
+ "kind",
414
+ "multi",
415
+ "resolve",
416
+ "construct",
417
+ "instanceOf",
418
+ "predicate",
419
+ "represent",
420
+ "representName",
421
+ "defaultStyle",
422
+ "styleAliases"
423
+ ], Or = [
424
+ "scalar",
425
+ "sequence",
426
+ "mapping"
427
+ ];
428
+ function Tr(e) {
429
+ var r = {};
430
+ return e !== null && Object.keys(e).forEach(function(t) {
431
+ e[t].forEach(function(i) {
432
+ r[String(i)] = t;
433
+ });
434
+ }), r;
435
+ }
436
+ function Ir(e, r) {
437
+ if (r = r || {}, Object.keys(r).forEach(function(t) {
438
+ if (Nr.indexOf(t) === -1)
439
+ throw new A('Unknown option "' + t + '" is met in definition of "' + e + '" YAML type.');
440
+ }), this.options = r, this.tag = e, this.kind = r.kind || null, this.resolve = r.resolve || function() {
441
+ return !0;
442
+ }, this.construct = r.construct || function(t) {
443
+ return t;
444
+ }, this.instanceOf = r.instanceOf || null, this.predicate = r.predicate || null, this.represent = r.represent || null, this.representName = r.representName || null, this.defaultStyle = r.defaultStyle || null, this.multi = r.multi || !1, this.styleAliases = Tr(r.styleAliases || null), Or.indexOf(this.kind) === -1)
445
+ throw new A('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
446
+ }
447
+ var g = Ir;
448
+ function ie(e, r) {
449
+ var t = [];
450
+ return e[r].forEach(function(i) {
451
+ var n = t.length;
452
+ t.forEach(function(a, l) {
453
+ a.tag === i.tag && a.kind === i.kind && a.multi === i.multi && (n = l);
454
+ }), t[n] = i;
455
+ }), t;
456
+ }
457
+ function Lr() {
458
+ var e = {
459
+ scalar: {},
460
+ sequence: {},
461
+ mapping: {},
462
+ fallback: {},
463
+ multi: {
464
+ scalar: [],
465
+ sequence: [],
466
+ mapping: [],
467
+ fallback: []
468
+ }
469
+ }, r, t;
470
+ function i(n) {
471
+ n.multi ? (e.multi[n.kind].push(n), e.multi.fallback.push(n)) : e[n.kind][n.tag] = e.fallback[n.tag] = n;
472
+ }
473
+ for (r = 0, t = arguments.length; r < t; r += 1)
474
+ arguments[r].forEach(i);
475
+ return e;
476
+ }
477
+ function K(e) {
478
+ return this.extend(e);
479
+ }
480
+ K.prototype.extend = function(r) {
481
+ var t = [], i = [];
482
+ if (r instanceof g)
483
+ i.push(r);
484
+ else if (Array.isArray(r))
485
+ i = i.concat(r);
486
+ else if (r && (Array.isArray(r.implicit) || Array.isArray(r.explicit)))
487
+ r.implicit && (t = t.concat(r.implicit)), r.explicit && (i = i.concat(r.explicit));
488
+ else
489
+ throw new A("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
490
+ t.forEach(function(a) {
491
+ if (!(a instanceof g))
492
+ throw new A("Specified list of YAML types (or a single Type object) contains a non-Type object.");
493
+ if (a.loadKind && a.loadKind !== "scalar")
494
+ throw new A("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
495
+ if (a.multi)
496
+ throw new A("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
497
+ }), i.forEach(function(a) {
498
+ if (!(a instanceof g))
499
+ throw new A("Specified list of YAML types (or a single Type object) contains a non-Type object.");
500
+ });
501
+ var n = Object.create(K.prototype);
502
+ return n.implicit = (this.implicit || []).concat(t), n.explicit = (this.explicit || []).concat(i), n.compiledImplicit = ie(n, "implicit"), n.compiledExplicit = ie(n, "explicit"), n.compiledTypeMap = Lr(n.compiledImplicit, n.compiledExplicit), n;
503
+ };
504
+ var Rr = K, Mr = new g("tag:yaml.org,2002:str", {
505
+ kind: "scalar",
506
+ construct: function(e) {
507
+ return e !== null ? e : "";
508
+ }
509
+ }), Ur = new g("tag:yaml.org,2002:seq", {
510
+ kind: "sequence",
511
+ construct: function(e) {
512
+ return e !== null ? e : [];
513
+ }
514
+ }), Dr = new g("tag:yaml.org,2002:map", {
515
+ kind: "mapping",
516
+ construct: function(e) {
517
+ return e !== null ? e : {};
518
+ }
519
+ }), Yr = new Rr({
520
+ explicit: [
521
+ Mr,
522
+ Ur,
523
+ Dr
524
+ ]
525
+ });
526
+ function Br(e) {
527
+ if (e === null)
528
+ return !0;
529
+ var r = e.length;
530
+ return r === 1 && e === "~" || r === 4 && (e === "null" || e === "Null" || e === "NULL");
531
+ }
532
+ function $r() {
533
+ return null;
534
+ }
535
+ function Pr(e) {
536
+ return e === null;
537
+ }
538
+ var Hr = new g("tag:yaml.org,2002:null", {
539
+ kind: "scalar",
540
+ resolve: Br,
541
+ construct: $r,
542
+ predicate: Pr,
543
+ represent: {
544
+ canonical: function() {
545
+ return "~";
546
+ },
547
+ lowercase: function() {
548
+ return "null";
549
+ },
550
+ uppercase: function() {
551
+ return "NULL";
552
+ },
553
+ camelcase: function() {
554
+ return "Null";
555
+ },
556
+ empty: function() {
557
+ return "";
558
+ }
559
+ },
560
+ defaultStyle: "lowercase"
561
+ });
562
+ function Vr(e) {
563
+ if (e === null)
564
+ return !1;
565
+ var r = e.length;
566
+ return r === 4 && (e === "true" || e === "True" || e === "TRUE") || r === 5 && (e === "false" || e === "False" || e === "FALSE");
567
+ }
568
+ function qr(e) {
569
+ return e === "true" || e === "True" || e === "TRUE";
570
+ }
571
+ function jr(e) {
572
+ return Object.prototype.toString.call(e) === "[object Boolean]";
573
+ }
574
+ var Kr = new g("tag:yaml.org,2002:bool", {
575
+ kind: "scalar",
576
+ resolve: Vr,
577
+ construct: qr,
578
+ predicate: jr,
579
+ represent: {
580
+ lowercase: function(e) {
581
+ return e ? "true" : "false";
582
+ },
583
+ uppercase: function(e) {
584
+ return e ? "TRUE" : "FALSE";
585
+ },
586
+ camelcase: function(e) {
587
+ return e ? "True" : "False";
588
+ }
589
+ },
590
+ defaultStyle: "lowercase"
591
+ });
592
+ function Gr(e) {
593
+ return 48 <= e && e <= 57 || 65 <= e && e <= 70 || 97 <= e && e <= 102;
594
+ }
595
+ function Qr(e) {
596
+ return 48 <= e && e <= 55;
597
+ }
598
+ function Wr(e) {
599
+ return 48 <= e && e <= 57;
600
+ }
601
+ function zr(e) {
602
+ if (e === null)
603
+ return !1;
604
+ var r = e.length, t = 0, i = !1, n;
605
+ if (!r)
606
+ return !1;
607
+ if (n = e[t], (n === "-" || n === "+") && (n = e[++t]), n === "0") {
608
+ if (t + 1 === r)
609
+ return !0;
610
+ if (n = e[++t], n === "b") {
611
+ for (t++; t < r; t++)
612
+ if (n = e[t], n !== "_") {
613
+ if (n !== "0" && n !== "1")
614
+ return !1;
615
+ i = !0;
616
+ }
617
+ return i && n !== "_";
618
+ }
619
+ if (n === "x") {
620
+ for (t++; t < r; t++)
621
+ if (n = e[t], n !== "_") {
622
+ if (!Gr(e.charCodeAt(t)))
623
+ return !1;
624
+ i = !0;
625
+ }
626
+ return i && n !== "_";
627
+ }
628
+ if (n === "o") {
629
+ for (t++; t < r; t++)
630
+ if (n = e[t], n !== "_") {
631
+ if (!Qr(e.charCodeAt(t)))
632
+ return !1;
633
+ i = !0;
634
+ }
635
+ return i && n !== "_";
636
+ }
637
+ }
638
+ if (n === "_")
639
+ return !1;
640
+ for (; t < r; t++)
641
+ if (n = e[t], n !== "_") {
642
+ if (!Wr(e.charCodeAt(t)))
643
+ return !1;
644
+ i = !0;
645
+ }
646
+ return !(!i || n === "_");
647
+ }
648
+ function Zr(e) {
649
+ var r = e, t = 1, i;
650
+ if (r.indexOf("_") !== -1 && (r = r.replace(/_/g, "")), i = r[0], (i === "-" || i === "+") && (i === "-" && (t = -1), r = r.slice(1), i = r[0]), r === "0")
651
+ return 0;
652
+ if (i === "0") {
653
+ if (r[1] === "b")
654
+ return t * parseInt(r.slice(2), 2);
655
+ if (r[1] === "x")
656
+ return t * parseInt(r.slice(2), 16);
657
+ if (r[1] === "o")
658
+ return t * parseInt(r.slice(2), 8);
659
+ }
660
+ return t * parseInt(r, 10);
661
+ }
662
+ function Xr(e) {
663
+ return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !C.isNegativeZero(e);
664
+ }
665
+ var Jr = new g("tag:yaml.org,2002:int", {
666
+ kind: "scalar",
667
+ resolve: zr,
668
+ construct: Zr,
669
+ predicate: Xr,
670
+ represent: {
671
+ binary: function(e) {
672
+ return e >= 0 ? "0b" + e.toString(2) : "-0b" + e.toString(2).slice(1);
673
+ },
674
+ octal: function(e) {
675
+ return e >= 0 ? "0o" + e.toString(8) : "-0o" + e.toString(8).slice(1);
676
+ },
677
+ decimal: function(e) {
678
+ return e.toString(10);
679
+ },
680
+ /* eslint-disable max-len */
681
+ hexadecimal: function(e) {
682
+ return e >= 0 ? "0x" + e.toString(16).toUpperCase() : "-0x" + e.toString(16).toUpperCase().slice(1);
683
+ }
684
+ },
685
+ defaultStyle: "decimal",
686
+ styleAliases: {
687
+ binary: [2, "bin"],
688
+ octal: [8, "oct"],
689
+ decimal: [10, "dec"],
690
+ hexadecimal: [16, "hex"]
691
+ }
692
+ }), et = new RegExp(
693
+ // 2.5e4, 2.5 and integers
694
+ "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
695
+ );
696
+ function rt(e) {
697
+ return !(e === null || !et.test(e) || // Quick hack to not allow integers end with `_`
698
+ // Probably should update regexp & check speed
699
+ e[e.length - 1] === "_");
700
+ }
701
+ function tt(e) {
702
+ var r, t;
703
+ return r = e.replace(/_/g, "").toLowerCase(), t = r[0] === "-" ? -1 : 1, "+-".indexOf(r[0]) >= 0 && (r = r.slice(1)), r === ".inf" ? t === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : r === ".nan" ? NaN : t * parseFloat(r, 10);
704
+ }
705
+ var nt = /^[-+]?[0-9]+e/;
706
+ function it(e, r) {
707
+ var t;
708
+ if (isNaN(e))
709
+ switch (r) {
710
+ case "lowercase":
711
+ return ".nan";
712
+ case "uppercase":
713
+ return ".NAN";
714
+ case "camelcase":
715
+ return ".NaN";
716
+ }
717
+ else if (Number.POSITIVE_INFINITY === e)
718
+ switch (r) {
719
+ case "lowercase":
720
+ return ".inf";
721
+ case "uppercase":
722
+ return ".INF";
723
+ case "camelcase":
724
+ return ".Inf";
725
+ }
726
+ else if (Number.NEGATIVE_INFINITY === e)
727
+ switch (r) {
728
+ case "lowercase":
729
+ return "-.inf";
730
+ case "uppercase":
731
+ return "-.INF";
732
+ case "camelcase":
733
+ return "-.Inf";
734
+ }
735
+ else if (C.isNegativeZero(e))
736
+ return "-0.0";
737
+ return t = e.toString(10), nt.test(t) ? t.replace("e", ".e") : t;
738
+ }
739
+ function lt(e) {
740
+ return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || C.isNegativeZero(e));
741
+ }
742
+ var at = new g("tag:yaml.org,2002:float", {
743
+ kind: "scalar",
744
+ resolve: rt,
745
+ construct: tt,
746
+ predicate: lt,
747
+ represent: it,
748
+ defaultStyle: "lowercase"
749
+ }), ut = Yr.extend({
750
+ implicit: [
751
+ Hr,
752
+ Kr,
753
+ Jr,
754
+ at
755
+ ]
756
+ }), ot = ut, we = new RegExp(
757
+ "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
758
+ ), ke = new RegExp(
759
+ "^([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]))?))?$"
760
+ );
761
+ function st(e) {
762
+ return e === null ? !1 : we.exec(e) !== null || ke.exec(e) !== null;
763
+ }
764
+ function ct(e) {
765
+ var r, t, i, n, a, l, u, o = 0, s = null, d, p, c;
766
+ if (r = we.exec(e), r === null && (r = ke.exec(e)), r === null)
767
+ throw new Error("Date resolve error");
768
+ if (t = +r[1], i = +r[2] - 1, n = +r[3], !r[4])
769
+ return new Date(Date.UTC(t, i, n));
770
+ if (a = +r[4], l = +r[5], u = +r[6], r[7]) {
771
+ for (o = r[7].slice(0, 3); o.length < 3; )
772
+ o += "0";
773
+ o = +o;
774
+ }
775
+ return r[9] && (d = +r[10], p = +(r[11] || 0), s = (d * 60 + p) * 6e4, r[9] === "-" && (s = -s)), c = new Date(Date.UTC(t, i, n, a, l, u, o)), s && c.setTime(c.getTime() - s), c;
776
+ }
777
+ function ft(e) {
778
+ return e.toISOString();
779
+ }
780
+ var dt = new g("tag:yaml.org,2002:timestamp", {
781
+ kind: "scalar",
782
+ resolve: st,
783
+ construct: ct,
784
+ instanceOf: Date,
785
+ represent: ft
786
+ });
787
+ function mt(e) {
788
+ return e === "<<" || e === null;
789
+ }
790
+ var pt = new g("tag:yaml.org,2002:merge", {
791
+ kind: "scalar",
792
+ resolve: mt
793
+ }), J = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
794
+ \r`;
795
+ function vt(e) {
796
+ if (e === null)
797
+ return !1;
798
+ var r, t, i = 0, n = e.length, a = J;
799
+ for (t = 0; t < n; t++)
800
+ if (r = a.indexOf(e.charAt(t)), !(r > 64)) {
801
+ if (r < 0)
802
+ return !1;
803
+ i += 6;
804
+ }
805
+ return i % 8 === 0;
806
+ }
807
+ function ht(e) {
808
+ var r, t, i = e.replace(/[\r\n=]/g, ""), n = i.length, a = J, l = 0, u = [];
809
+ for (r = 0; r < n; r++)
810
+ r % 4 === 0 && r && (u.push(l >> 16 & 255), u.push(l >> 8 & 255), u.push(l & 255)), l = l << 6 | a.indexOf(i.charAt(r));
811
+ return t = n % 4 * 6, t === 0 ? (u.push(l >> 16 & 255), u.push(l >> 8 & 255), u.push(l & 255)) : t === 18 ? (u.push(l >> 10 & 255), u.push(l >> 2 & 255)) : t === 12 && u.push(l >> 4 & 255), new Uint8Array(u);
812
+ }
813
+ function gt(e) {
814
+ var r = "", t = 0, i, n, a = e.length, l = J;
815
+ for (i = 0; i < a; i++)
816
+ i % 3 === 0 && i && (r += l[t >> 18 & 63], r += l[t >> 12 & 63], r += l[t >> 6 & 63], r += l[t & 63]), t = (t << 8) + e[i];
817
+ return n = a % 3, n === 0 ? (r += l[t >> 18 & 63], r += l[t >> 12 & 63], r += l[t >> 6 & 63], r += l[t & 63]) : n === 2 ? (r += l[t >> 10 & 63], r += l[t >> 4 & 63], r += l[t << 2 & 63], r += l[64]) : n === 1 && (r += l[t >> 2 & 63], r += l[t << 4 & 63], r += l[64], r += l[64]), r;
818
+ }
819
+ function xt(e) {
820
+ return Object.prototype.toString.call(e) === "[object Uint8Array]";
821
+ }
822
+ var yt = new g("tag:yaml.org,2002:binary", {
823
+ kind: "scalar",
824
+ resolve: vt,
825
+ construct: ht,
826
+ predicate: xt,
827
+ represent: gt
828
+ }), wt = Object.prototype.hasOwnProperty, kt = Object.prototype.toString;
829
+ function bt(e) {
830
+ if (e === null)
831
+ return !0;
832
+ var r = [], t, i, n, a, l, u = e;
833
+ for (t = 0, i = u.length; t < i; t += 1) {
834
+ if (n = u[t], l = !1, kt.call(n) !== "[object Object]")
835
+ return !1;
836
+ for (a in n)
837
+ if (wt.call(n, a))
838
+ if (!l)
839
+ l = !0;
840
+ else
841
+ return !1;
842
+ if (!l)
843
+ return !1;
844
+ if (r.indexOf(a) === -1)
845
+ r.push(a);
846
+ else
847
+ return !1;
848
+ }
849
+ return !0;
850
+ }
851
+ function At(e) {
852
+ return e !== null ? e : [];
853
+ }
854
+ var _t = new g("tag:yaml.org,2002:omap", {
855
+ kind: "sequence",
856
+ resolve: bt,
857
+ construct: At
858
+ }), Et = Object.prototype.toString;
859
+ function Ft(e) {
860
+ if (e === null)
861
+ return !0;
862
+ var r, t, i, n, a, l = e;
863
+ for (a = new Array(l.length), r = 0, t = l.length; r < t; r += 1) {
864
+ if (i = l[r], Et.call(i) !== "[object Object]" || (n = Object.keys(i), n.length !== 1))
865
+ return !1;
866
+ a[r] = [n[0], i[n[0]]];
867
+ }
868
+ return !0;
869
+ }
870
+ function Ct(e) {
871
+ if (e === null)
872
+ return [];
873
+ var r, t, i, n, a, l = e;
874
+ for (a = new Array(l.length), r = 0, t = l.length; r < t; r += 1)
875
+ i = l[r], n = Object.keys(i), a[r] = [n[0], i[n[0]]];
876
+ return a;
877
+ }
878
+ var St = new g("tag:yaml.org,2002:pairs", {
879
+ kind: "sequence",
880
+ resolve: Ft,
881
+ construct: Ct
882
+ }), Nt = Object.prototype.hasOwnProperty;
883
+ function Ot(e) {
884
+ if (e === null)
885
+ return !0;
886
+ var r, t = e;
887
+ for (r in t)
888
+ if (Nt.call(t, r) && t[r] !== null)
889
+ return !1;
890
+ return !0;
891
+ }
892
+ function Tt(e) {
893
+ return e !== null ? e : {};
894
+ }
895
+ var It = new g("tag:yaml.org,2002:set", {
896
+ kind: "mapping",
897
+ resolve: Ot,
898
+ construct: Tt
899
+ }), Lt = ot.extend({
900
+ implicit: [
901
+ dt,
902
+ pt
903
+ ],
904
+ explicit: [
905
+ yt,
906
+ _t,
907
+ St,
908
+ It
909
+ ]
910
+ });
911
+ function le(e) {
912
+ return e === 48 ? "\0" : e === 97 ? "\x07" : e === 98 ? "\b" : e === 116 || e === 9 ? " " : e === 110 ? `
913
+ ` : e === 118 ? "\v" : e === 102 ? "\f" : e === 114 ? "\r" : e === 101 ? "\x1B" : e === 32 ? " " : e === 34 ? '"' : e === 47 ? "/" : e === 92 ? "\\" : e === 78 ? "…" : e === 95 ? " " : e === 76 ? "\u2028" : e === 80 ? "\u2029" : "";
914
+ }
915
+ var Rt = new Array(256), Mt = new Array(256);
916
+ for (var S = 0; S < 256; S++)
917
+ Rt[S] = le(S) ? 1 : 0, Mt[S] = le(S);
918
+ var be = Object.prototype.toString, Ae = Object.prototype.hasOwnProperty, ee = 65279, Ut = 9, R = 10, Dt = 13, Yt = 32, Bt = 33, $t = 34, G = 35, Pt = 37, Ht = 38, Vt = 39, qt = 42, _e = 44, jt = 45, P = 58, Kt = 61, Gt = 62, Qt = 63, Wt = 64, Ee = 91, Fe = 93, zt = 96, Ce = 123, Zt = 124, Se = 125, x = {};
919
+ x[0] = "\\0";
920
+ x[7] = "\\a";
921
+ x[8] = "\\b";
922
+ x[9] = "\\t";
923
+ x[10] = "\\n";
924
+ x[11] = "\\v";
925
+ x[12] = "\\f";
926
+ x[13] = "\\r";
927
+ x[27] = "\\e";
928
+ x[34] = '\\"';
929
+ x[92] = "\\\\";
930
+ x[133] = "\\N";
931
+ x[160] = "\\_";
932
+ x[8232] = "\\L";
933
+ x[8233] = "\\P";
934
+ var Xt = [
935
+ "y",
936
+ "Y",
937
+ "yes",
938
+ "Yes",
939
+ "YES",
940
+ "on",
941
+ "On",
942
+ "ON",
943
+ "n",
944
+ "N",
945
+ "no",
946
+ "No",
947
+ "NO",
948
+ "off",
949
+ "Off",
950
+ "OFF"
951
+ ], Jt = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
952
+ function en(e, r) {
953
+ var t, i, n, a, l, u, o;
954
+ if (r === null)
955
+ return {};
956
+ for (t = {}, i = Object.keys(r), n = 0, a = i.length; n < a; n += 1)
957
+ l = i[n], u = String(r[l]), l.slice(0, 2) === "!!" && (l = "tag:yaml.org,2002:" + l.slice(2)), o = e.compiledTypeMap.fallback[l], o && Ae.call(o.styleAliases, u) && (u = o.styleAliases[u]), t[l] = u;
958
+ return t;
959
+ }
960
+ function rn(e) {
961
+ var r, t, i;
962
+ if (r = e.toString(16).toUpperCase(), e <= 255)
963
+ t = "x", i = 2;
964
+ else if (e <= 65535)
965
+ t = "u", i = 4;
966
+ else if (e <= 4294967295)
967
+ t = "U", i = 8;
968
+ else
969
+ throw new A("code point within a string may not be greater than 0xFFFFFFFF");
970
+ return "\\" + t + C.repeat("0", i - r.length) + r;
971
+ }
972
+ var tn = 1, M = 2;
973
+ function nn(e) {
974
+ this.schema = e.schema || Lt, this.indent = Math.max(1, e.indent || 2), this.noArrayIndent = e.noArrayIndent || !1, this.skipInvalid = e.skipInvalid || !1, this.flowLevel = C.isNothing(e.flowLevel) ? -1 : e.flowLevel, this.styleMap = en(this.schema, e.styles || null), this.sortKeys = e.sortKeys || !1, this.lineWidth = e.lineWidth || 80, this.noRefs = e.noRefs || !1, this.noCompatMode = e.noCompatMode || !1, this.condenseFlow = e.condenseFlow || !1, this.quotingType = e.quotingType === '"' ? M : tn, this.forceQuotes = e.forceQuotes || !1, this.replacer = typeof e.replacer == "function" ? e.replacer : null, this.implicitTypes = this.schema.compiledImplicit, this.explicitTypes = this.schema.compiledExplicit, this.tag = null, this.result = "", this.duplicates = [], this.usedDuplicates = null;
975
+ }
976
+ function ae(e, r) {
977
+ for (var t = C.repeat(" ", r), i = 0, n = -1, a = "", l, u = e.length; i < u; )
978
+ n = e.indexOf(`
979
+ `, i), n === -1 ? (l = e.slice(i), i = u) : (l = e.slice(i, n + 1), i = n + 1), l.length && l !== `
980
+ ` && (a += t), a += l;
981
+ return a;
982
+ }
983
+ function Q(e, r) {
984
+ return `
985
+ ` + C.repeat(" ", e.indent * r);
986
+ }
987
+ function ln(e, r) {
988
+ var t, i, n;
989
+ for (t = 0, i = e.implicitTypes.length; t < i; t += 1)
990
+ if (n = e.implicitTypes[t], n.resolve(r))
991
+ return !0;
992
+ return !1;
993
+ }
994
+ function H(e) {
995
+ return e === Yt || e === Ut;
996
+ }
997
+ function U(e) {
998
+ return 32 <= e && e <= 126 || 161 <= e && e <= 55295 && e !== 8232 && e !== 8233 || 57344 <= e && e <= 65533 && e !== ee || 65536 <= e && e <= 1114111;
999
+ }
1000
+ function ue(e) {
1001
+ return U(e) && e !== ee && e !== Dt && e !== R;
1002
+ }
1003
+ function oe(e, r, t) {
1004
+ var i = ue(e), n = i && !H(e);
1005
+ return (
1006
+ // ns-plain-safe
1007
+ (t ? (
1008
+ // c = flow-in
1009
+ i
1010
+ ) : i && e !== _e && e !== Ee && e !== Fe && e !== Ce && e !== Se) && e !== G && !(r === P && !n) || ue(r) && !H(r) && e === G || r === P && n
1011
+ );
1012
+ }
1013
+ function an(e) {
1014
+ return U(e) && e !== ee && !H(e) && e !== jt && e !== Qt && e !== P && e !== _e && e !== Ee && e !== Fe && e !== Ce && e !== Se && e !== G && e !== Ht && e !== qt && e !== Bt && e !== Zt && e !== Kt && e !== Gt && e !== Vt && e !== $t && e !== Pt && e !== Wt && e !== zt;
1015
+ }
1016
+ function un(e) {
1017
+ return !H(e) && e !== P;
1018
+ }
1019
+ function T(e, r) {
1020
+ var t = e.charCodeAt(r), i;
1021
+ return t >= 55296 && t <= 56319 && r + 1 < e.length && (i = e.charCodeAt(r + 1), i >= 56320 && i <= 57343) ? (t - 55296) * 1024 + i - 56320 + 65536 : t;
1022
+ }
1023
+ function Ne(e) {
1024
+ var r = /^\n* /;
1025
+ return r.test(e);
1026
+ }
1027
+ var Oe = 1, W = 2, Te = 3, Ie = 4, N = 5;
1028
+ function on(e, r, t, i, n, a, l, u) {
1029
+ var o, s = 0, d = null, p = !1, c = !1, m = i !== -1, f = -1, h = an(T(e, 0)) && un(T(e, e.length - 1));
1030
+ if (r || l)
1031
+ for (o = 0; o < e.length; s >= 65536 ? o += 2 : o++) {
1032
+ if (s = T(e, o), !U(s))
1033
+ return N;
1034
+ h = h && oe(s, d, u), d = s;
1035
+ }
1036
+ else {
1037
+ for (o = 0; o < e.length; s >= 65536 ? o += 2 : o++) {
1038
+ if (s = T(e, o), s === R)
1039
+ p = !0, m && (c = c || // Foldable line = too long, and not more-indented.
1040
+ o - f - 1 > i && e[f + 1] !== " ", f = o);
1041
+ else if (!U(s))
1042
+ return N;
1043
+ h = h && oe(s, d, u), d = s;
1044
+ }
1045
+ c = c || m && o - f - 1 > i && e[f + 1] !== " ";
1046
+ }
1047
+ return !p && !c ? h && !l && !n(e) ? Oe : a === M ? N : W : t > 9 && Ne(e) ? N : l ? a === M ? N : W : c ? Ie : Te;
1048
+ }
1049
+ function sn(e, r, t, i, n) {
1050
+ e.dump = function() {
1051
+ if (r.length === 0)
1052
+ return e.quotingType === M ? '""' : "''";
1053
+ if (!e.noCompatMode && (Xt.indexOf(r) !== -1 || Jt.test(r)))
1054
+ return e.quotingType === M ? '"' + r + '"' : "'" + r + "'";
1055
+ var a = e.indent * Math.max(1, t), l = e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - a), u = i || e.flowLevel > -1 && t >= e.flowLevel;
1056
+ function o(s) {
1057
+ return ln(e, s);
1058
+ }
1059
+ switch (on(
1060
+ r,
1061
+ u,
1062
+ e.indent,
1063
+ l,
1064
+ o,
1065
+ e.quotingType,
1066
+ e.forceQuotes && !i,
1067
+ n
1068
+ )) {
1069
+ case Oe:
1070
+ return r;
1071
+ case W:
1072
+ return "'" + r.replace(/'/g, "''") + "'";
1073
+ case Te:
1074
+ return "|" + se(r, e.indent) + ce(ae(r, a));
1075
+ case Ie:
1076
+ return ">" + se(r, e.indent) + ce(ae(cn(r, l), a));
1077
+ case N:
1078
+ return '"' + fn(r) + '"';
1079
+ default:
1080
+ throw new A("impossible error: invalid scalar style");
1081
+ }
1082
+ }();
1083
+ }
1084
+ function se(e, r) {
1085
+ var t = Ne(e) ? String(r) : "", i = e[e.length - 1] === `
1086
+ `, n = i && (e[e.length - 2] === `
1087
+ ` || e === `
1088
+ `), a = n ? "+" : i ? "" : "-";
1089
+ return t + a + `
1090
+ `;
1091
+ }
1092
+ function ce(e) {
1093
+ return e[e.length - 1] === `
1094
+ ` ? e.slice(0, -1) : e;
1095
+ }
1096
+ function cn(e, r) {
1097
+ for (var t = /(\n+)([^\n]*)/g, i = function() {
1098
+ var s = e.indexOf(`
1099
+ `);
1100
+ return s = s !== -1 ? s : e.length, t.lastIndex = s, fe(e.slice(0, s), r);
1101
+ }(), n = e[0] === `
1102
+ ` || e[0] === " ", a, l; l = t.exec(e); ) {
1103
+ var u = l[1], o = l[2];
1104
+ a = o[0] === " ", i += u + (!n && !a && o !== "" ? `
1105
+ ` : "") + fe(o, r), n = a;
1106
+ }
1107
+ return i;
1108
+ }
1109
+ function fe(e, r) {
1110
+ if (e === "" || e[0] === " ")
1111
+ return e;
1112
+ for (var t = / [^ ]/g, i, n = 0, a, l = 0, u = 0, o = ""; i = t.exec(e); )
1113
+ u = i.index, u - n > r && (a = l > n ? l : u, o += `
1114
+ ` + e.slice(n, a), n = a + 1), l = u;
1115
+ return o += `
1116
+ `, e.length - n > r && l > n ? o += e.slice(n, l) + `
1117
+ ` + e.slice(l + 1) : o += e.slice(n), o.slice(1);
1118
+ }
1119
+ function fn(e) {
1120
+ for (var r = "", t = 0, i, n = 0; n < e.length; t >= 65536 ? n += 2 : n++)
1121
+ t = T(e, n), i = x[t], !i && U(t) ? (r += e[n], t >= 65536 && (r += e[n + 1])) : r += i || rn(t);
1122
+ return r;
1123
+ }
1124
+ function dn(e, r, t) {
1125
+ var i = "", n = e.tag, a, l, u;
1126
+ for (a = 0, l = t.length; a < l; a += 1)
1127
+ u = t[a], e.replacer && (u = e.replacer.call(t, String(a), u)), (E(e, r, u, !1, !1) || typeof u > "u" && E(e, r, null, !1, !1)) && (i !== "" && (i += "," + (e.condenseFlow ? "" : " ")), i += e.dump);
1128
+ e.tag = n, e.dump = "[" + i + "]";
1129
+ }
1130
+ function de(e, r, t, i) {
1131
+ var n = "", a = e.tag, l, u, o;
1132
+ for (l = 0, u = t.length; l < u; l += 1)
1133
+ o = t[l], e.replacer && (o = e.replacer.call(t, String(l), o)), (E(e, r + 1, o, !0, !0, !1, !0) || typeof o > "u" && E(e, r + 1, null, !0, !0, !1, !0)) && ((!i || n !== "") && (n += Q(e, r)), e.dump && R === e.dump.charCodeAt(0) ? n += "-" : n += "- ", n += e.dump);
1134
+ e.tag = a, e.dump = n || "[]";
1135
+ }
1136
+ function mn(e, r, t) {
1137
+ var i = "", n = e.tag, a = Object.keys(t), l, u, o, s, d;
1138
+ for (l = 0, u = a.length; l < u; l += 1)
1139
+ d = "", i !== "" && (d += ", "), e.condenseFlow && (d += '"'), o = a[l], s = t[o], e.replacer && (s = e.replacer.call(t, o, s)), E(e, r, o, !1, !1) && (e.dump.length > 1024 && (d += "? "), d += e.dump + (e.condenseFlow ? '"' : "") + ":" + (e.condenseFlow ? "" : " "), E(e, r, s, !1, !1) && (d += e.dump, i += d));
1140
+ e.tag = n, e.dump = "{" + i + "}";
1141
+ }
1142
+ function pn(e, r, t, i) {
1143
+ var n = "", a = e.tag, l = Object.keys(t), u, o, s, d, p, c;
1144
+ if (e.sortKeys === !0)
1145
+ l.sort();
1146
+ else if (typeof e.sortKeys == "function")
1147
+ l.sort(e.sortKeys);
1148
+ else if (e.sortKeys)
1149
+ throw new A("sortKeys must be a boolean or a function");
1150
+ for (u = 0, o = l.length; u < o; u += 1)
1151
+ c = "", (!i || n !== "") && (c += Q(e, r)), s = l[u], d = t[s], e.replacer && (d = e.replacer.call(t, s, d)), E(e, r + 1, s, !0, !0, !0) && (p = e.tag !== null && e.tag !== "?" || e.dump && e.dump.length > 1024, p && (e.dump && R === e.dump.charCodeAt(0) ? c += "?" : c += "? "), c += e.dump, p && (c += Q(e, r)), E(e, r + 1, d, !0, p) && (e.dump && R === e.dump.charCodeAt(0) ? c += ":" : c += ": ", c += e.dump, n += c));
1152
+ e.tag = a, e.dump = n || "{}";
1153
+ }
1154
+ function me(e, r, t) {
1155
+ var i, n, a, l, u, o;
1156
+ for (n = t ? e.explicitTypes : e.implicitTypes, a = 0, l = n.length; a < l; a += 1)
1157
+ if (u = n[a], (u.instanceOf || u.predicate) && (!u.instanceOf || typeof r == "object" && r instanceof u.instanceOf) && (!u.predicate || u.predicate(r))) {
1158
+ if (t ? u.multi && u.representName ? e.tag = u.representName(r) : e.tag = u.tag : e.tag = "?", u.represent) {
1159
+ if (o = e.styleMap[u.tag] || u.defaultStyle, be.call(u.represent) === "[object Function]")
1160
+ i = u.represent(r, o);
1161
+ else if (Ae.call(u.represent, o))
1162
+ i = u.represent[o](r, o);
1163
+ else
1164
+ throw new A("!<" + u.tag + '> tag resolver accepts not "' + o + '" style');
1165
+ e.dump = i;
1166
+ }
1167
+ return !0;
1168
+ }
1169
+ return !1;
1170
+ }
1171
+ function E(e, r, t, i, n, a, l) {
1172
+ e.tag = null, e.dump = t, me(e, t, !1) || me(e, t, !0);
1173
+ var u = be.call(e.dump), o = i, s;
1174
+ i && (i = e.flowLevel < 0 || e.flowLevel > r);
1175
+ var d = u === "[object Object]" || u === "[object Array]", p, c;
1176
+ if (d && (p = e.duplicates.indexOf(t), c = p !== -1), (e.tag !== null && e.tag !== "?" || c || e.indent !== 2 && r > 0) && (n = !1), c && e.usedDuplicates[p])
1177
+ e.dump = "*ref_" + p;
1178
+ else {
1179
+ if (d && c && !e.usedDuplicates[p] && (e.usedDuplicates[p] = !0), u === "[object Object]")
1180
+ i && Object.keys(e.dump).length !== 0 ? (pn(e, r, e.dump, n), c && (e.dump = "&ref_" + p + e.dump)) : (mn(e, r, e.dump), c && (e.dump = "&ref_" + p + " " + e.dump));
1181
+ else if (u === "[object Array]")
1182
+ i && e.dump.length !== 0 ? (e.noArrayIndent && !l && r > 0 ? de(e, r - 1, e.dump, n) : de(e, r, e.dump, n), c && (e.dump = "&ref_" + p + e.dump)) : (dn(e, r, e.dump), c && (e.dump = "&ref_" + p + " " + e.dump));
1183
+ else if (u === "[object String]")
1184
+ e.tag !== "?" && sn(e, e.dump, r, a, o);
1185
+ else {
1186
+ if (u === "[object Undefined]")
1187
+ return !1;
1188
+ if (e.skipInvalid)
1189
+ return !1;
1190
+ throw new A("unacceptable kind of an object to dump " + u);
1191
+ }
1192
+ e.tag !== null && e.tag !== "?" && (s = encodeURI(
1193
+ e.tag[0] === "!" ? e.tag.slice(1) : e.tag
1194
+ ).replace(/!/g, "%21"), e.tag[0] === "!" ? s = "!" + s : s.slice(0, 18) === "tag:yaml.org,2002:" ? s = "!!" + s.slice(18) : s = "!<" + s + ">", e.dump = s + " " + e.dump);
1195
+ }
1196
+ return !0;
1197
+ }
1198
+ function vn(e, r) {
1199
+ var t = [], i = [], n, a;
1200
+ for (z(e, t, i), n = 0, a = i.length; n < a; n += 1)
1201
+ r.duplicates.push(t[i[n]]);
1202
+ r.usedDuplicates = new Array(a);
1203
+ }
1204
+ function z(e, r, t) {
1205
+ var i, n, a;
1206
+ if (e !== null && typeof e == "object")
1207
+ if (n = r.indexOf(e), n !== -1)
1208
+ t.indexOf(n) === -1 && t.push(n);
1209
+ else if (r.push(e), Array.isArray(e))
1210
+ for (n = 0, a = e.length; n < a; n += 1)
1211
+ z(e[n], r, t);
1212
+ else
1213
+ for (i = Object.keys(e), n = 0, a = i.length; n < a; n += 1)
1214
+ z(e[i[n]], r, t);
1215
+ }
1216
+ function hn(e, r) {
1217
+ r = r || {};
1218
+ var t = new nn(r);
1219
+ t.noRefs || vn(e, t);
1220
+ var i = e;
1221
+ return t.replacer && (i = t.replacer.call({ "": i }, "", i)), E(t, 0, i, !0, !0) ? t.dump + `
1222
+ ` : "";
1223
+ }
1224
+ var gn = hn, xn = {
1225
+ dump: gn
1226
+ }, yn = xn.dump;
1227
+ const wn = { class: "space-y-6 max-w-7xl mx-auto" }, kn = { class: "flex items-center justify-between" }, bn = { class: "flex items-center gap-4" }, An = { class: "flex items-center gap-2" }, _n = { class: "text-2xl font-semibold text-gray-900 dark:text-white" }, En = ["href", "title"], Fn = { class: "flex items-center space-x-3" }, Cn = {
1228
+ key: 0,
1229
+ class: "max-w-[1000px] flex flex-col"
1230
+ }, Sn = { class: "flex ml-2 mb-6 w-min border border-gray-200 dark:border-gray-700 rounded-full overflow-hidden" }, In = /* @__PURE__ */ D({
1231
+ __name: "MenuItemPage",
1232
+ setup(e) {
1233
+ he["vs-input-monaco-editor"] = ge;
1234
+ const { t: r, locale: t } = V(), i = er(), n = rr(), a = He(() => [
1235
+ {
1236
+ key: "name",
1237
+ title: r("cms.menu.form.name"),
1238
+ type: "text",
1239
+ placeholder: r("cms.menu.form.name"),
1240
+ required: !0,
1241
+ validators: ["required"]
1242
+ },
1243
+ {
1244
+ key: "description",
1245
+ title: r("cms.menu.form.description"),
1246
+ type: "text",
1247
+ placeholder: r("cms.menu.form.description"),
1248
+ required: !0,
1249
+ validators: ["required"]
1250
+ },
1251
+ {
1252
+ key: "locale",
1253
+ title: r("cms.menu.form.language"),
1254
+ type: "select",
1255
+ placeholder: r("cms.menu.form.language"),
1256
+ options: [
1257
+ { text: "Ukrainian", id: "uk" },
1258
+ { text: "English", id: "en" }
1259
+ ],
1260
+ required: !0,
1261
+ validators: ["required"]
1262
+ },
1263
+ {
1264
+ key: "content",
1265
+ title: r("cms.menu.form.content"),
1266
+ type: "monaco-editor",
1267
+ height: "500px",
1268
+ language: "yaml",
1269
+ theme: "vs-light"
1270
+ }
1271
+ ]), l = k(null), u = k({}), o = k(!1), s = k(!1), d = (m) => {
1272
+ const f = {};
1273
+ for (const h of m) {
1274
+ const { title: re, value: Le, children: q } = h;
1275
+ q && q.length > 0 ? f[re] = d(q) : f[re] = Le;
1276
+ }
1277
+ return f;
1278
+ }, p = async () => {
1279
+ let m = { ...l.value || {} };
1280
+ if (await u.value.validate()) {
1281
+ I({
1282
+ type: "warning",
1283
+ title: r("cms.common.actions.warning"),
1284
+ message: r("cms.menu.createMenuFailed")
1285
+ });
1286
+ return;
1287
+ }
1288
+ Array.isArray(m.items) && (m.items = d(m.items), m.content = yn(m.items));
1289
+ try {
1290
+ await fetch(`/api/cms-menu/${n.params.id}`, {
1291
+ method: "PUT",
1292
+ headers: {
1293
+ "Content-Type": "application/json"
1294
+ },
1295
+ body: JSON.stringify(m)
1296
+ }), I({
1297
+ title: r("cms.menu.menuUpdated"),
1298
+ type: "success",
1299
+ message: r("cms.menu.menuUpdated")
1300
+ }), i.push("/menu");
1301
+ } catch {
1302
+ I({
1303
+ title: r("cms.menu.menuUpdateError"),
1304
+ type: "error",
1305
+ message: r("cms.menu.menuUpdateError")
1306
+ });
1307
+ }
1308
+ };
1309
+ return Ve(async () => {
1310
+ try {
1311
+ const f = await (await fetch(`/api/cms-menu/${n.params.id}`)).json();
1312
+ l.value = f, o.value = !0;
1313
+ } catch {
1314
+ o.value = !1;
1315
+ }
1316
+ }), (m, f) => (w(), F("div", wn, [
1317
+ v("div", kn, [
1318
+ v("div", bn, [
1319
+ v("button", {
1320
+ onClick: f[0] || (f[0] = (h) => y(i).back()),
1321
+ class: "p-2 text-gray-500 rounded-full hover:text-gray-900 dark:text-gray-400 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"
1322
+ }, [
1323
+ b(y(Ze), { class: "w-5 h-5" })
1324
+ ]),
1325
+ v("div", An, [
1326
+ v("h1", _n, _(m.$t("cms.menu.editMenu")), 1),
1327
+ v("a", {
1328
+ href: `https://cms.opengis.info/${y(t)}/guides/menu/`,
1329
+ target: "_blank",
1330
+ title: m.$t("cms.guide.menu")
1331
+ }, [
1332
+ b(y(Xe), { class: "w-5 h-5" })
1333
+ ], 8, En)
1334
+ ])
1335
+ ]),
1336
+ v("div", Fn, [
1337
+ v("button", {
1338
+ onClick: p,
1339
+ class: "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium h-9 px-4 py-2 bg-blue-600 text-white shadow-md transition-all duration-200 transform hover:bg-blue-700 hover:shadow-lg hover:scale-105 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"
1340
+ }, [
1341
+ b(y(Je), { class: "w-4 h-4 mr-2" }),
1342
+ Z(" " + _(m.$t("cms.common.actions.save")), 1)
1343
+ ])
1344
+ ])
1345
+ ]),
1346
+ o.value ? (w(), F("div", Cn, [
1347
+ v("div", Sn, [
1348
+ v("button", {
1349
+ onClick: f[1] || (f[1] = (h) => s.value = !1),
1350
+ class: B([{ "bg-gray-200 text-gray-900 dark:bg-gray-700 dark:text-white": !s.value }, "text-gray-500 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-700 whitespace-nowrap px-5 py-2 w-[200px] text-sm font-medium"])
1351
+ }, _(m.$t("cms.menu.textEditor")), 3),
1352
+ v("button", {
1353
+ onClick: f[2] || (f[2] = (h) => s.value = !0),
1354
+ class: B([{ "bg-gray-200 text-gray-900 dark:bg-gray-700 dark:text-white": s.value }, "text-gray-500 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-700 whitespace-nowrap px-5 py-2 w-[200px] text-sm font-medium"])
1355
+ }, _(m.$t("cms.menu.listTree")), 3)
1356
+ ]),
1357
+ s.value ? (w(), O(gr, {
1358
+ key: 0,
1359
+ modelValue: l.value,
1360
+ "onUpdate:modelValue": f[3] || (f[3] = (h) => l.value = h)
1361
+ }, null, 8, ["modelValue"])) : (w(), O(y(X), {
1362
+ key: 1,
1363
+ schema: a.value,
1364
+ modelValue: l.value,
1365
+ "onUpdate:modelValue": f[4] || (f[4] = (h) => l.value = h),
1366
+ form: u.value,
1367
+ "onUpdate:form": f[5] || (f[5] = (h) => u.value = h)
1368
+ }, null, 8, ["schema", "modelValue", "form"]))
1369
+ ])) : $("", !0)
1370
+ ]));
1371
+ }
1372
+ });
1373
+ export {
1374
+ In as default
1375
+ };