@quickflo/quickforms-vue 1.7.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DynamicForm.vue.d.ts.map +1 -1
- package/dist/index.js +994 -1003
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { provide as ea, inject as ta, computed as
|
|
1
|
+
import { provide as ea, inject as ta, computed as B, defineComponent as fe, ref as ae, createElementBlock as I, openBlock as j, createElementVNode as D, withDirectives as Oe, createCommentVNode as V, createTextVNode as je, toDisplayString as Q, vModelText as yt, normalizeClass as Er, vModelDynamic as Pr, vModelCheckbox as ra, Fragment as $e, renderList as He, vModelSelect as na, createBlock as vt, resolveDynamicComponent as sa, createVNode as xn, watch as Le, onMounted as Or, mergeModels as $n, useModel as aa, reactive as oa, markRaw as ia, toRaw as wn, nextTick as Et, renderSlot as la } from "vue";
|
|
2
2
|
import { useField as da, useForm as ca } from "vee-validate";
|
|
3
3
|
class ua {
|
|
4
4
|
constructor() {
|
|
@@ -57,13 +57,13 @@ class ua {
|
|
|
57
57
|
this.components.clear();
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
const
|
|
60
|
+
const he = (e, t) => t ? e : -1, tt = (e) => e.type === "string" || e.const !== void 0 && typeof e.const == "string", fa = (e) => e.type === "number" || e.type === "integer" || e.const !== void 0 && typeof e.const == "number", om = (e) => e.type === "integer", ma = (e) => e.type === "boolean" || e.const !== void 0 && typeof e.const == "boolean", ha = (e) => e.type === "object" || e.type === void 0 && e.properties !== void 0, pa = (e) => e.type === "array", ya = (e) => e.type === "object" && e.additionalProperties !== void 0 && typeof e.additionalProperties == "object" && Object.keys(e.additionalProperties).length > 0 && // Has typed additionalProperties
|
|
61
61
|
(!e.properties || Object.keys(e.properties).length === 0), va = (e) => e["x-render"] === "jsoneditor" ? !0 : e.type === "object" && e.additionalProperties !== void 0 && typeof e.additionalProperties == "object" && Object.keys(e.additionalProperties).length === 0 && // Empty = freeform
|
|
62
|
-
(!e.properties || Object.keys(e.properties).length === 0), im = (e) => e.type === "null", _a = (e) => e.const !== void 0, ga = (e) => Array.isArray(e.enum) && e.enum.length > 0, lm = (e) => (t) => t.format === e, dm = (e) =>
|
|
62
|
+
(!e.properties || Object.keys(e.properties).length === 0), im = (e) => e.type === "null", _a = (e) => e.const !== void 0, ga = (e) => Array.isArray(e.enum) && e.enum.length > 0, lm = (e) => (t) => t.format === e, dm = (e) => tt(e) && e.format === "email", ba = (e) => tt(e) && e.format === "date", cm = (e) => tt(e) && e.format === "time", um = (e) => tt(e) && e.format === "date-time", fm = (e) => tt(e) && (e.format === "url" || e.format === "uri"), Wn = (e) => Array.isArray(e.oneOf) && e.oneOf.length > 0, $a = (e) => Array.isArray(e.anyOf) && e.anyOf.length > 0, wa = (e) => Array.isArray(e.allOf) && e.allOf.length > 0, mm = (e) => Wn(e) && e.discriminator !== void 0, hm = (e) => e.if !== void 0, pm = (e) => (t) => t[e] !== void 0, ym = (...e) => (t) => e.every((n) => n(t)), vm = (...e) => (t) => e.some((n) => n(t)), _m = (e) => (t) => !e(t);
|
|
63
63
|
function Zn(e) {
|
|
64
64
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
65
65
|
}
|
|
66
|
-
var yr = { exports: {} }, Yn = {},
|
|
66
|
+
var yr = { exports: {} }, Yn = {}, be = {}, Xe = {}, gt = {}, K = {}, _t = {};
|
|
67
67
|
(function(e) {
|
|
68
68
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.regexpCode = e.getEsmExportName = e.getProperty = e.safeStringify = e.stringify = e.strConcat = e.addCodeArg = e.str = e._ = e.nil = e._Code = e.Name = e.IDENTIFIER = e._CodeOrName = void 0;
|
|
69
69
|
class t {
|
|
@@ -101,28 +101,28 @@ var yr = { exports: {} }, Yn = {}, $e = {}, et = {}, bt = {}, B = {}, gt = {};
|
|
|
101
101
|
}
|
|
102
102
|
get str() {
|
|
103
103
|
var y;
|
|
104
|
-
return (y = this._str) !== null && y !== void 0 ? y : this._str = this._items.reduce((k,
|
|
104
|
+
return (y = this._str) !== null && y !== void 0 ? y : this._str = this._items.reduce((k, S) => `${k}${S}`, "");
|
|
105
105
|
}
|
|
106
106
|
get names() {
|
|
107
107
|
var y;
|
|
108
|
-
return (y = this._names) !== null && y !== void 0 ? y : this._names = this._items.reduce((k,
|
|
108
|
+
return (y = this._names) !== null && y !== void 0 ? y : this._names = this._items.reduce((k, S) => (S instanceof n && (k[S.str] = (k[S.str] || 0) + 1), k), {});
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
e._Code = r, e.nil = new r("");
|
|
112
112
|
function s(f, ...y) {
|
|
113
113
|
const k = [f[0]];
|
|
114
|
-
let
|
|
115
|
-
for (;
|
|
116
|
-
i(k, y[
|
|
114
|
+
let S = 0;
|
|
115
|
+
for (; S < y.length; )
|
|
116
|
+
i(k, y[S]), k.push(f[++S]);
|
|
117
117
|
return new r(k);
|
|
118
118
|
}
|
|
119
119
|
e._ = s;
|
|
120
120
|
const a = new r("+");
|
|
121
121
|
function o(f, ...y) {
|
|
122
122
|
const k = [$(f[0])];
|
|
123
|
-
let
|
|
124
|
-
for (;
|
|
125
|
-
k.push(a), i(k, y[
|
|
123
|
+
let S = 0;
|
|
124
|
+
for (; S < y.length; )
|
|
125
|
+
k.push(a), i(k, y[S]), k.push(a, $(f[++S]));
|
|
126
126
|
return d(k), new r(k);
|
|
127
127
|
}
|
|
128
128
|
e.str = o;
|
|
@@ -183,11 +183,11 @@ var yr = { exports: {} }, Yn = {}, $e = {}, et = {}, bt = {}, B = {}, gt = {};
|
|
|
183
183
|
return new r(f.toString());
|
|
184
184
|
}
|
|
185
185
|
e.regexpCode = p;
|
|
186
|
-
})(
|
|
186
|
+
})(_t);
|
|
187
187
|
var vr = {};
|
|
188
188
|
(function(e) {
|
|
189
189
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.ValueScope = e.ValueScopeName = e.Scope = e.varKinds = e.UsedValueState = void 0;
|
|
190
|
-
const t =
|
|
190
|
+
const t = _t;
|
|
191
191
|
class n extends Error {
|
|
192
192
|
constructor(c) {
|
|
193
193
|
super(`CodeGen: "code" for ${c} not defined`), this.value = c.value;
|
|
@@ -307,8 +307,8 @@ var vr = {};
|
|
|
307
307
|
})(vr);
|
|
308
308
|
(function(e) {
|
|
309
309
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.or = e.and = e.not = e.CodeGen = e.operators = e.varKinds = e.ValueScopeName = e.ValueScope = e.Scope = e.Name = e.regexpCode = e.stringify = e.getProperty = e.nil = e.strConcat = e.str = e._ = void 0;
|
|
310
|
-
const t =
|
|
311
|
-
var r =
|
|
310
|
+
const t = _t, n = vr;
|
|
311
|
+
var r = _t;
|
|
312
312
|
Object.defineProperty(e, "_", { enumerable: !0, get: function() {
|
|
313
313
|
return r._;
|
|
314
314
|
} }), Object.defineProperty(e, "str", { enumerable: !0, get: function() {
|
|
@@ -356,40 +356,40 @@ var vr = {};
|
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
class o extends a {
|
|
359
|
-
constructor(l, h,
|
|
360
|
-
super(), this.varKind = l, this.name = h, this.rhs =
|
|
359
|
+
constructor(l, h, E) {
|
|
360
|
+
super(), this.varKind = l, this.name = h, this.rhs = E;
|
|
361
361
|
}
|
|
362
362
|
render({ es5: l, _n: h }) {
|
|
363
|
-
const
|
|
364
|
-
return `${
|
|
363
|
+
const E = l ? n.varKinds.var : this.varKind, F = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
|
|
364
|
+
return `${E} ${this.name}${F};` + h;
|
|
365
365
|
}
|
|
366
366
|
optimizeNames(l, h) {
|
|
367
367
|
if (l[this.name.str])
|
|
368
|
-
return this.rhs && (this.rhs =
|
|
368
|
+
return this.rhs && (this.rhs = re(this.rhs, l, h)), this;
|
|
369
369
|
}
|
|
370
370
|
get names() {
|
|
371
371
|
return this.rhs instanceof t._CodeOrName ? this.rhs.names : {};
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
class i extends a {
|
|
375
|
-
constructor(l, h,
|
|
376
|
-
super(), this.lhs = l, this.rhs = h, this.sideEffects =
|
|
375
|
+
constructor(l, h, E) {
|
|
376
|
+
super(), this.lhs = l, this.rhs = h, this.sideEffects = E;
|
|
377
377
|
}
|
|
378
378
|
render({ _n: l }) {
|
|
379
379
|
return `${this.lhs} = ${this.rhs};` + l;
|
|
380
380
|
}
|
|
381
381
|
optimizeNames(l, h) {
|
|
382
382
|
if (!(this.lhs instanceof t.Name && !l[this.lhs.str] && !this.sideEffects))
|
|
383
|
-
return this.rhs =
|
|
383
|
+
return this.rhs = re(this.rhs, l, h), this;
|
|
384
384
|
}
|
|
385
385
|
get names() {
|
|
386
386
|
const l = this.lhs instanceof t.Name ? {} : { ...this.lhs.names };
|
|
387
|
-
return
|
|
387
|
+
return X(l, this.rhs);
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
390
|
class d extends i {
|
|
391
|
-
constructor(l, h,
|
|
392
|
-
super(l,
|
|
391
|
+
constructor(l, h, E, F) {
|
|
392
|
+
super(l, E, F), this.op = h;
|
|
393
393
|
}
|
|
394
394
|
render({ _n: l }) {
|
|
395
395
|
return `${this.lhs} ${this.op}= ${this.rhs};` + l;
|
|
@@ -433,7 +433,7 @@ var vr = {};
|
|
|
433
433
|
return `${this.code}` ? this : void 0;
|
|
434
434
|
}
|
|
435
435
|
optimizeNames(l, h) {
|
|
436
|
-
return this.code =
|
|
436
|
+
return this.code = re(this.code, l, h), this;
|
|
437
437
|
}
|
|
438
438
|
get names() {
|
|
439
439
|
return this.code instanceof t._CodeOrName ? this.code.names : {};
|
|
@@ -444,28 +444,28 @@ var vr = {};
|
|
|
444
444
|
super(), this.nodes = l;
|
|
445
445
|
}
|
|
446
446
|
render(l) {
|
|
447
|
-
return this.nodes.reduce((h,
|
|
447
|
+
return this.nodes.reduce((h, E) => h + E.render(l), "");
|
|
448
448
|
}
|
|
449
449
|
optimizeNodes() {
|
|
450
450
|
const { nodes: l } = this;
|
|
451
451
|
let h = l.length;
|
|
452
452
|
for (; h--; ) {
|
|
453
|
-
const
|
|
454
|
-
Array.isArray(
|
|
453
|
+
const E = l[h].optimizeNodes();
|
|
454
|
+
Array.isArray(E) ? l.splice(h, 1, ...E) : E ? l[h] = E : l.splice(h, 1);
|
|
455
455
|
}
|
|
456
456
|
return l.length > 0 ? this : void 0;
|
|
457
457
|
}
|
|
458
458
|
optimizeNames(l, h) {
|
|
459
|
-
const { nodes:
|
|
460
|
-
let
|
|
461
|
-
for (;
|
|
462
|
-
const
|
|
463
|
-
|
|
459
|
+
const { nodes: E } = this;
|
|
460
|
+
let F = E.length;
|
|
461
|
+
for (; F--; ) {
|
|
462
|
+
const C = E[F];
|
|
463
|
+
C.optimizeNames(l, h) || (ke(l, C.names), E.splice(F, 1));
|
|
464
464
|
}
|
|
465
|
-
return
|
|
465
|
+
return E.length > 0 ? this : void 0;
|
|
466
466
|
}
|
|
467
467
|
get names() {
|
|
468
|
-
return this.nodes.reduce((l, h) =>
|
|
468
|
+
return this.nodes.reduce((l, h) => T(l, h.names), {});
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
class v extends $ {
|
|
@@ -493,22 +493,22 @@ var vr = {};
|
|
|
493
493
|
return this.nodes;
|
|
494
494
|
let h = this.else;
|
|
495
495
|
if (h) {
|
|
496
|
-
const
|
|
497
|
-
h = this.else = Array.isArray(
|
|
496
|
+
const E = h.optimizeNodes();
|
|
497
|
+
h = this.else = Array.isArray(E) ? new p(E) : E;
|
|
498
498
|
}
|
|
499
499
|
if (h)
|
|
500
|
-
return l === !1 ? h instanceof f ? h : h.nodes : this.nodes.length ? this : new f(
|
|
500
|
+
return l === !1 ? h instanceof f ? h : h.nodes : this.nodes.length ? this : new f(kt(l), h instanceof f ? [h] : h.nodes);
|
|
501
501
|
if (!(l === !1 || !this.nodes.length))
|
|
502
502
|
return this;
|
|
503
503
|
}
|
|
504
504
|
optimizeNames(l, h) {
|
|
505
|
-
var
|
|
506
|
-
if (this.else = (
|
|
507
|
-
return this.condition =
|
|
505
|
+
var E;
|
|
506
|
+
if (this.else = (E = this.else) === null || E === void 0 ? void 0 : E.optimizeNames(l, h), !!(super.optimizeNames(l, h) || this.else))
|
|
507
|
+
return this.condition = re(this.condition, l, h), this;
|
|
508
508
|
}
|
|
509
509
|
get names() {
|
|
510
510
|
const l = super.names;
|
|
511
|
-
return
|
|
511
|
+
return X(l, this.condition), this.else && T(l, this.else.names), l;
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
514
|
f.kind = "if";
|
|
@@ -524,55 +524,55 @@ var vr = {};
|
|
|
524
524
|
}
|
|
525
525
|
optimizeNames(l, h) {
|
|
526
526
|
if (super.optimizeNames(l, h))
|
|
527
|
-
return this.iteration =
|
|
527
|
+
return this.iteration = re(this.iteration, l, h), this;
|
|
528
528
|
}
|
|
529
529
|
get names() {
|
|
530
|
-
return
|
|
530
|
+
return T(super.names, this.iteration.names);
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
|
-
class
|
|
534
|
-
constructor(l, h,
|
|
535
|
-
super(), this.varKind = l, this.name = h, this.from =
|
|
533
|
+
class S extends y {
|
|
534
|
+
constructor(l, h, E, F) {
|
|
535
|
+
super(), this.varKind = l, this.name = h, this.from = E, this.to = F;
|
|
536
536
|
}
|
|
537
537
|
render(l) {
|
|
538
|
-
const h = l.es5 ? n.varKinds.var : this.varKind, { name:
|
|
539
|
-
return `for(${h} ${
|
|
538
|
+
const h = l.es5 ? n.varKinds.var : this.varKind, { name: E, from: F, to: C } = this;
|
|
539
|
+
return `for(${h} ${E}=${F}; ${E}<${C}; ${E}++)` + super.render(l);
|
|
540
540
|
}
|
|
541
541
|
get names() {
|
|
542
|
-
const l =
|
|
543
|
-
return
|
|
542
|
+
const l = X(super.names, this.from);
|
|
543
|
+
return X(l, this.to);
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
546
|
class O extends y {
|
|
547
|
-
constructor(l, h,
|
|
548
|
-
super(), this.loop = l, this.varKind = h, this.name =
|
|
547
|
+
constructor(l, h, E, F) {
|
|
548
|
+
super(), this.loop = l, this.varKind = h, this.name = E, this.iterable = F;
|
|
549
549
|
}
|
|
550
550
|
render(l) {
|
|
551
551
|
return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(l);
|
|
552
552
|
}
|
|
553
553
|
optimizeNames(l, h) {
|
|
554
554
|
if (super.optimizeNames(l, h))
|
|
555
|
-
return this.iterable =
|
|
555
|
+
return this.iterable = re(this.iterable, l, h), this;
|
|
556
556
|
}
|
|
557
557
|
get names() {
|
|
558
|
-
return
|
|
558
|
+
return T(super.names, this.iterable.names);
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
|
-
class
|
|
562
|
-
constructor(l, h,
|
|
563
|
-
super(), this.name = l, this.args = h, this.async =
|
|
561
|
+
class U extends v {
|
|
562
|
+
constructor(l, h, E) {
|
|
563
|
+
super(), this.name = l, this.args = h, this.async = E;
|
|
564
564
|
}
|
|
565
565
|
render(l) {
|
|
566
566
|
return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(l);
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
|
|
570
|
-
class
|
|
569
|
+
U.kind = "func";
|
|
570
|
+
class G extends $ {
|
|
571
571
|
render(l) {
|
|
572
572
|
return "return " + super.render(l);
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
|
-
|
|
575
|
+
G.kind = "return";
|
|
576
576
|
class M extends v {
|
|
577
577
|
render(l) {
|
|
578
578
|
let h = "try" + super.render(l);
|
|
@@ -583,15 +583,15 @@ var vr = {};
|
|
|
583
583
|
return super.optimizeNodes(), (l = this.catch) === null || l === void 0 || l.optimizeNodes(), (h = this.finally) === null || h === void 0 || h.optimizeNodes(), this;
|
|
584
584
|
}
|
|
585
585
|
optimizeNames(l, h) {
|
|
586
|
-
var
|
|
587
|
-
return super.optimizeNames(l, h), (
|
|
586
|
+
var E, F;
|
|
587
|
+
return super.optimizeNames(l, h), (E = this.catch) === null || E === void 0 || E.optimizeNames(l, h), (F = this.finally) === null || F === void 0 || F.optimizeNames(l, h), this;
|
|
588
588
|
}
|
|
589
589
|
get names() {
|
|
590
590
|
const l = super.names;
|
|
591
|
-
return this.catch &&
|
|
591
|
+
return this.catch && T(l, this.catch.names), this.finally && T(l, this.finally.names), l;
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
|
-
class
|
|
594
|
+
class R extends v {
|
|
595
595
|
constructor(l) {
|
|
596
596
|
super(), this.error = l;
|
|
597
597
|
}
|
|
@@ -599,14 +599,14 @@ var vr = {};
|
|
|
599
599
|
return `catch(${this.error})` + super.render(l);
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
|
|
602
|
+
R.kind = "catch";
|
|
603
603
|
class z extends v {
|
|
604
604
|
render(l) {
|
|
605
605
|
return "finally" + super.render(l);
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
z.kind = "finally";
|
|
609
|
-
class
|
|
609
|
+
class x {
|
|
610
610
|
constructor(l, h = {}) {
|
|
611
611
|
this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...h, _n: h.lines ? `
|
|
612
612
|
` : "" }, this._extScope = l, this._scope = new n.Scope({ parent: l }), this._nodes = [new g()];
|
|
@@ -624,8 +624,8 @@ var vr = {};
|
|
|
624
624
|
}
|
|
625
625
|
// reserves unique name in the external scope and assigns value to it
|
|
626
626
|
scopeValue(l, h) {
|
|
627
|
-
const
|
|
628
|
-
return (this._values[
|
|
627
|
+
const E = this._extScope.value(l, h);
|
|
628
|
+
return (this._values[E.prefix] || (this._values[E.prefix] = /* @__PURE__ */ new Set())).add(E), E;
|
|
629
629
|
}
|
|
630
630
|
getScopeValue(l, h) {
|
|
631
631
|
return this._extScope.getValue(l, h);
|
|
@@ -638,25 +638,25 @@ var vr = {};
|
|
|
638
638
|
scopeCode() {
|
|
639
639
|
return this._extScope.scopeCode(this._values);
|
|
640
640
|
}
|
|
641
|
-
_def(l, h,
|
|
642
|
-
const
|
|
643
|
-
return
|
|
641
|
+
_def(l, h, E, F) {
|
|
642
|
+
const C = this._scope.toName(h);
|
|
643
|
+
return E !== void 0 && F && (this._constants[C.str] = E), this._leafNode(new o(l, C, E)), C;
|
|
644
644
|
}
|
|
645
645
|
// `const` declaration (`var` in es5 mode)
|
|
646
|
-
const(l, h,
|
|
647
|
-
return this._def(n.varKinds.const, l, h,
|
|
646
|
+
const(l, h, E) {
|
|
647
|
+
return this._def(n.varKinds.const, l, h, E);
|
|
648
648
|
}
|
|
649
649
|
// `let` declaration with optional assignment (`var` in es5 mode)
|
|
650
|
-
let(l, h,
|
|
651
|
-
return this._def(n.varKinds.let, l, h,
|
|
650
|
+
let(l, h, E) {
|
|
651
|
+
return this._def(n.varKinds.let, l, h, E);
|
|
652
652
|
}
|
|
653
653
|
// `var` declaration with optional assignment
|
|
654
|
-
var(l, h,
|
|
655
|
-
return this._def(n.varKinds.var, l, h,
|
|
654
|
+
var(l, h, E) {
|
|
655
|
+
return this._def(n.varKinds.var, l, h, E);
|
|
656
656
|
}
|
|
657
657
|
// assignment code
|
|
658
|
-
assign(l, h,
|
|
659
|
-
return this._leafNode(new i(l, h,
|
|
658
|
+
assign(l, h, E) {
|
|
659
|
+
return this._leafNode(new i(l, h, E));
|
|
660
660
|
}
|
|
661
661
|
// `+=` code
|
|
662
662
|
add(l, h) {
|
|
@@ -669,17 +669,17 @@ var vr = {};
|
|
|
669
669
|
// returns code for object literal for the passed argument list of key-value pairs
|
|
670
670
|
object(...l) {
|
|
671
671
|
const h = ["{"];
|
|
672
|
-
for (const [
|
|
673
|
-
h.length > 1 && h.push(","), h.push(
|
|
672
|
+
for (const [E, F] of l)
|
|
673
|
+
h.length > 1 && h.push(","), h.push(E), (E !== F || this.opts.es5) && (h.push(":"), (0, t.addCodeArg)(h, F));
|
|
674
674
|
return h.push("}"), new t._Code(h);
|
|
675
675
|
}
|
|
676
676
|
// `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
|
|
677
|
-
if(l, h,
|
|
678
|
-
if (this._blockNode(new f(l)), h &&
|
|
679
|
-
this.code(h).else().code(
|
|
677
|
+
if(l, h, E) {
|
|
678
|
+
if (this._blockNode(new f(l)), h && E)
|
|
679
|
+
this.code(h).else().code(E).endIf();
|
|
680
680
|
else if (h)
|
|
681
681
|
this.code(h).endIf();
|
|
682
|
-
else if (
|
|
682
|
+
else if (E)
|
|
683
683
|
throw new Error('CodeGen: "else" body without "then" body');
|
|
684
684
|
return this;
|
|
685
685
|
}
|
|
@@ -703,28 +703,28 @@ var vr = {};
|
|
|
703
703
|
return this._for(new k(l), h);
|
|
704
704
|
}
|
|
705
705
|
// `for` statement for a range of values
|
|
706
|
-
forRange(l, h,
|
|
707
|
-
const
|
|
708
|
-
return this._for(new
|
|
706
|
+
forRange(l, h, E, F, C = this.opts.es5 ? n.varKinds.var : n.varKinds.let) {
|
|
707
|
+
const Z = this._scope.toName(l);
|
|
708
|
+
return this._for(new S(C, Z, h, E), () => F(Z));
|
|
709
709
|
}
|
|
710
710
|
// `for-of` statement (in es5 mode replace with a normal for loop)
|
|
711
|
-
forOf(l, h,
|
|
712
|
-
const
|
|
711
|
+
forOf(l, h, E, F = n.varKinds.const) {
|
|
712
|
+
const C = this._scope.toName(l);
|
|
713
713
|
if (this.opts.es5) {
|
|
714
|
-
const
|
|
715
|
-
return this.forRange("_i", 0, (0, t._)`${
|
|
716
|
-
this.var(
|
|
714
|
+
const Z = h instanceof t.Name ? h : this.var("_arr", h);
|
|
715
|
+
return this.forRange("_i", 0, (0, t._)`${Z}.length`, (W) => {
|
|
716
|
+
this.var(C, (0, t._)`${Z}[${W}]`), E(C);
|
|
717
717
|
});
|
|
718
718
|
}
|
|
719
|
-
return this._for(new O("of",
|
|
719
|
+
return this._for(new O("of", F, C, h), () => E(C));
|
|
720
720
|
}
|
|
721
721
|
// `for-in` statement.
|
|
722
722
|
// With option `ownProperties` replaced with a `for-of` loop for object keys
|
|
723
|
-
forIn(l, h,
|
|
723
|
+
forIn(l, h, E, F = this.opts.es5 ? n.varKinds.var : n.varKinds.const) {
|
|
724
724
|
if (this.opts.ownProperties)
|
|
725
|
-
return this.forOf(l, (0, t._)`Object.keys(${h})`,
|
|
726
|
-
const
|
|
727
|
-
return this._for(new O("in",
|
|
725
|
+
return this.forOf(l, (0, t._)`Object.keys(${h})`, E);
|
|
726
|
+
const C = this._scope.toName(l);
|
|
727
|
+
return this._for(new O("in", F, C, h), () => E(C));
|
|
728
728
|
}
|
|
729
729
|
// end `for` loop
|
|
730
730
|
endFor() {
|
|
@@ -740,21 +740,21 @@ var vr = {};
|
|
|
740
740
|
}
|
|
741
741
|
// `return` statement
|
|
742
742
|
return(l) {
|
|
743
|
-
const h = new
|
|
743
|
+
const h = new G();
|
|
744
744
|
if (this._blockNode(h), this.code(l), h.nodes.length !== 1)
|
|
745
745
|
throw new Error('CodeGen: "return" should have one node');
|
|
746
|
-
return this._endBlockNode(
|
|
746
|
+
return this._endBlockNode(G);
|
|
747
747
|
}
|
|
748
748
|
// `try` statement
|
|
749
|
-
try(l, h,
|
|
750
|
-
if (!h && !
|
|
749
|
+
try(l, h, E) {
|
|
750
|
+
if (!h && !E)
|
|
751
751
|
throw new Error('CodeGen: "try" without "catch" and "finally"');
|
|
752
|
-
const
|
|
753
|
-
if (this._blockNode(
|
|
754
|
-
const
|
|
755
|
-
this._currNode =
|
|
752
|
+
const F = new M();
|
|
753
|
+
if (this._blockNode(F), this.code(l), h) {
|
|
754
|
+
const C = this.name("e");
|
|
755
|
+
this._currNode = F.catch = new R(C), h(C);
|
|
756
756
|
}
|
|
757
|
-
return
|
|
757
|
+
return E && (this._currNode = F.finally = new z(), this.code(E)), this._endBlockNode(R, z);
|
|
758
758
|
}
|
|
759
759
|
// `throw` statement
|
|
760
760
|
throw(l) {
|
|
@@ -769,18 +769,18 @@ var vr = {};
|
|
|
769
769
|
const h = this._blockStarts.pop();
|
|
770
770
|
if (h === void 0)
|
|
771
771
|
throw new Error("CodeGen: not in self-balancing block");
|
|
772
|
-
const
|
|
773
|
-
if (
|
|
774
|
-
throw new Error(`CodeGen: wrong number of nodes: ${
|
|
772
|
+
const E = this._nodes.length - h;
|
|
773
|
+
if (E < 0 || l !== void 0 && E !== l)
|
|
774
|
+
throw new Error(`CodeGen: wrong number of nodes: ${E} vs ${l} expected`);
|
|
775
775
|
return this._nodes.length = h, this;
|
|
776
776
|
}
|
|
777
777
|
// `function` heading (or definition if funcBody is passed)
|
|
778
|
-
func(l, h = t.nil,
|
|
779
|
-
return this._blockNode(new
|
|
778
|
+
func(l, h = t.nil, E, F) {
|
|
779
|
+
return this._blockNode(new U(l, h, E)), F && this.code(F).endFunc(), this;
|
|
780
780
|
}
|
|
781
781
|
// end function definition
|
|
782
782
|
endFunc() {
|
|
783
|
-
return this._endBlockNode(
|
|
783
|
+
return this._endBlockNode(U);
|
|
784
784
|
}
|
|
785
785
|
optimize(l = 1) {
|
|
786
786
|
for (; l-- > 0; )
|
|
@@ -793,8 +793,8 @@ var vr = {};
|
|
|
793
793
|
this._currNode.nodes.push(l), this._nodes.push(l);
|
|
794
794
|
}
|
|
795
795
|
_endBlockNode(l, h) {
|
|
796
|
-
const
|
|
797
|
-
if (
|
|
796
|
+
const E = this._currNode;
|
|
797
|
+
if (E instanceof l || h && E instanceof h)
|
|
798
798
|
return this._nodes.pop(), this;
|
|
799
799
|
throw new Error(`CodeGen: not in block "${h ? `${l.kind}/${h.kind}` : l.kind}"`);
|
|
800
800
|
}
|
|
@@ -816,37 +816,37 @@ var vr = {};
|
|
|
816
816
|
h[h.length - 1] = l;
|
|
817
817
|
}
|
|
818
818
|
}
|
|
819
|
-
e.CodeGen =
|
|
820
|
-
function
|
|
819
|
+
e.CodeGen = x;
|
|
820
|
+
function T(w, l) {
|
|
821
821
|
for (const h in l)
|
|
822
822
|
w[h] = (w[h] || 0) + (l[h] || 0);
|
|
823
823
|
return w;
|
|
824
824
|
}
|
|
825
|
-
function
|
|
826
|
-
return l instanceof t._CodeOrName ?
|
|
825
|
+
function X(w, l) {
|
|
826
|
+
return l instanceof t._CodeOrName ? T(w, l.names) : w;
|
|
827
827
|
}
|
|
828
|
-
function
|
|
828
|
+
function re(w, l, h) {
|
|
829
829
|
if (w instanceof t.Name)
|
|
830
|
-
return
|
|
831
|
-
if (!
|
|
830
|
+
return E(w);
|
|
831
|
+
if (!F(w))
|
|
832
832
|
return w;
|
|
833
|
-
return new t._Code(w._items.reduce((
|
|
834
|
-
function
|
|
835
|
-
const
|
|
836
|
-
return
|
|
833
|
+
return new t._Code(w._items.reduce((C, Z) => (Z instanceof t.Name && (Z = E(Z)), Z instanceof t._Code ? C.push(...Z._items) : C.push(Z), C), []));
|
|
834
|
+
function E(C) {
|
|
835
|
+
const Z = h[C.str];
|
|
836
|
+
return Z === void 0 || l[C.str] !== 1 ? C : (delete l[C.str], Z);
|
|
837
837
|
}
|
|
838
|
-
function
|
|
839
|
-
return
|
|
838
|
+
function F(C) {
|
|
839
|
+
return C instanceof t._Code && C._items.some((Z) => Z instanceof t.Name && l[Z.str] === 1 && h[Z.str] !== void 0);
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
|
-
function
|
|
842
|
+
function ke(w, l) {
|
|
843
843
|
for (const h in l)
|
|
844
844
|
w[h] = (w[h] || 0) - (l[h] || 0);
|
|
845
845
|
}
|
|
846
|
-
function
|
|
846
|
+
function kt(w) {
|
|
847
847
|
return typeof w == "boolean" || typeof w == "number" || w === null ? !w : (0, t._)`!${P(w)}`;
|
|
848
848
|
}
|
|
849
|
-
e.not =
|
|
849
|
+
e.not = kt;
|
|
850
850
|
const Wt = _(e.operators.AND);
|
|
851
851
|
function Zt(...w) {
|
|
852
852
|
return w.reduce(Wt);
|
|
@@ -863,11 +863,11 @@ var vr = {};
|
|
|
863
863
|
function P(w) {
|
|
864
864
|
return w instanceof t.Name ? w : (0, t._)`(${w})`;
|
|
865
865
|
}
|
|
866
|
-
})(
|
|
866
|
+
})(K);
|
|
867
867
|
var N = {};
|
|
868
868
|
Object.defineProperty(N, "__esModule", { value: !0 });
|
|
869
869
|
N.checkStrictMode = N.getErrorPath = N.Type = N.useFunc = N.setEvaluated = N.evaluatedPropsToName = N.mergeEvaluated = N.eachItem = N.unescapeJsonPointer = N.escapeJsonPointer = N.escapeFragment = N.unescapeFragment = N.schemaRefOrVal = N.schemaHasRulesButRef = N.schemaHasRules = N.checkUnknownRules = N.alwaysValidSchema = N.toHash = void 0;
|
|
870
|
-
const
|
|
870
|
+
const Y = K, ka = _t;
|
|
871
871
|
function Sa(e) {
|
|
872
872
|
const t = {};
|
|
873
873
|
for (const n of e)
|
|
@@ -911,9 +911,9 @@ function Oa({ topSchemaRef: e, schemaPath: t }, n, r, s) {
|
|
|
911
911
|
if (typeof n == "number" || typeof n == "boolean")
|
|
912
912
|
return n;
|
|
913
913
|
if (typeof n == "string")
|
|
914
|
-
return (0,
|
|
914
|
+
return (0, Y._)`${n}`;
|
|
915
915
|
}
|
|
916
|
-
return (0,
|
|
916
|
+
return (0, Y._)`${e}${t}${(0, Y.getProperty)(r)}`;
|
|
917
917
|
}
|
|
918
918
|
N.schemaRefOrVal = Oa;
|
|
919
919
|
function ja(e) {
|
|
@@ -942,24 +942,24 @@ function Ia(e, t) {
|
|
|
942
942
|
N.eachItem = Ia;
|
|
943
943
|
function kn({ mergeNames: e, mergeToName: t, mergeValues: n, resultToName: r }) {
|
|
944
944
|
return (s, a, o, i) => {
|
|
945
|
-
const d = o === void 0 ? a : o instanceof
|
|
946
|
-
return i ===
|
|
945
|
+
const d = o === void 0 ? a : o instanceof Y.Name ? (a instanceof Y.Name ? e(s, a, o) : t(s, a, o), o) : a instanceof Y.Name ? (t(s, o, a), a) : n(a, o);
|
|
946
|
+
return i === Y.Name && !(d instanceof Y.Name) ? r(s, d) : d;
|
|
947
947
|
};
|
|
948
948
|
}
|
|
949
949
|
N.mergeEvaluated = {
|
|
950
950
|
props: kn({
|
|
951
|
-
mergeNames: (e, t, n) => e.if((0,
|
|
952
|
-
e.if((0,
|
|
951
|
+
mergeNames: (e, t, n) => e.if((0, Y._)`${n} !== true && ${t} !== undefined`, () => {
|
|
952
|
+
e.if((0, Y._)`${t} === true`, () => e.assign(n, !0), () => e.assign(n, (0, Y._)`${n} || {}`).code((0, Y._)`Object.assign(${n}, ${t})`));
|
|
953
953
|
}),
|
|
954
|
-
mergeToName: (e, t, n) => e.if((0,
|
|
955
|
-
t === !0 ? e.assign(n, !0) : (e.assign(n, (0,
|
|
954
|
+
mergeToName: (e, t, n) => e.if((0, Y._)`${n} !== true`, () => {
|
|
955
|
+
t === !0 ? e.assign(n, !0) : (e.assign(n, (0, Y._)`${n} || {}`), qr(e, n, t));
|
|
956
956
|
}),
|
|
957
957
|
mergeValues: (e, t) => e === !0 ? !0 : { ...e, ...t },
|
|
958
958
|
resultToName: ts
|
|
959
959
|
}),
|
|
960
960
|
items: kn({
|
|
961
|
-
mergeNames: (e, t, n) => e.if((0,
|
|
962
|
-
mergeToName: (e, t, n) => e.if((0,
|
|
961
|
+
mergeNames: (e, t, n) => e.if((0, Y._)`${n} !== true && ${t} !== undefined`, () => e.assign(n, (0, Y._)`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),
|
|
962
|
+
mergeToName: (e, t, n) => e.if((0, Y._)`${n} !== true`, () => e.assign(n, t === !0 ? !0 : (0, Y._)`${n} > ${t} ? ${n} : ${t}`)),
|
|
963
963
|
mergeValues: (e, t) => e === !0 ? !0 : Math.max(e, t),
|
|
964
964
|
resultToName: (e, t) => e.var("items", t)
|
|
965
965
|
})
|
|
@@ -967,12 +967,12 @@ N.mergeEvaluated = {
|
|
|
967
967
|
function ts(e, t) {
|
|
968
968
|
if (t === !0)
|
|
969
969
|
return e.var("props", !0);
|
|
970
|
-
const n = e.var("props", (0,
|
|
970
|
+
const n = e.var("props", (0, Y._)`{}`);
|
|
971
971
|
return t !== void 0 && qr(e, n, t), n;
|
|
972
972
|
}
|
|
973
973
|
N.evaluatedPropsToName = ts;
|
|
974
974
|
function qr(e, t, n) {
|
|
975
|
-
Object.keys(n).forEach((r) => e.assign((0,
|
|
975
|
+
Object.keys(n).forEach((r) => e.assign((0, Y._)`${t}${(0, Y.getProperty)(r)}`, !0));
|
|
976
976
|
}
|
|
977
977
|
N.setEvaluated = qr;
|
|
978
978
|
const Sn = {};
|
|
@@ -988,11 +988,11 @@ var _r;
|
|
|
988
988
|
e[e.Num = 0] = "Num", e[e.Str = 1] = "Str";
|
|
989
989
|
})(_r || (N.Type = _r = {}));
|
|
990
990
|
function Ma(e, t, n) {
|
|
991
|
-
if (e instanceof
|
|
991
|
+
if (e instanceof Y.Name) {
|
|
992
992
|
const r = t === _r.Num;
|
|
993
|
-
return n ? r ? (0,
|
|
993
|
+
return n ? r ? (0, Y._)`"[" + ${e} + "]"` : (0, Y._)`"['" + ${e} + "']"` : r ? (0, Y._)`"/" + ${e}` : (0, Y._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
|
|
994
994
|
}
|
|
995
|
-
return n ? (0,
|
|
995
|
+
return n ? (0, Y.getProperty)(e).toString() : "/" + jr(e);
|
|
996
996
|
}
|
|
997
997
|
N.getErrorPath = Ma;
|
|
998
998
|
function rs(e, t, n = e.opts.strictSchema) {
|
|
@@ -1005,64 +1005,64 @@ function rs(e, t, n = e.opts.strictSchema) {
|
|
|
1005
1005
|
N.checkStrictMode = rs;
|
|
1006
1006
|
var qe = {};
|
|
1007
1007
|
Object.defineProperty(qe, "__esModule", { value: !0 });
|
|
1008
|
-
const
|
|
1008
|
+
const le = K, Ta = {
|
|
1009
1009
|
// validation function arguments
|
|
1010
|
-
data: new
|
|
1010
|
+
data: new le.Name("data"),
|
|
1011
1011
|
// data passed to validation function
|
|
1012
1012
|
// args passed from referencing schema
|
|
1013
|
-
valCxt: new
|
|
1013
|
+
valCxt: new le.Name("valCxt"),
|
|
1014
1014
|
// validation/data context - should not be used directly, it is destructured to the names below
|
|
1015
|
-
instancePath: new
|
|
1016
|
-
parentData: new
|
|
1017
|
-
parentDataProperty: new
|
|
1018
|
-
rootData: new
|
|
1015
|
+
instancePath: new le.Name("instancePath"),
|
|
1016
|
+
parentData: new le.Name("parentData"),
|
|
1017
|
+
parentDataProperty: new le.Name("parentDataProperty"),
|
|
1018
|
+
rootData: new le.Name("rootData"),
|
|
1019
1019
|
// root data - same as the data passed to the first/top validation function
|
|
1020
|
-
dynamicAnchors: new
|
|
1020
|
+
dynamicAnchors: new le.Name("dynamicAnchors"),
|
|
1021
1021
|
// used to support recursiveRef and dynamicRef
|
|
1022
1022
|
// function scoped variables
|
|
1023
|
-
vErrors: new
|
|
1023
|
+
vErrors: new le.Name("vErrors"),
|
|
1024
1024
|
// null or array of validation errors
|
|
1025
|
-
errors: new
|
|
1025
|
+
errors: new le.Name("errors"),
|
|
1026
1026
|
// counter of validation errors
|
|
1027
|
-
this: new
|
|
1027
|
+
this: new le.Name("this"),
|
|
1028
1028
|
// "globals"
|
|
1029
|
-
self: new
|
|
1030
|
-
scope: new
|
|
1029
|
+
self: new le.Name("self"),
|
|
1030
|
+
scope: new le.Name("scope"),
|
|
1031
1031
|
// JTD serialize/parse name for JSON string and position
|
|
1032
|
-
json: new
|
|
1033
|
-
jsonPos: new
|
|
1034
|
-
jsonLen: new
|
|
1035
|
-
jsonPart: new
|
|
1032
|
+
json: new le.Name("json"),
|
|
1033
|
+
jsonPos: new le.Name("jsonPos"),
|
|
1034
|
+
jsonLen: new le.Name("jsonLen"),
|
|
1035
|
+
jsonPart: new le.Name("jsonPart")
|
|
1036
1036
|
};
|
|
1037
1037
|
qe.default = Ta;
|
|
1038
1038
|
(function(e) {
|
|
1039
1039
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.extendErrors = e.resetErrorsCount = e.reportExtraError = e.reportError = e.keyword$DataError = e.keywordError = void 0;
|
|
1040
|
-
const t =
|
|
1040
|
+
const t = K, n = N, r = qe;
|
|
1041
1041
|
e.keywordError = {
|
|
1042
1042
|
message: ({ keyword: p }) => (0, t.str)`must pass "${p}" keyword validation`
|
|
1043
1043
|
}, e.keyword$DataError = {
|
|
1044
1044
|
message: ({ keyword: p, schemaType: f }) => f ? (0, t.str)`"${p}" keyword must be ${f} ($data)` : (0, t.str)`"${p}" keyword is invalid ($data)`
|
|
1045
1045
|
};
|
|
1046
1046
|
function s(p, f = e.keywordError, y, k) {
|
|
1047
|
-
const { it:
|
|
1048
|
-
k ?? (
|
|
1047
|
+
const { it: S } = p, { gen: O, compositeRule: U, allErrors: G } = S, M = m(p, f, y);
|
|
1048
|
+
k ?? (U || G) ? d(O, M) : c(S, (0, t._)`[${M}]`);
|
|
1049
1049
|
}
|
|
1050
1050
|
e.reportError = s;
|
|
1051
1051
|
function a(p, f = e.keywordError, y) {
|
|
1052
|
-
const { it: k } = p, { gen:
|
|
1053
|
-
d(
|
|
1052
|
+
const { it: k } = p, { gen: S, compositeRule: O, allErrors: U } = k, G = m(p, f, y);
|
|
1053
|
+
d(S, G), O || U || c(k, r.default.vErrors);
|
|
1054
1054
|
}
|
|
1055
1055
|
e.reportExtraError = a;
|
|
1056
1056
|
function o(p, f) {
|
|
1057
1057
|
p.assign(r.default.errors, f), p.if((0, t._)`${r.default.vErrors} !== null`, () => p.if(f, () => p.assign((0, t._)`${r.default.vErrors}.length`, f), () => p.assign(r.default.vErrors, null)));
|
|
1058
1058
|
}
|
|
1059
1059
|
e.resetErrorsCount = o;
|
|
1060
|
-
function i({ gen: p, keyword: f, schemaValue: y, data: k, errsCount:
|
|
1061
|
-
if (
|
|
1060
|
+
function i({ gen: p, keyword: f, schemaValue: y, data: k, errsCount: S, it: O }) {
|
|
1061
|
+
if (S === void 0)
|
|
1062
1062
|
throw new Error("ajv implementation error");
|
|
1063
|
-
const
|
|
1064
|
-
p.forRange("i",
|
|
1065
|
-
p.const(
|
|
1063
|
+
const U = p.name("err");
|
|
1064
|
+
p.forRange("i", S, r.default.errors, (G) => {
|
|
1065
|
+
p.const(U, (0, t._)`${r.default.vErrors}[${G}]`), p.if((0, t._)`${U}.instancePath === undefined`, () => p.assign((0, t._)`${U}.instancePath`, (0, t.strConcat)(r.default.instancePath, O.errorPath))), p.assign((0, t._)`${U}.schemaPath`, (0, t.str)`${O.errSchemaPath}/${f}`), O.opts.verbose && (p.assign((0, t._)`${U}.schema`, y), p.assign((0, t._)`${U}.data`, k));
|
|
1066
1066
|
});
|
|
1067
1067
|
}
|
|
1068
1068
|
e.extendErrors = i;
|
|
@@ -1071,8 +1071,8 @@ qe.default = Ta;
|
|
|
1071
1071
|
p.if((0, t._)`${r.default.vErrors} === null`, () => p.assign(r.default.vErrors, (0, t._)`[${y}]`), (0, t._)`${r.default.vErrors}.push(${y})`), p.code((0, t._)`${r.default.errors}++`);
|
|
1072
1072
|
}
|
|
1073
1073
|
function c(p, f) {
|
|
1074
|
-
const { gen: y, validateName: k, schemaEnv:
|
|
1075
|
-
|
|
1074
|
+
const { gen: y, validateName: k, schemaEnv: S } = p;
|
|
1075
|
+
S.$async ? y.throw((0, t._)`new ${p.ValidationError}(${f})`) : (y.assign((0, t._)`${k}.errors`, f), y.return(!1));
|
|
1076
1076
|
}
|
|
1077
1077
|
const u = {
|
|
1078
1078
|
keyword: new t.Name("keyword"),
|
|
@@ -1089,8 +1089,8 @@ qe.default = Ta;
|
|
|
1089
1089
|
return k === !1 ? (0, t._)`{}` : b(p, f, y);
|
|
1090
1090
|
}
|
|
1091
1091
|
function b(p, f, y = {}) {
|
|
1092
|
-
const { gen: k, it:
|
|
1093
|
-
$(
|
|
1092
|
+
const { gen: k, it: S } = p, O = [
|
|
1093
|
+
$(S, y),
|
|
1094
1094
|
v(p, y)
|
|
1095
1095
|
];
|
|
1096
1096
|
return g(p, f, O), k.object(...O);
|
|
@@ -1100,29 +1100,29 @@ qe.default = Ta;
|
|
|
1100
1100
|
return [r.default.instancePath, (0, t.strConcat)(r.default.instancePath, y)];
|
|
1101
1101
|
}
|
|
1102
1102
|
function v({ keyword: p, it: { errSchemaPath: f } }, { schemaPath: y, parentSchema: k }) {
|
|
1103
|
-
let
|
|
1104
|
-
return y && (
|
|
1103
|
+
let S = k ? f : (0, t.str)`${f}/${p}`;
|
|
1104
|
+
return y && (S = (0, t.str)`${S}${(0, n.getErrorPath)(y, n.Type.Str)}`), [u.schemaPath, S];
|
|
1105
1105
|
}
|
|
1106
1106
|
function g(p, { params: f, message: y }, k) {
|
|
1107
|
-
const { keyword:
|
|
1108
|
-
k.push([u.keyword,
|
|
1107
|
+
const { keyword: S, data: O, schemaValue: U, it: G } = p, { opts: M, propertyName: R, topSchemaRef: z, schemaPath: x } = G;
|
|
1108
|
+
k.push([u.keyword, S], [u.params, typeof f == "function" ? f(p) : f || (0, t._)`{}`]), M.messages && k.push([u.message, typeof y == "function" ? y(p) : y]), M.verbose && k.push([u.schema, U], [u.parentSchema, (0, t._)`${z}${x}`], [r.default.data, O]), R && k.push([u.propertyName, R]);
|
|
1109
1109
|
}
|
|
1110
|
-
})(
|
|
1111
|
-
Object.defineProperty(
|
|
1112
|
-
|
|
1113
|
-
const Ra =
|
|
1110
|
+
})(gt);
|
|
1111
|
+
Object.defineProperty(Xe, "__esModule", { value: !0 });
|
|
1112
|
+
Xe.boolOrEmptySchema = Xe.topBoolOrEmptySchema = void 0;
|
|
1113
|
+
const Ra = gt, Aa = K, Fa = qe, Da = {
|
|
1114
1114
|
message: "boolean schema is false"
|
|
1115
1115
|
};
|
|
1116
|
-
function
|
|
1116
|
+
function Ca(e) {
|
|
1117
1117
|
const { gen: t, schema: n, validateName: r } = e;
|
|
1118
|
-
n === !1 ? ns(e, !1) : typeof n == "object" && n.$async === !0 ? t.return(
|
|
1118
|
+
n === !1 ? ns(e, !1) : typeof n == "object" && n.$async === !0 ? t.return(Fa.default.data) : (t.assign((0, Aa._)`${r}.errors`, null), t.return(!0));
|
|
1119
1119
|
}
|
|
1120
|
-
|
|
1120
|
+
Xe.topBoolOrEmptySchema = Ca;
|
|
1121
1121
|
function Va(e, t) {
|
|
1122
1122
|
const { gen: n, schema: r } = e;
|
|
1123
1123
|
r === !1 ? (n.var(t, !1), ns(e)) : n.var(t, !0);
|
|
1124
1124
|
}
|
|
1125
|
-
|
|
1125
|
+
Xe.boolOrEmptySchema = Va;
|
|
1126
1126
|
function ns(e, t) {
|
|
1127
1127
|
const { gen: n, data: r } = e, s = {
|
|
1128
1128
|
gen: n,
|
|
@@ -1134,16 +1134,16 @@ function ns(e, t) {
|
|
|
1134
1134
|
params: {},
|
|
1135
1135
|
it: e
|
|
1136
1136
|
};
|
|
1137
|
-
(0, Ra.reportError)(s,
|
|
1137
|
+
(0, Ra.reportError)(s, Da, void 0, t);
|
|
1138
1138
|
}
|
|
1139
|
-
var
|
|
1140
|
-
Object.defineProperty(
|
|
1141
|
-
|
|
1139
|
+
var ne = {}, Ke = {};
|
|
1140
|
+
Object.defineProperty(Ke, "__esModule", { value: !0 });
|
|
1141
|
+
Ke.getRules = Ke.isJSONType = void 0;
|
|
1142
1142
|
const za = ["string", "number", "integer", "boolean", "null", "object", "array"], Ua = new Set(za);
|
|
1143
1143
|
function La(e) {
|
|
1144
1144
|
return typeof e == "string" && Ua.has(e);
|
|
1145
1145
|
}
|
|
1146
|
-
|
|
1146
|
+
Ke.isJSONType = La;
|
|
1147
1147
|
function Ha() {
|
|
1148
1148
|
const e = {
|
|
1149
1149
|
number: { type: "number", rules: [] },
|
|
@@ -1159,7 +1159,7 @@ function Ha() {
|
|
|
1159
1159
|
keywords: {}
|
|
1160
1160
|
};
|
|
1161
1161
|
}
|
|
1162
|
-
|
|
1162
|
+
Ke.getRules = Ha;
|
|
1163
1163
|
var Ne = {};
|
|
1164
1164
|
Object.defineProperty(Ne, "__esModule", { value: !0 });
|
|
1165
1165
|
Ne.shouldUseRule = Ne.shouldUseGroup = Ne.schemaHasRulesForType = void 0;
|
|
@@ -1177,13 +1177,13 @@ function as(e, t) {
|
|
|
1177
1177
|
return e[t.keyword] !== void 0 || ((n = t.definition.implements) === null || n === void 0 ? void 0 : n.some((r) => e[r] !== void 0));
|
|
1178
1178
|
}
|
|
1179
1179
|
Ne.shouldUseRule = as;
|
|
1180
|
-
Object.defineProperty(
|
|
1181
|
-
|
|
1182
|
-
const Ba =
|
|
1183
|
-
var
|
|
1180
|
+
Object.defineProperty(ne, "__esModule", { value: !0 });
|
|
1181
|
+
ne.reportTypeError = ne.checkDataTypes = ne.checkDataType = ne.coerceAndCheckDataType = ne.getJSONTypes = ne.getSchemaTypes = ne.DataType = void 0;
|
|
1182
|
+
const Ba = Ke, Ga = Ne, Ja = gt, H = K, os = N;
|
|
1183
|
+
var Ye;
|
|
1184
1184
|
(function(e) {
|
|
1185
1185
|
e[e.Correct = 0] = "Correct", e[e.Wrong = 1] = "Wrong";
|
|
1186
|
-
})(
|
|
1186
|
+
})(Ye || (ne.DataType = Ye = {}));
|
|
1187
1187
|
function xa(e) {
|
|
1188
1188
|
const t = is(e.type);
|
|
1189
1189
|
if (t.includes("null")) {
|
|
@@ -1196,25 +1196,25 @@ function xa(e) {
|
|
|
1196
1196
|
}
|
|
1197
1197
|
return t;
|
|
1198
1198
|
}
|
|
1199
|
-
|
|
1199
|
+
ne.getSchemaTypes = xa;
|
|
1200
1200
|
function is(e) {
|
|
1201
1201
|
const t = Array.isArray(e) ? e : e ? [e] : [];
|
|
1202
1202
|
if (t.every(Ba.isJSONType))
|
|
1203
1203
|
return t;
|
|
1204
1204
|
throw new Error("type must be JSONType or JSONType[]: " + t.join(","));
|
|
1205
1205
|
}
|
|
1206
|
-
|
|
1206
|
+
ne.getJSONTypes = is;
|
|
1207
1207
|
function Wa(e, t) {
|
|
1208
1208
|
const { gen: n, data: r, opts: s } = e, a = Za(t, s.coerceTypes), o = t.length > 0 && !(a.length === 0 && t.length === 1 && (0, Ga.schemaHasRulesForType)(e, t[0]));
|
|
1209
1209
|
if (o) {
|
|
1210
|
-
const i = Ir(t, r, s.strictNumbers,
|
|
1210
|
+
const i = Ir(t, r, s.strictNumbers, Ye.Wrong);
|
|
1211
1211
|
n.if(i, () => {
|
|
1212
1212
|
a.length ? Ya(e, t, a) : Nr(e);
|
|
1213
1213
|
});
|
|
1214
1214
|
}
|
|
1215
1215
|
return o;
|
|
1216
1216
|
}
|
|
1217
|
-
|
|
1217
|
+
ne.coerceAndCheckDataType = Wa;
|
|
1218
1218
|
const ls = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
|
|
1219
1219
|
function Za(e, t) {
|
|
1220
1220
|
return t ? e.filter((n) => ls.has(n) || t === "array" && n === "array") : [];
|
|
@@ -1255,8 +1255,8 @@ function Ya(e, t, n) {
|
|
|
1255
1255
|
function Qa({ gen: e, parentData: t, parentDataProperty: n }, r) {
|
|
1256
1256
|
e.if((0, H._)`${t} !== undefined`, () => e.assign((0, H._)`${t}[${n}]`, r));
|
|
1257
1257
|
}
|
|
1258
|
-
function gr(e, t, n, r =
|
|
1259
|
-
const s = r ===
|
|
1258
|
+
function gr(e, t, n, r = Ye.Correct) {
|
|
1259
|
+
const s = r === Ye.Correct ? H.operators.EQ : H.operators.NEQ;
|
|
1260
1260
|
let a;
|
|
1261
1261
|
switch (e) {
|
|
1262
1262
|
case "null":
|
|
@@ -1276,12 +1276,12 @@ function gr(e, t, n, r = Qe.Correct) {
|
|
|
1276
1276
|
default:
|
|
1277
1277
|
return (0, H._)`typeof ${t} ${s} ${e}`;
|
|
1278
1278
|
}
|
|
1279
|
-
return r ===
|
|
1279
|
+
return r === Ye.Correct ? a : (0, H.not)(a);
|
|
1280
1280
|
function o(i = H.nil) {
|
|
1281
1281
|
return (0, H.and)((0, H._)`typeof ${t} == "number"`, i, n ? (0, H._)`isFinite(${t})` : H.nil);
|
|
1282
1282
|
}
|
|
1283
1283
|
}
|
|
1284
|
-
|
|
1284
|
+
ne.checkDataType = gr;
|
|
1285
1285
|
function Ir(e, t, n, r) {
|
|
1286
1286
|
if (e.length === 1)
|
|
1287
1287
|
return gr(e[0], t, n, r);
|
|
@@ -1297,7 +1297,7 @@ function Ir(e, t, n, r) {
|
|
|
1297
1297
|
s = (0, H.and)(s, gr(o, t, n, r));
|
|
1298
1298
|
return s;
|
|
1299
1299
|
}
|
|
1300
|
-
|
|
1300
|
+
ne.checkDataTypes = Ir;
|
|
1301
1301
|
const Xa = {
|
|
1302
1302
|
message: ({ schema: e }) => `must be ${e}`,
|
|
1303
1303
|
params: ({ schema: e, schemaValue: t }) => typeof e == "string" ? (0, H._)`{type: ${e}}` : (0, H._)`{type: ${t}}`
|
|
@@ -1306,7 +1306,7 @@ function Nr(e) {
|
|
|
1306
1306
|
const t = eo(e);
|
|
1307
1307
|
(0, Ja.reportError)(t, Xa);
|
|
1308
1308
|
}
|
|
1309
|
-
|
|
1309
|
+
ne.reportTypeError = Nr;
|
|
1310
1310
|
function eo(e) {
|
|
1311
1311
|
const { gen: t, data: n, schema: r } = e, s = (0, os.schemaRefOrVal)(e, r, "type");
|
|
1312
1312
|
return {
|
|
@@ -1324,7 +1324,7 @@ function eo(e) {
|
|
|
1324
1324
|
var Ht = {};
|
|
1325
1325
|
Object.defineProperty(Ht, "__esModule", { value: !0 });
|
|
1326
1326
|
Ht.assignDefaults = void 0;
|
|
1327
|
-
const
|
|
1327
|
+
const Je = K, to = N;
|
|
1328
1328
|
function ro(e, t) {
|
|
1329
1329
|
const { properties: n, items: r } = e.schema;
|
|
1330
1330
|
if (t === "object" && n)
|
|
@@ -1337,18 +1337,18 @@ function En(e, t, n) {
|
|
|
1337
1337
|
const { gen: r, compositeRule: s, data: a, opts: o } = e;
|
|
1338
1338
|
if (n === void 0)
|
|
1339
1339
|
return;
|
|
1340
|
-
const i = (0,
|
|
1340
|
+
const i = (0, Je._)`${a}${(0, Je.getProperty)(t)}`;
|
|
1341
1341
|
if (s) {
|
|
1342
1342
|
(0, to.checkStrictMode)(e, `default is ignored for: ${i}`);
|
|
1343
1343
|
return;
|
|
1344
1344
|
}
|
|
1345
|
-
let d = (0,
|
|
1346
|
-
o.useDefaults === "empty" && (d = (0,
|
|
1345
|
+
let d = (0, Je._)`${i} === undefined`;
|
|
1346
|
+
o.useDefaults === "empty" && (d = (0, Je._)`${d} || ${i} === null || ${i} === ""`), r.if(d, (0, Je._)`${i} = ${(0, Je.stringify)(n)}`);
|
|
1347
1347
|
}
|
|
1348
1348
|
var Ee = {}, J = {};
|
|
1349
1349
|
Object.defineProperty(J, "__esModule", { value: !0 });
|
|
1350
1350
|
J.validateUnion = J.validateArray = J.usePattern = J.callValidateCode = J.schemaProperties = J.allSchemaProperties = J.noPropertyInData = J.propertyInData = J.isOwnProperty = J.hasPropFunc = J.reportMissingProp = J.checkMissingProp = J.checkReportMissingProp = void 0;
|
|
1351
|
-
const ee =
|
|
1351
|
+
const ee = K, Mr = N, Re = qe, no = N;
|
|
1352
1352
|
function so(e, t) {
|
|
1353
1353
|
const { gen: n, data: r, it: s } = e;
|
|
1354
1354
|
n.if(Rr(n, r, t, s.opts.ownProperties), () => {
|
|
@@ -1454,14 +1454,14 @@ function ho(e) {
|
|
|
1454
1454
|
J.validateUnion = ho;
|
|
1455
1455
|
Object.defineProperty(Ee, "__esModule", { value: !0 });
|
|
1456
1456
|
Ee.validateKeywordUsage = Ee.validSchemaType = Ee.funcKeywordCode = Ee.macroKeywordCode = void 0;
|
|
1457
|
-
const
|
|
1457
|
+
const de = K, Ve = qe, po = J, yo = gt;
|
|
1458
1458
|
function vo(e, t) {
|
|
1459
1459
|
const { gen: n, keyword: r, schema: s, parentSchema: a, it: o } = e, i = t.macro.call(o.self, s, a, o), d = us(n, r, i);
|
|
1460
1460
|
o.opts.validateSchema !== !1 && o.self.validateSchema(i, !0);
|
|
1461
1461
|
const c = n.name("valid");
|
|
1462
1462
|
e.subschema({
|
|
1463
1463
|
schema: i,
|
|
1464
|
-
schemaPath:
|
|
1464
|
+
schemaPath: de.nil,
|
|
1465
1465
|
errSchemaPath: `${o.errSchemaPath}/${r}`,
|
|
1466
1466
|
topSchemaRef: d,
|
|
1467
1467
|
compositeRule: !0
|
|
@@ -1484,30 +1484,30 @@ function _o(e, t) {
|
|
|
1484
1484
|
}
|
|
1485
1485
|
function $() {
|
|
1486
1486
|
const f = r.let("ruleErrs", null);
|
|
1487
|
-
return r.try(() => g((0,
|
|
1487
|
+
return r.try(() => g((0, de._)`await `), (y) => r.assign(m, !1).if((0, de._)`${y} instanceof ${d.ValidationError}`, () => r.assign(f, (0, de._)`${y}.errors`), () => r.throw(y))), f;
|
|
1488
1488
|
}
|
|
1489
1489
|
function v() {
|
|
1490
|
-
const f = (0,
|
|
1491
|
-
return r.assign(f, null), g(
|
|
1490
|
+
const f = (0, de._)`${u}.errors`;
|
|
1491
|
+
return r.assign(f, null), g(de.nil), f;
|
|
1492
1492
|
}
|
|
1493
|
-
function g(f = t.async ? (0,
|
|
1494
|
-
const y = d.opts.passContext ?
|
|
1495
|
-
r.assign(m, (0,
|
|
1493
|
+
function g(f = t.async ? (0, de._)`await ` : de.nil) {
|
|
1494
|
+
const y = d.opts.passContext ? Ve.default.this : Ve.default.self, k = !("compile" in t && !i || t.schema === !1);
|
|
1495
|
+
r.assign(m, (0, de._)`${f}${(0, po.callValidateCode)(e, u, y, k)}`, t.modifying);
|
|
1496
1496
|
}
|
|
1497
1497
|
function p(f) {
|
|
1498
1498
|
var y;
|
|
1499
|
-
r.if((0,
|
|
1499
|
+
r.if((0, de.not)((y = t.valid) !== null && y !== void 0 ? y : m), f);
|
|
1500
1500
|
}
|
|
1501
1501
|
}
|
|
1502
1502
|
Ee.funcKeywordCode = _o;
|
|
1503
1503
|
function Pn(e) {
|
|
1504
1504
|
const { gen: t, data: n, it: r } = e;
|
|
1505
|
-
t.if(r.parentData, () => t.assign(n, (0,
|
|
1505
|
+
t.if(r.parentData, () => t.assign(n, (0, de._)`${r.parentData}[${r.parentDataProperty}]`));
|
|
1506
1506
|
}
|
|
1507
1507
|
function go(e, t) {
|
|
1508
1508
|
const { gen: n } = e;
|
|
1509
|
-
n.if((0,
|
|
1510
|
-
n.assign(
|
|
1509
|
+
n.if((0, de._)`Array.isArray(${t})`, () => {
|
|
1510
|
+
n.assign(Ve.default.vErrors, (0, de._)`${Ve.default.vErrors} === null ? ${t} : ${Ve.default.vErrors}.concat(${t})`).assign(Ve.default.errors, (0, de._)`${Ve.default.vErrors}.length`), (0, yo.extendErrors)(e);
|
|
1511
1511
|
}, () => e.error());
|
|
1512
1512
|
}
|
|
1513
1513
|
function bo({ schemaEnv: e }, t) {
|
|
@@ -1517,7 +1517,7 @@ function bo({ schemaEnv: e }, t) {
|
|
|
1517
1517
|
function us(e, t, n) {
|
|
1518
1518
|
if (n === void 0)
|
|
1519
1519
|
throw new Error(`keyword "${t}" failed to compile`);
|
|
1520
|
-
return e.scopeValue("keyword", typeof n == "function" ? { ref: n } : { ref: n, code: (0,
|
|
1520
|
+
return e.scopeValue("keyword", typeof n == "function" ? { ref: n } : { ref: n, code: (0, de.stringify)(n) });
|
|
1521
1521
|
}
|
|
1522
1522
|
function $o(e, t, n = !1) {
|
|
1523
1523
|
return !t.length || t.some((r) => r === "array" ? Array.isArray(e) : r === "object" ? e && typeof e == "object" && !Array.isArray(e) : typeof e == r || n && typeof e > "u");
|
|
@@ -1541,7 +1541,7 @@ Ee.validateKeywordUsage = wo;
|
|
|
1541
1541
|
var De = {};
|
|
1542
1542
|
Object.defineProperty(De, "__esModule", { value: !0 });
|
|
1543
1543
|
De.extendSubschemaMode = De.extendSubschemaData = De.getSubschema = void 0;
|
|
1544
|
-
const Se =
|
|
1544
|
+
const Se = K, fs = N;
|
|
1545
1545
|
function ko(e, { keyword: t, schemaProp: n, schema: r, schemaPath: s, errSchemaPath: a, topSchemaRef: o }) {
|
|
1546
1546
|
if (t !== void 0 && r !== void 0)
|
|
1547
1547
|
throw new Error('both "keyword" and "schema" passed, only one allowed');
|
|
@@ -1592,7 +1592,7 @@ function Eo(e, { jtdDiscriminator: t, jtdMetadata: n, compositeRule: r, createEr
|
|
|
1592
1592
|
r !== void 0 && (e.compositeRule = r), s !== void 0 && (e.createErrors = s), a !== void 0 && (e.allErrors = a), e.jtdDiscriminator = t, e.jtdMetadata = n;
|
|
1593
1593
|
}
|
|
1594
1594
|
De.extendSubschemaMode = Eo;
|
|
1595
|
-
var
|
|
1595
|
+
var ie = {}, ms = function e(t, n) {
|
|
1596
1596
|
if (t === n) return !0;
|
|
1597
1597
|
if (t && n && typeof t == "object" && typeof n == "object") {
|
|
1598
1598
|
if (t.constructor !== n.constructor) return !1;
|
|
@@ -1689,8 +1689,8 @@ function Po(e) {
|
|
|
1689
1689
|
return e.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
1690
1690
|
}
|
|
1691
1691
|
var Oo = hs.exports;
|
|
1692
|
-
Object.defineProperty(
|
|
1693
|
-
|
|
1692
|
+
Object.defineProperty(ie, "__esModule", { value: !0 });
|
|
1693
|
+
ie.getSchemaRefs = ie.resolveUrl = ie.normalizeId = ie._getFullPath = ie.getFullPath = ie.inlineRef = void 0;
|
|
1694
1694
|
const jo = N, qo = ms, Io = Oo, No = /* @__PURE__ */ new Set([
|
|
1695
1695
|
"type",
|
|
1696
1696
|
"format",
|
|
@@ -1712,7 +1712,7 @@ const jo = N, qo = ms, Io = Oo, No = /* @__PURE__ */ new Set([
|
|
|
1712
1712
|
function Mo(e, t = !0) {
|
|
1713
1713
|
return typeof e == "boolean" ? !0 : t === !0 ? !br(e) : t ? ps(e) <= t : !1;
|
|
1714
1714
|
}
|
|
1715
|
-
|
|
1715
|
+
ie.inlineRef = Mo;
|
|
1716
1716
|
const To = /* @__PURE__ */ new Set([
|
|
1717
1717
|
"$ref",
|
|
1718
1718
|
"$recursiveRef",
|
|
@@ -1741,29 +1741,29 @@ function ps(e) {
|
|
|
1741
1741
|
return t;
|
|
1742
1742
|
}
|
|
1743
1743
|
function ys(e, t = "", n) {
|
|
1744
|
-
n !== !1 && (t =
|
|
1744
|
+
n !== !1 && (t = Qe(t));
|
|
1745
1745
|
const r = e.parse(t);
|
|
1746
1746
|
return vs(e, r);
|
|
1747
1747
|
}
|
|
1748
|
-
|
|
1748
|
+
ie.getFullPath = ys;
|
|
1749
1749
|
function vs(e, t) {
|
|
1750
1750
|
return e.serialize(t).split("#")[0] + "#";
|
|
1751
1751
|
}
|
|
1752
|
-
|
|
1752
|
+
ie._getFullPath = vs;
|
|
1753
1753
|
const Ro = /#\/?$/;
|
|
1754
|
-
function
|
|
1754
|
+
function Qe(e) {
|
|
1755
1755
|
return e ? e.replace(Ro, "") : "";
|
|
1756
1756
|
}
|
|
1757
|
-
|
|
1757
|
+
ie.normalizeId = Qe;
|
|
1758
1758
|
function Ao(e, t, n) {
|
|
1759
|
-
return n =
|
|
1759
|
+
return n = Qe(n), e.resolve(t, n);
|
|
1760
1760
|
}
|
|
1761
|
-
|
|
1762
|
-
const
|
|
1763
|
-
function
|
|
1761
|
+
ie.resolveUrl = Ao;
|
|
1762
|
+
const Fo = /^[a-z_][-a-z0-9._]*$/i;
|
|
1763
|
+
function Do(e, t) {
|
|
1764
1764
|
if (typeof e == "boolean")
|
|
1765
1765
|
return {};
|
|
1766
|
-
const { schemaId: n, uriResolver: r } = this.opts, s =
|
|
1766
|
+
const { schemaId: n, uriResolver: r } = this.opts, s = Qe(e[n] || t), a = { "": s }, o = ys(r, s, !1), i = {}, d = /* @__PURE__ */ new Set();
|
|
1767
1767
|
return Io(e, { allKeys: !0 }, (m, b, $, v) => {
|
|
1768
1768
|
if (v === void 0)
|
|
1769
1769
|
return;
|
|
@@ -1771,16 +1771,16 @@ function Fo(e, t) {
|
|
|
1771
1771
|
let p = a[v];
|
|
1772
1772
|
typeof m[n] == "string" && (p = f.call(this, m[n])), y.call(this, m.$anchor), y.call(this, m.$dynamicAnchor), a[b] = p;
|
|
1773
1773
|
function f(k) {
|
|
1774
|
-
const
|
|
1775
|
-
if (k =
|
|
1774
|
+
const S = this.opts.uriResolver.resolve;
|
|
1775
|
+
if (k = Qe(p ? S(p, k) : k), d.has(k))
|
|
1776
1776
|
throw u(k);
|
|
1777
1777
|
d.add(k);
|
|
1778
1778
|
let O = this.refs[k];
|
|
1779
|
-
return typeof O == "string" && (O = this.refs[O]), typeof O == "object" ? c(m, O.schema, k) : k !==
|
|
1779
|
+
return typeof O == "string" && (O = this.refs[O]), typeof O == "object" ? c(m, O.schema, k) : k !== Qe(g) && (k[0] === "#" ? (c(m, i[k], k), i[k] = m) : this.refs[k] = g), k;
|
|
1780
1780
|
}
|
|
1781
1781
|
function y(k) {
|
|
1782
1782
|
if (typeof k == "string") {
|
|
1783
|
-
if (!
|
|
1783
|
+
if (!Fo.test(k))
|
|
1784
1784
|
throw new Error(`invalid anchor "${k}"`);
|
|
1785
1785
|
f.call(this, `#${k}`);
|
|
1786
1786
|
}
|
|
@@ -1794,10 +1794,10 @@ function Fo(e, t) {
|
|
|
1794
1794
|
return new Error(`reference "${m}" resolves to more than one schema`);
|
|
1795
1795
|
}
|
|
1796
1796
|
}
|
|
1797
|
-
|
|
1798
|
-
Object.defineProperty(
|
|
1799
|
-
|
|
1800
|
-
const _s =
|
|
1797
|
+
ie.getSchemaRefs = Do;
|
|
1798
|
+
Object.defineProperty(be, "__esModule", { value: !0 });
|
|
1799
|
+
be.getData = be.KeywordCxt = be.validateFunctionCode = void 0;
|
|
1800
|
+
const _s = Xe, On = ne, Ar = Ne, Dt = ne, Co = Ht, ut = Ee, ur = De, A = K, L = qe, Vo = ie, Me = N, it = gt;
|
|
1801
1801
|
function zo(e) {
|
|
1802
1802
|
if ($s(e) && (ws(e), bs(e))) {
|
|
1803
1803
|
Ho(e);
|
|
@@ -1805,35 +1805,35 @@ function zo(e) {
|
|
|
1805
1805
|
}
|
|
1806
1806
|
gs(e, () => (0, _s.topBoolOrEmptySchema)(e));
|
|
1807
1807
|
}
|
|
1808
|
-
|
|
1808
|
+
be.validateFunctionCode = zo;
|
|
1809
1809
|
function gs({ gen: e, validateName: t, schema: n, schemaEnv: r, opts: s }, a) {
|
|
1810
|
-
s.code.es5 ? e.func(t, (0,
|
|
1811
|
-
e.code((0,
|
|
1812
|
-
}) : e.func(t, (0,
|
|
1810
|
+
s.code.es5 ? e.func(t, (0, A._)`${L.default.data}, ${L.default.valCxt}`, r.$async, () => {
|
|
1811
|
+
e.code((0, A._)`"use strict"; ${jn(n, s)}`), Lo(e, s), e.code(a);
|
|
1812
|
+
}) : e.func(t, (0, A._)`${L.default.data}, ${Uo(s)}`, r.$async, () => e.code(jn(n, s)).code(a));
|
|
1813
1813
|
}
|
|
1814
1814
|
function Uo(e) {
|
|
1815
|
-
return (0,
|
|
1815
|
+
return (0, A._)`{${L.default.instancePath}="", ${L.default.parentData}, ${L.default.parentDataProperty}, ${L.default.rootData}=${L.default.data}${e.dynamicRef ? (0, A._)`, ${L.default.dynamicAnchors}={}` : A.nil}}={}`;
|
|
1816
1816
|
}
|
|
1817
1817
|
function Lo(e, t) {
|
|
1818
|
-
e.if(
|
|
1819
|
-
e.var(
|
|
1818
|
+
e.if(L.default.valCxt, () => {
|
|
1819
|
+
e.var(L.default.instancePath, (0, A._)`${L.default.valCxt}.${L.default.instancePath}`), e.var(L.default.parentData, (0, A._)`${L.default.valCxt}.${L.default.parentData}`), e.var(L.default.parentDataProperty, (0, A._)`${L.default.valCxt}.${L.default.parentDataProperty}`), e.var(L.default.rootData, (0, A._)`${L.default.valCxt}.${L.default.rootData}`), t.dynamicRef && e.var(L.default.dynamicAnchors, (0, A._)`${L.default.valCxt}.${L.default.dynamicAnchors}`);
|
|
1820
1820
|
}, () => {
|
|
1821
|
-
e.var(
|
|
1821
|
+
e.var(L.default.instancePath, (0, A._)`""`), e.var(L.default.parentData, (0, A._)`undefined`), e.var(L.default.parentDataProperty, (0, A._)`undefined`), e.var(L.default.rootData, L.default.data), t.dynamicRef && e.var(L.default.dynamicAnchors, (0, A._)`{}`);
|
|
1822
1822
|
});
|
|
1823
1823
|
}
|
|
1824
1824
|
function Ho(e) {
|
|
1825
1825
|
const { schema: t, opts: n, gen: r } = e;
|
|
1826
1826
|
gs(e, () => {
|
|
1827
|
-
n.$comment && t.$comment && Ss(e), xo(e), r.let(
|
|
1827
|
+
n.$comment && t.$comment && Ss(e), xo(e), r.let(L.default.vErrors, null), r.let(L.default.errors, 0), n.unevaluated && Ko(e), ks(e), Yo(e);
|
|
1828
1828
|
});
|
|
1829
1829
|
}
|
|
1830
1830
|
function Ko(e) {
|
|
1831
1831
|
const { gen: t, validateName: n } = e;
|
|
1832
|
-
e.evaluated = t.const("evaluated", (0,
|
|
1832
|
+
e.evaluated = t.const("evaluated", (0, A._)`${n}.evaluated`), t.if((0, A._)`${e.evaluated}.dynamicProps`, () => t.assign((0, A._)`${e.evaluated}.props`, (0, A._)`undefined`)), t.if((0, A._)`${e.evaluated}.dynamicItems`, () => t.assign((0, A._)`${e.evaluated}.items`, (0, A._)`undefined`));
|
|
1833
1833
|
}
|
|
1834
1834
|
function jn(e, t) {
|
|
1835
1835
|
const n = typeof e == "object" && e[t.schemaId];
|
|
1836
|
-
return n && (t.code.source || t.code.process) ? (0,
|
|
1836
|
+
return n && (t.code.source || t.code.process) ? (0, A._)`/*# sourceURL=${n} */` : A.nil;
|
|
1837
1837
|
}
|
|
1838
1838
|
function Bo(e, t) {
|
|
1839
1839
|
if ($s(e) && (ws(e), bs(e))) {
|
|
@@ -1856,8 +1856,8 @@ function $s(e) {
|
|
|
1856
1856
|
function Go(e, t) {
|
|
1857
1857
|
const { schema: n, gen: r, opts: s } = e;
|
|
1858
1858
|
s.$comment && n.$comment && Ss(e), Wo(e), Zo(e);
|
|
1859
|
-
const a = r.const("_errs",
|
|
1860
|
-
ks(e, a), r.var(t, (0,
|
|
1859
|
+
const a = r.const("_errs", L.default.errors);
|
|
1860
|
+
ks(e, a), r.var(t, (0, A._)`${a} === ${L.default.errors}`);
|
|
1861
1861
|
}
|
|
1862
1862
|
function ws(e) {
|
|
1863
1863
|
(0, Me.checkUnknownRules)(e), Jo(e);
|
|
@@ -1887,18 +1887,18 @@ function Zo(e) {
|
|
|
1887
1887
|
function Ss({ gen: e, schemaEnv: t, schema: n, errSchemaPath: r, opts: s }) {
|
|
1888
1888
|
const a = n.$comment;
|
|
1889
1889
|
if (s.$comment === !0)
|
|
1890
|
-
e.code((0,
|
|
1890
|
+
e.code((0, A._)`${L.default.self}.logger.log(${a})`);
|
|
1891
1891
|
else if (typeof s.$comment == "function") {
|
|
1892
|
-
const o = (0,
|
|
1893
|
-
e.code((0,
|
|
1892
|
+
const o = (0, A.str)`${r}/$comment`, i = e.scopeValue("root", { ref: t.root });
|
|
1893
|
+
e.code((0, A._)`${L.default.self}.opts.$comment(${a}, ${o}, ${i}.schema)`);
|
|
1894
1894
|
}
|
|
1895
1895
|
}
|
|
1896
1896
|
function Yo(e) {
|
|
1897
1897
|
const { gen: t, schemaEnv: n, validateName: r, ValidationError: s, opts: a } = e;
|
|
1898
|
-
n.$async ? t.if((0,
|
|
1898
|
+
n.$async ? t.if((0, A._)`${L.default.errors} === 0`, () => t.return(L.default.data), () => t.throw((0, A._)`new ${s}(${L.default.vErrors})`)) : (t.assign((0, A._)`${r}.errors`, L.default.vErrors), a.unevaluated && Qo(e), t.return((0, A._)`${L.default.errors} === 0`));
|
|
1899
1899
|
}
|
|
1900
1900
|
function Qo({ gen: e, evaluated: t, props: n, items: r }) {
|
|
1901
|
-
n instanceof
|
|
1901
|
+
n instanceof A.Name && e.assign((0, A._)`${t}.props`, n), r instanceof A.Name && e.assign((0, A._)`${t}.items`, r);
|
|
1902
1902
|
}
|
|
1903
1903
|
function qn(e, t, n, r) {
|
|
1904
1904
|
const { gen: s, schema: a, data: o, allErrors: i, opts: d, self: c } = e, { RULES: u } = c;
|
|
@@ -1912,12 +1912,12 @@ function qn(e, t, n, r) {
|
|
|
1912
1912
|
m(u.post);
|
|
1913
1913
|
});
|
|
1914
1914
|
function m(b) {
|
|
1915
|
-
(0, Ar.shouldUseGroup)(a, b) && (b.type ? (s.if((0,
|
|
1915
|
+
(0, Ar.shouldUseGroup)(a, b) && (b.type ? (s.if((0, Dt.checkDataType)(b.type, o, d.strictNumbers)), In(e, b), t.length === 1 && t[0] === b.type && n && (s.else(), (0, Dt.reportTypeError)(e)), s.endIf()) : In(e, b), i || s.if((0, A._)`${L.default.errors} === ${r || 0}`));
|
|
1916
1916
|
}
|
|
1917
1917
|
}
|
|
1918
1918
|
function In(e, t) {
|
|
1919
1919
|
const { gen: n, schema: r, opts: { useDefaults: s } } = e;
|
|
1920
|
-
s && (0,
|
|
1920
|
+
s && (0, Co.assignDefaults)(e, t.type), n.block(() => {
|
|
1921
1921
|
for (const a of t.rules)
|
|
1922
1922
|
(0, Ar.shouldUseRule)(r, a) && Os(e, a.keyword, a.definition, t.type);
|
|
1923
1923
|
});
|
|
@@ -1932,12 +1932,12 @@ function ei(e, t) {
|
|
|
1932
1932
|
return;
|
|
1933
1933
|
}
|
|
1934
1934
|
t.forEach((n) => {
|
|
1935
|
-
Es(e.dataTypes, n) ||
|
|
1935
|
+
Es(e.dataTypes, n) || Fr(e, `type "${n}" not allowed by context "${e.dataTypes.join(",")}"`);
|
|
1936
1936
|
}), si(e, t);
|
|
1937
1937
|
}
|
|
1938
1938
|
}
|
|
1939
1939
|
function ti(e, t) {
|
|
1940
|
-
t.length > 1 && !(t.length === 2 && t.includes("null")) &&
|
|
1940
|
+
t.length > 1 && !(t.length === 2 && t.includes("null")) && Fr(e, "use allowUnionTypes to allow union type keyword");
|
|
1941
1941
|
}
|
|
1942
1942
|
function ri(e, t) {
|
|
1943
1943
|
const n = e.self.RULES.all;
|
|
@@ -1945,7 +1945,7 @@ function ri(e, t) {
|
|
|
1945
1945
|
const s = n[r];
|
|
1946
1946
|
if (typeof s == "object" && (0, Ar.shouldUseRule)(e.schema, s)) {
|
|
1947
1947
|
const { type: a } = s.definition;
|
|
1948
|
-
a.length && !a.some((o) => ni(t, o)) &&
|
|
1948
|
+
a.length && !a.some((o) => ni(t, o)) && Fr(e, `missing type "${a.join(",")}" for keyword "${r}"`);
|
|
1949
1949
|
}
|
|
1950
1950
|
}
|
|
1951
1951
|
}
|
|
@@ -1961,26 +1961,26 @@ function si(e, t) {
|
|
|
1961
1961
|
Es(t, r) ? n.push(r) : t.includes("integer") && r === "number" && n.push("integer");
|
|
1962
1962
|
e.dataTypes = n;
|
|
1963
1963
|
}
|
|
1964
|
-
function
|
|
1964
|
+
function Fr(e, t) {
|
|
1965
1965
|
const n = e.schemaEnv.baseId + e.errSchemaPath;
|
|
1966
1966
|
t += ` at "${n}" (strictTypes)`, (0, Me.checkStrictMode)(e, t, e.opts.strictTypes);
|
|
1967
1967
|
}
|
|
1968
1968
|
class Ps {
|
|
1969
1969
|
constructor(t, n, r) {
|
|
1970
|
-
if ((0,
|
|
1970
|
+
if ((0, ut.validateKeywordUsage)(t, n, r), this.gen = t.gen, this.allErrors = t.allErrors, this.keyword = r, this.data = t.data, this.schema = t.schema[r], this.$data = n.$data && t.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, Me.schemaRefOrVal)(t, this.schema, r, this.$data), this.schemaType = n.schemaType, this.parentSchema = t.schema, this.params = {}, this.it = t, this.def = n, this.$data)
|
|
1971
1971
|
this.schemaCode = t.gen.const("vSchema", js(this.$data, t));
|
|
1972
|
-
else if (this.schemaCode = this.schemaValue, !(0,
|
|
1972
|
+
else if (this.schemaCode = this.schemaValue, !(0, ut.validSchemaType)(this.schema, n.schemaType, n.allowUndefined))
|
|
1973
1973
|
throw new Error(`${r} value must be ${JSON.stringify(n.schemaType)}`);
|
|
1974
|
-
("code" in n ? n.trackErrors : n.errors !== !1) && (this.errsCount = t.gen.const("_errs",
|
|
1974
|
+
("code" in n ? n.trackErrors : n.errors !== !1) && (this.errsCount = t.gen.const("_errs", L.default.errors));
|
|
1975
1975
|
}
|
|
1976
1976
|
result(t, n, r) {
|
|
1977
|
-
this.failResult((0,
|
|
1977
|
+
this.failResult((0, A.not)(t), n, r);
|
|
1978
1978
|
}
|
|
1979
1979
|
failResult(t, n, r) {
|
|
1980
1980
|
this.gen.if(t), r ? r() : this.error(), n ? (this.gen.else(), n(), this.allErrors && this.gen.endIf()) : this.allErrors ? this.gen.endIf() : this.gen.else();
|
|
1981
1981
|
}
|
|
1982
1982
|
pass(t, n) {
|
|
1983
|
-
this.failResult((0,
|
|
1983
|
+
this.failResult((0, A.not)(t), void 0, n);
|
|
1984
1984
|
}
|
|
1985
1985
|
fail(t) {
|
|
1986
1986
|
if (t === void 0) {
|
|
@@ -1993,7 +1993,7 @@ class Ps {
|
|
|
1993
1993
|
if (!this.$data)
|
|
1994
1994
|
return this.fail(t);
|
|
1995
1995
|
const { schemaCode: n } = this;
|
|
1996
|
-
this.fail((0,
|
|
1996
|
+
this.fail((0, A._)`${n} !== undefined && (${(0, A.or)(this.invalid$data(), t)})`);
|
|
1997
1997
|
}
|
|
1998
1998
|
error(t, n, r) {
|
|
1999
1999
|
if (n) {
|
|
@@ -2003,15 +2003,15 @@ class Ps {
|
|
|
2003
2003
|
this._error(t, r);
|
|
2004
2004
|
}
|
|
2005
2005
|
_error(t, n) {
|
|
2006
|
-
(t ?
|
|
2006
|
+
(t ? it.reportExtraError : it.reportError)(this, this.def.error, n);
|
|
2007
2007
|
}
|
|
2008
2008
|
$dataError() {
|
|
2009
|
-
(0,
|
|
2009
|
+
(0, it.reportError)(this, this.def.$dataError || it.keyword$DataError);
|
|
2010
2010
|
}
|
|
2011
2011
|
reset() {
|
|
2012
2012
|
if (this.errsCount === void 0)
|
|
2013
2013
|
throw new Error('add "trackErrors" to keyword definition');
|
|
2014
|
-
(0,
|
|
2014
|
+
(0, it.resetErrorsCount)(this.gen, this.errsCount);
|
|
2015
2015
|
}
|
|
2016
2016
|
ok(t) {
|
|
2017
2017
|
this.allErrors || this.gen.if(t);
|
|
@@ -2019,35 +2019,35 @@ class Ps {
|
|
|
2019
2019
|
setParams(t, n) {
|
|
2020
2020
|
n ? Object.assign(this.params, t) : this.params = t;
|
|
2021
2021
|
}
|
|
2022
|
-
block$data(t, n, r =
|
|
2022
|
+
block$data(t, n, r = A.nil) {
|
|
2023
2023
|
this.gen.block(() => {
|
|
2024
2024
|
this.check$data(t, r), n();
|
|
2025
2025
|
});
|
|
2026
2026
|
}
|
|
2027
|
-
check$data(t =
|
|
2027
|
+
check$data(t = A.nil, n = A.nil) {
|
|
2028
2028
|
if (!this.$data)
|
|
2029
2029
|
return;
|
|
2030
2030
|
const { gen: r, schemaCode: s, schemaType: a, def: o } = this;
|
|
2031
|
-
r.if((0,
|
|
2031
|
+
r.if((0, A.or)((0, A._)`${s} === undefined`, n)), t !== A.nil && r.assign(t, !0), (a.length || o.validateSchema) && (r.elseIf(this.invalid$data()), this.$dataError(), t !== A.nil && r.assign(t, !1)), r.else();
|
|
2032
2032
|
}
|
|
2033
2033
|
invalid$data() {
|
|
2034
2034
|
const { gen: t, schemaCode: n, schemaType: r, def: s, it: a } = this;
|
|
2035
|
-
return (0,
|
|
2035
|
+
return (0, A.or)(o(), i());
|
|
2036
2036
|
function o() {
|
|
2037
2037
|
if (r.length) {
|
|
2038
|
-
if (!(n instanceof
|
|
2038
|
+
if (!(n instanceof A.Name))
|
|
2039
2039
|
throw new Error("ajv implementation error");
|
|
2040
2040
|
const d = Array.isArray(r) ? r : [r];
|
|
2041
|
-
return (0,
|
|
2041
|
+
return (0, A._)`${(0, Dt.checkDataTypes)(d, n, a.opts.strictNumbers, Dt.DataType.Wrong)}`;
|
|
2042
2042
|
}
|
|
2043
|
-
return
|
|
2043
|
+
return A.nil;
|
|
2044
2044
|
}
|
|
2045
2045
|
function i() {
|
|
2046
2046
|
if (s.validateSchema) {
|
|
2047
2047
|
const d = t.scopeValue("validate$data", { ref: s.validateSchema });
|
|
2048
|
-
return (0,
|
|
2048
|
+
return (0, A._)`!${d}(${n})`;
|
|
2049
2049
|
}
|
|
2050
|
-
return
|
|
2050
|
+
return A.nil;
|
|
2051
2051
|
}
|
|
2052
2052
|
}
|
|
2053
2053
|
subschema(t, n) {
|
|
@@ -2063,23 +2063,23 @@ class Ps {
|
|
|
2063
2063
|
mergeValidEvaluated(t, n) {
|
|
2064
2064
|
const { it: r, gen: s } = this;
|
|
2065
2065
|
if (r.opts.unevaluated && (r.props !== !0 || r.items !== !0))
|
|
2066
|
-
return s.if(n, () => this.mergeEvaluated(t,
|
|
2066
|
+
return s.if(n, () => this.mergeEvaluated(t, A.Name)), !0;
|
|
2067
2067
|
}
|
|
2068
2068
|
}
|
|
2069
|
-
|
|
2069
|
+
be.KeywordCxt = Ps;
|
|
2070
2070
|
function Os(e, t, n, r) {
|
|
2071
2071
|
const s = new Ps(e, n, t);
|
|
2072
|
-
"code" in n ? n.code(s, r) : s.$data && n.validate ? (0,
|
|
2072
|
+
"code" in n ? n.code(s, r) : s.$data && n.validate ? (0, ut.funcKeywordCode)(s, n) : "macro" in n ? (0, ut.macroKeywordCode)(s, n) : (n.compile || n.validate) && (0, ut.funcKeywordCode)(s, n);
|
|
2073
2073
|
}
|
|
2074
2074
|
const ai = /^\/(?:[^~]|~0|~1)*$/, oi = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
|
|
2075
2075
|
function js(e, { dataLevel: t, dataNames: n, dataPathArr: r }) {
|
|
2076
2076
|
let s, a;
|
|
2077
2077
|
if (e === "")
|
|
2078
|
-
return
|
|
2078
|
+
return L.default.rootData;
|
|
2079
2079
|
if (e[0] === "/") {
|
|
2080
2080
|
if (!ai.test(e))
|
|
2081
2081
|
throw new Error(`Invalid JSON-pointer: ${e}`);
|
|
2082
|
-
s = e, a =
|
|
2082
|
+
s = e, a = L.default.rootData;
|
|
2083
2083
|
} else {
|
|
2084
2084
|
const c = oi.exec(e);
|
|
2085
2085
|
if (!c)
|
|
@@ -2098,77 +2098,77 @@ function js(e, { dataLevel: t, dataNames: n, dataPathArr: r }) {
|
|
|
2098
2098
|
let o = a;
|
|
2099
2099
|
const i = s.split("/");
|
|
2100
2100
|
for (const c of i)
|
|
2101
|
-
c && (a = (0,
|
|
2101
|
+
c && (a = (0, A._)`${a}${(0, A.getProperty)((0, Me.unescapeJsonPointer)(c))}`, o = (0, A._)`${o} && ${a}`);
|
|
2102
2102
|
return o;
|
|
2103
2103
|
function d(c, u) {
|
|
2104
2104
|
return `Cannot access ${c} ${u} levels up, current level is ${t}`;
|
|
2105
2105
|
}
|
|
2106
2106
|
}
|
|
2107
|
-
|
|
2108
|
-
var
|
|
2109
|
-
Object.defineProperty(
|
|
2107
|
+
be.getData = js;
|
|
2108
|
+
var bt = {};
|
|
2109
|
+
Object.defineProperty(bt, "__esModule", { value: !0 });
|
|
2110
2110
|
class ii extends Error {
|
|
2111
2111
|
constructor(t) {
|
|
2112
2112
|
super("validation failed"), this.errors = t, this.ajv = this.validation = !0;
|
|
2113
2113
|
}
|
|
2114
2114
|
}
|
|
2115
|
-
|
|
2116
|
-
var
|
|
2117
|
-
Object.defineProperty(
|
|
2118
|
-
const fr =
|
|
2115
|
+
bt.default = ii;
|
|
2116
|
+
var rt = {};
|
|
2117
|
+
Object.defineProperty(rt, "__esModule", { value: !0 });
|
|
2118
|
+
const fr = ie;
|
|
2119
2119
|
class li extends Error {
|
|
2120
2120
|
constructor(t, n, r, s) {
|
|
2121
2121
|
super(s || `can't resolve reference ${r} from id ${n}`), this.missingRef = (0, fr.resolveUrl)(t, n, r), this.missingSchema = (0, fr.normalizeId)((0, fr.getFullPath)(t, this.missingRef));
|
|
2122
2122
|
}
|
|
2123
2123
|
}
|
|
2124
|
-
|
|
2125
|
-
var
|
|
2126
|
-
Object.defineProperty(
|
|
2127
|
-
|
|
2128
|
-
const
|
|
2124
|
+
rt.default = li;
|
|
2125
|
+
var ue = {};
|
|
2126
|
+
Object.defineProperty(ue, "__esModule", { value: !0 });
|
|
2127
|
+
ue.resolveSchema = ue.getCompilingSchema = ue.resolveRef = ue.compileSchema = ue.SchemaEnv = void 0;
|
|
2128
|
+
const ve = K, di = bt, Ce = qe, ge = ie, Nn = N, ci = be;
|
|
2129
2129
|
class Kt {
|
|
2130
2130
|
constructor(t) {
|
|
2131
2131
|
var n;
|
|
2132
2132
|
this.refs = {}, this.dynamicAnchors = {};
|
|
2133
2133
|
let r;
|
|
2134
|
-
typeof t.schema == "object" && (r = t.schema), this.schema = t.schema, this.schemaId = t.schemaId, this.root = t.root || this, this.baseId = (n = t.baseId) !== null && n !== void 0 ? n : (0,
|
|
2134
|
+
typeof t.schema == "object" && (r = t.schema), this.schema = t.schema, this.schemaId = t.schemaId, this.root = t.root || this, this.baseId = (n = t.baseId) !== null && n !== void 0 ? n : (0, ge.normalizeId)(r == null ? void 0 : r[t.schemaId || "$id"]), this.schemaPath = t.schemaPath, this.localRefs = t.localRefs, this.meta = t.meta, this.$async = r == null ? void 0 : r.$async, this.refs = {};
|
|
2135
2135
|
}
|
|
2136
2136
|
}
|
|
2137
|
-
|
|
2138
|
-
function
|
|
2137
|
+
ue.SchemaEnv = Kt;
|
|
2138
|
+
function Dr(e) {
|
|
2139
2139
|
const t = qs.call(this, e);
|
|
2140
2140
|
if (t)
|
|
2141
2141
|
return t;
|
|
2142
|
-
const n = (0,
|
|
2142
|
+
const n = (0, ge.getFullPath)(this.opts.uriResolver, e.root.baseId), { es5: r, lines: s } = this.opts.code, { ownProperties: a } = this.opts, o = new ve.CodeGen(this.scope, { es5: r, lines: s, ownProperties: a });
|
|
2143
2143
|
let i;
|
|
2144
2144
|
e.$async && (i = o.scopeValue("Error", {
|
|
2145
2145
|
ref: di.default,
|
|
2146
|
-
code: (0,
|
|
2146
|
+
code: (0, ve._)`require("ajv/dist/runtime/validation_error").default`
|
|
2147
2147
|
}));
|
|
2148
2148
|
const d = o.scopeName("validate");
|
|
2149
2149
|
e.validateName = d;
|
|
2150
2150
|
const c = {
|
|
2151
2151
|
gen: o,
|
|
2152
2152
|
allErrors: this.opts.allErrors,
|
|
2153
|
-
data:
|
|
2154
|
-
parentData:
|
|
2155
|
-
parentDataProperty:
|
|
2156
|
-
dataNames: [
|
|
2157
|
-
dataPathArr: [
|
|
2153
|
+
data: Ce.default.data,
|
|
2154
|
+
parentData: Ce.default.parentData,
|
|
2155
|
+
parentDataProperty: Ce.default.parentDataProperty,
|
|
2156
|
+
dataNames: [Ce.default.data],
|
|
2157
|
+
dataPathArr: [ve.nil],
|
|
2158
2158
|
// TODO can its length be used as dataLevel if nil is removed?
|
|
2159
2159
|
dataLevel: 0,
|
|
2160
2160
|
dataTypes: [],
|
|
2161
2161
|
definedProperties: /* @__PURE__ */ new Set(),
|
|
2162
|
-
topSchemaRef: o.scopeValue("schema", this.opts.code.source === !0 ? { ref: e.schema, code: (0,
|
|
2162
|
+
topSchemaRef: o.scopeValue("schema", this.opts.code.source === !0 ? { ref: e.schema, code: (0, ve.stringify)(e.schema) } : { ref: e.schema }),
|
|
2163
2163
|
validateName: d,
|
|
2164
2164
|
ValidationError: i,
|
|
2165
2165
|
schema: e.schema,
|
|
2166
2166
|
schemaEnv: e,
|
|
2167
2167
|
rootId: n,
|
|
2168
2168
|
baseId: e.baseId || n,
|
|
2169
|
-
schemaPath:
|
|
2169
|
+
schemaPath: ve.nil,
|
|
2170
2170
|
errSchemaPath: e.schemaPath || (this.opts.jtd ? "" : "#"),
|
|
2171
|
-
errorPath: (0,
|
|
2171
|
+
errorPath: (0, ve._)`""`,
|
|
2172
2172
|
opts: this.opts,
|
|
2173
2173
|
self: this
|
|
2174
2174
|
};
|
|
@@ -2176,16 +2176,16 @@ function Fr(e) {
|
|
|
2176
2176
|
try {
|
|
2177
2177
|
this._compilations.add(e), (0, ci.validateFunctionCode)(c), o.optimize(this.opts.code.optimize);
|
|
2178
2178
|
const m = o.toString();
|
|
2179
|
-
u = `${o.scopeRefs(
|
|
2180
|
-
const $ = new Function(`${
|
|
2179
|
+
u = `${o.scopeRefs(Ce.default.scope)}return ${m}`, this.opts.code.process && (u = this.opts.code.process(u, e));
|
|
2180
|
+
const $ = new Function(`${Ce.default.self}`, `${Ce.default.scope}`, u)(this, this.scope.get());
|
|
2181
2181
|
if (this.scope.value(d, { ref: $ }), $.errors = null, $.schema = e.schema, $.schemaEnv = e, e.$async && ($.$async = !0), this.opts.code.source === !0 && ($.source = { validateName: d, validateCode: m, scopeValues: o._values }), this.opts.unevaluated) {
|
|
2182
2182
|
const { props: v, items: g } = c;
|
|
2183
2183
|
$.evaluated = {
|
|
2184
|
-
props: v instanceof
|
|
2185
|
-
items: g instanceof
|
|
2186
|
-
dynamicProps: v instanceof
|
|
2187
|
-
dynamicItems: g instanceof
|
|
2188
|
-
}, $.source && ($.source.evaluated = (0,
|
|
2184
|
+
props: v instanceof ve.Name ? void 0 : v,
|
|
2185
|
+
items: g instanceof ve.Name ? void 0 : g,
|
|
2186
|
+
dynamicProps: v instanceof ve.Name,
|
|
2187
|
+
dynamicItems: g instanceof ve.Name
|
|
2188
|
+
}, $.source && ($.source.evaluated = (0, ve.stringify)($.evaluated));
|
|
2189
2189
|
}
|
|
2190
2190
|
return e.validate = $, e;
|
|
2191
2191
|
} catch (m) {
|
|
@@ -2194,10 +2194,10 @@ function Fr(e) {
|
|
|
2194
2194
|
this._compilations.delete(e);
|
|
2195
2195
|
}
|
|
2196
2196
|
}
|
|
2197
|
-
|
|
2197
|
+
ue.compileSchema = Dr;
|
|
2198
2198
|
function ui(e, t, n) {
|
|
2199
2199
|
var r;
|
|
2200
|
-
n = (0,
|
|
2200
|
+
n = (0, ge.resolveUrl)(this.opts.uriResolver, t, n);
|
|
2201
2201
|
const s = e.refs[n];
|
|
2202
2202
|
if (s)
|
|
2203
2203
|
return s;
|
|
@@ -2209,16 +2209,16 @@ function ui(e, t, n) {
|
|
|
2209
2209
|
if (a !== void 0)
|
|
2210
2210
|
return e.refs[n] = fi.call(this, a);
|
|
2211
2211
|
}
|
|
2212
|
-
|
|
2212
|
+
ue.resolveRef = ui;
|
|
2213
2213
|
function fi(e) {
|
|
2214
|
-
return (0,
|
|
2214
|
+
return (0, ge.inlineRef)(e.schema, this.opts.inlineRefs) ? e.schema : e.validate ? e : Dr.call(this, e);
|
|
2215
2215
|
}
|
|
2216
2216
|
function qs(e) {
|
|
2217
2217
|
for (const t of this._compilations)
|
|
2218
2218
|
if (mi(t, e))
|
|
2219
2219
|
return t;
|
|
2220
2220
|
}
|
|
2221
|
-
|
|
2221
|
+
ue.getCompilingSchema = qs;
|
|
2222
2222
|
function mi(e, t) {
|
|
2223
2223
|
return e.schema === t.schema && e.root === t.root && e.baseId === t.baseId;
|
|
2224
2224
|
}
|
|
@@ -2229,24 +2229,24 @@ function hi(e, t) {
|
|
|
2229
2229
|
return n || this.schemas[t] || Bt.call(this, e, t);
|
|
2230
2230
|
}
|
|
2231
2231
|
function Bt(e, t) {
|
|
2232
|
-
const n = this.opts.uriResolver.parse(t), r = (0,
|
|
2233
|
-
let s = (0,
|
|
2232
|
+
const n = this.opts.uriResolver.parse(t), r = (0, ge._getFullPath)(this.opts.uriResolver, n);
|
|
2233
|
+
let s = (0, ge.getFullPath)(this.opts.uriResolver, e.baseId, void 0);
|
|
2234
2234
|
if (Object.keys(e.schema).length > 0 && r === s)
|
|
2235
2235
|
return mr.call(this, n, e);
|
|
2236
|
-
const a = (0,
|
|
2236
|
+
const a = (0, ge.normalizeId)(r), o = this.refs[a] || this.schemas[a];
|
|
2237
2237
|
if (typeof o == "string") {
|
|
2238
2238
|
const i = Bt.call(this, e, o);
|
|
2239
2239
|
return typeof (i == null ? void 0 : i.schema) != "object" ? void 0 : mr.call(this, n, i);
|
|
2240
2240
|
}
|
|
2241
2241
|
if (typeof (o == null ? void 0 : o.schema) == "object") {
|
|
2242
|
-
if (o.validate ||
|
|
2242
|
+
if (o.validate || Dr.call(this, o), a === (0, ge.normalizeId)(t)) {
|
|
2243
2243
|
const { schema: i } = o, { schemaId: d } = this.opts, c = i[d];
|
|
2244
|
-
return c && (s = (0,
|
|
2244
|
+
return c && (s = (0, ge.resolveUrl)(this.opts.uriResolver, s, c)), new Kt({ schema: i, schemaId: d, root: e, baseId: s });
|
|
2245
2245
|
}
|
|
2246
2246
|
return mr.call(this, n, o);
|
|
2247
2247
|
}
|
|
2248
2248
|
}
|
|
2249
|
-
|
|
2249
|
+
ue.resolveSchema = Bt;
|
|
2250
2250
|
const pi = /* @__PURE__ */ new Set([
|
|
2251
2251
|
"properties",
|
|
2252
2252
|
"patternProperties",
|
|
@@ -2266,11 +2266,11 @@ function mr(e, { baseId: t, schema: n, root: r }) {
|
|
|
2266
2266
|
return;
|
|
2267
2267
|
n = d;
|
|
2268
2268
|
const c = typeof n == "object" && n[this.opts.schemaId];
|
|
2269
|
-
!pi.has(i) && c && (t = (0,
|
|
2269
|
+
!pi.has(i) && c && (t = (0, ge.resolveUrl)(this.opts.uriResolver, t, c));
|
|
2270
2270
|
}
|
|
2271
2271
|
let a;
|
|
2272
2272
|
if (typeof n != "boolean" && n.$ref && !(0, Nn.schemaHasRulesButRef)(n, this.RULES)) {
|
|
2273
|
-
const i = (0,
|
|
2273
|
+
const i = (0, ge.resolveUrl)(this.opts.uriResolver, t, n.$ref);
|
|
2274
2274
|
a = Bt.call(this, r, i);
|
|
2275
2275
|
}
|
|
2276
2276
|
const { schemaId: o } = this.opts;
|
|
@@ -2299,7 +2299,7 @@ const yi = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/
|
|
|
2299
2299
|
properties: bi,
|
|
2300
2300
|
additionalProperties: $i
|
|
2301
2301
|
};
|
|
2302
|
-
var
|
|
2302
|
+
var Cr = {}, Gt = { exports: {} };
|
|
2303
2303
|
const ki = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu), Is = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
2304
2304
|
function Ns(e) {
|
|
2305
2305
|
let t = "", n = 0, r = 0;
|
|
@@ -2466,7 +2466,7 @@ function Rs(e) {
|
|
|
2466
2466
|
function As(e) {
|
|
2467
2467
|
return e.host || (e.error = e.error || "HTTP URIs must have a host."), e;
|
|
2468
2468
|
}
|
|
2469
|
-
function
|
|
2469
|
+
function Fs(e) {
|
|
2470
2470
|
const t = String(e.scheme).toLowerCase() === "https";
|
|
2471
2471
|
return (e.port === (t ? 443 : 80) || e.port === "") && (e.port = void 0), e.path || (e.path = "/"), e;
|
|
2472
2472
|
}
|
|
@@ -2493,7 +2493,7 @@ function Ai(e, t) {
|
|
|
2493
2493
|
e.error = e.error || "URN can not be parsed.";
|
|
2494
2494
|
return e;
|
|
2495
2495
|
}
|
|
2496
|
-
function
|
|
2496
|
+
function Fi(e, t) {
|
|
2497
2497
|
if (e.nid === void 0)
|
|
2498
2498
|
throw new Error("URN without nid cannot be serialized");
|
|
2499
2499
|
const n = t.scheme || e.scheme || "urn", r = e.nid.toLowerCase(), s = `${n}:${t.nid || r}`, a = Vr(s);
|
|
@@ -2501,29 +2501,29 @@ function Ci(e, t) {
|
|
|
2501
2501
|
const o = e, i = e.nss;
|
|
2502
2502
|
return o.path = `${r || t.nid}:${i}`, t.skipEscape = !0, o;
|
|
2503
2503
|
}
|
|
2504
|
-
function
|
|
2504
|
+
function Di(e, t) {
|
|
2505
2505
|
const n = e;
|
|
2506
2506
|
return n.uuid = n.nss, n.nss = void 0, !t.tolerant && (!n.uuid || !Ni(n.uuid)) && (n.error = n.error || "UUID is not valid."), n;
|
|
2507
2507
|
}
|
|
2508
|
-
function
|
|
2508
|
+
function Ci(e) {
|
|
2509
2509
|
const t = e;
|
|
2510
2510
|
return t.nss = (e.uuid || "").toLowerCase(), t;
|
|
2511
2511
|
}
|
|
2512
|
-
const
|
|
2512
|
+
const Ds = (
|
|
2513
2513
|
/** @type {SchemeHandler} */
|
|
2514
2514
|
{
|
|
2515
2515
|
scheme: "http",
|
|
2516
2516
|
domainHost: !0,
|
|
2517
2517
|
parse: As,
|
|
2518
|
-
serialize:
|
|
2518
|
+
serialize: Fs
|
|
2519
2519
|
}
|
|
2520
2520
|
), Vi = (
|
|
2521
2521
|
/** @type {SchemeHandler} */
|
|
2522
2522
|
{
|
|
2523
2523
|
scheme: "https",
|
|
2524
|
-
domainHost:
|
|
2524
|
+
domainHost: Ds.domainHost,
|
|
2525
2525
|
parse: As,
|
|
2526
|
-
serialize:
|
|
2526
|
+
serialize: Fs
|
|
2527
2527
|
}
|
|
2528
2528
|
), Tt = (
|
|
2529
2529
|
/** @type {SchemeHandler} */
|
|
@@ -2546,21 +2546,21 @@ const Fs = (
|
|
|
2546
2546
|
{
|
|
2547
2547
|
scheme: "urn",
|
|
2548
2548
|
parse: Ai,
|
|
2549
|
-
serialize:
|
|
2549
|
+
serialize: Fi,
|
|
2550
2550
|
skipNormalize: !0
|
|
2551
2551
|
}
|
|
2552
2552
|
), Li = (
|
|
2553
2553
|
/** @type {SchemeHandler} */
|
|
2554
2554
|
{
|
|
2555
2555
|
scheme: "urn:uuid",
|
|
2556
|
-
parse:
|
|
2557
|
-
serialize:
|
|
2556
|
+
parse: Di,
|
|
2557
|
+
serialize: Ci,
|
|
2558
2558
|
skipNormalize: !0
|
|
2559
2559
|
}
|
|
2560
|
-
),
|
|
2560
|
+
), Ct = (
|
|
2561
2561
|
/** @type {Record<SchemeName, SchemeHandler>} */
|
|
2562
2562
|
{
|
|
2563
|
-
http:
|
|
2563
|
+
http: Ds,
|
|
2564
2564
|
https: Vi,
|
|
2565
2565
|
ws: Tt,
|
|
2566
2566
|
wss: zi,
|
|
@@ -2568,21 +2568,21 @@ const Fs = (
|
|
|
2568
2568
|
"urn:uuid": Li
|
|
2569
2569
|
}
|
|
2570
2570
|
);
|
|
2571
|
-
Object.setPrototypeOf(
|
|
2571
|
+
Object.setPrototypeOf(Ct, null);
|
|
2572
2572
|
function Vr(e) {
|
|
2573
|
-
return e && (
|
|
2573
|
+
return e && (Ct[
|
|
2574
2574
|
/** @type {SchemeName} */
|
|
2575
2575
|
e
|
|
2576
|
-
] ||
|
|
2576
|
+
] || Ct[
|
|
2577
2577
|
/** @type {SchemeName} */
|
|
2578
2578
|
e.toLowerCase()
|
|
2579
2579
|
]) || void 0;
|
|
2580
2580
|
}
|
|
2581
2581
|
var Hi = {
|
|
2582
|
-
SCHEMES:
|
|
2582
|
+
SCHEMES: Ct,
|
|
2583
2583
|
getSchemeHandler: Vr
|
|
2584
2584
|
};
|
|
2585
|
-
const { normalizeIPv6: Ki, removeDotSegments:
|
|
2585
|
+
const { normalizeIPv6: Ki, removeDotSegments: dt, recomposeAuthority: Bi, normalizeComponentEncoding: Pt, isIPv4: Gi, nonSimpleDomain: Ji } = Ts, { SCHEMES: xi, getSchemeHandler: Cs } = Hi;
|
|
2586
2586
|
function Wi(e, t) {
|
|
2587
2587
|
return typeof e == "string" ? e = /** @type {T} */
|
|
2588
2588
|
Pe(Te(e, t), t) : typeof e == "object" && (e = /** @type {T} */
|
|
@@ -2594,7 +2594,7 @@ function Zi(e, t, n) {
|
|
|
2594
2594
|
}
|
|
2595
2595
|
function Vs(e, t, n, r) {
|
|
2596
2596
|
const s = {};
|
|
2597
|
-
return r || (e = Te(Pe(e, n), n), t = Te(Pe(t, n), n)), n = n || {}, !n.tolerant && t.scheme ? (s.scheme = t.scheme, s.userinfo = t.userinfo, s.host = t.host, s.port = t.port, s.path =
|
|
2597
|
+
return r || (e = Te(Pe(e, n), n), t = Te(Pe(t, n), n)), n = n || {}, !n.tolerant && t.scheme ? (s.scheme = t.scheme, s.userinfo = t.userinfo, s.host = t.host, s.port = t.port, s.path = dt(t.path || ""), s.query = t.query) : (t.userinfo !== void 0 || t.host !== void 0 || t.port !== void 0 ? (s.userinfo = t.userinfo, s.host = t.host, s.port = t.port, s.path = dt(t.path || ""), s.query = t.query) : (t.path ? (t.path[0] === "/" ? s.path = dt(t.path) : ((e.userinfo !== void 0 || e.host !== void 0 || e.port !== void 0) && !e.path ? s.path = "/" + t.path : e.path ? s.path = e.path.slice(0, e.path.lastIndexOf("/") + 1) + t.path : s.path = t.path, s.path = dt(s.path)), s.query = t.query) : (s.path = e.path, t.query !== void 0 ? s.query = t.query : s.query = e.query), s.userinfo = e.userinfo, s.host = e.host, s.port = e.port), s.scheme = e.scheme), s.fragment = t.fragment, s;
|
|
2598
2598
|
}
|
|
2599
2599
|
function Yi(e, t, n) {
|
|
2600
2600
|
return typeof e == "string" ? (e = unescape(e), e = Pe(Pt(Te(e, n), !0), { ...n, skipEscape: !0 })) : typeof e == "object" && (e = Pe(Pt(e, !0), { ...n, skipEscape: !0 })), typeof t == "string" ? (t = unescape(t), t = Pe(Pt(Te(t, n), !0), { ...n, skipEscape: !0 })) : typeof t == "object" && (t = Pe(Pt(t, !0), { ...n, skipEscape: !0 })), e.toLowerCase() === t.toLowerCase();
|
|
@@ -2615,12 +2615,12 @@ function Pe(e, t) {
|
|
|
2615
2615
|
resourceName: e.resourceName,
|
|
2616
2616
|
secure: e.secure,
|
|
2617
2617
|
error: ""
|
|
2618
|
-
}, r = Object.assign({}, t), s = [], a =
|
|
2618
|
+
}, r = Object.assign({}, t), s = [], a = Cs(r.scheme || n.scheme);
|
|
2619
2619
|
a && a.serialize && a.serialize(n, r), n.path !== void 0 && (r.skipEscape ? n.path = unescape(n.path) : (n.path = escape(n.path), n.scheme !== void 0 && (n.path = n.path.split("%3A").join(":")))), r.reference !== "suffix" && n.scheme && s.push(n.scheme, ":");
|
|
2620
2620
|
const o = Bi(n);
|
|
2621
2621
|
if (o !== void 0 && (r.reference !== "suffix" && s.push("//"), s.push(o), n.path && n.path[0] !== "/" && s.push("/")), n.path !== void 0) {
|
|
2622
2622
|
let i = n.path;
|
|
2623
|
-
!r.absolutePath && (!a || !a.absolutePath) && (i =
|
|
2623
|
+
!r.absolutePath && (!a || !a.absolutePath) && (i = dt(i)), o === void 0 && i[0] === "/" && i[1] === "/" && (i = "/%2F" + i.slice(2)), s.push(i);
|
|
2624
2624
|
}
|
|
2625
2625
|
return n.query !== void 0 && s.push("?", n.query), n.fragment !== void 0 && s.push("#", n.fragment), s.join("");
|
|
2626
2626
|
}
|
|
@@ -2646,7 +2646,7 @@ function Te(e, t) {
|
|
|
2646
2646
|
} else
|
|
2647
2647
|
s = !0;
|
|
2648
2648
|
r.scheme === void 0 && r.userinfo === void 0 && r.host === void 0 && r.port === void 0 && r.query === void 0 && !r.path ? r.reference = "same-document" : r.scheme === void 0 ? r.reference = "relative" : r.fragment === void 0 ? r.reference = "absolute" : r.reference = "uri", n.reference && n.reference !== "suffix" && n.reference !== r.reference && (r.error = r.error || "URI is not a " + n.reference + " reference.");
|
|
2649
|
-
const o =
|
|
2649
|
+
const o = Cs(n.scheme || r.scheme);
|
|
2650
2650
|
if (!n.unicodeSupport && (!o || !o.unicodeSupport) && r.host && (n.domainHost || o && o.domainHost) && s === !1 && Ji(r.host))
|
|
2651
2651
|
try {
|
|
2652
2652
|
r.host = URL.domainToASCII(r.host.toLowerCase());
|
|
@@ -2671,17 +2671,17 @@ Gt.exports = zr;
|
|
|
2671
2671
|
Gt.exports.default = zr;
|
|
2672
2672
|
Gt.exports.fastUri = zr;
|
|
2673
2673
|
var Xi = Gt.exports;
|
|
2674
|
-
Object.defineProperty(
|
|
2674
|
+
Object.defineProperty(Cr, "__esModule", { value: !0 });
|
|
2675
2675
|
const zs = Xi;
|
|
2676
2676
|
zs.code = 'require("ajv/dist/runtime/uri").default';
|
|
2677
|
-
|
|
2677
|
+
Cr.default = zs;
|
|
2678
2678
|
(function(e) {
|
|
2679
2679
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = void 0;
|
|
2680
|
-
var t =
|
|
2680
|
+
var t = be;
|
|
2681
2681
|
Object.defineProperty(e, "KeywordCxt", { enumerable: !0, get: function() {
|
|
2682
2682
|
return t.KeywordCxt;
|
|
2683
2683
|
} });
|
|
2684
|
-
var n =
|
|
2684
|
+
var n = K;
|
|
2685
2685
|
Object.defineProperty(e, "_", { enumerable: !0, get: function() {
|
|
2686
2686
|
return n._;
|
|
2687
2687
|
} }), Object.defineProperty(e, "str", { enumerable: !0, get: function() {
|
|
@@ -2695,7 +2695,7 @@ Dr.default = zs;
|
|
|
2695
2695
|
} }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
|
|
2696
2696
|
return n.CodeGen;
|
|
2697
2697
|
} });
|
|
2698
|
-
const r =
|
|
2698
|
+
const r = bt, s = rt, a = Ke, o = ue, i = K, d = ie, c = ne, u = N, m = wi, b = Cr, $ = (q, _) => new RegExp(q, _);
|
|
2699
2699
|
$.code = "new RegExp";
|
|
2700
2700
|
const v = ["removeAdditional", "useDefaults", "coerceTypes"], g = /* @__PURE__ */ new Set([
|
|
2701
2701
|
"validate",
|
|
@@ -2733,14 +2733,14 @@ Dr.default = zs;
|
|
|
2733
2733
|
unicode: '"minLength"/"maxLength" account for unicode characters by default.'
|
|
2734
2734
|
}, y = 200;
|
|
2735
2735
|
function k(q) {
|
|
2736
|
-
var _, P, w, l, h,
|
|
2737
|
-
const
|
|
2736
|
+
var _, P, w, l, h, E, F, C, Z, W, se, Ge, Yt, Qt, Xt, er, tr, rr, nr, sr, ar, or, ir, lr, dr;
|
|
2737
|
+
const ot = q.strict, cr = (_ = q.code) === null || _ === void 0 ? void 0 : _.optimize, gn = cr === !0 || cr === void 0 ? 1 : cr || 0, bn = (w = (P = q.code) === null || P === void 0 ? void 0 : P.regExp) !== null && w !== void 0 ? w : $, Xs = (l = q.uriResolver) !== null && l !== void 0 ? l : b.default;
|
|
2738
2738
|
return {
|
|
2739
|
-
strictSchema: (
|
|
2740
|
-
strictNumbers: (
|
|
2741
|
-
strictTypes: (
|
|
2742
|
-
strictTuples: (
|
|
2743
|
-
strictRequired: (Qt = (Yt = q.strictRequired) !== null && Yt !== void 0 ? Yt :
|
|
2739
|
+
strictSchema: (E = (h = q.strictSchema) !== null && h !== void 0 ? h : ot) !== null && E !== void 0 ? E : !0,
|
|
2740
|
+
strictNumbers: (C = (F = q.strictNumbers) !== null && F !== void 0 ? F : ot) !== null && C !== void 0 ? C : !0,
|
|
2741
|
+
strictTypes: (W = (Z = q.strictTypes) !== null && Z !== void 0 ? Z : ot) !== null && W !== void 0 ? W : "log",
|
|
2742
|
+
strictTuples: (Ge = (se = q.strictTuples) !== null && se !== void 0 ? se : ot) !== null && Ge !== void 0 ? Ge : "log",
|
|
2743
|
+
strictRequired: (Qt = (Yt = q.strictRequired) !== null && Yt !== void 0 ? Yt : ot) !== null && Qt !== void 0 ? Qt : !1,
|
|
2744
2744
|
code: q.code ? { ...q.code, optimize: gn, regExp: bn } : { optimize: gn, regExp: bn },
|
|
2745
2745
|
loopRequired: (Xt = q.loopRequired) !== null && Xt !== void 0 ? Xt : y,
|
|
2746
2746
|
loopEnum: (er = q.loopEnum) !== null && er !== void 0 ? er : y,
|
|
@@ -2756,13 +2756,13 @@ Dr.default = zs;
|
|
|
2756
2756
|
uriResolver: Xs
|
|
2757
2757
|
};
|
|
2758
2758
|
}
|
|
2759
|
-
class
|
|
2759
|
+
class S {
|
|
2760
2760
|
constructor(_ = {}) {
|
|
2761
2761
|
this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), _ = this.opts = { ..._, ...k(_) };
|
|
2762
2762
|
const { es5: P, lines: w } = this.opts.code;
|
|
2763
|
-
this.scope = new i.ValueScope({ scope: {}, prefixes: g, es5: P, lines: w }), this.logger =
|
|
2763
|
+
this.scope = new i.ValueScope({ scope: {}, prefixes: g, es5: P, lines: w }), this.logger = T(_.logger);
|
|
2764
2764
|
const l = _.validateFormats;
|
|
2765
|
-
_.validateFormats = !1, this.RULES = (0, a.getRules)(), O.call(this, p, _, "NOT SUPPORTED"), O.call(this, f, _, "DEPRECATED", "warn"), this._metaOpts = z.call(this), _.formats && M.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), _.keywords &&
|
|
2765
|
+
_.validateFormats = !1, this.RULES = (0, a.getRules)(), O.call(this, p, _, "NOT SUPPORTED"), O.call(this, f, _, "DEPRECATED", "warn"), this._metaOpts = z.call(this), _.formats && M.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), _.keywords && R.call(this, _.keywords), typeof _.meta == "object" && this.addMetaSchema(_.meta), G.call(this), _.validateFormats = l;
|
|
2766
2766
|
}
|
|
2767
2767
|
_addVocabularies() {
|
|
2768
2768
|
this.addKeyword("$async");
|
|
@@ -2795,54 +2795,54 @@ Dr.default = zs;
|
|
|
2795
2795
|
throw new Error("options.loadSchema should be a function");
|
|
2796
2796
|
const { loadSchema: w } = this.opts;
|
|
2797
2797
|
return l.call(this, _, P);
|
|
2798
|
-
async function l(
|
|
2799
|
-
await h.call(this,
|
|
2800
|
-
const
|
|
2801
|
-
return
|
|
2798
|
+
async function l(W, se) {
|
|
2799
|
+
await h.call(this, W.$schema);
|
|
2800
|
+
const Ge = this._addSchema(W, se);
|
|
2801
|
+
return Ge.validate || E.call(this, Ge);
|
|
2802
2802
|
}
|
|
2803
|
-
async function h(
|
|
2804
|
-
|
|
2803
|
+
async function h(W) {
|
|
2804
|
+
W && !this.getSchema(W) && await l.call(this, { $ref: W }, !0);
|
|
2805
2805
|
}
|
|
2806
|
-
async function
|
|
2806
|
+
async function E(W) {
|
|
2807
2807
|
try {
|
|
2808
|
-
return this._compileSchemaEnv(
|
|
2809
|
-
} catch (
|
|
2810
|
-
if (!(
|
|
2811
|
-
throw
|
|
2812
|
-
return
|
|
2808
|
+
return this._compileSchemaEnv(W);
|
|
2809
|
+
} catch (se) {
|
|
2810
|
+
if (!(se instanceof s.default))
|
|
2811
|
+
throw se;
|
|
2812
|
+
return F.call(this, se), await C.call(this, se.missingSchema), E.call(this, W);
|
|
2813
2813
|
}
|
|
2814
2814
|
}
|
|
2815
|
-
function
|
|
2816
|
-
if (this.refs[
|
|
2817
|
-
throw new Error(`AnySchema ${
|
|
2815
|
+
function F({ missingSchema: W, missingRef: se }) {
|
|
2816
|
+
if (this.refs[W])
|
|
2817
|
+
throw new Error(`AnySchema ${W} is loaded but ${se} cannot be resolved`);
|
|
2818
2818
|
}
|
|
2819
|
-
async function
|
|
2820
|
-
const
|
|
2821
|
-
this.refs[
|
|
2819
|
+
async function C(W) {
|
|
2820
|
+
const se = await Z.call(this, W);
|
|
2821
|
+
this.refs[W] || await h.call(this, se.$schema), this.refs[W] || this.addSchema(se, W, P);
|
|
2822
2822
|
}
|
|
2823
|
-
async function
|
|
2824
|
-
const
|
|
2825
|
-
if (
|
|
2826
|
-
return
|
|
2823
|
+
async function Z(W) {
|
|
2824
|
+
const se = this._loading[W];
|
|
2825
|
+
if (se)
|
|
2826
|
+
return se;
|
|
2827
2827
|
try {
|
|
2828
|
-
return await (this._loading[
|
|
2828
|
+
return await (this._loading[W] = w(W));
|
|
2829
2829
|
} finally {
|
|
2830
|
-
delete this._loading[
|
|
2830
|
+
delete this._loading[W];
|
|
2831
2831
|
}
|
|
2832
2832
|
}
|
|
2833
2833
|
}
|
|
2834
2834
|
// Adds schema to the instance
|
|
2835
2835
|
addSchema(_, P, w, l = this.opts.validateSchema) {
|
|
2836
2836
|
if (Array.isArray(_)) {
|
|
2837
|
-
for (const
|
|
2838
|
-
this.addSchema(
|
|
2837
|
+
for (const E of _)
|
|
2838
|
+
this.addSchema(E, void 0, w, l);
|
|
2839
2839
|
return this;
|
|
2840
2840
|
}
|
|
2841
2841
|
let h;
|
|
2842
2842
|
if (typeof _ == "object") {
|
|
2843
|
-
const { schemaId:
|
|
2844
|
-
if (h = _[
|
|
2845
|
-
throw new Error(`schema ${
|
|
2843
|
+
const { schemaId: E } = this.opts;
|
|
2844
|
+
if (h = _[E], h !== void 0 && typeof h != "string")
|
|
2845
|
+
throw new Error(`schema ${E} must be string`);
|
|
2846
2846
|
}
|
|
2847
2847
|
return P = (0, d.normalizeId)(P || h), this._checkUnique(P), this.schemas[P] = this._addSchema(_, w, P, l, !0), this;
|
|
2848
2848
|
}
|
|
@@ -2874,7 +2874,7 @@ Dr.default = zs;
|
|
|
2874
2874
|
// (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
|
|
2875
2875
|
getSchema(_) {
|
|
2876
2876
|
let P;
|
|
2877
|
-
for (; typeof (P =
|
|
2877
|
+
for (; typeof (P = U.call(this, _)) == "string"; )
|
|
2878
2878
|
_ = P;
|
|
2879
2879
|
if (P === void 0) {
|
|
2880
2880
|
const { schemaId: w } = this.opts, l = new o.SchemaEnv({ schema: {}, schemaId: w });
|
|
@@ -2895,7 +2895,7 @@ Dr.default = zs;
|
|
|
2895
2895
|
case "undefined":
|
|
2896
2896
|
return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this;
|
|
2897
2897
|
case "string": {
|
|
2898
|
-
const P =
|
|
2898
|
+
const P = U.call(this, _);
|
|
2899
2899
|
return typeof P == "object" && this._cache.delete(P.schema), delete this.schemas[_], delete this.refs[_], this;
|
|
2900
2900
|
}
|
|
2901
2901
|
case "object": {
|
|
@@ -2923,15 +2923,15 @@ Dr.default = zs;
|
|
|
2923
2923
|
throw new Error("addKeywords: keyword must be string or non-empty array");
|
|
2924
2924
|
} else
|
|
2925
2925
|
throw new Error("invalid addKeywords parameters");
|
|
2926
|
-
if (
|
|
2927
|
-
return (0, u.eachItem)(w, (h) =>
|
|
2926
|
+
if (re.call(this, w, P), !P)
|
|
2927
|
+
return (0, u.eachItem)(w, (h) => ke.call(this, h)), this;
|
|
2928
2928
|
Wt.call(this, P);
|
|
2929
2929
|
const l = {
|
|
2930
2930
|
...P,
|
|
2931
2931
|
type: (0, c.getJSONTypes)(P.type),
|
|
2932
2932
|
schemaType: (0, c.getJSONTypes)(P.schemaType)
|
|
2933
2933
|
};
|
|
2934
|
-
return (0, u.eachItem)(w, l.type.length === 0 ? (h) =>
|
|
2934
|
+
return (0, u.eachItem)(w, l.type.length === 0 ? (h) => ke.call(this, h, l) : (h) => l.type.forEach((E) => ke.call(this, h, l, E))), this;
|
|
2935
2935
|
}
|
|
2936
2936
|
getKeyword(_) {
|
|
2937
2937
|
const P = this.RULES.all[_];
|
|
@@ -2959,15 +2959,15 @@ Dr.default = zs;
|
|
|
2959
2959
|
_ = JSON.parse(JSON.stringify(_));
|
|
2960
2960
|
for (const l of P) {
|
|
2961
2961
|
const h = l.split("/").slice(1);
|
|
2962
|
-
let
|
|
2963
|
-
for (const
|
|
2964
|
-
|
|
2965
|
-
for (const
|
|
2966
|
-
const
|
|
2967
|
-
if (typeof
|
|
2962
|
+
let E = _;
|
|
2963
|
+
for (const F of h)
|
|
2964
|
+
E = E[F];
|
|
2965
|
+
for (const F in w) {
|
|
2966
|
+
const C = w[F];
|
|
2967
|
+
if (typeof C != "object")
|
|
2968
2968
|
continue;
|
|
2969
|
-
const { $data:
|
|
2970
|
-
|
|
2969
|
+
const { $data: Z } = C.definition, W = E[F];
|
|
2970
|
+
Z && W && (E[F] = St(W));
|
|
2971
2971
|
}
|
|
2972
2972
|
}
|
|
2973
2973
|
return _;
|
|
@@ -2979,22 +2979,22 @@ Dr.default = zs;
|
|
|
2979
2979
|
}
|
|
2980
2980
|
}
|
|
2981
2981
|
_addSchema(_, P, w, l = this.opts.validateSchema, h = this.opts.addUsedSchema) {
|
|
2982
|
-
let
|
|
2983
|
-
const { schemaId:
|
|
2982
|
+
let E;
|
|
2983
|
+
const { schemaId: F } = this.opts;
|
|
2984
2984
|
if (typeof _ == "object")
|
|
2985
|
-
|
|
2985
|
+
E = _[F];
|
|
2986
2986
|
else {
|
|
2987
2987
|
if (this.opts.jtd)
|
|
2988
2988
|
throw new Error("schema must be object");
|
|
2989
2989
|
if (typeof _ != "boolean")
|
|
2990
2990
|
throw new Error("schema must be object or boolean");
|
|
2991
2991
|
}
|
|
2992
|
-
let
|
|
2993
|
-
if (
|
|
2994
|
-
return
|
|
2995
|
-
w = (0, d.normalizeId)(
|
|
2996
|
-
const
|
|
2997
|
-
return
|
|
2992
|
+
let C = this._cache.get(_);
|
|
2993
|
+
if (C !== void 0)
|
|
2994
|
+
return C;
|
|
2995
|
+
w = (0, d.normalizeId)(E || w);
|
|
2996
|
+
const Z = d.getSchemaRefs.call(this, _, w);
|
|
2997
|
+
return C = new o.SchemaEnv({ schema: _, schemaId: F, meta: P, baseId: w, localRefs: Z }), this._cache.set(C.schema, C), h && !w.startsWith("#") && (w && this._checkUnique(w), this.refs[w] = C), l && this.validateSchema(_, !0), C;
|
|
2998
2998
|
}
|
|
2999
2999
|
_checkUnique(_) {
|
|
3000
3000
|
if (this.schemas[_] || this.refs[_])
|
|
@@ -3015,17 +3015,17 @@ Dr.default = zs;
|
|
|
3015
3015
|
}
|
|
3016
3016
|
}
|
|
3017
3017
|
}
|
|
3018
|
-
|
|
3018
|
+
S.ValidationError = r.default, S.MissingRefError = s.default, e.default = S;
|
|
3019
3019
|
function O(q, _, P, w = "error") {
|
|
3020
3020
|
for (const l in q) {
|
|
3021
3021
|
const h = l;
|
|
3022
3022
|
h in _ && this.logger[w](`${P}: option ${l}. ${q[h]}`);
|
|
3023
3023
|
}
|
|
3024
3024
|
}
|
|
3025
|
-
function
|
|
3025
|
+
function U(q) {
|
|
3026
3026
|
return q = (0, d.normalizeId)(q), this.schemas[q] || this.refs[q];
|
|
3027
3027
|
}
|
|
3028
|
-
function
|
|
3028
|
+
function G() {
|
|
3029
3029
|
const q = this.opts.schemas;
|
|
3030
3030
|
if (q)
|
|
3031
3031
|
if (Array.isArray(q))
|
|
@@ -3040,7 +3040,7 @@ Dr.default = zs;
|
|
|
3040
3040
|
_ && this.addFormat(q, _);
|
|
3041
3041
|
}
|
|
3042
3042
|
}
|
|
3043
|
-
function
|
|
3043
|
+
function R(q) {
|
|
3044
3044
|
if (Array.isArray(q)) {
|
|
3045
3045
|
this.addVocabulary(q);
|
|
3046
3046
|
return;
|
|
@@ -3057,40 +3057,40 @@ Dr.default = zs;
|
|
|
3057
3057
|
delete q[_];
|
|
3058
3058
|
return q;
|
|
3059
3059
|
}
|
|
3060
|
-
const
|
|
3060
|
+
const x = { log() {
|
|
3061
3061
|
}, warn() {
|
|
3062
3062
|
}, error() {
|
|
3063
3063
|
} };
|
|
3064
|
-
function
|
|
3064
|
+
function T(q) {
|
|
3065
3065
|
if (q === !1)
|
|
3066
|
-
return
|
|
3066
|
+
return x;
|
|
3067
3067
|
if (q === void 0)
|
|
3068
3068
|
return console;
|
|
3069
3069
|
if (q.log && q.warn && q.error)
|
|
3070
3070
|
return q;
|
|
3071
3071
|
throw new Error("logger must implement log, warn and error methods");
|
|
3072
3072
|
}
|
|
3073
|
-
const
|
|
3074
|
-
function
|
|
3073
|
+
const X = /^[a-z_$][a-z0-9_$:-]*$/i;
|
|
3074
|
+
function re(q, _) {
|
|
3075
3075
|
const { RULES: P } = this;
|
|
3076
3076
|
if ((0, u.eachItem)(q, (w) => {
|
|
3077
3077
|
if (P.keywords[w])
|
|
3078
3078
|
throw new Error(`Keyword ${w} is already defined`);
|
|
3079
|
-
if (!
|
|
3079
|
+
if (!X.test(w))
|
|
3080
3080
|
throw new Error(`Keyword ${w} has invalid name`);
|
|
3081
3081
|
}), !!_ && _.$data && !("code" in _ || "validate" in _))
|
|
3082
3082
|
throw new Error('$data keyword must have "code" or "validate" function');
|
|
3083
3083
|
}
|
|
3084
|
-
function
|
|
3084
|
+
function ke(q, _, P) {
|
|
3085
3085
|
var w;
|
|
3086
3086
|
const l = _ == null ? void 0 : _.post;
|
|
3087
3087
|
if (P && l)
|
|
3088
3088
|
throw new Error('keyword with "post" flag cannot have "type"');
|
|
3089
3089
|
const { RULES: h } = this;
|
|
3090
|
-
let
|
|
3091
|
-
if (
|
|
3090
|
+
let E = l ? h.post : h.rules.find(({ type: C }) => C === P);
|
|
3091
|
+
if (E || (E = { type: P, rules: [] }, h.rules.push(E)), h.keywords[q] = !0, !_)
|
|
3092
3092
|
return;
|
|
3093
|
-
const
|
|
3093
|
+
const F = {
|
|
3094
3094
|
keyword: q,
|
|
3095
3095
|
definition: {
|
|
3096
3096
|
..._,
|
|
@@ -3098,9 +3098,9 @@ Dr.default = zs;
|
|
|
3098
3098
|
schemaType: (0, c.getJSONTypes)(_.schemaType)
|
|
3099
3099
|
}
|
|
3100
3100
|
};
|
|
3101
|
-
_.before ?
|
|
3101
|
+
_.before ? kt.call(this, E, F, _.before) : E.rules.push(F), h.all[q] = F, (w = _.implements) === null || w === void 0 || w.forEach((C) => this.addKeyword(C));
|
|
3102
3102
|
}
|
|
3103
|
-
function
|
|
3103
|
+
function kt(q, _, P) {
|
|
3104
3104
|
const w = q.rules.findIndex((l) => l.keyword === P);
|
|
3105
3105
|
w >= 0 ? q.rules.splice(w, 0, _) : (q.rules.push(_), this.logger.warn(`rule ${P} is not defined`));
|
|
3106
3106
|
}
|
|
@@ -3124,10 +3124,10 @@ const el = {
|
|
|
3124
3124
|
}
|
|
3125
3125
|
};
|
|
3126
3126
|
Hr.default = el;
|
|
3127
|
-
var
|
|
3128
|
-
Object.defineProperty(
|
|
3129
|
-
|
|
3130
|
-
const tl =
|
|
3127
|
+
var Be = {};
|
|
3128
|
+
Object.defineProperty(Be, "__esModule", { value: !0 });
|
|
3129
|
+
Be.callRef = Be.getValidate = void 0;
|
|
3130
|
+
const tl = rt, Tn = J, ce = K, xe = qe, Rn = ue, Ot = N, rl = {
|
|
3131
3131
|
keyword: "$ref",
|
|
3132
3132
|
schemaType: "string",
|
|
3133
3133
|
code(e) {
|
|
@@ -3144,17 +3144,17 @@ const tl = nt, Tn = J, ue = B, We = qe, Rn = fe, Ot = N, rl = {
|
|
|
3144
3144
|
if (a === c)
|
|
3145
3145
|
return Rt(e, o, a, a.$async);
|
|
3146
3146
|
const v = t.scopeValue("root", { ref: c });
|
|
3147
|
-
return Rt(e, (0,
|
|
3147
|
+
return Rt(e, (0, ce._)`${v}.validate`, c, c.$async);
|
|
3148
3148
|
}
|
|
3149
3149
|
function b(v) {
|
|
3150
3150
|
const g = Us(e, v);
|
|
3151
3151
|
Rt(e, g, v, v.$async);
|
|
3152
3152
|
}
|
|
3153
3153
|
function $(v) {
|
|
3154
|
-
const g = t.scopeValue("schema", i.code.source === !0 ? { ref: v, code: (0,
|
|
3154
|
+
const g = t.scopeValue("schema", i.code.source === !0 ? { ref: v, code: (0, ce.stringify)(v) } : { ref: v }), p = t.name("valid"), f = e.subschema({
|
|
3155
3155
|
schema: v,
|
|
3156
3156
|
dataTypes: [],
|
|
3157
|
-
schemaPath:
|
|
3157
|
+
schemaPath: ce.nil,
|
|
3158
3158
|
topSchemaRef: g,
|
|
3159
3159
|
errSchemaPath: n
|
|
3160
3160
|
}, p);
|
|
@@ -3164,28 +3164,28 @@ const tl = nt, Tn = J, ue = B, We = qe, Rn = fe, Ot = N, rl = {
|
|
|
3164
3164
|
};
|
|
3165
3165
|
function Us(e, t) {
|
|
3166
3166
|
const { gen: n } = e;
|
|
3167
|
-
return t.validate ? n.scopeValue("validate", { ref: t.validate }) : (0,
|
|
3167
|
+
return t.validate ? n.scopeValue("validate", { ref: t.validate }) : (0, ce._)`${n.scopeValue("wrapper", { ref: t })}.validate`;
|
|
3168
3168
|
}
|
|
3169
|
-
|
|
3169
|
+
Be.getValidate = Us;
|
|
3170
3170
|
function Rt(e, t, n, r) {
|
|
3171
|
-
const { gen: s, it: a } = e, { allErrors: o, schemaEnv: i, opts: d } = a, c = d.passContext ?
|
|
3171
|
+
const { gen: s, it: a } = e, { allErrors: o, schemaEnv: i, opts: d } = a, c = d.passContext ? xe.default.this : ce.nil;
|
|
3172
3172
|
r ? u() : m();
|
|
3173
3173
|
function u() {
|
|
3174
3174
|
if (!i.$async)
|
|
3175
3175
|
throw new Error("async schema referenced by sync schema");
|
|
3176
3176
|
const v = s.let("valid");
|
|
3177
3177
|
s.try(() => {
|
|
3178
|
-
s.code((0,
|
|
3178
|
+
s.code((0, ce._)`await ${(0, Tn.callValidateCode)(e, t, c)}`), $(t), o || s.assign(v, !0);
|
|
3179
3179
|
}, (g) => {
|
|
3180
|
-
s.if((0,
|
|
3180
|
+
s.if((0, ce._)`!(${g} instanceof ${a.ValidationError})`, () => s.throw(g)), b(g), o || s.assign(v, !1);
|
|
3181
3181
|
}), e.ok(v);
|
|
3182
3182
|
}
|
|
3183
3183
|
function m() {
|
|
3184
3184
|
e.result((0, Tn.callValidateCode)(e, t, c), () => $(t), () => b(t));
|
|
3185
3185
|
}
|
|
3186
3186
|
function b(v) {
|
|
3187
|
-
const g = (0,
|
|
3188
|
-
s.assign(
|
|
3187
|
+
const g = (0, ce._)`${v}.errors`;
|
|
3188
|
+
s.assign(xe.default.vErrors, (0, ce._)`${xe.default.vErrors} === null ? ${g} : ${xe.default.vErrors}.concat(${g})`), s.assign(xe.default.errors, (0, ce._)`${xe.default.vErrors}.length`);
|
|
3189
3189
|
}
|
|
3190
3190
|
function $(v) {
|
|
3191
3191
|
var g;
|
|
@@ -3196,22 +3196,22 @@ function Rt(e, t, n, r) {
|
|
|
3196
3196
|
if (p && !p.dynamicProps)
|
|
3197
3197
|
p.props !== void 0 && (a.props = Ot.mergeEvaluated.props(s, p.props, a.props));
|
|
3198
3198
|
else {
|
|
3199
|
-
const f = s.var("props", (0,
|
|
3200
|
-
a.props = Ot.mergeEvaluated.props(s, f, a.props,
|
|
3199
|
+
const f = s.var("props", (0, ce._)`${v}.evaluated.props`);
|
|
3200
|
+
a.props = Ot.mergeEvaluated.props(s, f, a.props, ce.Name);
|
|
3201
3201
|
}
|
|
3202
3202
|
if (a.items !== !0)
|
|
3203
3203
|
if (p && !p.dynamicItems)
|
|
3204
3204
|
p.items !== void 0 && (a.items = Ot.mergeEvaluated.items(s, p.items, a.items));
|
|
3205
3205
|
else {
|
|
3206
|
-
const f = s.var("items", (0,
|
|
3207
|
-
a.items = Ot.mergeEvaluated.items(s, f, a.items,
|
|
3206
|
+
const f = s.var("items", (0, ce._)`${v}.evaluated.items`);
|
|
3207
|
+
a.items = Ot.mergeEvaluated.items(s, f, a.items, ce.Name);
|
|
3208
3208
|
}
|
|
3209
3209
|
}
|
|
3210
3210
|
}
|
|
3211
|
-
|
|
3212
|
-
|
|
3211
|
+
Be.callRef = Rt;
|
|
3212
|
+
Be.default = rl;
|
|
3213
3213
|
Object.defineProperty(Lr, "__esModule", { value: !0 });
|
|
3214
|
-
const nl = Hr, sl =
|
|
3214
|
+
const nl = Hr, sl = Be, al = [
|
|
3215
3215
|
"$schema",
|
|
3216
3216
|
"$id",
|
|
3217
3217
|
"$defs",
|
|
@@ -3224,7 +3224,7 @@ const nl = Hr, sl = Ge, al = [
|
|
|
3224
3224
|
Lr.default = al;
|
|
3225
3225
|
var Kr = {}, Br = {};
|
|
3226
3226
|
Object.defineProperty(Br, "__esModule", { value: !0 });
|
|
3227
|
-
const Vt =
|
|
3227
|
+
const Vt = K, Ae = Vt.operators, zt = {
|
|
3228
3228
|
maximum: { okStr: "<=", ok: Ae.LTE, fail: Ae.GT },
|
|
3229
3229
|
minimum: { okStr: ">=", ok: Ae.GTE, fail: Ae.LT },
|
|
3230
3230
|
exclusiveMaximum: { okStr: "<", ok: Ae.LT, fail: Ae.GTE },
|
|
@@ -3246,9 +3246,9 @@ const Vt = B, Ae = Vt.operators, zt = {
|
|
|
3246
3246
|
Br.default = il;
|
|
3247
3247
|
var Gr = {};
|
|
3248
3248
|
Object.defineProperty(Gr, "__esModule", { value: !0 });
|
|
3249
|
-
const
|
|
3250
|
-
message: ({ schemaCode: e }) => (0,
|
|
3251
|
-
params: ({ schemaCode: e }) => (0,
|
|
3249
|
+
const ft = K, ll = {
|
|
3250
|
+
message: ({ schemaCode: e }) => (0, ft.str)`must be multiple of ${e}`,
|
|
3251
|
+
params: ({ schemaCode: e }) => (0, ft._)`{multipleOf: ${e}}`
|
|
3252
3252
|
}, dl = {
|
|
3253
3253
|
keyword: "multipleOf",
|
|
3254
3254
|
type: "number",
|
|
@@ -3256,8 +3256,8 @@ const mt = B, ll = {
|
|
|
3256
3256
|
$data: !0,
|
|
3257
3257
|
error: ll,
|
|
3258
3258
|
code(e) {
|
|
3259
|
-
const { gen: t, data: n, schemaCode: r, it: s } = e, a = s.opts.multipleOfPrecision, o = t.let("res"), i = a ? (0,
|
|
3260
|
-
e.fail$data((0,
|
|
3259
|
+
const { gen: t, data: n, schemaCode: r, it: s } = e, a = s.opts.multipleOfPrecision, o = t.let("res"), i = a ? (0, ft._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${a}` : (0, ft._)`${o} !== parseInt(${o})`;
|
|
3260
|
+
e.fail$data((0, ft._)`(${r} === 0 || (${o} = ${n}/${r}, ${i}))`);
|
|
3261
3261
|
}
|
|
3262
3262
|
};
|
|
3263
3263
|
Gr.default = dl;
|
|
@@ -3273,12 +3273,12 @@ function Ls(e) {
|
|
|
3273
3273
|
xr.default = Ls;
|
|
3274
3274
|
Ls.code = 'require("ajv/dist/runtime/ucs2length").default';
|
|
3275
3275
|
Object.defineProperty(Jr, "__esModule", { value: !0 });
|
|
3276
|
-
const
|
|
3276
|
+
const ze = K, cl = N, ul = xr, fl = {
|
|
3277
3277
|
message({ keyword: e, schemaCode: t }) {
|
|
3278
3278
|
const n = e === "maxLength" ? "more" : "fewer";
|
|
3279
|
-
return (0,
|
|
3279
|
+
return (0, ze.str)`must NOT have ${n} than ${t} characters`;
|
|
3280
3280
|
},
|
|
3281
|
-
params: ({ schemaCode: e }) => (0,
|
|
3281
|
+
params: ({ schemaCode: e }) => (0, ze._)`{limit: ${e}}`
|
|
3282
3282
|
}, ml = {
|
|
3283
3283
|
keyword: ["maxLength", "minLength"],
|
|
3284
3284
|
type: "string",
|
|
@@ -3286,14 +3286,14 @@ const Le = B, cl = N, ul = xr, fl = {
|
|
|
3286
3286
|
$data: !0,
|
|
3287
3287
|
error: fl,
|
|
3288
3288
|
code(e) {
|
|
3289
|
-
const { keyword: t, data: n, schemaCode: r, it: s } = e, a = t === "maxLength" ?
|
|
3290
|
-
e.fail$data((0,
|
|
3289
|
+
const { keyword: t, data: n, schemaCode: r, it: s } = e, a = t === "maxLength" ? ze.operators.GT : ze.operators.LT, o = s.opts.unicode === !1 ? (0, ze._)`${n}.length` : (0, ze._)`${(0, cl.useFunc)(e.gen, ul.default)}(${n})`;
|
|
3290
|
+
e.fail$data((0, ze._)`${o} ${a} ${r}`);
|
|
3291
3291
|
}
|
|
3292
3292
|
};
|
|
3293
3293
|
Jr.default = ml;
|
|
3294
3294
|
var Wr = {};
|
|
3295
3295
|
Object.defineProperty(Wr, "__esModule", { value: !0 });
|
|
3296
|
-
const hl = J, Ut =
|
|
3296
|
+
const hl = J, Ut = K, pl = {
|
|
3297
3297
|
message: ({ schemaCode: e }) => (0, Ut.str)`must match pattern "${e}"`,
|
|
3298
3298
|
params: ({ schemaCode: e }) => (0, Ut._)`{pattern: ${e}}`
|
|
3299
3299
|
}, yl = {
|
|
@@ -3310,12 +3310,12 @@ const hl = J, Ut = B, pl = {
|
|
|
3310
3310
|
Wr.default = yl;
|
|
3311
3311
|
var Zr = {};
|
|
3312
3312
|
Object.defineProperty(Zr, "__esModule", { value: !0 });
|
|
3313
|
-
const
|
|
3313
|
+
const mt = K, vl = {
|
|
3314
3314
|
message({ keyword: e, schemaCode: t }) {
|
|
3315
3315
|
const n = e === "maxProperties" ? "more" : "fewer";
|
|
3316
|
-
return (0,
|
|
3316
|
+
return (0, mt.str)`must NOT have ${n} than ${t} properties`;
|
|
3317
3317
|
},
|
|
3318
|
-
params: ({ schemaCode: e }) => (0,
|
|
3318
|
+
params: ({ schemaCode: e }) => (0, mt._)`{limit: ${e}}`
|
|
3319
3319
|
}, _l = {
|
|
3320
3320
|
keyword: ["maxProperties", "minProperties"],
|
|
3321
3321
|
type: "object",
|
|
@@ -3323,16 +3323,16 @@ const ht = B, vl = {
|
|
|
3323
3323
|
$data: !0,
|
|
3324
3324
|
error: vl,
|
|
3325
3325
|
code(e) {
|
|
3326
|
-
const { keyword: t, data: n, schemaCode: r } = e, s = t === "maxProperties" ?
|
|
3327
|
-
e.fail$data((0,
|
|
3326
|
+
const { keyword: t, data: n, schemaCode: r } = e, s = t === "maxProperties" ? mt.operators.GT : mt.operators.LT;
|
|
3327
|
+
e.fail$data((0, mt._)`Object.keys(${n}).length ${s} ${r}`);
|
|
3328
3328
|
}
|
|
3329
3329
|
};
|
|
3330
3330
|
Zr.default = _l;
|
|
3331
3331
|
var Yr = {};
|
|
3332
3332
|
Object.defineProperty(Yr, "__esModule", { value: !0 });
|
|
3333
|
-
const
|
|
3334
|
-
message: ({ params: { missingProperty: e } }) => (0,
|
|
3335
|
-
params: ({ params: { missingProperty: e } }) => (0,
|
|
3333
|
+
const lt = J, ht = K, gl = N, bl = {
|
|
3334
|
+
message: ({ params: { missingProperty: e } }) => (0, ht.str)`must have required property '${e}'`,
|
|
3335
|
+
params: ({ params: { missingProperty: e } }) => (0, ht._)`{missingProperty: ${e}}`
|
|
3336
3336
|
}, $l = {
|
|
3337
3337
|
keyword: "required",
|
|
3338
3338
|
type: "object",
|
|
@@ -3354,10 +3354,10 @@ const dt = J, pt = B, gl = N, bl = {
|
|
|
3354
3354
|
}
|
|
3355
3355
|
function c() {
|
|
3356
3356
|
if (d || a)
|
|
3357
|
-
e.block$data(
|
|
3357
|
+
e.block$data(ht.nil, m);
|
|
3358
3358
|
else
|
|
3359
3359
|
for (const $ of n)
|
|
3360
|
-
(0,
|
|
3360
|
+
(0, lt.checkReportMissingProp)(e, $);
|
|
3361
3361
|
}
|
|
3362
3362
|
function u() {
|
|
3363
3363
|
const $ = t.let("missing");
|
|
@@ -3365,31 +3365,31 @@ const dt = J, pt = B, gl = N, bl = {
|
|
|
3365
3365
|
const v = t.let("valid", !0);
|
|
3366
3366
|
e.block$data(v, () => b($, v)), e.ok(v);
|
|
3367
3367
|
} else
|
|
3368
|
-
t.if((0,
|
|
3368
|
+
t.if((0, lt.checkMissingProp)(e, n, $)), (0, lt.reportMissingProp)(e, $), t.else();
|
|
3369
3369
|
}
|
|
3370
3370
|
function m() {
|
|
3371
3371
|
t.forOf("prop", r, ($) => {
|
|
3372
|
-
e.setParams({ missingProperty: $ }), t.if((0,
|
|
3372
|
+
e.setParams({ missingProperty: $ }), t.if((0, lt.noPropertyInData)(t, s, $, i.ownProperties), () => e.error());
|
|
3373
3373
|
});
|
|
3374
3374
|
}
|
|
3375
3375
|
function b($, v) {
|
|
3376
3376
|
e.setParams({ missingProperty: $ }), t.forOf($, r, () => {
|
|
3377
|
-
t.assign(v, (0,
|
|
3377
|
+
t.assign(v, (0, lt.propertyInData)(t, s, $, i.ownProperties)), t.if((0, ht.not)(v), () => {
|
|
3378
3378
|
e.error(), t.break();
|
|
3379
3379
|
});
|
|
3380
|
-
},
|
|
3380
|
+
}, ht.nil);
|
|
3381
3381
|
}
|
|
3382
3382
|
}
|
|
3383
3383
|
};
|
|
3384
3384
|
Yr.default = $l;
|
|
3385
3385
|
var Qr = {};
|
|
3386
3386
|
Object.defineProperty(Qr, "__esModule", { value: !0 });
|
|
3387
|
-
const
|
|
3387
|
+
const pt = K, wl = {
|
|
3388
3388
|
message({ keyword: e, schemaCode: t }) {
|
|
3389
3389
|
const n = e === "maxItems" ? "more" : "fewer";
|
|
3390
|
-
return (0,
|
|
3390
|
+
return (0, pt.str)`must NOT have ${n} than ${t} items`;
|
|
3391
3391
|
},
|
|
3392
|
-
params: ({ schemaCode: e }) => (0,
|
|
3392
|
+
params: ({ schemaCode: e }) => (0, pt._)`{limit: ${e}}`
|
|
3393
3393
|
}, kl = {
|
|
3394
3394
|
keyword: ["maxItems", "minItems"],
|
|
3395
3395
|
type: "array",
|
|
@@ -3397,20 +3397,20 @@ const yt = B, wl = {
|
|
|
3397
3397
|
$data: !0,
|
|
3398
3398
|
error: wl,
|
|
3399
3399
|
code(e) {
|
|
3400
|
-
const { keyword: t, data: n, schemaCode: r } = e, s = t === "maxItems" ?
|
|
3401
|
-
e.fail$data((0,
|
|
3400
|
+
const { keyword: t, data: n, schemaCode: r } = e, s = t === "maxItems" ? pt.operators.GT : pt.operators.LT;
|
|
3401
|
+
e.fail$data((0, pt._)`${n}.length ${s} ${r}`);
|
|
3402
3402
|
}
|
|
3403
3403
|
};
|
|
3404
3404
|
Qr.default = kl;
|
|
3405
|
-
var Xr = {},
|
|
3406
|
-
Object.defineProperty(
|
|
3405
|
+
var Xr = {}, $t = {};
|
|
3406
|
+
Object.defineProperty($t, "__esModule", { value: !0 });
|
|
3407
3407
|
const Hs = ms;
|
|
3408
3408
|
Hs.code = 'require("ajv/dist/runtime/equal").default';
|
|
3409
|
-
|
|
3409
|
+
$t.default = Hs;
|
|
3410
3410
|
Object.defineProperty(Xr, "__esModule", { value: !0 });
|
|
3411
|
-
const hr =
|
|
3412
|
-
message: ({ params: { i: e, j: t } }) => (0,
|
|
3413
|
-
params: ({ params: { i: e, j: t } }) => (0,
|
|
3411
|
+
const hr = ne, oe = K, Sl = N, El = $t, Pl = {
|
|
3412
|
+
message: ({ params: { i: e, j: t } }) => (0, oe.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,
|
|
3413
|
+
params: ({ params: { i: e, j: t } }) => (0, oe._)`{i: ${e}, j: ${t}}`
|
|
3414
3414
|
}, Ol = {
|
|
3415
3415
|
keyword: "uniqueItems",
|
|
3416
3416
|
type: "array",
|
|
@@ -3422,25 +3422,25 @@ const hr = se, ie = B, Sl = N, El = wt, Pl = {
|
|
|
3422
3422
|
if (!r && !s)
|
|
3423
3423
|
return;
|
|
3424
3424
|
const d = t.let("valid"), c = a.items ? (0, hr.getSchemaTypes)(a.items) : [];
|
|
3425
|
-
e.block$data(d, u, (0,
|
|
3425
|
+
e.block$data(d, u, (0, oe._)`${o} === false`), e.ok(d);
|
|
3426
3426
|
function u() {
|
|
3427
|
-
const v = t.let("i", (0,
|
|
3428
|
-
e.setParams({ i: v, j: g }), t.assign(d, !0), t.if((0,
|
|
3427
|
+
const v = t.let("i", (0, oe._)`${n}.length`), g = t.let("j");
|
|
3428
|
+
e.setParams({ i: v, j: g }), t.assign(d, !0), t.if((0, oe._)`${v} > 1`, () => (m() ? b : $)(v, g));
|
|
3429
3429
|
}
|
|
3430
3430
|
function m() {
|
|
3431
3431
|
return c.length > 0 && !c.some((v) => v === "object" || v === "array");
|
|
3432
3432
|
}
|
|
3433
3433
|
function b(v, g) {
|
|
3434
|
-
const p = t.name("item"), f = (0, hr.checkDataTypes)(c, p, i.opts.strictNumbers, hr.DataType.Wrong), y = t.const("indices", (0,
|
|
3435
|
-
t.for((0,
|
|
3436
|
-
t.let(p, (0,
|
|
3437
|
-
t.assign(g, (0,
|
|
3438
|
-
}).code((0,
|
|
3434
|
+
const p = t.name("item"), f = (0, hr.checkDataTypes)(c, p, i.opts.strictNumbers, hr.DataType.Wrong), y = t.const("indices", (0, oe._)`{}`);
|
|
3435
|
+
t.for((0, oe._)`;${v}--;`, () => {
|
|
3436
|
+
t.let(p, (0, oe._)`${n}[${v}]`), t.if(f, (0, oe._)`continue`), c.length > 1 && t.if((0, oe._)`typeof ${p} == "string"`, (0, oe._)`${p} += "_"`), t.if((0, oe._)`typeof ${y}[${p}] == "number"`, () => {
|
|
3437
|
+
t.assign(g, (0, oe._)`${y}[${p}]`), e.error(), t.assign(d, !1).break();
|
|
3438
|
+
}).code((0, oe._)`${y}[${p}] = ${v}`);
|
|
3439
3439
|
});
|
|
3440
3440
|
}
|
|
3441
3441
|
function $(v, g) {
|
|
3442
3442
|
const p = (0, Sl.useFunc)(t, El.default), f = t.name("outer");
|
|
3443
|
-
t.label(f).for((0,
|
|
3443
|
+
t.label(f).for((0, oe._)`;${v}--;`, () => t.for((0, oe._)`${g} = ${v}; ${g}--;`, () => t.if((0, oe._)`${p}(${n}[${v}], ${n}[${g}])`, () => {
|
|
3444
3444
|
e.error(), t.assign(d, !1).break(f);
|
|
3445
3445
|
})));
|
|
3446
3446
|
}
|
|
@@ -3449,7 +3449,7 @@ const hr = se, ie = B, Sl = N, El = wt, Pl = {
|
|
|
3449
3449
|
Xr.default = Ol;
|
|
3450
3450
|
var en = {};
|
|
3451
3451
|
Object.defineProperty(en, "__esModule", { value: !0 });
|
|
3452
|
-
const $r =
|
|
3452
|
+
const $r = K, jl = N, ql = $t, Il = {
|
|
3453
3453
|
message: "must be equal to constant",
|
|
3454
3454
|
params: ({ schemaCode: e }) => (0, $r._)`{allowedValue: ${e}}`
|
|
3455
3455
|
}, Nl = {
|
|
@@ -3464,9 +3464,9 @@ const $r = B, jl = N, ql = wt, Il = {
|
|
|
3464
3464
|
en.default = Nl;
|
|
3465
3465
|
var tn = {};
|
|
3466
3466
|
Object.defineProperty(tn, "__esModule", { value: !0 });
|
|
3467
|
-
const
|
|
3467
|
+
const ct = K, Ml = N, Tl = $t, Rl = {
|
|
3468
3468
|
message: "must be equal to one of the allowed values",
|
|
3469
|
-
params: ({ schemaCode: e }) => (0,
|
|
3469
|
+
params: ({ schemaCode: e }) => (0, ct._)`{allowedValues: ${e}}`
|
|
3470
3470
|
}, Al = {
|
|
3471
3471
|
keyword: "enum",
|
|
3472
3472
|
schemaType: "array",
|
|
@@ -3486,26 +3486,26 @@ const ut = B, Ml = N, Tl = wt, Rl = {
|
|
|
3486
3486
|
if (!Array.isArray(s))
|
|
3487
3487
|
throw new Error("ajv implementation error");
|
|
3488
3488
|
const $ = t.const("vSchema", a);
|
|
3489
|
-
u = (0,
|
|
3489
|
+
u = (0, ct.or)(...s.map((v, g) => b($, g)));
|
|
3490
3490
|
}
|
|
3491
3491
|
e.pass(u);
|
|
3492
3492
|
function m() {
|
|
3493
|
-
t.assign(u, !1), t.forOf("v", a, ($) => t.if((0,
|
|
3493
|
+
t.assign(u, !1), t.forOf("v", a, ($) => t.if((0, ct._)`${c()}(${n}, ${$})`, () => t.assign(u, !0).break()));
|
|
3494
3494
|
}
|
|
3495
3495
|
function b($, v) {
|
|
3496
3496
|
const g = s[v];
|
|
3497
|
-
return typeof g == "object" && g !== null ? (0,
|
|
3497
|
+
return typeof g == "object" && g !== null ? (0, ct._)`${c()}(${n}, ${$}[${v}])` : (0, ct._)`${n} === ${g}`;
|
|
3498
3498
|
}
|
|
3499
3499
|
}
|
|
3500
3500
|
};
|
|
3501
3501
|
tn.default = Al;
|
|
3502
3502
|
Object.defineProperty(Kr, "__esModule", { value: !0 });
|
|
3503
|
-
const
|
|
3503
|
+
const Fl = Br, Dl = Gr, Cl = Jr, Vl = Wr, zl = Zr, Ul = Yr, Ll = Qr, Hl = Xr, Kl = en, Bl = tn, Gl = [
|
|
3504
3504
|
// number
|
|
3505
|
-
Cl.default,
|
|
3506
3505
|
Fl.default,
|
|
3507
|
-
// string
|
|
3508
3506
|
Dl.default,
|
|
3507
|
+
// string
|
|
3508
|
+
Cl.default,
|
|
3509
3509
|
Vl.default,
|
|
3510
3510
|
// object
|
|
3511
3511
|
zl.default,
|
|
@@ -3520,12 +3520,12 @@ const Cl = Br, Fl = Gr, Dl = Jr, Vl = Wr, zl = Zr, Ul = Yr, Ll = Qr, Hl = Xr, Kl
|
|
|
3520
3520
|
Bl.default
|
|
3521
3521
|
];
|
|
3522
3522
|
Kr.default = Gl;
|
|
3523
|
-
var rn = {},
|
|
3524
|
-
Object.defineProperty(
|
|
3525
|
-
|
|
3526
|
-
const
|
|
3527
|
-
message: ({ params: { len: e } }) => (0,
|
|
3528
|
-
params: ({ params: { len: e } }) => (0,
|
|
3523
|
+
var rn = {}, nt = {};
|
|
3524
|
+
Object.defineProperty(nt, "__esModule", { value: !0 });
|
|
3525
|
+
nt.validateAdditionalItems = void 0;
|
|
3526
|
+
const Ue = K, wr = N, Jl = {
|
|
3527
|
+
message: ({ params: { len: e } }) => (0, Ue.str)`must NOT have more than ${e} items`,
|
|
3528
|
+
params: ({ params: { len: e } }) => (0, Ue._)`{limit: ${e}}`
|
|
3529
3529
|
}, xl = {
|
|
3530
3530
|
keyword: "additionalItems",
|
|
3531
3531
|
type: "array",
|
|
@@ -3544,25 +3544,25 @@ const He = B, wr = N, Jl = {
|
|
|
3544
3544
|
function Ks(e, t) {
|
|
3545
3545
|
const { gen: n, schema: r, data: s, keyword: a, it: o } = e;
|
|
3546
3546
|
o.items = !0;
|
|
3547
|
-
const i = n.const("len", (0,
|
|
3547
|
+
const i = n.const("len", (0, Ue._)`${s}.length`);
|
|
3548
3548
|
if (r === !1)
|
|
3549
|
-
e.setParams({ len: t.length }), e.pass((0,
|
|
3549
|
+
e.setParams({ len: t.length }), e.pass((0, Ue._)`${i} <= ${t.length}`);
|
|
3550
3550
|
else if (typeof r == "object" && !(0, wr.alwaysValidSchema)(o, r)) {
|
|
3551
|
-
const c = n.var("valid", (0,
|
|
3552
|
-
n.if((0,
|
|
3551
|
+
const c = n.var("valid", (0, Ue._)`${i} <= ${t.length}`);
|
|
3552
|
+
n.if((0, Ue.not)(c), () => d(c)), e.ok(c);
|
|
3553
3553
|
}
|
|
3554
3554
|
function d(c) {
|
|
3555
3555
|
n.forRange("i", t.length, i, (u) => {
|
|
3556
|
-
e.subschema({ keyword: a, dataProp: u, dataPropType: wr.Type.Num }, c), o.allErrors || n.if((0,
|
|
3556
|
+
e.subschema({ keyword: a, dataProp: u, dataPropType: wr.Type.Num }, c), o.allErrors || n.if((0, Ue.not)(c), () => n.break());
|
|
3557
3557
|
});
|
|
3558
3558
|
}
|
|
3559
3559
|
}
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
var nn = {},
|
|
3563
|
-
Object.defineProperty(
|
|
3564
|
-
|
|
3565
|
-
const An =
|
|
3560
|
+
nt.validateAdditionalItems = Ks;
|
|
3561
|
+
nt.default = xl;
|
|
3562
|
+
var nn = {}, st = {};
|
|
3563
|
+
Object.defineProperty(st, "__esModule", { value: !0 });
|
|
3564
|
+
st.validateTuple = void 0;
|
|
3565
|
+
const An = K, At = N, Wl = J, Zl = {
|
|
3566
3566
|
keyword: "items",
|
|
3567
3567
|
type: "array",
|
|
3568
3568
|
schemaType: ["object", "array", "boolean"],
|
|
@@ -3593,10 +3593,10 @@ function Bs(e, t, n = e.schema) {
|
|
|
3593
3593
|
}
|
|
3594
3594
|
}
|
|
3595
3595
|
}
|
|
3596
|
-
|
|
3597
|
-
|
|
3596
|
+
st.validateTuple = Bs;
|
|
3597
|
+
st.default = Zl;
|
|
3598
3598
|
Object.defineProperty(nn, "__esModule", { value: !0 });
|
|
3599
|
-
const Yl =
|
|
3599
|
+
const Yl = st, Ql = {
|
|
3600
3600
|
keyword: "prefixItems",
|
|
3601
3601
|
type: "array",
|
|
3602
3602
|
schemaType: ["array"],
|
|
@@ -3606,9 +3606,9 @@ const Yl = at, Ql = {
|
|
|
3606
3606
|
nn.default = Ql;
|
|
3607
3607
|
var sn = {};
|
|
3608
3608
|
Object.defineProperty(sn, "__esModule", { value: !0 });
|
|
3609
|
-
const
|
|
3610
|
-
message: ({ params: { len: e } }) => (0,
|
|
3611
|
-
params: ({ params: { len: e } }) => (0,
|
|
3609
|
+
const Fn = K, Xl = N, ed = J, td = nt, rd = {
|
|
3610
|
+
message: ({ params: { len: e } }) => (0, Fn.str)`must NOT have more than ${e} items`,
|
|
3611
|
+
params: ({ params: { len: e } }) => (0, Fn._)`{limit: ${e}}`
|
|
3612
3612
|
}, nd = {
|
|
3613
3613
|
keyword: "items",
|
|
3614
3614
|
type: "array",
|
|
@@ -3623,9 +3623,9 @@ const Cn = B, Xl = N, ed = J, td = st, rd = {
|
|
|
3623
3623
|
sn.default = nd;
|
|
3624
3624
|
var an = {};
|
|
3625
3625
|
Object.defineProperty(an, "__esModule", { value: !0 });
|
|
3626
|
-
const
|
|
3627
|
-
message: ({ params: { min: e, max: t } }) => t === void 0 ? (0,
|
|
3628
|
-
params: ({ params: { min: e, max: t } }) => t === void 0 ? (0,
|
|
3626
|
+
const pe = K, jt = N, sd = {
|
|
3627
|
+
message: ({ params: { min: e, max: t } }) => t === void 0 ? (0, pe.str)`must contain at least ${e} valid item(s)` : (0, pe.str)`must contain at least ${e} and no more than ${t} valid item(s)`,
|
|
3628
|
+
params: ({ params: { min: e, max: t } }) => t === void 0 ? (0, pe._)`{minContains: ${e}}` : (0, pe._)`{minContains: ${e}, maxContains: ${t}}`
|
|
3629
3629
|
}, ad = {
|
|
3630
3630
|
keyword: "contains",
|
|
3631
3631
|
type: "array",
|
|
@@ -3638,7 +3638,7 @@ const ye = B, jt = N, sd = {
|
|
|
3638
3638
|
let o, i;
|
|
3639
3639
|
const { minContains: d, maxContains: c } = r;
|
|
3640
3640
|
a.opts.next ? (o = d === void 0 ? 1 : d, i = c) : o = 1;
|
|
3641
|
-
const u = t.const("len", (0,
|
|
3641
|
+
const u = t.const("len", (0, pe._)`${s}.length`);
|
|
3642
3642
|
if (e.setParams({ min: o, max: i }), i === void 0 && o === 0) {
|
|
3643
3643
|
(0, jt.checkStrictMode)(a, '"minContains" == 0 without "maxContains": "contains" keyword ignored');
|
|
3644
3644
|
return;
|
|
@@ -3648,13 +3648,13 @@ const ye = B, jt = N, sd = {
|
|
|
3648
3648
|
return;
|
|
3649
3649
|
}
|
|
3650
3650
|
if ((0, jt.alwaysValidSchema)(a, n)) {
|
|
3651
|
-
let g = (0,
|
|
3652
|
-
i !== void 0 && (g = (0,
|
|
3651
|
+
let g = (0, pe._)`${u} >= ${o}`;
|
|
3652
|
+
i !== void 0 && (g = (0, pe._)`${g} && ${u} <= ${i}`), e.pass(g);
|
|
3653
3653
|
return;
|
|
3654
3654
|
}
|
|
3655
3655
|
a.items = !0;
|
|
3656
3656
|
const m = t.name("valid");
|
|
3657
|
-
i === void 0 && o === 1 ? $(m, () => t.if(m, () => t.break())) : o === 0 ? (t.let(m, !0), i !== void 0 && t.if((0,
|
|
3657
|
+
i === void 0 && o === 1 ? $(m, () => t.if(m, () => t.break())) : o === 0 ? (t.let(m, !0), i !== void 0 && t.if((0, pe._)`${s}.length > 0`, b)) : (t.let(m, !1), b()), e.result(m, () => e.reset());
|
|
3658
3658
|
function b() {
|
|
3659
3659
|
const g = t.name("_valid"), p = t.let("count", 0);
|
|
3660
3660
|
$(g, () => t.if(g, () => v(p)));
|
|
@@ -3670,7 +3670,7 @@ const ye = B, jt = N, sd = {
|
|
|
3670
3670
|
});
|
|
3671
3671
|
}
|
|
3672
3672
|
function v(g) {
|
|
3673
|
-
t.code((0,
|
|
3673
|
+
t.code((0, pe._)`${g}++`), i === void 0 ? t.if((0, pe._)`${g} >= ${o}`, () => t.assign(m, !0).break()) : (t.if((0, pe._)`${g} > ${i}`, () => t.assign(m, !1).break()), o === 1 ? t.assign(m, !0) : t.if((0, pe._)`${g} >= ${o}`, () => t.assign(m, !0)));
|
|
3674
3674
|
}
|
|
3675
3675
|
}
|
|
3676
3676
|
};
|
|
@@ -3678,7 +3678,7 @@ an.default = ad;
|
|
|
3678
3678
|
var Gs = {};
|
|
3679
3679
|
(function(e) {
|
|
3680
3680
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0;
|
|
3681
|
-
const t =
|
|
3681
|
+
const t = K, n = N, r = J;
|
|
3682
3682
|
e.error = {
|
|
3683
3683
|
message: ({ params: { property: d, depsCount: c, deps: u } }) => {
|
|
3684
3684
|
const m = c === 1 ? "property" : "properties";
|
|
@@ -3748,7 +3748,7 @@ var Gs = {};
|
|
|
3748
3748
|
})(Gs);
|
|
3749
3749
|
var on = {};
|
|
3750
3750
|
Object.defineProperty(on, "__esModule", { value: !0 });
|
|
3751
|
-
const Js =
|
|
3751
|
+
const Js = K, od = N, id = {
|
|
3752
3752
|
message: "property name must be valid",
|
|
3753
3753
|
params: ({ params: e }) => (0, Js._)`{propertyName: ${e.propertyName}}`
|
|
3754
3754
|
}, ld = {
|
|
@@ -3777,9 +3777,9 @@ const Js = B, od = N, id = {
|
|
|
3777
3777
|
on.default = ld;
|
|
3778
3778
|
var Jt = {};
|
|
3779
3779
|
Object.defineProperty(Jt, "__esModule", { value: !0 });
|
|
3780
|
-
const qt = J,
|
|
3780
|
+
const qt = J, _e = K, dd = qe, It = N, cd = {
|
|
3781
3781
|
message: "must NOT have additional properties",
|
|
3782
|
-
params: ({ params: e }) => (0,
|
|
3782
|
+
params: ({ params: e }) => (0, _e._)`{additionalProperty: ${e.additionalProperty}}`
|
|
3783
3783
|
}, ud = {
|
|
3784
3784
|
keyword: "additionalProperties",
|
|
3785
3785
|
type: ["object"],
|
|
@@ -3795,7 +3795,7 @@ const qt = J, ge = B, dd = qe, It = N, cd = {
|
|
|
3795
3795
|
if (o.props = !0, d.removeAdditional !== "all" && (0, It.alwaysValidSchema)(o, n))
|
|
3796
3796
|
return;
|
|
3797
3797
|
const c = (0, qt.allSchemaProperties)(r.properties), u = (0, qt.allSchemaProperties)(r.patternProperties);
|
|
3798
|
-
m(), e.ok((0,
|
|
3798
|
+
m(), e.ok((0, _e._)`${a} === ${dd.default.errors}`);
|
|
3799
3799
|
function m() {
|
|
3800
3800
|
t.forIn("key", s, (p) => {
|
|
3801
3801
|
!c.length && !u.length ? v(p) : t.if(b(p), () => v(p));
|
|
@@ -3806,11 +3806,11 @@ const qt = J, ge = B, dd = qe, It = N, cd = {
|
|
|
3806
3806
|
if (c.length > 8) {
|
|
3807
3807
|
const y = (0, It.schemaRefOrVal)(o, r.properties, "properties");
|
|
3808
3808
|
f = (0, qt.isOwnProperty)(t, y, p);
|
|
3809
|
-
} else c.length ? f = (0,
|
|
3810
|
-
return u.length && (f = (0,
|
|
3809
|
+
} else c.length ? f = (0, _e.or)(...c.map((y) => (0, _e._)`${p} === ${y}`)) : f = _e.nil;
|
|
3810
|
+
return u.length && (f = (0, _e.or)(f, ...u.map((y) => (0, _e._)`${(0, qt.usePattern)(e, y)}.test(${p})`))), (0, _e.not)(f);
|
|
3811
3811
|
}
|
|
3812
3812
|
function $(p) {
|
|
3813
|
-
t.code((0,
|
|
3813
|
+
t.code((0, _e._)`delete ${s}[${p}]`);
|
|
3814
3814
|
}
|
|
3815
3815
|
function v(p) {
|
|
3816
3816
|
if (d.removeAdditional === "all" || d.removeAdditional && n === !1) {
|
|
@@ -3823,9 +3823,9 @@ const qt = J, ge = B, dd = qe, It = N, cd = {
|
|
|
3823
3823
|
}
|
|
3824
3824
|
if (typeof n == "object" && !(0, It.alwaysValidSchema)(o, n)) {
|
|
3825
3825
|
const f = t.name("valid");
|
|
3826
|
-
d.removeAdditional === "failing" ? (g(p, f, !1), t.if((0,
|
|
3826
|
+
d.removeAdditional === "failing" ? (g(p, f, !1), t.if((0, _e.not)(f), () => {
|
|
3827
3827
|
e.reset(), $(p);
|
|
3828
|
-
})) : (g(p, f), i || t.if((0,
|
|
3828
|
+
})) : (g(p, f), i || t.if((0, _e.not)(f), () => t.break()));
|
|
3829
3829
|
}
|
|
3830
3830
|
}
|
|
3831
3831
|
function g(p, f, y) {
|
|
@@ -3845,14 +3845,14 @@ const qt = J, ge = B, dd = qe, It = N, cd = {
|
|
|
3845
3845
|
Jt.default = ud;
|
|
3846
3846
|
var ln = {};
|
|
3847
3847
|
Object.defineProperty(ln, "__esModule", { value: !0 });
|
|
3848
|
-
const fd =
|
|
3848
|
+
const fd = be, Dn = J, pr = N, Cn = Jt, md = {
|
|
3849
3849
|
keyword: "properties",
|
|
3850
3850
|
type: "object",
|
|
3851
3851
|
schemaType: "object",
|
|
3852
3852
|
code(e) {
|
|
3853
3853
|
const { gen: t, schema: n, parentSchema: r, data: s, it: a } = e;
|
|
3854
|
-
a.opts.removeAdditional === "all" && r.additionalProperties === void 0 &&
|
|
3855
|
-
const o = (0,
|
|
3854
|
+
a.opts.removeAdditional === "all" && r.additionalProperties === void 0 && Cn.default.code(new fd.KeywordCxt(a, Cn.default, "additionalProperties"));
|
|
3855
|
+
const o = (0, Dn.allSchemaProperties)(n);
|
|
3856
3856
|
for (const m of o)
|
|
3857
3857
|
a.definedProperties.add(m);
|
|
3858
3858
|
a.opts.unevaluated && o.length && a.props !== !0 && (a.props = pr.mergeEvaluated.props(t, (0, pr.toHash)(o), a.props));
|
|
@@ -3861,7 +3861,7 @@ const fd = $e, Fn = J, pr = N, Dn = Jt, md = {
|
|
|
3861
3861
|
return;
|
|
3862
3862
|
const d = t.name("valid");
|
|
3863
3863
|
for (const m of i)
|
|
3864
|
-
c(m) ? u(m) : (t.if((0,
|
|
3864
|
+
c(m) ? u(m) : (t.if((0, Dn.propertyInData)(t, s, m, a.opts.ownProperties)), u(m), a.allErrors || t.else().var(d, !0), t.endIf()), e.it.definedProperties.add(m), e.ok(d);
|
|
3865
3865
|
function c(m) {
|
|
3866
3866
|
return a.opts.useDefaults && !a.compositeRule && n[m].default !== void 0;
|
|
3867
3867
|
}
|
|
@@ -3877,7 +3877,7 @@ const fd = $e, Fn = J, pr = N, Dn = Jt, md = {
|
|
|
3877
3877
|
ln.default = md;
|
|
3878
3878
|
var dn = {};
|
|
3879
3879
|
Object.defineProperty(dn, "__esModule", { value: !0 });
|
|
3880
|
-
const Vn = J, Nt =
|
|
3880
|
+
const Vn = J, Nt = K, zn = N, Un = N, hd = {
|
|
3881
3881
|
keyword: "patternProperties",
|
|
3882
3882
|
type: "object",
|
|
3883
3883
|
schemaType: "object",
|
|
@@ -3948,9 +3948,9 @@ const vd = J, _d = {
|
|
|
3948
3948
|
un.default = _d;
|
|
3949
3949
|
var fn = {};
|
|
3950
3950
|
Object.defineProperty(fn, "__esModule", { value: !0 });
|
|
3951
|
-
const
|
|
3951
|
+
const Ft = K, gd = N, bd = {
|
|
3952
3952
|
message: "must match exactly one schema in oneOf",
|
|
3953
|
-
params: ({ params: e }) => (0,
|
|
3953
|
+
params: ({ params: e }) => (0, Ft._)`{passingSchemas: ${e.passing}}`
|
|
3954
3954
|
}, $d = {
|
|
3955
3955
|
keyword: "oneOf",
|
|
3956
3956
|
schemaType: "array",
|
|
@@ -3971,8 +3971,8 @@ const Ct = B, gd = N, bd = {
|
|
|
3971
3971
|
keyword: "oneOf",
|
|
3972
3972
|
schemaProp: m,
|
|
3973
3973
|
compositeRule: !0
|
|
3974
|
-
}, d), m > 0 && t.if((0,
|
|
3975
|
-
t.assign(o, !0), t.assign(i, m), b && e.mergeEvaluated(b,
|
|
3974
|
+
}, d), m > 0 && t.if((0, Ft._)`${d} && ${o}`).assign(o, !1).assign(i, (0, Ft._)`[${i}, ${m}]`).else(), t.if(d, () => {
|
|
3975
|
+
t.assign(o, !0), t.assign(i, m), b && e.mergeEvaluated(b, Ft.Name);
|
|
3976
3976
|
});
|
|
3977
3977
|
});
|
|
3978
3978
|
}
|
|
@@ -4000,7 +4000,7 @@ const wd = N, kd = {
|
|
|
4000
4000
|
mn.default = kd;
|
|
4001
4001
|
var hn = {};
|
|
4002
4002
|
Object.defineProperty(hn, "__esModule", { value: !0 });
|
|
4003
|
-
const Lt =
|
|
4003
|
+
const Lt = K, xs = N, Sd = {
|
|
4004
4004
|
message: ({ params: e }) => (0, Lt.str)`must match "${e.ifClause}" schema`,
|
|
4005
4005
|
params: ({ params: e }) => (0, Lt._)`{failingKeyword: ${e.ifClause}}`
|
|
4006
4006
|
}, Ed = {
|
|
@@ -4053,11 +4053,11 @@ const Pd = N, Od = {
|
|
|
4053
4053
|
};
|
|
4054
4054
|
pn.default = Od;
|
|
4055
4055
|
Object.defineProperty(rn, "__esModule", { value: !0 });
|
|
4056
|
-
const jd =
|
|
4056
|
+
const jd = nt, qd = nn, Id = st, Nd = sn, Md = an, Td = Gs, Rd = on, Ad = Jt, Fd = ln, Dd = dn, Cd = cn, Vd = un, zd = fn, Ud = mn, Ld = hn, Hd = pn;
|
|
4057
4057
|
function Kd(e = !1) {
|
|
4058
4058
|
const t = [
|
|
4059
4059
|
// any
|
|
4060
|
-
|
|
4060
|
+
Cd.default,
|
|
4061
4061
|
Vd.default,
|
|
4062
4062
|
zd.default,
|
|
4063
4063
|
Ud.default,
|
|
@@ -4067,15 +4067,15 @@ function Kd(e = !1) {
|
|
|
4067
4067
|
Rd.default,
|
|
4068
4068
|
Ad.default,
|
|
4069
4069
|
Td.default,
|
|
4070
|
-
|
|
4071
|
-
|
|
4070
|
+
Fd.default,
|
|
4071
|
+
Dd.default
|
|
4072
4072
|
];
|
|
4073
4073
|
return e ? t.push(qd.default, Nd.default) : t.push(jd.default, Id.default), t.push(Md.default), t;
|
|
4074
4074
|
}
|
|
4075
4075
|
rn.default = Kd;
|
|
4076
4076
|
var yn = {}, vn = {};
|
|
4077
4077
|
Object.defineProperty(vn, "__esModule", { value: !0 });
|
|
4078
|
-
const te =
|
|
4078
|
+
const te = K, Bd = {
|
|
4079
4079
|
message: ({ schemaCode: e }) => (0, te.str)`must match format "${e}"`,
|
|
4080
4080
|
params: ({ schemaCode: e }) => (0, te._)`{format: ${e}}`
|
|
4081
4081
|
}, Gd = {
|
|
@@ -4099,7 +4099,7 @@ const te = B, Bd = {
|
|
|
4099
4099
|
return d.strictSchema === !1 ? te.nil : (0, te._)`${o} && !${f}`;
|
|
4100
4100
|
}
|
|
4101
4101
|
function k() {
|
|
4102
|
-
const
|
|
4102
|
+
const S = u.$async ? (0, te._)`(${g}.async ? await ${f}(${r}) : ${f}(${r}))` : (0, te._)`${f}(${r})`, O = (0, te._)`(typeof ${f} == "function" ? ${S} : ${f}.test(${r}))`;
|
|
4103
4103
|
return (0, te._)`${f} && ${f} !== true && ${p} === ${t} && !${O}`;
|
|
4104
4104
|
}
|
|
4105
4105
|
}
|
|
@@ -4112,7 +4112,7 @@ const te = B, Bd = {
|
|
|
4112
4112
|
if (v === !0)
|
|
4113
4113
|
return;
|
|
4114
4114
|
const [g, p, f] = k(v);
|
|
4115
|
-
g === t && e.pass(
|
|
4115
|
+
g === t && e.pass(S());
|
|
4116
4116
|
function y() {
|
|
4117
4117
|
if (d.strictSchema === !1) {
|
|
4118
4118
|
m.logger.warn(O());
|
|
@@ -4124,10 +4124,10 @@ const te = B, Bd = {
|
|
|
4124
4124
|
}
|
|
4125
4125
|
}
|
|
4126
4126
|
function k(O) {
|
|
4127
|
-
const
|
|
4128
|
-
return typeof O == "object" && !(O instanceof RegExp) ? [O.type || "string", O.validate, (0, te._)`${
|
|
4127
|
+
const U = O instanceof RegExp ? (0, te.regexpCode)(O) : d.code.formats ? (0, te._)`${d.code.formats}${(0, te.getProperty)(a)}` : void 0, G = n.scopeValue("formats", { key: a, ref: O, code: U });
|
|
4128
|
+
return typeof O == "object" && !(O instanceof RegExp) ? [O.type || "string", O.validate, (0, te._)`${G}.validate`] : ["string", O, G];
|
|
4129
4129
|
}
|
|
4130
|
-
function
|
|
4130
|
+
function S() {
|
|
4131
4131
|
if (typeof v == "object" && !(v instanceof RegExp) && v.async) {
|
|
4132
4132
|
if (!u.$async)
|
|
4133
4133
|
throw new Error("async format in sync schema");
|
|
@@ -4142,10 +4142,10 @@ vn.default = Gd;
|
|
|
4142
4142
|
Object.defineProperty(yn, "__esModule", { value: !0 });
|
|
4143
4143
|
const Jd = vn, xd = [Jd.default];
|
|
4144
4144
|
yn.default = xd;
|
|
4145
|
-
var
|
|
4146
|
-
Object.defineProperty(
|
|
4147
|
-
|
|
4148
|
-
|
|
4145
|
+
var et = {};
|
|
4146
|
+
Object.defineProperty(et, "__esModule", { value: !0 });
|
|
4147
|
+
et.contentVocabulary = et.metadataVocabulary = void 0;
|
|
4148
|
+
et.metadataVocabulary = [
|
|
4149
4149
|
"title",
|
|
4150
4150
|
"description",
|
|
4151
4151
|
"default",
|
|
@@ -4154,13 +4154,13 @@ tt.metadataVocabulary = [
|
|
|
4154
4154
|
"writeOnly",
|
|
4155
4155
|
"examples"
|
|
4156
4156
|
];
|
|
4157
|
-
|
|
4157
|
+
et.contentVocabulary = [
|
|
4158
4158
|
"contentMediaType",
|
|
4159
4159
|
"contentEncoding",
|
|
4160
4160
|
"contentSchema"
|
|
4161
4161
|
];
|
|
4162
4162
|
Object.defineProperty(Ur, "__esModule", { value: !0 });
|
|
4163
|
-
const Wd = Lr, Zd = Kr, Yd = rn, Qd = yn, Hn =
|
|
4163
|
+
const Wd = Lr, Zd = Kr, Yd = rn, Qd = yn, Hn = et, Xd = [
|
|
4164
4164
|
Wd.default,
|
|
4165
4165
|
Zd.default,
|
|
4166
4166
|
(0, Yd.default)(),
|
|
@@ -4177,9 +4177,9 @@ var Kn;
|
|
|
4177
4177
|
e.Tag = "tag", e.Mapping = "mapping";
|
|
4178
4178
|
})(Kn || (xt.DiscrError = Kn = {}));
|
|
4179
4179
|
Object.defineProperty(_n, "__esModule", { value: !0 });
|
|
4180
|
-
const
|
|
4180
|
+
const Ze = K, kr = xt, Bn = ue, ec = rt, tc = N, rc = {
|
|
4181
4181
|
message: ({ params: { discrError: e, tagName: t } }) => e === kr.DiscrError.Tag ? `tag "${t}" must be string` : `value of tag "${t}" must be in oneOf`,
|
|
4182
|
-
params: ({ params: { discrError: e, tag: t, tagName: n } }) => (0,
|
|
4182
|
+
params: ({ params: { discrError: e, tag: t, tagName: n } }) => (0, Ze._)`{error: ${e}, tag: ${n}, tagValue: ${t}}`
|
|
4183
4183
|
}, nc = {
|
|
4184
4184
|
keyword: "discriminator",
|
|
4185
4185
|
type: "object",
|
|
@@ -4196,54 +4196,54 @@ const Ye = B, kr = xt, Bn = fe, ec = nt, tc = N, rc = {
|
|
|
4196
4196
|
throw new Error("discriminator: mapping is not supported");
|
|
4197
4197
|
if (!o)
|
|
4198
4198
|
throw new Error("discriminator: requires oneOf keyword");
|
|
4199
|
-
const d = t.let("valid", !1), c = t.const("tag", (0,
|
|
4200
|
-
t.if((0,
|
|
4199
|
+
const d = t.let("valid", !1), c = t.const("tag", (0, Ze._)`${n}${(0, Ze.getProperty)(i)}`);
|
|
4200
|
+
t.if((0, Ze._)`typeof ${c} == "string"`, () => u(), () => e.error(!1, { discrError: kr.DiscrError.Tag, tag: c, tagName: i })), e.ok(d);
|
|
4201
4201
|
function u() {
|
|
4202
4202
|
const $ = b();
|
|
4203
4203
|
t.if(!1);
|
|
4204
4204
|
for (const v in $)
|
|
4205
|
-
t.elseIf((0,
|
|
4205
|
+
t.elseIf((0, Ze._)`${c} === ${v}`), t.assign(d, m($[v]));
|
|
4206
4206
|
t.else(), e.error(!1, { discrError: kr.DiscrError.Mapping, tag: c, tagName: i }), t.endIf();
|
|
4207
4207
|
}
|
|
4208
4208
|
function m($) {
|
|
4209
4209
|
const v = t.name("valid"), g = e.subschema({ keyword: "oneOf", schemaProp: $ }, v);
|
|
4210
|
-
return e.mergeEvaluated(g,
|
|
4210
|
+
return e.mergeEvaluated(g, Ze.Name), v;
|
|
4211
4211
|
}
|
|
4212
4212
|
function b() {
|
|
4213
4213
|
var $;
|
|
4214
4214
|
const v = {}, g = f(s);
|
|
4215
4215
|
let p = !0;
|
|
4216
|
-
for (let
|
|
4217
|
-
let O = o[
|
|
4216
|
+
for (let S = 0; S < o.length; S++) {
|
|
4217
|
+
let O = o[S];
|
|
4218
4218
|
if (O != null && O.$ref && !(0, tc.schemaHasRulesButRef)(O, a.self.RULES)) {
|
|
4219
|
-
const
|
|
4220
|
-
if (O = Bn.resolveRef.call(a.self, a.schemaEnv.root, a.baseId,
|
|
4221
|
-
throw new ec.default(a.opts.uriResolver, a.baseId,
|
|
4219
|
+
const G = O.$ref;
|
|
4220
|
+
if (O = Bn.resolveRef.call(a.self, a.schemaEnv.root, a.baseId, G), O instanceof Bn.SchemaEnv && (O = O.schema), O === void 0)
|
|
4221
|
+
throw new ec.default(a.opts.uriResolver, a.baseId, G);
|
|
4222
4222
|
}
|
|
4223
|
-
const
|
|
4224
|
-
if (typeof
|
|
4223
|
+
const U = ($ = O == null ? void 0 : O.properties) === null || $ === void 0 ? void 0 : $[i];
|
|
4224
|
+
if (typeof U != "object")
|
|
4225
4225
|
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${i}"`);
|
|
4226
|
-
p = p && (g || f(O)), y(
|
|
4226
|
+
p = p && (g || f(O)), y(U, S);
|
|
4227
4227
|
}
|
|
4228
4228
|
if (!p)
|
|
4229
4229
|
throw new Error(`discriminator: "${i}" must be required`);
|
|
4230
4230
|
return v;
|
|
4231
|
-
function f({ required:
|
|
4232
|
-
return Array.isArray(
|
|
4231
|
+
function f({ required: S }) {
|
|
4232
|
+
return Array.isArray(S) && S.includes(i);
|
|
4233
4233
|
}
|
|
4234
|
-
function y(
|
|
4235
|
-
if (
|
|
4236
|
-
k(
|
|
4237
|
-
else if (
|
|
4238
|
-
for (const
|
|
4239
|
-
k(
|
|
4234
|
+
function y(S, O) {
|
|
4235
|
+
if (S.const)
|
|
4236
|
+
k(S.const, O);
|
|
4237
|
+
else if (S.enum)
|
|
4238
|
+
for (const U of S.enum)
|
|
4239
|
+
k(U, O);
|
|
4240
4240
|
else
|
|
4241
4241
|
throw new Error(`discriminator: "properties/${i}" must have "const" or "enum"`);
|
|
4242
4242
|
}
|
|
4243
|
-
function k(
|
|
4244
|
-
if (typeof
|
|
4243
|
+
function k(S, O) {
|
|
4244
|
+
if (typeof S != "string" || S in v)
|
|
4245
4245
|
throw new Error(`discriminator: "${i}" values must be unique strings`);
|
|
4246
|
-
v[
|
|
4246
|
+
v[S] = O;
|
|
4247
4247
|
}
|
|
4248
4248
|
}
|
|
4249
4249
|
}
|
|
@@ -4508,11 +4508,11 @@ const sc = "http://json-schema.org/draft-07/schema#", ac = "http://json-schema.o
|
|
|
4508
4508
|
}
|
|
4509
4509
|
}
|
|
4510
4510
|
t.Ajv = d, e.exports = t = d, e.exports.Ajv = d, Object.defineProperty(t, "__esModule", { value: !0 }), t.default = d;
|
|
4511
|
-
var c =
|
|
4511
|
+
var c = be;
|
|
4512
4512
|
Object.defineProperty(t, "KeywordCxt", { enumerable: !0, get: function() {
|
|
4513
4513
|
return c.KeywordCxt;
|
|
4514
4514
|
} });
|
|
4515
|
-
var u =
|
|
4515
|
+
var u = K;
|
|
4516
4516
|
Object.defineProperty(t, "_", { enumerable: !0, get: function() {
|
|
4517
4517
|
return u._;
|
|
4518
4518
|
} }), Object.defineProperty(t, "str", { enumerable: !0, get: function() {
|
|
@@ -4526,11 +4526,11 @@ const sc = "http://json-schema.org/draft-07/schema#", ac = "http://json-schema.o
|
|
|
4526
4526
|
} }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function() {
|
|
4527
4527
|
return u.CodeGen;
|
|
4528
4528
|
} });
|
|
4529
|
-
var m =
|
|
4529
|
+
var m = bt;
|
|
4530
4530
|
Object.defineProperty(t, "ValidationError", { enumerable: !0, get: function() {
|
|
4531
4531
|
return m.default;
|
|
4532
4532
|
} });
|
|
4533
|
-
var b =
|
|
4533
|
+
var b = rt;
|
|
4534
4534
|
Object.defineProperty(t, "MissingRefError", { enumerable: !0, get: function() {
|
|
4535
4535
|
return b.default;
|
|
4536
4536
|
} });
|
|
@@ -4540,8 +4540,8 @@ const uc = /* @__PURE__ */ Zn(Ws);
|
|
|
4540
4540
|
var Sr = { exports: {} }, Zs = {};
|
|
4541
4541
|
(function(e) {
|
|
4542
4542
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.formatNames = e.fastFormats = e.fullFormats = void 0;
|
|
4543
|
-
function t(
|
|
4544
|
-
return { validate:
|
|
4543
|
+
function t(R, z) {
|
|
4544
|
+
return { validate: R, compare: z };
|
|
4545
4545
|
}
|
|
4546
4546
|
e.fullFormats = {
|
|
4547
4547
|
// date: http://tools.ietf.org/html/rfc3339#section-5.6
|
|
@@ -4576,13 +4576,13 @@ var Sr = { exports: {} }, Zs = {};
|
|
|
4576
4576
|
// byte: https://github.com/miguelmota/is-base64
|
|
4577
4577
|
byte: f,
|
|
4578
4578
|
// signed 32 bit integer
|
|
4579
|
-
int32: { type: "number", validate:
|
|
4579
|
+
int32: { type: "number", validate: S },
|
|
4580
4580
|
// signed 64 bit integer
|
|
4581
4581
|
int64: { type: "number", validate: O },
|
|
4582
4582
|
// C-type float
|
|
4583
|
-
float: { type: "number", validate:
|
|
4583
|
+
float: { type: "number", validate: U },
|
|
4584
4584
|
// C-type double
|
|
4585
|
-
double: { type: "number", validate:
|
|
4585
|
+
double: { type: "number", validate: U },
|
|
4586
4586
|
// hint to the UI to hide input strings
|
|
4587
4587
|
password: !0,
|
|
4588
4588
|
// unchecked string payload
|
|
@@ -4600,72 +4600,72 @@ var Sr = { exports: {} }, Zs = {};
|
|
|
4600
4600
|
// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation')
|
|
4601
4601
|
email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i
|
|
4602
4602
|
}, e.formatNames = Object.keys(e.fullFormats);
|
|
4603
|
-
function n(
|
|
4604
|
-
return
|
|
4603
|
+
function n(R) {
|
|
4604
|
+
return R % 4 === 0 && (R % 100 !== 0 || R % 400 === 0);
|
|
4605
4605
|
}
|
|
4606
4606
|
const r = /^(\d\d\d\d)-(\d\d)-(\d\d)$/, s = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
4607
|
-
function a(
|
|
4608
|
-
const z = r.exec(
|
|
4607
|
+
function a(R) {
|
|
4608
|
+
const z = r.exec(R);
|
|
4609
4609
|
if (!z)
|
|
4610
4610
|
return !1;
|
|
4611
|
-
const
|
|
4612
|
-
return
|
|
4611
|
+
const x = +z[1], T = +z[2], X = +z[3];
|
|
4612
|
+
return T >= 1 && T <= 12 && X >= 1 && X <= (T === 2 && n(x) ? 29 : s[T]);
|
|
4613
4613
|
}
|
|
4614
|
-
function o(
|
|
4615
|
-
if (
|
|
4616
|
-
return
|
|
4614
|
+
function o(R, z) {
|
|
4615
|
+
if (R && z)
|
|
4616
|
+
return R > z ? 1 : R < z ? -1 : 0;
|
|
4617
4617
|
}
|
|
4618
4618
|
const i = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
|
|
4619
|
-
function d(
|
|
4620
|
-
const
|
|
4621
|
-
if (!
|
|
4619
|
+
function d(R, z) {
|
|
4620
|
+
const x = i.exec(R);
|
|
4621
|
+
if (!x)
|
|
4622
4622
|
return !1;
|
|
4623
|
-
const
|
|
4624
|
-
return (
|
|
4623
|
+
const T = +x[1], X = +x[2], re = +x[3], ke = x[5];
|
|
4624
|
+
return (T <= 23 && X <= 59 && re <= 59 || T === 23 && X === 59 && re === 60) && (!z || ke !== "");
|
|
4625
4625
|
}
|
|
4626
|
-
function c(
|
|
4627
|
-
if (!(
|
|
4626
|
+
function c(R, z) {
|
|
4627
|
+
if (!(R && z))
|
|
4628
4628
|
return;
|
|
4629
|
-
const
|
|
4630
|
-
if (
|
|
4631
|
-
return
|
|
4629
|
+
const x = i.exec(R), T = i.exec(z);
|
|
4630
|
+
if (x && T)
|
|
4631
|
+
return R = x[1] + x[2] + x[3] + (x[4] || ""), z = T[1] + T[2] + T[3] + (T[4] || ""), R > z ? 1 : R < z ? -1 : 0;
|
|
4632
4632
|
}
|
|
4633
4633
|
const u = /t|\s/i;
|
|
4634
|
-
function m(
|
|
4635
|
-
const z =
|
|
4634
|
+
function m(R) {
|
|
4635
|
+
const z = R.split(u);
|
|
4636
4636
|
return z.length === 2 && a(z[0]) && d(z[1], !0);
|
|
4637
4637
|
}
|
|
4638
|
-
function b(
|
|
4639
|
-
if (!(
|
|
4638
|
+
function b(R, z) {
|
|
4639
|
+
if (!(R && z))
|
|
4640
4640
|
return;
|
|
4641
|
-
const [
|
|
4642
|
-
if (
|
|
4643
|
-
return
|
|
4641
|
+
const [x, T] = R.split(u), [X, re] = z.split(u), ke = o(x, X);
|
|
4642
|
+
if (ke !== void 0)
|
|
4643
|
+
return ke || c(T, re);
|
|
4644
4644
|
}
|
|
4645
4645
|
const $ = /\/|:/, v = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
4646
|
-
function g(
|
|
4647
|
-
return $.test(
|
|
4646
|
+
function g(R) {
|
|
4647
|
+
return $.test(R) && v.test(R);
|
|
4648
4648
|
}
|
|
4649
4649
|
const p = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
|
|
4650
|
-
function f(
|
|
4651
|
-
return p.lastIndex = 0, p.test(
|
|
4650
|
+
function f(R) {
|
|
4651
|
+
return p.lastIndex = 0, p.test(R);
|
|
4652
4652
|
}
|
|
4653
4653
|
const y = -2147483648, k = 2 ** 31 - 1;
|
|
4654
|
-
function
|
|
4655
|
-
return Number.isInteger(
|
|
4654
|
+
function S(R) {
|
|
4655
|
+
return Number.isInteger(R) && R <= k && R >= y;
|
|
4656
4656
|
}
|
|
4657
|
-
function O(
|
|
4658
|
-
return Number.isInteger(
|
|
4657
|
+
function O(R) {
|
|
4658
|
+
return Number.isInteger(R);
|
|
4659
4659
|
}
|
|
4660
|
-
function
|
|
4660
|
+
function U() {
|
|
4661
4661
|
return !0;
|
|
4662
4662
|
}
|
|
4663
|
-
const
|
|
4664
|
-
function M(
|
|
4665
|
-
if (
|
|
4663
|
+
const G = /[^\\]\\Z/;
|
|
4664
|
+
function M(R) {
|
|
4665
|
+
if (G.test(R))
|
|
4666
4666
|
return !1;
|
|
4667
4667
|
try {
|
|
4668
|
-
return new RegExp(
|
|
4668
|
+
return new RegExp(R), !0;
|
|
4669
4669
|
} catch {
|
|
4670
4670
|
return !1;
|
|
4671
4671
|
}
|
|
@@ -4674,7 +4674,7 @@ var Sr = { exports: {} }, Zs = {};
|
|
|
4674
4674
|
var Ys = {};
|
|
4675
4675
|
(function(e) {
|
|
4676
4676
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.formatLimitDefinition = void 0;
|
|
4677
|
-
const t = Ws, n =
|
|
4677
|
+
const t = Ws, n = K, r = n.operators, s = {
|
|
4678
4678
|
formatMaximum: { okStr: "<=", ok: r.LTE, fail: r.GT },
|
|
4679
4679
|
formatMinimum: { okStr: ">=", ok: r.GTE, fail: r.LT },
|
|
4680
4680
|
formatExclusiveMaximum: { okStr: "<", ok: r.LT, fail: r.GTE },
|
|
@@ -4699,18 +4699,18 @@ var Ys = {};
|
|
|
4699
4699
|
const k = d.scopeValue("formats", {
|
|
4700
4700
|
ref: v.formats,
|
|
4701
4701
|
code: $.code.formats
|
|
4702
|
-
}),
|
|
4703
|
-
i.fail$data(n.or(n._`typeof ${
|
|
4702
|
+
}), S = d.const("fmt", n._`${k}[${g.schemaCode}]`);
|
|
4703
|
+
i.fail$data(n.or(n._`typeof ${S} != "object"`, n._`${S} instanceof RegExp`, n._`typeof ${S}.compare != "function"`, y(S)));
|
|
4704
4704
|
}
|
|
4705
4705
|
function f() {
|
|
4706
|
-
const k = g.schema,
|
|
4707
|
-
if (!
|
|
4706
|
+
const k = g.schema, S = v.formats[k];
|
|
4707
|
+
if (!S || S === !0)
|
|
4708
4708
|
return;
|
|
4709
|
-
if (typeof
|
|
4709
|
+
if (typeof S != "object" || S instanceof RegExp || typeof S.compare != "function")
|
|
4710
4710
|
throw new Error(`"${m}": format "${k}" does not define "compare" function`);
|
|
4711
4711
|
const O = d.scopeValue("formats", {
|
|
4712
4712
|
key: k,
|
|
4713
|
-
ref:
|
|
4713
|
+
ref: S,
|
|
4714
4714
|
code: $.code.formats ? n._`${$.code.formats}${n.getProperty(k)}` : void 0
|
|
4715
4715
|
});
|
|
4716
4716
|
i.fail$data(y(O));
|
|
@@ -4726,7 +4726,7 @@ var Ys = {};
|
|
|
4726
4726
|
})(Ys);
|
|
4727
4727
|
(function(e, t) {
|
|
4728
4728
|
Object.defineProperty(t, "__esModule", { value: !0 });
|
|
4729
|
-
const n = Zs, r = Ys, s =
|
|
4729
|
+
const n = Zs, r = Ys, s = K, a = new s.Name("fullFormats"), o = new s.Name("fastFormats"), i = (c, u = { keywords: !0 }) => {
|
|
4730
4730
|
if (Array.isArray(u))
|
|
4731
4731
|
return d(c, u, n.fullFormats, a), c;
|
|
4732
4732
|
const [m, b] = u.mode === "fast" ? [n.fastFormats, o] : [n.fullFormats, a], $ = u.formats || n.formatNames;
|
|
@@ -4902,10 +4902,10 @@ const Qs = Symbol("quickforms-context");
|
|
|
4902
4902
|
function pc(e) {
|
|
4903
4903
|
ea(Qs, e);
|
|
4904
4904
|
}
|
|
4905
|
-
function
|
|
4905
|
+
function at() {
|
|
4906
4906
|
return ta(Qs, void 0);
|
|
4907
4907
|
}
|
|
4908
|
-
function
|
|
4908
|
+
function we(e) {
|
|
4909
4909
|
return `field-${e.replace(/\./g, "-")}`;
|
|
4910
4910
|
}
|
|
4911
4911
|
function gm(e, t) {
|
|
@@ -4944,22 +4944,22 @@ function gc(e, t) {
|
|
|
4944
4944
|
function Gn(e) {
|
|
4945
4945
|
return typeof e == "boolean" || typeof e == "string" ? e : e && typeof e == "object" && e.valid === !1 ? e.message || "Validation failed" : !0;
|
|
4946
4946
|
}
|
|
4947
|
-
function
|
|
4948
|
-
const r =
|
|
4949
|
-
var
|
|
4947
|
+
function ye(e, t, n = {}) {
|
|
4948
|
+
const r = at(), s = (r == null ? void 0 : r.validationMode) || "ValidateAndShow", a = r == null ? void 0 : r.errorMessages, o = r == null ? void 0 : r.validators, i = r == null ? void 0 : r.validatorDebounce, d = (M, R) => {
|
|
4949
|
+
var x;
|
|
4950
4950
|
const z = t["x-error-messages"];
|
|
4951
|
-
return z != null && z[M] ? z[M] : (
|
|
4951
|
+
return z != null && z[M] ? z[M] : (x = a == null ? void 0 : a[e]) != null && x[M] ? a[e][M] : R;
|
|
4952
4952
|
}, c = () => {
|
|
4953
4953
|
if (typeof i == "number")
|
|
4954
4954
|
return i;
|
|
4955
4955
|
if (i && typeof i == "object")
|
|
4956
4956
|
return i[e];
|
|
4957
4957
|
}, u = (M) => {
|
|
4958
|
-
var
|
|
4958
|
+
var x;
|
|
4959
4959
|
if (s === "NoValidation")
|
|
4960
4960
|
return !0;
|
|
4961
|
-
const
|
|
4962
|
-
if (
|
|
4961
|
+
const R = r == null ? void 0 : r.schema;
|
|
4962
|
+
if (R && Ie.isRequired(R, e) && (M == null || M === ""))
|
|
4963
4963
|
return d(
|
|
4964
4964
|
"required",
|
|
4965
4965
|
`${t.title || e} is required`
|
|
@@ -4992,26 +4992,26 @@ function ve(e, t, n = {}) {
|
|
|
4992
4992
|
}
|
|
4993
4993
|
}
|
|
4994
4994
|
if ((t.type === "number" || t.type === "integer") && M !== "") {
|
|
4995
|
-
const
|
|
4996
|
-
if (isNaN(
|
|
4995
|
+
const T = Number(M);
|
|
4996
|
+
if (isNaN(T))
|
|
4997
4997
|
return d("type", "Must be a valid number");
|
|
4998
|
-
if (t.type === "integer" && !Number.isInteger(
|
|
4998
|
+
if (t.type === "integer" && !Number.isInteger(T))
|
|
4999
4999
|
return d("type", "Must be a whole number");
|
|
5000
|
-
if (t.minimum !== void 0 &&
|
|
5000
|
+
if (t.minimum !== void 0 && T < t.minimum)
|
|
5001
5001
|
return d("minimum", `Must be at least ${t.minimum}`);
|
|
5002
|
-
if (t.maximum !== void 0 &&
|
|
5002
|
+
if (t.maximum !== void 0 && T > t.maximum)
|
|
5003
5003
|
return d("maximum", `Must be at most ${t.maximum}`);
|
|
5004
|
-
if (t.exclusiveMinimum !== void 0 &&
|
|
5004
|
+
if (t.exclusiveMinimum !== void 0 && T <= t.exclusiveMinimum)
|
|
5005
5005
|
return d(
|
|
5006
5006
|
"exclusiveMinimum",
|
|
5007
5007
|
`Must be greater than ${t.exclusiveMinimum}`
|
|
5008
5008
|
);
|
|
5009
|
-
if (t.exclusiveMaximum !== void 0 &&
|
|
5009
|
+
if (t.exclusiveMaximum !== void 0 && T >= t.exclusiveMaximum)
|
|
5010
5010
|
return d(
|
|
5011
5011
|
"exclusiveMaximum",
|
|
5012
5012
|
`Must be less than ${t.exclusiveMaximum}`
|
|
5013
5013
|
);
|
|
5014
|
-
if (t.multipleOf !== void 0 &&
|
|
5014
|
+
if (t.multipleOf !== void 0 && T % t.multipleOf !== 0)
|
|
5015
5015
|
return d(
|
|
5016
5016
|
"multipleOf",
|
|
5017
5017
|
`Must be a multiple of ${t.multipleOf}`
|
|
@@ -5038,10 +5038,10 @@ function ve(e, t, n = {}) {
|
|
|
5038
5038
|
const z = o == null ? void 0 : o[e];
|
|
5039
5039
|
if (z)
|
|
5040
5040
|
try {
|
|
5041
|
-
const
|
|
5042
|
-
return
|
|
5043
|
-
} catch (
|
|
5044
|
-
return console.error("Custom validator error for", e, ":",
|
|
5041
|
+
const T = ((x = r == null ? void 0 : r.formValues) == null ? void 0 : x.call(r)) || {}, X = (r == null ? void 0 : r.context) || {}, re = z(M, T, X);
|
|
5042
|
+
return re instanceof Promise ? re.then(Gn) : Gn(re);
|
|
5043
|
+
} catch (T) {
|
|
5044
|
+
return console.error("Custom validator error for", e, ":", T), "Validation error";
|
|
5045
5045
|
}
|
|
5046
5046
|
return !0;
|
|
5047
5047
|
}, m = c(), b = m && (o != null && o[e]) ? gc(u, m) : u, { value: $, errorMessage: v, errors: g, setValue: p, setTouched: f, meta: y } = da(
|
|
@@ -5053,7 +5053,7 @@ function ve(e, t, n = {}) {
|
|
|
5053
5053
|
validateOnMount: !1
|
|
5054
5054
|
// Note: VeeValidate will still validate, we just control when errors are displayed
|
|
5055
5055
|
}
|
|
5056
|
-
), k =
|
|
5056
|
+
), k = B(() => n.label !== void 0 ? n.label : e === "__root__" ? t.title || "" : t.title || e), S = B(() => {
|
|
5057
5057
|
const M = yc(t);
|
|
5058
5058
|
if (M)
|
|
5059
5059
|
return r != null && r.hintRenderer ? r.hintRenderer(M, {
|
|
@@ -5061,28 +5061,28 @@ function ve(e, t, n = {}) {
|
|
|
5061
5061
|
path: e,
|
|
5062
5062
|
value: $.value
|
|
5063
5063
|
}) : M;
|
|
5064
|
-
}), O =
|
|
5065
|
-
var
|
|
5064
|
+
}), O = B(() => {
|
|
5065
|
+
var R, z;
|
|
5066
5066
|
const M = t["x-hint-mode"];
|
|
5067
|
-
return M || ((z = (
|
|
5068
|
-
}),
|
|
5067
|
+
return M || ((z = (R = r == null ? void 0 : r.componentDefaults) == null ? void 0 : R.hints) == null ? void 0 : z.showMode) || "always";
|
|
5068
|
+
}), U = B(() => {
|
|
5069
5069
|
const M = r == null ? void 0 : r.schema;
|
|
5070
5070
|
return M ? Ie.isRequired(M, e) : !1;
|
|
5071
|
-
}),
|
|
5071
|
+
}), G = B(() => s === "ValidateAndHide" || s === "NoValidation" ? null : v.value);
|
|
5072
5072
|
return {
|
|
5073
5073
|
value: $,
|
|
5074
|
-
errorMessage:
|
|
5074
|
+
errorMessage: G,
|
|
5075
5075
|
errors: g,
|
|
5076
5076
|
setValue: p,
|
|
5077
5077
|
setTouched: f,
|
|
5078
5078
|
meta: y,
|
|
5079
5079
|
label: k,
|
|
5080
|
-
hint:
|
|
5080
|
+
hint: S,
|
|
5081
5081
|
hintMode: O,
|
|
5082
|
-
required:
|
|
5082
|
+
required: U
|
|
5083
5083
|
};
|
|
5084
5084
|
}
|
|
5085
|
-
const bc = /* @__PURE__ */
|
|
5085
|
+
const bc = /* @__PURE__ */ fe({
|
|
5086
5086
|
__name: "StringField",
|
|
5087
5087
|
props: {
|
|
5088
5088
|
schema: { type: Object, required: !0 },
|
|
@@ -5095,16 +5095,16 @@ const bc = /* @__PURE__ */ me({
|
|
|
5095
5095
|
},
|
|
5096
5096
|
setup(e, { expose: t }) {
|
|
5097
5097
|
t();
|
|
5098
|
-
const n = e, r =
|
|
5098
|
+
const n = e, r = at(), s = (r == null ? void 0 : r.validationMode) || "ValidateAndShow", { value: a, errorMessage: o, label: i, hint: d, hintMode: c } = ye(
|
|
5099
5099
|
n.path,
|
|
5100
5100
|
n.schema,
|
|
5101
5101
|
{ label: n.label }
|
|
5102
|
-
), u =
|
|
5102
|
+
), u = we(n.path), m = ae(!1), b = ae(!1), $ = ae(!1), v = B(() => n.schema.format === "password"), g = B(() => n.schema.format === "email" ? "email" : n.schema.format === "url" || n.schema.format === "uri" ? "url" : n.schema.format === "password" ? m.value ? "text" : "password" : "text"), p = B(() => n.schema.format === "textarea" || n.schema.maxLength && n.schema.maxLength > 200), f = () => {
|
|
5103
5103
|
m.value = !m.value;
|
|
5104
|
-
}, y =
|
|
5104
|
+
}, y = B(() => !d.value || o.value ? !1 : c.value === "always" ? !0 : c.value === "focus" ? b.value : c.value === "hover" ? $.value : !0), k = { props: n, formContext: r, validationMode: s, value: a, errorMessage: o, label: i, hint: d, hintMode: c, fieldId: u, showPassword: m, isFocused: b, isHovered: $, isPassword: v, inputType: g, isTextarea: p, togglePasswordVisibility: f, showHint: y };
|
|
5105
5105
|
return Object.defineProperty(k, "__isScriptSetup", { enumerable: !1, value: !0 }), k;
|
|
5106
5106
|
}
|
|
5107
|
-
}),
|
|
5107
|
+
}), me = (e, t) => {
|
|
5108
5108
|
const n = e.__vccOpts || e;
|
|
5109
5109
|
for (const [r, s] of t)
|
|
5110
5110
|
n[r] = s;
|
|
@@ -5144,12 +5144,12 @@ const bc = /* @__PURE__ */ me({
|
|
|
5144
5144
|
function Tc(e, t, n, r, s, a) {
|
|
5145
5145
|
var o, i;
|
|
5146
5146
|
return j(), I("div", $c, [
|
|
5147
|
-
|
|
5147
|
+
D("label", {
|
|
5148
5148
|
for: r.fieldId,
|
|
5149
5149
|
class: "quickform-label"
|
|
5150
5150
|
}, [
|
|
5151
5151
|
je(
|
|
5152
|
-
|
|
5152
|
+
Q(r.label) + " ",
|
|
5153
5153
|
1
|
|
5154
5154
|
/* TEXT */
|
|
5155
5155
|
),
|
|
@@ -5172,9 +5172,9 @@ function Tc(e, t, n, r, s, a) {
|
|
|
5172
5172
|
onMouseenter: t[3] || (t[3] = (d) => r.isHovered = !0),
|
|
5173
5173
|
onMouseleave: t[4] || (t[4] = (d) => r.isHovered = !1)
|
|
5174
5174
|
}, null, 40, Sc)), [
|
|
5175
|
-
[
|
|
5175
|
+
[yt, r.value]
|
|
5176
5176
|
]) : (j(), I("div", Ec, [
|
|
5177
|
-
Oe(
|
|
5177
|
+
Oe(D("input", {
|
|
5178
5178
|
id: r.fieldId,
|
|
5179
5179
|
"onUpdate:modelValue": t[5] || (t[5] = (d) => r.value = d),
|
|
5180
5180
|
type: r.inputType,
|
|
@@ -5202,14 +5202,14 @@ function Tc(e, t, n, r, s, a) {
|
|
|
5202
5202
|
onClick: r.togglePasswordVisibility
|
|
5203
5203
|
}, [
|
|
5204
5204
|
r.showPassword ? (j(), I("svg", jc, [...t[10] || (t[10] = [
|
|
5205
|
-
|
|
5205
|
+
D(
|
|
5206
5206
|
"path",
|
|
5207
5207
|
{ d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" },
|
|
5208
5208
|
null,
|
|
5209
5209
|
-1
|
|
5210
5210
|
/* CACHED */
|
|
5211
5211
|
),
|
|
5212
|
-
|
|
5212
|
+
D(
|
|
5213
5213
|
"line",
|
|
5214
5214
|
{
|
|
5215
5215
|
x1: "1",
|
|
@@ -5222,14 +5222,14 @@ function Tc(e, t, n, r, s, a) {
|
|
|
5222
5222
|
/* CACHED */
|
|
5223
5223
|
)
|
|
5224
5224
|
])])) : (j(), I("svg", qc, [...t[11] || (t[11] = [
|
|
5225
|
-
|
|
5225
|
+
D(
|
|
5226
5226
|
"path",
|
|
5227
5227
|
{ d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" },
|
|
5228
5228
|
null,
|
|
5229
5229
|
-1
|
|
5230
5230
|
/* CACHED */
|
|
5231
5231
|
),
|
|
5232
|
-
|
|
5232
|
+
D(
|
|
5233
5233
|
"circle",
|
|
5234
5234
|
{
|
|
5235
5235
|
cx: "12",
|
|
@@ -5248,18 +5248,18 @@ function Tc(e, t, n, r, s, a) {
|
|
|
5248
5248
|
id: `${r.fieldId}-hint`,
|
|
5249
5249
|
class: "quickform-hint"
|
|
5250
5250
|
}, [
|
|
5251
|
-
|
|
5251
|
+
D("span", { innerHTML: r.hint }, null, 8, Nc)
|
|
5252
5252
|
], 8, Ic)) : V("v-if", !0),
|
|
5253
5253
|
r.errorMessage ? (j(), I(
|
|
5254
5254
|
"div",
|
|
5255
5255
|
Mc,
|
|
5256
|
-
|
|
5256
|
+
Q(r.errorMessage),
|
|
5257
5257
|
1
|
|
5258
5258
|
/* TEXT */
|
|
5259
5259
|
)) : V("v-if", !0)
|
|
5260
5260
|
]);
|
|
5261
5261
|
}
|
|
5262
|
-
const Rc = /* @__PURE__ */
|
|
5262
|
+
const Rc = /* @__PURE__ */ me(bc, [["render", Tc], ["__scopeId", "data-v-ad9ab1f4"], ["__file", "/Users/zachsherbondy/src/github.com/quickforms/packages/vue/src/components/StringField.vue"]]), Ac = /* @__PURE__ */ fe({
|
|
5263
5263
|
__name: "NumberField",
|
|
5264
5264
|
props: {
|
|
5265
5265
|
schema: { type: Object, required: !0 },
|
|
@@ -5272,10 +5272,10 @@ const Rc = /* @__PURE__ */ he(bc, [["render", Tc], ["__scopeId", "data-v-ad9ab1f
|
|
|
5272
5272
|
},
|
|
5273
5273
|
setup(e, { expose: t }) {
|
|
5274
5274
|
t();
|
|
5275
|
-
const n = e, r =
|
|
5275
|
+
const n = e, r = at(), s = (r == null ? void 0 : r.validationMode) || "ValidateAndShow", { value: a, errorMessage: o, label: i, hint: d, hintMode: c } = ye(n.path, n.schema, { label: n.label }), u = we(n.path), m = ae(!1), b = ae(!1), $ = B(() => (n.schema.type === "integer", "number")), v = B(() => n.schema.multipleOf ? n.schema.multipleOf : n.schema.type === "integer" ? 1 : "any"), g = B(() => !d.value || o.value ? !1 : c.value === "always" ? !0 : c.value === "focus" ? m.value : c.value === "hover" ? b.value : !0), p = { props: n, formContext: r, validationMode: s, value: a, errorMessage: o, label: i, hint: d, hintMode: c, fieldId: u, isFocused: m, isHovered: b, inputType: $, step: v, showHint: g };
|
|
5276
5276
|
return Object.defineProperty(p, "__isScriptSetup", { enumerable: !1, value: !0 }), p;
|
|
5277
5277
|
}
|
|
5278
|
-
}),
|
|
5278
|
+
}), Fc = { class: "quickform-field quickform-number-field" }, Dc = ["for"], Cc = {
|
|
5279
5279
|
key: 0,
|
|
5280
5280
|
class: "quickform-required"
|
|
5281
5281
|
}, Vc = ["id", "type", "disabled", "readonly", "placeholder", "min", "max", "step", "aria-describedby", "aria-invalid"], zc = ["id"], Uc = ["innerHTML"], Lc = {
|
|
@@ -5283,19 +5283,19 @@ const Rc = /* @__PURE__ */ he(bc, [["render", Tc], ["__scopeId", "data-v-ad9ab1f
|
|
|
5283
5283
|
class: "quickform-error"
|
|
5284
5284
|
};
|
|
5285
5285
|
function Hc(e, t, n, r, s, a) {
|
|
5286
|
-
return j(), I("div",
|
|
5287
|
-
|
|
5286
|
+
return j(), I("div", Fc, [
|
|
5287
|
+
D("label", {
|
|
5288
5288
|
for: r.fieldId,
|
|
5289
5289
|
class: "quickform-label"
|
|
5290
5290
|
}, [
|
|
5291
5291
|
je(
|
|
5292
|
-
|
|
5292
|
+
Q(r.label) + " ",
|
|
5293
5293
|
1
|
|
5294
5294
|
/* TEXT */
|
|
5295
5295
|
),
|
|
5296
|
-
r.props.schema.required ? (j(), I("span",
|
|
5297
|
-
], 8,
|
|
5298
|
-
Oe(
|
|
5296
|
+
r.props.schema.required ? (j(), I("span", Cc, "*")) : V("v-if", !0)
|
|
5297
|
+
], 8, Dc),
|
|
5298
|
+
Oe(D("input", {
|
|
5299
5299
|
id: r.fieldId,
|
|
5300
5300
|
"onUpdate:modelValue": t[0] || (t[0] = (o) => r.value = o),
|
|
5301
5301
|
type: r.inputType,
|
|
@@ -5325,18 +5325,18 @@ function Hc(e, t, n, r, s, a) {
|
|
|
5325
5325
|
id: `${r.fieldId}-hint`,
|
|
5326
5326
|
class: "quickform-hint"
|
|
5327
5327
|
}, [
|
|
5328
|
-
|
|
5328
|
+
D("span", { innerHTML: r.hint }, null, 8, Uc)
|
|
5329
5329
|
], 8, zc)) : V("v-if", !0),
|
|
5330
5330
|
r.errorMessage ? (j(), I(
|
|
5331
5331
|
"div",
|
|
5332
5332
|
Lc,
|
|
5333
|
-
|
|
5333
|
+
Q(r.errorMessage),
|
|
5334
5334
|
1
|
|
5335
5335
|
/* TEXT */
|
|
5336
5336
|
)) : V("v-if", !0)
|
|
5337
5337
|
]);
|
|
5338
5338
|
}
|
|
5339
|
-
const Kc = /* @__PURE__ */
|
|
5339
|
+
const Kc = /* @__PURE__ */ me(Ac, [["render", Hc], ["__scopeId", "data-v-7def4a8b"], ["__file", "/Users/zachsherbondy/src/github.com/quickforms/packages/vue/src/components/NumberField.vue"]]), Bc = /* @__PURE__ */ fe({
|
|
5340
5340
|
__name: "BooleanField",
|
|
5341
5341
|
props: {
|
|
5342
5342
|
schema: { type: Object, required: !0 },
|
|
@@ -5349,7 +5349,7 @@ const Kc = /* @__PURE__ */ he(Ac, [["render", Hc], ["__scopeId", "data-v-7def4a8
|
|
|
5349
5349
|
},
|
|
5350
5350
|
setup(e, { expose: t }) {
|
|
5351
5351
|
t();
|
|
5352
|
-
const n = e, { value: r, errorMessage: s, label: a, hint: o, hintMode: i } =
|
|
5352
|
+
const n = e, { value: r, errorMessage: s, label: a, hint: o, hintMode: i } = ye(n.path, n.schema, { label: n.label }), d = we(n.path), c = ae(!1), u = ae(!1), m = B(() => !o.value || s.value ? !1 : i.value === "always" ? !0 : i.value === "focus" ? c.value : i.value === "hover" ? u.value : !0), b = { props: n, value: r, errorMessage: s, label: a, hint: o, hintMode: i, fieldId: d, isFocused: c, isHovered: u, showHint: m };
|
|
5353
5353
|
return Object.defineProperty(b, "__isScriptSetup", { enumerable: !1, value: !0 }), b;
|
|
5354
5354
|
}
|
|
5355
5355
|
}), Gc = { class: "quickform-field quickform-boolean-field" }, Jc = ["for"], xc = ["id", "disabled", "readonly", "aria-describedby", "aria-invalid"], Wc = { class: "quickform-checkbox-text" }, Zc = {
|
|
@@ -5361,13 +5361,13 @@ const Kc = /* @__PURE__ */ he(Ac, [["render", Hc], ["__scopeId", "data-v-7def4a8
|
|
|
5361
5361
|
};
|
|
5362
5362
|
function eu(e, t, n, r, s, a) {
|
|
5363
5363
|
return j(), I("div", Gc, [
|
|
5364
|
-
|
|
5364
|
+
D("label", {
|
|
5365
5365
|
for: r.fieldId,
|
|
5366
5366
|
class: "quickform-checkbox-label",
|
|
5367
5367
|
onMouseenter: t[3] || (t[3] = (o) => r.isHovered = !0),
|
|
5368
5368
|
onMouseleave: t[4] || (t[4] = (o) => r.isHovered = !1)
|
|
5369
5369
|
}, [
|
|
5370
|
-
Oe(
|
|
5370
|
+
Oe(D("input", {
|
|
5371
5371
|
id: r.fieldId,
|
|
5372
5372
|
"onUpdate:modelValue": t[0] || (t[0] = (o) => r.value = o),
|
|
5373
5373
|
type: "checkbox",
|
|
@@ -5381,9 +5381,9 @@ function eu(e, t, n, r, s, a) {
|
|
|
5381
5381
|
}, null, 40, xc), [
|
|
5382
5382
|
[ra, r.value]
|
|
5383
5383
|
]),
|
|
5384
|
-
|
|
5384
|
+
D("span", Wc, [
|
|
5385
5385
|
je(
|
|
5386
|
-
|
|
5386
|
+
Q(r.label) + " ",
|
|
5387
5387
|
1
|
|
5388
5388
|
/* TEXT */
|
|
5389
5389
|
),
|
|
@@ -5395,18 +5395,18 @@ function eu(e, t, n, r, s, a) {
|
|
|
5395
5395
|
id: `${r.fieldId}-hint`,
|
|
5396
5396
|
class: "quickform-hint"
|
|
5397
5397
|
}, [
|
|
5398
|
-
|
|
5398
|
+
D("span", { innerHTML: r.hint }, null, 8, Qc)
|
|
5399
5399
|
], 8, Yc)) : V("v-if", !0),
|
|
5400
5400
|
r.errorMessage ? (j(), I(
|
|
5401
5401
|
"div",
|
|
5402
5402
|
Xc,
|
|
5403
|
-
|
|
5403
|
+
Q(r.errorMessage),
|
|
5404
5404
|
1
|
|
5405
5405
|
/* TEXT */
|
|
5406
5406
|
)) : V("v-if", !0)
|
|
5407
5407
|
]);
|
|
5408
5408
|
}
|
|
5409
|
-
const tu = /* @__PURE__ */
|
|
5409
|
+
const tu = /* @__PURE__ */ me(Bc, [["render", eu], ["__scopeId", "data-v-1ff012c7"], ["__file", "/Users/zachsherbondy/src/github.com/quickforms/packages/vue/src/components/BooleanField.vue"]]), ru = /* @__PURE__ */ fe({
|
|
5410
5410
|
__name: "EnumField",
|
|
5411
5411
|
props: {
|
|
5412
5412
|
schema: { type: Object, required: !0 },
|
|
@@ -5419,31 +5419,31 @@ const tu = /* @__PURE__ */ he(Bc, [["render", eu], ["__scopeId", "data-v-1ff012c
|
|
|
5419
5419
|
},
|
|
5420
5420
|
setup(e, { expose: t }) {
|
|
5421
5421
|
t();
|
|
5422
|
-
const n = e, { value: r, errorMessage: s, label: a, hint: o, hintMode: i } =
|
|
5422
|
+
const n = e, { value: r, errorMessage: s, label: a, hint: o, hintMode: i } = ye(
|
|
5423
5423
|
n.path,
|
|
5424
5424
|
n.schema,
|
|
5425
5425
|
{ label: n.label }
|
|
5426
|
-
), d =
|
|
5426
|
+
), d = at(), c = we(n.path), u = `${c}-datalist`, m = ae(!1), b = ae(!1), $ = B(() => {
|
|
5427
5427
|
if (!n.schema.enum) return [];
|
|
5428
5428
|
const y = n.schema["x-enum-labels"];
|
|
5429
5429
|
return n.schema.enum.map((k) => {
|
|
5430
|
-
let
|
|
5431
|
-
return y && k in y && (
|
|
5430
|
+
let S = String(k);
|
|
5431
|
+
return y && k in y && (S = y[k]), {
|
|
5432
5432
|
value: k,
|
|
5433
|
-
label:
|
|
5433
|
+
label: S
|
|
5434
5434
|
};
|
|
5435
5435
|
});
|
|
5436
|
-
}), v =
|
|
5437
|
-
var O,
|
|
5436
|
+
}), v = B(() => {
|
|
5437
|
+
var O, U, G, M;
|
|
5438
5438
|
const y = n.schema["x-component-props"];
|
|
5439
5439
|
if ((y == null ? void 0 : y.autocomplete) !== void 0)
|
|
5440
5440
|
return y.autocomplete;
|
|
5441
|
-
const k = ((
|
|
5442
|
-
return k || $.value.length >=
|
|
5443
|
-
}), g =
|
|
5441
|
+
const k = ((U = (O = d == null ? void 0 : d.componentDefaults) == null ? void 0 : O.select) == null ? void 0 : U.autocomplete) || !1, S = ((M = (G = d == null ? void 0 : d.componentDefaults) == null ? void 0 : G.select) == null ? void 0 : M.autocompleteThreshold) || 5;
|
|
5442
|
+
return k || $.value.length >= S;
|
|
5443
|
+
}), g = B(() => {
|
|
5444
5444
|
var y;
|
|
5445
5445
|
return ((y = d == null ? void 0 : d.labels) == null ? void 0 : y.selectPlaceholder) || "Select an option...";
|
|
5446
|
-
}), p =
|
|
5446
|
+
}), p = B(() => !o.value || s.value ? !1 : i.value === "always" ? !0 : i.value === "focus" ? m.value : i.value === "hover" ? b.value : !0), f = { props: n, value: r, errorMessage: s, label: a, hint: o, hintMode: i, formContext: d, fieldId: c, datalistId: u, isFocused: m, isHovered: b, options: $, useAutocomplete: v, placeholder: g, showHint: p };
|
|
5447
5447
|
return Object.defineProperty(f, "__isScriptSetup", { enumerable: !1, value: !0 }), f;
|
|
5448
5448
|
}
|
|
5449
5449
|
}), nu = { class: "quickform-field quickform-enum-field" }, su = ["for"], au = {
|
|
@@ -5455,12 +5455,12 @@ const tu = /* @__PURE__ */ he(Bc, [["render", eu], ["__scopeId", "data-v-1ff012c
|
|
|
5455
5455
|
};
|
|
5456
5456
|
function hu(e, t, n, r, s, a) {
|
|
5457
5457
|
return j(), I("div", nu, [
|
|
5458
|
-
|
|
5458
|
+
D("label", {
|
|
5459
5459
|
for: r.fieldId,
|
|
5460
5460
|
class: "quickform-label"
|
|
5461
5461
|
}, [
|
|
5462
5462
|
je(
|
|
5463
|
-
|
|
5463
|
+
Q(r.label) + " ",
|
|
5464
5464
|
1
|
|
5465
5465
|
/* TEXT */
|
|
5466
5466
|
),
|
|
@@ -5482,16 +5482,16 @@ function hu(e, t, n, r, s, a) {
|
|
|
5482
5482
|
onMouseenter: t[3] || (t[3] = (o) => r.isHovered = !0),
|
|
5483
5483
|
onMouseleave: t[4] || (t[4] = (o) => r.isHovered = !1)
|
|
5484
5484
|
}, null, 40, ou)), [
|
|
5485
|
-
[
|
|
5485
|
+
[yt, r.value]
|
|
5486
5486
|
]) : V("v-if", !0),
|
|
5487
|
-
|
|
5487
|
+
D("datalist", { id: r.datalistId }, [
|
|
5488
5488
|
(j(!0), I(
|
|
5489
|
-
|
|
5489
|
+
$e,
|
|
5490
5490
|
null,
|
|
5491
|
-
|
|
5491
|
+
He(r.options, (o) => (j(), I("option", {
|
|
5492
5492
|
key: String(o.value),
|
|
5493
5493
|
value: o.value
|
|
5494
|
-
},
|
|
5494
|
+
}, Q(o.label), 9, iu))),
|
|
5495
5495
|
128
|
|
5496
5496
|
/* KEYED_FRAGMENT */
|
|
5497
5497
|
))
|
|
@@ -5510,20 +5510,20 @@ function hu(e, t, n, r, s, a) {
|
|
|
5510
5510
|
onMouseenter: t[8] || (t[8] = (o) => r.isHovered = !0),
|
|
5511
5511
|
onMouseleave: t[9] || (t[9] = (o) => r.isHovered = !1)
|
|
5512
5512
|
}, [
|
|
5513
|
-
|
|
5513
|
+
D(
|
|
5514
5514
|
"option",
|
|
5515
5515
|
du,
|
|
5516
|
-
|
|
5516
|
+
Q(r.placeholder),
|
|
5517
5517
|
1
|
|
5518
5518
|
/* TEXT */
|
|
5519
5519
|
),
|
|
5520
5520
|
(j(!0), I(
|
|
5521
|
-
|
|
5521
|
+
$e,
|
|
5522
5522
|
null,
|
|
5523
|
-
|
|
5523
|
+
He(r.options, (o) => (j(), I("option", {
|
|
5524
5524
|
key: String(o.value),
|
|
5525
5525
|
value: o.value
|
|
5526
|
-
},
|
|
5526
|
+
}, Q(o.label), 9, cu))),
|
|
5527
5527
|
128
|
|
5528
5528
|
/* KEYED_FRAGMENT */
|
|
5529
5529
|
))
|
|
@@ -5535,18 +5535,18 @@ function hu(e, t, n, r, s, a) {
|
|
|
5535
5535
|
id: `${r.fieldId}-hint`,
|
|
5536
5536
|
class: "quickform-hint"
|
|
5537
5537
|
}, [
|
|
5538
|
-
|
|
5538
|
+
D("span", { innerHTML: r.hint }, null, 8, fu)
|
|
5539
5539
|
], 8, uu)) : V("v-if", !0),
|
|
5540
5540
|
r.errorMessage ? (j(), I(
|
|
5541
5541
|
"div",
|
|
5542
5542
|
mu,
|
|
5543
|
-
|
|
5543
|
+
Q(r.errorMessage),
|
|
5544
5544
|
1
|
|
5545
5545
|
/* TEXT */
|
|
5546
5546
|
)) : V("v-if", !0)
|
|
5547
5547
|
]);
|
|
5548
5548
|
}
|
|
5549
|
-
const pu = /* @__PURE__ */
|
|
5549
|
+
const pu = /* @__PURE__ */ me(ru, [["render", hu], ["__scopeId", "data-v-666cc49b"], ["__file", "/Users/zachsherbondy/src/github.com/quickforms/packages/vue/src/components/EnumField.vue"]]), yu = /* @__PURE__ */ fe({
|
|
5550
5550
|
__name: "DateField",
|
|
5551
5551
|
props: {
|
|
5552
5552
|
schema: { type: Object, required: !0 },
|
|
@@ -5559,7 +5559,7 @@ const pu = /* @__PURE__ */ he(ru, [["render", hu], ["__scopeId", "data-v-666cc49
|
|
|
5559
5559
|
},
|
|
5560
5560
|
setup(e, { expose: t }) {
|
|
5561
5561
|
t();
|
|
5562
|
-
const n = e, { value: r, errorMessage: s, label: a, hint: o, hintMode: i } =
|
|
5562
|
+
const n = e, { value: r, errorMessage: s, label: a, hint: o, hintMode: i } = ye(n.path, n.schema, { label: n.label }), d = we(n.path), c = ae(!1), u = ae(!1), m = B(() => n.schema.format === "time" ? "time" : n.schema.format === "date-time" ? "datetime-local" : "date"), b = B(() => !o.value || s.value ? !1 : i.value === "always" ? !0 : i.value === "focus" ? c.value : i.value === "hover" ? u.value : !0), $ = { props: n, value: r, errorMessage: s, label: a, hint: o, hintMode: i, fieldId: d, isFocused: c, isHovered: u, inputType: m, showHint: b };
|
|
5563
5563
|
return Object.defineProperty($, "__isScriptSetup", { enumerable: !1, value: !0 }), $;
|
|
5564
5564
|
}
|
|
5565
5565
|
}), vu = { class: "quickform-field quickform-date-field" }, _u = ["for"], gu = {
|
|
@@ -5571,18 +5571,18 @@ const pu = /* @__PURE__ */ he(ru, [["render", hu], ["__scopeId", "data-v-666cc49
|
|
|
5571
5571
|
};
|
|
5572
5572
|
function Su(e, t, n, r, s, a) {
|
|
5573
5573
|
return j(), I("div", vu, [
|
|
5574
|
-
|
|
5574
|
+
D("label", {
|
|
5575
5575
|
for: r.fieldId,
|
|
5576
5576
|
class: "quickform-label"
|
|
5577
5577
|
}, [
|
|
5578
5578
|
je(
|
|
5579
|
-
|
|
5579
|
+
Q(r.label) + " ",
|
|
5580
5580
|
1
|
|
5581
5581
|
/* TEXT */
|
|
5582
5582
|
),
|
|
5583
5583
|
r.props.schema.required ? (j(), I("span", gu, "*")) : V("v-if", !0)
|
|
5584
5584
|
], 8, _u),
|
|
5585
|
-
Oe(
|
|
5585
|
+
Oe(D("input", {
|
|
5586
5586
|
id: r.fieldId,
|
|
5587
5587
|
"onUpdate:modelValue": t[0] || (t[0] = (o) => r.value = o),
|
|
5588
5588
|
type: r.inputType,
|
|
@@ -5603,18 +5603,18 @@ function Su(e, t, n, r, s, a) {
|
|
|
5603
5603
|
id: `${r.fieldId}-hint`,
|
|
5604
5604
|
class: "quickform-hint"
|
|
5605
5605
|
}, [
|
|
5606
|
-
|
|
5606
|
+
D("span", { innerHTML: r.hint }, null, 8, wu)
|
|
5607
5607
|
], 8, $u)) : V("v-if", !0),
|
|
5608
5608
|
r.errorMessage ? (j(), I(
|
|
5609
5609
|
"div",
|
|
5610
5610
|
ku,
|
|
5611
|
-
|
|
5611
|
+
Q(r.errorMessage),
|
|
5612
5612
|
1
|
|
5613
5613
|
/* TEXT */
|
|
5614
5614
|
)) : V("v-if", !0)
|
|
5615
5615
|
]);
|
|
5616
5616
|
}
|
|
5617
|
-
const Eu = /* @__PURE__ */
|
|
5617
|
+
const Eu = /* @__PURE__ */ me(yu, [["render", Su], ["__scopeId", "data-v-e0ddab64"], ["__file", "/Users/zachsherbondy/src/github.com/quickforms/packages/vue/src/components/DateField.vue"]]), Pu = /* @__PURE__ */ fe({
|
|
5618
5618
|
__name: "FieldRenderer",
|
|
5619
5619
|
props: {
|
|
5620
5620
|
schema: { type: Object, required: !0 },
|
|
@@ -5626,10 +5626,10 @@ const Eu = /* @__PURE__ */ he(yu, [["render", Su], ["__scopeId", "data-v-e0ddab6
|
|
|
5626
5626
|
},
|
|
5627
5627
|
setup(e, { expose: t }) {
|
|
5628
5628
|
t();
|
|
5629
|
-
const n = e, r =
|
|
5629
|
+
const n = e, r = at();
|
|
5630
5630
|
if (!r)
|
|
5631
5631
|
throw new Error("FieldRenderer must be used within a DynamicForm");
|
|
5632
|
-
const s =
|
|
5632
|
+
const s = B(() => {
|
|
5633
5633
|
const d = n.schema;
|
|
5634
5634
|
if (d["x-hidden"] === !0) return !1;
|
|
5635
5635
|
if (d["x-roles"]) {
|
|
@@ -5639,7 +5639,7 @@ const Eu = /* @__PURE__ */ he(yu, [["render", Su], ["__scopeId", "data-v-e0ddab6
|
|
|
5639
5639
|
)) return !1;
|
|
5640
5640
|
}
|
|
5641
5641
|
return !0;
|
|
5642
|
-
}), a =
|
|
5642
|
+
}), a = B(() => {
|
|
5643
5643
|
if (n.readonly || r.readonly) return !0;
|
|
5644
5644
|
const d = n.schema;
|
|
5645
5645
|
if (d["x-readonly"] === !0) return !0;
|
|
@@ -5650,7 +5650,7 @@ const Eu = /* @__PURE__ */ he(yu, [["render", Su], ["__scopeId", "data-v-e0ddab6
|
|
|
5650
5650
|
)) return !0;
|
|
5651
5651
|
}
|
|
5652
5652
|
return !1;
|
|
5653
|
-
}), o =
|
|
5653
|
+
}), o = B(() => {
|
|
5654
5654
|
if (!s.value) return null;
|
|
5655
5655
|
const d = r.registry.getComponent(n.schema, n.uischema);
|
|
5656
5656
|
return d || (console.warn("No renderer found for schema:", n.schema), null);
|
|
@@ -5663,15 +5663,15 @@ const Eu = /* @__PURE__ */ he(yu, [["render", Su], ["__scopeId", "data-v-e0ddab6
|
|
|
5663
5663
|
};
|
|
5664
5664
|
function ju(e, t, n, r, s, a) {
|
|
5665
5665
|
return j(), I(
|
|
5666
|
-
|
|
5666
|
+
$e,
|
|
5667
5667
|
null,
|
|
5668
5668
|
[
|
|
5669
5669
|
V(" Only render if visible "),
|
|
5670
5670
|
r.isVisible ? (j(), I(
|
|
5671
|
-
|
|
5671
|
+
$e,
|
|
5672
5672
|
{ key: 0 },
|
|
5673
5673
|
[
|
|
5674
|
-
r.component ? (j(),
|
|
5674
|
+
r.component ? (j(), vt(sa(r.component), {
|
|
5675
5675
|
key: 0,
|
|
5676
5676
|
schema: n.schema,
|
|
5677
5677
|
uischema: n.uischema,
|
|
@@ -5680,17 +5680,17 @@ function ju(e, t, n, r, s, a) {
|
|
|
5680
5680
|
disabled: n.disabled || r.context.disabled,
|
|
5681
5681
|
readonly: r.isFieldReadonly
|
|
5682
5682
|
}, null, 8, ["schema", "uischema", "path", "label", "disabled", "readonly"])) : (j(), I("div", Ou, [
|
|
5683
|
-
|
|
5683
|
+
D(
|
|
5684
5684
|
"p",
|
|
5685
5685
|
null,
|
|
5686
|
-
"No renderer available for field: " +
|
|
5686
|
+
"No renderer available for field: " + Q(n.path),
|
|
5687
5687
|
1
|
|
5688
5688
|
/* TEXT */
|
|
5689
5689
|
),
|
|
5690
|
-
|
|
5690
|
+
D(
|
|
5691
5691
|
"pre",
|
|
5692
5692
|
null,
|
|
5693
|
-
|
|
5693
|
+
Q(JSON.stringify(n.schema, null, 2)),
|
|
5694
5694
|
1
|
|
5695
5695
|
/* TEXT */
|
|
5696
5696
|
)
|
|
@@ -5704,7 +5704,7 @@ function ju(e, t, n, r, s, a) {
|
|
|
5704
5704
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
5705
5705
|
);
|
|
5706
5706
|
}
|
|
5707
|
-
const
|
|
5707
|
+
const wt = /* @__PURE__ */ me(Pu, [["render", ju], ["__scopeId", "data-v-abf28e2e"], ["__file", "/Users/zachsherbondy/src/github.com/quickforms/packages/vue/src/components/FieldRenderer.vue"]]), qu = /* @__PURE__ */ fe({
|
|
5708
5708
|
__name: "ObjectField",
|
|
5709
5709
|
props: {
|
|
5710
5710
|
schema: { type: Object, required: !0 },
|
|
@@ -5717,11 +5717,11 @@ const kt = /* @__PURE__ */ he(Pu, [["render", ju], ["__scopeId", "data-v-abf28e2
|
|
|
5717
5717
|
},
|
|
5718
5718
|
setup(e, { expose: t }) {
|
|
5719
5719
|
t();
|
|
5720
|
-
const n = e, { label: r, hint: s, errorMessage: a } =
|
|
5720
|
+
const n = e, { label: r, hint: s, errorMessage: a } = ye(n.path, n.schema, { label: n.label }), o = we(n.path), i = B(() => n.schema.properties ? Object.entries(n.schema.properties).map(([c, u]) => ({
|
|
5721
5721
|
key: c,
|
|
5722
5722
|
schema: u,
|
|
5723
5723
|
path: n.path ? `${n.path}.${c}` : c
|
|
5724
|
-
})) : []), d = { props: n, label: r, hint: s, errorMessage: a, fieldId: o, properties: i, FieldRenderer:
|
|
5724
|
+
})) : []), d = { props: n, label: r, hint: s, errorMessage: a, fieldId: o, properties: i, FieldRenderer: wt };
|
|
5725
5725
|
return Object.defineProperty(d, "__isScriptSetup", { enumerable: !1, value: !0 }), d;
|
|
5726
5726
|
}
|
|
5727
5727
|
}), Iu = { class: "quickform-field quickform-object-field" }, Nu = ["id", "aria-describedby"], Mu = {
|
|
@@ -5730,20 +5730,20 @@ const kt = /* @__PURE__ */ he(Pu, [["render", ju], ["__scopeId", "data-v-abf28e2
|
|
|
5730
5730
|
}, Tu = {
|
|
5731
5731
|
key: 0,
|
|
5732
5732
|
class: "quickform-required"
|
|
5733
|
-
}, Ru = ["id"], Au = ["innerHTML"],
|
|
5733
|
+
}, Ru = ["id"], Au = ["innerHTML"], Fu = { class: "quickform-object-content" }, Du = {
|
|
5734
5734
|
key: 2,
|
|
5735
5735
|
class: "quickform-error"
|
|
5736
5736
|
};
|
|
5737
|
-
function
|
|
5737
|
+
function Cu(e, t, n, r, s, a) {
|
|
5738
5738
|
return j(), I("div", Iu, [
|
|
5739
|
-
|
|
5739
|
+
D("fieldset", {
|
|
5740
5740
|
id: r.fieldId,
|
|
5741
5741
|
class: "quickform-fieldset",
|
|
5742
5742
|
"aria-describedby": r.hint ? `${r.fieldId}-hint` : void 0
|
|
5743
5743
|
}, [
|
|
5744
5744
|
r.label ? (j(), I("legend", Mu, [
|
|
5745
5745
|
je(
|
|
5746
|
-
|
|
5746
|
+
Q(r.label) + " ",
|
|
5747
5747
|
1
|
|
5748
5748
|
/* TEXT */
|
|
5749
5749
|
),
|
|
@@ -5754,13 +5754,13 @@ function Du(e, t, n, r, s, a) {
|
|
|
5754
5754
|
id: `${r.fieldId}-hint`,
|
|
5755
5755
|
class: "quickform-hint quickform-object-hint"
|
|
5756
5756
|
}, [
|
|
5757
|
-
|
|
5757
|
+
D("span", { innerHTML: r.hint }, null, 8, Au)
|
|
5758
5758
|
], 8, Ru)) : V("v-if", !0),
|
|
5759
|
-
|
|
5759
|
+
D("div", Fu, [
|
|
5760
5760
|
(j(!0), I(
|
|
5761
|
-
|
|
5761
|
+
$e,
|
|
5762
5762
|
null,
|
|
5763
|
-
|
|
5763
|
+
He(r.properties, (o) => (j(), vt(r.FieldRenderer, {
|
|
5764
5764
|
key: o.key,
|
|
5765
5765
|
schema: o.schema,
|
|
5766
5766
|
path: o.path,
|
|
@@ -5773,15 +5773,15 @@ function Du(e, t, n, r, s, a) {
|
|
|
5773
5773
|
]),
|
|
5774
5774
|
r.errorMessage ? (j(), I(
|
|
5775
5775
|
"div",
|
|
5776
|
-
|
|
5777
|
-
|
|
5776
|
+
Du,
|
|
5777
|
+
Q(r.errorMessage),
|
|
5778
5778
|
1
|
|
5779
5779
|
/* TEXT */
|
|
5780
5780
|
)) : V("v-if", !0)
|
|
5781
5781
|
], 8, Nu)
|
|
5782
5782
|
]);
|
|
5783
5783
|
}
|
|
5784
|
-
const Vu = /* @__PURE__ */
|
|
5784
|
+
const Vu = /* @__PURE__ */ me(qu, [["render", Cu], ["__scopeId", "data-v-8012fc15"], ["__file", "/Users/zachsherbondy/src/github.com/quickforms/packages/vue/src/components/ObjectField.vue"]]), zu = /* @__PURE__ */ fe({
|
|
5785
5785
|
__name: "ArrayField",
|
|
5786
5786
|
props: {
|
|
5787
5787
|
schema: { type: Object, required: !0 },
|
|
@@ -5794,14 +5794,14 @@ const Vu = /* @__PURE__ */ he(qu, [["render", Du], ["__scopeId", "data-v-8012fc1
|
|
|
5794
5794
|
},
|
|
5795
5795
|
setup(e, { expose: t }) {
|
|
5796
5796
|
t();
|
|
5797
|
-
const n = e, { value: r, errorMessage: s, label: a, hint: o } =
|
|
5797
|
+
const n = e, { value: r, errorMessage: s, label: a, hint: o } = ye(
|
|
5798
5798
|
n.path,
|
|
5799
5799
|
n.schema,
|
|
5800
5800
|
{ label: n.label }
|
|
5801
|
-
), i =
|
|
5801
|
+
), i = at(), d = we(n.path), c = B({
|
|
5802
5802
|
get: () => Array.isArray(r.value) ? r.value : [],
|
|
5803
5803
|
set: (y) => r.value = y
|
|
5804
|
-
}), u =
|
|
5804
|
+
}), u = B(() => Array.isArray(n.schema.items) ? n.schema.items[0] : n.schema.items), m = () => {
|
|
5805
5805
|
if (!u.value) return;
|
|
5806
5806
|
const y = Ie.getDefaultValue(u.value);
|
|
5807
5807
|
r.value = [...c.value, y];
|
|
@@ -5810,26 +5810,26 @@ const Vu = /* @__PURE__ */ he(qu, [["render", Du], ["__scopeId", "data-v-8012fc1
|
|
|
5810
5810
|
k.splice(y, 1), r.value = k;
|
|
5811
5811
|
}, $ = (y, k) => {
|
|
5812
5812
|
if (k === "up" && y === 0 || k === "down" && y === c.value.length - 1) return;
|
|
5813
|
-
const
|
|
5814
|
-
|
|
5815
|
-
}, v =
|
|
5813
|
+
const S = [...c.value], O = k === "up" ? y - 1 : y + 1, U = S[y];
|
|
5814
|
+
S[y] = S[O], S[O] = U, r.value = S;
|
|
5815
|
+
}, v = B(() => !(n.disabled || n.readonly || n.schema.maxItems && c.value.length >= n.schema.maxItems)), g = B(() => !(n.disabled || n.readonly || n.schema.minItems && c.value.length <= n.schema.minItems)), f = { props: n, value: r, errorMessage: s, label: a, hint: o, formContext: i, fieldId: d, arrayValue: c, itemsSchema: u, addItem: m, removeItem: b, moveItem: $, canAdd: v, canRemove: g, getItemLabel: (y) => {
|
|
5816
5816
|
var O;
|
|
5817
5817
|
const k = n.schema["x-item-label"];
|
|
5818
5818
|
if (k === "none" || k === !1)
|
|
5819
5819
|
return "";
|
|
5820
5820
|
if (typeof k == "string" && k.includes("{{")) {
|
|
5821
|
-
const
|
|
5822
|
-
if (typeof
|
|
5823
|
-
let
|
|
5824
|
-
if (
|
|
5825
|
-
const
|
|
5826
|
-
return
|
|
5827
|
-
}),
|
|
5828
|
-
return
|
|
5821
|
+
const U = c.value[y];
|
|
5822
|
+
if (typeof U == "object" && U !== null) {
|
|
5823
|
+
let G = k, M = !1;
|
|
5824
|
+
if (G = G.replace(/\{\{([^}]+)\}\}/g, (R, z) => {
|
|
5825
|
+
const x = U[z.trim()];
|
|
5826
|
+
return x != null && x !== "" ? (M = !0, String(x)) : "";
|
|
5827
|
+
}), G = G.replace(/^\s*-\s*/, "").replace(/\s*-\s*$/, ""), M && G.trim())
|
|
5828
|
+
return G.trim();
|
|
5829
5829
|
}
|
|
5830
5830
|
}
|
|
5831
5831
|
return `${((O = u.value) == null ? void 0 : O.title) || "Item"} #${y + 1}`;
|
|
5832
|
-
}, FieldRenderer:
|
|
5832
|
+
}, FieldRenderer: wt };
|
|
5833
5833
|
return Object.defineProperty(f, "__isScriptSetup", { enumerable: !1, value: !0 }), f;
|
|
5834
5834
|
}
|
|
5835
5835
|
}), Uu = { class: "quickform-field quickform-array-field" }, Lu = ["id", "aria-describedby"], Hu = {
|
|
@@ -5847,14 +5847,14 @@ const Vu = /* @__PURE__ */ he(qu, [["render", Du], ["__scopeId", "data-v-8012fc1
|
|
|
5847
5847
|
};
|
|
5848
5848
|
function nf(e, t, n, r, s, a) {
|
|
5849
5849
|
return j(), I("div", Uu, [
|
|
5850
|
-
|
|
5850
|
+
D("fieldset", {
|
|
5851
5851
|
id: r.fieldId,
|
|
5852
5852
|
class: "quickform-fieldset",
|
|
5853
5853
|
"aria-describedby": r.hint ? `${r.fieldId}-hint` : void 0
|
|
5854
5854
|
}, [
|
|
5855
5855
|
r.label ? (j(), I("legend", Hu, [
|
|
5856
5856
|
je(
|
|
5857
|
-
|
|
5857
|
+
Q(r.label) + " ",
|
|
5858
5858
|
1
|
|
5859
5859
|
/* TEXT */
|
|
5860
5860
|
),
|
|
@@ -5865,17 +5865,17 @@ function nf(e, t, n, r, s, a) {
|
|
|
5865
5865
|
id: `${r.fieldId}-hint`,
|
|
5866
5866
|
class: "quickform-hint quickform-array-hint"
|
|
5867
5867
|
}, [
|
|
5868
|
-
|
|
5868
|
+
D("span", { innerHTML: r.hint }, null, 8, Gu)
|
|
5869
5869
|
], 8, Bu)) : V("v-if", !0),
|
|
5870
|
-
|
|
5870
|
+
D("div", Ju, [
|
|
5871
5871
|
(j(!0), I(
|
|
5872
|
-
|
|
5872
|
+
$e,
|
|
5873
5873
|
null,
|
|
5874
|
-
|
|
5874
|
+
He(r.arrayValue, (o, i) => (j(), I("div", {
|
|
5875
5875
|
key: i,
|
|
5876
5876
|
class: "quickform-array-item"
|
|
5877
5877
|
}, [
|
|
5878
|
-
|
|
5878
|
+
D("div", xu, [
|
|
5879
5879
|
xn(r.FieldRenderer, {
|
|
5880
5880
|
schema: r.itemsSchema,
|
|
5881
5881
|
path: `${n.path}[${i}]`,
|
|
@@ -5884,22 +5884,22 @@ function nf(e, t, n, r, s, a) {
|
|
|
5884
5884
|
readonly: n.readonly
|
|
5885
5885
|
}, null, 8, ["schema", "path", "label", "disabled", "readonly"])
|
|
5886
5886
|
]),
|
|
5887
|
-
|
|
5888
|
-
|
|
5887
|
+
D("div", Wu, [
|
|
5888
|
+
D("button", {
|
|
5889
5889
|
type: "button",
|
|
5890
5890
|
class: "quickform-btn-icon",
|
|
5891
5891
|
disabled: i === 0 || n.disabled || n.readonly,
|
|
5892
5892
|
onClick: (d) => r.moveItem(i, "up"),
|
|
5893
5893
|
title: "Move Up"
|
|
5894
5894
|
}, " ↑ ", 8, Zu),
|
|
5895
|
-
|
|
5895
|
+
D("button", {
|
|
5896
5896
|
type: "button",
|
|
5897
5897
|
class: "quickform-btn-icon",
|
|
5898
5898
|
disabled: i === r.arrayValue.length - 1 || n.disabled || n.readonly,
|
|
5899
5899
|
onClick: (d) => r.moveItem(i, "down"),
|
|
5900
5900
|
title: "Move Down"
|
|
5901
5901
|
}, " ↓ ", 8, Yu),
|
|
5902
|
-
|
|
5902
|
+
D("button", {
|
|
5903
5903
|
type: "button",
|
|
5904
5904
|
class: "quickform-btn-icon quickform-btn-danger",
|
|
5905
5905
|
disabled: !r.canRemove,
|
|
@@ -5913,25 +5913,25 @@ function nf(e, t, n, r, s, a) {
|
|
|
5913
5913
|
)),
|
|
5914
5914
|
r.arrayValue.length === 0 ? (j(), I("div", Xu, " No items ")) : V("v-if", !0)
|
|
5915
5915
|
]),
|
|
5916
|
-
|
|
5917
|
-
|
|
5916
|
+
D("div", ef, [
|
|
5917
|
+
D("button", {
|
|
5918
5918
|
type: "button",
|
|
5919
5919
|
class: "quickform-btn quickform-btn-secondary",
|
|
5920
5920
|
disabled: !r.canAdd,
|
|
5921
5921
|
onClick: r.addItem
|
|
5922
|
-
}, " + " +
|
|
5922
|
+
}, " + " + Q(r.formContext.labels.addItem), 9, tf)
|
|
5923
5923
|
]),
|
|
5924
5924
|
r.errorMessage ? (j(), I(
|
|
5925
5925
|
"div",
|
|
5926
5926
|
rf,
|
|
5927
|
-
|
|
5927
|
+
Q(r.errorMessage),
|
|
5928
5928
|
1
|
|
5929
5929
|
/* TEXT */
|
|
5930
5930
|
)) : V("v-if", !0)
|
|
5931
5931
|
], 8, Lu)
|
|
5932
5932
|
]);
|
|
5933
5933
|
}
|
|
5934
|
-
const sf = /* @__PURE__ */
|
|
5934
|
+
const sf = /* @__PURE__ */ me(zu, [["render", nf], ["__scopeId", "data-v-a0783890"], ["__file", "/Users/zachsherbondy/src/github.com/quickforms/packages/vue/src/components/ArrayField.vue"]]), af = /* @__PURE__ */ fe({
|
|
5935
5935
|
__name: "KeyValueField",
|
|
5936
5936
|
props: {
|
|
5937
5937
|
schema: { type: Object, required: !0 },
|
|
@@ -5944,14 +5944,14 @@ const sf = /* @__PURE__ */ he(zu, [["render", nf], ["__scopeId", "data-v-a078389
|
|
|
5944
5944
|
},
|
|
5945
5945
|
setup(e, { expose: t }) {
|
|
5946
5946
|
t();
|
|
5947
|
-
const n = e, { value: r, setValue: s, label: a, hint: o, errorMessage: i, required: d } =
|
|
5947
|
+
const n = e, { value: r, setValue: s, label: a, hint: o, errorMessage: i, required: d } = ye(
|
|
5948
5948
|
n.path,
|
|
5949
5949
|
n.schema,
|
|
5950
5950
|
{ label: n.label }
|
|
5951
|
-
), c =
|
|
5951
|
+
), c = we(n.path);
|
|
5952
5952
|
let u = 0;
|
|
5953
5953
|
const m = ae([]), b = ae(!1);
|
|
5954
|
-
|
|
5954
|
+
Le(
|
|
5955
5955
|
() => r.value,
|
|
5956
5956
|
(p) => {
|
|
5957
5957
|
if (b.value) {
|
|
@@ -5965,7 +5965,7 @@ const sf = /* @__PURE__ */ he(zu, [["render", nf], ["__scopeId", "data-v-a078389
|
|
|
5965
5965
|
})) : m.value.length || (m.value = []);
|
|
5966
5966
|
},
|
|
5967
5967
|
{ immediate: !0 }
|
|
5968
|
-
),
|
|
5968
|
+
), Le(
|
|
5969
5969
|
m,
|
|
5970
5970
|
(p) => {
|
|
5971
5971
|
const f = {};
|
|
@@ -6006,7 +6006,7 @@ function gf(e, t, n, r, s, a) {
|
|
|
6006
6006
|
class: "quickform-label"
|
|
6007
6007
|
}, [
|
|
6008
6008
|
je(
|
|
6009
|
-
|
|
6009
|
+
Q(r.label) + " ",
|
|
6010
6010
|
1
|
|
6011
6011
|
/* TEXT */
|
|
6012
6012
|
),
|
|
@@ -6017,25 +6017,25 @@ function gf(e, t, n, r, s, a) {
|
|
|
6017
6017
|
id: `${r.fieldId}-hint`,
|
|
6018
6018
|
class: "quickform-hint"
|
|
6019
6019
|
}, [
|
|
6020
|
-
|
|
6020
|
+
D("span", { innerHTML: r.hint }, null, 8, uf)
|
|
6021
6021
|
], 8, cf)) : V("v-if", !0),
|
|
6022
|
-
|
|
6022
|
+
D("div", ff, [
|
|
6023
6023
|
r.pairs.length ? (j(), I("div", mf, [...t[0] || (t[0] = [
|
|
6024
|
-
|
|
6024
|
+
D(
|
|
6025
6025
|
"span",
|
|
6026
6026
|
{ class: "quickform-keyvalue-header-cell" },
|
|
6027
6027
|
"Key",
|
|
6028
6028
|
-1
|
|
6029
6029
|
/* CACHED */
|
|
6030
6030
|
),
|
|
6031
|
-
|
|
6031
|
+
D(
|
|
6032
6032
|
"span",
|
|
6033
6033
|
{ class: "quickform-keyvalue-header-cell" },
|
|
6034
6034
|
"Value",
|
|
6035
6035
|
-1
|
|
6036
6036
|
/* CACHED */
|
|
6037
6037
|
),
|
|
6038
|
-
|
|
6038
|
+
D(
|
|
6039
6039
|
"span",
|
|
6040
6040
|
{ class: "quickform-keyvalue-header-cell" },
|
|
6041
6041
|
null,
|
|
@@ -6044,13 +6044,13 @@ function gf(e, t, n, r, s, a) {
|
|
|
6044
6044
|
)
|
|
6045
6045
|
])])) : V("v-if", !0),
|
|
6046
6046
|
(j(!0), I(
|
|
6047
|
-
|
|
6047
|
+
$e,
|
|
6048
6048
|
null,
|
|
6049
|
-
|
|
6049
|
+
He(r.pairs, (o) => (j(), I("div", {
|
|
6050
6050
|
key: o.id,
|
|
6051
6051
|
class: "quickform-keyvalue-row"
|
|
6052
6052
|
}, [
|
|
6053
|
-
Oe(
|
|
6053
|
+
Oe(D("input", {
|
|
6054
6054
|
"onUpdate:modelValue": (i) => o.key = i,
|
|
6055
6055
|
type: "text",
|
|
6056
6056
|
placeholder: "key",
|
|
@@ -6058,9 +6058,9 @@ function gf(e, t, n, r, s, a) {
|
|
|
6058
6058
|
disabled: n.disabled,
|
|
6059
6059
|
readonly: n.readonly
|
|
6060
6060
|
}, null, 8, hf), [
|
|
6061
|
-
[
|
|
6061
|
+
[yt, o.key]
|
|
6062
6062
|
]),
|
|
6063
|
-
Oe(
|
|
6063
|
+
Oe(D("input", {
|
|
6064
6064
|
"onUpdate:modelValue": (i) => o.value = i,
|
|
6065
6065
|
type: "text",
|
|
6066
6066
|
placeholder: "value",
|
|
@@ -6068,9 +6068,9 @@ function gf(e, t, n, r, s, a) {
|
|
|
6068
6068
|
disabled: n.disabled,
|
|
6069
6069
|
readonly: n.readonly
|
|
6070
6070
|
}, null, 8, pf), [
|
|
6071
|
-
[
|
|
6071
|
+
[yt, o.value]
|
|
6072
6072
|
]),
|
|
6073
|
-
|
|
6073
|
+
D("button", {
|
|
6074
6074
|
type: "button",
|
|
6075
6075
|
class: "quickform-button quickform-keyvalue-remove",
|
|
6076
6076
|
disabled: n.disabled || n.readonly,
|
|
@@ -6080,7 +6080,7 @@ function gf(e, t, n, r, s, a) {
|
|
|
6080
6080
|
128
|
|
6081
6081
|
/* KEYED_FRAGMENT */
|
|
6082
6082
|
)),
|
|
6083
|
-
|
|
6083
|
+
D("button", {
|
|
6084
6084
|
type: "button",
|
|
6085
6085
|
class: "quickform-button quickform-keyvalue-add",
|
|
6086
6086
|
disabled: n.disabled || n.readonly,
|
|
@@ -6090,13 +6090,13 @@ function gf(e, t, n, r, s, a) {
|
|
|
6090
6090
|
r.errorMessage ? (j(), I(
|
|
6091
6091
|
"div",
|
|
6092
6092
|
_f,
|
|
6093
|
-
|
|
6093
|
+
Q(r.errorMessage),
|
|
6094
6094
|
1
|
|
6095
6095
|
/* TEXT */
|
|
6096
6096
|
)) : V("v-if", !0)
|
|
6097
6097
|
]);
|
|
6098
6098
|
}
|
|
6099
|
-
const bf = /* @__PURE__ */
|
|
6099
|
+
const bf = /* @__PURE__ */ me(af, [["render", gf], ["__scopeId", "data-v-8e716b7d"], ["__file", "/Users/zachsherbondy/src/github.com/quickforms/packages/vue/src/components/KeyValueField.vue"]]), $f = /* @__PURE__ */ fe({
|
|
6100
6100
|
__name: "JsonField",
|
|
6101
6101
|
props: {
|
|
6102
6102
|
schema: { type: Object, required: !0 },
|
|
@@ -6109,17 +6109,17 @@ const bf = /* @__PURE__ */ he(af, [["render", gf], ["__scopeId", "data-v-8e716b7
|
|
|
6109
6109
|
},
|
|
6110
6110
|
setup(e, { expose: t }) {
|
|
6111
6111
|
t();
|
|
6112
|
-
const n = e, { value: r, setValue: s, label: a, hint: o, errorMessage: i, required: d } =
|
|
6112
|
+
const n = e, { value: r, setValue: s, label: a, hint: o, errorMessage: i, required: d } = ye(
|
|
6113
6113
|
n.path,
|
|
6114
6114
|
n.schema,
|
|
6115
6115
|
{ label: n.label }
|
|
6116
|
-
), c =
|
|
6117
|
-
|
|
6116
|
+
), c = we(n.path), u = B(() => n.schema["x-show-format-hint"] !== !1), m = ae(""), b = ae(null), $ = ae(!1);
|
|
6117
|
+
Le(
|
|
6118
6118
|
() => r.value,
|
|
6119
|
-
(
|
|
6119
|
+
(S) => {
|
|
6120
6120
|
if (!$.value) {
|
|
6121
6121
|
try {
|
|
6122
|
-
m.value = JSON.stringify(
|
|
6122
|
+
m.value = JSON.stringify(S || {}, null, 2), b.value = null;
|
|
6123
6123
|
} catch {
|
|
6124
6124
|
m.value = "{}";
|
|
6125
6125
|
}
|
|
@@ -6128,42 +6128,42 @@ const bf = /* @__PURE__ */ he(af, [["render", gf], ["__scopeId", "data-v-8e716b7
|
|
|
6128
6128
|
},
|
|
6129
6129
|
{ immediate: !0 }
|
|
6130
6130
|
);
|
|
6131
|
-
function v(
|
|
6132
|
-
const O =
|
|
6131
|
+
function v(S) {
|
|
6132
|
+
const O = S.target;
|
|
6133
6133
|
m.value = O.value;
|
|
6134
6134
|
try {
|
|
6135
|
-
const
|
|
6136
|
-
s(
|
|
6137
|
-
} catch (
|
|
6138
|
-
b.value =
|
|
6135
|
+
const U = JSON.parse(m.value);
|
|
6136
|
+
s(U), b.value = null;
|
|
6137
|
+
} catch (U) {
|
|
6138
|
+
b.value = U.message;
|
|
6139
6139
|
}
|
|
6140
6140
|
}
|
|
6141
6141
|
function g() {
|
|
6142
6142
|
try {
|
|
6143
|
-
const
|
|
6144
|
-
m.value = JSON.stringify(
|
|
6143
|
+
const S = JSON.parse(m.value);
|
|
6144
|
+
m.value = JSON.stringify(S, null, 2), b.value = null;
|
|
6145
6145
|
} catch {
|
|
6146
6146
|
}
|
|
6147
6147
|
}
|
|
6148
|
-
function p(
|
|
6149
|
-
const O =
|
|
6150
|
-
if (
|
|
6151
|
-
|
|
6148
|
+
function p(S) {
|
|
6149
|
+
const O = S.target;
|
|
6150
|
+
if (S.ctrlKey && (S.key === " " || S.code === "Space")) {
|
|
6151
|
+
S.preventDefault(), S.stopPropagation(), g();
|
|
6152
6152
|
return;
|
|
6153
6153
|
}
|
|
6154
|
-
if (
|
|
6155
|
-
|
|
6156
|
-
const
|
|
6157
|
-
m.value = m.value.substring(0,
|
|
6158
|
-
O.selectionStart = O.selectionEnd =
|
|
6154
|
+
if (S.key === "Tab") {
|
|
6155
|
+
S.preventDefault(), S.stopPropagation();
|
|
6156
|
+
const U = O.selectionStart, G = O.selectionEnd, M = " ";
|
|
6157
|
+
m.value = m.value.substring(0, U) + M + m.value.substring(G), setTimeout(() => {
|
|
6158
|
+
O.selectionStart = O.selectionEnd = U + M.length;
|
|
6159
6159
|
}, 0);
|
|
6160
6160
|
return;
|
|
6161
6161
|
}
|
|
6162
|
-
(
|
|
6162
|
+
(S.key === "Enter" || S.key === " ") && S.stopPropagation();
|
|
6163
6163
|
}
|
|
6164
|
-
const f =
|
|
6165
|
-
const
|
|
6166
|
-
return
|
|
6164
|
+
const f = B(() => b.value || i.value), y = B(() => {
|
|
6165
|
+
const S = n.schema["x-rows"];
|
|
6166
|
+
return S !== void 0 ? S : 8;
|
|
6167
6167
|
}), k = { props: n, value: r, setValue: s, label: a, hint: o, errorMessage: i, required: d, fieldId: c, showFormatHint: u, jsonText: m, parseError: b, isInitialized: $, handleInput: v, formatJson: g, handleKeyDown: p, displayError: f, rows: y };
|
|
6168
6168
|
return Object.defineProperty(k, "__isScriptSetup", { enumerable: !1, value: !0 }), k;
|
|
6169
6169
|
}
|
|
@@ -6184,12 +6184,12 @@ const bf = /* @__PURE__ */ he(af, [["render", gf], ["__scopeId", "data-v-8e716b7
|
|
|
6184
6184
|
function Nf(e, t, n, r, s, a) {
|
|
6185
6185
|
return j(), I("div", wf, [
|
|
6186
6186
|
r.label ? (j(), I("div", kf, [
|
|
6187
|
-
|
|
6187
|
+
D("label", {
|
|
6188
6188
|
for: r.fieldId,
|
|
6189
6189
|
class: "quickform-label"
|
|
6190
6190
|
}, [
|
|
6191
6191
|
je(
|
|
6192
|
-
|
|
6192
|
+
Q(r.label) + " ",
|
|
6193
6193
|
1
|
|
6194
6194
|
/* TEXT */
|
|
6195
6195
|
),
|
|
@@ -6202,9 +6202,9 @@ function Nf(e, t, n, r, s, a) {
|
|
|
6202
6202
|
id: `${r.fieldId}-hint`,
|
|
6203
6203
|
class: "quickform-hint"
|
|
6204
6204
|
}, [
|
|
6205
|
-
|
|
6205
|
+
D("span", { innerHTML: r.hint }, null, 8, jf)
|
|
6206
6206
|
], 8, Of)) : V("v-if", !0),
|
|
6207
|
-
Oe(
|
|
6207
|
+
Oe(D("textarea", {
|
|
6208
6208
|
id: r.fieldId,
|
|
6209
6209
|
"onUpdate:modelValue": t[0] || (t[0] = (o) => r.jsonText = o),
|
|
6210
6210
|
class: Er(["quickform-textarea quickform-json-editor", { "quickform-error-border": r.displayError }]),
|
|
@@ -6218,18 +6218,18 @@ function Nf(e, t, n, r, s, a) {
|
|
|
6218
6218
|
onInput: r.handleInput,
|
|
6219
6219
|
onKeydown: r.handleKeyDown
|
|
6220
6220
|
}, null, 42, qf), [
|
|
6221
|
-
[
|
|
6221
|
+
[yt, r.jsonText]
|
|
6222
6222
|
]),
|
|
6223
6223
|
r.displayError ? (j(), I(
|
|
6224
6224
|
"div",
|
|
6225
6225
|
If,
|
|
6226
|
-
|
|
6226
|
+
Q(r.displayError),
|
|
6227
6227
|
1
|
|
6228
6228
|
/* TEXT */
|
|
6229
6229
|
)) : V("v-if", !0)
|
|
6230
6230
|
]);
|
|
6231
6231
|
}
|
|
6232
|
-
const Mf = /* @__PURE__ */
|
|
6232
|
+
const Mf = /* @__PURE__ */ me($f, [["render", Nf], ["__scopeId", "data-v-8122fb79"], ["__file", "/Users/zachsherbondy/src/github.com/quickforms/packages/vue/src/components/JsonField.vue"]]), Tf = /* @__PURE__ */ fe({
|
|
6233
6233
|
__name: "OneOfField",
|
|
6234
6234
|
props: {
|
|
6235
6235
|
schema: { type: Object, required: !0 },
|
|
@@ -6242,72 +6242,72 @@ const Mf = /* @__PURE__ */ he($f, [["render", Nf], ["__scopeId", "data-v-8122fb7
|
|
|
6242
6242
|
},
|
|
6243
6243
|
setup(e, { expose: t }) {
|
|
6244
6244
|
t();
|
|
6245
|
-
const n = e, { value: r, label: s, hint: a, errorMessage: o } =
|
|
6245
|
+
const n = e, { value: r, label: s, hint: a, errorMessage: o } = ye(n.path, n.schema, { label: n.label }), i = we(n.path), d = B(() => n.schema.oneOf || n.schema.anyOf || []), c = ae(0);
|
|
6246
6246
|
Or(() => {
|
|
6247
6247
|
if (r.value) {
|
|
6248
6248
|
const v = d.value.findIndex((g) => Ie.validate(g, r.value).valid);
|
|
6249
6249
|
v !== -1 && (c.value = v);
|
|
6250
6250
|
}
|
|
6251
6251
|
});
|
|
6252
|
-
const u =
|
|
6252
|
+
const u = B(() => d.value[c.value]), m = B(() => d.value.map((v, g) => v.title || `Option ${g + 1}`)), $ = { props: n, value: r, label: s, hint: a, errorMessage: o, fieldId: i, options: d, selectedIndex: c, activeSchema: u, optionLabels: m, handleOptionChange: (v) => {
|
|
6253
6253
|
const g = Number(v.target.value);
|
|
6254
6254
|
c.value = g;
|
|
6255
|
-
}, FieldRenderer:
|
|
6255
|
+
}, FieldRenderer: wt };
|
|
6256
6256
|
return Object.defineProperty($, "__isScriptSetup", { enumerable: !1, value: !0 }), $;
|
|
6257
6257
|
}
|
|
6258
|
-
}), Rf = { class: "quickform-field quickform-oneof-field" }, Af = ["id", "aria-describedby"],
|
|
6258
|
+
}), Rf = { class: "quickform-field quickform-oneof-field" }, Af = ["id", "aria-describedby"], Ff = {
|
|
6259
6259
|
key: 0,
|
|
6260
6260
|
class: "quickform-legend"
|
|
6261
|
-
},
|
|
6261
|
+
}, Df = {
|
|
6262
6262
|
key: 0,
|
|
6263
6263
|
class: "quickform-required"
|
|
6264
|
-
},
|
|
6264
|
+
}, Cf = ["id"], Vf = ["innerHTML"], zf = { class: "quickform-oneof-selector" }, Uf = ["value", "disabled"], Lf = ["value"], Hf = { class: "quickform-oneof-content" }, Kf = {
|
|
6265
6265
|
key: 2,
|
|
6266
6266
|
class: "quickform-error"
|
|
6267
6267
|
};
|
|
6268
6268
|
function Bf(e, t, n, r, s, a) {
|
|
6269
6269
|
return j(), I("div", Rf, [
|
|
6270
|
-
|
|
6270
|
+
D("fieldset", {
|
|
6271
6271
|
id: r.fieldId,
|
|
6272
6272
|
class: "quickform-fieldset",
|
|
6273
6273
|
"aria-describedby": r.hint ? `${r.fieldId}-hint` : void 0
|
|
6274
6274
|
}, [
|
|
6275
|
-
r.label ? (j(), I("legend",
|
|
6275
|
+
r.label ? (j(), I("legend", Ff, [
|
|
6276
6276
|
je(
|
|
6277
|
-
|
|
6277
|
+
Q(r.label) + " ",
|
|
6278
6278
|
1
|
|
6279
6279
|
/* TEXT */
|
|
6280
6280
|
),
|
|
6281
|
-
r.props.schema.required ? (j(), I("span",
|
|
6281
|
+
r.props.schema.required ? (j(), I("span", Df, "*")) : V("v-if", !0)
|
|
6282
6282
|
])) : V("v-if", !0),
|
|
6283
6283
|
r.hint ? (j(), I("div", {
|
|
6284
6284
|
key: 1,
|
|
6285
6285
|
id: `${r.fieldId}-hint`,
|
|
6286
6286
|
class: "quickform-hint quickform-oneof-hint"
|
|
6287
6287
|
}, [
|
|
6288
|
-
|
|
6289
|
-
], 8,
|
|
6290
|
-
|
|
6291
|
-
|
|
6288
|
+
D("span", { innerHTML: r.hint }, null, 8, Vf)
|
|
6289
|
+
], 8, Cf)) : V("v-if", !0),
|
|
6290
|
+
D("div", zf, [
|
|
6291
|
+
D("select", {
|
|
6292
6292
|
value: r.selectedIndex,
|
|
6293
6293
|
onChange: r.handleOptionChange,
|
|
6294
6294
|
class: "quickform-select",
|
|
6295
6295
|
disabled: n.disabled || n.readonly
|
|
6296
6296
|
}, [
|
|
6297
6297
|
(j(!0), I(
|
|
6298
|
-
|
|
6298
|
+
$e,
|
|
6299
6299
|
null,
|
|
6300
|
-
|
|
6300
|
+
He(r.optionLabels, (o, i) => (j(), I("option", {
|
|
6301
6301
|
key: i,
|
|
6302
6302
|
value: i
|
|
6303
|
-
},
|
|
6303
|
+
}, Q(o), 9, Lf))),
|
|
6304
6304
|
128
|
|
6305
6305
|
/* KEYED_FRAGMENT */
|
|
6306
6306
|
))
|
|
6307
6307
|
], 40, Uf)
|
|
6308
6308
|
]),
|
|
6309
|
-
|
|
6310
|
-
r.activeSchema ? (j(),
|
|
6309
|
+
D("div", Hf, [
|
|
6310
|
+
r.activeSchema ? (j(), vt(r.FieldRenderer, {
|
|
6311
6311
|
key: 0,
|
|
6312
6312
|
schema: r.activeSchema,
|
|
6313
6313
|
path: n.path,
|
|
@@ -6318,14 +6318,14 @@ function Bf(e, t, n, r, s, a) {
|
|
|
6318
6318
|
r.errorMessage ? (j(), I(
|
|
6319
6319
|
"div",
|
|
6320
6320
|
Kf,
|
|
6321
|
-
|
|
6321
|
+
Q(r.errorMessage),
|
|
6322
6322
|
1
|
|
6323
6323
|
/* TEXT */
|
|
6324
6324
|
)) : V("v-if", !0)
|
|
6325
6325
|
], 8, Af)
|
|
6326
6326
|
]);
|
|
6327
6327
|
}
|
|
6328
|
-
const Jn = /* @__PURE__ */
|
|
6328
|
+
const Jn = /* @__PURE__ */ me(Tf, [["render", Bf], ["__scopeId", "data-v-dab625e6"], ["__file", "/Users/zachsherbondy/src/github.com/quickforms/packages/vue/src/components/OneOfField.vue"]]), Gf = /* @__PURE__ */ fe({
|
|
6329
6329
|
__name: "AllOfField",
|
|
6330
6330
|
props: {
|
|
6331
6331
|
schema: { type: Object, required: !0 },
|
|
@@ -6338,11 +6338,11 @@ const Jn = /* @__PURE__ */ he(Tf, [["render", Bf], ["__scopeId", "data-v-dab625e
|
|
|
6338
6338
|
},
|
|
6339
6339
|
setup(e, { expose: t }) {
|
|
6340
6340
|
t();
|
|
6341
|
-
const n = e, { label: r, hint: s, errorMessage: a } =
|
|
6341
|
+
const n = e, { label: r, hint: s, errorMessage: a } = ye(n.path, n.schema, { label: n.label }), o = we(n.path), i = B(() => {
|
|
6342
6342
|
if (!n.schema.allOf) return n.schema;
|
|
6343
6343
|
const c = { ...n.schema };
|
|
6344
6344
|
return delete c.allOf, Ie.mergeSchemas(c, ...n.schema.allOf);
|
|
6345
|
-
}), d = { props: n, label: r, hint: s, errorMessage: a, fieldId: o, mergedSchema: i, FieldRenderer:
|
|
6345
|
+
}), d = { props: n, label: r, hint: s, errorMessage: a, fieldId: o, mergedSchema: i, FieldRenderer: wt };
|
|
6346
6346
|
return Object.defineProperty(d, "__isScriptSetup", { enumerable: !1, value: !0 }), d;
|
|
6347
6347
|
}
|
|
6348
6348
|
}), Jf = { class: "quickform-field quickform-allof-field" };
|
|
@@ -6358,7 +6358,7 @@ function xf(e, t, n, r, s, a) {
|
|
|
6358
6358
|
}, null, 8, ["schema", "path", "disabled", "readonly", "label"])
|
|
6359
6359
|
]);
|
|
6360
6360
|
}
|
|
6361
|
-
const Wf = /* @__PURE__ */
|
|
6361
|
+
const Wf = /* @__PURE__ */ me(Gf, [["render", xf], ["__scopeId", "data-v-094fd67d"], ["__file", "/Users/zachsherbondy/src/github.com/quickforms/packages/vue/src/components/AllOfField.vue"]]), Zf = /* @__PURE__ */ fe({
|
|
6362
6362
|
__name: "HiddenField",
|
|
6363
6363
|
props: {
|
|
6364
6364
|
schema: { type: Object, required: !0 },
|
|
@@ -6371,7 +6371,7 @@ const Wf = /* @__PURE__ */ he(Gf, [["render", xf], ["__scopeId", "data-v-094fd67
|
|
|
6371
6371
|
},
|
|
6372
6372
|
setup(e, { expose: t }) {
|
|
6373
6373
|
t();
|
|
6374
|
-
const n = e, { value: r } =
|
|
6374
|
+
const n = e, { value: r } = ye(n.path, n.schema, { label: n.label });
|
|
6375
6375
|
Or(() => {
|
|
6376
6376
|
n.schema.const !== void 0 && r.value === void 0 && (r.value = n.schema.const);
|
|
6377
6377
|
});
|
|
@@ -6381,11 +6381,11 @@ const Wf = /* @__PURE__ */ he(Gf, [["render", xf], ["__scopeId", "data-v-094fd67
|
|
|
6381
6381
|
}), Yf = ["value"];
|
|
6382
6382
|
function Qf(e, t, n, r, s, a) {
|
|
6383
6383
|
return j(), I(
|
|
6384
|
-
|
|
6384
|
+
$e,
|
|
6385
6385
|
null,
|
|
6386
6386
|
[
|
|
6387
6387
|
V(" Hidden field - renders nothing visible to the user "),
|
|
6388
|
-
|
|
6388
|
+
D("input", {
|
|
6389
6389
|
type: "hidden",
|
|
6390
6390
|
value: r.value
|
|
6391
6391
|
}, null, 8, Yf)
|
|
@@ -6394,64 +6394,64 @@ function Qf(e, t, n, r, s, a) {
|
|
|
6394
6394
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
6395
6395
|
);
|
|
6396
6396
|
}
|
|
6397
|
-
const Xf = /* @__PURE__ */
|
|
6397
|
+
const Xf = /* @__PURE__ */ me(Zf, [["render", Qf], ["__file", "/Users/zachsherbondy/src/github.com/quickforms/packages/vue/src/components/HiddenField.vue"]]);
|
|
6398
6398
|
function em() {
|
|
6399
6399
|
const e = new ua();
|
|
6400
6400
|
return e.register(
|
|
6401
6401
|
"hidden",
|
|
6402
6402
|
Xf,
|
|
6403
|
-
(t) =>
|
|
6403
|
+
(t) => he(100, _a(t))
|
|
6404
6404
|
), e.register(
|
|
6405
6405
|
"string",
|
|
6406
6406
|
Rc,
|
|
6407
|
-
(t) =>
|
|
6407
|
+
(t) => he(1, tt(t))
|
|
6408
6408
|
), e.register(
|
|
6409
6409
|
"number",
|
|
6410
6410
|
Kc,
|
|
6411
|
-
(t) =>
|
|
6411
|
+
(t) => he(1, fa(t))
|
|
6412
6412
|
), e.register(
|
|
6413
6413
|
"boolean",
|
|
6414
6414
|
tu,
|
|
6415
|
-
(t) =>
|
|
6415
|
+
(t) => he(1, ma(t))
|
|
6416
6416
|
), e.register(
|
|
6417
6417
|
"enum",
|
|
6418
6418
|
pu,
|
|
6419
|
-
(t) =>
|
|
6419
|
+
(t) => he(2, ga(t))
|
|
6420
6420
|
), e.register(
|
|
6421
6421
|
"date",
|
|
6422
6422
|
Eu,
|
|
6423
|
-
(t) =>
|
|
6423
|
+
(t) => he(2, ba(t))
|
|
6424
6424
|
), e.register(
|
|
6425
6425
|
"keyvalue",
|
|
6426
6426
|
bf,
|
|
6427
|
-
(t) =>
|
|
6427
|
+
(t) => he(6, ya(t))
|
|
6428
6428
|
), e.register(
|
|
6429
6429
|
"json",
|
|
6430
6430
|
Mf,
|
|
6431
|
-
(t) =>
|
|
6431
|
+
(t) => he(5, va(t))
|
|
6432
6432
|
), e.register(
|
|
6433
6433
|
"object",
|
|
6434
6434
|
Vu,
|
|
6435
|
-
(t) =>
|
|
6435
|
+
(t) => he(1, ha(t))
|
|
6436
6436
|
), e.register(
|
|
6437
6437
|
"array",
|
|
6438
6438
|
sf,
|
|
6439
|
-
(t) =>
|
|
6439
|
+
(t) => he(1, pa(t))
|
|
6440
6440
|
), e.register(
|
|
6441
6441
|
"oneOf",
|
|
6442
6442
|
Jn,
|
|
6443
|
-
(t) =>
|
|
6443
|
+
(t) => he(10, Wn(t))
|
|
6444
6444
|
), e.register(
|
|
6445
6445
|
"anyOf",
|
|
6446
6446
|
Jn,
|
|
6447
|
-
(t) =>
|
|
6447
|
+
(t) => he(10, $a(t))
|
|
6448
6448
|
), e.register(
|
|
6449
6449
|
"allOf",
|
|
6450
6450
|
Wf,
|
|
6451
|
-
(t) =>
|
|
6451
|
+
(t) => he(10, wa(t))
|
|
6452
6452
|
), e;
|
|
6453
6453
|
}
|
|
6454
|
-
const
|
|
6454
|
+
const We = "__root__", tm = /* @__PURE__ */ fe({
|
|
6455
6455
|
__name: "DynamicForm",
|
|
6456
6456
|
props: /* @__PURE__ */ $n({
|
|
6457
6457
|
schema: { type: Object, required: !0 },
|
|
@@ -6463,10 +6463,10 @@ const Ze = "__root__", tm = /* @__PURE__ */ me({
|
|
|
6463
6463
|
}),
|
|
6464
6464
|
emits: /* @__PURE__ */ $n(["submit", "validation", "ready"], ["update:modelValue"]),
|
|
6465
6465
|
setup(e, { expose: t, emit: n }) {
|
|
6466
|
-
var
|
|
6466
|
+
var M, R, z, x;
|
|
6467
6467
|
t();
|
|
6468
|
-
const r = e, s = aa(e, "modelValue"), a = n, o = r.options.registry || em(), i =
|
|
6469
|
-
[
|
|
6468
|
+
const r = e, s = aa(e, "modelValue"), a = n, o = r.options.registry || em(), i = B(() => r.schema.type === "object" && !r.schema.properties), d = i.value ? {
|
|
6469
|
+
[We]: s.value && typeof s.value == "object" && Object.keys(s.value).length > 0 ? s.value : r.options.useDefaults !== !1 ? Ie.getDefaultValue(r.schema) : {}
|
|
6470
6470
|
} : r.options.useDefaults !== !1 ? { ...Ie.getDefaultValue(r.schema), ...s.value } : { ...s.value }, { handleSubmit: c, values: u, setValues: m, setFieldValue: b, errors: $, meta: v } = ca({
|
|
6471
6471
|
initialValues: d,
|
|
6472
6472
|
validateOnMount: r.options.validateOnMount ?? !1
|
|
@@ -6492,19 +6492,19 @@ const Ze = "__root__", tm = /* @__PURE__ */ me({
|
|
|
6492
6492
|
showMode: "always"
|
|
6493
6493
|
}
|
|
6494
6494
|
}, f = oa({
|
|
6495
|
-
readonly:
|
|
6496
|
-
disabled:
|
|
6495
|
+
readonly: B(() => r.options.readonly || !1),
|
|
6496
|
+
disabled: B(() => r.options.disabled || !1),
|
|
6497
6497
|
schema: r.schema,
|
|
6498
6498
|
// Schema usually doesn't change, but if it does, we might need computed
|
|
6499
6499
|
rootPath: "",
|
|
6500
6500
|
registry: ia(o),
|
|
6501
6501
|
// markRaw prevents Vue from making components reactive
|
|
6502
|
-
context:
|
|
6502
|
+
context: B(() => r.options.context || {}),
|
|
6503
6503
|
validationMode: r.options.validationMode || "ValidateAndShow",
|
|
6504
6504
|
errorMessages: r.options.errorMessages,
|
|
6505
6505
|
validators: r.options.validators,
|
|
6506
6506
|
validatorDebounce: r.options.validatorDebounce,
|
|
6507
|
-
formValues: () => i.value ? wn(u[
|
|
6507
|
+
formValues: () => i.value ? wn(u[We]) : wn(u),
|
|
6508
6508
|
labels: { ...g, ...r.options.labels },
|
|
6509
6509
|
componentDefaults: {
|
|
6510
6510
|
// Start with all custom component defaults from options
|
|
@@ -6512,94 +6512,86 @@ const Ze = "__root__", tm = /* @__PURE__ */ me({
|
|
|
6512
6512
|
// Then merge in the built-in defaults
|
|
6513
6513
|
select: {
|
|
6514
6514
|
...p.select,
|
|
6515
|
-
...(
|
|
6515
|
+
...(M = r.options.componentDefaults) == null ? void 0 : M.select
|
|
6516
6516
|
},
|
|
6517
6517
|
array: {
|
|
6518
6518
|
...p.array,
|
|
6519
|
-
...(
|
|
6519
|
+
...(R = r.options.componentDefaults) == null ? void 0 : R.array
|
|
6520
6520
|
},
|
|
6521
6521
|
number: {
|
|
6522
6522
|
...p.number,
|
|
6523
|
-
...(
|
|
6523
|
+
...(z = r.options.componentDefaults) == null ? void 0 : z.number
|
|
6524
6524
|
},
|
|
6525
6525
|
hints: {
|
|
6526
6526
|
...p.hints,
|
|
6527
|
-
...(
|
|
6527
|
+
...(x = r.options.componentDefaults) == null ? void 0 : x.hints
|
|
6528
6528
|
}
|
|
6529
6529
|
},
|
|
6530
6530
|
quickformsDefaults: r.options.quickformsDefaults || {},
|
|
6531
6531
|
hintRenderer: r.options.hintRenderer
|
|
6532
6532
|
});
|
|
6533
6533
|
pc(f);
|
|
6534
|
-
const y = ae(!1)
|
|
6535
|
-
|
|
6534
|
+
const y = ae(!1);
|
|
6535
|
+
Or(() => {
|
|
6536
6536
|
Et(() => {
|
|
6537
|
-
y.value
|
|
6537
|
+
y.value = !0, a("ready");
|
|
6538
6538
|
});
|
|
6539
|
-
}
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
}
|
|
6547
|
-
);
|
|
6548
|
-
let O = !1, F = !1;
|
|
6549
|
-
Ce(s, (K) => {
|
|
6550
|
-
if (!F) {
|
|
6551
|
-
if (O = !0, i.value) {
|
|
6552
|
-
const ne = K && typeof K == "object" && Object.keys(K).length > 0 ? K : r.options.useDefaults !== !1 ? Ie.getDefaultValue(r.schema) : {};
|
|
6553
|
-
b(Ze, ne);
|
|
6539
|
+
});
|
|
6540
|
+
let k = !1, S = !1;
|
|
6541
|
+
Le(s, (T) => {
|
|
6542
|
+
if (!S) {
|
|
6543
|
+
if (k = !0, i.value) {
|
|
6544
|
+
const X = T && typeof T == "object" && Object.keys(T).length > 0 ? T : r.options.useDefaults !== !1 ? Ie.getDefaultValue(r.schema) : {};
|
|
6545
|
+
b(We, X);
|
|
6554
6546
|
} else
|
|
6555
|
-
|
|
6547
|
+
T && m(T);
|
|
6556
6548
|
Et(() => {
|
|
6557
|
-
|
|
6549
|
+
k = !1;
|
|
6558
6550
|
});
|
|
6559
6551
|
}
|
|
6560
|
-
}), i.value ?
|
|
6561
|
-
() => u[
|
|
6562
|
-
(
|
|
6563
|
-
|
|
6564
|
-
|
|
6552
|
+
}), i.value ? Le(
|
|
6553
|
+
() => u[We],
|
|
6554
|
+
(T) => {
|
|
6555
|
+
k || (S = !0, s.value = T, Et(() => {
|
|
6556
|
+
S = !1;
|
|
6565
6557
|
}));
|
|
6566
6558
|
},
|
|
6567
6559
|
{ deep: !0 }
|
|
6568
|
-
) :
|
|
6560
|
+
) : Le(
|
|
6569
6561
|
u,
|
|
6570
|
-
(
|
|
6571
|
-
|
|
6572
|
-
|
|
6562
|
+
(T) => {
|
|
6563
|
+
k || (S = !0, s.value = T, Et(() => {
|
|
6564
|
+
S = !1;
|
|
6573
6565
|
}));
|
|
6574
6566
|
},
|
|
6575
6567
|
{ deep: !0 }
|
|
6576
|
-
),
|
|
6568
|
+
), Le(
|
|
6577
6569
|
[$, v],
|
|
6578
|
-
([
|
|
6570
|
+
([T, X]) => {
|
|
6579
6571
|
a("validation", {
|
|
6580
|
-
valid:
|
|
6581
|
-
errors:
|
|
6572
|
+
valid: X.valid,
|
|
6573
|
+
errors: T
|
|
6582
6574
|
});
|
|
6583
6575
|
},
|
|
6584
6576
|
{ immediate: !0 }
|
|
6585
6577
|
);
|
|
6586
|
-
const
|
|
6587
|
-
const
|
|
6588
|
-
|
|
6589
|
-
}),
|
|
6590
|
-
key:
|
|
6591
|
-
schema:
|
|
6592
|
-
path:
|
|
6593
|
-
}))),
|
|
6594
|
-
return
|
|
6595
|
-
}, set isUpdatingFromModel(
|
|
6596
|
-
|
|
6578
|
+
const O = c((T) => {
|
|
6579
|
+
const X = i.value ? T[We] : T, re = Ie.validate(r.schema, X);
|
|
6580
|
+
re.valid ? a("submit", X) : console.error("Form validation failed:", re.errors);
|
|
6581
|
+
}), U = B(() => r.schema.type !== "object" || !r.schema.properties ? [] : Object.entries(r.schema.properties).map(([T, X]) => ({
|
|
6582
|
+
key: T,
|
|
6583
|
+
schema: X,
|
|
6584
|
+
path: T
|
|
6585
|
+
}))), G = { props: r, model: s, emit: a, registry: o, SINGLE_FIELD_PATH: We, isSingleField: i, initialValues: d, handleSubmit: c, values: u, setValues: m, setFieldValue: b, errors: $, meta: v, defaultLabels: g, defaultComponentDefaults: p, formContext: f, isReady: y, get isUpdatingFromModel() {
|
|
6586
|
+
return k;
|
|
6587
|
+
}, set isUpdatingFromModel(T) {
|
|
6588
|
+
k = T;
|
|
6597
6589
|
}, get isUpdatingModel() {
|
|
6598
|
-
return
|
|
6599
|
-
}, set isUpdatingModel(
|
|
6600
|
-
|
|
6601
|
-
}, onSubmit:
|
|
6602
|
-
return Object.defineProperty(
|
|
6590
|
+
return S;
|
|
6591
|
+
}, set isUpdatingModel(T) {
|
|
6592
|
+
S = T;
|
|
6593
|
+
}, onSubmit: O, properties: U, FieldRenderer: wt };
|
|
6594
|
+
return Object.defineProperty(G, "__isScriptSetup", { enumerable: !1, value: !0 }), G;
|
|
6603
6595
|
}
|
|
6604
6596
|
}), rm = {
|
|
6605
6597
|
key: 0,
|
|
@@ -6616,11 +6608,11 @@ function nm(e, t, n, r, s, a) {
|
|
|
6616
6608
|
V(" Loading overlay (shown until form is ready) "),
|
|
6617
6609
|
n.showLoadingOverlay && !r.isReady ? (j(), I("div", rm, [
|
|
6618
6610
|
la(e.$slots, "loading", {}, () => [
|
|
6619
|
-
t[1] || (t[1] =
|
|
6611
|
+
t[1] || (t[1] = D(
|
|
6620
6612
|
"div",
|
|
6621
6613
|
{ class: "quickform-loading-default" },
|
|
6622
6614
|
[
|
|
6623
|
-
|
|
6615
|
+
D("div", { class: "quickform-spinner" })
|
|
6624
6616
|
],
|
|
6625
6617
|
-1
|
|
6626
6618
|
/* CACHED */
|
|
@@ -6628,29 +6620,28 @@ function nm(e, t, n, r, s, a) {
|
|
|
6628
6620
|
], !0)
|
|
6629
6621
|
])) : V("v-if", !0),
|
|
6630
6622
|
V(" Form content (always rendered, but hidden until ready if overlay is enabled) "),
|
|
6631
|
-
|
|
6623
|
+
D(
|
|
6632
6624
|
"div",
|
|
6633
6625
|
{
|
|
6634
|
-
ref: "formContentRef",
|
|
6635
6626
|
class: Er(["quickform-content", { "quickform-content-hidden": n.showLoadingOverlay && !r.isReady }])
|
|
6636
6627
|
},
|
|
6637
6628
|
[
|
|
6638
6629
|
V(" Single field schema (e.g., JSON editor, single object field) "),
|
|
6639
|
-
r.isSingleField ? (j(),
|
|
6630
|
+
r.isSingleField ? (j(), vt(r.FieldRenderer, {
|
|
6640
6631
|
key: 0,
|
|
6641
6632
|
schema: n.schema,
|
|
6642
6633
|
path: r.SINGLE_FIELD_PATH,
|
|
6643
6634
|
disabled: n.options.disabled,
|
|
6644
6635
|
readonly: n.options.readonly
|
|
6645
6636
|
}, null, 8, ["schema", "disabled", "readonly"])) : (j(), I(
|
|
6646
|
-
|
|
6637
|
+
$e,
|
|
6647
6638
|
{ key: 1 },
|
|
6648
6639
|
[
|
|
6649
6640
|
V(" Multiple fields (normal form) "),
|
|
6650
6641
|
(j(!0), I(
|
|
6651
|
-
|
|
6642
|
+
$e,
|
|
6652
6643
|
null,
|
|
6653
|
-
|
|
6644
|
+
He(r.properties, (o) => (j(), vt(r.FieldRenderer, {
|
|
6654
6645
|
key: o.key,
|
|
6655
6646
|
schema: o.schema,
|
|
6656
6647
|
path: o.path,
|
|
@@ -6673,7 +6664,7 @@ function nm(e, t, n, r, s, a) {
|
|
|
6673
6664
|
/* NEED_HYDRATION */
|
|
6674
6665
|
);
|
|
6675
6666
|
}
|
|
6676
|
-
const wm = /* @__PURE__ */
|
|
6667
|
+
const wm = /* @__PURE__ */ me(tm, [["render", nm], ["__scopeId", "data-v-cb85e2c1"], ["__file", "/Users/zachsherbondy/src/github.com/quickforms/packages/vue/src/components/DynamicForm.vue"]]);
|
|
6677
6668
|
export {
|
|
6678
6669
|
Wf as AllOfField,
|
|
6679
6670
|
sf as ArrayField,
|
|
@@ -6682,7 +6673,7 @@ export {
|
|
|
6682
6673
|
Eu as DateField,
|
|
6683
6674
|
wm as DynamicForm,
|
|
6684
6675
|
pu as EnumField,
|
|
6685
|
-
|
|
6676
|
+
wt as FieldRenderer,
|
|
6686
6677
|
Xf as HiddenField,
|
|
6687
6678
|
Mf as JsonField,
|
|
6688
6679
|
bf as KeyValueField,
|
|
@@ -6693,7 +6684,7 @@ export {
|
|
|
6693
6684
|
Rc as StringField,
|
|
6694
6685
|
ym as and,
|
|
6695
6686
|
em as createDefaultRegistry,
|
|
6696
|
-
|
|
6687
|
+
we as generateFieldId,
|
|
6697
6688
|
yc as getHint,
|
|
6698
6689
|
gm as getLabel,
|
|
6699
6690
|
wa as hasAllOf,
|
|
@@ -6717,14 +6708,14 @@ export {
|
|
|
6717
6708
|
fa as isNumberType,
|
|
6718
6709
|
ha as isObjectType,
|
|
6719
6710
|
ya as isRecordType,
|
|
6720
|
-
|
|
6711
|
+
tt as isStringType,
|
|
6721
6712
|
cm as isTimeFormat,
|
|
6722
6713
|
fm as isUrlFormat,
|
|
6723
6714
|
$m as joinPath,
|
|
6724
6715
|
_m as not,
|
|
6725
6716
|
vm as or,
|
|
6726
6717
|
pc as provideFormContext,
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
|
|
6718
|
+
he as rankWith,
|
|
6719
|
+
at as useFormContext,
|
|
6720
|
+
ye as useFormField
|
|
6730
6721
|
};
|