@ea-lab/reactive-json 0.0.24 → 0.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +0 -4
  2. package/dist/{HashChangeListener-DfQ_3Guk.js → HashChangeListener-4RW0JIqP.js} +6036 -5900
  3. package/dist/component/action/HashChangeListener.js +1 -1
  4. package/dist/component/action/MessageListener.js +1 -1
  5. package/dist/component/action/Popover.js +1 -1
  6. package/dist/component/action/ReactOnEvent.js +1 -1
  7. package/dist/component/action/Redirect.js +1 -1
  8. package/dist/component/action/Tooltip.js +1 -1
  9. package/dist/component/action/index.js +1 -1
  10. package/dist/component/element/form/CheckBoxField.js +1 -1
  11. package/dist/component/element/form/DateField.js +1 -1
  12. package/dist/component/element/form/SelectField.js +1 -1
  13. package/dist/component/element/form/TextAreaField.js +1 -1
  14. package/dist/component/element/form/TextField.js +1 -1
  15. package/dist/component/element/form/formElementsCommon.js +1 -1
  16. package/dist/component/element/form/index.js +1 -1
  17. package/dist/component/element/html/AccordionItem.js +1 -1
  18. package/dist/component/element/html/FolderSortableTree.js +1 -1
  19. package/dist/component/element/html/FormatNumeral.js +1 -1
  20. package/dist/component/element/html/Html.js +1 -1
  21. package/dist/component/element/html/LabelFromValue.js +1 -1
  22. package/dist/component/element/html/Modal.js +1 -1
  23. package/dist/component/element/html/PreformattedMarkup.js +1 -1
  24. package/dist/component/element/html/SortableTreeItemCollapseButton.js +1 -1
  25. package/dist/component/element/html/Tabs.js +1 -1
  26. package/dist/component/element/html/index.js +1 -1
  27. package/dist/component/element/index.js +1 -1
  28. package/dist/component/element/special/BootstrapElement.js +1 -1
  29. package/dist/component/element/special/Count.js +1 -1
  30. package/dist/component/element/special/DataFilter.js +1 -1
  31. package/dist/component/element/special/DelayedActions.js +1 -1
  32. package/dist/component/element/special/Phantom.js +1 -1
  33. package/dist/component/element/special/ReactiveJsonSubroot.js +11 -0
  34. package/dist/component/element/special/Switch.js +1 -1
  35. package/dist/component/element/special/index.js +1 -1
  36. package/dist/component/index.js +1 -1
  37. package/dist/component/reaction/addData.js +1 -1
  38. package/dist/component/reaction/fetchData.js +1 -1
  39. package/dist/component/reaction/index.js +1 -1
  40. package/dist/component/reaction/moveData.js +1 -1
  41. package/dist/component/reaction/postMessage.js +1 -1
  42. package/dist/component/reaction/redirectNow.js +1 -1
  43. package/dist/component/reaction/removeData.js +1 -1
  44. package/dist/component/reaction/setClipboardData.js +1 -1
  45. package/dist/component/reaction/setData.js +1 -1
  46. package/dist/component/reaction/submitData.js +1 -1
  47. package/dist/engine/Actions.js +1 -1
  48. package/dist/engine/ReactiveJsonRoot.js +9 -1123
  49. package/dist/engine/TemplateSystem.js +1 -1
  50. package/dist/engine/View.js +2 -2
  51. package/dist/engine/index.js +28 -29
  52. package/dist/engine/utility/formatString.js +1 -1
  53. package/dist/engine/utility/parseRjBuild.js +994 -0
  54. package/dist/main.js +65 -66
  55. package/package.json +1 -1
@@ -1,1125 +1,11 @@
1
- import { jsx as D, jsxs as Oe } from "react/jsx-runtime";
2
- import { EventDispatcherProvider as Ee } from "./EventDispatcherProvider.js";
3
- import { GlobalDataContextProvider as Ne } from "./GlobalDataContextProvider.js";
4
- import { TemplateContext as Le } from "./TemplateContext.js";
5
- import { W as te, X as De, V as Me } from "../HashChangeListener-DfQ_3Guk.js";
6
- import { useReducer as je, useState as R, useEffect as fe } from "react";
7
- import { stringToBoolean as Pe } from "./utility/stringToBoolean.js";
8
- /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
9
- function ge(e) {
10
- return typeof e > "u" || e === null;
11
- }
12
- function Ye(e) {
13
- return typeof e == "object" && e !== null;
14
- }
15
- function Be(e) {
16
- return Array.isArray(e) ? e : ge(e) ? [] : [e];
17
- }
18
- function Re(e, i) {
19
- var n, l, r, u;
20
- if (i)
21
- for (u = Object.keys(i), n = 0, l = u.length; n < l; n += 1)
22
- r = u[n], e[r] = i[r];
23
- return e;
24
- }
25
- function qe(e, i) {
26
- var n = "", l;
27
- for (l = 0; l < i; l += 1)
28
- n += e;
29
- return n;
30
- }
31
- function Ue(e) {
32
- return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
33
- }
34
- var Ge = ge, $e = Ye, He = Be, Ke = qe, Ve = Ue, We = Re, _ = {
35
- isNothing: Ge,
36
- isObject: $e,
37
- toArray: He,
38
- repeat: Ke,
39
- isNegativeZero: Ve,
40
- extend: We
41
- };
42
- function Ae(e, i) {
43
- var n = "", l = e.reason || "(unknown reason)";
44
- return e.mark ? (e.mark.name && (n += 'in "' + e.mark.name + '" '), n += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !i && e.mark.snippet && (n += `
45
-
46
- ` + e.mark.snippet), l + " " + n) : l;
47
- }
48
- function q(e, i) {
49
- Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = i, this.message = Ae(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
50
- }
51
- q.prototype = Object.create(Error.prototype);
52
- q.prototype.constructor = q;
53
- q.prototype.toString = function(i) {
54
- return this.name + ": " + Ae(this, i);
55
- };
56
- var F = q;
57
- function X(e, i, n, l, r) {
58
- var u = "", o = "", c = Math.floor(r / 2) - 1;
59
- return l - i > c && (u = " ... ", i = l - c + u.length), n - l > c && (o = " ...", n = l + c - o.length), {
60
- str: u + e.slice(i, n).replace(/\t/g, "→") + o,
61
- pos: l - i + u.length
62
- // relative position
63
- };
64
- }
65
- function Z(e, i) {
66
- return _.repeat(" ", i - e.length) + e;
67
- }
68
- function Xe(e, i) {
69
- if (i = Object.create(i || null), !e.buffer) return null;
70
- i.maxLength || (i.maxLength = 79), typeof i.indent != "number" && (i.indent = 1), typeof i.linesBefore != "number" && (i.linesBefore = 3), typeof i.linesAfter != "number" && (i.linesAfter = 2);
71
- for (var n = /\r?\n|\r|\0/g, l = [0], r = [], u, o = -1; u = n.exec(e.buffer); )
72
- r.push(u.index), l.push(u.index + u[0].length), e.position <= u.index && o < 0 && (o = l.length - 2);
73
- o < 0 && (o = l.length - 1);
74
- var c = "", t, h, d = Math.min(e.line + i.linesAfter, r.length).toString().length, f = i.maxLength - (i.indent + d + 3);
75
- for (t = 1; t <= i.linesBefore && !(o - t < 0); t++)
76
- h = X(
77
- e.buffer,
78
- l[o - t],
79
- r[o - t],
80
- e.position - (l[o] - l[o - t]),
81
- f
82
- ), c = _.repeat(" ", i.indent) + Z((e.line - t + 1).toString(), d) + " | " + h.str + `
83
- ` + c;
84
- for (h = X(e.buffer, l[o], r[o], e.position, f), c += _.repeat(" ", i.indent) + Z((e.line + 1).toString(), d) + " | " + h.str + `
85
- `, c += _.repeat("-", i.indent + d + 3 + h.pos) + `^
86
- `, t = 1; t <= i.linesAfter && !(o + t >= r.length); t++)
87
- h = X(
88
- e.buffer,
89
- l[o + t],
90
- r[o + t],
91
- e.position - (l[o] - l[o + t]),
92
- f
93
- ), c += _.repeat(" ", i.indent) + Z((e.line + t + 1).toString(), d) + " | " + h.str + `
94
- `;
95
- return c.replace(/\n$/, "");
96
- }
97
- var Ze = Xe, Je = [
98
- "kind",
99
- "multi",
100
- "resolve",
101
- "construct",
102
- "instanceOf",
103
- "predicate",
104
- "represent",
105
- "representName",
106
- "defaultStyle",
107
- "styleAliases"
108
- ], ze = [
109
- "scalar",
110
- "sequence",
111
- "mapping"
112
- ];
113
- function Qe(e) {
114
- var i = {};
115
- return e !== null && Object.keys(e).forEach(function(n) {
116
- e[n].forEach(function(l) {
117
- i[String(l)] = n;
118
- });
119
- }), i;
120
- }
121
- function ei(e, i) {
122
- if (i = i || {}, Object.keys(i).forEach(function(n) {
123
- if (Je.indexOf(n) === -1)
124
- throw new F('Unknown option "' + n + '" is met in definition of "' + e + '" YAML type.');
125
- }), this.options = i, this.tag = e, this.kind = i.kind || null, this.resolve = i.resolve || function() {
126
- return !0;
127
- }, this.construct = i.construct || function(n) {
128
- return n;
129
- }, this.instanceOf = i.instanceOf || null, this.predicate = i.predicate || null, this.represent = i.represent || null, this.representName = i.representName || null, this.defaultStyle = i.defaultStyle || null, this.multi = i.multi || !1, this.styleAliases = Qe(i.styleAliases || null), ze.indexOf(this.kind) === -1)
130
- throw new F('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
131
- }
132
- var C = ei;
133
- function ae(e, i) {
134
- var n = [];
135
- return e[i].forEach(function(l) {
136
- var r = n.length;
137
- n.forEach(function(u, o) {
138
- u.tag === l.tag && u.kind === l.kind && u.multi === l.multi && (r = o);
139
- }), n[r] = l;
140
- }), n;
141
- }
142
- function ii() {
143
- var e = {
144
- scalar: {},
145
- sequence: {},
146
- mapping: {},
147
- fallback: {},
148
- multi: {
149
- scalar: [],
150
- sequence: [],
151
- mapping: [],
152
- fallback: []
153
- }
154
- }, i, n;
155
- function l(r) {
156
- r.multi ? (e.multi[r.kind].push(r), e.multi.fallback.push(r)) : e[r.kind][r.tag] = e.fallback[r.tag] = r;
157
- }
158
- for (i = 0, n = arguments.length; i < n; i += 1)
159
- arguments[i].forEach(l);
160
- return e;
161
- }
162
- function z(e) {
163
- return this.extend(e);
164
- }
165
- z.prototype.extend = function(i) {
166
- var n = [], l = [];
167
- if (i instanceof C)
168
- l.push(i);
169
- else if (Array.isArray(i))
170
- l = l.concat(i);
171
- else if (i && (Array.isArray(i.implicit) || Array.isArray(i.explicit)))
172
- i.implicit && (n = n.concat(i.implicit)), i.explicit && (l = l.concat(i.explicit));
173
- else
174
- throw new F("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
175
- n.forEach(function(u) {
176
- if (!(u instanceof C))
177
- throw new F("Specified list of YAML types (or a single Type object) contains a non-Type object.");
178
- if (u.loadKind && u.loadKind !== "scalar")
179
- throw new F("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
180
- if (u.multi)
181
- throw new F("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
182
- }), l.forEach(function(u) {
183
- if (!(u instanceof C))
184
- throw new F("Specified list of YAML types (or a single Type object) contains a non-Type object.");
185
- });
186
- var r = Object.create(z.prototype);
187
- return r.implicit = (this.implicit || []).concat(n), r.explicit = (this.explicit || []).concat(l), r.compiledImplicit = ae(r, "implicit"), r.compiledExplicit = ae(r, "explicit"), r.compiledTypeMap = ii(r.compiledImplicit, r.compiledExplicit), r;
188
- };
189
- var ni = z, ri = new C("tag:yaml.org,2002:str", {
190
- kind: "scalar",
191
- construct: function(e) {
192
- return e !== null ? e : "";
193
- }
194
- }), li = new C("tag:yaml.org,2002:seq", {
195
- kind: "sequence",
196
- construct: function(e) {
197
- return e !== null ? e : [];
198
- }
199
- }), oi = new C("tag:yaml.org,2002:map", {
200
- kind: "mapping",
201
- construct: function(e) {
202
- return e !== null ? e : {};
203
- }
204
- }), ui = new ni({
205
- explicit: [
206
- ri,
207
- li,
208
- oi
209
- ]
210
- });
211
- function ci(e) {
212
- if (e === null) return !0;
213
- var i = e.length;
214
- return i === 1 && e === "~" || i === 4 && (e === "null" || e === "Null" || e === "NULL");
215
- }
216
- function ti() {
217
- return null;
218
- }
219
- function fi(e) {
220
- return e === null;
221
- }
222
- var ai = new C("tag:yaml.org,2002:null", {
223
- kind: "scalar",
224
- resolve: ci,
225
- construct: ti,
226
- predicate: fi,
227
- represent: {
228
- canonical: function() {
229
- return "~";
230
- },
231
- lowercase: function() {
232
- return "null";
233
- },
234
- uppercase: function() {
235
- return "NULL";
236
- },
237
- camelcase: function() {
238
- return "Null";
239
- },
240
- empty: function() {
241
- return "";
242
- }
243
- },
244
- defaultStyle: "lowercase"
245
- });
246
- function pi(e) {
247
- if (e === null) return !1;
248
- var i = e.length;
249
- return i === 4 && (e === "true" || e === "True" || e === "TRUE") || i === 5 && (e === "false" || e === "False" || e === "FALSE");
250
- }
251
- function hi(e) {
252
- return e === "true" || e === "True" || e === "TRUE";
253
- }
254
- function si(e) {
255
- return Object.prototype.toString.call(e) === "[object Boolean]";
256
- }
257
- var di = new C("tag:yaml.org,2002:bool", {
258
- kind: "scalar",
259
- resolve: pi,
260
- construct: hi,
261
- predicate: si,
262
- represent: {
263
- lowercase: function(e) {
264
- return e ? "true" : "false";
265
- },
266
- uppercase: function(e) {
267
- return e ? "TRUE" : "FALSE";
268
- },
269
- camelcase: function(e) {
270
- return e ? "True" : "False";
271
- }
272
- },
273
- defaultStyle: "lowercase"
274
- });
275
- function mi(e) {
276
- return 48 <= e && e <= 57 || 65 <= e && e <= 70 || 97 <= e && e <= 102;
277
- }
278
- function xi(e) {
279
- return 48 <= e && e <= 55;
280
- }
281
- function gi(e) {
282
- return 48 <= e && e <= 57;
283
- }
284
- function Ai(e) {
285
- if (e === null) return !1;
286
- var i = e.length, n = 0, l = !1, r;
287
- if (!i) return !1;
288
- if (r = e[n], (r === "-" || r === "+") && (r = e[++n]), r === "0") {
289
- if (n + 1 === i) return !0;
290
- if (r = e[++n], r === "b") {
291
- for (n++; n < i; n++)
292
- if (r = e[n], r !== "_") {
293
- if (r !== "0" && r !== "1") return !1;
294
- l = !0;
295
- }
296
- return l && r !== "_";
297
- }
298
- if (r === "x") {
299
- for (n++; n < i; n++)
300
- if (r = e[n], r !== "_") {
301
- if (!mi(e.charCodeAt(n))) return !1;
302
- l = !0;
303
- }
304
- return l && r !== "_";
305
- }
306
- if (r === "o") {
307
- for (n++; n < i; n++)
308
- if (r = e[n], r !== "_") {
309
- if (!xi(e.charCodeAt(n))) return !1;
310
- l = !0;
311
- }
312
- return l && r !== "_";
313
- }
314
- }
315
- if (r === "_") return !1;
316
- for (; n < i; n++)
317
- if (r = e[n], r !== "_") {
318
- if (!gi(e.charCodeAt(n)))
319
- return !1;
320
- l = !0;
321
- }
322
- return !(!l || r === "_");
323
- }
324
- function vi(e) {
325
- var i = e, n = 1, l;
326
- if (i.indexOf("_") !== -1 && (i = i.replace(/_/g, "")), l = i[0], (l === "-" || l === "+") && (l === "-" && (n = -1), i = i.slice(1), l = i[0]), i === "0") return 0;
327
- if (l === "0") {
328
- if (i[1] === "b") return n * parseInt(i.slice(2), 2);
329
- if (i[1] === "x") return n * parseInt(i.slice(2), 16);
330
- if (i[1] === "o") return n * parseInt(i.slice(2), 8);
331
- }
332
- return n * parseInt(i, 10);
333
- }
334
- function yi(e) {
335
- return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !_.isNegativeZero(e);
336
- }
337
- var bi = new C("tag:yaml.org,2002:int", {
338
- kind: "scalar",
339
- resolve: Ai,
340
- construct: vi,
341
- predicate: yi,
342
- represent: {
343
- binary: function(e) {
344
- return e >= 0 ? "0b" + e.toString(2) : "-0b" + e.toString(2).slice(1);
345
- },
346
- octal: function(e) {
347
- return e >= 0 ? "0o" + e.toString(8) : "-0o" + e.toString(8).slice(1);
348
- },
349
- decimal: function(e) {
350
- return e.toString(10);
351
- },
352
- /* eslint-disable max-len */
353
- hexadecimal: function(e) {
354
- return e >= 0 ? "0x" + e.toString(16).toUpperCase() : "-0x" + e.toString(16).toUpperCase().slice(1);
355
- }
356
- },
357
- defaultStyle: "decimal",
358
- styleAliases: {
359
- binary: [2, "bin"],
360
- octal: [8, "oct"],
361
- decimal: [10, "dec"],
362
- hexadecimal: [16, "hex"]
363
- }
364
- }), wi = new RegExp(
365
- // 2.5e4, 2.5 and integers
366
- "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
367
- );
368
- function Ci(e) {
369
- return !(e === null || !wi.test(e) || // Quick hack to not allow integers end with `_`
370
- // Probably should update regexp & check speed
371
- e[e.length - 1] === "_");
372
- }
373
- function _i(e) {
374
- var i, n;
375
- return i = e.replace(/_/g, "").toLowerCase(), n = i[0] === "-" ? -1 : 1, "+-".indexOf(i[0]) >= 0 && (i = i.slice(1)), i === ".inf" ? n === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : i === ".nan" ? NaN : n * parseFloat(i, 10);
376
- }
377
- var ki = /^[-+]?[0-9]+e/;
378
- function Si(e, i) {
379
- var n;
380
- if (isNaN(e))
381
- switch (i) {
382
- case "lowercase":
383
- return ".nan";
384
- case "uppercase":
385
- return ".NAN";
386
- case "camelcase":
387
- return ".NaN";
388
- }
389
- else if (Number.POSITIVE_INFINITY === e)
390
- switch (i) {
391
- case "lowercase":
392
- return ".inf";
393
- case "uppercase":
394
- return ".INF";
395
- case "camelcase":
396
- return ".Inf";
397
- }
398
- else if (Number.NEGATIVE_INFINITY === e)
399
- switch (i) {
400
- case "lowercase":
401
- return "-.inf";
402
- case "uppercase":
403
- return "-.INF";
404
- case "camelcase":
405
- return "-.Inf";
406
- }
407
- else if (_.isNegativeZero(e))
408
- return "-0.0";
409
- return n = e.toString(10), ki.test(n) ? n.replace("e", ".e") : n;
410
- }
411
- function Ii(e) {
412
- return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || _.isNegativeZero(e));
413
- }
414
- var Ti = new C("tag:yaml.org,2002:float", {
415
- kind: "scalar",
416
- resolve: Ci,
417
- construct: _i,
418
- predicate: Ii,
419
- represent: Si,
420
- defaultStyle: "lowercase"
421
- }), Fi = ui.extend({
422
- implicit: [
423
- ai,
424
- di,
425
- bi,
426
- Ti
427
- ]
428
- }), Oi = Fi, ve = new RegExp(
429
- "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
430
- ), ye = new RegExp(
431
- "^([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]))?))?$"
432
- );
433
- function Ei(e) {
434
- return e === null ? !1 : ve.exec(e) !== null || ye.exec(e) !== null;
435
- }
436
- function Ni(e) {
437
- var i, n, l, r, u, o, c, t = 0, h = null, d, f, A;
438
- if (i = ve.exec(e), i === null && (i = ye.exec(e)), i === null) throw new Error("Date resolve error");
439
- if (n = +i[1], l = +i[2] - 1, r = +i[3], !i[4])
440
- return new Date(Date.UTC(n, l, r));
441
- if (u = +i[4], o = +i[5], c = +i[6], i[7]) {
442
- for (t = i[7].slice(0, 3); t.length < 3; )
443
- t += "0";
444
- t = +t;
445
- }
446
- return i[9] && (d = +i[10], f = +(i[11] || 0), h = (d * 60 + f) * 6e4, i[9] === "-" && (h = -h)), A = new Date(Date.UTC(n, l, r, u, o, c, t)), h && A.setTime(A.getTime() - h), A;
447
- }
448
- function Li(e) {
449
- return e.toISOString();
450
- }
451
- var Di = new C("tag:yaml.org,2002:timestamp", {
452
- kind: "scalar",
453
- resolve: Ei,
454
- construct: Ni,
455
- instanceOf: Date,
456
- represent: Li
457
- });
458
- function Mi(e) {
459
- return e === "<<" || e === null;
460
- }
461
- var ji = new C("tag:yaml.org,2002:merge", {
462
- kind: "scalar",
463
- resolve: Mi
464
- }), Q = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
465
- \r`;
466
- function Pi(e) {
467
- if (e === null) return !1;
468
- var i, n, l = 0, r = e.length, u = Q;
469
- for (n = 0; n < r; n++)
470
- if (i = u.indexOf(e.charAt(n)), !(i > 64)) {
471
- if (i < 0) return !1;
472
- l += 6;
473
- }
474
- return l % 8 === 0;
475
- }
476
- function Yi(e) {
477
- var i, n, l = e.replace(/[\r\n=]/g, ""), r = l.length, u = Q, o = 0, c = [];
478
- for (i = 0; i < r; i++)
479
- i % 4 === 0 && i && (c.push(o >> 16 & 255), c.push(o >> 8 & 255), c.push(o & 255)), o = o << 6 | u.indexOf(l.charAt(i));
480
- return n = r % 4 * 6, n === 0 ? (c.push(o >> 16 & 255), c.push(o >> 8 & 255), c.push(o & 255)) : n === 18 ? (c.push(o >> 10 & 255), c.push(o >> 2 & 255)) : n === 12 && c.push(o >> 4 & 255), new Uint8Array(c);
481
- }
482
- function Bi(e) {
483
- var i = "", n = 0, l, r, u = e.length, o = Q;
484
- for (l = 0; l < u; l++)
485
- l % 3 === 0 && l && (i += o[n >> 18 & 63], i += o[n >> 12 & 63], i += o[n >> 6 & 63], i += o[n & 63]), n = (n << 8) + e[l];
486
- return r = u % 3, r === 0 ? (i += o[n >> 18 & 63], i += o[n >> 12 & 63], i += o[n >> 6 & 63], i += o[n & 63]) : r === 2 ? (i += o[n >> 10 & 63], i += o[n >> 4 & 63], i += o[n << 2 & 63], i += o[64]) : r === 1 && (i += o[n >> 2 & 63], i += o[n << 4 & 63], i += o[64], i += o[64]), i;
487
- }
488
- function Ri(e) {
489
- return Object.prototype.toString.call(e) === "[object Uint8Array]";
490
- }
491
- var qi = new C("tag:yaml.org,2002:binary", {
492
- kind: "scalar",
493
- resolve: Pi,
494
- construct: Yi,
495
- predicate: Ri,
496
- represent: Bi
497
- }), Ui = Object.prototype.hasOwnProperty, Gi = Object.prototype.toString;
498
- function $i(e) {
499
- if (e === null) return !0;
500
- var i = [], n, l, r, u, o, c = e;
501
- for (n = 0, l = c.length; n < l; n += 1) {
502
- if (r = c[n], o = !1, Gi.call(r) !== "[object Object]") return !1;
503
- for (u in r)
504
- if (Ui.call(r, u))
505
- if (!o) o = !0;
506
- else return !1;
507
- if (!o) return !1;
508
- if (i.indexOf(u) === -1) i.push(u);
509
- else return !1;
510
- }
511
- return !0;
512
- }
513
- function Hi(e) {
514
- return e !== null ? e : [];
515
- }
516
- var Ki = new C("tag:yaml.org,2002:omap", {
517
- kind: "sequence",
518
- resolve: $i,
519
- construct: Hi
520
- }), Vi = Object.prototype.toString;
521
- function Wi(e) {
522
- if (e === null) return !0;
523
- var i, n, l, r, u, o = e;
524
- for (u = new Array(o.length), i = 0, n = o.length; i < n; i += 1) {
525
- if (l = o[i], Vi.call(l) !== "[object Object]" || (r = Object.keys(l), r.length !== 1)) return !1;
526
- u[i] = [r[0], l[r[0]]];
527
- }
528
- return !0;
529
- }
530
- function Xi(e) {
531
- if (e === null) return [];
532
- var i, n, l, r, u, o = e;
533
- for (u = new Array(o.length), i = 0, n = o.length; i < n; i += 1)
534
- l = o[i], r = Object.keys(l), u[i] = [r[0], l[r[0]]];
535
- return u;
536
- }
537
- var Zi = new C("tag:yaml.org,2002:pairs", {
538
- kind: "sequence",
539
- resolve: Wi,
540
- construct: Xi
541
- }), Ji = Object.prototype.hasOwnProperty;
542
- function zi(e) {
543
- if (e === null) return !0;
544
- var i, n = e;
545
- for (i in n)
546
- if (Ji.call(n, i) && n[i] !== null)
547
- return !1;
548
- return !0;
549
- }
550
- function Qi(e) {
551
- return e !== null ? e : {};
552
- }
553
- var en = new C("tag:yaml.org,2002:set", {
554
- kind: "mapping",
555
- resolve: zi,
556
- construct: Qi
557
- }), nn = Oi.extend({
558
- implicit: [
559
- Di,
560
- ji
561
- ],
562
- explicit: [
563
- qi,
564
- Ki,
565
- Zi,
566
- en
567
- ]
568
- }), N = Object.prototype.hasOwnProperty, G = 1, be = 2, we = 3, $ = 4, J = 1, rn = 2, pe = 3, ln = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, on = /[\x85\u2028\u2029]/, un = /[,\[\]\{\}]/, Ce = /^(?:!|!!|![a-z\-]+!)$/i, _e = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
569
- function he(e) {
570
- return Object.prototype.toString.call(e);
571
- }
572
- function I(e) {
573
- return e === 10 || e === 13;
574
- }
575
- function L(e) {
576
- return e === 9 || e === 32;
577
- }
578
- function k(e) {
579
- return e === 9 || e === 32 || e === 10 || e === 13;
580
- }
581
- function j(e) {
582
- return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
583
- }
584
- function cn(e) {
585
- var i;
586
- return 48 <= e && e <= 57 ? e - 48 : (i = e | 32, 97 <= i && i <= 102 ? i - 97 + 10 : -1);
587
- }
588
- function tn(e) {
589
- return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
590
- }
591
- function fn(e) {
592
- return 48 <= e && e <= 57 ? e - 48 : -1;
593
- }
594
- function se(e) {
595
- return e === 48 ? "\0" : e === 97 ? "\x07" : e === 98 ? "\b" : e === 116 || e === 9 ? " " : e === 110 ? `
596
- ` : 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" : "";
597
- }
598
- function an(e) {
599
- return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode(
600
- (e - 65536 >> 10) + 55296,
601
- (e - 65536 & 1023) + 56320
602
- );
603
- }
604
- var ke = new Array(256), Se = new Array(256);
605
- for (var M = 0; M < 256; M++)
606
- ke[M] = se(M) ? 1 : 0, Se[M] = se(M);
607
- function pn(e, i) {
608
- this.input = e, this.filename = i.filename || null, this.schema = i.schema || nn, this.onWarning = i.onWarning || null, this.legacy = i.legacy || !1, this.json = i.json || !1, this.listener = i.listener || null, this.implicitTypes = this.schema.compiledImplicit, this.typeMap = this.schema.compiledTypeMap, this.length = e.length, this.position = 0, this.line = 0, this.lineStart = 0, this.lineIndent = 0, this.firstTabInLine = -1, this.documents = [];
609
- }
610
- function Ie(e, i) {
611
- var n = {
612
- name: e.filename,
613
- buffer: e.input.slice(0, -1),
614
- // omit trailing \0
615
- position: e.position,
616
- line: e.line,
617
- column: e.position - e.lineStart
618
- };
619
- return n.snippet = Ze(n), new F(i, n);
620
- }
621
- function a(e, i) {
622
- throw Ie(e, i);
623
- }
624
- function H(e, i) {
625
- e.onWarning && e.onWarning.call(null, Ie(e, i));
626
- }
627
- var de = {
628
- YAML: function(i, n, l) {
629
- var r, u, o;
630
- i.version !== null && a(i, "duplication of %YAML directive"), l.length !== 1 && a(i, "YAML directive accepts exactly one argument"), r = /^([0-9]+)\.([0-9]+)$/.exec(l[0]), r === null && a(i, "ill-formed argument of the YAML directive"), u = parseInt(r[1], 10), o = parseInt(r[2], 10), u !== 1 && a(i, "unacceptable YAML version of the document"), i.version = l[0], i.checkLineBreaks = o < 2, o !== 1 && o !== 2 && H(i, "unsupported YAML version of the document");
631
- },
632
- TAG: function(i, n, l) {
633
- var r, u;
634
- l.length !== 2 && a(i, "TAG directive accepts exactly two arguments"), r = l[0], u = l[1], Ce.test(r) || a(i, "ill-formed tag handle (first argument) of the TAG directive"), N.call(i.tagMap, r) && a(i, 'there is a previously declared suffix for "' + r + '" tag handle'), _e.test(u) || a(i, "ill-formed tag prefix (second argument) of the TAG directive");
635
- try {
636
- u = decodeURIComponent(u);
637
- } catch {
638
- a(i, "tag prefix is malformed: " + u);
639
- }
640
- i.tagMap[r] = u;
641
- }
642
- };
643
- function E(e, i, n, l) {
644
- var r, u, o, c;
645
- if (i < n) {
646
- if (c = e.input.slice(i, n), l)
647
- for (r = 0, u = c.length; r < u; r += 1)
648
- o = c.charCodeAt(r), o === 9 || 32 <= o && o <= 1114111 || a(e, "expected valid JSON character");
649
- else ln.test(c) && a(e, "the stream contains non-printable characters");
650
- e.result += c;
651
- }
652
- }
653
- function me(e, i, n, l) {
654
- var r, u, o, c;
655
- for (_.isObject(n) || a(e, "cannot merge mappings; the provided source object is unacceptable"), r = Object.keys(n), o = 0, c = r.length; o < c; o += 1)
656
- u = r[o], N.call(i, u) || (i[u] = n[u], l[u] = !0);
657
- }
658
- function P(e, i, n, l, r, u, o, c, t) {
659
- var h, d;
660
- if (Array.isArray(r))
661
- for (r = Array.prototype.slice.call(r), h = 0, d = r.length; h < d; h += 1)
662
- Array.isArray(r[h]) && a(e, "nested arrays are not supported inside keys"), typeof r == "object" && he(r[h]) === "[object Object]" && (r[h] = "[object Object]");
663
- if (typeof r == "object" && he(r) === "[object Object]" && (r = "[object Object]"), r = String(r), i === null && (i = {}), l === "tag:yaml.org,2002:merge")
664
- if (Array.isArray(u))
665
- for (h = 0, d = u.length; h < d; h += 1)
666
- me(e, i, u[h], n);
667
- else
668
- me(e, i, u, n);
669
- else
670
- !e.json && !N.call(n, r) && N.call(i, r) && (e.line = o || e.line, e.lineStart = c || e.lineStart, e.position = t || e.position, a(e, "duplicated mapping key")), r === "__proto__" ? Object.defineProperty(i, r, {
671
- configurable: !0,
672
- enumerable: !0,
673
- writable: !0,
674
- value: u
675
- }) : i[r] = u, delete n[r];
676
- return i;
677
- }
678
- function ee(e) {
679
- var i;
680
- i = e.input.charCodeAt(e.position), i === 10 ? e.position++ : i === 13 ? (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++) : a(e, "a line break is expected"), e.line += 1, e.lineStart = e.position, e.firstTabInLine = -1;
681
- }
682
- function b(e, i, n) {
683
- for (var l = 0, r = e.input.charCodeAt(e.position); r !== 0; ) {
684
- for (; L(r); )
685
- r === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), r = e.input.charCodeAt(++e.position);
686
- if (i && r === 35)
687
- do
688
- r = e.input.charCodeAt(++e.position);
689
- while (r !== 10 && r !== 13 && r !== 0);
690
- if (I(r))
691
- for (ee(e), r = e.input.charCodeAt(e.position), l++, e.lineIndent = 0; r === 32; )
692
- e.lineIndent++, r = e.input.charCodeAt(++e.position);
693
- else
694
- break;
695
- }
696
- return n !== -1 && l !== 0 && e.lineIndent < n && H(e, "deficient indentation"), l;
697
- }
698
- function K(e) {
699
- var i = e.position, n;
700
- return n = e.input.charCodeAt(i), !!((n === 45 || n === 46) && n === e.input.charCodeAt(i + 1) && n === e.input.charCodeAt(i + 2) && (i += 3, n = e.input.charCodeAt(i), n === 0 || k(n)));
701
- }
702
- function ie(e, i) {
703
- i === 1 ? e.result += " " : i > 1 && (e.result += _.repeat(`
704
- `, i - 1));
705
- }
706
- function hn(e, i, n) {
707
- var l, r, u, o, c, t, h, d, f = e.kind, A = e.result, p;
708
- if (p = e.input.charCodeAt(e.position), k(p) || j(p) || p === 35 || p === 38 || p === 42 || p === 33 || p === 124 || p === 62 || p === 39 || p === 34 || p === 37 || p === 64 || p === 96 || (p === 63 || p === 45) && (r = e.input.charCodeAt(e.position + 1), k(r) || n && j(r)))
709
- return !1;
710
- for (e.kind = "scalar", e.result = "", u = o = e.position, c = !1; p !== 0; ) {
711
- if (p === 58) {
712
- if (r = e.input.charCodeAt(e.position + 1), k(r) || n && j(r))
713
- break;
714
- } else if (p === 35) {
715
- if (l = e.input.charCodeAt(e.position - 1), k(l))
716
- break;
717
- } else {
718
- if (e.position === e.lineStart && K(e) || n && j(p))
719
- break;
720
- if (I(p))
721
- if (t = e.line, h = e.lineStart, d = e.lineIndent, b(e, !1, -1), e.lineIndent >= i) {
722
- c = !0, p = e.input.charCodeAt(e.position);
723
- continue;
724
- } else {
725
- e.position = o, e.line = t, e.lineStart = h, e.lineIndent = d;
726
- break;
727
- }
728
- }
729
- c && (E(e, u, o, !1), ie(e, e.line - t), u = o = e.position, c = !1), L(p) || (o = e.position + 1), p = e.input.charCodeAt(++e.position);
730
- }
731
- return E(e, u, o, !1), e.result ? !0 : (e.kind = f, e.result = A, !1);
732
- }
733
- function sn(e, i) {
734
- var n, l, r;
735
- if (n = e.input.charCodeAt(e.position), n !== 39)
736
- return !1;
737
- for (e.kind = "scalar", e.result = "", e.position++, l = r = e.position; (n = e.input.charCodeAt(e.position)) !== 0; )
738
- if (n === 39)
739
- if (E(e, l, e.position, !0), n = e.input.charCodeAt(++e.position), n === 39)
740
- l = e.position, e.position++, r = e.position;
741
- else
742
- return !0;
743
- else I(n) ? (E(e, l, r, !0), ie(e, b(e, !1, i)), l = r = e.position) : e.position === e.lineStart && K(e) ? a(e, "unexpected end of the document within a single quoted scalar") : (e.position++, r = e.position);
744
- a(e, "unexpected end of the stream within a single quoted scalar");
745
- }
746
- function dn(e, i) {
747
- var n, l, r, u, o, c;
748
- if (c = e.input.charCodeAt(e.position), c !== 34)
749
- return !1;
750
- for (e.kind = "scalar", e.result = "", e.position++, n = l = e.position; (c = e.input.charCodeAt(e.position)) !== 0; ) {
751
- if (c === 34)
752
- return E(e, n, e.position, !0), e.position++, !0;
753
- if (c === 92) {
754
- if (E(e, n, e.position, !0), c = e.input.charCodeAt(++e.position), I(c))
755
- b(e, !1, i);
756
- else if (c < 256 && ke[c])
757
- e.result += Se[c], e.position++;
758
- else if ((o = tn(c)) > 0) {
759
- for (r = o, u = 0; r > 0; r--)
760
- c = e.input.charCodeAt(++e.position), (o = cn(c)) >= 0 ? u = (u << 4) + o : a(e, "expected hexadecimal character");
761
- e.result += an(u), e.position++;
762
- } else
763
- a(e, "unknown escape sequence");
764
- n = l = e.position;
765
- } else I(c) ? (E(e, n, l, !0), ie(e, b(e, !1, i)), n = l = e.position) : e.position === e.lineStart && K(e) ? a(e, "unexpected end of the document within a double quoted scalar") : (e.position++, l = e.position);
766
- }
767
- a(e, "unexpected end of the stream within a double quoted scalar");
768
- }
769
- function mn(e, i) {
770
- var n = !0, l, r, u, o = e.tag, c, t = e.anchor, h, d, f, A, p, x = /* @__PURE__ */ Object.create(null), v, g, S, s;
771
- if (s = e.input.charCodeAt(e.position), s === 91)
772
- d = 93, p = !1, c = [];
773
- else if (s === 123)
774
- d = 125, p = !0, c = {};
775
- else
776
- return !1;
777
- for (e.anchor !== null && (e.anchorMap[e.anchor] = c), s = e.input.charCodeAt(++e.position); s !== 0; ) {
778
- if (b(e, !0, i), s = e.input.charCodeAt(e.position), s === d)
779
- return e.position++, e.tag = o, e.anchor = t, e.kind = p ? "mapping" : "sequence", e.result = c, !0;
780
- n ? s === 44 && a(e, "expected the node content, but found ','") : a(e, "missed comma between flow collection entries"), g = v = S = null, f = A = !1, s === 63 && (h = e.input.charCodeAt(e.position + 1), k(h) && (f = A = !0, e.position++, b(e, !0, i))), l = e.line, r = e.lineStart, u = e.position, Y(e, i, G, !1, !0), g = e.tag, v = e.result, b(e, !0, i), s = e.input.charCodeAt(e.position), (A || e.line === l) && s === 58 && (f = !0, s = e.input.charCodeAt(++e.position), b(e, !0, i), Y(e, i, G, !1, !0), S = e.result), p ? P(e, c, x, g, v, S, l, r, u) : f ? c.push(P(e, null, x, g, v, S, l, r, u)) : c.push(v), b(e, !0, i), s = e.input.charCodeAt(e.position), s === 44 ? (n = !0, s = e.input.charCodeAt(++e.position)) : n = !1;
781
- }
782
- a(e, "unexpected end of the stream within a flow collection");
783
- }
784
- function xn(e, i) {
785
- var n, l, r = J, u = !1, o = !1, c = i, t = 0, h = !1, d, f;
786
- if (f = e.input.charCodeAt(e.position), f === 124)
787
- l = !1;
788
- else if (f === 62)
789
- l = !0;
790
- else
791
- return !1;
792
- for (e.kind = "scalar", e.result = ""; f !== 0; )
793
- if (f = e.input.charCodeAt(++e.position), f === 43 || f === 45)
794
- J === r ? r = f === 43 ? pe : rn : a(e, "repeat of a chomping mode identifier");
795
- else if ((d = fn(f)) >= 0)
796
- d === 0 ? a(e, "bad explicit indentation width of a block scalar; it cannot be less than one") : o ? a(e, "repeat of an indentation width identifier") : (c = i + d - 1, o = !0);
797
- else
798
- break;
799
- if (L(f)) {
800
- do
801
- f = e.input.charCodeAt(++e.position);
802
- while (L(f));
803
- if (f === 35)
804
- do
805
- f = e.input.charCodeAt(++e.position);
806
- while (!I(f) && f !== 0);
807
- }
808
- for (; f !== 0; ) {
809
- for (ee(e), e.lineIndent = 0, f = e.input.charCodeAt(e.position); (!o || e.lineIndent < c) && f === 32; )
810
- e.lineIndent++, f = e.input.charCodeAt(++e.position);
811
- if (!o && e.lineIndent > c && (c = e.lineIndent), I(f)) {
812
- t++;
813
- continue;
814
- }
815
- if (e.lineIndent < c) {
816
- r === pe ? e.result += _.repeat(`
817
- `, u ? 1 + t : t) : r === J && u && (e.result += `
818
- `);
819
- break;
820
- }
821
- for (l ? L(f) ? (h = !0, e.result += _.repeat(`
822
- `, u ? 1 + t : t)) : h ? (h = !1, e.result += _.repeat(`
823
- `, t + 1)) : t === 0 ? u && (e.result += " ") : e.result += _.repeat(`
824
- `, t) : e.result += _.repeat(`
825
- `, u ? 1 + t : t), u = !0, o = !0, t = 0, n = e.position; !I(f) && f !== 0; )
826
- f = e.input.charCodeAt(++e.position);
827
- E(e, n, e.position, !1);
828
- }
829
- return !0;
830
- }
831
- function xe(e, i) {
832
- var n, l = e.tag, r = e.anchor, u = [], o, c = !1, t;
833
- if (e.firstTabInLine !== -1) return !1;
834
- for (e.anchor !== null && (e.anchorMap[e.anchor] = u), t = e.input.charCodeAt(e.position); t !== 0 && (e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, a(e, "tab characters must not be used in indentation")), !(t !== 45 || (o = e.input.charCodeAt(e.position + 1), !k(o)))); ) {
835
- if (c = !0, e.position++, b(e, !0, -1) && e.lineIndent <= i) {
836
- u.push(null), t = e.input.charCodeAt(e.position);
837
- continue;
838
- }
839
- if (n = e.line, Y(e, i, we, !1, !0), u.push(e.result), b(e, !0, -1), t = e.input.charCodeAt(e.position), (e.line === n || e.lineIndent > i) && t !== 0)
840
- a(e, "bad indentation of a sequence entry");
841
- else if (e.lineIndent < i)
842
- break;
843
- }
844
- return c ? (e.tag = l, e.anchor = r, e.kind = "sequence", e.result = u, !0) : !1;
845
- }
846
- function gn(e, i, n) {
847
- var l, r, u, o, c, t, h = e.tag, d = e.anchor, f = {}, A = /* @__PURE__ */ Object.create(null), p = null, x = null, v = null, g = !1, S = !1, s;
848
- if (e.firstTabInLine !== -1) return !1;
849
- for (e.anchor !== null && (e.anchorMap[e.anchor] = f), s = e.input.charCodeAt(e.position); s !== 0; ) {
850
- if (!g && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, a(e, "tab characters must not be used in indentation")), l = e.input.charCodeAt(e.position + 1), u = e.line, (s === 63 || s === 58) && k(l))
851
- s === 63 ? (g && (P(e, f, A, p, x, null, o, c, t), p = x = v = null), S = !0, g = !0, r = !0) : g ? (g = !1, r = !0) : a(e, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), e.position += 1, s = l;
852
- else {
853
- if (o = e.line, c = e.lineStart, t = e.position, !Y(e, n, be, !1, !0))
854
- break;
855
- if (e.line === u) {
856
- for (s = e.input.charCodeAt(e.position); L(s); )
857
- s = e.input.charCodeAt(++e.position);
858
- if (s === 58)
859
- s = e.input.charCodeAt(++e.position), k(s) || a(e, "a whitespace character is expected after the key-value separator within a block mapping"), g && (P(e, f, A, p, x, null, o, c, t), p = x = v = null), S = !0, g = !1, r = !1, p = e.tag, x = e.result;
860
- else if (S)
861
- a(e, "can not read an implicit mapping pair; a colon is missed");
862
- else
863
- return e.tag = h, e.anchor = d, !0;
864
- } else if (S)
865
- a(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
866
- else
867
- return e.tag = h, e.anchor = d, !0;
868
- }
869
- if ((e.line === u || e.lineIndent > i) && (g && (o = e.line, c = e.lineStart, t = e.position), Y(e, i, $, !0, r) && (g ? x = e.result : v = e.result), g || (P(e, f, A, p, x, v, o, c, t), p = x = v = null), b(e, !0, -1), s = e.input.charCodeAt(e.position)), (e.line === u || e.lineIndent > i) && s !== 0)
870
- a(e, "bad indentation of a mapping entry");
871
- else if (e.lineIndent < i)
872
- break;
873
- }
874
- return g && P(e, f, A, p, x, null, o, c, t), S && (e.tag = h, e.anchor = d, e.kind = "mapping", e.result = f), S;
875
- }
876
- function An(e) {
877
- var i, n = !1, l = !1, r, u, o;
878
- if (o = e.input.charCodeAt(e.position), o !== 33) return !1;
879
- if (e.tag !== null && a(e, "duplication of a tag property"), o = e.input.charCodeAt(++e.position), o === 60 ? (n = !0, o = e.input.charCodeAt(++e.position)) : o === 33 ? (l = !0, r = "!!", o = e.input.charCodeAt(++e.position)) : r = "!", i = e.position, n) {
880
- do
881
- o = e.input.charCodeAt(++e.position);
882
- while (o !== 0 && o !== 62);
883
- e.position < e.length ? (u = e.input.slice(i, e.position), o = e.input.charCodeAt(++e.position)) : a(e, "unexpected end of the stream within a verbatim tag");
884
- } else {
885
- for (; o !== 0 && !k(o); )
886
- o === 33 && (l ? a(e, "tag suffix cannot contain exclamation marks") : (r = e.input.slice(i - 1, e.position + 1), Ce.test(r) || a(e, "named tag handle cannot contain such characters"), l = !0, i = e.position + 1)), o = e.input.charCodeAt(++e.position);
887
- u = e.input.slice(i, e.position), un.test(u) && a(e, "tag suffix cannot contain flow indicator characters");
888
- }
889
- u && !_e.test(u) && a(e, "tag name cannot contain such characters: " + u);
890
- try {
891
- u = decodeURIComponent(u);
892
- } catch {
893
- a(e, "tag name is malformed: " + u);
894
- }
895
- return n ? e.tag = u : N.call(e.tagMap, r) ? e.tag = e.tagMap[r] + u : r === "!" ? e.tag = "!" + u : r === "!!" ? e.tag = "tag:yaml.org,2002:" + u : a(e, 'undeclared tag handle "' + r + '"'), !0;
896
- }
897
- function vn(e) {
898
- var i, n;
899
- if (n = e.input.charCodeAt(e.position), n !== 38) return !1;
900
- for (e.anchor !== null && a(e, "duplication of an anchor property"), n = e.input.charCodeAt(++e.position), i = e.position; n !== 0 && !k(n) && !j(n); )
901
- n = e.input.charCodeAt(++e.position);
902
- return e.position === i && a(e, "name of an anchor node must contain at least one character"), e.anchor = e.input.slice(i, e.position), !0;
903
- }
904
- function yn(e) {
905
- var i, n, l;
906
- if (l = e.input.charCodeAt(e.position), l !== 42) return !1;
907
- for (l = e.input.charCodeAt(++e.position), i = e.position; l !== 0 && !k(l) && !j(l); )
908
- l = e.input.charCodeAt(++e.position);
909
- return e.position === i && a(e, "name of an alias node must contain at least one character"), n = e.input.slice(i, e.position), N.call(e.anchorMap, n) || a(e, 'unidentified alias "' + n + '"'), e.result = e.anchorMap[n], b(e, !0, -1), !0;
910
- }
911
- function Y(e, i, n, l, r) {
912
- var u, o, c, t = 1, h = !1, d = !1, f, A, p, x, v, g;
913
- if (e.listener !== null && e.listener("open", e), e.tag = null, e.anchor = null, e.kind = null, e.result = null, u = o = c = $ === n || we === n, l && b(e, !0, -1) && (h = !0, e.lineIndent > i ? t = 1 : e.lineIndent === i ? t = 0 : e.lineIndent < i && (t = -1)), t === 1)
914
- for (; An(e) || vn(e); )
915
- b(e, !0, -1) ? (h = !0, c = u, e.lineIndent > i ? t = 1 : e.lineIndent === i ? t = 0 : e.lineIndent < i && (t = -1)) : c = !1;
916
- if (c && (c = h || r), (t === 1 || $ === n) && (G === n || be === n ? v = i : v = i + 1, g = e.position - e.lineStart, t === 1 ? c && (xe(e, g) || gn(e, g, v)) || mn(e, v) ? d = !0 : (o && xn(e, v) || sn(e, v) || dn(e, v) ? d = !0 : yn(e) ? (d = !0, (e.tag !== null || e.anchor !== null) && a(e, "alias node should not have any properties")) : hn(e, v, G === n) && (d = !0, e.tag === null && (e.tag = "?")), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : t === 0 && (d = c && xe(e, g))), e.tag === null)
917
- e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
918
- else if (e.tag === "?") {
919
- for (e.result !== null && e.kind !== "scalar" && a(e, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + e.kind + '"'), f = 0, A = e.implicitTypes.length; f < A; f += 1)
920
- if (x = e.implicitTypes[f], x.resolve(e.result)) {
921
- e.result = x.construct(e.result), e.tag = x.tag, e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
922
- break;
923
- }
924
- } else if (e.tag !== "!") {
925
- if (N.call(e.typeMap[e.kind || "fallback"], e.tag))
926
- x = e.typeMap[e.kind || "fallback"][e.tag];
927
- else
928
- for (x = null, p = e.typeMap.multi[e.kind || "fallback"], f = 0, A = p.length; f < A; f += 1)
929
- if (e.tag.slice(0, p[f].tag.length) === p[f].tag) {
930
- x = p[f];
931
- break;
932
- }
933
- x || a(e, "unknown tag !<" + e.tag + ">"), e.result !== null && x.kind !== e.kind && a(e, "unacceptable node kind for !<" + e.tag + '> tag; it should be "' + x.kind + '", not "' + e.kind + '"'), x.resolve(e.result, e.tag) ? (e.result = x.construct(e.result, e.tag), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : a(e, "cannot resolve a node with !<" + e.tag + "> explicit tag");
934
- }
935
- return e.listener !== null && e.listener("close", e), e.tag !== null || e.anchor !== null || d;
936
- }
937
- function bn(e) {
938
- var i = e.position, n, l, r, u = !1, o;
939
- for (e.version = null, e.checkLineBreaks = e.legacy, e.tagMap = /* @__PURE__ */ Object.create(null), e.anchorMap = /* @__PURE__ */ Object.create(null); (o = e.input.charCodeAt(e.position)) !== 0 && (b(e, !0, -1), o = e.input.charCodeAt(e.position), !(e.lineIndent > 0 || o !== 37)); ) {
940
- for (u = !0, o = e.input.charCodeAt(++e.position), n = e.position; o !== 0 && !k(o); )
941
- o = e.input.charCodeAt(++e.position);
942
- for (l = e.input.slice(n, e.position), r = [], l.length < 1 && a(e, "directive name must not be less than one character in length"); o !== 0; ) {
943
- for (; L(o); )
944
- o = e.input.charCodeAt(++e.position);
945
- if (o === 35) {
946
- do
947
- o = e.input.charCodeAt(++e.position);
948
- while (o !== 0 && !I(o));
949
- break;
950
- }
951
- if (I(o)) break;
952
- for (n = e.position; o !== 0 && !k(o); )
953
- o = e.input.charCodeAt(++e.position);
954
- r.push(e.input.slice(n, e.position));
955
- }
956
- o !== 0 && ee(e), N.call(de, l) ? de[l](e, l, r) : H(e, 'unknown document directive "' + l + '"');
957
- }
958
- if (b(e, !0, -1), e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 ? (e.position += 3, b(e, !0, -1)) : u && a(e, "directives end mark is expected"), Y(e, e.lineIndent - 1, $, !1, !0), b(e, !0, -1), e.checkLineBreaks && on.test(e.input.slice(i, e.position)) && H(e, "non-ASCII line breaks are interpreted as content"), e.documents.push(e.result), e.position === e.lineStart && K(e)) {
959
- e.input.charCodeAt(e.position) === 46 && (e.position += 3, b(e, !0, -1));
960
- return;
961
- }
962
- if (e.position < e.length - 1)
963
- a(e, "end of the stream or a document separator is expected");
964
- else
965
- return;
966
- }
967
- function wn(e, i) {
968
- e = String(e), i = i || {}, e.length !== 0 && (e.charCodeAt(e.length - 1) !== 10 && e.charCodeAt(e.length - 1) !== 13 && (e += `
969
- `), e.charCodeAt(0) === 65279 && (e = e.slice(1)));
970
- var n = new pn(e, i), l = e.indexOf("\0");
971
- for (l !== -1 && (n.position = l, a(n, "null byte is not allowed in input")), n.input += "\0"; n.input.charCodeAt(n.position) === 32; )
972
- n.lineIndent += 1, n.position += 1;
973
- for (; n.position < n.length - 1; )
974
- bn(n);
975
- return n.documents;
976
- }
977
- function Cn(e, i) {
978
- var n = wn(e, i);
979
- if (n.length !== 0) {
980
- if (n.length === 1)
981
- return n[0];
982
- throw new F("expected a single document in the stream, but found more");
983
- }
984
- }
985
- var _n = Cn, kn = {
986
- load: _n
987
- }, Sn = kn.load;
988
- const Dn = ({
989
- dataFetchMethod: e,
990
- dataUrl: i,
991
- headersForData: n,
992
- plugins: l,
993
- debugMode: r,
994
- DebugModeContentWrapper: u,
995
- DebugModeDataWrapper: o,
996
- DebugModeRootWrapper: c
997
- }) => {
998
- const [t, h] = je((m, T) => {
999
- switch (T.type) {
1000
- case "setData":
1001
- return { updateId: 0, realCurrentData: T.data };
1002
- case "updateData":
1003
- return Fe(m, T.path, T.value, T.updateMode);
1004
- default:
1005
- return m;
1006
- }
1007
- }, { updateId: 0, realCurrentData: {} }), [d, f] = R(0), [A, p] = R({}), [x, v] = R({}), [g, S] = R([]), [s, V] = R();
1008
- fe(() => {
1009
- i && (typeof e == "string" && e.toLowerCase() === "post" ? te.post(
1010
- i,
1011
- {
1012
- headers: n
1013
- }
1014
- ).then((m) => {
1015
- V(m.data);
1016
- }) : te.get(
1017
- i,
1018
- {
1019
- headers: n
1020
- }
1021
- ).then((m) => {
1022
- V(m.data);
1023
- }));
1024
- }, [i, n]), fe(() => {
1025
- if (!s)
1026
- return;
1027
- let m = s;
1028
- if (typeof m != "object")
1029
- try {
1030
- m = JSON.parse(s);
1031
- } catch {
1032
- try {
1033
- m = Sn(s);
1034
- } catch {
1035
- console.log("Tried to load app data but the content could not be parsed as JSON nor YAML.");
1036
- return;
1037
- }
1038
- }
1039
- p(m.templates ?? m.listForms), !m.templates && m.listForms && console.log("'listForms' needs to be renamed to 'templates'. The support for 'listForms' will be removed in the next releases of reactive-json."), h({ type: "setData", data: m.data }), v(m.renderView), S(Object.keys(m.renderView));
1040
- }, [s]);
1041
- const Te = (m, T, O = void 0) => {
1042
- let B = T.replace("data.", "");
1043
- h({
1044
- type: "updateData",
1045
- path: B,
1046
- value: m,
1047
- updateMode: O
1048
- });
1049
- };
1050
- function Fe(m, T, O, B = void 0) {
1051
- const le = T.split(".");
1052
- let y = m.realCurrentData;
1053
- for (let U = 0, oe = le.length; U < oe; U++) {
1054
- const w = le[U];
1055
- if (U === oe - 1) {
1056
- if (B === "remove" && Array.isArray(y))
1057
- y.splice(w, 1);
1058
- else if (B === "move")
1059
- if (O.increment) {
1060
- if (!Array.isArray(y))
1061
- return m;
1062
- const ue = Math.min(y.length, Math.max(0, parseInt(w) + parseInt(O.increment)));
1063
- if (ue === parseInt(w))
1064
- return m;
1065
- const ce = y.splice(w, 1);
1066
- if (ce.length < 1)
1067
- return m;
1068
- y.splice(ue, 0, ce[0]);
1069
- } else
1070
- return m;
1071
- else if (O === void 0)
1072
- delete y[w];
1073
- else {
1074
- if (De.isEqual(O, y[w]))
1075
- return m;
1076
- B === "add" ? (y[w] === void 0 && (y[w] = []), y[w].push(O)) : y[w] = O;
1077
- }
1078
- return {
1079
- // Using modulo in case of massive update counts in long frontend sessions.
1080
- updateId: (m.updateId ?? 0) % (Number.MAX_SAFE_INTEGER - 1) + 1,
1081
- realCurrentData: m.realCurrentData
1082
- };
1083
- }
1084
- if (y.hasOwnProperty(w)) {
1085
- (typeof y[w] != "object" || y[w] === null) && (y[w] = {}), y = y[w];
1086
- continue;
1087
- }
1088
- y[w] = {}, y = y[w];
1089
- }
1090
- throw new Error("Could not update data.");
1091
- }
1092
- if (!s)
1093
- return null;
1094
- const ne = g.map((m) => /* @__PURE__ */ D(
1095
- Me,
1096
- {
1097
- datafield: m,
1098
- props: x[m],
1099
- path: "data." + m,
1100
- currentData: t.realCurrentData[m]
1101
- },
1102
- m
1103
- )), W = Pe(r), re = /* @__PURE__ */ D(Ee, { children: /* @__PURE__ */ Oe(
1104
- Ne,
1105
- {
1106
- value: {
1107
- element: A,
1108
- headersForData: n,
1109
- plugins: l,
1110
- setRawAppData: V,
1111
- templateData: t.realCurrentData,
1112
- templatePath: "data",
1113
- updateData: Te
1114
- },
1115
- children: [
1116
- /* @__PURE__ */ D(Le.Provider, { value: { templateData: t.realCurrentData, templatePath: "data" }, children: W && u ? /* @__PURE__ */ D(u, { children: ne }) : ne }),
1117
- W ? o && /* @__PURE__ */ D(o, { children: JSON.stringify(t.realCurrentData, null, " ") }) : null
1118
- ]
1119
- }
1120
- ) });
1121
- return W && u ? /* @__PURE__ */ D(c, { children: re }) : re;
1122
- };
1
+ import "react/jsx-runtime";
2
+ import "./EventDispatcherProvider.js";
3
+ import "./GlobalDataContextProvider.js";
4
+ import "./TemplateContext.js";
5
+ import { J } from "../HashChangeListener-4RW0JIqP.js";
6
+ import "./utility/parseRjBuild.js";
7
+ import "./utility/stringToBoolean.js";
8
+ import "react";
1123
9
  export {
1124
- Dn as ReactiveJsonRoot
10
+ J as ReactiveJsonRoot
1125
11
  };